diff --git a/.gitignore b/.gitignore index c7cc0a48e..cf1e6b9b9 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,8 @@ build*/ CMakeUserPresets.json *~*.TMP +.DS_Store + .idea/* .vs/* .vscode/* diff --git a/README.md b/README.md index 63c4e58fa..6ebdc4456 100644 --- a/README.md +++ b/README.md @@ -55,13 +55,21 @@ We have made available to the medical simulation community a large set of burn i ## Release Notes -### 8.0.0 (November 2024) +### 8.2.0 (January 2025) +- Marshall / UnMarshall code migrated from Load/UnLoad functions to private API +- Additioanl Unit Test for all Seralization code +- Equality operators +- Refactored SEScalarTypes +- Added Enums for all CDM Enums +- Seperated SESubstance between Definition and State +- ~~~~ +### 8.0.0 - Modified Scenario CDM to require Tag around individual actions - Allowed import of external ActionList and DataRequestList - Updated CMAKE to minimum 3.20 - Improved various features -### 7.6.0 (December 2023) +### 7.6.0 - Improved SWIG bindings - Improved Various Models @@ -92,12 +100,10 @@ We support the [contributor covenant](https://github.com/BioGearsEngine/Engine/b Contributing ------------- -Details will be filled in shortly. In the meantime, if you have a contribution or issue to post/push feel free to contact abaird@ara.com with the details. +Details will be filled in shortly. In the meantime, if you have a contribution or issue to post/push feel free to contact biogears@ara.com with the details. You can access our public Slack through our [development website](https://www.biogears.dev/). Additional Documentation -------------------------- For more detailed documentation including model discussions and implementation details can be found at www.BioGearsEngine.com - - diff --git a/cmake/cmake-common_logic.cmake b/cmake/cmake-common_logic.cmake index 767f68e22..0110a5992 100644 --- a/cmake/cmake-common_logic.cmake +++ b/cmake/cmake-common_logic.cmake @@ -32,14 +32,14 @@ set_property(GLOBAL PROPERTY AUTOGEN_SOURCE_GROUP "Generated") #### function(verify_package package) cmake_parse_arguments(_l - REQUIRED + "REQUIRED;QUIET" "" "" ${ARGN}) find_package(${package} CONFIG ${_l_UNPARSED_ARGUMENTS} QUIET) if(NOT ${package}_FOUND) find_package(${package} ${_l_UNPARSED_ARGUMENTS} QUIET) - if(NOT ${package}_FOUND) + if(NOT ${package}_FOUND AND NOT _l_QUIET) message(WARNING "The following packages ${package} were not found." "For native compilations setting CMAKE_PREFIX_PATH can solve this problem" "For cross complilation try expanding your CMAKE_FIND_ROOT_PATH" diff --git a/projects/CMakeLists.txt b/projects/CMakeLists.txt index b46418bef..566c5ad53 100644 --- a/projects/CMakeLists.txt +++ b/projects/CMakeLists.txt @@ -143,7 +143,11 @@ STRING(APPEND VS_DEBUGGER_ENV_PATH "%PATH%") LIST(APPEND VS_DEBUGGER_ENVIRONMENT_LIST "${VS_DEBUGGER_ENV_PATH}") message(STATUS "VS_DEBUGGER_ENVIRONMENT_LIST=${VS_DEBUGGER_ENVIRONMENT_LIST}") -# add_subdirectory(unit) + + +add_subdirectory(unit) + + add_subdirectory(biogears-common) add_subdirectory(biogears) add_subdirectory(test_driver) diff --git a/projects/biogears-common/include/biogears/framework/result.tci.h b/projects/biogears-common/include/biogears/framework/result.tci.h index d92fd9013..e069d76d3 100644 --- a/projects/biogears-common/include/biogears/framework/result.tci.h +++ b/projects/biogears-common/include/biogears/framework/result.tci.h @@ -306,7 +306,7 @@ T Result::unwrap() { static_assert(!std::is_same::value, "Result and Error can not be the same type."); assert(is_ok()); return dump_ok(); -}; +}; template E Result::unwrap_err() { diff --git a/projects/biogears-common/src/math/angles.cpp b/projects/biogears-common/src/math/angles.cpp index 96423e909..f9d1da09b 100644 --- a/projects/biogears-common/src/math/angles.cpp +++ b/projects/biogears-common/src/math/angles.cpp @@ -133,7 +133,7 @@ static_assert(Anglef(1.f) + Anglef(2.f) == 3.f, ""); static_assert(0.f + 1.0_f_i + 2.0_f_j + 3.0_f_k == Quaternionf(0.f, 1.f, 2.f, 3.f), ""); static_assert(Quaternionf(1.f, 2.f, 3.f, 4.f).real() + Quaternionf(1.f, 2.f, 3.f, 4.f).pure() == Quaternionf(1.f, 2.f, 3.f, 4.f), ""); static_assert((Quaternionf(1.f, 1.f, 1.f, 1.f) * Quaternionf(1.f, 1.f, 1.f, 1.f).conj()).w() == 4.0f, ""); -#endif() +#endif //------------------------------------------------------------------------------ auto azimuth_uncert_from_quat(const Quaternionf& q diff --git a/projects/biogears-common/unit/test_common_OwningMutex.cpp b/projects/biogears-common/unit/test_common_OwningMutex.cpp index 109ff4781..7e1f27995 100644 --- a/projects/biogears-common/unit/test_common_OwningMutex.cpp +++ b/projects/biogears-common/unit/test_common_OwningMutex.cpp @@ -17,6 +17,7 @@ //! Unit Test for Biogears-common Config //! #include +#include #include diff --git a/projects/biogears/CMakeLists.txt b/projects/biogears/CMakeLists.txt index 231046e73..d24e60615 100644 --- a/projects/biogears/CMakeLists.txt +++ b/projects/biogears/CMakeLists.txt @@ -53,13 +53,17 @@ file(GLOB_RECURSE biogears_xsd_list "${PROJECT_SOURCE_DIR}/share/xsd/biogears/*. file(GLOB_RECURSE cdm_xsd_list "${PROJECT_SOURCE_DIR}/share/xsd/cdm/*.xsd") set (BIOGEARS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) -set (BIOGEARS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/generated/$) -set (BIOGEARS_BINARY_BARE_DIR ${CMAKE_CURRENT_BINARY_DIR}/generated/) - +if (NOT APPLE) + set (GENERATED_PREFIX generated/$) +else() + set (GENERATED_PREFIX generated/) +endif() +set (BIOGEARS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${GENERATED_PREFIX}) +set (BIOGEARS_BINARY_BARE_DIR ${CMAKE_CURRENT_BINARY_DIR}/${GENERATED_PREFIX}) REGISTER_XSD_DIR( "${PROJECT_SOURCE_DIR}/share/xsd/" CONFIG "${PROJECT_SOURCE_DIR}/share/xsd/BioGearsDataModel.cfg" - PROJECT "generated/$/biogears" COMPONENT "schema" RESOURCE_FOLDER "resources/schema" + PROJECT "${GENERATED_PREFIX}/biogears" COMPONENT "schema" RESOURCE_FOLDER "resources/schema" NO_TARGETS SOURCES_VAR XSD_SRCS HEADERS_VAR XSD_HDRS VERBOSITY 1) diff --git a/projects/biogears/libBiogears/CMakeLists.txt b/projects/biogears/libBiogears/CMakeLists.txt index 5f97e4ebc..af6aa534d 100644 --- a/projects/biogears/libBiogears/CMakeLists.txt +++ b/projects/biogears/libBiogears/CMakeLists.txt @@ -5,7 +5,7 @@ message(STATUS " Configuring libbiogears") file(READ ${CMAKE_CURRENT_SOURCE_DIR}/include/biogears/config.h.in contents) string(CONFIGURE "${contents}" contents @ONLY) -FILE(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/../generated/$/biogears/config.h +FILE(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/../${GENERATED_PREFIX}/biogears/config.h CONTENT "${contents}" NEWLINE_STYLE LF) @@ -62,7 +62,7 @@ if(Biogears_BUILD_STATIC) if(biogears_USE_OVERRIDE_CONTROL) target_compile_definitions( libbiogears PRIVATE BIOGEARS_USE_OVERRIDE_CONTROL) endif() - if(UNITTEST_biogears-core) + if(Biogears_BUILD_TEST) target_compile_definitions( libbiogears PUBLIC ENABLE_UNIT_TEST_API) endif() if(WIN32) @@ -139,7 +139,7 @@ else() CXX_STANDARD 20 ) set_target_properties(libbiogears PROPERTIES SOVERSION "${Biogears_LIB_VERSION}") - if(UNITTEST_biogears-core) + if(Biogears_BUILD_TEST) target_compile_definitions( libbiogears PUBLIC ENABLE_UNIT_TEST_API) endif() ############################################################################### diff --git a/projects/biogears/libBiogears/include/biogears/BiogearsEnums.h b/projects/biogears/libBiogears/include/biogears/BiogearsEnums.h new file mode 100644 index 000000000..591981333 --- /dev/null +++ b/projects/biogears/libBiogears/include/biogears/BiogearsEnums.h @@ -0,0 +1,30 @@ +/************************************************************************************** +Copyright 2019 Applied Research Associates, Inc. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the License +at: +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +**************************************************************************************/ + +#pragma once + +#include + +#include "cdm/enums/SEActionEnums.h" +#include "cdm/enums/SEAnesthesiaEnums.h" +#include "cdm/enums/SECircuitEnums.h" +#include "cdm/enums/SECompartmentEnums.h" +#include "cdm/enums/SEEnvironmentEnums.h" +#include "cdm/enums/SEPatientActionsEnums.h" +#include "cdm/enums/SEPatientAssessmentEnums.h" +#include "cdm/enums/SEPatientEnums.h" +#include "cdm/enums/SEPhysiologyEnums.h" +#include "cdm/enums/SEPropertyEnums.h" +#include "cdm/enums/SESubstanceEnums.h" + +#include "engine/Controller/BioGearsEnums.h" + diff --git a/projects/biogears/libBiogears/include/biogears/cdm/CommonDataModel.h b/projects/biogears/libBiogears/include/biogears/cdm/CommonDataModel.h index d646199ce..c9caa2a86 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/CommonDataModel.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/CommonDataModel.h @@ -26,17 +26,7 @@ namespace tatrc { } } } -//using namespace mil::tatrc::phsyiology::datamodel; -#define CDM_BIND_DECL(type) \ - namespace mil { \ - namespace tatrc { \ - namespace physiology { \ - namespace datamodel { \ - class type; \ - } \ - } \ - } \ - } + namespace CDM = mil::tatrc::physiology::datamodel; #include @@ -47,8 +37,8 @@ namespace CDM = mil::tatrc::physiology::datamodel; #include namespace biogears { -#pragma warning(disable: 4251) #pragma warning(push,0) +#pragma warning(disable: 4251) #pragma warning(disable: 4275) struct BIOGEARS_API CommonDataModelException : public std::runtime_error { CommonDataModelException(); @@ -60,4 +50,5 @@ struct BIOGEARS_API CommonDataModelException : public std::runtime_error { } // Basics #include +#include #include \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/Macros.h b/projects/biogears/libBiogears/include/biogears/cdm/Macros.h index 3452335d6..63054dd59 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/Macros.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/Macros.h @@ -11,9 +11,11 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once +#include +#include #include +#include #include -#include namespace biogears { #define BLIM(input, min, max) (input = (input > max) ? max : ((input < min) ? min : input)) @@ -58,12 +60,40 @@ inline size_t _Hash_value(_InIt _Begin, _InIt _End) if (from.Has##name()) \ Get##name().Merge(*from.m_##name); -#define CDM_COPY(from, to) \ - { \ - auto* bind = from->Unload(); \ - to->Load(*bind); \ - delete bind; \ - } +template +concept Container = requires(ContainerType a) { + requires std::regular; + requires std::swappable; + requires std::destructible; + requires std::same_as; + requires std::same_as; + requires std::forward_iterator; + requires std::forward_iterator; + requires std::signed_integral; + requires std::same_as::difference_type>; + requires std::same_as::difference_type>; + { + a.begin() + } -> std::same_as; + { + a.end() + } -> std::same_as; + { + a.cbegin() + } -> std::same_as; + { + a.cend() + } -> std::same_as; + { + a.size() + } -> std::same_as; + { + a.max_size() + } -> std::same_as; + { + a.empty() + } -> std::same_as; +}; template inline void Copy(const std::vector& from, std::vector& to) @@ -109,12 +139,25 @@ inline void DELETE_VECTOR(std::vector& vec) } vec.clear(); } -//This will delete all of the second items in a map and then clear the map to destroy all dangling pointers + +template + requires Container && std::is_pointer_v +inline void DELETE_CONTAINER_OF_POINTERS(ContainerType& container) +{ + for (auto& element : container) { + delete element; + element = nullptr; + } + container.clear(); +} +// Th +// This will delete all of the second items in a map and then clear the map to destroy all dangling pointers template -inline void DELETE_MAP_SECOND(std::map& map) +inline void DELETE_MAP_OF_POINTERS(std::map& map) { - for (typename std::map::iterator it = map.begin(); it != map.end(); ++it) { - delete it->second; + for (auto& [key,value] : map) { + delete value; + value = nullptr; } map.clear(); } diff --git a/projects/biogears/libBiogears/include/biogears/cdm/Serializer.h b/projects/biogears/libBiogears/include/biogears/cdm/Serializer.h index 2454e8521..63fa4ebba 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/Serializer.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/Serializer.h @@ -30,7 +30,6 @@ specific language governing permissions and limitations under the License. #include #include -CDM_BIND_DECL(ObjectData) namespace biogears { class Serializer { diff --git a/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuit.h b/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuit.h index 6e4a1568f..16a59c571 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuit.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuit.h @@ -15,16 +15,15 @@ specific language governing permissions and limitations under the License. #include #include -#define CIRCUIT_TEMPLATE typename CircuitBindType, typename NodeType, typename CircuitNodeBindType, typename PathType, typename CircuitPathBindType -#define CIRCUIT_TYPES CircuitBindType, NodeType, CircuitNodeBindType, PathType, CircuitPathBindType +#define CIRCUIT_TEMPLATE typename NodeType, typename PathType +#define CIRCUIT_TYPES NodeType, PathType -CDM_BIND_DECL(CircuitData) namespace biogears { namespace io { class Circuit; } - +#pragma warning(disable : 4661) template class SECircuit : public Loggable { friend io::Circuit; @@ -34,13 +33,7 @@ class SECircuit : public Loggable { SECircuit(const std::string& name, Logger* logger); virtual ~SECircuit(); - virtual void Clear(); //clear memory - - virtual bool Load(const CircuitBindType& in, const std::map& nodes, const std::map& paths); - virtual CircuitBindType* Unload() const; - -protected: - virtual void Unload(CircuitBindType& data) const; + virtual void Invalidate(); // clear memory public: virtual std::string GetName() const; @@ -105,5 +98,5 @@ class SECircuit : public Loggable { std::vector m_PolarizedElementPaths; std::map m_CalculatorIndex; // A unique id (starting at 0) for all nodes except the reference node }; +#pragma warning(default : 4661) } -#include diff --git a/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuit.inl b/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuit.inl index e119af3af..696b3a061 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuit.inl +++ b/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuit.inl @@ -12,7 +12,8 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include + +#include "io/cdm/Circuit.h" #define OPEN_RESISTANCE 1e100 @@ -34,11 +35,11 @@ SECircuit::SECircuit(const std::string& name, Logger* logger) template SECircuit::~SECircuit() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- template -void SECircuit::Clear() +void SECircuit::Invalidate() { m_ReferenceNodes.clear(); for (auto& itr : m_TargetPathMap) @@ -56,61 +57,7 @@ void SECircuit::Clear() m_ValvePaths.clear(); m_PolarizedElementPaths.clear(); } -//----------------------------------------------------------------------------- -template -bool SECircuit::Load(const CircuitBindType& in, const std::map& nodes, const std::map& paths) -{ // note: not clearing here as the derived class needs to clear and call this super class Load last to get the ref node hooked up - Clear(); - m_Name = in.Name(); - for (auto name : in.Node()) { - auto idx = nodes.find(name); - if (idx == nodes.end()) { - Error(m_Name + " could not find node " + name.c_str()); - return false; - } - AddNode(*idx->second); - } - for (auto name : in.Path()) { - auto idx = paths.find(name); - if (idx == paths.end()) { - Error(m_Name + " could not find path " + name.c_str()); - return false; - } - AddPath(*idx->second); - } - for (auto name : in.ReferenceNode()) { - auto idx = nodes.find(name); - if (idx == nodes.end()) { - Error(m_Name + " could not find reference node " + name.c_str()); - return false; - } - AddReferenceNode(*idx->second); - } - StateChange(); - return true; -} -//----------------------------------------------------------------------------- -template -CircuitBindType* SECircuit::Unload() const -{ - CircuitBindType* data = new CircuitBindType(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -template -void SECircuit::Unload(CircuitBindType& data) const -{ - data.Name(m_Name); - if (HasReferenceNode()) { - for (NodeType* n : m_ReferenceNodes) - data.ReferenceNode().push_back(n->GetName()); - } - for (auto* n : m_Nodes) - data.Node().push_back(n->GetName()); - for (auto* p : m_Paths) - data.Path().push_back(p->GetName()); -} + //----------------------------------------------------------------------------- template void SECircuit::StateChange() @@ -135,8 +82,8 @@ void SECircuit::StateChange() Fatal(m_ss); } - //There should never be a NextFlow value set on a path - //Flow sources are defined using NextFlowSource + // There should never be a NextFlow value set on a path + // Flow sources are defined using NextFlowSource /* if (p->HasNextFlux()) { ///\error Fatal: Invalid Path in the Circuit. @@ -168,7 +115,7 @@ void SECircuit::StateChange() m_ConnectedPathMap[nSrc] = conSrcPaths; } - //Make sure we didn't accidentally define something twice + // Make sure we didn't accidentally define something twice if (std::find(m_ConnectedPathMap[nSrc]->begin(), m_ConnectedPathMap[nSrc]->end(), p) != m_ConnectedPathMap[nSrc]->end() || std::find(m_ConnectedPathMap[nTgt]->begin(), m_ConnectedPathMap[nTgt]->end(), p) != m_ConnectedPathMap[nTgt]->end()) { m_ss << p->GetName() << " is defined multiple times."; Fatal(m_ss); @@ -189,14 +136,14 @@ void SECircuit::StateChange() size_t jIdx = 0; m_CalculatorIndex.clear(); for (NodeType* n : m_Nodes) { - //There should never be a next pressure value set on a node - // //Initializing a compliance "charge" is done on the current pressure value - // //Pressure sources are defined on a path - // if (n->HasNextPotential() && n!=GetReferenceNode()) - // { - // m_ss << "You cannot set a pressure value without using a path pressure source. The NextPressure value will be ignored and overwritten for Node " << n->GetName(); - // Warning(m_ss); - // } + // There should never be a next pressure value set on a node + // //Initializing a compliance "charge" is done on the current pressure value + // //Pressure sources are defined on a path + // if (n->HasNextPotential() && n!=GetReferenceNode()) + // { + // m_ss << "You cannot set a pressure value without using a path pressure source. The NextPressure value will be ignored and overwritten for Node " << n->GetName(); + // Warning(m_ss); + // } if (!IsReferenceNode(*n)) m_CalculatorIndex[n] = jIdx++; } @@ -271,7 +218,7 @@ bool SECircuit::HasNode(NodeType& node) template bool SECircuit::HasNode(const char* name) { - return HasNode(std::string{ name }); + return HasNode(std::string { name }); } //----------------------------------------------------------------------------- template @@ -299,7 +246,7 @@ NodeType* SECircuit::GetNode(const std::string& name) template const NodeType* SECircuit::GetNode(const char* name) const { - return GetNode(std::string{ name }); + return GetNode(std::string { name }); } //----------------------------------------------------------------------------- template @@ -334,7 +281,7 @@ void SECircuit::RemoveNode(const NodeType& node) template void SECircuit::RemoveNode(const char* name) { - RemoveNode(std::string{ name }); + RemoveNode(std::string { name }); } //----------------------------------------------------------------------------- template @@ -355,7 +302,7 @@ size_t SECircuit::GetCalculatorIndex(const NodeType& node) const { auto itr = m_CalculatorIndex.find(&node); if (itr == m_CalculatorIndex.end()) { - Error("Node " + std::string{ node.GetName() } +" is not in Calculator Index Map."); + Error("Node " + std::string { node.GetName() } + " is not in Calculator Index Map."); return -1; } return itr->second; @@ -377,7 +324,7 @@ bool SECircuit::HasPath(PathType& path) template bool SECircuit::HasPath(const char* name) { - return HasPath(std::string{ name }); + return HasPath(std::string { name }); } //----------------------------------------------------------------------------- template @@ -389,7 +336,7 @@ bool SECircuit::HasPath(const std::string& name) template PathType* SECircuit::GetPath(const char* name) { - return GetPath(std::string{ name }); + return GetPath(std::string { name }); } //----------------------------------------------------------------------------- template @@ -405,7 +352,7 @@ PathType* SECircuit::GetPath(const std::string& name) template const PathType* SECircuit::GetPath(const char* name) const { - return GetPath(std::string{ name }); + return GetPath(std::string { name }); } //----------------------------------------------------------------------------- template @@ -440,7 +387,7 @@ void SECircuit::RemovePath(const PathType& path) template void SECircuit::RemovePath(const char* name) { - RemovePath(std::string{ name }); + RemovePath(std::string { name }); } //----------------------------------------------------------------------------- template diff --git a/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitCalculator.h b/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitCalculator.h index 0d2ab47c7..9b3ad7530 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitCalculator.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitCalculator.h @@ -11,10 +11,12 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once + #include #include -#include #include +#include +#include #define CIRCUIT_CALCULATOR_TEMPLATE typename CircuitType, typename NodeType, typename PathType, typename CapacitanceUnit, typename FluxUnit, typename InductanceUnit, typename PotentialUnit, typename QuantityUnit, typename ResistanceUnit #define CIRCUIT_CALCULATOR_TYPES CircuitType, NodeType, PathType, CapacitanceUnit, FluxUnit, InductanceUnit, PotentialUnit, QuantityUnit, ResistanceUnit @@ -23,20 +25,80 @@ namespace biogears { // These are the Eigen Solvers we can use for solving our circuits struct BIOGEARS_API EigenCircuitSolver { enum Type { Direct, - PartialPivLu, - FullPivLu, - JacobiSvd, - HouseholderQr, - Ldlt, - Llt, - SparseLU, - SparseQR, - BiCGSTAB, - ConjugateGradient }; - SMART_ENUM(EigenCircuitSolver, Type, 11); + PartialPivLu, + FullPivLu, + JacobiSvd, + HouseholderQr, + Ldlt, + Llt, + SparseLU, + SparseQR, + BiCGSTAB, + ConjugateGradient }; + + + + inline void set(Type t) { m_value = t; } + inline Type get() const { return m_value; }; + inline Type value() const { return m_value; }; + static char const* Value(size_t idx); + + private: + Type m_value = Type::Direct; }; +inline char const * ToString( EigenCircuitSolver::Type const & pt) +{ + using Type = EigenCircuitSolver::Type; + + switch (pt) { + case Type::Direct: + return "Direct"; + case Type::PartialPivLu: + return "PartialPivLu"; + case Type::FullPivLu: + return "FullPivLu"; + case Type::JacobiSvd: + return "JacobiSvd"; + case Type::HouseholderQr: + return "HouseholderQr"; + case Type::Ldlt: + return "Ldlt"; + case Type::Llt: + return "Llt"; + case Type::SparseLU: + return "SparseLU"; + case Type::SparseQR: + return "SparseQR"; + case Type::BiCGSTAB: + return "BiCGSTAB"; + case Type::ConjugateGradient: + return "ConjugateGradient"; + default: + return "Invalid"; + } +} + +inline char const* ToString(EigenCircuitSolver const& es) +{ + return ToString(es.get()); +} + + +inline std::ostream& operator<<(std::ostream& os, const EigenCircuitSolver::Type& bit) +{ + os << ToString(bit); + return os; +} + +inline std::ostream& operator<<(std::ostream& os, const EigenCircuitSolver& bit) +{ + os << ToString(bit); + return os; +} + +#pragma warning(disable:4661) template class SECircuitCalculator : public Loggable { public: @@ -66,10 +128,10 @@ class SECircuitCalculator : public Loggable { // These are all transient and cleared/set at the start of the process call std::stringstream m_ss; - //Ax=b - Eigen::MatrixXd m_AMatrix; //A - Eigen::VectorXd m_xVector; //x - Eigen::VectorXd m_bVector; //b + // Ax=b + Eigen::MatrixXd m_AMatrix; // A + Eigen::VectorXd m_xVector; // x + Eigen::VectorXd m_bVector; // b double m_dT_s; CircuitType* m_circuit; @@ -84,5 +146,6 @@ class SECircuitCalculator : public Loggable { const QuantityUnit& m_QuantityUnit; const ResistanceUnit& m_ResistanceUnit; }; +#pragma warning(default : 4661) } #include \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitCalculator.inl b/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitCalculator.inl index e824bc884..a8009f002 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitCalculator.inl +++ b/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitCalculator.inl @@ -77,7 +77,7 @@ void SECircuitCalculator::Process(CircuitType& circuit //Reset all Polarized Elements to be shorted. for (PathType* p : circuit.GetPolarizedElementPaths()) { if (p->HasNextPolarizedState()) - p->SetNextPolarizedState(CDM::enumOpenClosed::Closed); + p->SetNextPolarizedState(SEOpenClosed::Closed); } //When we parse everything into our Ax=b matrices/vectors for the linear solver, @@ -157,7 +157,7 @@ void SECircuitCalculator::ParseIn() for (PathType* p : m_circuit->GetPaths()) { //Set aside the pressure sources, since the Flow through them will be directly solved by adding them to the bottom of the matrix. //We have to do this outside of the KCL loop below because we only want to account for each one once. - if (p->HasNextPotentialSource() || (p->NumberOfNextElements() < 1) || (p->HasNextValve() && p->GetNextValve() == CDM::enumOpenClosed::Closed) || (p->HasNextSwitch() && p->GetNextSwitch() == CDM::enumOpenClosed::Closed)) { + if (p->HasNextPotentialSource() || (p->NumberOfNextElements() < 1) || (p->HasNextValve() && p->GetNextValve() == SEOpenClosed::Closed) || (p->HasNextSwitch() && p->GetNextSwitch() == SEOpenClosed::Closed)) { m_potentialSources[p] = numNodes + idx++; } } @@ -189,7 +189,7 @@ void SECircuitCalculator::ParseIn() NodeType* nSrc = &p->GetSourceNode(); NodeType* nTgt = &p->GetTargetNode(); - if (p->HasNextPolarizedState() && p->GetNextPolarizedState() == CDM::enumOpenClosed::Open) { //Polarized elements that are open are done exactly the same as a open switch. + if (p->HasNextPolarizedState() && p->GetNextPolarizedState() == SEOpenClosed::Open) { //Polarized elements that are open are done exactly the same as a open switch. //We'll check to see if the resulting pressure difference is valid later. //Model as an open switch double dMultiplier = 1.0 / OPEN_RESISTANCE; @@ -201,7 +201,7 @@ void SECircuitCalculator::ParseIn() //Each Path has only one Element (or none at all) and each type is handled differently. //The variables in the x vector are the unknown Node Pressures and Flows for Pressure Sources. if (p->HasNextSwitch()) { - if (p->GetNextSwitch() == CDM::enumOpenClosed::Open) { + if (p->GetNextSwitch() == SEOpenClosed::Open) { //Model as a resistor with a ridiculously high resistance (basically an open circuit) double dMultiplier = 1.0 / OPEN_RESISTANCE; PopulateAMatrix(*n, *p, dMultiplier); @@ -303,7 +303,7 @@ void SECircuitCalculator::ParseIn() } else if (p->HasNextValve()) { //Valves are done exactly the same as switches. //We'll check to see if the resulting flow and pressure difference is valid later. - if (p->GetNextValve() == CDM::enumOpenClosed::Open) { + if (p->GetNextValve() == SEOpenClosed::Open) { //Model as a resistor with a ridiculously high resistance (basically an open circuit) double dMultiplier = 1.0 / OPEN_RESISTANCE; PopulateAMatrix(*n, *p, dMultiplier); @@ -552,7 +552,7 @@ void SECircuitCalculator::CalculateFluxes() for (PathType* p : m_circuit->GetPaths()) { if (p->HasNextFluxSource()) { Override(p->GetNextFluxSource(), p->GetNextFlux()); - } else if ((p->HasNextSwitch() && p->GetNextSwitch() == CDM::enumOpenClosed::Open) || (p->HasNextValve() && p->GetNextValve() == CDM::enumOpenClosed::Open) || (p->HasNextPolarizedState() && p->GetNextPolarizedState() == CDM::enumOpenClosed::Open)) { + } else if ((p->HasNextSwitch() && p->GetNextSwitch() == SEOpenClosed::Open) || (p->HasNextValve() && p->GetNextValve() == SEOpenClosed::Open) || (p->HasNextPolarizedState() && p->GetNextPolarizedState() == SEOpenClosed::Open)) { ValueOverride(p->GetNextFlux(), 0, m_FluxUnit); } else if (p->HasNextResistance()) { //I = V/R @@ -625,12 +625,12 @@ void SECircuitCalculator::CalculateQuantities() //dStartingPressDiff is at time = T + deltaT double dEndingPressDiff = std::abs(p->GetSourceNode().GetNextPotential().GetValue(m_PotentialUnit) - p->GetTargetNode().GetNextPotential().GetValue(m_PotentialUnit)); - if (p->GetPolarizedState() == CDM::enumOpenClosed::Open) { + if (p->GetPolarizedState() == SEOpenClosed::Open) { //If this was a shorted polarized element last time-step, we need to make the starting difference zero //Otherwise, it will possibly think it was already charged to a certain point dStartingPressDiff = 0.0; } - if (p->GetNextPolarizedState() == CDM::enumOpenClosed::Open) { + if (p->GetNextPolarizedState() == SEOpenClosed::Open) { //If it is currently a shorted polarized element, we need to make the starting difference zero //This will make it go to the non-charged volume dEndingPressDiff = 0.0; @@ -678,8 +678,8 @@ bool SECircuitCalculator::CheckAndModifyValves() } for (PathType* p : m_circuit->GetValvePaths()) { - if ((p->GetNextValve() == CDM::enumOpenClosed::Closed && p->GetNextFlux().GetValue(m_FluxUnit) < -ZERO_APPROX) - || (p->GetNextValve() == CDM::enumOpenClosed::Open && (p->GetSourceNode().GetNextPotential().GetValue(m_PotentialUnit) - p->GetTargetNode().GetNextPotential().GetValue(m_PotentialUnit)) > ZERO_APPROX)) { + if ((p->GetNextValve() == SEOpenClosed::Closed && p->GetNextFlux().GetValue(m_FluxUnit) < -ZERO_APPROX) + || (p->GetNextValve() == SEOpenClosed::Open && (p->GetSourceNode().GetNextPotential().GetValue(m_PotentialUnit) - p->GetTargetNode().GetNextPotential().GetValue(m_PotentialUnit)) > ZERO_APPROX)) { p->FlipNextValve(); if (IsCurrentValveStateUnique()) { return false; @@ -689,7 +689,7 @@ bool SECircuitCalculator::CheckAndModifyValves() } for (PathType* p : m_circuit->GetPolarizedElementPaths()) { - if (p->GetNextPolarizedState() == CDM::enumOpenClosed::Closed && (p->GetSourceNode().GetNextPotential().GetValue(m_PotentialUnit) - p->GetTargetNode().GetNextPotential().GetValue(m_PotentialUnit)) < -ZERO_APPROX) { + if (p->GetNextPolarizedState() == SEOpenClosed::Closed && (p->GetSourceNode().GetNextPotential().GetValue(m_PotentialUnit) - p->GetTargetNode().GetNextPotential().GetValue(m_PotentialUnit)) < -ZERO_APPROX) { p->FlipNextPolarizedState(); if (IsCurrentValveStateUnique()) { return false; @@ -722,12 +722,12 @@ bool SECircuitCalculator::IsCurrentValveStateUnique() /// the polarized element combinations. This is the order in which we want to evaluate the states /// so this bit order is important. for (PathType* pValve : m_circuit->GetValvePaths()) { - if (pValve->GetNextValve() == CDM::enumOpenClosed::Closed) + if (pValve->GetNextValve() == SEOpenClosed::Closed) currentState |= index; index = index << static_cast(1); } for (PathType* pPolarizedElement : m_circuit->GetPolarizedElementPaths()) { - if (pPolarizedElement->GetNextPolarizedState() == CDM::enumOpenClosed::Closed) + if (pPolarizedElement->GetNextPolarizedState() == SEOpenClosed::Closed) currentState |= index; index = index << static_cast(1); } diff --git a/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitLedger.h b/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitLedger.h new file mode 100644 index 000000000..8be04d159 --- /dev/null +++ b/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitLedger.h @@ -0,0 +1,45 @@ +/************************************************************************************** +Copyright 2022 Applied Research Associates, Inc. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the License +at: +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +**************************************************************************************/ + +#pragma once +#include + + +#define CIRCUIT_LEDGER_TEMPLATE typename NodeType, typename PathType, typename CircuitType +#define CIRCUIT_LEDGER_TYPES NodeType, PathType, CircuitType + +namespace biogears { +namespace io { + class Circuit; +} +template +class SECircuitLedger { + friend class SECircuitManager; + friend io::Circuit; + +protected: + SECircuitLedger() {}; + +public: + virtual ~SECircuitLedger() { Invalidate(); }; + void Invalidate() + { + DELETE_MAP_OF_POINTERS(nodes); + DELETE_MAP_OF_POINTERS(paths); + DELETE_MAP_OF_POINTERS(circuits); + } + std::map nodes; + std::map paths; + std::map circuits; +}; + +} \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitManager.h b/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitManager.h index 502ca7c6d..44251656a 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitManager.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitManager.h @@ -11,53 +11,19 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once +#include #include #include #include -#include - -CDM_BIND_DECL(CircuitManagerData); - -#define CIRCUIT_LEDGER_TEMPLATE typename NodeType, typename PathType, typename CircuitType -#define CIRCUIT_LEDGER_TYPES NodeType, PathType, CircuitType +#pragma warning(disable : 4661) namespace biogears { namespace io { class Circuit; } class SECircuitManager; -template -class SECircuitLedger { - friend class SECircuitManager; - friend io::Circuit; - -protected: - SECircuitLedger() {}; - -public: - virtual ~SECircuitLedger() { Clear(); }; - void Clear() - { - DELETE_MAP_SECOND(nodes); - DELETE_MAP_SECOND(paths); - DELETE_MAP_SECOND(circuits); - } - std::map nodes; - std::map paths; - std::map circuits; -}; - - -BG_EXT template class BIOGEARS_API SECircuitLedger; -BG_EXT template class BIOGEARS_API SECircuitLedger; -BG_EXT template class BIOGEARS_API SECircuitLedger; - -#define ELECTRICAL_LEDGER_TYPES SEElectricalCircuitNode, SEElectricalCircuitPath, SEElectricalCircuit -#define FLUID_LEDGER_TYPES SEFluidCircuitNode, SEFluidCircuitPath, SEFluidCircuit -#define THERMAL_LEDGER_TYPES SEThermalCircuitNode, SEThermalCircuitPath, SEThermalCircuit - class BIOGEARS_API SECircuitManager : public Loggable { friend io::Circuit; @@ -65,13 +31,7 @@ class BIOGEARS_API SECircuitManager : public Loggable { SECircuitManager(Logger* logger); virtual ~SECircuitManager(); - virtual void Clear(); //clear memory - - virtual bool Load(const CDM::CircuitManagerData& in); - virtual CDM::CircuitManagerData* Unload() const; - -protected: - void Unload(CDM::CircuitManagerData& data) const; + virtual void Invalidate(); // clear memory public: void SetReadOnly(bool b); @@ -237,9 +197,9 @@ class BIOGEARS_API SECircuitManager : public Loggable { template const CircuitType* GetCircuit(const std::string& name, const SECircuitLedger& ledger) const; - SECircuitLedger m_ElectricalLedger; - SECircuitLedger m_FluidLedger; - SECircuitLedger m_ThermalLedger; + SECircuitLedger m_ElectricalLedger; + SECircuitLedger m_FluidLedger; + SECircuitLedger m_ThermalLedger; }; template @@ -492,4 +452,5 @@ const CircuitType* SECircuitManager::GetCircuit(const std::string& name, const S } //------------------------------------------------------------------------------- -} \ No newline at end of file +} +#pragma warning(default : 4661) \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitNode.h b/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitNode.h index 6b3706952..58f831be7 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitNode.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitNode.h @@ -21,8 +21,6 @@ specific language governing permissions and limitations under the License. #include #include -CDM_BIND_DECL(CircuitNodeData); - namespace biogears { #define CIRCUIT_NODE_TEMPLATE typename PotentialScalar, typename QuantityScalar @@ -35,9 +33,10 @@ namespace io { class Circuit; } +#pragma warning(disable : 4661) template class SECircuitNode : public Loggable { - template + template friend class SECircuit; friend class io::Circuit; @@ -48,16 +47,11 @@ class SECircuitNode : public Loggable { public: virtual ~SECircuitNode(); - virtual void Clear(); // clear memory - - virtual bool Load(const CDM::CircuitNodeData& in); - virtual CDM::CircuitNodeData* Unload() const = 0; + virtual void Invalidate(); // clear memory bool operator==(SECircuitNode& rhs) const; bool operator!=(SECircuitNode& rhs) const; -protected: - virtual void Unload(CDM::CircuitNodeData& data) const; public: virtual std::string GetName() const; @@ -88,7 +82,6 @@ class SECircuitNode : public Loggable { QuantityScalar* m_NextQuantity; QuantityScalar* m_QuantityBaseline; }; - } #include @@ -96,4 +89,5 @@ namespace biogears { BG_EXT template class SECircuitNode; BG_EXT template class SECircuitNode; BG_EXT template class SECircuitNode; -} \ No newline at end of file +} +#pragma warning(disable : 4661) \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitNode.inl b/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitNode.inl index b6f581148..23e69c2d2 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitNode.inl +++ b/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitNode.inl @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once // Project Includes #include -#include namespace biogears { template @@ -36,11 +35,11 @@ SECircuitNode::SECircuitNode(const std::string& name, Logger template SECircuitNode::~SECircuitNode() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- template -void SECircuitNode::Clear() +void SECircuitNode::Invalidate() { SAFE_DELETE(m_Potential); SAFE_DELETE(m_NextPotential); @@ -48,19 +47,7 @@ void SECircuitNode::Clear() SAFE_DELETE(m_NextQuantity); SAFE_DELETE(m_QuantityBaseline); } -//------------------------------------------------------------------------------- -template -bool SECircuitNode::Load(const CDM::CircuitNodeData& in) -{ - Clear(); - return true; -} -//------------------------------------------------------------------------------- -template -void SECircuitNode::Unload(CDM::CircuitNodeData& data) const -{ - data.Name(m_Name); -} + //------------------------------------------------------------------------------- template std::string SECircuitNode::GetName() const diff --git a/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitPath.h b/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitPath.h index 250d3483a..32c4f76df 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitPath.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitPath.h @@ -13,7 +13,7 @@ specific language governing permissions and limitations under the License. #pragma once #include #include -#include +#include #include #include @@ -40,17 +40,15 @@ specific language governing permissions and limitations under the License. #define FLUID_CIRCUIT_PATH SEScalarVolumePerTime, SEScalarFlowResistance, SEScalarFlowCompliance, SEScalarFlowInertance, SEScalarPressure, SEScalarVolume #define THERMAL_CIRCUIT_PATH SEScalarPower, SEScalarHeatResistance, SEScalarHeatCapacitance, SEScalarHeatInductance, SEScalarTemperature, SEScalarEnergy -CDM_BIND_DECL(CircuitPathData) - namespace biogears { namespace io { class Circuit; } - +#pragma warning(disable : 4661) template class SECircuitPath : public Loggable { - template + template friend class SECircuit; friend io::Circuit; @@ -61,17 +59,11 @@ class SECircuitPath : public Loggable { public: virtual ~SECircuitPath(); - virtual void Clear(); - - virtual bool Load(const CDM::CircuitPathData& in); - virtual CDM::CircuitPathData* Unload() const = 0; + virtual void Invalidate(); bool operator==(SECircuitPath& rhs) const; bool operator!=(SECircuitPath& rhs) const; -protected: - virtual void Unload(CDM::CircuitPathData& data) const; - public: virtual std::string GetName() const; virtual const char* GetName_cStr() const; @@ -124,38 +116,38 @@ class SECircuitPath : public Loggable { virtual unsigned short NumberOfElements() const { return m_NumElements; } virtual unsigned short NumberOfNextElements() const { return m_NumNextElements; } - virtual CDM::enumOpenClosed::value GetSwitch() const; - virtual void SetSwitch(CDM::enumOpenClosed::value state); + virtual SEOpenClosed GetSwitch() const; + virtual void SetSwitch(SEOpenClosed state); virtual void FlipSwitch(); virtual bool HasSwitch() const; virtual void InvalidateSwitch(); - virtual CDM::enumOpenClosed::value GetNextSwitch() const; - virtual void SetNextSwitch(CDM::enumOpenClosed::value state); + virtual SEOpenClosed GetNextSwitch() const; + virtual void SetNextSwitch(SEOpenClosed state); virtual void FlipNextSwitch(); virtual bool HasNextSwitch() const; virtual void InvalidateNextSwitch(); - virtual CDM::enumOpenClosed::value GetValve() const; - virtual void SetValve(CDM::enumOpenClosed::value state); + virtual SEOpenClosed GetValve() const; + virtual void SetValve(SEOpenClosed state); virtual void FlipValve(); virtual bool HasValve() const; virtual void InvalidateValve(); - virtual CDM::enumOpenClosed::value GetNextValve() const; - virtual void SetNextValve(CDM::enumOpenClosed::value state); + virtual SEOpenClosed GetNextValve() const; + virtual void SetNextValve(SEOpenClosed state); virtual void FlipNextValve(); virtual bool HasNextValve() const; virtual void InvalidateNextValve(); - virtual CDM::enumOpenClosed::value GetPolarizedState() const; - virtual void SetPolarizedState(CDM::enumOpenClosed::value state); + virtual SEOpenClosed GetPolarizedState() const; + virtual void SetPolarizedState(SEOpenClosed state); virtual void FlipPolarizedState(); virtual bool HasPolarizedState() const; virtual void InvalidatePolarizedState(); - virtual CDM::enumOpenClosed::value GetNextPolarizedState() const; - virtual void SetNextPolarizedState(CDM::enumOpenClosed::value state); + virtual SEOpenClosed GetNextPolarizedState() const; + virtual void SetNextPolarizedState(SEOpenClosed state); virtual void FlipNextPolarizedState(); virtual bool HasNextPolarizedState() const; virtual void InvalidateNextPolarizedState(); @@ -169,12 +161,12 @@ class SECircuitPath : public Loggable { ///////////////////////// // Valves and Switches // ///////////////////////// - CDM::enumOpenClosed::value m_Switch; - CDM::enumOpenClosed::value m_NextSwitch; - CDM::enumOpenClosed::value m_Valve; - CDM::enumOpenClosed::value m_NextValve; - CDM::enumOpenClosed::value m_PolarizedState; - CDM::enumOpenClosed::value m_NextPolarizedState; + SEOpenClosed m_Switch; + SEOpenClosed m_NextSwitch; + SEOpenClosed m_Valve; + SEOpenClosed m_NextValve; + SEOpenClosed m_PolarizedState; + SEOpenClosed m_NextPolarizedState; ResistanceScalar* m_Resistance; ResistanceScalar* m_NextResistance; @@ -200,9 +192,10 @@ class SECircuitPath : public Loggable { PotentialScalar* m_ValveBreakdownPotential; }; -BG_EXT template class BIOGEARS_API SECircuitPath; -BG_EXT template class BIOGEARS_API SECircuitPath; -BG_EXT template class BIOGEARS_API SECircuitPath; +extern template class SECircuitPath; +extern template class SECircuitPath; +extern template class SECircuitPath; + +#pragma warning(default : 4661) } -#include diff --git a/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitPath.inl b/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitPath.inl index 37f786772..1e3ffc54f 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitPath.inl +++ b/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECircuitPath.inl @@ -12,8 +12,8 @@ specific language governing permissions and limitations under the License. #include #include -#include +#include "io/cdm/Circuit.h" namespace biogears { template SECircuitPath::SECircuitPath(SECircuitNode& src, SECircuitNode& tgt, const char* name) @@ -46,12 +46,12 @@ SECircuitPath::SECircuitPath(SECircuitNode::SECircuitPath(SECircuitNode SECircuitPath::~SECircuitPath() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- template -void SECircuitPath::Clear() +void SECircuitPath::Invalidate() { - m_Switch = (CDM::enumOpenClosed::value)-1; - m_Valve = (CDM::enumOpenClosed::value)-1; - m_NextSwitch = (CDM::enumOpenClosed::value)-1; - m_NextValve = (CDM::enumOpenClosed::value)-1; - m_NextPolarizedState = (CDM::enumOpenClosed::value)-1; - m_PolarizedState = (CDM::enumOpenClosed::value)-1; + m_Switch = (SEOpenClosed)-1; + m_Valve = (SEOpenClosed)-1; + m_NextSwitch = (SEOpenClosed)-1; + m_NextValve = (SEOpenClosed)-1; + m_NextPolarizedState = (SEOpenClosed)-1; + m_PolarizedState = (SEOpenClosed)-1; SAFE_DELETE(m_Resistance); SAFE_DELETE(m_NextResistance); SAFE_DELETE(m_ResistanceBaseline); @@ -97,45 +97,7 @@ void SECircuitPath::Clear() SAFE_DELETE(m_PotentialSourceBaseline); SAFE_DELETE(m_ValveBreakdownPotential); } -//------------------------------------------------------------------------------- -template -bool SECircuitPath::Load(const CDM::CircuitPathData& in) -{ - Clear(); - if (in.Switch().present()) - SetSwitch(in.Switch().get()); - if (in.NextSwitch().present()) - SetNextSwitch(in.NextSwitch().get()); - if (in.Valve().present()) - SetValve(in.Valve().get()); - if (in.NextValve().present()) - SetNextValve(in.NextValve().get()); - if (in.PolarizedState().present()) - SetPolarizedState(in.PolarizedState().get()); - if (in.NextPolarizedState().present()) - SetNextPolarizedState(in.NextPolarizedState().get()); - return true; -} -//------------------------------------------------------------------------------- -template -void SECircuitPath::Unload(CDM::CircuitPathData& data) const -{ - data.Name(m_Name); - data.SourceNode(m_SourceNode.GetName()); - data.TargetNode(m_TargetNode.GetName()); - if (HasSwitch()) - data.Switch(m_Switch); - if (HasNextSwitch()) - data.NextSwitch(m_NextSwitch); - if (HasValve()) - data.Valve(m_Valve); - if (HasNextValve()) - data.NextValve(m_NextValve); - if (HasPolarizedState()) - data.PolarizedState(m_PolarizedState); - if (HasNextPolarizedState()) - data.NextPolarizedState(m_NextPolarizedState); -} + //------------------------------------------------------------------------------- template std::string SECircuitPath::GetName() const @@ -211,13 +173,13 @@ bool SECircuitPath::HasValidElements() const } //------------------------------------------------------------------------------- template -CDM::enumOpenClosed::value SECircuitPath::GetSwitch() const +SEOpenClosed SECircuitPath::GetSwitch() const { return m_Switch; } //------------------------------------------------------------------------------- template -void SECircuitPath::SetSwitch(CDM::enumOpenClosed::value state) +void SECircuitPath::SetSwitch(SEOpenClosed state) { m_Switch = state; } @@ -225,28 +187,28 @@ void SECircuitPath::SetSwitch(CDM::enumOpenClosed::value sta template void SECircuitPath::FlipSwitch() { - m_Switch = (m_Switch == CDM::enumOpenClosed::Open) ? CDM::enumOpenClosed::Closed : CDM::enumOpenClosed::Open; + m_Switch = (m_Switch == SEOpenClosed::Open) ? SEOpenClosed::Closed : SEOpenClosed::Open; } //------------------------------------------------------------------------------- template bool SECircuitPath::HasSwitch() const { - return m_Switch == (CDM::enumOpenClosed::value)-1 ? false : true; + return m_Switch == (SEOpenClosed)-1 ? false : true; } //------------------------------------------------------------------------------- template void SECircuitPath::InvalidateSwitch() { - m_Switch = (CDM::enumOpenClosed::value)-1; + m_Switch = (SEOpenClosed)-1; } //------------------------------------------------------------------------------- template -CDM::enumOpenClosed::value SECircuitPath::GetNextSwitch() const +SEOpenClosed SECircuitPath::GetNextSwitch() const { return m_NextSwitch; } template -void SECircuitPath::SetNextSwitch(CDM::enumOpenClosed::value state) +void SECircuitPath::SetNextSwitch(SEOpenClosed state) { m_NextSwitch = state; } @@ -254,29 +216,29 @@ void SECircuitPath::SetNextSwitch(CDM::enumOpenClosed::value template void SECircuitPath::FlipNextSwitch() { - m_NextSwitch = (m_NextSwitch == CDM::enumOpenClosed::Open) ? CDM::enumOpenClosed::Closed : CDM::enumOpenClosed::Open; + m_NextSwitch = (m_NextSwitch == SEOpenClosed::Open) ? SEOpenClosed::Closed : SEOpenClosed::Open; } //------------------------------------------------------------------------------- template bool SECircuitPath::HasNextSwitch() const { - return m_NextSwitch == (CDM::enumOpenClosed::value)-1 ? false : true; + return m_NextSwitch == (SEOpenClosed)-1 ? false : true; } //------------------------------------------------------------------------------- template void SECircuitPath::InvalidateNextSwitch() { - m_NextSwitch = (CDM::enumOpenClosed::value)-1; + m_NextSwitch = (SEOpenClosed)-1; } //------------------------------------------------------------------------------- template -CDM::enumOpenClosed::value SECircuitPath::GetValve() const +SEOpenClosed SECircuitPath::GetValve() const { return m_Valve; } //------------------------------------------------------------------------------- template -void SECircuitPath::SetValve(CDM::enumOpenClosed::value state) +void SECircuitPath::SetValve(SEOpenClosed state) { m_Valve = state; } @@ -284,29 +246,29 @@ void SECircuitPath::SetValve(CDM::enumOpenClosed::value stat template void SECircuitPath::FlipValve() { - m_Valve = (m_Valve == CDM::enumOpenClosed::Open) ? CDM::enumOpenClosed::Closed : CDM::enumOpenClosed::Open; + m_Valve = (m_Valve == SEOpenClosed::Open) ? SEOpenClosed::Closed : SEOpenClosed::Open; } //------------------------------------------------------------------------------- template bool SECircuitPath::HasValve() const { - return m_Valve == (CDM::enumOpenClosed::value)-1 ? false : true; + return m_Valve == (SEOpenClosed)-1 ? false : true; } //------------------------------------------------------------------------------- template void SECircuitPath::InvalidateValve() { - m_Valve = (CDM::enumOpenClosed::value)-1; + m_Valve = (SEOpenClosed)-1; } //------------------------------------------------------------------------------- template -CDM::enumOpenClosed::value SECircuitPath::GetNextValve() const +SEOpenClosed SECircuitPath::GetNextValve() const { return m_NextValve; } //------------------------------------------------------------------------------- template -void SECircuitPath::SetNextValve(CDM::enumOpenClosed::value state) +void SECircuitPath::SetNextValve(SEOpenClosed state) { m_NextValve = state; } @@ -314,29 +276,29 @@ void SECircuitPath::SetNextValve(CDM::enumOpenClosed::value template void SECircuitPath::FlipNextValve() { - m_NextValve = (m_NextValve == CDM::enumOpenClosed::Open) ? CDM::enumOpenClosed::Closed : CDM::enumOpenClosed::Open; + m_NextValve = (m_NextValve == SEOpenClosed::Open) ? SEOpenClosed::Closed : SEOpenClosed::Open; } //------------------------------------------------------------------------------- template bool SECircuitPath::HasNextValve() const { - return m_NextValve == (CDM::enumOpenClosed::value)-1 ? false : true; + return m_NextValve == (SEOpenClosed)-1 ? false : true; } //------------------------------------------------------------------------------- template void SECircuitPath::InvalidateNextValve() { - m_NextValve = (CDM::enumOpenClosed::value)-1; + m_NextValve = (SEOpenClosed)-1; } //------------------------------------------------------------------------------- template -CDM::enumOpenClosed::value SECircuitPath::GetNextPolarizedState() const +SEOpenClosed SECircuitPath::GetNextPolarizedState() const { return m_NextPolarizedState; } //------------------------------------------------------------------------------- template -void SECircuitPath::SetNextPolarizedState(CDM::enumOpenClosed::value state) +void SECircuitPath::SetNextPolarizedState(SEOpenClosed state) { m_NextPolarizedState = state; } @@ -344,29 +306,29 @@ void SECircuitPath::SetNextPolarizedState(CDM::enumOpenClose template void SECircuitPath::FlipNextPolarizedState() { - m_NextPolarizedState = (m_NextPolarizedState == CDM::enumOpenClosed::Open) ? CDM::enumOpenClosed::Closed : CDM::enumOpenClosed::Open; + m_NextPolarizedState = (m_NextPolarizedState == SEOpenClosed::Open) ? SEOpenClosed::Closed : SEOpenClosed::Open; } //------------------------------------------------------------------------------- template bool SECircuitPath::HasNextPolarizedState() const { - return m_NextPolarizedState == (CDM::enumOpenClosed::value)-1 ? false : true; + return m_NextPolarizedState == (SEOpenClosed)-1 ? false : true; } //------------------------------------------------------------------------------- template void SECircuitPath::InvalidateNextPolarizedState() { - m_NextPolarizedState = (CDM::enumOpenClosed::value)-1; + m_NextPolarizedState = (SEOpenClosed)-1; } //------------------------------------------------------------------------------- template -CDM::enumOpenClosed::value SECircuitPath::GetPolarizedState() const +SEOpenClosed SECircuitPath::GetPolarizedState() const { return m_PolarizedState; } //------------------------------------------------------------------------------- template -void SECircuitPath::SetPolarizedState(CDM::enumOpenClosed::value state) +void SECircuitPath::SetPolarizedState(SEOpenClosed state) { m_PolarizedState = state; } @@ -374,19 +336,19 @@ void SECircuitPath::SetPolarizedState(CDM::enumOpenClosed::v template void SECircuitPath::FlipPolarizedState() { - m_PolarizedState = (m_PolarizedState == CDM::enumOpenClosed::Open) ? CDM::enumOpenClosed::Closed : CDM::enumOpenClosed::Open; + m_PolarizedState = (m_PolarizedState == SEOpenClosed::Open) ? SEOpenClosed::Closed : SEOpenClosed::Open; } //------------------------------------------------------------------------------- template bool SECircuitPath::HasPolarizedState() const { - return m_PolarizedState == (CDM::enumOpenClosed::value)-1 ? false : true; + return m_PolarizedState == (SEOpenClosed)-1 ? false : true; } //------------------------------------------------------------------------------- template void SECircuitPath::InvalidatePolarizedState() { - m_PolarizedState = (CDM::enumOpenClosed::value)-1; + m_PolarizedState = (SEOpenClosed)-1; } //------------------------------------------------------------------------------- ///////////////// diff --git a/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECombinedCircuit.h b/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECombinedCircuit.h index 29c3a1720..7839da88a 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECombinedCircuit.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECombinedCircuit.h @@ -11,8 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once -#define COMBINED_CIRCUIT_TEMPLATE typename CombinedCircuitBindType, typename CircuitType, typename CircuitBindType, typename NodeType, typename CircuitNodeBindType, typename PathType, typename CircuitPathBindType -#define COMBINED_CIRCUIT_TYPES CombinedCircuitBindType, CircuitType, CircuitBindType, NodeType, CircuitNodeBindType, PathType, CircuitPathBindType +#define COMBINED_CIRCUIT_TEMPLATE typename CircuitType, typename NodeType, typename PathType +#define COMBINED_CIRCUIT_TYPES CircuitType, NodeType, PathType #include @@ -24,13 +24,8 @@ class SECombinedCircuit : public CircuitType { SECombinedCircuit(const std::string& name, Logger* logger); virtual ~SECombinedCircuit() override; - virtual void Clear() override; //clear memory + virtual void Invalidate() override; //clear memory - bool Load(const CombinedCircuitBindType& in); - CombinedCircuitBindType* Unload() const; - -protected: - void Unload(CombinedCircuitBindType& data) const; public: virtual void AddCircuit(CircuitType& c) override; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECombinedCircuit.inl b/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECombinedCircuit.inl index a01a78666..bbb8519af 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECombinedCircuit.inl +++ b/projects/biogears/libBiogears/include/biogears/cdm/circuit/SECombinedCircuit.inl @@ -10,6 +10,7 @@ CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **************************************************************************************/ +#include #include @@ -30,11 +31,11 @@ SECombinedCircuit::SECombinedCircuit(const std::string& template SECombinedCircuit::~SECombinedCircuit() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- template -void SECombinedCircuit::Clear() +void SECombinedCircuit::Invalidate() { m_Nodes.clear(); m_Paths.clear(); @@ -43,93 +44,7 @@ void SECombinedCircuit::Clear() m_RemovedNodes.clear(); m_RemovedPaths.clear(); m_Circuits.clear(); - CircuitType::Clear(); -} -//----------------------------------------------------------------------------- -template -bool SECombinedCircuit::Load(const CombinedCircuitBindType& in) -{ // Note we don't call SECircuit::Load, we will do things ourselves, OUR way (sometimes, parents just don't understand...) - Clear(); - // First load up our sub circuits so any new paths have all nodes we may need - for (const CircuitBindType& fData : in.Circuit()) { - CircuitType* c = new CircuitType(fData.Name(), GetLogger()); - c->Load(fData); - AddCircuit(*c); - } - // NOW we can load any other 'connection' Nodes and Paths - for (auto nData : in.Node()) { - auto& n = CreateNode(nData.Name()); - n.Load(nData); - } - for (auto& pData : in.Path()) { - auto* src = CircuitType::GetNode(pData.SourceNode()); - if (src == nullptr) { - m_ss << "Source Node " << pData.SourceNode() << " not found for path " << pData.Name(); - Error(m_ss); - return false; - } - auto* tgt = CircuitType::GetNode(pData.TargetNode()); - if (tgt == nullptr) { - m_ss << "Target Node " << pData.TargetNode() << " not found for path " << pData.Name(); - Error(m_ss); - return false; - } - auto& p = CreatePath(*src, *tgt, pData.Name()); - p.Load(pData); - } - // Take out any nodes/paths that were not part of this combined circuit, but are part of the sub circuits - for (auto s : in.RemovedNode()) { - NodeType* n = CircuitType::GetNode(s); - if (n == nullptr) - Error("Unable to find removed node", s); - else - RemoveNode(*n); - } - for (auto s : in.RemovedPath()) { - PathType* p = CircuitType::GetPath(s); - if (p == nullptr) - Error("Unable to find removed path", s); - else - RemovePath(*p); - } - for (auto ref : in.ReferenceNode()) { - NodeType* n = GetNode(ref); - if (n == nullptr) { - Error("Could not find reference node " + ref); - return false; - } else - AddReferenceNode(*n); - } - StateChange(); - return true; -} -//----------------------------------------------------------------------------- -template -CombinedCircuitBindType* SECombinedCircuit::Unload() const -{ - CombinedCircuitBindType* data = new CombinedCircuitBindType(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -template -void SECombinedCircuit::Unload(CombinedCircuitBindType& data) const -{ // Note we don't call SECircuit::Load, we will do things ourselves, OUR way (sometimes, parents just don't understand...) - data.Name(m_Name); - if (HasReferenceNode()) { - for (NodeType* n : m_ReferenceNodes) - data.ReferenceNode().push_back(n->GetName()); - } - for (auto itr : m_Circuits) - data.Circuit().push_back(std::unique_ptr(itr.second->Unload())); - for (auto* n : m_LinkNodes) - data.Node().push_back(std::unique_ptr(n->Unload())); - for (auto* p : m_LinkPaths) - data.Path().push_back(std::unique_ptr(p->Unload())); - for (auto s : m_RemovedNodes) - data.RemovedNode().push_back(s); - for (auto s : m_RemovedPaths) - data.RemovedPath().push_back(s); + CircuitType::Invalidate(); } //----------------------------------------------------------------------------- template diff --git a/projects/biogears/libBiogears/include/biogears/cdm/circuit/electrical/SEElectricalCircuit.h b/projects/biogears/libBiogears/include/biogears/cdm/circuit/electrical/SEElectricalCircuit.h index 9419b2952..61a15a495 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/circuit/electrical/SEElectricalCircuit.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/circuit/electrical/SEElectricalCircuit.h @@ -12,21 +12,31 @@ specific language governing permissions and limitations under the License. #pragma once #include +#include #include #include +#include + +#pragma warning(disable:4661) namespace std { -BG_EXT template class BIOGEARS_API vector; -BG_EXT template class BIOGEARS_API vector; -BG_EXT template class BIOGEARS_API map*>; -BG_EXT template class BIOGEARS_API map; +extern template class vector; +extern template class map*>; +extern template class map; } +#pragma warning(default:4661) + + +#define ELECTRICAL_CIRCUIT_TYPES SEElectricalCircuitNode, SEElectricalCircuitPath +#define ELECTRICAL_LEDGER_TYPES SEElectricalCircuitNode, SEElectricalCircuitPath, SEElectricalCircuit + namespace biogears { class SECircuitManager; -BG_EXT template class BIOGEARS_API SECircuit; +#pragma warning(disable: 4661) +extern template class SECircuit; -class BIOGEARS_API SEElectricalCircuit : public SECircuit { +class BIOGEARS_API SEElectricalCircuit : public SECircuit { friend class SECircuitManager; protected: @@ -45,4 +55,7 @@ class BIOGEARS_API SEElectricalCircuit : public SECircuit; +#pragma warning(default : 4661) +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/circuit/electrical/SEElectricalCircuitCalculator.h b/projects/biogears/libBiogears/include/biogears/cdm/circuit/electrical/SEElectricalCircuitCalculator.h index 05dd1a631..4a540ac95 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/circuit/electrical/SEElectricalCircuitCalculator.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/circuit/electrical/SEElectricalCircuitCalculator.h @@ -22,8 +22,8 @@ specific language governing permissions and limitations under the License. #include namespace biogears { - -BG_EXT template class BIOGEARS_API SECircuitCalculator; +#pragma warning(disable : 4661) +extern template class SECircuitCalculator; class BIOGEARS_API SEElectricalCircuitCalculator : public SECircuitCalculator { public: @@ -31,4 +31,5 @@ class BIOGEARS_API SEElectricalCircuitCalculator : public SECircuitCalculator #include #include -#include namespace biogears { class SECircuitManager; @@ -32,13 +31,7 @@ class BIOGEARS_API SEElectricalCircuitNode : public SECircuitNode; + class BIOGEARS_API SEElectricalCircuitPath : public SECircuitPath { friend class SECircuitManager; friend io::Circuit; @@ -36,13 +39,7 @@ class BIOGEARS_API SEElectricalCircuitPath : public SECircuitPath #include +#include #include #include +#include +#pragma warning(disable : 4661) namespace std { -BG_EXT template class BIOGEARS_API vector; -BG_EXT template class BIOGEARS_API vector; -BG_EXT template class BIOGEARS_API map*>; -BG_EXT template class BIOGEARS_API map; +extern template class vector; +extern template class vector; +extern template class map*>; +extern template class map; } +#pragma warning(default : 4661) +#define FLUID_CIRCUIT_TYPES SEFluidCircuitNode, SEFluidCircuitPath + +#define FLUID_LEDGER_TYPES SEFluidCircuitNode, SEFluidCircuitPath, SEFluidCircuit namespace biogears { class SECircuitManager; namespace io { class Circuit; } -BG_EXT template class BIOGEARS_API SECircuit; +#pragma warning(disable : 4661) +extern template class SECircuit; -class BIOGEARS_API SEFluidCircuit : public SECircuit { +class BIOGEARS_API SEFluidCircuit : public SECircuit { friend class SECircuitManager; friend io::Circuit; @@ -54,4 +62,7 @@ class BIOGEARS_API SEFluidCircuit : public SECircuit; +#pragma warning(default : 4661) +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/circuit/fluid/SEFluidCircuitCalculator.h b/projects/biogears/libBiogears/include/biogears/cdm/circuit/fluid/SEFluidCircuitCalculator.h index e3900de94..8c709adb4 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/circuit/fluid/SEFluidCircuitCalculator.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/circuit/fluid/SEFluidCircuitCalculator.h @@ -22,7 +22,9 @@ specific language governing permissions and limitations under the License. #include namespace biogears { -BG_EXT template class BIOGEARS_API SECircuitCalculator; +#pragma warning(disable : 4661) + +extern template class SECircuitCalculator; class BIOGEARS_API SEFluidCircuitCalculator : public SECircuitCalculator { public: @@ -30,4 +32,6 @@ class BIOGEARS_API SEFluidCircuitCalculator : public SECircuitCalculator #include #include -#include namespace biogears { class SECircuitManager; @@ -30,13 +29,7 @@ class BIOGEARS_API SEFluidCircuitNode : public SECircuitNode public: virtual ~SEFluidCircuitNode(); - virtual void Clear(); //clear memory - - virtual bool Load(const CDM::FluidCircuitNodeData& in); - virtual CDM::FluidCircuitNodeData* Unload() const; - -protected: - virtual void Unload(CDM::FluidCircuitNodeData& data) const; + virtual void Invalidate(); //clear memory public: virtual bool HasPressure() const; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/circuit/fluid/SEFluidCircuitPath.h b/projects/biogears/libBiogears/include/biogears/cdm/circuit/fluid/SEFluidCircuitPath.h index a8ce7b044..5060c3b43 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/circuit/fluid/SEFluidCircuitPath.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/circuit/fluid/SEFluidCircuitPath.h @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once +#include #include #include #include @@ -25,6 +26,10 @@ class SECircuitManager; namespace io { class Circuit; } +#pragma warning(disable : 4661) + +extern template class SECircuitPath; + class BIOGEARS_API SEFluidCircuitPath : public SECircuitPath { friend class SECircuitManager; friend io::Circuit; @@ -36,13 +41,7 @@ class BIOGEARS_API SEFluidCircuitPath : public SECircuitPath public: virtual ~SEFluidCircuitPath(); - virtual void Clear(); //clear memory - - bool Load(const CDM::FluidCircuitPathData& in); - CDM::FluidCircuitPathData* Unload() const; - -protected: - void Unload(CDM::FluidCircuitPathData& data) const; + virtual void Invalidate(); // clear memory public: virtual SEFluidCircuitNode& GetSourceNode() const { return m_FluidSourceNode; } @@ -108,13 +107,15 @@ class BIOGEARS_API SEFluidCircuitPath : public SECircuitPath virtual double GetValveBreakdownPressure(const PressureUnit& unit) const; virtual bool HasCardiovascularRegion() const; - CDM::enumResistancePathType::value GetCardiovascularRegion() const; - void SetCardiovascularRegion(CDM::enumResistancePathType::value pType); + SEResistancePathType GetCardiovascularRegion() const; + void SetCardiovascularRegion(SEResistancePathType pType); void InvalidateCardiovascularRegion(); protected: SEFluidCircuitNode& m_FluidSourceNode; SEFluidCircuitNode& m_FluidTargetNode; - CDM::enumResistancePathType::value m_CardiovascularRegion; + SEResistancePathType m_CardiovascularRegion; }; +#pragma warning(default : 4661) + } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/circuit/thermal/SEThermalCircuit.h b/projects/biogears/libBiogears/include/biogears/cdm/circuit/thermal/SEThermalCircuit.h index 77162c395..5cdca5d80 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/circuit/thermal/SEThermalCircuit.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/circuit/thermal/SEThermalCircuit.h @@ -16,22 +16,32 @@ specific language governing permissions and limitations under the License. #include #include +#include #include #include +#include + +#pragma warning(disable : 4661) namespace std { -BG_EXT template class BIOGEARS_API vector; -BG_EXT template class BIOGEARS_API vector; -BG_EXT template class BIOGEARS_API map*>; -BG_EXT template class BIOGEARS_API map; +extern template class vector; +extern template class vector; +extern template class map*>; +extern template class map; } +#pragma warning(default : 4661) + + +#define THERMAL_CIRCUIT_TYPES SEThermalCircuitNode, SEThermalCircuitPath +#define THERMAL_LEDGER_TYPES SEThermalCircuitNode, SEThermalCircuitPath, SEThermalCircuit namespace biogears { class SECircuitManager; +#pragma warning(disable : 4661) -BG_EXT template class BIOGEARS_API SECircuit; +extern template class SECircuit; -class BIOGEARS_API SEThermalCircuit : public SECircuit { +class BIOGEARS_API SEThermalCircuit : public SECircuit { friend class SECircuitManager; protected: @@ -51,4 +61,8 @@ class BIOGEARS_API SEThermalCircuit : public SECircuit; +#pragma warning(default : 4661) + +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/circuit/thermal/SEThermalCircuitCalculator.h b/projects/biogears/libBiogears/include/biogears/cdm/circuit/thermal/SEThermalCircuitCalculator.h index 5bf55b3fb..330c68a0a 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/circuit/thermal/SEThermalCircuitCalculator.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/circuit/thermal/SEThermalCircuitCalculator.h @@ -22,8 +22,9 @@ specific language governing permissions and limitations under the License. #include namespace biogears { +#pragma warning(disable : 4661) -BG_EXT template class BIOGEARS_API SECircuitCalculator; +extern template class SECircuitCalculator; class BIOGEARS_API SEThermalCircuitCalculator : public SECircuitCalculator { public: @@ -31,4 +32,6 @@ class BIOGEARS_API SEThermalCircuitCalculator : public SECircuitCalculator; class BIOGEARS_API SEThermalCircuitPath : public SECircuitPath { friend class SECircuitManager; @@ -37,13 +40,7 @@ class BIOGEARS_API SEThermalCircuitPath : public SECircuitPath #include #include -#include -CDM_BIND_DECL(CompartmentData) namespace biogears { @@ -42,13 +40,7 @@ class BIOGEARS_API SECompartment : public Loggable { public: virtual ~SECompartment() override; - virtual void Clear(); - - virtual bool Load(const CDM::CompartmentData& in, SECircuitManager* circuits = nullptr); - virtual CDM::CompartmentData* Unload() = 0; - -protected: - virtual void Unload(CDM::CompartmentData& data); + virtual void Invalidate(); public: virtual std::string GetName() const; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentGraph.h b/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentGraph.h index e53d31bf3..843313368 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentGraph.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentGraph.h @@ -30,7 +30,7 @@ class SECompartmentGraph : public Loggable { public: virtual ~SECompartmentGraph(); - virtual void Clear(); + virtual void Invalidate(); public: virtual std::string GetName() const; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentGraph.inl b/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentGraph.inl index 854d8ed3b..4bd0fd321 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentGraph.inl +++ b/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentGraph.inl @@ -29,11 +29,11 @@ SECompartmentGraph::SECompartmentGraph(const std::strin template SECompartmentGraph::~SECompartmentGraph() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- template -void SECompartmentGraph::Clear() +void SECompartmentGraph::Invalidate() { m_Compartments.clear(); m_CompartmentLinks.clear(); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentLink.h b/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentLink.h index 232d3ba6c..5264ba1e9 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentLink.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentLink.h @@ -13,7 +13,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -CDM_BIND_DECL(CompartmentLinkData) namespace biogears { class SECircuitManager; @@ -31,17 +30,11 @@ class BIOGEARS_API SECompartmentLink : public Loggable { public: virtual ~SECompartmentLink(); - virtual void Clear(); - - virtual bool Load(const CDM::CompartmentLinkData& in, SECircuitManager* circuits = nullptr); - virtual CDM::CompartmentLinkData* Unload() = 0; + virtual void Invalidate(); virtual bool operator==(const SECompartmentLink& rhs) const = 0; virtual bool operator!=(const SECompartmentLink& rhs) const = 0; -protected: - virtual void Unload(CDM::CompartmentLinkData& data); - public: virtual std::string GetName() const; virtual const char* GetName_cStr() const; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentManager.h b/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentManager.h index cc64d0632..4babba264 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentManager.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentManager.h @@ -11,65 +11,63 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once +#include #include #include -#include #include #include #include +#include #include #include #include #include #include -#include -CDM_BIND_DECL(CompartmentManagerData) + +#pragma warning(disable : 4661) namespace std { - BG_EXT template class BIOGEARS_API vector ; - BG_EXT template class BIOGEARS_API map ; - BG_EXT template class BIOGEARS_API vector ; - BG_EXT template class BIOGEARS_API map ; - BG_EXT template class BIOGEARS_API vector ; - BG_EXT template class BIOGEARS_API map ; - BG_EXT template class BIOGEARS_API vector ; - - BG_EXT template class BIOGEARS_API vector ; - BG_EXT template class BIOGEARS_API map ; - BG_EXT template class BIOGEARS_API vector ; - BG_EXT template class BIOGEARS_API map ; - BG_EXT template class BIOGEARS_API vector ; - BG_EXT template class BIOGEARS_API map ; - - BG_EXT template class BIOGEARS_API vector ; - BG_EXT template class BIOGEARS_API map ; - BG_EXT template class BIOGEARS_API vector ; - BG_EXT template class BIOGEARS_API map ; - - BG_EXT template class BIOGEARS_API vector ; - BG_EXT template class BIOGEARS_API map ; +extern template class vector; +extern template class map; +extern template class vector; +extern template class map; +extern template class vector; +extern template class map; +extern template class vector; + +extern template class vector; +extern template class map; +extern template class vector; +extern template class map; +extern template class vector; +extern template class map; + +extern template class vector; +extern template class map; +extern template class vector; +extern template class map; + +extern template class vector; +extern template class map; } +#pragma warning(default : 4661) + namespace biogears { - namespace io { +namespace io { class Compartment; } class BIOGEARS_API SECompartmentManager : public Loggable { friend io::Compartment; + public: SECompartmentManager(SESubstanceManager& subMgr); virtual ~SECompartmentManager(); - virtual void Clear(); //clear memory - - virtual bool Load(const CDM::CompartmentManagerData& in, SECircuitManager* circuits = nullptr); - virtual CDM::CompartmentManagerData* Unload() const; - -protected: - void Unload(CDM::CompartmentManagerData& data) const; + virtual void Invalidate(); // clear memory public: virtual void StateChange(); // Identify leaves and other bookkeeping @@ -77,12 +75,12 @@ class BIOGEARS_API SECompartmentManager : public Loggable { virtual void UpdateLinks(SEGasCompartmentGraph& graph); virtual void UpdateLinks(SELiquidCompartmentGraph& graph); - virtual bool HasCompartment(CDM::enumCompartmentType::value type, const char* name) const; - virtual bool HasCompartment(CDM::enumCompartmentType::value type, const std::string& name) const; - virtual SECompartment* GetCompartment(CDM::enumCompartmentType::value type, const char* name); - virtual SECompartment* GetCompartment(CDM::enumCompartmentType::value type, const std::string& name); - virtual const SECompartment* GetCompartment(CDM::enumCompartmentType::value type, const char* name) const; - virtual const SECompartment* GetCompartment(CDM::enumCompartmentType::value type, const std::string& name) const; + virtual bool HasCompartment(SECompartmentType type, const char* name) const; + virtual bool HasCompartment(SECompartmentType type, const std::string& name) const; + virtual SECompartment* GetCompartment(SECompartmentType type, const char* name); + virtual SECompartment* GetCompartment(SECompartmentType type, const std::string& name); + virtual const SECompartment* GetCompartment(SECompartmentType type, const char* name) const; + virtual const SECompartment* GetCompartment(SECompartmentType type, const std::string& name) const; virtual SEGasCompartment& CreateGasCompartment(const char* name); virtual SEGasCompartment& CreateGasCompartment(const std::string& name); @@ -90,7 +88,7 @@ class BIOGEARS_API SECompartmentManager : public Loggable { virtual void DeleteGasCompartment(const std::string& name); virtual bool HasGasCompartment(const char* name) const; virtual bool HasGasCompartment(const std::string& name) const; - virtual SEGasCompartment* GetGasCompartment(const char* name); + virtual SEGasCompartment* GetGasCompartment(const char* name); virtual SEGasCompartment* GetGasCompartment(const std::string& name); virtual const SEGasCompartment* GetGasCompartment(const char* name) const; virtual const SEGasCompartment* GetGasCompartment(const std::string& name) const; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentNodes.h b/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentNodes.h index f25539084..e30b7cf53 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentNodes.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentNodes.h @@ -33,7 +33,7 @@ class SECompartmentNodes : public Loggable { SECompartmentNodes(Logger* logger); virtual ~SECompartmentNodes(); - virtual void Clear(); + virtual void Invalidate(); virtual void StateChange(); //analyze and cache for optimization virtual bool HasMapping() const { return !m_AllNodes.empty(); } @@ -62,9 +62,12 @@ class SECompartmentNodes : public Loggable { PotentialScalar* m_Potential; }; -BG_EXT template class BIOGEARS_API SECompartmentNodes; -BG_EXT template class BIOGEARS_API SECompartmentNodes; -BG_EXT template class BIOGEARS_API SECompartmentNodes; +#pragma warning(disable : 4661) + +extern template class SECompartmentNodes; +extern template class SECompartmentNodes; +extern template class SECompartmentNodes; +#pragma warning(default : 4661) } #include diff --git a/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentNodes.inl b/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentNodes.inl index 235eab1c3..1ac270dcc 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentNodes.inl +++ b/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentNodes.inl @@ -25,16 +25,21 @@ SECompartmentNodes::SECompartmentNodes(Logger* logger) template SECompartmentNodes::~SECompartmentNodes() { - Clear(); + SAFE_DELETE(m_Quantity); + SAFE_DELETE(m_Potential); } template -void SECompartmentNodes::Clear() +void SECompartmentNodes::Invalidate() { m_QuantityNodes.clear(); m_AllNodes.clear(); - SAFE_DELETE(m_Quantity); - SAFE_DELETE(m_Potential); + if (m_Quantity && m_Quantity->IsValid()) { + m_Quantity->Invalidate(); + } + if (m_Potential && m_Potential->IsValid()) { + m_Potential->Invalidate(); + } } template diff --git a/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentTransportGraph.h b/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentTransportGraph.h index 8f189022b..3fc597f07 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentTransportGraph.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentTransportGraph.h @@ -20,7 +20,7 @@ specific language governing permissions and limitations under the License. #define COMPARTMENT_TRANSPORT_GRAPH_TYPES GraphType, GraphVertexType, GraphEdgeType, CompartmentType, CompartmentLinkType namespace biogears { - +#pragma warning(disable : 4661) template class SECompartmentTransportGraph : public GraphType, public SECompartmentGraph { @@ -29,13 +29,7 @@ class SECompartmentTransportGraph : public GraphType, public SECompartmentGraph< SECompartmentTransportGraph(const std::string& name, Logger* logger); virtual ~SECompartmentTransportGraph(); - virtual void Clear() override; - /* - virtual bool Load(const BindType& in); - virtual BindType* Unload() = 0; -protected: - virtual void Unload(BindType& data); -*/ + virtual void Invalidate() override; public: virtual std::string GetName() const override; @@ -55,4 +49,5 @@ class SECompartmentTransportGraph : public GraphType, public SECompartmentGraph< std::map*> m_SourceEdgeMap; std::map*> m_TargetEdgeMap; }; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentTransportGraph.inl b/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentTransportGraph.inl index 695ca7c61..b306e30c2 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentTransportGraph.inl +++ b/projects/biogears/libBiogears/include/biogears/cdm/compartment/SECompartmentTransportGraph.inl @@ -29,14 +29,14 @@ SECompartmentTransportGraph::SECompartmentTra template SECompartmentTransportGraph::~SECompartmentTransportGraph() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- template -void SECompartmentTransportGraph::Clear() +void SECompartmentTransportGraph::Invalidate() { - SECompartmentGraph::Clear(); + SECompartmentGraph::Invalidate(); for (auto& itr : m_TargetEdgeMap) delete itr.second; for (auto& itr : m_SourceEdgeMap) diff --git a/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SEFluidCompartment.h b/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SEFluidCompartment.h index b452bd22c..4ed639699 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SEFluidCompartment.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SEFluidCompartment.h @@ -1,3 +1,4 @@ + /************************************************************************************** Copyright 2015 Applied Research Associates, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use @@ -11,7 +12,10 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once +#include +#include #include + // Project Includes #include #include @@ -20,15 +24,10 @@ specific language governing permissions and limitations under the License. #include #include #include -#include namespace biogears { class SESubstance; -class SEScalarPressure; -class PressureUnit; -class SEScalarVolumePerTime; -class VolumePerTimeUnit; namespace io { class Compartment; @@ -40,6 +39,7 @@ class SEFluidCompartmentLink; #define FLUID_COMPARTMENT_TEMPLATE typename LinkType, typename VertexType, typename TransportSubstanceType, typename SubstanceQuantityType #define FLUID_COMPARTMENT_TYPES LinkType, VertexType, TransportSubstanceType, SubstanceQuantityType +#pragma warning(disable : 4661) template class SEFluidCompartment : public SECompartment, public VertexType { friend io::Compartment; @@ -54,16 +54,11 @@ class SEFluidCompartment : public SECompartment, public VertexType { public: virtual ~SEFluidCompartment(); - void Clear() override; - - virtual bool Load(const CDM::FluidCompartmentData& in, SECircuitManager* circuits = nullptr); - CDM::FluidCompartmentData* Unload() override = 0; + void Invalidate() override; virtual bool operator==(SEFluidCompartment const&) const = 0; virtual bool operator!=(SEFluidCompartment const&) const = 0; -protected: - virtual void Unload(CDM::FluidCompartmentData& data); public: std::string GetName() const override; @@ -118,7 +113,7 @@ class SEFluidCompartment : public SECompartment, public VertexType { virtual double CalculateOutFlow_mL_Per_s() const; virtual std::vector& GetTransportSubstances() override { return m_TransportSubstances; } - virtual std::vectorconst & GetTransportSubstances() const override { return m_TransportSubstances; } + virtual std::vector const& GetTransportSubstances() const override { return m_TransportSubstances; } SEScalarVolumePerTime* m_InFlow; SEScalarVolumePerTime* m_OutFlow; @@ -134,4 +129,5 @@ class SEFluidCompartment : public SECompartment, public VertexType { std::vector m_FluidChildren; SECompartmentNodes m_Nodes; }; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SEFluidCompartment.inl b/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SEFluidCompartment.inl index fe6ae8f19..b0fc57cde 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SEFluidCompartment.inl +++ b/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SEFluidCompartment.inl @@ -22,7 +22,7 @@ specific language governing permissions and limitations under the License. namespace biogears { template SEFluidCompartment::SEFluidCompartment(const char* name, Logger* logger) - : SEFluidCompartment(std::string{ name }, logger) + : SEFluidCompartment(std::string { name }, logger) { } //----------------------------------------------------------------------------- @@ -40,72 +40,37 @@ SEFluidCompartment::SEFluidCompartment(const std::strin template SEFluidCompartment::~SEFluidCompartment() { - Clear(); -} -//----------------------------------------------------------------------------- -template -void SEFluidCompartment::Clear() -{ - SECompartment::Clear(); + DELETE_VECTOR(m_SubstanceQuantities); SAFE_DELETE(m_InFlow); SAFE_DELETE(m_OutFlow); SAFE_DELETE(m_Pressure); SAFE_DELETE(m_Volume); - m_Links.clear(); - m_FluidChildren.clear(); - DELETE_VECTOR(m_SubstanceQuantities); - m_Nodes.Clear(); } //----------------------------------------------------------------------------- template -bool SEFluidCompartment::Load(const CDM::FluidCompartmentData& in, SECircuitManager* circuits) +void SEFluidCompartment::Invalidate() { - if (!SECompartment::Load(in, circuits)) - return false; - // Not Loading In/Out Flow, those are calculated on demand - if (!in.Child().empty()) - return true; - else if (!in.Node().empty()) { - if (circuits == nullptr) { - Error("Compartment is mapped to circuit nodes, but no circuit manager was provided, cannot load"); - return false; - } - for (auto name : in.Node()) { - SEFluidCircuitNode* node = circuits->GetFluidNode(name); - if (node == nullptr) { - Error("Compartment is mapped to circuit node, " + std::string{ name } +", but provided circuit manager did not have that node"); - return false; - } - MapNode(*node); - } - } else { // Only load these if you don't have children or nodes - if (in.Pressure().present()) - GetPressure().Load(in.Pressure().get()); - if (in.Volume().present()) - GetVolume().Load(in.Volume().get()); + SECompartment::Invalidate(); + + m_Links.clear(); + m_FluidChildren.clear(); + DELETE_VECTOR(m_SubstanceQuantities); + m_Nodes.Invalidate(); + + if (m_InFlow && !m_InFlow->IsReadOnly()) { + m_InFlow->Invalidate(); + } + if (m_OutFlow && !m_OutFlow->IsReadOnly()) { + m_OutFlow->Invalidate(); + } + if (m_Pressure && !m_Pressure->IsReadOnly()) { + m_Pressure->Invalidate(); + } + if (m_Volume && !m_Volume->IsReadOnly()) { + m_Volume->Invalidate(); } - return true; -} -//----------------------------------------------------------------------------- -template -void SEFluidCompartment::Unload(CDM::FluidCompartmentData& data) -{ - SECompartment::Unload(data); - for (SEFluidCompartment* child : m_FluidChildren) - data.Child().push_back(child->GetName()); - for (SEFluidCircuitNode* nodes : m_Nodes.GetNodes()) - data.Node().push_back(nodes->GetName()); - // Even if you have children or nodes, I am unloading everything, this makes the xml actually usefull... - if (HasInFlow()) - data.InFlow(std::unique_ptr(GetInFlow().Unload())); - if (HasOutFlow()) - data.OutFlow(std::unique_ptr(GetOutFlow().Unload())); - if (HasPressure()) - data.Pressure(std::unique_ptr(GetPressure().Unload())); - if (HasVolume()) - data.Volume(std::unique_ptr(GetVolume().Unload())); } -//----------------------------------------------------------------------------- +////----------------------------------------------------------------------------- template std::string SEFluidCompartment::GetName() const { @@ -121,9 +86,9 @@ const char* SEFluidCompartment::GetName_cStr() const template const SEScalar* SEFluidCompartment::GetScalar(const char* name) { - return GetScalar(std::string{ name }); + return GetScalar(std::string { name }); } -//----------------------------------------------------------------------------- +//-----------------------------------------------------------------------------s template const SEScalar* SEFluidCompartment::GetScalar(const std::string& name) { @@ -388,7 +353,7 @@ template bool SEFluidCompartment::HasSubstanceQuantity(const SESubstance& substance) const { for (SubstanceQuantityType* sq : m_SubstanceQuantities) { - if (&sq->GetSubstance() == &substance) + if (sq->GetSubstance() == substance) return true; } return false; @@ -398,7 +363,7 @@ template SubstanceQuantityType* SEFluidCompartment::GetSubstanceQuantity(const SESubstance& substance) const { for (SubstanceQuantityType* sq : m_SubstanceQuantities) { - if (&sq->GetSubstance() == &substance) + if (sq->GetSubstance() == substance) return sq; } return nullptr; @@ -414,7 +379,7 @@ template void SEFluidCompartment::RemoveSubstanceQuantity(const SESubstance& substance) { for (size_t i = 0; i < m_SubstanceQuantities.size(); i++) { - if (&m_SubstanceQuantities[i]->GetSubstance() == &substance) { + if (m_SubstanceQuantities[i]->GetSubstance() == substance) { SAFE_DELETE(m_SubstanceQuantities[i]); SAFE_DELETE(m_TransportSubstances[i]); // Assumes these are in sync m_SubstanceQuantities.erase(m_SubstanceQuantities.begin() + i); @@ -437,9 +402,9 @@ void SEFluidCompartment::AddLink(LinkType& link) if (!Contains(m_Links, link)) { m_Links.push_back(&link); // Is it incoming or out going? - if (this == &link.GetSourceCompartment()) + if ((void*)this == (void*)&link.GetSourceCompartment()) m_OutgoingLinks.push_back(&link); - else if (this == &link.GetTargetCompartment()) + else if ((void*)this == (void*)&link.GetTargetCompartment()) m_IncomingLinks.push_back(&link); } } @@ -465,7 +430,7 @@ const std::vector& SEFluidCompartment::GetLi template bool SEFluidCompartment::HasChild(const char* name) { - return HasChild( std::string{ name } ); + return HasChild(std::string { name }); } //----------------------------------------------------------------------------- template @@ -478,4 +443,4 @@ bool SEFluidCompartment::HasChild(const std::string& na return false; } //----------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SEFluidCompartmentLink.h b/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SEFluidCompartmentLink.h index 1ecbfb49b..ec34ed5f8 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SEFluidCompartmentLink.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SEFluidCompartmentLink.h @@ -15,7 +15,7 @@ specific language governing permissions and limitations under the License. #include #include -#include + #define FLUID_COMPARTMENT_LINK_TEMPLATE typename EdgeType, typename VertexType, typename CompartmentType #define FLUID_COMPARTMENT_LINK_TYPES EdgeType, VertexType, CompartmentType @@ -25,6 +25,7 @@ namespace io { class Compartment; } +#pragma warning(disable : 4661) template class SEFluidCompartmentLink : public SECompartmentLink, public EdgeType { friend io::Compartment; @@ -36,19 +37,13 @@ class SEFluidCompartmentLink : public SECompartmentLink, public EdgeType { public: virtual ~SEFluidCompartmentLink(); - virtual void Clear() override; - - virtual bool Load(const CDM::FluidCompartmentLinkData& in, SECircuitManager* circuits = nullptr); - virtual CDM::FluidCompartmentLinkData* Unload() override = 0; + virtual void Invalidate() override; bool operator==(const SEFluidCompartmentLink& rhs) const; bool operator!=(const SEFluidCompartmentLink& rhs) const; bool operator==(const SECompartmentLink& rhs) const final; bool operator!=(const SECompartmentLink& rhs) const final; -protected: - virtual void Unload(CDM::FluidCompartmentLinkData& data); - public: virtual const SEScalar* GetScalar(const char* name) override; virtual const SEScalar* GetScalar(const std::string& name) override; @@ -68,7 +63,7 @@ class SEFluidCompartmentLink : public SECompartmentLink, public EdgeType { virtual void RemovePath() { m_Path = nullptr; } virtual void MapPath(SEFluidCircuitPath& path) { - Clear(); + Invalidate(); m_Path = &path; } @@ -88,4 +83,5 @@ class SEFluidCompartmentLink : public SECompartmentLink, public EdgeType { VertexType& m_TargetVertex; SEFluidCircuitPath* m_Path; }; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SEFluidCompartmentLink.inl b/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SEFluidCompartmentLink.inl index 52d30d17c..bd192aaf1 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SEFluidCompartmentLink.inl +++ b/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SEFluidCompartmentLink.inl @@ -39,45 +39,10 @@ template SEFluidCompartmentLink::~SEFluidCompartmentLink() { } + //------------------------------------------------------------------------------- template -bool SEFluidCompartmentLink::Load(const CDM::FluidCompartmentLinkData& in, SECircuitManager* circuits) -{ - if (!SECompartmentLink::Load(in, circuits)) - return false; - if (in.Path().present()) { - if (circuits == nullptr) { - Error("Link is mapped to circuit path, " + std::string { in.Path().get() } + ", but no circuit manager was provided, cannot load"); - return false; - } - SEFluidCircuitPath* path = circuits->GetFluidPath(in.Path().get()); - if (path == nullptr) { - Error("Link is mapped to circuit path, " + std::string { in.Path().get() } + ", but provided circuit manager did not have that path"); - return false; - } - MapPath(*path); - } else { - if (in.Flow().present()) - const_cast(GetFlow()).Load(in.Flow().get()); - } - return true; -} -//------------------------------------------------------------------------------- -template -void SEFluidCompartmentLink::Unload(CDM::FluidCompartmentLinkData& data) -{ - SECompartmentLink::Unload(data); - data.SourceCompartment(m_SourceCmpt.GetName()); - data.TargetCompartment(m_TargetCmpt.GetName()); - if (m_Path != nullptr) - data.Path(m_Path->GetName()); - // Even if you have a path, I am unloading everything, this makes the xml actually usefull... - if (HasFlow()) - data.Flow(std::unique_ptr(GetFlow().Unload())); -} -//------------------------------------------------------------------------------- -template -void SEFluidCompartmentLink::Clear() +void SEFluidCompartmentLink::Invalidate() { m_Path = nullptr; SAFE_DELETE(m_Flow); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SEGasCompartment.h b/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SEGasCompartment.h index 92b3a7590..f94c49158 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SEGasCompartment.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SEGasCompartment.h @@ -20,6 +20,7 @@ specific language governing permissions and limitations under the License. #include namespace biogears { +class SESubstanceManager; namespace io { class Compartment; } @@ -28,6 +29,8 @@ enum class BalanceGasBy { Volume, VolumeFraction }; class SECompartmentManager; +#pragma warning(disable : 4661) + class BIOGEARS_API SEGasCompartment : public SEFluidCompartment { friend class SECompartmentManager; friend io::Compartment; @@ -39,16 +42,11 @@ class BIOGEARS_API SEGasCompartment : public SEFluidCompartment m_Children; std::vector m_Leaves; }; +#pragma warning(default : 4661) + } //namespace biogears +#pragma warning(disable : 4661) + namespace std { -BG_EXT template class BIOGEARS_API vector; -BG_EXT template class BIOGEARS_API map; +extern template class vector; +//extern template class map; } +#pragma warning(default : 4661) diff --git a/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SEGasCompartmentGraph.h b/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SEGasCompartmentGraph.h index 688e7bdbd..54632f8c8 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SEGasCompartmentGraph.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SEGasCompartmentGraph.h @@ -15,27 +15,30 @@ specific language governing permissions and limitations under the License. #include #include #include -#include + #include #include -CDM_BIND_DECL(GasCompartmentGraphData); +#pragma warning(disable : 4661) namespace std { -BG_EXT template class BIOGEARS_API vector; -BG_EXT template class BIOGEARS_API vector; -BG_EXT template class BIOGEARS_API map; -BG_EXT template class BIOGEARS_API map*>; +extern template class vector; +extern template class vector; +extern template class map; +extern template class map*>; } + + namespace biogears { class SECompartmentManager; namespace io { class Compartment; } + class BIOGEARS_API SEGasCompartmentGraph : public SECompartmentTransportGraph { friend class SECompartmentManager; friend io::Compartment; @@ -49,18 +52,15 @@ class BIOGEARS_API SEGasCompartmentGraph : public SECompartmentTransportGraph ; - BG_EXT template class BIOGEARS_API map ; -} \ No newline at end of file + extern template class vector ; + extern template class map ; +} +#pragma warning(default : 4661) \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SEGasCompartmentLink.h b/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SEGasCompartmentLink.h index e3ae2bcd8..a3c71de3e 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SEGasCompartmentLink.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SEGasCompartmentLink.h @@ -31,11 +31,12 @@ class BIOGEARS_API SEGasCompartmentLink : public SEFluidCompartmentLink; -BG_EXT template class BIOGEARS_API map; +extern template class vector; +extern template class map; } +#pragma warning(default:4661) diff --git a/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SELiquidCompartment.h b/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SELiquidCompartment.h index 8c86a153c..9803916b0 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SELiquidCompartment.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SELiquidCompartment.h @@ -18,26 +18,30 @@ specific language governing permissions and limitations under the License. #include #include #include -#include -#include + #include #include +#include namespace biogears { class SETissueCompartment; class SECompartmentManager; +class SESubstanceManager; class SELiquidSubstanceQuantity; namespace io { class Compartment; } + + +#pragma warning(disable : 4661) +extern template class SEFluidCompartment; class BIOGEARS_API SELiquidCompartment : public SEFluidCompartment { friend class SETissueCompartment; friend class SECompartmentManager; friend class SELiquidSubstanceQuantity; friend io::Compartment; - protected: SELiquidCompartment(const char* name, Logger* logger); SELiquidCompartment(const std::string& name, Logger* logger); @@ -45,19 +49,13 @@ class BIOGEARS_API SELiquidCompartment : public SEFluidCompartment const&) const override; bool operator!=(SEFluidCompartment const&) const override; -protected: - virtual void Unload(CDM::LiquidCompartmentData& data); - public: virtual const SEScalar* GetScalar(const char* name) override; virtual const SEScalar* GetScalar(const std::string& name) override; @@ -87,9 +85,12 @@ class BIOGEARS_API SELiquidCompartment : public SEFluidCompartment m_Children; std::vector m_Leaves; }; -} //namespace biogears +#pragma warning(default : 4661) +} // namespace biogears +#pragma warning(disable : 4661) -namespace std{ -BG_EXT template class BIOGEARS_API vector; -BG_EXT template class BIOGEARS_API map; +namespace std { +extern template class vector; +extern template class map; } +#pragma warning(default : 4661) diff --git a/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SELiquidCompartmentGraph.h b/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SELiquidCompartmentGraph.h index 34eaa924e..db7c8a392 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SELiquidCompartmentGraph.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SELiquidCompartmentGraph.h @@ -15,14 +15,13 @@ specific language governing permissions and limitations under the License. #include #include #include -#include + #include #include #include -CDM_BIND_DECL(LiquidCompartmentGraphData) namespace biogears { class SECompartmentManager; @@ -30,15 +29,20 @@ namespace io { class Compartment; } } //namespace biogears +#pragma warning(disable : 4661) namespace std { -BG_EXT template class BIOGEARS_API vector; -BG_EXT template class BIOGEARS_API vector; -BG_EXT template class BIOGEARS_API map; -BG_EXT template class BIOGEARS_API map*>; +extern template class vector; +extern template class vector; +extern template class map; +extern template class map*>; } +#pragma warning(default : 4661) + namespace biogears { +#pragma warning(disable : 4661) + class BIOGEARS_API SELiquidCompartmentGraph : public SECompartmentTransportGraph { friend class SECompartmentManager; friend io::Compartment; @@ -52,18 +56,18 @@ class BIOGEARS_API SELiquidCompartmentGraph : public SECompartmentTransportGraph void AddGraph(SELiquidCompartmentGraph& graph); - virtual bool Load(const CDM::LiquidCompartmentGraphData& in, SECompartmentManager& cmptMgr); - virtual CDM::LiquidCompartmentGraphData* Unload(); - -protected: - virtual void Unload(CDM::LiquidCompartmentGraphData& data); protected: void BalanceByIntensive() override; }; +#pragma warning(default : 4661) + } //namespace biogears +#pragma warning(disable : 4661) namespace std { -BG_EXT template class BIOGEARS_API vector; -BG_EXT template class BIOGEARS_API map; +extern template class vector; +extern template class map; +#pragma warning(default : 4661) + } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SELiquidCompartmentLink.h b/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SELiquidCompartmentLink.h index df58d438a..bff2f88f0 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SELiquidCompartmentLink.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/compartment/fluid/SELiquidCompartmentLink.h @@ -14,7 +14,7 @@ specific language governing permissions and limitations under the License. #include #include -#include + #include #include @@ -23,6 +23,11 @@ specific language governing permissions and limitations under the License. namespace biogears { class SELiquidCompartment; class SECompartmentManager; + +#pragma warning(disable : 4661) + +extern template class SEFluidCompartmentLink; + class BIOGEARS_API SELiquidCompartmentLink : public SEFluidCompartmentLink { friend class SECompartmentManager; @@ -33,11 +38,14 @@ class BIOGEARS_API SELiquidCompartmentLink : public SEFluidCompartmentLink; -BG_EXT template class BIOGEARS_API map; -} \ No newline at end of file +extern template class vector; +extern template class map; +} +#pragma warning(default : 4661) diff --git a/projects/biogears/libBiogears/include/biogears/cdm/compartment/substances/SEGasSubstanceQuantity.h b/projects/biogears/libBiogears/include/biogears/cdm/compartment/substances/SEGasSubstanceQuantity.h index e0c1fc10f..71436bf20 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/compartment/substances/SEGasSubstanceQuantity.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/compartment/substances/SEGasSubstanceQuantity.h @@ -32,11 +32,8 @@ class BIOGEARS_API SEGasSubstanceQuantity : public SESubstanceQuantity, public S public: virtual ~SEGasSubstanceQuantity(); - virtual void Clear() override; virtual void Invalidate() override; - - virtual bool Load(const CDM::GasSubstanceQuantityData& in); - virtual CDM::GasSubstanceQuantityData* Unload() override; + virtual void MakeInvalid() override; bool operator==(SEGasTransportSubstance const&) const override; bool operator!=(SEGasTransportSubstance const&) const override; @@ -45,9 +42,6 @@ class BIOGEARS_API SEGasSubstanceQuantity : public SESubstanceQuantity, public S bool operator==(const SEGasSubstanceQuantity&) const; bool operator!=(const SEGasSubstanceQuantity&) const; -protected: - virtual void Unload(CDM::GasSubstanceQuantityData& data); - public: virtual void SetToZero(); virtual const SEScalar* GetScalar(const char* name) override; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/compartment/substances/SELiquidSubstanceQuantity.h b/projects/biogears/libBiogears/include/biogears/cdm/compartment/substances/SELiquidSubstanceQuantity.h index 729cbe4bb..0596e0dfd 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/compartment/substances/SELiquidSubstanceQuantity.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/compartment/substances/SELiquidSubstanceQuantity.h @@ -42,11 +42,9 @@ class BIOGEARS_API SELiquidSubstanceQuantity : public SESubstanceQuantity, publi public: virtual ~SELiquidSubstanceQuantity(); - virtual void Clear() override; virtual void Invalidate() override; + virtual void MakeInvalid() override; - virtual bool Load(const CDM::LiquidSubstanceQuantityData& in); - virtual CDM::LiquidSubstanceQuantityData* Unload() override; bool operator==(SELiquidTransportSubstance const&) const override; bool operator!=(SELiquidTransportSubstance const&) const override; @@ -55,8 +53,6 @@ class BIOGEARS_API SELiquidSubstanceQuantity : public SESubstanceQuantity, publi bool operator==(SELiquidSubstanceQuantity const&) const; bool operator!=(SELiquidSubstanceQuantity const&) const; -protected: - virtual void Unload(CDM::LiquidSubstanceQuantityData& data); public: virtual void SetToZero(); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/compartment/substances/SESubstanceQuantity.h b/projects/biogears/libBiogears/include/biogears/cdm/compartment/substances/SESubstanceQuantity.h index e8703cb56..9a1e6e016 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/compartment/substances/SESubstanceQuantity.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/compartment/substances/SESubstanceQuantity.h @@ -12,7 +12,7 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include + namespace biogears { namespace io { @@ -26,18 +26,12 @@ class BIOGEARS_API SESubstanceQuantity : public Loggable { virtual ~SESubstanceQuantity() override; - virtual void Clear() = 0; //clear memory - virtual void Invalidate() = 0; + virtual void Invalidate() = 0; //clear memory + virtual void MakeInvalid() = 0; virtual bool operator==(SESubstanceQuantity const&) const = 0; virtual bool operator!=(SESubstanceQuantity const&) const = 0; - virtual bool Load(const CDM::SubstanceQuantityData& in); - virtual CDM::SubstanceQuantityData* Unload() = 0; - -protected: - virtual void Unload(CDM::SubstanceQuantityData& data); - public: virtual SESubstance& GetSubstance() const { return m_Substance; } diff --git a/projects/biogears/libBiogears/include/biogears/cdm/compartment/thermal/SEThermalCompartment.h b/projects/biogears/libBiogears/include/biogears/cdm/compartment/thermal/SEThermalCompartment.h index e4d389313..2322106ec 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/compartment/thermal/SEThermalCompartment.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/compartment/thermal/SEThermalCompartment.h @@ -13,18 +13,15 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include #include #include #include -CDM_BIND_DECL(ThermalCompartmentData) namespace biogears { class SEThermalCompartmentLink; -class SEScalarPower; -class PowerUnit; class SECompartmentManager; namespace io { @@ -44,17 +41,11 @@ class BIOGEARS_API SEThermalCompartment : public SECompartment { public: virtual ~SEThermalCompartment() override; - virtual void Clear() override; - - virtual bool Load(const CDM::ThermalCompartmentData& in, SECircuitManager* circuits = nullptr); - virtual CDM::ThermalCompartmentData* Unload() override; + virtual void Invalidate() override; bool operator==(SEThermalCompartment const&) const; bool operator!=(SEThermalCompartment const&) const; -protected: - virtual void Unload(CDM::ThermalCompartmentData& data); - public: virtual const SEScalar* GetScalar(const std::string& name) override; virtual const SEScalar* GetScalar(const char* name) override; @@ -112,8 +103,10 @@ class BIOGEARS_API SEThermalCompartment : public SECompartment { SECompartmentNodes m_Nodes; }; } // namespace biogears +#pragma warning(disable : 4661) namespace std { -BG_EXT template class BIOGEARS_API vector; -BG_EXT template class BIOGEARS_API map; -} \ No newline at end of file +extern template class vector; +extern template class map; +} +#pragma warning(default : 4661) diff --git a/projects/biogears/libBiogears/include/biogears/cdm/compartment/thermal/SEThermalCompartmentLink.h b/projects/biogears/libBiogears/include/biogears/cdm/compartment/thermal/SEThermalCompartmentLink.h index 4f20c6083..de5535a48 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/compartment/thermal/SEThermalCompartmentLink.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/compartment/thermal/SEThermalCompartmentLink.h @@ -15,7 +15,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include + #include #include @@ -37,19 +37,14 @@ class BIOGEARS_API SEThermalCompartmentLink : public SECompartmentLink { public: virtual ~SEThermalCompartmentLink(); - virtual void Clear() override; + virtual void Invalidate() override; - virtual bool Load(const CDM::ThermalCompartmentLinkData& in, SECircuitManager* circuits = nullptr); - virtual CDM::ThermalCompartmentLinkData* Unload() override; bool operator==(const SEThermalCompartmentLink& rhs) const; bool operator!=(const SEThermalCompartmentLink& rhs) const; bool operator==(const SECompartmentLink& rhs) const final; bool operator!=(const SECompartmentLink& rhs) const final; -protected: - virtual void Unload(CDM::ThermalCompartmentLinkData& data); - public: virtual const SEScalar* GetScalar(const char* name) override; virtual const SEScalar* GetScalar(const std::string& name) override; @@ -66,7 +61,7 @@ class BIOGEARS_API SEThermalCompartmentLink : public SECompartmentLink { virtual void RemovePath() { m_Path = nullptr; } virtual void MapPath(SEThermalCircuitPath& path) { - Clear(); + Invalidate(); m_Path = &path; } @@ -77,10 +72,11 @@ class BIOGEARS_API SEThermalCompartmentLink : public SECompartmentLink { SEThermalCircuitPath* m_Path; }; } +#pragma warning(disable : 4661) namespace std { -BG_EXT template class BIOGEARS_API vector; -BG_EXT template class BIOGEARS_API map; +extern template class vector; +extern template class map; } #include @@ -91,4 +87,7 @@ class SEThermalCompartmentGraph : public SECompartmentGraph #include -#include +#include #include #include #include namespace biogears { -class SEScalar0To1; class SESubstance; class SESubstanceManager; class SELiquidCompartment; -class SEScalarMassPerMass; -class MassPerMassUnit; -class SEScalarElectricPotential; -class ElectricPotentialUnit; -class SEScalarMass; -class MassUnit; class SECompartmentManager; namespace io { @@ -49,13 +42,8 @@ class BIOGEARS_API SETissueCompartment : public SECompartment { public: virtual ~SETissueCompartment(); - virtual void Clear() override; + virtual void Invalidate() override; - virtual bool Load(const CDM::TissueCompartmentData& in, SESubstanceManager& subMgr, SECircuitManager* circuits = nullptr); - virtual CDM::TissueCompartmentData* Unload() override; - -protected: - virtual void Unload(CDM::TissueCompartmentData& data); public: virtual const SEScalar* GetScalar(const char* name) override; @@ -123,8 +111,10 @@ class BIOGEARS_API SETissueCompartment : public SECompartment { std::vector m_Leaves; }; } //namespac biogears +#pragma warning(default : 4661) namespace std { - BG_EXT template class BIOGEARS_API vector ; - BG_EXT template class BIOGEARS_API map ; -} \ No newline at end of file + extern template class vector ; + extern template class map ; +} +#pragma warning(disable : 4661) diff --git a/projects/biogears/libBiogears/include/biogears/cdm/engine/PhysiologyEngine.h b/projects/biogears/libBiogears/include/biogears/cdm/engine/PhysiologyEngine.h index 27feea22e..bbedc21b0 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/engine/PhysiologyEngine.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/engine/PhysiologyEngine.h @@ -16,7 +16,6 @@ specific language governing permissions and limitations under the License. #include #include #include -#include namespace biogears { class SEEventHandler; @@ -80,22 +79,6 @@ class BIOGEARS_API PhysiologyEngine { virtual bool LoadState(const std::string& file, const SEScalarTime* simTime = nullptr) = 0; virtual bool LoadState(char const* buffer, size_t size) = 0; - //!------------------------------------------------------------------------------------------------- - //! \brief - //! Reset engine and set it to the state in the provided file. - //! You may provided a Simulation Time to be used if desired. - //! It will be reflected in the GetSimulationTime method. - //! Return value indicates engine was able to load provided state file. - //! Engine will be in a cleared state if this method fails. - //!------------------------------------------------------------------------------------------------- - virtual bool LoadState(const CDM::PhysiologyEngineStateData& state, const SEScalarTime* simTime = nullptr) = 0; - - //!------------------------------------------------------------------------------------------------- - //! \brief - //! State object will be returned. - //! Engine will be in a cleared state if this method fails. - //!------------------------------------------------------------------------------------------------- - virtual std::unique_ptr GetStateData() = 0; //!------------------------------------------------------------------------------------------------- //! \brief //! Save the current state of the engine. diff --git a/projects/biogears/libBiogears/include/biogears/cdm/engine/PhysiologyEngineConfiguration.h b/projects/biogears/libBiogears/include/biogears/cdm/engine/PhysiologyEngineConfiguration.h index 533f3c96e..35dc882bf 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/engine/PhysiologyEngineConfiguration.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/engine/PhysiologyEngineConfiguration.h @@ -12,9 +12,7 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include - -CDM_BIND_DECL(PhysiologyEngineConfigurationData) +#include namespace biogears { class SEElectroCardioGramInterpolator; @@ -22,8 +20,6 @@ class PhysiologyEngineStabilization; class PhysiologyEngineTimedStabilization; class PhysiologyEngineDynamicStabilization; class SEPatient; -class SEScalarTime; -class TimeUnit; namespace io { class EngineConfiguration; } @@ -34,13 +30,10 @@ class BIOGEARS_API PhysiologyEngineConfiguration : public Loggable { virtual ~PhysiologyEngineConfiguration(); - virtual void Clear(); + virtual void Invalidate(); virtual void Merge(const PhysiologyEngineConfiguration& from); - virtual bool Load(const CDM::PhysiologyEngineConfigurationData& in); - virtual CDM::PhysiologyEngineConfigurationData* Unload() const; - virtual bool Load(const char* file); virtual bool Load(const std::string& file); @@ -71,12 +64,9 @@ class BIOGEARS_API PhysiologyEngineConfiguration : public Loggable { virtual SEScalarTime& GetTimeStep(); virtual double GetTimeStep(const TimeUnit& unit) const; - virtual bool HasWritePatientBaselineFile() const { return m_WritePatientBaselineFile != (CDM::enumOnOff::value)-1; } - virtual bool WritePatientBaselineFile() const { return m_WritePatientBaselineFile == CDM::enumOnOff::On; } - virtual void SetWritePatientBaselineFile(CDM::enumOnOff::value v) { m_WritePatientBaselineFile = v; } - -protected: - void Unload(CDM::PhysiologyEngineConfigurationData& data) const; + virtual bool HasWritePatientBaselineFile() const { return m_WritePatientBaselineFile != SEOnOff::Invalid; } + virtual bool WritePatientBaselineFile() const { return m_WritePatientBaselineFile == SEOnOff::On; } + virtual void SetWritePatientBaselineFile(SEOnOff v) { m_WritePatientBaselineFile = v; } protected: bool m_Merge; @@ -89,6 +79,6 @@ class BIOGEARS_API PhysiologyEngineConfiguration : public Loggable { std::unique_ptr m_Patient; std::unique_ptr m_overrideMode; - CDM::enumOnOff::value m_WritePatientBaselineFile; + SEOnOff m_WritePatientBaselineFile; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/engine/PhysiologyEngineDynamicStabilization.h b/projects/biogears/libBiogears/include/biogears/cdm/engine/PhysiologyEngineDynamicStabilization.h index 5b00e410b..b8fde80fb 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/engine/PhysiologyEngineDynamicStabilization.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/engine/PhysiologyEngineDynamicStabilization.h @@ -14,7 +14,7 @@ specific language governing permissions and limitations under the License. #include #include -#include + namespace biogears { class TimeUnit; @@ -59,7 +59,6 @@ class BIOGEARS_API PropertyConvergence : public Loggable { }; class PhysiologyEngineDynamicStabilization; -CDM_BIND_DECL(PhysiologyEngineDynamicStabilizationCriteriaData) class BIOGEARS_API PhysiologyEngineDynamicStabilizationCriteria : public Loggable { friend PhysiologyEngineDynamicStabilization; friend io::EngineConfiguration; @@ -69,12 +68,7 @@ class BIOGEARS_API PhysiologyEngineDynamicStabilizationCriteria : public Loggabl virtual ~PhysiologyEngineDynamicStabilizationCriteria(); - virtual void Clear(); - virtual bool Load(const CDM::PhysiologyEngineDynamicStabilizationCriteriaData& in); - virtual CDM::PhysiologyEngineDynamicStabilizationCriteriaData* Unload() const; - -protected: - virtual void Unload(CDM::PhysiologyEngineDynamicStabilizationCriteriaData& data) const; + virtual void Invalidate(); public: virtual std::string GetName() const; @@ -150,20 +144,13 @@ class BIOGEARS_API PhysiologyEngineDynamicStabilizer : public Loggable { const std::vector& m_properties; }; -CDM_BIND_DECL(PhysiologyEngineDynamicStabilizationData) class PhysiologyEngineDynamicStabilization : public PhysiologyEngineStabilization { public: friend io::EngineConfiguration; BIOGEARS_API PhysiologyEngineDynamicStabilization(Logger* logger); BIOGEARS_API virtual ~PhysiologyEngineDynamicStabilization(); - BIOGEARS_API virtual void Clear() override; - - BIOGEARS_API virtual bool Load(const CDM::PhysiologyEngineDynamicStabilizationData& in); - BIOGEARS_API virtual CDM::PhysiologyEngineDynamicStabilizationData* Unload() const override; - -protected: - BIOGEARS_API virtual void Unload(CDM::PhysiologyEngineDynamicStabilizationData& data) const; + BIOGEARS_API virtual void Invalidate() override; public: BIOGEARS_API virtual bool Load(const char* file) override; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/engine/PhysiologyEngineStabilization.h b/projects/biogears/libBiogears/include/biogears/cdm/engine/PhysiologyEngineStabilization.h index 06930ff0e..685b43b86 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/engine/PhysiologyEngineStabilization.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/engine/PhysiologyEngineStabilization.h @@ -15,9 +15,6 @@ specific language governing permissions and limitations under the License. #include -#include - -CDM_BIND_DECL(PhysiologyEngineStabilizationData) namespace biogears { class PhysiologyEngine; @@ -25,22 +22,21 @@ class PhysiologyEngineTrack; class PhysiologyEngineConfiguration; class SECondition; +namespace io { + class EngineConfiguration; +} class PhysiologyEngineStabilization : public Loggable { + friend io::EngineConfiguration; + public: BIOGEARS_API PhysiologyEngineStabilization(Logger* logger); BIOGEARS_API virtual ~PhysiologyEngineStabilization(); - BIOGEARS_API virtual void Clear(); - - BIOGEARS_API virtual bool Load(const CDM::PhysiologyEngineStabilizationData& in); - BIOGEARS_API virtual CDM::PhysiologyEngineStabilizationData* Unload() const; + BIOGEARS_API virtual void Invalidate(); BIOGEARS_API bool operator==(PhysiologyEngineStabilization const&) const; BIOGEARS_API bool operator!=(PhysiologyEngineStabilization const&) const; -protected: - BIOGEARS_API virtual void Unload(CDM::PhysiologyEngineStabilizationData& data) const; - public: BIOGEARS_API virtual bool Load(const char* file) = 0; BIOGEARS_API virtual bool Load(const std::string& file) = 0; @@ -62,7 +58,7 @@ class PhysiologyEngineStabilization : public Loggable { protected: bool m_Canceled; bool m_LogProgress; - SEScalarTime* m_currentTime; + SEScalarTime* m_CurrentTime; std::stringstream m_ss; SEScalarTime* m_StabilizationDuration; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/engine/PhysiologyEngineTimedStabilization.h b/projects/biogears/libBiogears/include/biogears/cdm/engine/PhysiologyEngineTimedStabilization.h index 68a76f526..5df1141f0 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/engine/PhysiologyEngineTimedStabilization.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/engine/PhysiologyEngineTimedStabilization.h @@ -14,9 +14,7 @@ specific language governing permissions and limitations under the License. #include #include -#include -CDM_BIND_DECL(PhysiologyEngineTimedConditionStabilizationData) namespace biogears { namespace io { @@ -29,17 +27,11 @@ class BIOGEARS_API PhysiologyEngineTimedStabilizationCriteria : public Loggable PhysiologyEngineTimedStabilizationCriteria(Logger* logger); virtual ~PhysiologyEngineTimedStabilizationCriteria(); - virtual void Clear(); + virtual void Invalidate(); - virtual bool Load(const CDM::PhysiologyEngineTimedConditionStabilizationData& in); - virtual CDM::PhysiologyEngineTimedConditionStabilizationData* Unload() const; - - bool operator==(PhysiologyEngineTimedStabilizationCriteria const&) const; + bool operator==(PhysiologyEngineTimedStabilizationCriteria const&) const; bool operator!=(PhysiologyEngineTimedStabilizationCriteria const&) const; -protected: - virtual void Unload(CDM::PhysiologyEngineTimedConditionStabilizationData& data) const; - public: virtual std::string GetName() const; virtual const char* GetName_cStr() const; @@ -57,24 +49,17 @@ class BIOGEARS_API PhysiologyEngineTimedStabilizationCriteria : public Loggable SEScalarTime m_Time; }; -CDM_BIND_DECL(PhysiologyEngineTimedStabilizationData) class PhysiologyEngineTimedStabilization : public PhysiologyEngineStabilization { public: friend io::EngineConfiguration; BIOGEARS_API PhysiologyEngineTimedStabilization(Logger* logger); BIOGEARS_API virtual ~PhysiologyEngineTimedStabilization(); - BIOGEARS_API virtual void Clear() override; - - BIOGEARS_API virtual bool Load(const CDM::PhysiologyEngineTimedStabilizationData& in); - BIOGEARS_API virtual CDM::PhysiologyEngineTimedStabilizationData* Unload() const override; + BIOGEARS_API virtual void Invalidate() override; BIOGEARS_API bool operator==(PhysiologyEngineTimedStabilization const&) const; BIOGEARS_API bool operator!=(PhysiologyEngineTimedStabilization const&) const; -protected: - BIOGEARS_API virtual void Unload(CDM::PhysiologyEngineTimedStabilizationData& data) const; - public: BIOGEARS_API virtual bool Load(const char* file) override; BIOGEARS_API virtual bool Load(const std::string& file) override; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/engine/PhysiologyEngineTrack.h b/projects/biogears/libBiogears/include/biogears/cdm/engine/PhysiologyEngineTrack.h index 9e638e799..554be406e 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/engine/PhysiologyEngineTrack.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/engine/PhysiologyEngineTrack.h @@ -16,6 +16,7 @@ specific language governing permissions and limitations under the License. #include #include #include +#include #include #include #include @@ -30,9 +31,13 @@ specific language governing permissions and limitations under the License. #include #include +#pragma warning(disable : 4661) + namespace std { - BG_EXT template class BIOGEARS_API vector; +extern template class vector; } +#pragma warning(default : 4661) + namespace biogears { enum class CompartmentUpdate { None, @@ -84,11 +89,13 @@ class BIOGEARS_API SEDataRequestScalar : public SEGenericScalar { // Tissue cmpts don't have children and they don't have computed data that changes on call (like flow) }; -} //namespac biogears +} // namespac biogears +#pragma warning(disable : 4661) namespace std { -BG_EXT template class BIOGEARS_API map; +extern template class map; } // Namespace std +#pragma warning(default : 4661) namespace biogears { std::ostream& operator<<(std::ostream& os, SEDataRequestScalar& v); @@ -104,12 +111,12 @@ class BIOGEARS_API PhysiologyEngineTrack : public Loggable { PhysiologyEngineTrack& operator=(PhysiologyEngineTrack&& rhs); virtual ~PhysiologyEngineTrack(); - void Clear(); // Remove all requests and close the results file + void Invalidate(); // Remove all requests and close the results file DataTrack& GetDataTrack(); - DataTrack const & GetDataTrack() const; - SEDataRequestManager& GetDataRequestManager(); - SEDataRequestManager const & GetDataRequestManager()const; + DataTrack const& GetDataTrack() const; + SEDataRequestManager& GetDataRequestManager(); + SEDataRequestManager const& GetDataRequestManager() const; void ResetFile(); // Close file, so next Track Data will re hook up everything and make a new file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/enums/SEActionEnums.h b/projects/biogears/libBiogears/include/biogears/cdm/enums/SEActionEnums.h new file mode 100644 index 000000000..e17c51ecf --- /dev/null +++ b/projects/biogears/libBiogears/include/biogears/cdm/enums/SEActionEnums.h @@ -0,0 +1,45 @@ +/************************************************************************************** +Copyright 2019 Applied Research Associates, Inc. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the License +at: +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +**************************************************************************************/ + +#pragma once + +#include + +namespace biogears { + +enum class SESerializationType { + Invalid = -1, + Load = 0, + Save, +}; + + +inline std::string ToString(const SESerializationType& bit) +{ + switch (bit) { + case SESerializationType::Load: + return "Load"; + case SESerializationType::Save: + return "Save"; + default: + return "Invalid"; + } +} + + +inline std::ostream& operator<<(std::ostream& os, const SESerializationType& pt) +{ + os << ToString(pt); + return os; +} + +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/enums/SEAnesthesiaEnums.h b/projects/biogears/libBiogears/include/biogears/cdm/enums/SEAnesthesiaEnums.h new file mode 100644 index 000000000..2b38296a5 --- /dev/null +++ b/projects/biogears/libBiogears/include/biogears/cdm/enums/SEAnesthesiaEnums.h @@ -0,0 +1,124 @@ +/************************************************************************************** +Copyright 2019 Applied Research Associates, Inc. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the License +at: +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +**************************************************************************************/ + +#pragma once + +#include + +namespace biogears { + +enum class SEAnesthesiaMachineEvent { + Invalid = -1, + OxygenBottle1Exhausted = 0, + OxygenBottle2Exhausted, + ReliefValveActive, +}; + +enum class SEAnesthesiaMachineOxygenSource { + Invalid = -1, + Wall = 0, + BottleOne, + BottleTwo, +}; + +enum class SEAnesthesiaMachinePrimaryGas { + Invalid = -1, + Air = 0, + Nitrogen, +}; + +enum class SEAnesthesiaMachineConnection { + Invalid = -1, + Off = 0, + Mask, + Tube, +}; + +inline std::string ToString(const SEAnesthesiaMachineEvent& bit) +{ + switch (bit) { + case SEAnesthesiaMachineEvent::OxygenBottle1Exhausted: + return "OxygenBottle1Exhausted"; + case SEAnesthesiaMachineEvent::OxygenBottle2Exhausted: + return "OxygenBottle2Exhausted"; + case SEAnesthesiaMachineEvent::ReliefValveActive: + return "ReliefValveActive"; + default: + return "Invalid"; + } +} + +inline std::string ToString(const SEAnesthesiaMachineOxygenSource& bit) +{ + switch (bit) { + case SEAnesthesiaMachineOxygenSource::Wall: + return "Wall"; + case SEAnesthesiaMachineOxygenSource::BottleOne: + return "BottleOne"; + case SEAnesthesiaMachineOxygenSource::BottleTwo: + return "BottleTwo"; + default: + return "Invalid"; + } +} + +inline std::string ToString(const SEAnesthesiaMachinePrimaryGas& bit) +{ + switch (bit) { + case SEAnesthesiaMachinePrimaryGas::Air: + return "Air"; + case SEAnesthesiaMachinePrimaryGas::Nitrogen: + return "Nitrogen"; + default: + return "Invalid"; + } +} + +inline std::string ToString(const SEAnesthesiaMachineConnection& bit) +{ + switch (bit) { + case SEAnesthesiaMachineConnection::Off: + return "Off"; + case SEAnesthesiaMachineConnection::Mask: + return "Mask"; + case SEAnesthesiaMachineConnection::Tube: + return "Tube"; + default: + return "Invalid"; + } +} + +inline std::ostream& operator<<(std::ostream& os, const SEAnesthesiaMachineEvent& pt) +{ + os << ToString(pt); + return os; +} + +inline std::ostream& operator<<(std::ostream& os, const SEAnesthesiaMachineOxygenSource& pt) +{ + os << ToString(pt); + return os; +} + +inline std::ostream& operator<<(std::ostream& os, const SEAnesthesiaMachinePrimaryGas& pt) +{ + os << ToString(pt); + return os; +} + +inline std::ostream& operator<<(std::ostream& os, const SEAnesthesiaMachineConnection& pt) +{ + os << ToString(pt); + return os; +} + +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/enums/SECircuitEnums.h b/projects/biogears/libBiogears/include/biogears/cdm/enums/SECircuitEnums.h new file mode 100644 index 000000000..04a597023 --- /dev/null +++ b/projects/biogears/libBiogears/include/biogears/cdm/enums/SECircuitEnums.h @@ -0,0 +1,80 @@ +/************************************************************************************** +Copyright 2019 Applied Research Associates, Inc. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the License +at: +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +**************************************************************************************/ + +#pragma once + +#include + +namespace biogears { + +enum class SECircuitType { + Invalid = -1, + Electrical= 0, + Fluid, + Thermal, +}; + +enum class SEResistancePathType { + Invalid = -1, + Cerebral = 0, + Extrasplanchnic, + Muscle, + Splanchnic, + Myocardium +}; + + +inline std::string ToString(const SECircuitType& bit) +{ + switch (bit) { + case SECircuitType::Electrical: + return "Electrical"; + case SECircuitType::Fluid: + return "Fluid"; + case SECircuitType::Thermal: + return "Thermal"; + default: + return "Invalid"; + } +} + +inline std::string ToString(const SEResistancePathType& bit) +{ + switch (bit) { + case SEResistancePathType::Cerebral: + return "Cerebral"; + case SEResistancePathType::Extrasplanchnic: + return "Extrasplanchnic"; + case SEResistancePathType::Muscle: + return "Muscle"; + case SEResistancePathType::Splanchnic: + return "Splanchnic"; + case SEResistancePathType::Myocardium: + return "Myocardium"; + default: + return "Invalid"; + } +} + +inline std::ostream& operator<<(std::ostream& os, const SECircuitType& pt) +{ + os << ToString(pt); + return os; +} + +inline std::ostream& operator<<(std::ostream& os, const SEResistancePathType& pt) +{ + os << ToString(pt); + return os; +} + +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/enums/SECompartmentEnums.h b/projects/biogears/libBiogears/include/biogears/cdm/enums/SECompartmentEnums.h new file mode 100644 index 000000000..3b578f8cd --- /dev/null +++ b/projects/biogears/libBiogears/include/biogears/cdm/enums/SECompartmentEnums.h @@ -0,0 +1,51 @@ +/************************************************************************************** +Copyright 2019 Applied Research Associates, Inc. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the License +at: +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +**************************************************************************************/ +#pragma once + +#include + +namespace biogears { +enum class SECompartmentType { + Invalid = -1, + Electrical = 0, + Gas, + Liquid, + Thermal, + Tissue, +}; + +inline std::string ToString(const SECompartmentType& e) +{ + switch (e) { + case SECompartmentType::Electrical: + return "Electrical"; + case SECompartmentType::Gas: + return "Gas"; + case SECompartmentType::Liquid: + return "Liquid"; + case SECompartmentType::Thermal: + return "Thermal"; + case SECompartmentType::Tissue: + return "Tissue"; + + default: + return "Invalid"; + } +} + +inline std::ostream& operator<<(std::ostream& os, const SECompartmentType& e) +{ + os << ToString(e); + return os; +} + +} \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/enums/SEEnvironmentEnums.h b/projects/biogears/libBiogears/include/biogears/cdm/enums/SEEnvironmentEnums.h new file mode 100644 index 000000000..9a93f8f11 --- /dev/null +++ b/projects/biogears/libBiogears/include/biogears/cdm/enums/SEEnvironmentEnums.h @@ -0,0 +1,42 @@ +/************************************************************************************** +Copyright 2019 Applied Research Associates, Inc. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the License +at: +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +**************************************************************************************/ +#pragma once + +#include + +namespace biogears { +enum class SESurroundingType { + Invalid = -1, + Air = 0, + Water, +}; + +inline std::string ToString(const SESurroundingType& e) +{ + switch (e) { + case SESurroundingType::Air: + return "Air"; + case SESurroundingType::Water: + return "Water"; + default: + return "Invalid"; + } +} + + +inline std::ostream& operator<<(std::ostream& os, const SESurroundingType& e) +{ + os << ToString(e); + return os; +} + +} \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/PatientActionsEnums.h b/projects/biogears/libBiogears/include/biogears/cdm/enums/SEPatientActionsEnums.h similarity index 71% rename from projects/biogears/libBiogears/include/biogears/cdm/patient/actions/PatientActionsEnums.h rename to projects/biogears/libBiogears/include/biogears/cdm/enums/SEPatientActionsEnums.h index 67aaab1ea..900d31189 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/PatientActionsEnums.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/enums/SEPatientActionsEnums.h @@ -16,7 +16,6 @@ specific language governing permissions and limitations under the License. namespace biogears { - enum class SEBrainInjuryType { Invalid = -1, Diffuse = 0, @@ -31,11 +30,35 @@ enum class SEBolusAdministration { Intravenous }; +enum class SEBurnDegree { + Invalid = -1, + First = 0, + Second, + Third +}; + +enum class SEFracturedBone { + Invalid = -1, + Radius = 0, + Tibia +}; + +enum class SEFractureType { + Invalid = -1, + Transverse = 0, + Oblique, + Spiral, + Segmented, + Comminuted +}; + enum class SEInfectionSeverity { - Eliminated, + Invalid = -1, + Eliminated = 0, Mild, Moderate, - Severe + Severe, + }; enum class SEIntubationType { @@ -49,9 +72,13 @@ enum class SEIntubationType { enum class SEPatientAssessmentType { Invalid = -1, - PulmonaryFunctionTest = 0, + ArterialBloodGasAnalysis = 0, + PulmonaryFunctionTest, + ProthrombinTime, + PsychomotorVigilanceTask, CompleteBloodCount, ComprehensiveMetabolicPanel, + SequentialOrganFailureAssessment, Urinalysis }; @@ -100,6 +127,52 @@ inline std::string ToString(const SEBolusAdministration& ba) return "Invalid"; } } + +inline std::string ToString(const SEBurnDegree& bd) +{ + switch (bd) { + + case SEBurnDegree ::First: + return "First"; + case SEBurnDegree::Second: + return "Second"; + case SEBurnDegree::Third: + return "Third"; + default: + return "Invalid"; + } +} + +inline std::string ToString(const SEFracturedBone& fb) +{ + switch (fb) { + case SEFracturedBone::Radius: + return "Radius"; + case SEFracturedBone::Tibia: + return "Tibia"; + default: + return "Invalid"; + } +} + +inline std::string ToString(const SEFractureType& ft) +{ + switch (ft) { + case SEFractureType::Transverse: + return "Transverse"; + case SEFractureType::Oblique: + return "Oblique"; + case SEFractureType::Spiral: + return "Spiral"; + case SEFractureType::Segmented: + return "Segmented"; + case SEFractureType::Comminuted: + return "Comminuted"; + default: + return "Invalid"; + } +} + inline std::string ToString(const SEInfectionSeverity& ba) { switch (ba) { @@ -135,12 +208,20 @@ inline std::string ToString(const SEIntubationType& it) inline std::string ToString(const SEPatientAssessmentType& pa) { switch (pa) { + case SEPatientAssessmentType::ArterialBloodGasAnalysis: + return "ArterialBloodGasAnalysis"; case SEPatientAssessmentType::PulmonaryFunctionTest: return "PulmonaryFunctionTest"; + case SEPatientAssessmentType::ProthrombinTime: + return "ProthrombinTime"; + case SEPatientAssessmentType::PsychomotorVigilanceTask: + return "PsychomotorVigilanceTask"; case SEPatientAssessmentType::CompleteBloodCount: return "CompleteBloodCount"; case SEPatientAssessmentType::ComprehensiveMetabolicPanel: return "ComprehensiveMetabolicPanel"; + case SEPatientAssessmentType::SequentialOrganFailureAssessment: + return "SequentialOrganFailureAssessment"; case SEPatientAssessmentType::Urinalysis: return "Urinalysis"; default: @@ -193,6 +274,21 @@ inline std::ostream& operator<<(std::ostream& os, const SEBolusAdministration& b os << ToString(ba); return os; } +inline std::ostream& operator<<(std::ostream& os, const SEBurnDegree& bd) +{ + os << ToString(bd); + return os; +} +inline std::ostream& operator<<(std::ostream& os, const SEFracturedBone& fb) +{ + os << ToString(fb); + return os; +} +inline std::ostream& operator<<(std::ostream& os, const SEFractureType& ft) +{ + os << ToString(ft); + return os; +} inline std::ostream& operator<<(std::ostream& os, const SEInfectionSeverity& is) { os << ToString(is); @@ -223,5 +319,4 @@ inline std::ostream& operator<<(std::ostream& os, const SETourniquetApplicationT os << ToString(pt); return os; } - } diff --git a/projects/biogears/libBiogears/include/biogears/cdm/enums/SEPatientAssessmentEnums.h b/projects/biogears/libBiogears/include/biogears/cdm/enums/SEPatientAssessmentEnums.h new file mode 100644 index 000000000..a7b8f9ca5 --- /dev/null +++ b/projects/biogears/libBiogears/include/biogears/cdm/enums/SEPatientAssessmentEnums.h @@ -0,0 +1,143 @@ +/************************************************************************************** +Copyright 2019 Applied Research Associates, Inc. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the License +at: +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +**************************************************************************************/ +#pragma once + +#include + +namespace biogears { +enum class SEPresenceIndicator { + Invalid = -1, + Positive = 0, + Negative +}; + +enum class SEClarityIndicator { + Invalid = -1, + Clear = 0, + SlightlyCloudy, + Cloudy, + Turbid +}; + +enum class SEUrineColor { + Invalid = -1, + PaleYellow = 0, + Yellow, + DarkYellow, + Pink +}; + +enum class SEMicroscopicObservationType { + Invalid = -1, + LowPowerField = 0, + HighPowerField +}; + +enum class SEMicroscopicObservationAmount { + Invalid = -1, + Few = 0, + Moderate, + Many +}; + +inline std::string ToString(const SEPresenceIndicator& e) +{ + switch (e) { + case SEPresenceIndicator::Positive: + return "Positive"; + case SEPresenceIndicator::Negative: + return "Negative"; + default: + return "Invalid"; + } +} +inline std::string ToString(const SEClarityIndicator& e) +{ + switch (e) { + case SEClarityIndicator::Clear: + return "Clear"; + case SEClarityIndicator::SlightlyCloudy: + return "SlightlyCloudy"; + case SEClarityIndicator::Cloudy: + return "Cloudy"; + case SEClarityIndicator::Turbid: + return "Turbid"; + default: + return "Invalid"; + } +} +inline std::string ToString(const SEUrineColor& e) +{ + switch (e) { + case SEUrineColor::PaleYellow: + return "PaleYellow"; + case SEUrineColor::Yellow: + return "Yellow"; + case SEUrineColor::DarkYellow: + return "DarkYellow"; + case SEUrineColor::Pink: + return "Pink"; + default: + return "Invalid"; + } +} +inline std::string ToString(const SEMicroscopicObservationType& e) +{ + switch (e) { + case SEMicroscopicObservationType::LowPowerField: + return "LowPowerField"; + case SEMicroscopicObservationType::HighPowerField: + return "HighPowerField"; + default: + return "Invalid"; + } +} +inline std::string ToString(const SEMicroscopicObservationAmount& e) +{ + switch (e) { + case SEMicroscopicObservationAmount::Few: + return "Few"; + case SEMicroscopicObservationAmount::Moderate: + return "Moderate"; + case SEMicroscopicObservationAmount::Many: + return "Many"; + default: + return "Invalid"; + } +} + +inline std::ostream& operator<<(std::ostream& os, const SEPresenceIndicator& e) +{ + os << ToString(e); + return os; +} +inline std::ostream& operator<<(std::ostream& os, const SEClarityIndicator& e) +{ + os << ToString(e); + return os; +} +inline std::ostream& operator<<(std::ostream& os, const SEUrineColor& e) +{ + os << ToString(e); + return os; +} +inline std::ostream& operator<<(std::ostream& os, const SEMicroscopicObservationType& e) +{ + os << ToString(e); + return os; +} +inline std::ostream& operator<<(std::ostream& os, const SEMicroscopicObservationAmount& e) +{ + os << ToString(e); + return os; +} +} \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/enums/SEPatientEnums.h b/projects/biogears/libBiogears/include/biogears/cdm/enums/SEPatientEnums.h new file mode 100644 index 000000000..9ed10dabe --- /dev/null +++ b/projects/biogears/libBiogears/include/biogears/cdm/enums/SEPatientEnums.h @@ -0,0 +1,335 @@ +/************************************************************************************** +Copyright 2019 Applied Research Associates, Inc. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the License +at: +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +**************************************************************************************/ +#pragma once + +#include + +namespace biogears { +enum class SESex { + Invalid = -1, + Male = 0, + Female, + +}; + +enum class SEBloodType { + Invalid = -1, + A = 0, + B, + AB, + O +}; +enum class SEPatientEventType { + Invalid = -1, + AcuteLungInjury = 0, + AcuteRespiratoryDistress, + Antidiuresis, + Asystole, + Bradycardia, + Bradypnea, + BrainOxygenDeficit, + CardiacArrest, + CardiogenicShock, + CompartmentSyndromeLeftArm, + CompartmentSyndromeRightArm, + CompartmentSyndromeLeftLeg, + CompartmentSyndromeRightLeg, + CompartmentSyndromeAbdominal, + CriticalBrainOxygenDeficit, + Dehydration, + Diuresis, + MildDiarrhea, + SevereDiarrhea, + Fasciculation, + Fatigue, + FlaccidParalysis, + FunctionalIncontinence, + MildHeadache, + SevereHeadache, + HemolyticTransfusionReaction, + Hypercapnia, + Hyperglycemia, + MildDiaphoresis, + ModerateDiaphoresis, + SevereDiaphoresis, + MildHyperkalemia, + SevereHyperkalemia, + MildHypernatremia, + SevereHypernatremia, + Hyperthermia, + Hypoglycemia, + HypoglycemicShock, + HypoglycemicComa, + MildHypothermia, + ModerateHypothermia, + SevereHypothermia, + MildHypokalemia, + SevereHypokalemia, + MildHyponatremia, + SevereHyponatremia, + Hypoxia, + HypovolemicShock, + IntracranialHypertension, + IntracranialHypotension, + IrreversibleState, + Ketoacidosis, + LacticAcidosis, + LiverGlycogenDepleted, + MaximumPulmonaryVentilationRate, + MetabolicAcidosis, + MetabolicAlkalosis, + MildWeakness, + ModerateWeakness, + MildSecretions, + ModerateSecretions, + MuscleCatabolism, + MuscleGlycogenDepleted, + MyocardiumOxygenDeficit, + Natriuresis, + Nausea, + NutritionDepleted, + PulselessRhythm, + RenalHypoperfusion, + RespiratoryAcidosis, + RespiratoryAlkalosis, + SevereAcuteRespiratoryDistress, + SevereSecretions, + Seizures, + Shivering, + StartOfCardiacCycle, + StartOfExhale, + StartOfInhale, + SevereSepsis, + Tachycardia, + Tachypnea, + Vomiting, + _TotalPatientEvents, + // helpers for iterating over the enum + _begin = 0, + _end = _TotalPatientEvents +}; + +inline std::string ToString(const SESex& e) +{ + switch (e) { + case SESex::Male: + return "Male"; + case SESex::Female: + return "Female"; + default: + return "Invalid"; + } +} +inline std::string ToString(const SEBloodType& e) +{ + switch (e) { + case SEBloodType::A: + return "A"; + case SEBloodType::B: + return "B"; + case SEBloodType::AB: + return "AB"; + case SEBloodType::O: + return "O"; + default: + return "Invalid"; + } +} +inline std::string ToString(const SEPatientEventType& e) +{ + switch (e) { + case SEPatientEventType::AcuteLungInjury: + return "AcuteLungInjury"; + case SEPatientEventType::AcuteRespiratoryDistress: + return "AcuteRespiratoryDistress"; + case SEPatientEventType::Antidiuresis: + return "Antidiuresis"; + case SEPatientEventType::Asystole: + return "Asystole"; + case SEPatientEventType::Bradycardia: + return "Bradycardia"; + case SEPatientEventType::Bradypnea: + return "Bradypnea"; + case SEPatientEventType::BrainOxygenDeficit: + return "BrainOxygenDeficit"; + case SEPatientEventType::CardiacArrest: + return "CardiacArrest"; + case SEPatientEventType::CardiogenicShock: + return "CardiogenicShock"; + case SEPatientEventType::CompartmentSyndromeLeftArm: + return "CompartmentSyndromeLeftArm"; + case SEPatientEventType::CompartmentSyndromeRightArm: + return "CompartmentSyndromeRightArm"; + case SEPatientEventType::CompartmentSyndromeLeftLeg: + return "CompartmentSyndromeLeftLeg"; + case SEPatientEventType::CompartmentSyndromeRightLeg: + return "CompartmentSyndromeRightLeg"; + case SEPatientEventType::CompartmentSyndromeAbdominal: + return "CompartmentSyndromeAbdominal"; + case SEPatientEventType::CriticalBrainOxygenDeficit: + return "CriticalBrainOxygenDeficit"; + case SEPatientEventType::Dehydration: + return "Dehydration"; + case SEPatientEventType::Diuresis: + return "Diuresis"; + case SEPatientEventType::MildDiarrhea: + return "MildDiarrhea"; + case SEPatientEventType::SevereDiarrhea: + return "SevereDiarrhea"; + case SEPatientEventType::Fasciculation: + return "Fasciculation"; + case SEPatientEventType::Fatigue: + return "Fatigue"; + case SEPatientEventType::FlaccidParalysis: + return "FlaccidParalysis"; + case SEPatientEventType::FunctionalIncontinence: + return "FunctionalIncontinence"; + case SEPatientEventType::MildHeadache: + return "MildHeadache"; + case SEPatientEventType::SevereHeadache: + return "SevereHeadache"; + case SEPatientEventType::HemolyticTransfusionReaction: + return "HemolyticTransfusionReaction"; + case SEPatientEventType::Hypercapnia: + return "Hypercapnia"; + case SEPatientEventType::Hyperglycemia: + return "Hyperglycemia"; + case SEPatientEventType::MildDiaphoresis: + return "MildDiaphoresis"; + case SEPatientEventType::ModerateDiaphoresis: + return "ModerateDiaphoresis"; + case SEPatientEventType::SevereDiaphoresis: + return "SevereDiaphoresis"; + case SEPatientEventType::MildHyperkalemia: + return "MildHyperkalemia"; + case SEPatientEventType::SevereHyperkalemia: + return "SevereHyperkalemia"; + case SEPatientEventType::MildHypernatremia: + return "MildHypernatremia"; + case SEPatientEventType::SevereHypernatremia: + return "SevereHypernatremia"; + case SEPatientEventType::Hyperthermia: + return "Hyperthermia"; + case SEPatientEventType::Hypoglycemia: + return "Hypoglycemia"; + case SEPatientEventType::HypoglycemicShock: + return "HypoglycemicShock"; + case SEPatientEventType::HypoglycemicComa: + return "HypoglycemicComa"; + case SEPatientEventType::MildHypothermia: + return "MildHypothermia"; + case SEPatientEventType::ModerateHypothermia: + return "ModerateHypothermia"; + case SEPatientEventType::SevereHypothermia: + return "SevereHypothermia"; + case SEPatientEventType::MildHypokalemia: + return "MildHypokalemia"; + case SEPatientEventType::SevereHypokalemia: + return "SevereHypokalemia"; + case SEPatientEventType::MildHyponatremia: + return "MildHyponatremia"; + case SEPatientEventType::SevereHyponatremia: + return "SevereHyponatremia"; + case SEPatientEventType::Hypoxia: + return "Hypoxia"; + case SEPatientEventType::HypovolemicShock: + return "HypovolemicShock"; + case SEPatientEventType::IntracranialHypertension: + return "IntracranialHypertension"; + case SEPatientEventType::IntracranialHypotension: + return "IntracranialHypotension"; + case SEPatientEventType::IrreversibleState: + return "IrreversibleState"; + case SEPatientEventType::Ketoacidosis: + return "Ketoacidosis"; + case SEPatientEventType::LacticAcidosis: + return "LacticAcidosis"; + case SEPatientEventType::LiverGlycogenDepleted: + return "LiverGlycogenDepleted"; + case SEPatientEventType::MaximumPulmonaryVentilationRate: + return "MaximumPulmonaryVentilationRate"; + case SEPatientEventType::MetabolicAcidosis: + return "MetabolicAcidosis"; + case SEPatientEventType::MetabolicAlkalosis: + return "MetabolicAlkalosis"; + case SEPatientEventType::MildWeakness: + return "MildWeakness"; + case SEPatientEventType::ModerateWeakness: + return "ModerateWeakness"; + case SEPatientEventType::MildSecretions: + return "MildSecretions"; + case SEPatientEventType::ModerateSecretions: + return "ModerateSecretions"; + case SEPatientEventType::MuscleCatabolism: + return "MuscleCatabolism"; + case SEPatientEventType::MuscleGlycogenDepleted: + return "MuscleGlycogenDepleted"; + case SEPatientEventType::MyocardiumOxygenDeficit: + return "MyocardiumOxygenDeficit"; + case SEPatientEventType::Natriuresis: + return "Natriuresis"; + case SEPatientEventType::Nausea: + return "Nausea"; + case SEPatientEventType::NutritionDepleted: + return "NutritionDepleted"; + case SEPatientEventType::PulselessRhythm: + return "PulselessRhythm"; + case SEPatientEventType::RenalHypoperfusion: + return "RenalHypoperfusion"; + case SEPatientEventType::RespiratoryAcidosis: + return "RespiratoryAcidosis"; + case SEPatientEventType::RespiratoryAlkalosis: + return "RespiratoryAlkalosis"; + case SEPatientEventType::SevereAcuteRespiratoryDistress: + return "SevereAcuteRespiratoryDistress"; + case SEPatientEventType::SevereSecretions: + return "SevereSecretions"; + case SEPatientEventType::Seizures: + return "Seizures"; + case SEPatientEventType::Shivering: + return "Shivering"; + case SEPatientEventType::StartOfCardiacCycle: + return "StartOfCardiacCycle"; + case SEPatientEventType::StartOfExhale: + return "StartOfExhale"; + case SEPatientEventType::StartOfInhale: + return "StartOfInhale"; + case SEPatientEventType::SevereSepsis: + return "SevereSepsis"; + case SEPatientEventType::Tachycardia: + return "Tachycardia"; + case SEPatientEventType::Tachypnea: + return "Tachypnea"; + case SEPatientEventType::Vomiting: + return "Vomiting"; + default: + return "Invalid"; + } +} + +inline std::ostream& operator<<(std::ostream& os, const SESex& e) +{ + os << ToString(e); + return os; +} +inline std::ostream& operator<<(std::ostream& os, const SEBloodType& e) +{ + os << ToString(e); + return os; +} +inline std::ostream& operator<<(std::ostream& os, const SEPatientEventType& e) +{ + os << ToString(e); + return os; +} + +} \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/enums/SEPhysiologyEnums.h b/projects/biogears/libBiogears/include/biogears/cdm/enums/SEPhysiologyEnums.h new file mode 100644 index 000000000..7c3d8e6f7 --- /dev/null +++ b/projects/biogears/libBiogears/include/biogears/cdm/enums/SEPhysiologyEnums.h @@ -0,0 +1,94 @@ +/************************************************************************************** +Copyright 2019 Applied Research Associates, Inc. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the License +at: +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +**************************************************************************************/ +#pragma once + +#include + +namespace biogears { +enum class SEInflammationSource { + Invalid = -1, + Burn = 0, + Hemorrhage, + Infection, + Ebola, + Fracture +}; + +enum class SEHeartRhythm { + Invalid = -1, + Asystole = 0, + NormalSinus +}; +enum class SESleepState { + Invalid = -1, + Awake = 0, + Sleeping +}; + +inline std::string ToString(const SEInflammationSource& e) +{ + switch (e) { + case SEInflammationSource::Burn: + return "Burn"; + case SEInflammationSource::Hemorrhage: + return "Hemorrhage"; + case SEInflammationSource::Infection: + return "Infection"; + case SEInflammationSource::Ebola: + return "Ebola"; + case SEInflammationSource::Fracture: + return "Fracture"; + default: + return "Invalid"; + } +} +inline std::string ToString(const SEHeartRhythm& e) +{ + switch (e) { + case SEHeartRhythm::Asystole: + return "Asystole"; + case SEHeartRhythm::NormalSinus: + return "NormalSinus"; + default: + return "Invalid"; + } +} +inline std::string ToString(const SESleepState& e) +{ + switch (e) { + case SESleepState::Awake: + return "Awake"; + case SESleepState::Sleeping: + return "Sleep"; + default: + return "Invalid"; + } +} + + +inline std::ostream& operator<<(std::ostream& os, const SEInflammationSource& e) +{ + os << ToString(e); + return os; +} +inline std::ostream& operator<<(std::ostream& os, const SEHeartRhythm& e) +{ + os << ToString(e); + return os; +} +inline std::ostream& operator<<(std::ostream& os, const SESleepState& e) +{ + os << ToString(e); + return os; +} + +} \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/PropertyEnum.h b/projects/biogears/libBiogears/include/biogears/cdm/enums/SEPropertyEnums.h similarity index 92% rename from projects/biogears/libBiogears/include/biogears/cdm/properties/PropertyEnum.h rename to projects/biogears/libBiogears/include/biogears/cdm/enums/SEPropertyEnums.h index 4bcad6346..12d6391f3 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/PropertyEnum.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/enums/SEPropertyEnums.h @@ -13,24 +13,26 @@ specific language governing permissions and limitations under the License. #include +#include + namespace biogears { -enum class SESide { +enum class BIOGEARS_API SESide { Invalid = -1, Left = 0, Right }; -enum class SEOpenClosed { +enum class BIOGEARS_API SEOpenClosed { Invalid = -1, Closed = 0, Open }; -enum class SEOnOff { +enum class BIOGEARS_API SEOnOff { Invalid = -1, Off = 0, On }; -enum class SEErrorType { +enum class BIOGEARS_API SEErrorType { Invalid = -1, Standard = 0 }; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/enums/SESubstanceEnums.h b/projects/biogears/libBiogears/include/biogears/cdm/enums/SESubstanceEnums.h new file mode 100644 index 000000000..4dbc5a1fe --- /dev/null +++ b/projects/biogears/libBiogears/include/biogears/cdm/enums/SESubstanceEnums.h @@ -0,0 +1,201 @@ +/************************************************************************************** +Copyright 2019 Applied Research Associates, Inc. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the License +at: +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +**************************************************************************************/ + +#pragma once + +#include +#include + +namespace biogears { + +enum class SESubstanceState { + Invalid = -1, + Solid = 0, + Liquid, + Gas, + Molecular +}; + +enum class SESubstanceIonicState { + Invalid = -1, + WeakBase = 0, + Base, + Acid, + Neutral, + Zwitterion +}; + +enum class SESubstanceBindingProtein { + Invalid = -1, + Albumin = 0, + Lipoprotein, + AAG, +}; + +enum class SECharge { + Invalid = -1, + Positive = 0, + Neutral, + Negative, + +}; + +enum class SESubstanceClass { + Invalid = -1, + Anesthetic = 0, + Antibiotic, + WholeBlood, + Ion, + Opioid, + ReversalAgent, + Sedative +}; + +enum class RenalDynamicsType { + Invalid = -1, + Clearance = 0, + Regulation +}; + +inline ::std::string ToString(const SESubstanceState& bit) +{ + switch (bit) { + case SESubstanceState::Solid: + return "Solid"; + case SESubstanceState::Liquid: + return "Liquid"; + case SESubstanceState::Gas: + return "Gas"; + case SESubstanceState::Molecular: + return "Molecular"; + default: + return "Invalid"; + } +} + +inline ::std::string ToString(const SESubstanceIonicState& bit) +{ + switch (bit) { + case SESubstanceIonicState::WeakBase: + return "WeakBase"; + case SESubstanceIonicState::Base: + return "Base"; + case SESubstanceIonicState::Acid: + return "Acid"; + case SESubstanceIonicState::Neutral: + return "Neutral"; + case SESubstanceIonicState::Zwitterion: + return "Zwitterion"; + default: + return "Invalid"; + } +} + +inline ::std::string ToString(const SESubstanceBindingProtein& bit) +{ + switch (bit) { + case SESubstanceBindingProtein::Albumin: + return "Albumin"; + case SESubstanceBindingProtein::Lipoprotein: + return "Lipoprotein"; + case SESubstanceBindingProtein::AAG: + return "AAG"; + default: + return "Invalid"; + } +} + +inline ::std::string ToString(const SECharge& bit) +{ + switch (bit) { + case SECharge::Positive: + return "Positive"; + case SECharge::Neutral: + return "Neutral"; + case SECharge::Negative: + return "Negative"; + default: + return "Invalid"; + } +} + +inline ::std::string ToString(const RenalDynamicsType& bit) +{ + switch (bit) { + case RenalDynamicsType::Clearance: + return "Anesthetic"; + case RenalDynamicsType::Regulation: + return "Antibiotic"; + default: + return "Invalid"; + } +} + +inline ::std::string ToString(const SESubstanceClass& bit) +{ + switch (bit) { + case SESubstanceClass::Anesthetic: + return "Anesthetic"; + case SESubstanceClass::Antibiotic: + return "Antibiotic"; + case SESubstanceClass::WholeBlood: + return "WholeBlood"; + case SESubstanceClass::Ion: + return "Ion"; + case SESubstanceClass::Opioid: + return "Opioid"; + case SESubstanceClass::ReversalAgent: + return "ReversalAgent"; + case SESubstanceClass::Sedative: + return "Sedative"; + default: + return "Invalid"; + } +} + +inline ::std::ostream& operator<<(::std::ostream& os, const SESubstanceState& pt) +{ + os << ToString(pt); + return os; +} + +inline ::std::ostream& operator<<(::std::ostream& os, const SESubstanceIonicState& pt) +{ + os << ToString(pt); + return os; +} + +inline ::std::ostream& operator<<(::std::ostream& os, const SESubstanceBindingProtein& pt) +{ + os << ToString(pt); + return os; +} + +inline ::std::ostream& operator<<(::std::ostream& os, const SECharge& pt) +{ + os << ToString(pt); + return os; +} + +inline ::std::ostream& operator<<(::std::ostream& os, const SESubstanceClass& pt) +{ + os << ToString(pt); + return os; +} + +inline ::std::ostream& operator<<(::std::ostream& os, const RenalDynamicsType& pt) +{ + os << ToString(pt); + return os; +} + +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/SENutrition.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/SENutrition.h index 438b753b6..6ff75b935 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/SENutrition.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/SENutrition.h @@ -12,23 +12,11 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include -#include +#include #include -CDM_BIND_DECL(NutritionData) - namespace biogears { - -class SEScalar; -class SEScalarMass; -class MassUnit; -class SEScalarMassPerTime; -class MassPerTimeUnit; -class SEScalarVolume; -class VolumeUnit; - namespace io { class PatientNutrition; } @@ -40,10 +28,7 @@ class BIOGEARS_API SENutrition : public Loggable { SENutrition(Logger* logger); virtual ~SENutrition(); - virtual void Clear(); - - virtual bool Load(const CDM::NutritionData& in, std::default_random_engine *rd = nullptr); - virtual CDM::NutritionData* Unload() const; + virtual void Invalidate(); public: const SEScalar* GetScalar(const char* name); @@ -92,8 +77,7 @@ class BIOGEARS_API SENutrition : public Loggable { virtual void ToString(std::ostream& str) const; -protected: - virtual void Unload(CDM::NutritionData& data) const; + virtual bool IsValid() const; protected: std::string m_Name; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/SEPatient.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/SEPatient.h index 7c5f1391d..4eab00387 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/SEPatient.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/SEPatient.h @@ -12,49 +12,32 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once -#include -#include -#include +#include -CDM_BIND_DECL(PatientData) +#include +#include +#include namespace biogears { class SEEventHandler; class SENutrition; -class SEScalar; -class TimeUnit; -class SEScalarMass; -class MassUnit; -class SEScalarLength; -class LengthUnit; -class SEScalarArea; -class AreaUnit; -class SEScalarPower; -class PowerUnit; -class SEScalarVolume; -class VolumeUnit; -class SEScalarMassPerVolume; -class MassPerVolumeUnit; -class SEScalarFraction; -class SEScalarPressure; -class PressureUnit; -class SEScalarFrequency; -class FrequencyUnit; -class SEScalarNeg1To1; -class SEScalarVolumePerTime; -class VolumePerTimeUnit; namespace io { class Patient; } } // namespace biogears + +#pragma warning(disable : 4661) + namespace std { -BG_EXT template class BIOGEARS_API map; -BG_EXT template class BIOGEARS_API map; -BG_EXT template class BIOGEARS_API map; +extern template class map; +extern template class map; +extern template class map; } +#pragma warning(default : 4661) + namespace biogears { class BIOGEARS_API SEPatient : public Loggable { friend io::Patient; @@ -63,15 +46,11 @@ class BIOGEARS_API SEPatient : public Loggable { SEPatient(Logger* logger); virtual ~SEPatient(); - virtual void Clear(); - - virtual bool Load(const CDM::PatientData& in); + virtual void Invalidate(); bool Load(const char* patientFile); bool Load(const std::string& patientFile); - virtual CDM::PatientData* Unload() const; - /** @name GetScalar * @brief - A reflextion type call that will return the Scalar associated * with the string. ex. GetScalar("Hematocrit") will return the @@ -83,11 +62,11 @@ class BIOGEARS_API SEPatient : public Loggable { virtual const SEScalar* GetScalar(const char* name); virtual const SEScalar* GetScalar(const std::string& name); - virtual const std::map& GetEventStates() const { return m_EventState; } - virtual void SetEvent(CDM::enumPatientEvent::value type, bool active, const SEScalarTime& time); - virtual void SetEventCallback(CDM::enumPatientEvent::value type, void (*callback)(bool)); - virtual bool IsEventActive(CDM::enumPatientEvent::value state) const; - virtual double GetEventDuration(CDM::enumPatientEvent::value type, const TimeUnit& unit) const; + virtual const std::map& GetEventStates() const { return m_EventState; } + virtual void SetEvent(SEPatientEventType type, bool active, const SEScalarTime& time); + virtual void SetEventCallback(SEPatientEventType type, void (*callback)(bool)); + virtual bool IsEventActive(SEPatientEventType state) const; + virtual double GetEventDuration(SEPatientEventType type, const TimeUnit& unit) const; virtual void UpdateEvents(const SEScalarTime& timeStep); /** @name ForwardEvents * @brief - Set a callback class to invoke when any event changes @@ -112,13 +91,8 @@ class BIOGEARS_API SEPatient : public Loggable { virtual bool HasAnnotation() const; virtual void InvalidateAnnotation(); - virtual CDM::enumSex::value GetGender() const; - virtual void SetGender(CDM::enumSex::value sex); - virtual bool HasGender() const; - virtual void InvalidateGender(); - - virtual CDM::enumSex::value GetSex() const; - virtual void SetSex(CDM::enumSex::value sex); + virtual SESex GetSex() const; + virtual void SetSex(SESex sex); virtual bool HasSex() const; virtual void InvalidateSex(); @@ -142,8 +116,8 @@ class BIOGEARS_API SEPatient : public Loggable { virtual SEScalarPower& GetBasalMetabolicRate(); virtual double GetBasalMetabolicRate(const PowerUnit& unit) const; - virtual CDM::enumBloodType::value GetBloodType() const; - virtual void SetBloodType(CDM::enumBloodType::value bloodAntigen); + virtual SEBloodType GetBloodType() const; + virtual void SetBloodType(SEBloodType bloodAntigen); virtual bool HasBloodType() const; virtual void InvalidateBloodType(); @@ -268,21 +242,19 @@ class BIOGEARS_API SEPatient : public Loggable { bool operator!=(SEPatient const& rhs) const; protected: - virtual void Unload(CDM::PatientData& data) const; - - virtual void CalculateWeightByBMI(const CDM::ScalarData& bmi); - virtual void CalculateHeightByBMI(const CDM::ScalarData& bmi); + virtual void CalculateWeightByBMI(const double& bmi); + virtual void CalculateHeightByBMI(const double& bmi); protected: std::stringstream m_ss; mutable SEEventHandler* m_EventHandler; - std::map m_EventState; - std::map m_EventCallbacks; - std::map m_EventDuration_s; + std::map m_EventState; + std::map m_EventCallbacks; + std::map m_EventDuration_s; std::string m_Name; std::string m_Annotation; - CDM::enumSex::value m_Gender; + SESex m_Sex; SEScalarTime* m_Age; SEScalarMass* m_Weight; SEScalarLength* m_Height; @@ -291,7 +263,7 @@ class BIOGEARS_API SEPatient : public Loggable { SEScalarMass* m_LeanBodyMass; SEScalarPower* m_MaxWorkRate; SEScalarMass* m_MuscleMass; - CDM::enumBloodType::value m_BloodType; + SEBloodType m_BloodType; bool m_BloodRh; // true meaning rh positive and false meaning rh negative SEScalarArea* m_AlveoliSurfaceArea; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEAcuteRespiratoryDistress.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEAcuteRespiratoryDistress.h index bc169915b..4f22774ed 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEAcuteRespiratoryDistress.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEAcuteRespiratoryDistress.h @@ -12,6 +12,7 @@ specific language governing permissions and limitations under the License. #pragma once #include +#include #include @@ -33,14 +34,11 @@ class BIOGEARS_API SEAcuteRespiratoryDistress : public SEPatientAction { static constexpr const char* TypeTag() { return "SEAcuteRespiratoryDistress"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; + virtual void Invalidate() override; virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::AcuteRespiratoryDistressData& in, std::default_random_engine *rd = nullptr); - virtual CDM::AcuteRespiratoryDistressData* Unload() const override; - virtual bool HasSeverity() const; virtual SEScalar0To1& GetSeverity(); @@ -49,9 +47,6 @@ class BIOGEARS_API SEAcuteRespiratoryDistress : public SEPatientAction { bool operator==(const SEAcuteRespiratoryDistress& rhs) const; bool operator!=(const SEAcuteRespiratoryDistress& rhs) const; -protected: - virtual void Unload(CDM::AcuteRespiratoryDistressData& data) const; - private: SEScalar0To1* m_Severity; }; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEAcuteStress.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEAcuteStress.h index 490f19ec2..ff22e60e1 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEAcuteStress.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEAcuteStress.h @@ -12,6 +12,7 @@ specific language governing permissions and limitations under the License. #pragma once #include +#include #include @@ -30,14 +31,11 @@ class BIOGEARS_API SEAcuteStress : public SEPatientAction { static constexpr const char* TypeTag() { return "SEAcuteStress"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; + virtual void Invalidate() override; virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::AcuteStressData& in, std::default_random_engine *rd = nullptr); - virtual CDM::AcuteStressData* Unload() const override; - virtual bool HasSeverity() const; virtual SEScalar0To1& GetSeverity(); @@ -46,9 +44,6 @@ class BIOGEARS_API SEAcuteStress : public SEPatientAction { bool operator==( const SEAcuteStress& rhs) const; bool operator!=( const SEAcuteStress& rhs) const; -protected: - virtual void Unload(CDM::AcuteStressData& data) const; - private: SEScalar0To1* m_Severity; }; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEAirwayObstruction.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEAirwayObstruction.h index 6e8a9545f..de8a4142e 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEAirwayObstruction.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEAirwayObstruction.h @@ -12,7 +12,7 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include #include @@ -31,14 +31,11 @@ class BIOGEARS_API SEAirwayObstruction : public SEPatientAction { static constexpr const char* TypeTag() { return "SEAirwayObstruction"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; + virtual void Invalidate() override; virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::AirwayObstructionData& in, std::default_random_engine *rd = nullptr); - virtual CDM::AirwayObstructionData* Unload() const override; - virtual bool HasSeverity() const; virtual SEScalar0To1& GetSeverity(); @@ -47,9 +44,6 @@ class BIOGEARS_API SEAirwayObstruction : public SEPatientAction { bool operator==(const SEAirwayObstruction& rhs) const; bool operator!=(const SEAirwayObstruction& rhs) const; -protected: - virtual void Unload(CDM::AirwayObstructionData& data) const; - protected: SEScalar0To1* m_Severity; }; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEAmputation.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEAmputation.h new file mode 100644 index 000000000..dfff2393f --- /dev/null +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEAmputation.h @@ -0,0 +1,71 @@ +/************************************************************************************** +Copyright 2015 Applied Research Associates, Inc. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the License +at: +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +**************************************************************************************/ + +#pragma once +#include +#include + +#include +#include +#include +#include + +#include + +namespace biogears { +namespace io { + class PatientActions; +} +class BIOGEARS_API SEAmputation : public SEPatientAction { + friend io::PatientActions; + + +public: + SEAmputation(); + virtual ~SEAmputation() override; + + static constexpr const char* TypeTag() { return "SEAmputation"; }; + const char* classname() const override { return TypeTag(); } + + virtual void Invalidate() override; // clear memory + + virtual bool IsValid() const override; + + virtual const char* GetCompartment_cStr() const; + virtual std::string GetCompartment() const; + virtual bool HasCompartment() const; + virtual void SetCompartment(const char* name); + virtual void SetCompartment(const std::string& name); + virtual void InvalidateCompartment(); + + virtual bool HasBleedResistance() const; + virtual SEScalarFlowResistance& GetBleedResistance(); + virtual SEScalarFlowResistance const& GetBleedResistance() const; + + virtual const char* GetWeightPercent_cStr() const; + virtual std::string GetWeightPercent() const; + //virtual bool HasWeightPercent() const; + virtual void SetWeightPercent(const char* name); + virtual void SetWeightPercent(const std::string& name); + //virtual void InvalidateWeightPercent(); + + virtual void ToString(std::ostream& str) const override; + + bool operator==(const SEAmputation& rhs) const; + bool operator!=(const SEAmputation& rhs) const; + +protected: + std::string m_Compartment; + SEScalarFlowResistance* m_BleedResistance; + std::string m_WeightPercent; +}; +} + diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEApnea.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEApnea.h index 573a2cd5d..9b7f7355b 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEApnea.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEApnea.h @@ -12,7 +12,7 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include #include @@ -31,14 +31,11 @@ class BIOGEARS_API SEApnea : public SEPatientAction { static constexpr const char* TypeTag() { return "SEApena"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; + virtual void Invalidate() override; virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::ApneaData& in, std::default_random_engine *rd = nullptr); - virtual CDM::ApneaData* Unload() const override; - virtual bool HasSeverity() const; virtual SEScalar0To1& GetSeverity(); @@ -46,8 +43,6 @@ class BIOGEARS_API SEApnea : public SEPatientAction { bool operator==( const SEApnea& rhs) const; bool operator!=( const SEApnea& rhs) const; -protected: - virtual void Unload(CDM::ApneaData& data) const; protected: SEScalar0To1* m_Severity; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEAsthmaAttack.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEAsthmaAttack.h index db2362c01..990ecc6eb 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEAsthmaAttack.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEAsthmaAttack.h @@ -12,7 +12,8 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include + #include @@ -31,14 +32,11 @@ class BIOGEARS_API SEAsthmaAttack : public SEPatientAction { static constexpr const char* TypeTag() { return "SEAsthmaAttack"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; //clear memory + virtual void Invalidate() override; //clear memory virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::AsthmaAttackData& in, std::default_random_engine *rd = nullptr); - virtual CDM::AsthmaAttackData* Unload() const override; - virtual bool HasSeverity() const; virtual SEScalar0To1& GetSeverity(); @@ -46,8 +44,6 @@ class BIOGEARS_API SEAsthmaAttack : public SEPatientAction { bool operator==(const SEAsthmaAttack& rhs) const; bool operator!=(const SEAsthmaAttack& rhs) const; -protected: - virtual void Unload(CDM::AsthmaAttackData& data) const; protected: SEScalar0To1* m_Severity; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEBrainInjury.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEBrainInjury.h index 0d07ffda0..61941c2d9 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEBrainInjury.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEBrainInjury.h @@ -11,10 +11,11 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once +#include + #include -#include +#include -#include namespace biogears { class SEScalar0To1; @@ -31,32 +32,26 @@ class BIOGEARS_API SEBrainInjury : public SEPatientAction { static constexpr const char* TypeTag() { return "SEBrainInjury"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; + virtual void Invalidate() override; virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::BrainInjuryData& in, std::default_random_engine *rd = nullptr); - virtual CDM::BrainInjuryData* Unload() const override; - virtual bool HasSeverity() const; virtual SEScalar0To1& GetSeverity(); - virtual CDM::enumBrainInjuryType::value GetType() const; - virtual void SetType(CDM::enumBrainInjuryType::value t); + virtual SEBrainInjuryType GetType() const; + virtual void SetType(SEBrainInjuryType t); virtual bool HasType() const; virtual void InvalidateType(); virtual void ToString(std::ostream& str) const override; - + bool operator==(const SEBrainInjury& rhs) const; bool operator!=(const SEBrainInjury& rhs) const; -protected: - virtual void Unload(CDM::BrainInjuryData& data) const; - protected: SEScalar0To1* m_Severity; - CDM::enumBrainInjuryType::value m_Type; + SEBrainInjuryType m_Type; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEBreathHold.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEBreathHold.h index 919fba617..868ecc6a9 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEBreathHold.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEBreathHold.h @@ -12,13 +12,13 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include +#include #include namespace biogears { class SEScalar0To1; -class SEScalarTime; class SEConsciousRespiration; namespace io { class PatientActions; @@ -31,14 +31,11 @@ class BIOGEARS_API SEBreathHold : public SEConsciousRespirationCommand { SEBreathHold(); virtual ~SEBreathHold(); - virtual void Clear(); //clear memory + virtual void Invalidate(); //clear memory virtual bool IsValid() const; virtual bool IsActive() const; - virtual bool Load(const CDM::BreathHoldData& in, std::default_random_engine *rd = nullptr); - virtual CDM::BreathHoldData* Unload() const; - virtual bool HasPeriod() const; virtual SEScalarTime& GetPeriod(); @@ -48,10 +45,6 @@ class BIOGEARS_API SEBreathHold : public SEConsciousRespirationCommand { bool operator!=( const SEBreathHold& rhs) const; protected: - virtual void Unload(CDM::BreathHoldData& data) const; - -protected: - SEScalarTime* m_Period; }; } diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEBronchoconstriction.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEBronchoconstriction.h index 0a89fe89e..ee5680a6c 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEBronchoconstriction.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEBronchoconstriction.h @@ -12,7 +12,8 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include + #include @@ -31,14 +32,11 @@ class BIOGEARS_API SEBronchoconstriction : public SEPatientAction { static constexpr const char* TypeTag() { return "SEBronchoconstriction"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; //clear memory + virtual void Invalidate() override; //clear memory virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::BronchoconstrictionData& in, std::default_random_engine *rd = nullptr); - virtual CDM::BronchoconstrictionData* Unload() const override; - bool operator==( const SEBronchoconstriction& rhs) const; bool operator!=( const SEBronchoconstriction& rhs) const; @@ -47,10 +45,6 @@ class BIOGEARS_API SEBronchoconstriction : public SEPatientAction { virtual void ToString(std::ostream& str) const override; -protected: - virtual void Unload(CDM::BronchoconstrictionData& data) const; - - protected: SEScalar0To1* m_Severity; }; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEBurnWound.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEBurnWound.h index 54aacc9ba..37c7645e5 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEBurnWound.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEBurnWound.h @@ -15,7 +15,8 @@ specific language governing permissions and limitations under the License. #include #include -#include +#include + #include @@ -41,22 +42,19 @@ class BIOGEARS_API SEBurnWound : public SEPatientAction { static constexpr const char* TypeTag() { return "SEBurnWound"; }; const char* classname() const override { return TypeTag(); } - - virtual void Clear() override; // clear memory + + virtual void Invalidate() override; // clear memory virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::BurnWoundData& in, std::default_random_engine *rd = nullptr); - virtual CDM::BurnWoundData* Unload() const override; - bool HasTotalBodySurfaceArea() const; double GetTotalBodySurfaceArea() const; void SetTotalBodySurfaceArea(double); bool HasDegreeOfBurn() const; - CDM::enumBurnDegree::value GetDegreeOfBurn() const; - void SetDegreeOfBurn(CDM::enumBurnDegree::value value); + SEBurnDegree GetDegreeOfBurn() const; + void SetDegreeOfBurn(SEBurnDegree value); void SetTimeOfBurn(double burnTime); double GetTimeOfBurn() const; @@ -94,14 +92,13 @@ class BIOGEARS_API SEBurnWound : public SEPatientAction { double getRightLegBurnIntensity() const; protected: - virtual void Unload(CDM::BurnWoundData& data) const; void calculateCompartmentDistribution(); private: bool m_Inflammation; double m_DegreeModifier; double m_burnInitiationTime; - CDM::enumBurnDegree::value m_DegreeOfBurn; + SEBurnDegree m_DegreeOfBurn; SEScalar0To1* m_TBSA; std::vector m_compartments; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SECardiacArrest.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SECardiacArrest.h index ca8e669ca..06fdff1a0 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SECardiacArrest.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SECardiacArrest.h @@ -12,7 +12,8 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include + #include @@ -30,24 +31,18 @@ class BIOGEARS_API SECardiacArrest : public SEPatientAction { static constexpr const char* TypeTag() { return "SECardiacArrest"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; //clear memory + virtual void Invalidate() override; //clear memory virtual bool IsValid() const override; virtual bool IsActive() const override; virtual void SetActive(bool b); - virtual bool Load(const CDM::CardiacArrestData& in, std::default_random_engine *rd = nullptr); - virtual CDM::CardiacArrestData* Unload() const override; - virtual void ToString(std::ostream& str) const override; bool operator==( const SECardiacArrest& rhs) const; bool operator!=( const SECardiacArrest& rhs) const; protected: - virtual void Unload(CDM::CardiacArrestData& data) const; - -protected: - CDM::enumOnOff::value m_State; + SEOnOff m_State; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEChestCompression.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEChestCompression.h index b3b659a61..9cb03085f 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEChestCompression.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEChestCompression.h @@ -13,8 +13,7 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include -#include +#include #include @@ -27,22 +26,15 @@ class BIOGEARS_API SEChestCompression : public SEPatientAction { static constexpr const char* TypeTag() { return "SEChestCompression"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; //clear memory + virtual void Invalidate() override; //clear memory virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::ChestCompressionData& in); - virtual CDM::ChestCompressionData* Unload() const override; - virtual void ToString(std::ostream& str) const override; bool operator==( const SEChestCompression& rhs) const; bool operator!=( const SEChestCompression& rhs) const; -protected: - virtual void Unload(CDM::ChestCompressionData& data) const; - -private: }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEChestCompressionForce.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEChestCompressionForce.h index ac07a8e97..802d1faf7 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEChestCompressionForce.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEChestCompressionForce.h @@ -12,12 +12,12 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include +#include #include namespace biogears { -class SEScalarForce; namespace io { class PatientActions; } @@ -28,14 +28,11 @@ class BIOGEARS_API SEChestCompressionForce : public SEChestCompression { SEChestCompressionForce(); virtual ~SEChestCompressionForce(); - virtual void Clear() override; //clear memory + virtual void Invalidate() override; //clear memory virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::ChestCompressionForceData& in, std::default_random_engine *rd = nullptr); - virtual CDM::ChestCompressionForceData* Unload() const override; - virtual bool HasForce() const; virtual SEScalarForce& GetForce(); @@ -44,9 +41,6 @@ class BIOGEARS_API SEChestCompressionForce : public SEChestCompression { bool operator==( const SEChestCompressionForce& rhs) const; bool operator!=( const SEChestCompressionForce& rhs) const; -protected: - virtual void Unload(CDM::ChestCompressionForceData& data) const; - protected: SEScalarForce* m_Force; }; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEChestCompressionForceScale.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEChestCompressionForceScale.h index e8b0a74c4..99ce3fc39 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEChestCompressionForceScale.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEChestCompressionForceScale.h @@ -12,7 +12,8 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include + #include @@ -28,14 +29,11 @@ class BIOGEARS_API SEChestCompressionForceScale : public SEChestCompression { SEChestCompressionForceScale(); virtual ~SEChestCompressionForceScale(); - virtual void Clear(); //clear memory + virtual void Invalidate(); //clear memory virtual bool IsValid() const; virtual bool IsActive() const; - virtual bool Load(const CDM::ChestCompressionForceScaleData& in, std::default_random_engine *rd = nullptr); - virtual CDM::ChestCompressionForceScaleData* Unload() const; - virtual bool HasForceScale() const; virtual SEScalar0To1& GetForceScale(); @@ -47,9 +45,6 @@ class BIOGEARS_API SEChestCompressionForceScale : public SEChestCompression { bool operator==( const SEChestCompressionForceScale& rhs) const; bool operator!=( const SEChestCompressionForceScale& rhs) const; -protected: - virtual void Unload(CDM::ChestCompressionForceScaleData& data) const; - protected: SEScalar0To1* m_ForceScale; SEScalarTime* m_ForcePeriod; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEChestOcclusiveDressing.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEChestOcclusiveDressing.h index 80e437e96..ef9c11bab 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEChestOcclusiveDressing.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEChestOcclusiveDressing.h @@ -12,7 +12,8 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include + #include @@ -29,19 +30,17 @@ class BIOGEARS_API SEChestOcclusiveDressing : public SEPatientAction { static constexpr const char* TypeTag() { return "SEChestOcclusiveDressing"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; //clear memory + virtual void Invalidate() override; //clear memory virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual void SetActive(bool b); - - virtual bool Load(const CDM::ChestOcclusiveDressingData& in, std::default_random_engine *rd = nullptr); - virtual CDM::ChestOcclusiveDressingData* Unload() const override; + + void SetActive(bool b); - virtual CDM::enumSide::value GetSide() const; - virtual void SetSide(CDM::enumSide::value LeftOrRight); - virtual bool HasSide() const; - virtual void InvalidateSide(); + SESide GetSide() const; + void SetSide(SESide LeftOrRight); + bool HasSide() const; + void InvalidateSide(); virtual void ToString(std::ostream& str) const override; @@ -49,11 +48,7 @@ class BIOGEARS_API SEChestOcclusiveDressing : public SEPatientAction { bool operator!=( const SEChestOcclusiveDressing& rhs) const; protected: - virtual void Unload(CDM::ChestOcclusiveDressingData& data) const; - - -protected: - CDM::enumSide::value m_Side; - CDM::enumOnOff::value m_State; + SESide m_Side; + SEOnOff m_State; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEActionExample.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEChestTube.h similarity index 63% rename from projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEActionExample.h rename to projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEChestTube.h index d5777b55a..c4ebe1762 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEActionExample.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEChestTube.h @@ -12,44 +12,43 @@ specific language governing permissions and limitations under the License. #pragma once #include +#include #include namespace biogears { -class SEScalar0To1; namespace io { class PatientActions; } -class BIOGEARS_API SEActionExample : public SEPatientAction { + +class BIOGEARS_API SEChestTube : public SEPatientAction { friend io::PatientActions; public: - SEActionExample(); - virtual ~SEActionExample() override; + SEChestTube(); + virtual ~SEChestTube() override; - static constexpr const char* TypeTag() { return "SEActionExample"; }; + static constexpr const char* TypeTag() { return "SEChestTube"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; + virtual void Invalidate() override; //clear memory virtual bool IsValid() const override; virtual bool IsActive() const override; + virtual void SetActive(bool b); - virtual bool Load(const CDM::ExampleActionData& in, std::default_random_engine *rd = nullptr); - virtual CDM::ExampleActionData* Unload() const override; - - virtual bool HasSeverity() const; - virtual SEScalar0To1& GetSeverity(); + virtual SESide GetSide() const; + virtual void SetSide(SESide LeftOrRight); + virtual bool HasSide() const; + virtual void InvalidateSide(); virtual void ToString(std::ostream& str) const override; - - bool operator==(const SEActionExample& rhs) const; - bool operator!=(const SEActionExample& rhs) const; -protected: - virtual void Unload(CDM::ExampleActionData& data) const; + bool operator==(const SEChestTube& rhs) const; + bool operator!=(const SEChestTube& rhs) const; -private: - SEScalar0To1* m_Severity; +protected: + SESide m_Side; + SEOnOff m_State; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEConsciousRespiration.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEConsciousRespiration.h index 8816f86d4..75f9c54cb 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEConsciousRespiration.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEConsciousRespiration.h @@ -12,7 +12,8 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include + #include @@ -34,14 +35,11 @@ class BIOGEARS_API SEConsciousRespiration : public SEPatientAction { static constexpr const char* TypeTag() { return "SEConsciousRespiration"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; //clear memory + virtual void Invalidate() override; //clear memory virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::ConsciousRespirationData& in, const SESubstanceManager& substances, std::default_random_engine *rd = nullptr); - virtual CDM::ConsciousRespirationData* Unload() const override; - // Get the active command virtual SEConsciousRespirationCommand* GetActiveCommand(); /// When the active command has been processed, remove it @@ -57,10 +55,6 @@ class BIOGEARS_API SEConsciousRespiration : public SEPatientAction { bool operator==( const SEConsciousRespiration& rhs) const; bool operator!=( const SEConsciousRespiration& rhs) const; -protected: - virtual void Unload(CDM::ConsciousRespirationData& data) const; - - protected: bool m_ClearCommands; std::vector m_Commands; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEConsciousRespirationCommand.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEConsciousRespirationCommand.h index e555dab34..84fdc3aff 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEConsciousRespirationCommand.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEConsciousRespirationCommand.h @@ -13,7 +13,8 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include + #include @@ -28,14 +29,11 @@ class BIOGEARS_API SEConsciousRespirationCommand { SEConsciousRespirationCommand(); virtual ~SEConsciousRespirationCommand(); - virtual void Clear(); //clear memory + virtual void Invalidate(); // clear memory virtual bool IsValid() const; virtual bool IsActive() const; - virtual bool Load(const CDM::ConsciousRespirationCommandData& in); - virtual CDM::ConsciousRespirationCommandData* Unload() const = 0; - virtual std::string GetComment() const; virtual const char* GetComment_cStr() const; virtual void SetComment(const char* comment); @@ -45,12 +43,8 @@ class BIOGEARS_API SEConsciousRespirationCommand { virtual void ToString(std::ostream& str) const = 0; - bool operator==( const SEConsciousRespirationCommand& rhs) const; - bool operator!=( const SEConsciousRespirationCommand& rhs) const; - -protected: - virtual void Unload(CDM::ConsciousRespirationCommandData& data) const; - + bool operator==(const SEConsciousRespirationCommand& rhs) const; + bool operator!=(const SEConsciousRespirationCommand& rhs) const; std::string m_Comment; }; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEConsumeNutrients.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEConsumeNutrients.h index e9d0178ca..3ef54e076 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEConsumeNutrients.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEConsumeNutrients.h @@ -15,7 +15,8 @@ specific language governing permissions and limitations under the License. #include #include -#include +#include + #include @@ -33,14 +34,11 @@ class BIOGEARS_API SEConsumeNutrients : public SEPatientAction { static constexpr const char* TypeTag() { return "SEconsumeNutrients"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; //clear memory + virtual void Invalidate() override; // clear memory virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::ConsumeNutrientsData& in, std::default_random_engine *rd = nullptr); - virtual CDM::ConsumeNutrientsData* Unload() const override; - bool HasNutrition() const; SENutrition& GetNutrition(); const SENutrition* GetNutrition() const; @@ -53,13 +51,9 @@ class BIOGEARS_API SEConsumeNutrients : public SEPatientAction { virtual void InvalidateNutritionFile(); virtual void ToString(std::ostream& str) const override; - - bool operator==( const SEConsumeNutrients& rhs) const; - bool operator!=( const SEConsumeNutrients& rhs) const; - -protected: - virtual void Unload(CDM::ConsumeNutrientsData& data) const; + bool operator==(const SEConsumeNutrients& rhs) const; + bool operator!=(const SEConsumeNutrients& rhs) const; protected: SENutrition* m_Nutrition; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEEbola.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEEbola.h index 7a1e7ee81..40d1a2625 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEEbola.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEEbola.h @@ -11,19 +11,19 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once +#include #include #include -#include -#include +#include +#include #include namespace biogears { - class SEScalarMassPerVolume; - namespace io { - class PatientActions; - } +namespace io { + class PatientActions; +} class BIOGEARS_API SEEbola : public SEPatientAction { friend io::PatientActions; @@ -35,17 +35,14 @@ class BIOGEARS_API SEEbola : public SEPatientAction { static constexpr const char* TypeTag() { return "SEEbola"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; //clear memory + virtual void Invalidate() override; // clear memory virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::EbolaData& in, std::default_random_engine *rd = nullptr); - virtual CDM::EbolaData* Unload() const override; - virtual bool HasSeverity() const; - virtual CDM::enumInfectionSeverity::value GetSeverity() const; - virtual void SetSeverity(CDM::enumInfectionSeverity::value t); + virtual SEInfectionSeverity GetSeverity() const; + virtual void SetSeverity(SEInfectionSeverity t); virtual void InvalidateSeverity(); virtual void ToString(std::ostream& str) const override; @@ -54,9 +51,6 @@ class BIOGEARS_API SEEbola : public SEPatientAction { bool operator!=(const SEEbola& rhs) const; protected: - virtual void Unload(CDM::EbolaData& data) const; - -protected: - CDM::enumInfectionSeverity::value m_Severity; + SEInfectionSeverity m_Severity; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEEscharotomy.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEEscharotomy.h index 71e8059ac..c1e77fdb4 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEEscharotomy.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEEscharotomy.h @@ -12,7 +12,8 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include + #include @@ -22,6 +23,7 @@ namespace io { } class BIOGEARS_API SEEscharotomy : public SEPatientAction { friend io::PatientActions; + public: SEEscharotomy(); virtual ~SEEscharotomy() override; @@ -29,17 +31,11 @@ class BIOGEARS_API SEEscharotomy : public SEPatientAction { static constexpr const char* TypeTag() { return "SEEscharotomy"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; //clear memory + virtual void Invalidate() override; // clear memory virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::EscharotomyData& in, std::default_random_engine *rd = nullptr); - virtual CDM::EscharotomyData* Unload() const override; - -protected: - virtual void Unload(CDM::EscharotomyData& data) const; - public: virtual std::string GetLocation() const; virtual bool HasLocation() const; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEExampleAction.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEExampleAction.h index 597c319d0..3f20b88e1 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEExampleAction.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEExampleAction.h @@ -12,6 +12,7 @@ specific language governing permissions and limitations under the License. #pragma once #include +#include #include @@ -30,25 +31,19 @@ class BIOGEARS_API SEExampleAction : public SEPatientAction { static constexpr const char* TypeTag() { return "SEExampleAction"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; + virtual void Invalidate() override; virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::ExampleActionData& in, std::default_random_engine *rd = nullptr); - virtual CDM::ExampleActionData* Unload() const override; - virtual bool HasSeverity() const; virtual SEScalar0To1& GetSeverity(); virtual void ToString(std::ostream& str) const override; - + bool operator==(const SEExampleAction& rhs) const; bool operator!=(const SEExampleAction& rhs) const; -protected: - virtual void Unload(CDM::ExampleActionData& data) const; - private: SEScalar0To1* m_Severity; }; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEExercise.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEExercise.h index 1332f610b..441959c85 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEExercise.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEExercise.h @@ -12,12 +12,14 @@ specific language governing permissions and limitations under the License. #pragma once #include +#include + #include #include #include #include #include -#include + #include @@ -41,31 +43,31 @@ class BIOGEARS_API SEExercise : public SEPatientAction { SEScalarPower DesiredWorkRate; SEScalar0To1 Intensity; - bool operator==( const SEGeneric& rhs) const; - bool operator!=( const SEGeneric& rhs) const; + bool operator==(const SEGeneric& rhs) const; + bool operator!=(const SEGeneric& rhs) const; }; struct SECycling { SEScalarFrequency CadenceCycle; SEScalarPower PowerCycle; SEScalarMass AddedWeight; - bool operator==( const SECycling& rhs) const; - bool operator!=( const SECycling& rhs) const; + bool operator==(const SECycling& rhs) const; + bool operator!=(const SECycling& rhs) const; }; struct SERunning { SEScalarLengthPerTime SpeedRun; SEScalar0To1 InclineRun; SEScalarMass AddedWeight; - bool operator==( const SERunning& rhs) const; - bool operator!=( const SERunning& rhs) const; + bool operator==(const SERunning& rhs) const; + bool operator!=(const SERunning& rhs) const; }; struct SEStrengthTraining { SEScalarMass WeightStrength; SEScalar RepsStrength; - bool operator==( const SEStrengthTraining& rhs) const; - bool operator!=( const SEStrengthTraining& rhs) const; + bool operator==(const SEStrengthTraining& rhs) const; + bool operator!=(const SEStrengthTraining& rhs) const; }; SEExercise(); @@ -79,20 +81,16 @@ class BIOGEARS_API SEExercise : public SEPatientAction { static constexpr const char* TypeTag() { return "SEExercise"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; //clear memory + virtual void Invalidate() override; // clear memory virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::ExerciseData& in, std::default_random_engine *rd = nullptr); - virtual bool HasGenericExercise() const; virtual bool HasCyclingExercise() const; virtual bool HasRunningExercise() const; virtual bool HasStrengthExercise() const; - virtual CDM::ExerciseData* Unload() const override; - virtual ExerciseType GetExerciseType() const; virtual SEGeneric GetGenericExercise() const; virtual SECycling GetCyclingExercise() const; @@ -111,15 +109,8 @@ class BIOGEARS_API SEExercise : public SEPatientAction { virtual void ToString(std::ostream& str) const override; - bool operator==( const SEExercise& rhs) const; - bool operator!=( const SEExercise& rhs) const; - -protected: - virtual void Unload(CDM::ExerciseData& data) const; - virtual bool LoadGeneric(const CDM::GenericExerciseData& in, std::default_random_engine *rd = nullptr); - virtual bool LoadCycling(const CDM::CyclingExerciseData& in, std::default_random_engine *rd = nullptr); - virtual bool LoadRunning(const CDM::RunningExerciseData& in, std::default_random_engine *rd = nullptr); - virtual bool LoadStrength(const CDM::StrengthExerciseData& in, std::default_random_engine *rd = nullptr); + bool operator==(const SEExercise& rhs) const; + bool operator!=(const SEExercise& rhs) const; private: ExerciseType m_mode; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEForcedExhale.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEForcedExhale.h index d161fd89c..22600413c 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEForcedExhale.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEForcedExhale.h @@ -12,7 +12,8 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include + #include @@ -30,17 +31,11 @@ class BIOGEARS_API SEForcedExhale : public SEConsciousRespirationCommand { SEForcedExhale(); virtual ~SEForcedExhale(); - virtual void Clear(); //clear memory + virtual void Invalidate(); // clear memory virtual bool IsValid() const; virtual bool IsActive() const; - virtual bool Load(const CDM::ForcedExhaleData& in, std::default_random_engine *rd = nullptr); - virtual CDM::ForcedExhaleData* Unload() const; - -protected: - virtual void Unload(CDM::ForcedExhaleData& data) const; - public: virtual void ToString(std::ostream& str) const; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEForcedInhale.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEForcedInhale.h index cb418a49b..8d490d7e3 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEForcedInhale.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEForcedInhale.h @@ -12,7 +12,8 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include + +#include #include @@ -30,14 +31,11 @@ class BIOGEARS_API SEForcedInhale : public SEConsciousRespirationCommand { SEForcedInhale(); virtual ~SEForcedInhale(); - virtual void Clear(); //clear memory + virtual void Invalidate(); //clear memory virtual bool IsValid() const; virtual bool IsActive() const; - virtual bool Load(const CDM::ForcedInhaleData& in, std::default_random_engine *rd = nullptr); - virtual CDM::ForcedInhaleData* Unload() const; - virtual bool HasInspiratoryCapacityFraction() const; virtual SEScalar0To1& GetInspiratoryCapacityFraction(); @@ -49,9 +47,6 @@ class BIOGEARS_API SEForcedInhale : public SEConsciousRespirationCommand { bool operator==( const SEForcedInhale& rhs) const; bool operator!=( const SEForcedInhale& rhs) const; -protected: - virtual void Unload(CDM::ForcedInhaleData& data) const; - protected: SEScalar0To1* m_InspiratoryCapacityFraction; SEScalarTime* m_Period; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEFracture.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEFracture.h new file mode 100644 index 000000000..dda50c613 --- /dev/null +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEFracture.h @@ -0,0 +1,78 @@ +/************************************************************************************** +Copyright 2015 Applied Research Associates, Inc. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the License +at: +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +**************************************************************************************/ + +#pragma once +#include +#include + +#include +#include + + +#include + +namespace biogears { +class SEScalar0To1; +namespace io { + class PatientActions; +} + +class BIOGEARS_API SEFracture : public SEPatientAction { + friend io::PatientActions; + +public: + SEFracture(); + virtual ~SEFracture() override; + + static constexpr const char* TypeTag() { return "SEFracture"; }; + const char* classname() const override { return TypeTag(); } + + virtual void Invalidate() override; // clear memory + + virtual bool IsValid() const override; + virtual bool IsActive() const override; + + bool HasFracturedBone() const; + SEFracturedBone GetFracturedBone() const; + void SetFracturedBone(SEFracturedBone bone); + + virtual bool HasSide() const; + virtual SESide GetSide() const; + virtual void SetSide(SESide LeftOrRight); + virtual void InvalidateSide(); + + bool HasFractureType() const; + SEFractureType GetFractureType() const; + void SetFractureType(SEFractureType type); + + virtual bool HasSeverity() const; + virtual SEScalar0To1& GetSeverity(); + //void SetSeverity(SEFracturedBone bone, SEFractureType type); + + bool HasInflammation() const; //May need; Check back before merging + void SetInflammation(bool activate); + + void ToString(std::ostream& str) const override; + + bool operator==(const SEFracture& rhs) const; + bool operator!=(const SEFracture& rhs) const; + +protected: + +private: + bool m_Inflammation; + SEFracturedBone m_FracturedBone; + SESide m_Side; + SEFractureType m_FractureType; + SEScalar0To1* m_Severity; +}; +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEHemorrhage.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEHemorrhage.h index 0499d5ff6..cf932f7f7 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEHemorrhage.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEHemorrhage.h @@ -14,13 +14,13 @@ specific language governing permissions and limitations under the License. #include #include +#include #include -#include +#include #include namespace biogears { -class SEScalarVolumePerTime; namespace io { class PatientActions; } @@ -40,14 +40,11 @@ class BIOGEARS_API SEHemorrhage : public SEPatientAction { static constexpr const char* TypeTag() { return "SEHemorrhage"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; //clear memory + virtual void Invalidate() override; // clear memory virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::HemorrhageData& in, std::default_random_engine *rd = nullptr); - virtual CDM::HemorrhageData* Unload() const override; - virtual const char* GetCompartment_cStr() const; virtual std::string GetCompartment() const; virtual bool HasCompartment() const; @@ -57,7 +54,7 @@ class BIOGEARS_API SEHemorrhage : public SEPatientAction { virtual bool HasMCIS() const; virtual std::vector& GetMCIS() { return m_MCIS; } - virtual std::vector const & GetMCIS() const { return m_MCIS; }; + virtual std::vector const& GetMCIS() const { return m_MCIS; }; virtual void SetMCIS(); virtual bool HasInitialRate() const; @@ -70,11 +67,8 @@ class BIOGEARS_API SEHemorrhage : public SEPatientAction { virtual void ToString(std::ostream& str) const override; - bool operator==( const SEHemorrhage& rhs) const; - bool operator!=( const SEHemorrhage& rhs) const; - -protected: - virtual void Unload(CDM::HemorrhageData& data) const; + bool operator==(const SEHemorrhage& rhs) const; + bool operator!=(const SEHemorrhage& rhs) const; protected: std::string m_Compartment; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEInfection.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEInfection.h index e0a3799cf..f51032b0a 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEInfection.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEInfection.h @@ -13,19 +13,21 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include #include -#include + +#include +#include +#include #include namespace biogears { -class SEScalarMassPerVolume; namespace io { class PatientActions; } class BIOGEARS_API SEInfection : public SEPatientAction { friend io::PatientActions; + public: SEInfection(); virtual ~SEInfection() override; @@ -33,14 +35,11 @@ class BIOGEARS_API SEInfection : public SEPatientAction { static constexpr const char* TypeTag() { return "SEInfection"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; //clear memory + virtual void Invalidate() override; // clear memory virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::InfectionData& in, std::default_random_engine *rd = nullptr); - virtual CDM::InfectionData* Unload() const override; - virtual const char* GetLocation_cStr() const; virtual std::string GetLocation() const; virtual bool HasLocation() const; @@ -49,8 +48,8 @@ class BIOGEARS_API SEInfection : public SEPatientAction { virtual void InvalidateLocation(); virtual bool HasSeverity() const; - virtual CDM::enumInfectionSeverity::value GetSeverity() const; - virtual void SetSeverity(CDM::enumInfectionSeverity::value t); + virtual SEInfectionSeverity GetSeverity() const; + virtual void SetSeverity(SEInfectionSeverity t); virtual void InvalidateSeverity(); virtual bool HasMinimumInhibitoryConcentration() const; @@ -58,15 +57,12 @@ class BIOGEARS_API SEInfection : public SEPatientAction { virtual void ToString(std::ostream& str) const override; - bool operator==( const SEInfection& rhs) const; - bool operator!=( const SEInfection& rhs) const; - -protected: - virtual void Unload(CDM::InfectionData& data) const; + bool operator==(const SEInfection& rhs) const; + bool operator!=(const SEInfection& rhs) const; protected: std::string m_Location; - CDM::enumInfectionSeverity::value m_Severity; + SEInfectionSeverity m_Severity; SEScalarMassPerVolume* m_MinimumInhibitoryConcentration; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEIntubation.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEIntubation.h index 9ee3b3cd2..3ba2e9548 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEIntubation.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEIntubation.h @@ -12,7 +12,8 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include + #include @@ -30,30 +31,23 @@ class BIOGEARS_API SEIntubation : public SEPatientAction { static constexpr const char* TypeTag() { return "SEIntubation"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; //clear memory + virtual void Invalidate() override; // clear memory virtual bool IsValid() const override; - + virtual bool IsActive() const override; - - virtual bool Load(const CDM::IntubationData& in, std::default_random_engine *rd = nullptr); - virtual CDM::IntubationData* Unload() const override; - - virtual CDM::enumIntubationType::value GetType() const; - virtual void SetType(CDM::enumIntubationType::value t); + virtual SEIntubationType GetType() const; + virtual void SetType(SEIntubationType t); virtual bool HasType() const; virtual void InvalidateType(); virtual void ToString(std::ostream& str) const override; - - bool operator==( const SEIntubation& rhs) const; - bool operator!=( const SEIntubation& rhs) const; -protected: - virtual void Unload(CDM::IntubationData& data) const; + bool operator==(const SEIntubation& rhs) const; + bool operator!=(const SEIntubation& rhs) const; protected: - CDM::enumIntubationType::value m_Type; + SEIntubationType m_Type; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEMechanicalVentilation.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEMechanicalVentilation.h index e18eb73f2..628cbb68e 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEMechanicalVentilation.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEMechanicalVentilation.h @@ -11,9 +11,11 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once -#include "biogears/cdm/properties/SEScalarPressure.h" +#include +#include #include -#include +#include +#include #include @@ -22,10 +24,7 @@ class Serializer; class SESubstance; class SESubstanceFraction; class SEMechanicalVentilationConfiguration; -class SEScalarVolumePerTime; -class VolumePerTimeUnit; -class SEScalarPressure; -class PressureUnit; + namespace io { class PatientActions; } @@ -40,16 +39,13 @@ class BIOGEARS_API SEMechanicalVentilation : public SEPatientAction { static constexpr const char* TypeTag() { return "SEMechanicalVentilation"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; + virtual void Invalidate() override; virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::MechanicalVentilationData& in, const SESubstanceManager& subMgr, std::default_random_engine *rd = nullptr); - virtual CDM::MechanicalVentilationData* Unload() const override; - - virtual CDM::enumOnOff::value GetState() const; - virtual void SetState(CDM::enumOnOff::value name); + virtual SEOnOff GetState() const; + virtual void SetState(SEOnOff name); virtual bool HasState() const; virtual void InvalidateState(); @@ -72,16 +68,13 @@ class BIOGEARS_API SEMechanicalVentilation : public SEPatientAction { virtual void ToString(std::ostream& str) const override; - bool operator==( const SEMechanicalVentilation& rhs) const; - bool operator!=( const SEMechanicalVentilation& rhs) const; - -protected: - virtual void Unload(CDM::MechanicalVentilationData& data) const; + bool operator==(const SEMechanicalVentilation& rhs) const; + bool operator!=(const SEMechanicalVentilation& rhs) const; protected: std::stringstream m_ss; - CDM::enumOnOff::value m_State; + SEOnOff m_State; SEScalarVolumePerTime* m_Flow; SEScalarPressure* m_Pressure; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SENasalCannula.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SENasalCannula.h index 9f16aaa88..74e9bb351 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SENasalCannula.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SENasalCannula.h @@ -12,12 +12,12 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include +#include #include namespace biogears { -class SEScalarVolumePerTime; namespace io { class PatientActions; } @@ -31,14 +31,11 @@ class BIOGEARS_API SENasalCannula : public SEPatientAction { static constexpr const char* TypeTag() { return "SENasalCannula"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; + virtual void Invalidate() override; virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::NasalCannulaData& in, std::default_random_engine *rd = nullptr); - virtual CDM::NasalCannulaData* Unload() const override; - virtual bool HasFlowRate() const; virtual SEScalarVolumePerTime& GetFlowRate(); @@ -47,9 +44,6 @@ class BIOGEARS_API SENasalCannula : public SEPatientAction { bool operator==(const SENasalCannula& rhs) const; bool operator!=(const SENasalCannula& rhs) const; -protected: - virtual void Unload(CDM::NasalCannulaData& data) const; - protected: SEScalarVolumePerTime* m_FlowRate; }; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SENeedleDecompression.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SENeedleDecompression.h index 8f0c9de08..87a4db6dd 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SENeedleDecompression.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SENeedleDecompression.h @@ -12,7 +12,7 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include #include @@ -23,6 +23,7 @@ namespace io { class BIOGEARS_API SENeedleDecompression : public SEPatientAction { friend io::PatientActions; + public: SENeedleDecompression(); virtual ~SENeedleDecompression() override; @@ -30,31 +31,24 @@ class BIOGEARS_API SENeedleDecompression : public SEPatientAction { static constexpr const char* TypeTag() { return "SENeedleDecompression"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; //clear memory + virtual void Invalidate() override; // clear memory virtual bool IsValid() const override; virtual bool IsActive() const override; virtual void SetActive(bool b); - virtual bool Load(const CDM::NeedleDecompressionData& in, std::default_random_engine *rd = nullptr); - virtual CDM::NeedleDecompressionData* Unload() const override; - - virtual CDM::enumSide::value GetSide() const; - virtual void SetSide(CDM::enumSide::value LeftOrRight); + virtual SESide GetSide() const; + virtual void SetSide(SESide LeftOrRight); virtual bool HasSide() const; virtual void InvalidateSide(); virtual void ToString(std::ostream& str) const override; - bool operator==( const SENeedleDecompression& rhs) const; - bool operator!=( const SENeedleDecompression& rhs) const; - -protected: - virtual void Unload(CDM::NeedleDecompressionData& data) const; - + bool operator==(const SENeedleDecompression& rhs) const; + bool operator!=(const SENeedleDecompression& rhs) const; protected: - CDM::enumSide::value m_Side; - CDM::enumOnOff::value m_State; + SESide m_Side; + SEOnOff m_State; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEOverride.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEOverride.h index 2788d5a76..f4590415f 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEOverride.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEOverride.h @@ -12,11 +12,14 @@ specific language governing permissions and limitations under the License. #pragma once #include +#include +#include #include #include #include #include +#include #include #include #include @@ -27,7 +30,6 @@ specific language governing permissions and limitations under the License. #include #include #include -#include #include @@ -47,28 +49,22 @@ class BIOGEARS_API SEOverride : public SEPatientAction { static constexpr const char* TypeTag() { return "SEOverride"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; //clear memory + virtual void Invalidate() override; // clear memory virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::OverrideData& in, std::default_random_engine *rd = nullptr); - virtual CDM::OverrideData* Unload() const override; - -protected: - virtual void Unload(CDM::OverrideData& data) const; - public: - CDM::enumOnOff::value GetOverrideState() const; - void SetOverrideState(CDM::enumOnOff::value state); + SEOnOff GetOverrideState() const; + void SetOverrideState(SEOnOff state); bool HasOverrideState() const; void InvalidateOverrideState(); - CDM::enumOnOff::value GetOverrideConformance() const; - void SetOverrideConformance(CDM::enumOnOff::value valid); + SEOnOff GetOverrideConformance() const; + void SetOverrideConformance(SEOnOff valid); bool HasOverrideConformance() const; void InvalidateOverrideConformance(); - //Blood Chemistry + // Blood Chemistry bool HasArterialPHOverride() const; SEScalar& GetArterialPHOverride(); double GetArterialPHOverride() const; @@ -111,7 +107,7 @@ class BIOGEARS_API SEOverride : public SEPatientAction { bool HasBloodChemistryOverride() const; - //Cardiovascular + // Cardiovascular bool HasBloodVolumeOverride() const; SEScalarVolume& GetBloodVolumeOverride(); double GetBloodVolumeOverride(const VolumeUnit& unit) const; @@ -135,7 +131,7 @@ class BIOGEARS_API SEOverride : public SEPatientAction { double GetSystolicArterialPressureOverride(const PressureUnit& unit) const; bool HasCardiovascularOverride() const; - //Endocrine + // Endocrine bool HasInsulinSynthesisRateOverride() const; SEScalarAmountPerTime& GetInsulinSynthesisRateOverride(); double GetInsulinSynthesisRateOverride(const AmountPerTimeUnit& unit) const; @@ -144,7 +140,7 @@ class BIOGEARS_API SEOverride : public SEPatientAction { double GetGlucagonSynthesisRateOverride(const AmountPerTimeUnit& unit) const; bool HasEndocrineOverride() const; - //Energy + // Energy bool HasAchievedExerciseLevelOverride() const; SEScalarFraction& GetAchievedExerciseLevelOverride(); double GetAchievedExerciseLevelOverride() const; @@ -187,7 +183,7 @@ class BIOGEARS_API SEOverride : public SEPatientAction { bool HasEnergyOverride() const; - //Renal + // Renal bool HasLeftAfferentArterioleResistanceOverride() const; SEScalarFlowResistance& GetLeftAfferentArterioleResistanceOverride(); double GetLeftAfferentArterioleResistanceOverride(const FlowResistanceUnit& unit) const; @@ -230,7 +226,7 @@ class BIOGEARS_API SEOverride : public SEPatientAction { bool HasRenalOverride() const; - //Respiratory + // Respiratory bool HasExpiratoryFlowOverride() const; SEScalarVolumePerTime& GetExpiratoryFlowOverride(); double GetExpiratoryFlowOverride(const VolumePerTimeUnit& unit) const; @@ -264,7 +260,7 @@ class BIOGEARS_API SEOverride : public SEPatientAction { bool HasRespiratoryOverride() const; - //Tissue + // Tissue bool HasExtravascularFluidVolumeOverride() const; SEScalarVolume& GetExtravascularFluidVolumeOverride(); double GetExtravascularFluidVolumeOverride(const VolumeUnit& unit) const; @@ -287,13 +283,13 @@ class BIOGEARS_API SEOverride : public SEPatientAction { bool HasTissueOverride() const; virtual void ToString(std::ostream& str) const override; - - bool operator==( const SEOverride& rhs) const; - bool operator!=( const SEOverride& rhs) const; + + bool operator==(const SEOverride& rhs) const; + bool operator!=(const SEOverride& rhs) const; protected: - CDM::enumOnOff m_OverrideState; - CDM::enumOnOff m_OverrideConformance; + SEOnOff m_OverrideState; + SEOnOff m_OverrideConformance; SEScalar* m_ArterialBloodPHOverride; SEScalar* m_VenousBloodPHOverride; SEScalarFraction* m_CarbonDioxideSaturationOverride; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEPainStimulus.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEPainStimulus.h index 6be32f07b..79e74fc81 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEPainStimulus.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEPainStimulus.h @@ -12,7 +12,7 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include #include #include @@ -25,6 +25,7 @@ namespace io { } class BIOGEARS_API SEPainStimulus : public SEPatientAction { friend io::PatientActions; + public: SEPainStimulus(); virtual ~SEPainStimulus() override; @@ -32,14 +33,11 @@ class BIOGEARS_API SEPainStimulus : public SEPatientAction { static constexpr const char* TypeTag() { return "SEPainStimulus"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; + virtual void Invalidate() override; virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::PainStimulusData& in, std::default_random_engine *rd = nullptr); - virtual CDM::PainStimulusData* Unload() const override; - virtual bool HasSeverity() const; virtual SEScalar0To1& GetSeverity(); @@ -53,12 +51,9 @@ class BIOGEARS_API SEPainStimulus : public SEPatientAction { virtual void SetLocation(const std::string& name); virtual void ToString(std::ostream& str) const override; - - bool operator==( const SEPainStimulus& rhs) const; - bool operator!=( const SEPainStimulus& rhs) const; -protected: - virtual void Unload(CDM::PainStimulusData& data) const; + bool operator==(const SEPainStimulus& rhs) const; + bool operator!=(const SEPainStimulus& rhs) const; protected: SEScalar0To1* m_Severity; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEPatientAction.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEPatientAction.h index 4fb8a1e6d..e6c5ca610 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEPatientAction.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEPatientAction.h @@ -11,9 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once +#include #include -#include -#include #include @@ -23,19 +22,13 @@ class BIOGEARS_API SEPatientAction : public SEAction { SEPatientAction(); virtual ~SEPatientAction(); - virtual void Clear(); //clear memory + virtual void Invalidate(); // clear memory virtual bool IsValid() const; - virtual bool Load(const CDM::PatientActionData& in); - virtual CDM::PatientActionData* Unload() const = 0; - bool operator==(const SEPatientAction& rhs) const; bool operator!=(const SEPatientAction& rhs) const; -protected: - virtual void Unload(CDM::PatientActionData& data) const; - public: using SEAction::ToString; virtual void ToString(std::ostream& str) const = 0; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEPatientAssessmentRequest.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEPatientAssessmentRequest.h index 300a9d8d7..b5a59abba 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEPatientAssessmentRequest.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEPatientAssessmentRequest.h @@ -12,7 +12,8 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include +#include #include @@ -22,6 +23,7 @@ namespace io { } class BIOGEARS_API SEPatientAssessmentRequest : public SEPatientAction { friend io::PatientActions; + public: SEPatientAssessmentRequest(); virtual ~SEPatientAssessmentRequest() override; @@ -29,28 +31,23 @@ class BIOGEARS_API SEPatientAssessmentRequest : public SEPatientAction { static constexpr const char* TypeTag() { return "SEPatientAssessmentRequest"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; //clear memory + virtual void Invalidate() override; // clear memory virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::PatientAssessmentRequestData& in, std::default_random_engine *rd = nullptr); - virtual CDM::PatientAssessmentRequestData* Unload() const override; - - bool operator==( const SEPatientAssessmentRequest& rhs) const; - bool operator!=( const SEPatientAssessmentRequest& rhs) const; -protected: - virtual void Unload(CDM::PatientAssessmentRequestData& data) const; + bool operator==(const SEPatientAssessmentRequest& rhs) const; + bool operator!=(const SEPatientAssessmentRequest& rhs) const; public: - virtual CDM::enumPatientAssessment::value GetType() const; - virtual void SetType(CDM::enumPatientAssessment::value type); + virtual SEPatientAssessmentType GetType() const; + virtual void SetType(SEPatientAssessmentType type); virtual bool HasType() const; virtual void InvalidateType(); virtual void ToString(std::ostream& str) const override; protected: - CDM::enumPatientAssessment::value m_Type; + SEPatientAssessmentType m_Type; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEPericardialEffusion.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEPericardialEffusion.h index 89b61af38..22a97084f 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEPericardialEffusion.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEPericardialEffusion.h @@ -12,12 +12,11 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include - +#include +#include #include namespace biogears { -class SEScalarVolumePerTime; namespace io { class PatientActions; } @@ -30,14 +29,11 @@ class BIOGEARS_API SEPericardialEffusion : public SEPatientAction { static constexpr const char* TypeTag() { return "SEPericardialEffusion"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; //clear memory + virtual void Invalidate() override; //clear memory virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::PericardialEffusionData& in, std::default_random_engine *rd = nullptr); - virtual CDM::PericardialEffusionData* Unload() const override; - virtual bool HasEffusionRate() const; virtual SEScalarVolumePerTime& GetEffusionRate(); @@ -46,10 +42,6 @@ class BIOGEARS_API SEPericardialEffusion : public SEPatientAction { bool operator==( const SEPericardialEffusion& rhs) const; bool operator!=( const SEPericardialEffusion& rhs) const; -protected: - virtual void Unload(CDM::PericardialEffusionData& data) const; - - protected: SEScalarVolumePerTime* m_EffusionRate; }; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEPulmonaryShunt.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEPulmonaryShunt.h index 07e0b27a9..c28a5e365 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEPulmonaryShunt.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEPulmonaryShunt.h @@ -12,7 +12,7 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include #include @@ -31,18 +31,11 @@ class BIOGEARS_API SEPulmonaryShunt : public SEPatientAction { static constexpr const char* TypeTag() { return "SEPulmonaryShunt"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; + virtual void Invalidate() override; virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::PulmonaryShuntData& in, std::default_random_engine *rd = nullptr); - virtual CDM::PulmonaryShuntData* Unload() const override; - -protected: - virtual void Unload(CDM::PulmonaryShuntData& data) const; - -public: virtual bool HasFlowRateScale() const; virtual SEScalar0To1& GetFlowRateScale(); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEPupillaryResponse.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEPupillaryResponse.h index 4de218e2b..15de24cd0 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEPupillaryResponse.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEPupillaryResponse.h @@ -14,8 +14,7 @@ specific language governing permissions and limitations under the License. #include #include -#include - +#include #include namespace biogears { @@ -33,14 +32,11 @@ friend io::Physiology; SEPupillaryResponse(); virtual ~SEPupillaryResponse(); - virtual void Clear(); // Deletes all members + virtual void Invalidate(); // Deletes all members virtual const SEScalar* GetScalar(const char* name); virtual const SEScalar* GetScalar(const std::string& name); - virtual bool Load(const CDM::PupillaryResponseData& in); - virtual CDM::PupillaryResponseData* Unload() const; - virtual bool HasReactivityModifier() const; virtual SEScalarNeg1To1& GetReactivityModifier(); virtual double GetReactivityModifier() const; @@ -56,9 +52,6 @@ friend io::Physiology; bool operator==(const SEPupillaryResponse& rhs) const; bool operator!=(const SEPupillaryResponse& rhs) const; -protected: - virtual void Unload(CDM::PupillaryResponseData& data) const; - private: SEScalarNeg1To1* m_ReactivityModifier; SEScalarNeg1To1* m_ShapeModifier; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SERadiationAbsorbedDose.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SERadiationAbsorbedDose.h index dd7b178c8..267760dca 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SERadiationAbsorbedDose.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SERadiationAbsorbedDose.h @@ -12,12 +12,12 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include - +#include +#include #include namespace biogears { -class SEScalarEnergyPerMass; + namespace io { class PatientActions; } @@ -31,14 +31,11 @@ class BIOGEARS_API SERadiationAbsorbedDose : public SEPatientAction { static constexpr const char* TypeTag() { return "SERadiationAbsorbedDose"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; + virtual void Invalidate() override; virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::RadiationAbsorbedDoseData& in, std::default_random_engine *rd = nullptr); - virtual CDM::RadiationAbsorbedDoseData* Unload() const override; - virtual bool HasDose() const; virtual SEScalarEnergyPerMass& GetDose(); @@ -47,9 +44,6 @@ class BIOGEARS_API SERadiationAbsorbedDose : public SEPatientAction { bool operator==(const SERadiationAbsorbedDose& rhs) const; bool operator!=(const SERadiationAbsorbedDose& rhs) const; -protected: - virtual void Unload(CDM::RadiationAbsorbedDoseData& data) const; - protected: SEScalarEnergyPerMass* m_RadiationDose; }; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SESleep.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SESleep.h index edce9109f..d431b1364 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SESleep.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SESleep.h @@ -11,11 +11,12 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once +#include #include -#include + #include -#include +#include #include @@ -27,35 +28,27 @@ class BIOGEARS_API SESleep : public SEPatientAction { friend class io::PatientActions; public: - SESleep(); + SESleep(); virtual ~SESleep() override; static constexpr const char* TypeTag() { return "SESleep"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; //clear memory + virtual void Invalidate() override; // clear memory virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::SleepData& in, std::default_random_engine *rd = nullptr); - virtual CDM::SleepData* Unload() const override; - virtual bool HasSleepState() const; - virtual CDM::enumOnOff GetSleepState() const; - virtual void SetSleepState(CDM::enumOnOff::value t); + virtual SEOnOff GetSleepState() const; + virtual void SetSleepState(SEOnOff t); virtual void ToString(std::ostream& str) const override; bool operator==(const SESleep& rhs) const; bool operator!=(const SESleep& rhs) const; -protected: - virtual void Unload(CDM::SleepData& data) const; - private: - CDM::enumOnOff::value m_SleepState; - - -}; + SEOnOff m_SleepState; +}; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SESubstanceAdministration.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SESubstanceAdministration.h index e24209bc6..fb133cccc 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SESubstanceAdministration.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SESubstanceAdministration.h @@ -12,7 +12,7 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include #include @@ -25,18 +25,14 @@ class BIOGEARS_API SESubstanceAdministration : public SEPatientAction { static constexpr const char* TypeTag() { return "SESubstanceAdministration"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; //clear memory + virtual void Invalidate() override; // clear memory virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::SubstanceAdministrationData& in); - bool operator==(const SESubstanceAdministration& rhs) const; bool operator!=(const SESubstanceAdministration& rhs) const; -protected: - virtual void Unload(CDM::SubstanceAdministrationData& data) const; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SESubstanceBolus.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SESubstanceBolus.h index 6e7badde6..4a746ca17 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SESubstanceBolus.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SESubstanceBolus.h @@ -11,10 +11,11 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once +#include #include +#include #include #include -#include #include @@ -30,17 +31,13 @@ class BIOGEARS_API SESubstanceBolus : public SESubstanceAdministration { SESubstanceBolus(const SESubstance& substance); virtual ~SESubstanceBolus(); - virtual void Clear(); //clear memory + virtual void Invalidate(); // clear memory virtual bool IsValid() const; virtual bool IsActive() const; - virtual bool Load(const CDM::SubstanceBolusData& in, std::default_random_engine *rd = nullptr); - virtual CDM::SubstanceBolusData* Unload() const; - -public: - virtual CDM::enumBolusAdministration::value GetAdminRoute() const; - virtual void SetAdminRoute(CDM::enumBolusAdministration::value name); + virtual SEBolusAdministration GetAdminRoute() const; + virtual void SetAdminRoute(SEBolusAdministration name); virtual bool HasAdminRoute() const; virtual void InvalidateAdminRoute(); @@ -56,15 +53,12 @@ class BIOGEARS_API SESubstanceBolus : public SESubstanceAdministration { virtual SESubstance& GetSubstance() const; virtual void ToString(std::ostream& str) const; - + bool operator==(const SESubstanceBolus& rhs) const; bool operator!=(const SESubstanceBolus& rhs) const; protected: - virtual void Unload(CDM::SubstanceBolusData& data) const; - -protected: - CDM::enumBolusAdministration::value m_AdminRoute; + SEBolusAdministration m_AdminRoute; SEScalarTime* m_AdminTime; SEScalarMassPerVolume* m_Concentration; SEScalarVolume* m_Dose; @@ -78,17 +72,11 @@ class BIOGEARS_API SESubstanceBolusState { SESubstanceBolusState(const SESubstance& sub); ~SESubstanceBolusState(); - virtual bool Load(const CDM::SubstanceBolusStateData& in, std::default_random_engine *rd = nullptr); - virtual CDM::SubstanceBolusStateData* Unload() const; - SEScalarTime& GetElapsedTime() { return m_ElapsedTime; } SEScalarVolume& GetAdministeredDose() { return m_AdministeredDose; } - bool operator==( const SESubstanceBolusState& rhs) const; - bool operator!=( const SESubstanceBolusState& rhs) const; - -protected: - virtual void Unload(CDM::SubstanceBolusStateData& data) const; + bool operator==(const SESubstanceBolusState& rhs) const; + bool operator!=(const SESubstanceBolusState& rhs) const; protected: const SESubstance& m_Substance; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SESubstanceCompoundInfusion.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SESubstanceCompoundInfusion.h index c9f12f8da..837b16660 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SESubstanceCompoundInfusion.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SESubstanceCompoundInfusion.h @@ -11,14 +11,13 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once +#include #include -#include - +#include +#include #include namespace biogears { -class SEScalarVolume; -class SEScalarVolumePerTime; class SESubstanceCompound; namespace io { class PatientActions; @@ -30,14 +29,11 @@ class BIOGEARS_API SESubstanceCompoundInfusion : public SESubstanceAdministratio SESubstanceCompoundInfusion(const SESubstanceCompound& compound); virtual ~SESubstanceCompoundInfusion(); - virtual void Clear(); //clear memory + virtual void Invalidate(); // clear memory virtual bool IsValid() const; virtual bool IsActive() const; - virtual bool Load(const CDM::SubstanceCompoundInfusionData& in, std::default_random_engine *rd = nullptr); - virtual CDM::SubstanceCompoundInfusionData* Unload() const; - virtual bool HasBagVolume() const; virtual SEScalarVolume& GetBagVolume(); @@ -48,11 +44,8 @@ class BIOGEARS_API SESubstanceCompoundInfusion : public SESubstanceAdministratio virtual void ToString(std::ostream& str) const; - bool operator==( const SESubstanceCompoundInfusion& rhs) const; - bool operator!=( const SESubstanceCompoundInfusion& rhs) const; - -protected: - virtual void Unload(CDM::SubstanceCompoundInfusionData& data) const; + bool operator==(const SESubstanceCompoundInfusion& rhs) const; + bool operator!=(const SESubstanceCompoundInfusion& rhs) const; protected: SEScalarVolume* m_BagVolume; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SESubstanceInfusion.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SESubstanceInfusion.h index de4320766..0d6d1bf15 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SESubstanceInfusion.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SESubstanceInfusion.h @@ -11,32 +11,29 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once +#include #include -#include - +#include +#include #include namespace biogears { class SESubstance; -class SEScalarMassPerVolume; -class SEScalarVolumePerTime; namespace io { class PatientActions; } class BIOGEARS_API SESubstanceInfusion : public SESubstanceAdministration { -friend io::PatientActions; + friend io::PatientActions; + public: SESubstanceInfusion(const SESubstance& substance); virtual ~SESubstanceInfusion(); - virtual void Clear(); //clear memory + virtual void Invalidate(); // clear memory virtual bool IsValid() const; virtual bool IsActive() const; - virtual bool Load(const CDM::SubstanceInfusionData& in, std::default_random_engine *rd = nullptr); - virtual CDM::SubstanceInfusionData* Unload() const; -public: virtual bool HasConcentration() const; virtual SEScalarMassPerVolume& GetConcentration(); @@ -46,13 +43,9 @@ friend io::PatientActions; virtual SESubstance& GetSubstance() const; virtual void ToString(std::ostream& str) const; - - bool operator==( const SESubstanceInfusion& rhs) const; - bool operator!=( const SESubstanceInfusion& rhs) const; - -protected: - virtual void Unload(CDM::SubstanceInfusionData& data) const; + bool operator==(const SESubstanceInfusion& rhs) const; + bool operator!=(const SESubstanceInfusion& rhs) const; protected: SEScalarMassPerVolume* m_Concentration; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SESubstanceNasalDose.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SESubstanceNasalDose.h index 1fbd56c56..c3d7670aa 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SESubstanceNasalDose.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SESubstanceNasalDose.h @@ -12,11 +12,11 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once +#include #include #include #include #include -#include #include @@ -32,14 +32,11 @@ class BIOGEARS_API SESubstanceNasalDose : public SESubstanceAdministration { SESubstanceNasalDose(const SESubstance& substance); virtual ~SESubstanceNasalDose(); - virtual void Clear(); // clear memory + virtual void Invalidate(); // clear memory virtual bool IsValid() const; virtual bool IsActive() const; - virtual bool Load(const CDM::SubstanceNasalDoseData& in, std::default_random_engine *rd = nullptr); - virtual CDM::SubstanceNasalDoseData* Unload() const; - virtual bool HasDose() const; virtual SEScalarMass& GetDose(); @@ -50,9 +47,6 @@ class BIOGEARS_API SESubstanceNasalDose : public SESubstanceAdministration { bool operator==(const SESubstanceNasalDose& rhs) const; bool operator!=(const SESubstanceNasalDose& rhs) const; -protected: - virtual void Unload(CDM::SubstanceNasalDoseData& data) const; - private: SEScalarMass* m_Dose; const SESubstance& m_Substance; @@ -64,16 +58,14 @@ class BIOGEARS_API SENasalState { public: SENasalState(const SESubstance& sub); ~SENasalState(); - virtual void Clear(); - - virtual bool Load(const CDM::NasalStateData& in, std::default_random_engine *rd = nullptr); - virtual CDM::NasalStateData* Unload() const; + virtual void Invalidate(); bool Initialize(SEScalarMass& dose); SEScalarMass& GetTotalNasalDose(); - //SEScalarMassPerVolume& GetVenaCavaConcentration(); + // SEScalarMassPerVolume& GetVenaCavaConcentration(); + std::vector& GetUnreleasedNasalMasses(); std::vector& GetReleasedNasalMasses(); @@ -86,15 +78,15 @@ class BIOGEARS_API SENasalState { bool operator==(const SENasalState& rhs) const; bool operator!=(const SENasalState& rhs) const; - private: - virtual void Unload(CDM::NasalStateData& data) const; // Nasal specific values const SESubstance* m_Substance; SEScalarMass* m_TotalNasalDose; - //SEScalarMassPerVolume* m_VenaCavaConcentration; + // SEScalarMassPerVolume* m_VenaCavaConcentration; + std::vector m_UnreleasedDrugMasses; std::vector m_ReleasedDrugMasses; + size_t m_NumUnreleasedMasses; size_t m_NumReleasedMasses; }; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SESubstanceOralDose.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SESubstanceOralDose.h index 58b8cb1ff..0afb73bab 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SESubstanceOralDose.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SESubstanceOralDose.h @@ -11,10 +11,10 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once +#include #include #include #include -#include #include @@ -32,16 +32,13 @@ class BIOGEARS_API SESubstanceOralDose : public SESubstanceAdministration { SESubstanceOralDose(const SESubstance& substance); virtual ~SESubstanceOralDose(); - virtual void Clear(); // clear memory + virtual void Invalidate(); // clear memory virtual bool IsValid() const; virtual bool IsActive() const; - virtual bool Load(const CDM::SubstanceOralDoseData& in, std::default_random_engine *rd = nullptr); - virtual CDM::SubstanceOralDoseData* Unload() const; - - virtual CDM::enumOralAdministration::value GetAdminRoute() const; - virtual void SetAdminRoute(CDM::enumOralAdministration::value name); + virtual SEOralAdministrationType GetAdminRoute() const; + virtual void SetAdminRoute(SEOralAdministrationType name); virtual bool HasAdminRoute() const; virtual bool HasDose() const; @@ -54,11 +51,8 @@ class BIOGEARS_API SESubstanceOralDose : public SESubstanceAdministration { bool operator==(const SESubstanceOralDose& rhs) const; bool operator!=(const SESubstanceOralDose& rhs) const; -protected: - virtual void Unload(CDM::SubstanceOralDoseData& data) const; - private: - CDM::enumOralAdministration::value m_AdminRoute; + SEOralAdministrationType m_AdminRoute; SEScalarMass* m_Dose; const SESubstance& m_Substance; }; @@ -69,10 +63,7 @@ class BIOGEARS_API SETransmucosalState { public: SETransmucosalState(const SESubstance& sub); ~SETransmucosalState(); - virtual void Clear(); - - virtual bool Load(const CDM::TransmucosalStateData& in, std::default_random_engine *rd = nullptr); - virtual CDM::TransmucosalStateData* Unload() const; + virtual void Invalidate(); bool Initialize(SEScalarMass& dose); @@ -88,9 +79,6 @@ class BIOGEARS_API SETransmucosalState { bool operator==(const SETransmucosalState& rhs) const; bool operator!=(const SETransmucosalState& rhs) const; -protected: - virtual void Unload(CDM::TransmucosalStateData& data) const; - private: // Transumucosal specific values const SESubstance* m_Substance; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SETensionPneumothorax.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SETensionPneumothorax.h index b881406d2..9bb1779cf 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SETensionPneumothorax.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SETensionPneumothorax.h @@ -12,7 +12,7 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include #include @@ -31,21 +31,18 @@ class BIOGEARS_API SETensionPneumothorax : public SEPatientAction { static constexpr const char* TypeTag() { return "SETensionPneumothorax"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; //clear memory + virtual void Invalidate() override; // clear memory virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::TensionPneumothoraxData& in, std::default_random_engine *rd = nullptr); - virtual CDM::TensionPneumothoraxData* Unload() const override; - - virtual CDM::enumPneumothoraxType::value GetType() const; - virtual void SetType(CDM::enumPneumothoraxType::value name); + virtual SEPneumothoraxType GetType() const; + virtual void SetType(SEPneumothoraxType name); virtual bool HasType() const; virtual void InvalidateType(); - virtual CDM::enumSide::value GetSide() const; - virtual void SetSide(CDM::enumSide::value name); + virtual SESide GetSide() const; + virtual void SetSide(SESide name); virtual bool HasSide() const; virtual void InvalidateSide(); @@ -53,16 +50,13 @@ class BIOGEARS_API SETensionPneumothorax : public SEPatientAction { virtual SEScalar0To1& GetSeverity(); virtual void ToString(std::ostream& str) const override; - - bool operator==( const SETensionPneumothorax& rhs) const; - bool operator!=( const SETensionPneumothorax& rhs) const; -protected: - virtual void Unload(CDM::TensionPneumothoraxData& data) const; + bool operator==(const SETensionPneumothorax& rhs) const; + bool operator!=(const SETensionPneumothorax& rhs) const; protected: - CDM::enumPneumothoraxType::value m_Type; - CDM::enumSide::value m_Side; + SEPneumothoraxType m_Type; + SESide m_Side; SEScalar0To1* m_Severity; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SETourniquet.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SETourniquet.h index 0dd91c916..00375572d 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SETourniquet.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SETourniquet.h @@ -11,15 +11,15 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once -#include #include +#include #include - +#include +#include #include namespace biogears { -class SEScalarVolumePerTime; namespace io { class PatientActions; } @@ -33,17 +33,11 @@ class BIOGEARS_API SETourniquet : public SEPatientAction { static constexpr const char* TypeTag() { return "SETourniquet"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; //clear memory + virtual void Invalidate() override; // clear memory virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::TourniquetData& in, std::default_random_engine *rd = nullptr); - virtual CDM::TourniquetData* Unload() const override; - -protected: - virtual void Unload(CDM::TourniquetData& data) const; - public: virtual const char* GetCompartment_cStr() const; virtual std::string GetCompartment() const; @@ -53,17 +47,16 @@ class BIOGEARS_API SETourniquet : public SEPatientAction { virtual void InvalidateCompartment(); virtual bool HasTourniquetLevel() const; - virtual CDM::enumTourniquetApplicationLevel GetTourniquetLevel(); - virtual void SetTourniquetLevel(CDM::enumTourniquetApplicationLevel::value level); + virtual SETourniquetApplicationType GetTourniquetLevel(); + virtual void SetTourniquetLevel(SETourniquetApplicationType level); virtual void ToString(std::ostream& str) const override; - + bool operator==(const SETourniquet& rhs) const; bool operator!=(const SETourniquet& rhs) const; protected: std::string m_Compartment; - CDM::enumTourniquetApplicationLevel::value m_TourniquetLevel; - + SETourniquetApplicationType m_TourniquetLevel; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEUrinate.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEUrinate.h index c32990eda..d37744844 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEUrinate.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEUrinate.h @@ -11,9 +11,11 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once +#include + #include -#include +#include #include @@ -26,23 +28,15 @@ class BIOGEARS_API SEUrinate : public SEPatientAction { static constexpr const char* TypeTag() { return "SEUrinate"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; //clear memory + virtual void Invalidate() override; //clear memory virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::UrinateData& in, std::default_random_engine *rd = nullptr); - virtual CDM::UrinateData* Unload() const override; - virtual void ToString(std::ostream& str) const override; bool operator==( const SEUrinate& rhs) const; bool operator!=( const SEUrinate& rhs) const; -protected: - virtual void Unload(CDM::UrinateData& data) const; - - -protected: }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEUseInhaler.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEUseInhaler.h index 0e7df4491..1625d83f6 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEUseInhaler.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEUseInhaler.h @@ -11,8 +11,10 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once +#include + #include -#include +#include #include @@ -26,22 +28,16 @@ class BIOGEARS_API SEUseInhaler : public SEConsciousRespirationCommand { SEUseInhaler(); virtual ~SEUseInhaler(); - virtual void Clear(); //clear memory + virtual void Invalidate(); //clear memory virtual bool IsValid() const; virtual bool IsActive() const; - virtual bool Load(const CDM::UseInhalerData& in, std::default_random_engine *rd = nullptr); - virtual CDM::UseInhalerData* Unload() const; - virtual void ToString(std::ostream& str) const; bool operator==( const SEUseInhaler& rhs) const; bool operator!=( const SEUseInhaler& rhs) const; -protected: - virtual void Unload(CDM::UseInhalerData& data) const; - protected: }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEArterialBloodGasAnalysis.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEArterialBloodGasAnalysis.h index 8b39b2ddb..68c5838ea 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEArterialBloodGasAnalysis.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEArterialBloodGasAnalysis.h @@ -12,13 +12,13 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include +#include +#include namespace biogears { class SEPatient; class SEScalar; -class SEScalarAmountPerVolume; -class SEScalarPressure; namespace io { class PatientAssessments; @@ -34,13 +34,7 @@ class BIOGEARS_API SEArterialBloodGasAnalysis : public SEPatientAssessment { const char* classname() const override { return TypeTag(); } virtual void Reset() override; - virtual void Clear() override; - - virtual bool Load(const CDM::ArterialBloodGasAnalysisData& in); - virtual CDM::ArterialBloodGasAnalysisData* Unload() override; - -protected: - virtual void Unload(CDM::ArterialBloodGasAnalysisData& data); + virtual void Invalidate() override; public: virtual bool HaspH(); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SECompleteBloodCount.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SECompleteBloodCount.h index 40c87117a..a3b5dadb4 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SECompleteBloodCount.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SECompleteBloodCount.h @@ -11,16 +11,16 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once -#include "biogears/cdm/properties/SEScalarMassPerAmount.h" +#include #include -#include +#include +#include +#include +#include +#include namespace biogears { class SEScalarFraction; -class SEScalarMassPerVolume; -class SEScalarMassPerAmount; -class SEScalarVolume; -class SEScalarAmountPerVolume; namespace io { class PatientAssessments; } @@ -35,13 +35,7 @@ class BIOGEARS_API SECompleteBloodCount : public SEPatientAssessment { const char* classname() const override { return TypeTag(); } virtual void Reset() override; // reset values - virtual void Clear() override; // clear memory - - virtual bool Load(const CDM::CompleteBloodCountData& in); - virtual CDM::CompleteBloodCountData* Unload() override; - -protected: - virtual void Unload(CDM::CompleteBloodCountData& data); + virtual void Invalidate() override; // clear memory public: virtual bool HasHematocrit() const; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEComprehensiveMetabolicPanel.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEComprehensiveMetabolicPanel.h index d40643e8a..250d5961b 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEComprehensiveMetabolicPanel.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEComprehensiveMetabolicPanel.h @@ -12,12 +12,12 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include +#include +#include namespace biogears { class SEBloodChemistrySystem; -class SEScalarMassPerVolume; -class SEScalarAmountPerVolume; namespace io { class PatientAssessments; } @@ -32,13 +32,7 @@ class BIOGEARS_API SEComprehensiveMetabolicPanel : public SEPatientAssessment { const char* classname() const override { return TypeTag(); } virtual void Reset() override; // reset values - virtual void Clear() override; // clear memory - - virtual bool Load(const CDM::ComprehensiveMetabolicPanelData& in); - virtual CDM::ComprehensiveMetabolicPanelData* Unload() override; - -protected: - virtual void Unload(CDM::ComprehensiveMetabolicPanelData& data); + virtual void Invalidate() override; // clear memory public: bool HasAlbumin() const; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEPatientAssessment.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEPatientAssessment.h index 508c99690..50283b887 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEPatientAssessment.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEPatientAssessment.h @@ -14,7 +14,8 @@ specific language governing permissions and limitations under the License. #include #include -CDM_BIND_DECL(PatientAssessmentData) +#include + namespace biogears { /** * @brief @@ -30,13 +31,7 @@ class BIOGEARS_API SEPatientAssessment { virtual const char* classname() const = 0; virtual void Reset(); - virtual void Clear(); - - virtual bool Load(const CDM::PatientAssessmentData& in); - virtual CDM::PatientAssessmentData* Unload(); - -protected: - virtual void Unload(CDM::PatientAssessmentData& data); + virtual void Invalidate(); public: }; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEProthrombinTime.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEProthrombinTime.h index 1d6105b0e..89a5d5981 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEProthrombinTime.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEProthrombinTime.h @@ -12,7 +12,7 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include namespace biogears { class SEBloodChemistry; @@ -32,14 +32,8 @@ class BIOGEARS_API SEProthrombinTime : public SEPatientAssessment { static constexpr const char* TypeTag() { return "SEProthrombinTime"; }; const char* classname() const override { return TypeTag(); } - virtual void Reset(); // reset values - virtual void Clear(); // clear memory - - virtual bool Load(const CDM::ProthrombinTimeData& in); - virtual CDM::ProthrombinTimeData* Unload(); - -protected: - virtual void Unload(CDM::ProthrombinTimeData& data); + virtual void Reset() override ; // reset values + virtual void Invalidate() override ; // clear memory public: virtual bool HasInternationalNormalizedRatio(); @@ -51,4 +45,4 @@ class BIOGEARS_API SEProthrombinTime : public SEPatientAssessment { protected: SEScalar* m_InternationalNormalizedRatio; }; -} \ No newline at end of file +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEPsychomotorVigilanceTask.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEPsychomotorVigilanceTask.h index 6c97d05f5..1c0444a36 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEPsychomotorVigilanceTask.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEPsychomotorVigilanceTask.h @@ -12,12 +12,12 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include +#include namespace biogears { class SENervousSystem; class SEScalar; -class SEScalarTime; namespace io { class PatientAssessments; @@ -33,14 +33,8 @@ class BIOGEARS_API SEPsychomotorVigilanceTask : public SEPatientAssessment { static constexpr const char* TypeTag() { return "SEArterialBloodGasAnalysis"; }; const char* classname() const override { return TypeTag(); } - virtual void Reset(); // reset values - virtual void Clear(); // clear memory - - virtual bool Load(const CDM::PsychomotorVigilanceTaskData& in); - virtual CDM::PsychomotorVigilanceTaskData* Unload(); - -protected: - virtual void Unload(CDM::PsychomotorVigilanceTaskData& data); + virtual void Reset() override ; // reset values + virtual void Invalidate() override ; // clear memory public: bool HasAttentionLapses(); @@ -49,11 +43,11 @@ class BIOGEARS_API SEPsychomotorVigilanceTask : public SEPatientAssessment { bool HasReactionTime(); SEScalarTime& GetReactionTime(); - bool operator==(SEPsychomotorVigilanceTask const&) const; + bool operator==(SEPsychomotorVigilanceTask const&) const; bool operator!=(SEPsychomotorVigilanceTask const&) const; protected: SEScalar* m_AttentionLapses; SEScalarTime* m_ReactionTime; }; -} \ No newline at end of file +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEPulmonaryFunctionTest.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEPulmonaryFunctionTest.h index 81c9d2a04..f9320dc5f 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEPulmonaryFunctionTest.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEPulmonaryFunctionTest.h @@ -12,13 +12,13 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include +#include +#include namespace biogears { class SEPatient; class SERespiratorySystem; -class SEScalarVolume; -class SEScalarVolumePerTime; class SEFunctionVolumeVsTime; namespace io { class PatientAssessments; @@ -34,13 +34,7 @@ class BIOGEARS_API SEPulmonaryFunctionTest : public SEPatientAssessment { const char* classname() const override { return TypeTag(); } virtual void Reset() override; - virtual void Clear() override; - - virtual bool Load(const CDM::PulmonaryFunctionTestData& in); - virtual CDM::PulmonaryFunctionTestData* Unload() override; - -protected: - virtual void Unload(CDM::PulmonaryFunctionTestData& data); + virtual void Invalidate() override; public: virtual int GetNumberOfPlotPoints() { return m_NumberOfPlotPoints; } diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SESequentialOrganFailureAssessment.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SESequentialOrganFailureAssessment.h index 740019a31..55a30bada 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SESequentialOrganFailureAssessment.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SESequentialOrganFailureAssessment.h @@ -11,9 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once -#include "biogears/cdm/properties/SEScalar.h" #include -#include +#include +#include namespace biogears { class SEScalar; @@ -31,13 +31,7 @@ class BIOGEARS_API SESequentialOrganFailureAssessment : public SEPatientAssessme const char* classname() const override { return TypeTag(); } virtual void Reset() override; // reset values - virtual void Clear() override; // clear memory - - virtual bool Load(const CDM::SequentialOrganFailureAssessmentData& in); - virtual CDM::SequentialOrganFailureAssessmentData* Unload() override; - -protected: - virtual void Unload(CDM::SequentialOrganFailureAssessmentData& data); + virtual void Invalidate() override; // clear memory public: virtual bool HasRespirationSOFA(); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEUrinalysis.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEUrinalysis.h index 84befe7e4..9393d3761 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEUrinalysis.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEUrinalysis.h @@ -14,8 +14,9 @@ specific language governing permissions and limitations under the License. #include #include #include +#include #include -#include +#include namespace biogears { @@ -34,33 +35,27 @@ class BIOGEARS_API SEUrinalysis : public SEPatientAssessment { const char* classname() const override { return TypeTag(); } virtual void Reset() override; - virtual void Clear() override; - - virtual bool Load(const CDM::UrinalysisData& in); - virtual CDM::UrinalysisData* Unload() override; - -protected: - virtual void Unload(CDM::UrinalysisData& data); + virtual void Invalidate() override; public: virtual bool HasColorResult() const; - virtual CDM::enumUrineColor::value GetColorResult() const; - virtual void SetColorResult(CDM::enumUrineColor::value color); + virtual SEUrineColor GetColorResult() const; + virtual void SetColorResult(SEUrineColor color); virtual void InvalidateColorResult(); virtual bool HasAppearanceResult() const; - virtual CDM::enumClarityIndicator::value GetAppearanceResult() const; - virtual void SetAppearanceResult(CDM::enumClarityIndicator::value c); + virtual SEClarityIndicator GetAppearanceResult() const; + virtual void SetAppearanceResult(SEClarityIndicator c); virtual void InvalidateAppearanceResult(); virtual bool HasGlucoseResult() const; - virtual CDM::enumPresenceIndicator::value GetGlucoseResult() const; - virtual void SetGlucoseResult(CDM::enumPresenceIndicator::value p); + virtual SEPresenceIndicator GetGlucoseResult() const; + virtual void SetGlucoseResult(SEPresenceIndicator p); virtual void InvalidateGlucoseResult(); virtual bool HasKetoneResult() const; - virtual CDM::enumPresenceIndicator::value GetKetoneResult() const; - virtual void SetKetoneResult(CDM::enumPresenceIndicator::value p); + virtual SEPresenceIndicator GetKetoneResult() const; + virtual void SetKetoneResult(SEPresenceIndicator p); virtual void InvalidateKetoneResult(); virtual bool HasBilirubinResult() const; @@ -70,29 +65,29 @@ class BIOGEARS_API SEUrinalysis : public SEPatientAssessment { virtual SEScalar& GetSpecificGravityResult(); virtual bool HasBloodResult() const; - virtual CDM::enumPresenceIndicator::value GetBloodResult() const; - virtual void SetBloodResult(CDM::enumPresenceIndicator::value p); + virtual SEPresenceIndicator GetBloodResult() const; + virtual void SetBloodResult(SEPresenceIndicator p); virtual void InvalidateBloodResult(); virtual bool HasPHResult() const; virtual SEScalar& GetPHResult(); virtual bool HasProteinResult() const; - virtual CDM::enumPresenceIndicator::value GetProteinResult() const; - virtual void SetProteinResult(CDM::enumPresenceIndicator::value p); + virtual SEPresenceIndicator GetProteinResult() const; + virtual void SetProteinResult(SEPresenceIndicator p); virtual void InvalidateProteinResult(); virtual bool HasUrobilinogenResult() const; virtual SEScalarMassPerVolume& GetUrobilinogenResult(); virtual bool HasNitriteResult() const; - virtual CDM::enumPresenceIndicator::value GetNitriteResult() const; - virtual void SetNitriteResult(CDM::enumPresenceIndicator::value p); + virtual SEPresenceIndicator GetNitriteResult() const; + virtual void SetNitriteResult(SEPresenceIndicator p); virtual void InvalidateNitriteResult(); virtual bool HasLeukocyteEsteraseResult() const; - virtual CDM::enumPresenceIndicator::value GetLeukocyteEsteraseResult() const; - virtual void SetLeukocyteEsteraseResult(CDM::enumPresenceIndicator::value p); + virtual SEPresenceIndicator GetLeukocyteEsteraseResult() const; + virtual void SetLeukocyteEsteraseResult(SEPresenceIndicator p); virtual void InvalidateLeukocyteEsteraseResult(); virtual bool HasMicroscopicResult() const; @@ -103,18 +98,18 @@ class BIOGEARS_API SEUrinalysis : public SEPatientAssessment { bool operator!=(SEUrinalysis const&) const; protected: - CDM::enumUrineColor::value m_Color; - CDM::enumClarityIndicator::value m_Appearance; - CDM::enumPresenceIndicator::value m_Glucose; - CDM::enumPresenceIndicator::value m_Ketone; + SEUrineColor m_Color; + SEClarityIndicator m_Appearance; + SEPresenceIndicator m_Glucose; + SEPresenceIndicator m_Ketone; SEScalar* m_Bilirubin; SEScalar* m_SpecificGravity; - CDM::enumPresenceIndicator::value m_Blood; + SEPresenceIndicator m_Blood; SEScalar* m_pH; - CDM::enumPresenceIndicator::value m_Protein; + SEPresenceIndicator m_Protein; SEScalarMassPerVolume* m_Urobilinogen; - CDM::enumPresenceIndicator::value m_Nitrite; - CDM::enumPresenceIndicator::value m_LeukocyteEsterase; + SEPresenceIndicator m_Nitrite; + SEPresenceIndicator m_LeukocyteEsterase; SEUrinalysisMicroscopic* m_Microscopic; }; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEUrinalysisMicroscopic.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEUrinalysisMicroscopic.h index b49124266..2c2d79ff0 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEUrinalysisMicroscopic.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/assessments/SEUrinalysisMicroscopic.h @@ -12,10 +12,10 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include +#include namespace biogears { -class SEScalarAmount; namespace io { class PatientAssessments; } @@ -30,18 +30,12 @@ class BIOGEARS_API SEUrinalysisMicroscopic : public SEPatientAssessment { const char* classname() const override { return TypeTag(); } virtual void Reset() override; - virtual void Clear() override; - - virtual bool Load(const CDM::UrinalysisMicroscopicData& in); - virtual CDM::UrinalysisMicroscopicData* Unload() override; - -protected: - virtual void Unload(CDM::UrinalysisMicroscopicData& data); + virtual void Invalidate() override; public: virtual bool HasObservationType() const; - virtual CDM::enumMicroscopicObservationType::value GetObservationType() const; - virtual void SetObservationType(CDM::enumMicroscopicObservationType::value p); + virtual SEMicroscopicObservationType GetObservationType() const; + virtual void SetObservationType(SEMicroscopicObservationType p); virtual void InvalidateObservationType(); virtual bool HasRedBloodCellsResult() const; @@ -51,45 +45,45 @@ class BIOGEARS_API SEUrinalysisMicroscopic : public SEPatientAssessment { virtual SEScalarAmount& GetWhiteBloodCellsResult(); virtual bool HasEpithelialCellsResult() const; - virtual CDM::enumMicroscopicObservationAmount::value GetEpithelialCellsResult() const; - virtual void SetEpithelialCellsResult(CDM::enumMicroscopicObservationAmount::value p); + virtual SEMicroscopicObservationAmount GetEpithelialCellsResult() const; + virtual void SetEpithelialCellsResult(SEMicroscopicObservationAmount p); virtual void InvalidateEpithelialCellsResult(); virtual bool HasCastsResult() const; virtual SEScalarAmount& GetCastsResult(); virtual bool HasCrystalsResult() const; - virtual CDM::enumMicroscopicObservationAmount::value GetCrystalsResult() const; - virtual void SetCrystalsResult(CDM::enumMicroscopicObservationAmount::value p); + virtual SEMicroscopicObservationAmount GetCrystalsResult() const; + virtual void SetCrystalsResult(SEMicroscopicObservationAmount p); virtual void InvalidateCrystalsResult(); virtual bool HasBacteriaResult() const; - virtual CDM::enumMicroscopicObservationAmount::value GetBacteriaResult() const; - virtual void SetBacteriaResult(CDM::enumMicroscopicObservationAmount::value p); + virtual SEMicroscopicObservationAmount GetBacteriaResult() const; + virtual void SetBacteriaResult(SEMicroscopicObservationAmount p); virtual void InvalidateBacteriaResult(); virtual bool HasTrichomonadsResult() const; - virtual CDM::enumMicroscopicObservationAmount::value GetTrichomonadsResult() const; - virtual void SetTrichomonadsResult(CDM::enumMicroscopicObservationAmount::value p); + virtual SEMicroscopicObservationAmount GetTrichomonadsResult() const; + virtual void SetTrichomonadsResult(SEMicroscopicObservationAmount p); virtual void InvalidateTrichomonadsResult(); virtual bool HasYeastResult() const; - virtual CDM::enumMicroscopicObservationAmount::value GetYeastResult() const; - virtual void SetYeastResult(CDM::enumMicroscopicObservationAmount::value p); + virtual SEMicroscopicObservationAmount GetYeastResult() const; + virtual void SetYeastResult(SEMicroscopicObservationAmount p); virtual void InvalidateYeastResult(); bool operator==(SEUrinalysisMicroscopic const&) const; bool operator!=(SEUrinalysisMicroscopic const&) const; protected: - CDM::enumMicroscopicObservationType::value m_ObservationType; + SEMicroscopicObservationType m_ObservationType; SEScalarAmount* m_RedBloodCells; SEScalarAmount* m_WhiteBloodCells; - CDM::enumMicroscopicObservationAmount::value m_EpithelialCells; + SEMicroscopicObservationAmount m_EpithelialCells; SEScalarAmount* m_Casts; - CDM::enumMicroscopicObservationAmount::value m_Crystals; - CDM::enumMicroscopicObservationAmount::value m_Bacteria; - CDM::enumMicroscopicObservationAmount::value m_Trichomonads; - CDM::enumMicroscopicObservationAmount::value m_Yeast; + SEMicroscopicObservationAmount m_Crystals; + SEMicroscopicObservationAmount m_Bacteria; + SEMicroscopicObservationAmount m_Trichomonads; + SEMicroscopicObservationAmount m_Yeast; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEChronicAnemia.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEChronicAnemia.h index 24a3a1cb4..4e4669ec1 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEChronicAnemia.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEChronicAnemia.h @@ -15,7 +15,6 @@ specific language governing permissions and limitations under the License. #include #include -#include namespace biogears { class SEScalar0To1; @@ -29,22 +28,15 @@ class BIOGEARS_API SEChronicAnemia : public SEPatientCondition { SEChronicAnemia(); virtual ~SEChronicAnemia() override; - virtual void Clear() override; //clear memory + virtual void Invalidate() override; //clear memory virtual bool IsValid() const override; - virtual bool Load(const CDM::ChronicAnemiaData& in); - virtual CDM::ChronicAnemiaData* Unload() const override; - bool operator==(SEChronicAnemia const& rhs) const; bool operator!=(SEChronicAnemia const& rhs) const; bool operator==(SECondition const&) const override; bool operator!=(SECondition const&) const override; -protected: - virtual void Unload(CDM::ChronicAnemiaData& data) const; - -public: virtual std::string GetName() const override { return "ChronicAnemia"; } virtual const char* GetName_cStr() const override { return "ChronicAnemia"; } diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEChronicHeartFailure.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEChronicHeartFailure.h index 1e49847c0..3bdcc3665 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEChronicHeartFailure.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEChronicHeartFailure.h @@ -13,7 +13,6 @@ specific language governing permissions and limitations under the License. #pragma once #include #include -#include namespace biogears { class BIOGEARS_API SEChronicHeartFailure : public SEPatientCondition { @@ -21,22 +20,17 @@ class BIOGEARS_API SEChronicHeartFailure : public SEPatientCondition { SEChronicHeartFailure(); virtual ~SEChronicHeartFailure(); - virtual void Clear(); //clear memory + virtual void Invalidate() override; //clear memory - virtual bool IsValid() const; + virtual bool IsValid() const override; - virtual bool Load(const CDM::ChronicHeartFailureData& in); - virtual CDM::ChronicHeartFailureData* Unload() const; - bool operator==(SECondition const& rhs) const = 0; - bool operator!=(SECondition const& rhs) const = 0; - -protected: - virtual void Unload(CDM::ChronicHeartFailureData& data) const; + bool operator==(SECondition const& rhs) const override = 0 ; + bool operator!=(SECondition const& rhs) const override = 0 ; public: - virtual void ToString(std::ostream& str) const = 0; + virtual void ToString(std::ostream& str) const override = 0 ; protected: }; -} \ No newline at end of file +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEChronicObstructivePulmonaryDisease.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEChronicObstructivePulmonaryDisease.h index 559c81e95..838c921f1 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEChronicObstructivePulmonaryDisease.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEChronicObstructivePulmonaryDisease.h @@ -15,7 +15,6 @@ specific language governing permissions and limitations under the License. #include #include -#include namespace biogears { class SEScalar0To1; @@ -29,24 +28,19 @@ class BIOGEARS_API SEChronicObstructivePulmonaryDisease : public SEPatientCondit SEChronicObstructivePulmonaryDisease(); virtual ~SEChronicObstructivePulmonaryDisease(); - virtual void Clear(); //clear memory + virtual void Invalidate() override; //clear memory - virtual bool IsValid() const; - - virtual bool Load(const CDM::ChronicObstructivePulmonaryDiseaseData& in); - virtual CDM::ChronicObstructivePulmonaryDiseaseData* Unload() const; + virtual bool IsValid() const override ; bool operator==(SEChronicObstructivePulmonaryDisease const&) const; bool operator!=(SEChronicObstructivePulmonaryDisease const&) const; bool operator==(SECondition const& rhs) const override; bool operator!=(SECondition const& rhs) const override; -protected: - virtual void Unload(CDM::ChronicObstructivePulmonaryDiseaseData& data) const; public: - virtual std::string GetName() const { return "ChronicObstructivePulmonaryDisease"; } - virtual const char* GetName_cStr() const { return "ChronicObstructivePulmonaryDisease"; } + virtual std::string GetName() const override { return "ChronicObstructivePulmonaryDisease"; } + virtual const char* GetName_cStr() const override { return "ChronicObstructivePulmonaryDisease"; } virtual bool HasBronchitisSeverity() const; virtual SEScalar0To1& GetBronchitisSeverity(); @@ -54,10 +48,10 @@ class BIOGEARS_API SEChronicObstructivePulmonaryDisease : public SEPatientCondit virtual bool HasEmphysemaSeverity() const; virtual SEScalar0To1& GetEmphysemaSeverity(); - virtual void ToString(std::ostream& str) const; + virtual void ToString(std::ostream& str) const override; protected: SEScalar0To1* m_BronchitisSeverity; SEScalar0To1* m_EmphysemaSeverity; }; -} \ No newline at end of file +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEChronicPericardialEffusion.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEChronicPericardialEffusion.h index 51a3901c1..f4aa222f2 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEChronicPericardialEffusion.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEChronicPericardialEffusion.h @@ -15,10 +15,9 @@ specific language governing permissions and limitations under the License. #include #include -#include +#include namespace biogears { -class SEScalarVolume; namespace io { class PatientConditions; } @@ -29,31 +28,24 @@ class BIOGEARS_API SEChronicPericardialEffusion : public SEPatientCondition { SEChronicPericardialEffusion(); virtual ~SEChronicPericardialEffusion(); - virtual void Clear(); + virtual void Invalidate() override ; - virtual bool IsValid() const; - - virtual bool Load(const CDM::ChronicPericardialEffusionData& in); - virtual CDM::ChronicPericardialEffusionData* Unload() const; + virtual bool IsValid() const override ; bool operator==(SEChronicPericardialEffusion const&) const; bool operator!=(SEChronicPericardialEffusion const&) const; bool operator==(SECondition const& rhs) const override; bool operator!=(SECondition const& rhs) const override; -protected: - virtual void Unload(CDM::ChronicPericardialEffusionData& data) const; - -public: - virtual std::string GetName() const { return "ChronicPericardialEffusion"; } - virtual const char* GetName_cStr() const { return "ChronicPericardialEffusion"; } + virtual std::string GetName() const override { return "ChronicPericardialEffusion"; } + virtual const char* GetName_cStr() const override { return "ChronicPericardialEffusion"; } virtual bool HasAccumulatedVolume() const; virtual SEScalarVolume& GetAccumulatedVolume(); - virtual void ToString(std::ostream& str) const; + virtual void ToString(std::ostream& str) const override ; protected: SEScalarVolume* m_AccumulatedVolume; }; -} \ No newline at end of file +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEChronicRenalStenosis.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEChronicRenalStenosis.h index 3706fef7f..023dc6bab 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEChronicRenalStenosis.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEChronicRenalStenosis.h @@ -15,7 +15,6 @@ specific language governing permissions and limitations under the License. #include #include -#include namespace biogears { class SEScalar0To1; @@ -29,24 +28,18 @@ class BIOGEARS_API SEChronicRenalStenosis : public SEPatientCondition { SEChronicRenalStenosis(); virtual ~SEChronicRenalStenosis(); - virtual void Clear(); //clear memory + virtual void Invalidate() override; //clear memory - virtual bool IsValid() const; - - virtual bool Load(const CDM::ChronicRenalStenosisData& in); - virtual CDM::ChronicRenalStenosisData* Unload() const; + virtual bool IsValid() const override; bool operator==(SEChronicRenalStenosis const&) const; bool operator!=(SEChronicRenalStenosis const&) const; bool operator==(SECondition const& rhs) const override; bool operator!=(SECondition const& rhs) const override; -protected: - virtual void Unload(CDM::ChronicRenalStenosisData& data) const; - public: - virtual std::string GetName() const { return "ChronicRenalStenosis"; } - virtual const char* GetName_cStr() const { return "ChronicRenalStenosis"; } + virtual std::string GetName() const override { return "ChronicRenalStenosis"; } + virtual const char* GetName_cStr() const override { return "ChronicRenalStenosis"; } virtual bool HasLeftKidneySeverity() const; virtual SEScalar0To1& GetLeftKidneySeverity(); @@ -54,10 +47,10 @@ class BIOGEARS_API SEChronicRenalStenosis : public SEPatientCondition { virtual bool HasRightKidneySeverity() const; virtual SEScalar0To1& GetRightKidneySeverity(); - virtual void ToString(std::ostream& str) const; + virtual void ToString(std::ostream& str) const override; protected: SEScalar0To1* m_LeftKidneySeverity; SEScalar0To1* m_RightKidneySeverity; }; -} \ No newline at end of file +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEChronicVentricularSystolicDysfunction.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEChronicVentricularSystolicDysfunction.h index 098cd463c..f5d0a2273 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEChronicVentricularSystolicDysfunction.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEChronicVentricularSystolicDysfunction.h @@ -15,7 +15,6 @@ specific language governing permissions and limitations under the License. #include #include -#include namespace biogears { class BIOGEARS_API SEChronicVentricularSystolicDysfunction : public SEChronicHeartFailure { @@ -23,27 +22,20 @@ class BIOGEARS_API SEChronicVentricularSystolicDysfunction : public SEChronicHea SEChronicVentricularSystolicDysfunction(); virtual ~SEChronicVentricularSystolicDysfunction(); - virtual void Clear(); //clear memory + virtual void Invalidate() override ; //clear memory - virtual bool IsValid() const; - - virtual bool Load(const CDM::ChronicVentricularSystolicDysfunctionData& in); - virtual CDM::ChronicVentricularSystolicDysfunctionData* Unload() const; + virtual bool IsValid() const override ; bool operator==(SEChronicVentricularSystolicDysfunction const&) const; bool operator!=(SEChronicVentricularSystolicDysfunction const&) const; bool operator==(SECondition const& rhs) const override; bool operator!=(SECondition const& rhs) const override; -protected: - virtual void Unload(CDM::ChronicVentricularSystolicDysfunctionData& data) const; - -public: - virtual std::string GetName() const { return "ChronicVentricularSystolicDysfunction"; } - virtual const char* GetName_cStr() const { return "ChronicVentricularSystolicDysfunction"; } + virtual std::string GetName() const override { return "ChronicVentricularSystolicDysfunction"; } + virtual const char* GetName_cStr() const override { return "ChronicVentricularSystolicDysfunction"; } - virtual void ToString(std::ostream& str) const; + virtual void ToString(std::ostream& str) const override ; protected: }; -} \ No newline at end of file +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEDehydration.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEDehydration.h index ba7d4779e..6bff8beae 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEDehydration.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEDehydration.h @@ -15,7 +15,6 @@ specific language governing permissions and limitations under the License. #include #include -#include namespace biogears { class SEScalar0To1; @@ -29,31 +28,24 @@ class BIOGEARS_API SEDehydration : public SEPatientCondition { SEDehydration(); virtual ~SEDehydration(); - virtual void Clear(); //clear memory + virtual void Invalidate() override ; //clear memory - virtual bool IsValid() const; - - virtual bool Load(const CDM::DehydrationData& in); - virtual CDM::DehydrationData* Unload() const; + virtual bool IsValid() const override ; bool operator==(SEDehydration const&) const; bool operator!=(SEDehydration const&) const; bool operator==(SECondition const& rhs) const override; bool operator!=(SECondition const& rhs) const override; -protected: - virtual void Unload(CDM::DehydrationData& data) const; - -public: - virtual std::string GetName() const { return "Dehydration"; } - virtual const char* GetName_cStr() const { return "Dehydration"; } + virtual std::string GetName() const override { return "Dehydration"; } + virtual const char* GetName_cStr() const override { return "Dehydration"; } virtual bool HasDehydrationFraction() const; virtual SEScalar0To1& GetDehydrationFraction(); - virtual void ToString(std::ostream& str) const; + virtual void ToString(std::ostream& str) const override ; protected: SEScalar0To1* m_DehydrationFraction; }; -} \ No newline at end of file +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEDiabetesType1.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEDiabetesType1.h index cfeafb8ba..e73b9370d 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEDiabetesType1.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEDiabetesType1.h @@ -15,7 +15,6 @@ specific language governing permissions and limitations under the License. #include #include -#include namespace biogears { class SEScalar0To1; @@ -29,31 +28,24 @@ class BIOGEARS_API SEDiabetesType1 : public SEPatientCondition { SEDiabetesType1(); virtual ~SEDiabetesType1(); - virtual void Clear(); //clear memory + virtual void Invalidate() override; //clear memory - virtual bool IsValid() const; - - virtual bool Load(const CDM::DiabetesType1Data& in); - virtual CDM::DiabetesType1Data* Unload() const; + virtual bool IsValid() const override; bool operator==(SEDiabetesType1 const&) const; bool operator!=(SEDiabetesType1 const&) const; bool operator==(SECondition const& rhs) const override; bool operator!=(SECondition const& rhs) const override; -protected: - virtual void Unload(CDM::DiabetesType1Data& data) const; - -public: - virtual std::string GetName() const { return "DiabetesType1"; } - virtual const char* GetName_cStr() const { return "DiabetesType1"; } + virtual std::string GetName() const override { return "DiabetesType1"; } + virtual const char* GetName_cStr() const override { return "DiabetesType1"; } virtual bool HasInsulinProductionSeverity() const; virtual SEScalar0To1& GetInsulinProductionSeverity(); - virtual void ToString(std::ostream& str) const; + virtual void ToString(std::ostream& str) const override ; protected: SEScalar0To1* m_InsulinProductionSeverity; }; -} \ No newline at end of file +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEDiabetesType2.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEDiabetesType2.h index 7b7f9a6fa..0b22b39cd 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEDiabetesType2.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEDiabetesType2.h @@ -15,7 +15,6 @@ specific language governing permissions and limitations under the License. #include #include -#include namespace biogears { class SEScalar0To1; @@ -29,35 +28,27 @@ class BIOGEARS_API SEDiabetesType2 : public SEPatientCondition { SEDiabetesType2(); virtual ~SEDiabetesType2(); - virtual void Clear(); //clear memory + virtual void Invalidate() override ; //clear memory - virtual bool IsValid() const; - - virtual bool Load(const CDM::DiabetesType2Data& in); - virtual CDM::DiabetesType2Data* Unload() const; + virtual bool IsValid() const override ; bool operator==(SEDiabetesType2 const&) const; bool operator!=(SEDiabetesType2 const&) const; bool operator==(SECondition const& rhs) const override; bool operator!=(SECondition const& rhs) const override; - -protected: - virtual void Unload(CDM::DiabetesType2Data& data) const; - -public: - virtual std::string GetName() const { return "DiabetesType2"; } - virtual const char* GetName_cStr() const { return "DiabetesType2"; } + virtual std::string GetName() const override { return "DiabetesType2"; } + virtual const char* GetName_cStr() const override { return "DiabetesType2"; } virtual bool HasInsulinProductionSeverity() const; virtual SEScalar0To1& GetInsulinProductionSeverity(); virtual bool HasInsulinResistanceSeverity() const; virtual SEScalar0To1& GetInsulinResistanceSeverity(); - virtual void ToString(std::ostream& str) const; + virtual void ToString(std::ostream& str) const override ; protected: SEScalar0To1* m_InsulinProductionSeverity; SEScalar0To1* m_InsulinResistanceSeverity; }; -} \ No newline at end of file +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEImpairedAlveolarExchange.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEImpairedAlveolarExchange.h index 69065c208..815f45fad 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEImpairedAlveolarExchange.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEImpairedAlveolarExchange.h @@ -11,11 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once #include -#include +#include namespace biogears { -class SEScalarArea; -class AreaUnit; class SEScalar0To1; namespace io { class PatientConditions; @@ -27,24 +25,17 @@ class BIOGEARS_API SEImpairedAlveolarExchange : public SEPatientCondition { SEImpairedAlveolarExchange(); virtual ~SEImpairedAlveolarExchange(); - virtual void Clear(); + virtual void Invalidate() override ; - virtual bool IsValid() const; - - virtual bool Load(const CDM::ImpairedAlveolarExchangeData& in); - virtual CDM::ImpairedAlveolarExchangeData* Unload() const; + virtual bool IsValid() const override ; bool operator==(SEImpairedAlveolarExchange const&) const; bool operator!=(SEImpairedAlveolarExchange const&) const; bool operator==(SECondition const& rhs) const override; bool operator!=(SECondition const& rhs) const override; -protected: - virtual void Unload(CDM::ImpairedAlveolarExchangeData& data) const; - -public: - virtual std::string GetName() const { return "ImpairedAlveolarExchange"; } - virtual const char* GetName_cStr() const { return "ImpairedAlveolarExchange"; } + virtual std::string GetName() const override { return "ImpairedAlveolarExchange"; } + virtual const char* GetName_cStr() const override { return "ImpairedAlveolarExchange"; } virtual bool HasImpairedSurfaceArea() const; virtual SEScalarArea& GetImpairedSurfaceArea(); @@ -54,10 +45,10 @@ class BIOGEARS_API SEImpairedAlveolarExchange : public SEPatientCondition { virtual SEScalar0To1& GetImpairedFraction(); virtual double GetImpairedFraction() const; - virtual void ToString(std::ostream& str) const; + virtual void ToString(std::ostream& str) const override ; protected: SEScalarArea* m_ImpairedSurfaceArea; SEScalar0To1* m_ImpairedFraction; }; -} \ No newline at end of file +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SELobarPneumonia.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SELobarPneumonia.h index 7749af0ec..58f453961 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SELobarPneumonia.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SELobarPneumonia.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class SEScalar0To1; @@ -26,24 +25,17 @@ class BIOGEARS_API SELobarPneumonia : public SEPatientCondition { SELobarPneumonia(); virtual ~SELobarPneumonia(); - virtual void Clear(); //clear memory + virtual void Invalidate() override ; //clear memory - virtual bool IsValid() const; - - virtual bool Load(const CDM::LobarPneumoniaData& in); - virtual CDM::LobarPneumoniaData* Unload() const; + virtual bool IsValid() const override ; bool operator==(SELobarPneumonia const&) const; bool operator!=(SELobarPneumonia const&) const; bool operator==(SECondition const& rhs) const override; bool operator!=(SECondition const& rhs) const override; -protected: - virtual void Unload(CDM::LobarPneumoniaData& data) const; - -public: - virtual std::string GetName() const { return "LobarPneumonia"; } - virtual const char* GetName_cStr() const { return "LobarPneumonia"; } + virtual std::string GetName() const override { return "LobarPneumonia"; } + virtual const char* GetName_cStr() const override { return "LobarPneumonia"; } virtual bool HasSeverity() const; virtual SEScalar0To1& GetSeverity(); @@ -54,11 +46,11 @@ class BIOGEARS_API SELobarPneumonia : public SEPatientCondition { virtual bool HasRightLungAffected() const; virtual SEScalar0To1& GetRightLungAffected(); - virtual void ToString(std::ostream& str) const; + virtual void ToString(std::ostream& str) const override ; protected: SEScalar0To1* m_Severity; SEScalar0To1* m_LeftLungAffected; SEScalar0To1* m_RightLungAffected; }; -} \ No newline at end of file +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEPatientCondition.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEPatientCondition.h index 1210ebc1f..83a764f12 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEPatientCondition.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEPatientCondition.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API SEPatientCondition : public SECondition { @@ -20,19 +19,13 @@ class BIOGEARS_API SEPatientCondition : public SECondition { SEPatientCondition(); virtual ~SEPatientCondition(); - virtual void Clear() override; // clear memory + virtual void Invalidate() override; // clear memory virtual bool IsValid() const override = 0; - virtual bool Load(const CDM::PatientConditionData& in); + virtual bool operator==(SECondition const&) const override = 0; + virtual bool operator!=(SECondition const&) const override = 0; - virtual bool operator==(SECondition const&) const = 0; - virtual bool operator!=(SECondition const&) const = 0; - -protected: - virtual void Unload(CDM::PatientConditionData& data) const; - -public: virtual void ToString(std::ostream& str) const override = 0; }; -} \ No newline at end of file +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEStarvation.h b/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEStarvation.h index dc603137b..f62a98f58 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEStarvation.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/patient/conditions/SEStarvation.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { namespace io { @@ -25,32 +24,25 @@ class BIOGEARS_API SEStarvation : public SEPatientCondition { SEStarvation(); virtual ~SEStarvation(); - virtual void Clear(); + virtual void Invalidate() override ; - virtual bool IsValid() const; - - virtual bool Load(const CDM::StarvationData& in); - virtual CDM::StarvationData* Unload() const; + virtual bool IsValid() const override ; bool operator==(SEStarvation const&) const; bool operator!=(SEStarvation const&) const; bool operator==(SECondition const& rhs) const override; bool operator!=(SECondition const& rhs) const override; - -protected: - virtual void Unload(CDM::StarvationData& data) const; - public: - virtual std::string GetName() const { return "Starvation"; } - virtual const char* GetName_cStr() const { return "Starvation"; } + virtual std::string GetName() const override { return "Starvation"; } + virtual const char* GetName_cStr() const override { return "Starvation"; } virtual bool HasTimeSinceMeal() const; virtual SEScalarTime& GetTimeSinceMeal(); - virtual void ToString(std::ostream& str) const; + virtual void ToString(std::ostream& str) const override ; protected: SEScalarTime* m_TimeSinceMeal; }; -} \ No newline at end of file +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEDecimalFormat.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEDecimalFormat.h index 12565e60b..7e21c28d4 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEDecimalFormat.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEDecimalFormat.h @@ -17,7 +17,6 @@ specific language governing permissions and limitations under the License. #include #include -CDM_BIND_DECL(DecimalFormatData) namespace biogears { namespace io { @@ -37,12 +36,6 @@ class BIOGEARS_API SEDecimalFormat { virtual void Reset(); virtual void Set(const SEDecimalFormat& f); - virtual bool Load(const CDM::DecimalFormatData& in); - virtual CDM::DecimalFormatData* Unload(); - -protected: - virtual void Unload(CDM::DecimalFormatData& to) const; - public: void SetPrecision(std::streamsize p); std::streamsize GetPrecision(); @@ -61,6 +54,9 @@ class BIOGEARS_API SEDecimalFormat { }; }//namespace biogears -namespace std{ -BG_EXT template class BIOGEARS_API map; -} \ No newline at end of file +#pragma warning(disable : 4661) + + namespace std{ +extern template class map; +} +#pragma warning(default : 4661) diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEFunction.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEFunction.h index 99d23506d..68cc91196 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEFunction.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEFunction.h @@ -17,7 +17,6 @@ specific language governing permissions and limitations under the License. #include #include -CDM_BIND_DECL(FunctionData) namespace biogears { namespace io { @@ -30,13 +29,10 @@ class BIOGEARS_API SEFunction : public SEProperty { virtual ~SEFunction(); - virtual void Clear(); //clear memory + virtual void Invalidate(); //clear memory - virtual bool Load(const CDM::FunctionData& in); - virtual CDM::FunctionData* Unload() const; virtual bool IsValid() const; - virtual void Invalidate(); virtual unsigned int Length(); @@ -49,10 +45,6 @@ class BIOGEARS_API SEFunction : public SEProperty { bool operator==(const SEFunction&) const; bool operator!=(const SEFunction&) const; -protected: - virtual void Unload(CDM::FunctionData& data) const; - - protected: std::vector m_Dependent; std::vector m_Independent; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEFunctionElectricPotentialVsTime.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEFunctionElectricPotentialVsTime.h index 7698eb39f..f18700096 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEFunctionElectricPotentialVsTime.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEFunctionElectricPotentialVsTime.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class TimeUnit; @@ -26,13 +25,7 @@ class BIOGEARS_API SEFunctionElectricPotentialVsTime : public SEFunction { SEFunctionElectricPotentialVsTime(); virtual ~SEFunctionElectricPotentialVsTime(); - virtual void Clear(); - - virtual bool Load(const CDM::FunctionElectricPotentialVsTimeData& in); - virtual CDM::FunctionElectricPotentialVsTimeData* Unload() const; - -protected: - virtual void Unload(CDM::FunctionElectricPotentialVsTimeData& data) const; + virtual void Invalidate(); public: double GetIndependentValue(unsigned int index) = delete; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEFunctionVolumeVsTime.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEFunctionVolumeVsTime.h index 12d5ea698..0f3736489 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEFunctionVolumeVsTime.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEFunctionVolumeVsTime.h @@ -14,7 +14,6 @@ specific language governing permissions and limitations under the License. #include #include #include -#include namespace biogears { namespace io { @@ -26,13 +25,7 @@ class BIOGEARS_API SEFunctionVolumeVsTime : public SEFunction { SEFunctionVolumeVsTime(); virtual ~SEFunctionVolumeVsTime(); - virtual void Clear(); - - virtual bool Load(const CDM::FunctionVolumeVsTimeData& in); - virtual CDM::FunctionVolumeVsTimeData* Unload() const; - -protected: - virtual void Unload(CDM::FunctionVolumeVsTimeData& data) const; + virtual void Invalidate(); public: double GetIndependentValue(unsigned int index) = delete; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEHistogram.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEHistogram.h index 31dfdadc1..9ae6924e2 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEHistogram.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEHistogram.h @@ -14,7 +14,6 @@ specific language governing permissions and limitations under the License. #include #include -CDM_BIND_DECL(HistogramData) namespace biogears { namespace io { @@ -23,20 +22,15 @@ namespace io { class BIOGEARS_API SEHistogram : public SEProperty { public: friend io::Property; + SEHistogram(SEHistogram const& obj); SEHistogram(); virtual ~SEHistogram(); - virtual void Clear(); //clear memory + virtual void Invalidate(); //clear memory - virtual bool Load(const CDM::HistogramData& in); - virtual CDM::HistogramData* Unload() const; - -protected: - virtual void Unload(CDM::HistogramData& data) const; public: virtual bool IsValid() const; - virtual void Invalidate(); virtual unsigned int NumberOfBins() const; virtual unsigned int NumberOfBoundaries() const; @@ -49,6 +43,8 @@ class BIOGEARS_API SEHistogram : public SEProperty { std::vector& GetIndependent(); const std::vector& GetIndependent() const; + //------------------------------------------------------------------------------- + SEHistogram& operator=(const SEHistogram& rhs); bool operator==(const SEHistogram&) const; bool operator!=(const SEHistogram&) const; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEHistogramFractionVsLength.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEHistogramFractionVsLength.h index 0501876a0..beabae9a0 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEHistogramFractionVsLength.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEHistogramFractionVsLength.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class LengthUnit; @@ -22,21 +21,20 @@ namespace io { class BIOGEARS_API SEHistogramFractionVsLength : public SEHistogram { public: friend io::Property; + SEHistogramFractionVsLength(SEHistogramFractionVsLength const&); SEHistogramFractionVsLength(); virtual ~SEHistogramFractionVsLength(); - virtual void Clear() override; + virtual void Invalidate() override; virtual bool IsVaild() const; - virtual bool Load(const CDM::HistogramFractionVsLengthData& in); - virtual CDM::HistogramFractionVsLengthData* Unload() const override; + SEHistogramFractionVsLength& operator=(const SEHistogramFractionVsLength&); + bool operator==(const SEHistogramFractionVsLength&) const; bool operator!=(const SEHistogramFractionVsLength&) const; -protected: - virtual void Unload(CDM::HistogramFractionVsLengthData& data) const; public: virtual double GetFractionValue(unsigned int index) const; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEProperty.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEProperty.h index 8f72625ff..c281afa46 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEProperty.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEProperty.h @@ -14,23 +14,15 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API SEProperty { protected: + public: SEProperty(); virtual ~SEProperty(); - - virtual void Clear(); //clear memory - virtual void Invalidate() = 0; virtual bool IsValid() const = 0; - - virtual bool Load(const CDM::PropertyData& in); - -protected: - virtual void Unload(CDM::PropertyData& data) const; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalar.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalar.h index 941b0bf92..9e703ac4b 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalar.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalar.h @@ -11,12 +11,12 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once +#include #include -#include + #include -CDM_BIND_DECL(ScalarData) namespace biogears { class SEGenericScalar; @@ -42,31 +42,30 @@ class BIOGEARS_API SEScalar : public SEProperty { public: friend io::Property; SEScalar(); + SEScalar(SEScalar const&); + SEScalar(SEScalar&&); SEScalar(double v, bool ro=false); virtual ~SEScalar(); - virtual void Clear(); + virtual void Invalidate(); /** Sets the value to NaN and removes the unit Note that this does not affect bounds */ - virtual void Invalidate(); - virtual void Load(const CDM::ScalarData& in, std::default_random_engine *rd = nullptr); - virtual CDM::ScalarData* Unload() const; /** * Copies ONLY the value and unit * ONLY if the provided scalar is valid. */ - bool Set(const SEScalar& s); + bool Set(SEScalar const& s); /** * Copies the entire contents * of the provided scalar to this. * Even if s is invalid. */ - void Copy(const SEScalar& s); + void Copy(SEScalar const& s); virtual bool IsValid() const; bool IsInfinity() const { return std::isinf(m_value); } @@ -81,16 +80,16 @@ class BIOGEARS_API SEScalar : public SEProperty { virtual double GetValue() const; virtual void SetValue(double d); - double Increment(const SEScalar& s); + double Increment(SEScalar const& s); double IncrementValue(double d); - double Decrement(const SEScalar& s); + double Decrement(SEScalar const& s); double DecrementValue(double d); - double Multiply(const SEScalar& s); + double Multiply(SEScalar const& s); double MultiplyValue(double d); - double Divide(const SEScalar& s); + double Divide(SEScalar const& s); double DivideValue(double d); - bool Equals(const SEScalar& to) const; + bool Equals(SEScalar const& to) const; virtual std::string ToString() const; @@ -101,42 +100,40 @@ class BIOGEARS_API SEScalar : public SEProperty { static const std::string unitless; - SEScalar& operator=(const SEScalar& rhs); + SEScalar& operator=(SEScalar const& rhs); + SEScalar& operator=(SEScalar&& rhs); - bool operator<(const SEScalar& rhs) const; - bool operator<=(const SEScalar& rhs) const; - bool operator>(const SEScalar& rhs) const; - bool operator>=(const SEScalar& rhs) const; + bool operator<(SEScalar const& rhs) const; + bool operator<=(SEScalar const& rhs) const; + bool operator>(SEScalar const& rhs) const; + bool operator>=(SEScalar const& rhs) const; - bool operator==(const SEScalar& rhs) const { return Equals(rhs); } - bool operator!=(const SEScalar& rhs) const { return !Equals(rhs); } + bool operator==(SEScalar const& rhs) const { return Equals(rhs); } + bool operator!=(SEScalar const& rhs) const { return !Equals(rhs); } - SEScalar operator+(const SEScalar& rhs) const; - SEScalar& operator+=(const SEScalar& rhs); - SEScalar operator-(const SEScalar& rhs) const; - SEScalar& operator-=(const SEScalar& rhs); - SEScalar operator/(const SEScalar& rhs) const; - SEScalar& operator/=(const SEScalar& rhs); - SEScalar operator*(const SEScalar& rhs) const; - SEScalar& operator*=(const SEScalar& rhs); + SEScalar operator+(SEScalar const& rhs) const; + SEScalar& operator+=(SEScalar const& rhs); + SEScalar operator-(SEScalar const& rhs) const; + SEScalar& operator-=(SEScalar const& rhs); + SEScalar operator/(SEScalar const& rhs) const; + SEScalar& operator/=(SEScalar const& rhs); + SEScalar operator*(SEScalar const& rhs) const; + SEScalar& operator*=(SEScalar const& rhs); - -protected: - virtual void Unload(CDM::ScalarData& s) const; }; //------------------------------------------------------------------------------- -inline SEScalar operator+(double lhs, const SEScalar& rhs) { return SEScalar { lhs }.Increment(rhs); }; -inline SEScalar operator-(double lhs, const SEScalar& rhs) { return SEScalar { lhs }.Decrement(rhs); }; -inline SEScalar operator/(double lhs, const SEScalar& rhs) { return SEScalar { lhs }.Divide(rhs); }; -inline SEScalar operator*(double lhs, const SEScalar& rhs) { return SEScalar { lhs }.Multiply(rhs); }; -inline bool operator<(double lhs, const SEScalar& rhs) { return SEScalar { lhs } < rhs; }; -inline bool operator<=(double lhs, const SEScalar& rhs) { return SEScalar { lhs } <= rhs; }; -inline bool operator>(double lhs, const SEScalar& rhs) { return SEScalar { lhs } > rhs; }; -inline bool operator>=(double lhs, const SEScalar& rhs) { return SEScalar { lhs } >= rhs; }; -inline bool operator==(double lhs, const SEScalar& rhs) { return rhs.operator==(lhs); } -inline bool operator!=(double lhs, const SEScalar& rhs) { return rhs.operator!=(lhs); } +inline SEScalar operator+(double lhs, SEScalar const& rhs) { return SEScalar { lhs }.Increment(rhs); }; +inline SEScalar operator-(double lhs, SEScalar const& rhs) { return SEScalar { lhs }.Decrement(rhs); }; +inline SEScalar operator/(double lhs, SEScalar const& rhs) { return SEScalar { lhs }.Divide(rhs); }; +inline SEScalar operator*(double lhs, SEScalar const& rhs) { return SEScalar { lhs }.Multiply(rhs); }; +inline bool operator<(double lhs, SEScalar const& rhs) { return SEScalar { lhs } < rhs; }; +inline bool operator<=(double lhs, SEScalar const& rhs) { return SEScalar { lhs } <= rhs; }; +inline bool operator>(double lhs, SEScalar const& rhs) { return SEScalar { lhs } > rhs; }; +inline bool operator>=(double lhs, SEScalar const& rhs) { return SEScalar { lhs } >= rhs; }; +inline bool operator==(double lhs, SEScalar const& rhs) { return rhs.operator==(lhs); } +inline bool operator!=(double lhs, SEScalar const& rhs) { return rhs.operator!=(lhs); } //------------------------------------------------------------------------------- -inline std::ostream& operator<<(std::ostream& out, const SEScalar* s) +inline std::ostream& operator<<(std::ostream& out, SEScalar const* s) { if (s == nullptr) out << SEScalar::NaN; @@ -145,12 +142,12 @@ inline std::ostream& operator<<(std::ostream& out, const SEScalar* s) return out; } //------------------------------------------------------------------------------- -inline std::ostream& operator<<(std::ostream& out, const SEScalar& s) +inline std::ostream& operator<<(std::ostream& out, SEScalar const& s) { out << s.ToString(); return out; } -inline void Override(const SEScalar& from, SEScalar& to) +inline void Override(SEScalar const& from, SEScalar& to) { bool b = to.IsReadOnly(); to.SetReadOnly(false); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalar0To1.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalar0To1.h index b51f946bf..ee1790459 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalar0To1.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalar0To1.h @@ -22,13 +22,10 @@ class BIOGEARS_API SEScalar0To1 : public SEScalar { SEScalar0To1(); virtual ~SEScalar0To1(); - void Load(const CDM::ScalarData& in, std::default_random_engine *rd = nullptr) override; - CDM::Scalar0To1Data* Unload() const; - - double GetValue() const { return SEScalar::GetValue(); } + double GetValue() const override { return SEScalar::GetValue(); } double GetValue(const NoUnit& unitless) { return SEScalar::GetValue(); } - void SetValue(double d); + void SetValue(double d) override; void SetValue(double d, const NoUnit& unitless); bool operator==(const SEScalar0To1&) const; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarAmount.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarAmount.h index 0d4c0fed7..f02e71492 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarAmount.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarAmount.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API AmountUnit : public CCompoundUnit { @@ -35,17 +34,9 @@ class BIOGEARS_API AmountUnit : public CCompoundUnit { static const AmountUnit pmol; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarAmount = SEScalarQuantity; +#pragma warning(default : 4661) -class BIOGEARS_API SEScalarAmount : public SEScalarQuantity { -public: - SEScalarAmount(); - virtual ~SEScalarAmount(); - - virtual CDM::ScalarAmountData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; - -}; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarAmountPerMass.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarAmountPerMass.h index 647f9e62a..b2669076d 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarAmountPerMass.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarAmountPerMass.h @@ -11,8 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once +#include #include -#include namespace biogears { class BIOGEARS_API AmountPerMassUnit : public CCompoundUnit { @@ -34,18 +34,8 @@ class BIOGEARS_API AmountPerMassUnit : public CCompoundUnit { static AmountPerMassUnit ct_Per_ug; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarAmountPerMass : public SEScalarQuantity { - -public: - SEScalarAmountPerMass(); - virtual ~SEScalarAmountPerMass(); - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; - - CDM::ScalarAmountPerMassData* Unload() const override; - -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarAmountPerMass = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarAmountPerTime.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarAmountPerTime.h index ffc0e703d..a4c90c4a1 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarAmountPerTime.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarAmountPerTime.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API AmountPerTimeUnit : public CCompoundUnit { @@ -38,17 +37,8 @@ class BIOGEARS_API AmountPerTimeUnit : public CCompoundUnit { static AmountPerTimeUnit umol_Per_min; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarAmountPerTime : public SEScalarQuantity { - -public: - SEScalarAmountPerTime(); - virtual ~SEScalarAmountPerTime(); - - CDM::ScalarAmountPerTimeData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarAmountPerTime = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarAmountPerVolume.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarAmountPerVolume.h index f1267f5b3..334c6d1b5 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarAmountPerVolume.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarAmountPerVolume.h @@ -37,17 +37,8 @@ class BIOGEARS_API AmountPerVolumeUnit : public CCompoundUnit { static AmountPerVolumeUnit ct_Per_uL; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarAmountPerVolume : public SEScalarQuantity { - -public: - SEScalarAmountPerVolume(); - virtual ~SEScalarAmountPerVolume(); - - CDM::ScalarAmountPerVolumeData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarAmountPerVolume = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarArea.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarArea.h index 39d916c17..0413b723e 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarArea.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarArea.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API AreaUnit : public CCompoundUnit { @@ -20,7 +19,7 @@ class BIOGEARS_API AreaUnit : public CCompoundUnit { AreaUnit(const char* u); AreaUnit(const std::string& u); - virtual ~AreaUnit(); + virtual ~AreaUnit(); bool operator==(const AreaUnit&) const; bool operator!=(const AreaUnit&) const; @@ -34,17 +33,9 @@ class BIOGEARS_API AreaUnit : public CCompoundUnit { static const AreaUnit m2; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; -class BIOGEARS_API SEScalarArea : public SEScalarQuantity { -public: - SEScalarArea(); - virtual ~SEScalarArea(); - - CDM::ScalarAreaData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; - -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarArea = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarAreaPerTimePressure.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarAreaPerTimePressure.h index 75f428bd7..af7ca7e4e 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarAreaPerTimePressure.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarAreaPerTimePressure.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API AreaPerTimePressureUnit : public CCompoundUnit { @@ -36,16 +35,8 @@ class BIOGEARS_API AreaPerTimePressureUnit : public CCompoundUnit { static const AreaPerTimePressureUnit cm2_Per_min_mmHg; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarAreaPerTimePressure : public SEScalarQuantity { -public: - SEScalarAreaPerTimePressure(); - virtual ~SEScalarAreaPerTimePressure(); - - CDM::ScalarAreaPerTimePressureData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarAreaPerTimePressure = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarElectricCapacitance.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarElectricCapacitance.h index 1811b66e6..cb2ee2c1c 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarElectricCapacitance.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarElectricCapacitance.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API ElectricCapacitanceUnit : public CCompoundUnit { @@ -33,16 +32,8 @@ class BIOGEARS_API ElectricCapacitanceUnit : public CCompoundUnit { static const ElectricCapacitanceUnit F; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarElectricCapacitance : public SEScalarQuantity { -public: - SEScalarElectricCapacitance(); - virtual ~SEScalarElectricCapacitance(); - - CDM::ScalarElectricCapacitanceData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarElectricCapacitance = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarElectricCharge.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarElectricCharge.h index 7ff92d398..aab38c8a3 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarElectricCharge.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarElectricCharge.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API ElectricChargeUnit : public CCompoundUnit { @@ -33,18 +32,8 @@ class BIOGEARS_API ElectricChargeUnit : public CCompoundUnit { static const ElectricChargeUnit C; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarElectricCharge : public SEScalarQuantity { -public: - SEScalarElectricCharge(); - virtual ~SEScalarElectricCharge(); - - CDM::ScalarElectricChargeData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; - - -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarElectricCharge = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarElectricCurrent.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarElectricCurrent.h index 2d88e7007..3769780ea 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarElectricCurrent.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarElectricCurrent.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API ElectricCurrentUnit : public CCompoundUnit { @@ -33,17 +32,8 @@ class BIOGEARS_API ElectricCurrentUnit : public CCompoundUnit { static const ElectricCurrentUnit A; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarElectricCurrent : public SEScalarQuantity { -public: - SEScalarElectricCurrent(); - virtual ~SEScalarElectricCurrent(); - - CDM::ScalarElectricCurrentData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; - -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarElectricCurrent = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarElectricInductance.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarElectricInductance.h index 5a2172887..843e0494d 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarElectricInductance.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarElectricInductance.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API ElectricInductanceUnit : public CCompoundUnit { @@ -33,17 +32,8 @@ class BIOGEARS_API ElectricInductanceUnit : public CCompoundUnit { static const ElectricInductanceUnit H; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarElectricInductance : public SEScalarQuantity { -public: - SEScalarElectricInductance(); - virtual ~SEScalarElectricInductance() ; - - CDM::ScalarElectricInductanceData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; - -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarElectricInductance = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarElectricPotential.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarElectricPotential.h index f7c9e4651..508281855 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarElectricPotential.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarElectricPotential.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API ElectricPotentialUnit : public CCompoundUnit { @@ -34,16 +33,8 @@ class BIOGEARS_API ElectricPotentialUnit : public CCompoundUnit { static const ElectricPotentialUnit mV; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarElectricPotential : public SEScalarQuantity { -public: - using SEScalarQuantity::SEScalarQuantity; - virtual ~SEScalarElectricPotential(); - - CDM::ScalarElectricPotentialData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarElectricPotential = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarElectricResistance.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarElectricResistance.h index 27f69dc59..9c038aa88 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarElectricResistance.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarElectricResistance.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API ElectricResistanceUnit : public CCompoundUnit { @@ -33,19 +32,8 @@ class BIOGEARS_API ElectricResistanceUnit : public CCompoundUnit { static const ElectricResistanceUnit Ohm; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarElectricResistance : public SEScalarQuantity { -public: - SEScalarElectricResistance(); - virtual ~SEScalarElectricResistance(); - - CDM::ScalarElectricResistanceData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; - - bool operator==(const SEScalarElectricResistance&) const; - bool operator!=(const SEScalarElectricResistance&) const; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarElectricResistance = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarEnergy.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarEnergy.h index 027f0b731..46ce2da63 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarEnergy.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarEnergy.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API EnergyUnit : public CCompoundUnit { @@ -36,16 +35,8 @@ class BIOGEARS_API EnergyUnit : public CCompoundUnit { static const EnergyUnit kcal; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarEnergy : public SEScalarQuantity { -public: - SEScalarEnergy(); - virtual ~SEScalarEnergy(); - - CDM::ScalarEnergyData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarEnergy = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarEnergyPerAmount.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarEnergyPerAmount.h index 4539d8dca..722b87b4f 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarEnergyPerAmount.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarEnergyPerAmount.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API EnergyPerAmountUnit : public CCompoundUnit { @@ -34,16 +33,8 @@ class BIOGEARS_API EnergyPerAmountUnit : public CCompoundUnit { static const EnergyPerAmountUnit kJ_Per_mol; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarEnergyPerAmount : public SEScalarQuantity { -public: - SEScalarEnergyPerAmount(); - virtual ~SEScalarEnergyPerAmount(); - - CDM::ScalarEnergyPerAmountData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarEnergyPerAmount = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarEnergyPerMass.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarEnergyPerMass.h index c85d802a5..38f057242 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarEnergyPerMass.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarEnergyPerMass.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API EnergyPerMassUnit : public CCompoundUnit { @@ -36,16 +35,8 @@ class BIOGEARS_API EnergyPerMassUnit : public CCompoundUnit { static const EnergyPerMassUnit kcal_Per_kg; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarEnergyPerMass : public SEScalarQuantity { -public: - SEScalarEnergyPerMass(); - virtual ~SEScalarEnergyPerMass(); - - CDM::ScalarEnergyPerMassData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarEnergyPerMass = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarFlowCompliance.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarFlowCompliance.h index 328227a3f..5e00fdd84 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarFlowCompliance.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarFlowCompliance.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API FlowComplianceUnit : public CCompoundUnit { @@ -36,17 +35,8 @@ class BIOGEARS_API FlowComplianceUnit : public CCompoundUnit { static const FlowComplianceUnit m3_Per_Pa; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarFlowCompliance : public SEScalarQuantity { -public: - SEScalarFlowCompliance(); - virtual ~SEScalarFlowCompliance(); - - CDM::ScalarFlowComplianceData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; - -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarFlowCompliance = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarFlowElastance.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarFlowElastance.h index 685842a42..96d12c8ef 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarFlowElastance.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarFlowElastance.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API FlowElastanceUnit : public CCompoundUnit { @@ -35,16 +34,8 @@ class BIOGEARS_API FlowElastanceUnit : public CCompoundUnit { static const FlowElastanceUnit Pa_Per_m3; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarFlowElastance : public SEScalarQuantity { -public: - SEScalarFlowElastance(); - virtual ~SEScalarFlowElastance(); - - CDM::ScalarFlowElastanceData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarFlowElastance = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarFlowInertance.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarFlowInertance.h index 7634dbd15..55bb03b2c 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarFlowInertance.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarFlowInertance.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API FlowInertanceUnit : public CCompoundUnit { @@ -37,16 +36,8 @@ class BIOGEARS_API FlowInertanceUnit : public CCompoundUnit { static const FlowInertanceUnit Pa_s2_Per_m3; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarFlowInertance : public SEScalarQuantity { -public: - SEScalarFlowInertance(); - virtual ~SEScalarFlowInertance(); - - CDM::ScalarFlowInertanceData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarFlowInertance = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarFlowResistance.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarFlowResistance.h index 2c97bccf8..bd610d295 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarFlowResistance.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarFlowResistance.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API FlowResistanceUnit : public CCompoundUnit { @@ -37,16 +36,8 @@ class BIOGEARS_API FlowResistanceUnit : public CCompoundUnit { static const FlowResistanceUnit Pa_s_Per_m3; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarFlowResistance : public SEScalarQuantity { -public: - SEScalarFlowResistance(); - virtual ~SEScalarFlowResistance(); - - CDM::ScalarFlowResistanceData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarFlowResistance = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarForce.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarForce.h index 3bb0aafc0..0734088ed 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarForce.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarForce.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API ForceUnit : public CCompoundUnit { @@ -35,16 +34,8 @@ class BIOGEARS_API ForceUnit : public CCompoundUnit { static const ForceUnit dyn; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarForce : public SEScalarQuantity { -public: - SEScalarForce(); - virtual ~SEScalarForce(); - - CDM::ScalarForceData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarForce = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarFraction.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarFraction.h index 8161378a8..6e02b55b2 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarFraction.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarFraction.h @@ -12,13 +12,13 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API SEScalarFraction : public SEScalar { public: SEScalarFraction(double value, bool readOnly = false); + SEScalarFraction(SEScalarFraction const& obj); SEScalarFraction(); virtual ~SEScalarFraction(); @@ -26,8 +26,6 @@ class BIOGEARS_API SEScalarFraction : public SEScalar { bool operator==(const SEScalarFraction&) const; bool operator!=(const SEScalarFraction&) const; - CDM::ScalarFractionData* Unload() const; - using SEScalar::GetValue; double GetValue(const NoUnit& unitless) const; using SEScalar::SetValue; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarFrequency.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarFrequency.h index e31f96606..8baa9845c 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarFrequency.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarFrequency.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API FrequencyUnit : public CCompoundUnit { @@ -36,16 +35,8 @@ class BIOGEARS_API FrequencyUnit : public CCompoundUnit { static const FrequencyUnit Per_hr; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarFrequency : public SEScalarQuantity { -public: - SEScalarFrequency(); - virtual ~SEScalarFrequency(); - - CDM::ScalarFrequencyData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarFrequency = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatCapacitance.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatCapacitance.h index f55f83f12..3bac3fe2c 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatCapacitance.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatCapacitance.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API HeatCapacitanceUnit : public CCompoundUnit { @@ -36,17 +35,8 @@ class BIOGEARS_API HeatCapacitanceUnit : public CCompoundUnit { static const HeatCapacitanceUnit kcal_Per_C; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarHeatCapacitance : public SEScalarQuantity { -public: - SEScalarHeatCapacitance(); - virtual ~SEScalarHeatCapacitance(); - - CDM::ScalarHeatCapacitanceData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; - -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarHeatCapacitance = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatCapacitancePerAmount.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatCapacitancePerAmount.h index 9d943f2b7..20aa2630c 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatCapacitancePerAmount.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatCapacitancePerAmount.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API HeatCapacitancePerAmountUnit : public CCompoundUnit { @@ -33,16 +32,7 @@ class BIOGEARS_API HeatCapacitancePerAmountUnit : public CCompoundUnit { static const HeatCapacitancePerAmountUnit J_Per_K_mol; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarHeatCapacitancePerAmount : public SEScalarQuantity { -public: - SEScalarHeatCapacitancePerAmount(); - virtual ~SEScalarHeatCapacitancePerAmount(); - - CDM::ScalarHeatCapacitancePerAmountData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarHeatCapacitancePerAmount = SEScalarQuantity; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatCapacitancePerMass.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatCapacitancePerMass.h index f20d42485..7789a6a2c 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatCapacitancePerMass.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatCapacitancePerMass.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API HeatCapacitancePerMassUnit : public CCompoundUnit { @@ -36,17 +35,8 @@ class BIOGEARS_API HeatCapacitancePerMassUnit : public CCompoundUnit { static const HeatCapacitancePerMassUnit kcal_Per_C_kg; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarHeatCapacitancePerMass : public SEScalarQuantity { -public: - SEScalarHeatCapacitancePerMass(); - virtual ~SEScalarHeatCapacitancePerMass(); - - CDM::ScalarHeatCapacitancePerMassData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; - -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarHeatCapacitancePerMass = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatConductance.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatConductance.h index 7596277b0..9ca14b915 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatConductance.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatConductance.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API HeatConductanceUnit : public CCompoundUnit { @@ -36,17 +35,8 @@ class BIOGEARS_API HeatConductanceUnit : public CCompoundUnit { static const HeatConductanceUnit kcal_Per_C_s; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarHeatConductance : public SEScalarQuantity { -public: - SEScalarHeatConductance(); - virtual ~SEScalarHeatConductance(); - - CDM::ScalarHeatConductanceData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; - -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarHeatConductance = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatConductancePerArea.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatConductancePerArea.h index 38acb9140..d908eea67 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatConductancePerArea.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatConductancePerArea.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API HeatConductancePerAreaUnit : public CCompoundUnit { @@ -35,17 +34,8 @@ class BIOGEARS_API HeatConductancePerAreaUnit : public CCompoundUnit { static const HeatConductancePerAreaUnit BTU_Per_hr_ft2_C; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarHeatConductancePerArea : public SEScalarQuantity { -public: - SEScalarHeatConductancePerArea(); - virtual ~SEScalarHeatConductancePerArea(); - - CDM::ScalarHeatConductancePerAreaData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; - -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarHeatConductancePerArea = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatInductance.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatInductance.h index 5bf045bf2..d14e70ba2 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatInductance.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatInductance.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API HeatInductanceUnit : public CCompoundUnit { @@ -33,17 +32,8 @@ class BIOGEARS_API HeatInductanceUnit : public CCompoundUnit { static const HeatInductanceUnit K_s_Per_W; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarHeatInductance : public SEScalarQuantity { -public: - SEScalarHeatInductance(); - virtual ~SEScalarHeatInductance(); - - CDM::ScalarHeatInductanceData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; - -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarHeatInductance = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatResistance.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatResistance.h index 3f4667912..cc335dbc3 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatResistance.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatResistance.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API HeatResistanceUnit : public CCompoundUnit { @@ -36,17 +35,8 @@ class BIOGEARS_API HeatResistanceUnit : public CCompoundUnit { static const HeatResistanceUnit C_s_Per_kcal; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarHeatResistance : public SEScalarQuantity { -public: - SEScalarHeatResistance(); - virtual ~SEScalarHeatResistance(); - - CDM::ScalarHeatResistanceData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; - -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarHeatResistance = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatResistanceArea.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatResistanceArea.h index 69110d1ab..55b089a86 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatResistanceArea.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarHeatResistanceArea.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API HeatResistanceAreaUnit : public CCompoundUnit { @@ -36,17 +35,8 @@ class BIOGEARS_API HeatResistanceAreaUnit : public CCompoundUnit { static const HeatResistanceAreaUnit tog; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarHeatResistanceArea : public SEScalarQuantity { -public: - SEScalarHeatResistanceArea(); - virtual ~SEScalarHeatResistanceArea(); - - CDM::ScalarHeatResistanceAreaData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; - -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarHeatResistanceArea = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarInversePressure.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarInversePressure.h index 26eb034bc..a5a610e07 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarInversePressure.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarInversePressure.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API InversePressureUnit : public CCompoundUnit { @@ -36,16 +35,8 @@ class BIOGEARS_API InversePressureUnit : public CCompoundUnit { static const InversePressureUnit Inverse_atm; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarInversePressure : public SEScalarQuantity { -public: - SEScalarInversePressure(); - virtual ~SEScalarInversePressure(); - - CDM::ScalarInversePressureData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarInversePressure = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarInverseVolume.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarInverseVolume.h index ede90ef8a..a691ee79b 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarInverseVolume.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarInverseVolume.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API InverseVolumeUnit : public CCompoundUnit { @@ -34,13 +33,8 @@ class BIOGEARS_API InverseVolumeUnit : public CCompoundUnit { static const InverseVolumeUnit Inverse_mL; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarInverseVolume : public SEScalarQuantity { -public: - SEScalarInverseVolume(); - virtual ~SEScalarInverseVolume(); - - CDM::ScalarInverseVolumeData* Unload() const override; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarInverseVolume = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarLength.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarLength.h index 2d0641b6d..267e0c7ae 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarLength.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarLength.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API LengthUnit : public CCompoundUnit { @@ -38,16 +37,8 @@ class BIOGEARS_API LengthUnit : public CCompoundUnit { static const LengthUnit ft; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarLength : public SEScalarQuantity { -public: - SEScalarLength(); - virtual ~SEScalarLength(); - - CDM::ScalarLengthData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarLength = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarLengthPerTime.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarLengthPerTime.h index 736533896..74ab5e008 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarLengthPerTime.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarLengthPerTime.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API LengthPerTimeUnit : public CCompoundUnit { @@ -37,16 +36,8 @@ class BIOGEARS_API LengthPerTimeUnit : public CCompoundUnit { static const LengthPerTimeUnit ft_Per_s; static const LengthPerTimeUnit ft_Per_min; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarLengthPerTime : public SEScalarQuantity { -public: - SEScalarLengthPerTime(); - virtual ~SEScalarLengthPerTime(); - - CDM::ScalarLengthPerTimeData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarLengthPerTime = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarLengthPerTimePressure.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarLengthPerTimePressure.h index 025b95ff7..b890e416e 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarLengthPerTimePressure.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarLengthPerTimePressure.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API LengthPerTimePressureUnit : public CCompoundUnit { @@ -36,16 +35,8 @@ class BIOGEARS_API LengthPerTimePressureUnit : public CCompoundUnit { static const LengthPerTimePressureUnit cm_Per_min_mmHg; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarLengthPerTimePressure : public SEScalarQuantity { -public: - SEScalarLengthPerTimePressure(); - virtual ~SEScalarLengthPerTimePressure(); - - CDM::ScalarLengthPerTimePressureData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarLengthPerTimePressure = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarMass.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarMass.h index 369f9a132..b0cfe8aa6 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarMass.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarMass.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API MassUnit : public CCompoundUnit { @@ -36,17 +35,8 @@ class BIOGEARS_API MassUnit : public CCompoundUnit { static const MassUnit& GetCompoundUnit(const char* unit); static const MassUnit& GetCompoundUnit(const std::string& unit); }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarMass : public SEScalarQuantity { -public: - SEScalarMass(); - SEScalarMass( double value, MassUnit const& unit); - virtual ~SEScalarMass(); - - CDM::ScalarMassData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarMass = SEScalarQuantity; +#pragma warning(default:4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarMassPerAmount.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarMassPerAmount.h index b9038e9c9..945a3345e 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarMassPerAmount.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarMassPerAmount.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API MassPerAmountUnit : public CCompoundUnit { @@ -43,16 +42,8 @@ class BIOGEARS_API MassPerAmountUnit : public CCompoundUnit { static const MassPerAmountUnit pg_Per_ct; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarMassPerAmount : public SEScalarQuantity { -public: - SEScalarMassPerAmount(); - virtual ~SEScalarMassPerAmount(); - - CDM::ScalarMassPerAmountData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarMassPerAmount = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarMassPerAreaTime.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarMassPerAreaTime.h index ffed205c8..b0d7675ea 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarMassPerAreaTime.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarMassPerAreaTime.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API MassPerAreaTimeUnit : public CCompoundUnit { @@ -33,17 +32,8 @@ class BIOGEARS_API MassPerAreaTimeUnit : public CCompoundUnit { static const MassPerAreaTimeUnit g_Per_cm2_s; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarMassPerAreaTime : public SEScalarQuantity { -public: - SEScalarMassPerAreaTime(); - virtual ~SEScalarMassPerAreaTime(); - - CDM::ScalarMassPerAreaTimeData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; - -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarMassPerAreaTime = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarMassPerMass.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarMassPerMass.h index 2bc2fe1b9..67df37ba7 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarMassPerMass.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarMassPerMass.h @@ -33,16 +33,8 @@ class BIOGEARS_API MassPerMassUnit : public CCompoundUnit { static const MassPerMassUnit mg_Per_g; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarMassPerMass : public SEScalarQuantity { -public: - SEScalarMassPerMass(); - virtual ~SEScalarMassPerMass(); - - CDM::ScalarMassPerMassData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarMassPerMass = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarMassPerTime.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarMassPerTime.h index ea3d8a357..bd5c252eb 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarMassPerTime.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarMassPerTime.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API MassPerTimeUnit : public CCompoundUnit { @@ -40,16 +39,8 @@ class BIOGEARS_API MassPerTimeUnit : public CCompoundUnit { static const MassPerTimeUnit kg_Per_s; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarMassPerTime : public SEScalarQuantity { -public: - SEScalarMassPerTime(); - virtual ~SEScalarMassPerTime(); - - CDM::ScalarMassPerTimeData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarMassPerTime = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarMassPerVolume.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarMassPerVolume.h index c9653f099..d6158a0e3 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarMassPerVolume.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarMassPerVolume.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API MassPerVolumeUnit : public CCompoundUnit { @@ -46,18 +45,8 @@ class BIOGEARS_API MassPerVolumeUnit : public CCompoundUnit { static const MassPerVolumeUnit kg_Per_L; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarMassPerVolume : public SEScalarQuantity { -public: - SEScalarMassPerVolume(); - SEScalarMassPerVolume(const SEScalarMassPerVolume& obj); - SEScalarMassPerVolume(double, const MassPerVolumeUnit&); - virtual ~SEScalarMassPerVolume(); - - CDM::ScalarMassPerVolumeData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarMassPerVolume = SEScalarQuantity; +#pragma warning(default:4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarNeg1To1.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarNeg1To1.h index 9f382897e..83402c01d 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarNeg1To1.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarNeg1To1.h @@ -12,20 +12,18 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API SEScalarNeg1To1 : public SEScalar { public: SEScalarNeg1To1(); + SEScalarNeg1To1(SEScalarNeg1To1 const& obj); virtual ~SEScalarNeg1To1(); bool operator==(const SEScalarNeg1To1&) const; bool operator!=(const SEScalarNeg1To1&) const; - CDM::ScalarNeg1To1Data* Unload() const override; - using SEScalar::GetValue; double GetValue(const NoUnit& unitless) const; void SetValue(double d) override; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarOsmolality.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarOsmolality.h index 7fc1eb26d..1a5198edc 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarOsmolality.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarOsmolality.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API OsmolalityUnit : public CCompoundUnit { @@ -34,17 +33,8 @@ class BIOGEARS_API OsmolalityUnit : public CCompoundUnit { static const OsmolalityUnit mOsm_Per_kg; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarOsmolality : public SEScalarQuantity { -public: - SEScalarOsmolality(); - virtual ~SEScalarOsmolality(); - - CDM::ScalarOsmolalityData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; - -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarOsmolality = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarOsmolarity.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarOsmolarity.h index c20fffdff..7451308aa 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarOsmolarity.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarOsmolarity.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API OsmolarityUnit : public CCompoundUnit { @@ -34,16 +33,8 @@ class BIOGEARS_API OsmolarityUnit : public CCompoundUnit { static const OsmolarityUnit mOsm_Per_L; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarOsmolarity : public SEScalarQuantity { -public: - SEScalarOsmolarity(); - virtual ~SEScalarOsmolarity(); - - CDM::ScalarOsmolarityData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarOsmolarity = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarPower.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarPower.h index d8ee49906..4f2c1a3bd 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarPower.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarPower.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API PowerUnit : public CCompoundUnit { @@ -38,17 +37,8 @@ class BIOGEARS_API PowerUnit : public CCompoundUnit { static const PowerUnit BTU_Per_hr; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarPower : public SEScalarQuantity { -public: - SEScalarPower(); - virtual ~SEScalarPower(); - - CDM::ScalarPowerData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; - -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarPower = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarPowerPerAreaTemperatureToTheFourth.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarPowerPerAreaTemperatureToTheFourth.h index 08b3b34c8..4447b730a 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarPowerPerAreaTemperatureToTheFourth.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarPowerPerAreaTemperatureToTheFourth.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API PowerPerAreaTemperatureToTheFourthUnit : public CCompoundUnit { @@ -33,16 +32,8 @@ class BIOGEARS_API PowerPerAreaTemperatureToTheFourthUnit : public CCompoundUnit static const PowerPerAreaTemperatureToTheFourthUnit W_Per_m2_K4; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarPowerPerAreaTemperatureToTheFourth : public SEScalarQuantity { -public: - SEScalarPowerPerAreaTemperatureToTheFourth(); - virtual ~SEScalarPowerPerAreaTemperatureToTheFourth(); - - CDM::ScalarPowerPerAreaTemperatureToTheFourthData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarPowerPerAreaTemperatureToTheFourth = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarPressure.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarPressure.h index ea5ae0232..b7c7466fb 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarPressure.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarPressure.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API PressureUnit : public CCompoundUnit { @@ -37,16 +36,8 @@ class BIOGEARS_API PressureUnit : public CCompoundUnit { static const PressureUnit atm; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarPressure : public SEScalarQuantity { -public: - SEScalarPressure(); - virtual ~SEScalarPressure(); - - CDM::ScalarPressureData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarPressure = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarPressurePerVolume.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarPressurePerVolume.h index d5ddac217..598e7a456 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarPressurePerVolume.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarPressurePerVolume.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API PressurePerVolumeUnit : public CCompoundUnit { @@ -34,16 +33,8 @@ class BIOGEARS_API PressurePerVolumeUnit : public CCompoundUnit { static const PressurePerVolumeUnit cmH2O_Per_mL; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarPressurePerVolume : public SEScalarQuantity { -public: - SEScalarPressurePerVolume(); - virtual ~SEScalarPressurePerVolume(); - - CDM::ScalarPressurePerVolumeData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarPressurePerVolume = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarPressureTimePerArea.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarPressureTimePerArea.h index 4d232e655..4a2dd09bc 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarPressureTimePerArea.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarPressureTimePerArea.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API PressureTimePerAreaUnit : public CCompoundUnit { @@ -34,16 +33,8 @@ class BIOGEARS_API PressureTimePerAreaUnit : public CCompoundUnit { static const PressureTimePerAreaUnit cmH2O_Per_mL_m2; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarPressureTimePerArea : public SEScalarQuantity { -public: - SEScalarPressureTimePerArea(); - virtual ~SEScalarPressureTimePerArea(); - - CDM::ScalarPressureTimePerAreaData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarPressureTimePerArea = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarPressureTimePerVolumeArea.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarPressureTimePerVolumeArea.h index 5b6ecbea9..82c140a86 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarPressureTimePerVolumeArea.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarPressureTimePerVolumeArea.h @@ -13,7 +13,6 @@ specific language governing permissions and limitations under the License. #pragma once #include #include -#include namespace biogears { class BIOGEARS_API PressureTimePerVolumeAreaUnit : public CCompoundUnit { @@ -36,17 +35,8 @@ class BIOGEARS_API PressureTimePerVolumeAreaUnit : public CCompoundUnit { static const PressureTimePerVolumeAreaUnit dyn_s_Per_cm5_m2; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarPressureTimePerVolumeArea : public SEScalarQuantity { -public: - SEScalarPressureTimePerVolumeArea(); - virtual ~SEScalarPressureTimePerVolumeArea(); - - CDM::ScalarPressureTimePerVolumeAreaData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; - -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarPressureTimePerVolumeArea = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarQuantity.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarQuantity.h index 3f124f46d..539f196c3 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarQuantity.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarQuantity.h @@ -17,8 +17,6 @@ specific language governing permissions and limitations under the License. #include -CDM_BIND_DECL(ScalarData) - namespace biogears { namespace io { class Property; @@ -31,17 +29,15 @@ class SEScalarQuantity : public SEUnitScalar { friend io::Property; SEScalarQuantity(); - SEScalarQuantity(const SEScalarQuantity&); + SEScalarQuantity(SEScalarQuantity const&); + SEScalarQuantity(SEScalarQuantity&&); explicit SEScalarQuantity(double, const Unit&, bool ro = false); ~SEScalarQuantity() override; - void Clear() override; void Invalidate() override; bool IsValid() const override; - virtual void Load(const CDM::ScalarData& in, std::default_random_engine *rd = nullptr) override; - virtual CDM::ScalarData* Unload() const override; virtual bool Set(const SEScalarQuantity& s); void Copy(const SEScalarQuantity& s); @@ -68,7 +64,8 @@ class SEScalarQuantity : public SEUnitScalar { SEScalarQuantity& DivideValue(double d); SEScalarQuantity& Divide(const SEScalar& s); - SEScalarQuantity& operator=(const SEScalarQuantity& rhs); + SEScalarQuantity& operator=(SEScalarQuantity const& rhs); + SEScalarQuantity& operator=(SEScalarQuantity&& rhs); bool operator<(const SEScalarQuantity& rhs) const; bool operator<=(const SEScalarQuantity& rhs) const; @@ -96,13 +93,11 @@ class SEScalarQuantity : public SEUnitScalar { const Unit* GetCompoundUnit(const char* unit) const override; const Unit* GetCompoundUnit(const std::string& unit) const override; -protected: - virtual void Unload(CDM::ScalarData& s) const override; - protected: const Unit* m_unit; }; +#pragma warning(disable : 4661) //------------------------------------------------------------------------------- template inline void Override(const SEScalarQuantity& from, SEScalarQuantity& to) @@ -131,5 +126,5 @@ inline void IncrementOverride(SEScalarQuantity& s, double value, const Uni s.SetReadOnly(b); } //------------------------------------------------------------------------------- +#pragma warning(default : 4661) } -#include diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarQuantity.inl b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarQuantity.inl index 6d85fa815..42d3810c3 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarQuantity.inl +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarQuantity.inl @@ -9,15 +9,18 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **************************************************************************************/ +#pragma once + #include +#include +#include #include -#include namespace biogears { //------------------------------------------------------------------------------- template -const Unit* SEScalarQuantity::GetUnit() const +Unit const* SEScalarQuantity::GetUnit() const { return m_unit; } @@ -30,7 +33,7 @@ SEScalarQuantity::SEScalarQuantity() } //------------------------------------------------------------------------------- template -SEScalarQuantity::SEScalarQuantity(const SEScalarQuantity& obj) +SEScalarQuantity::SEScalarQuantity(SEScalarQuantity const& obj) : SEUnitScalar(obj) , m_unit(obj.m_unit) @@ -38,42 +41,36 @@ SEScalarQuantity::SEScalarQuantity(const SEScalarQuantity& obj) } //------------------------------------------------------------------------------- template -SEScalarQuantity::SEScalarQuantity(double d, const Unit& u, bool ro) - : SEUnitScalar(ro) - , m_unit(nullptr) +SEScalarQuantity::SEScalarQuantity(SEScalarQuantity&& obj) + : SEUnitScalar(std::move(obj)) + , m_unit(std::exchange(obj.m_unit, nullptr)) { - SetValue(d, u); } //------------------------------------------------------------------------------- template -SEScalarQuantity::~SEScalarQuantity() +SEScalarQuantity::SEScalarQuantity(double d, Unit const& u, bool ro) + : SEUnitScalar(ro) + , m_unit(nullptr) { - this->Clear(); + SetValue(d, u); } //------------------------------------------------------------------------------- template -void SEScalarQuantity::Clear() +SEScalarQuantity::~SEScalarQuantity() { - SEProperty::Clear(); m_readOnly = false; - Invalidate(); + m_value = NaN; m_unit = nullptr; } //------------------------------------------------------------------------------- template void SEScalarQuantity::Invalidate() { - if (m_readOnly) { -#if defined(BIOGEARS_THROW_READONLY_EXCEPTIONS) - throw CommonDataModelException("Scalar is marked read-only"); - -#else - return; -#endif - } - m_value = NaN; + SEScalar::Invalidate(); m_unit = nullptr; + } + //------------------------------------------------------------------------------- template bool SEScalarQuantity::IsValid() const @@ -82,46 +79,10 @@ bool SEScalarQuantity::IsValid() const return false; return !std::isnan(m_value); } -//------------------------------------------------------------------------------- -template -void SEScalarQuantity::Load(const CDM::ScalarData& in, std::default_random_engine *rd) -{ - this->Clear(); - SEProperty::Load(in); - if (in.unit().present()) { - if (in.deviation().present() && rd) { - auto nd = std::normal_distribution(in.value(), in.deviation().get()); - this->SetValue(nd(*rd), Unit::GetCompoundUnit(in.unit().get())); - } else { - this->SetValue(in.value(), Unit::GetCompoundUnit(in.unit().get())); - } - } else - throw CommonDataModelException("ScalarQuantity attempted to load a ScalarData with no unit, must have a unit."); - m_readOnly = in.readOnly(); -} -//------------------------------------------------------------------------------- -template -CDM::ScalarData* SEScalarQuantity::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarData* data = new CDM::ScalarData(); - this->Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -template -void SEScalarQuantity::Unload(CDM::ScalarData& data) const -{ - SEProperty::Unload(data); - data.value(m_value); - data.unit(m_unit->GetString()); - data.readOnly(m_readOnly); -} //------------------------------------------------------------------------------- template -bool SEScalarQuantity::Set(const SEScalarQuantity& s) +bool SEScalarQuantity::Set(SEScalarQuantity const& s) { if (!s.IsValid()) { return false; @@ -141,7 +102,7 @@ bool SEScalarQuantity::Set(const SEScalarQuantity& s) } //------------------------------------------------------------------------------- template -void SEScalarQuantity::Copy(const SEScalarQuantity& s) +void SEScalarQuantity::Copy(SEScalarQuantity const& s) { if (m_readOnly) { #if defined(BIOGEARS_THROW_READONLY_EXCEPTIONS) @@ -166,32 +127,31 @@ double SEScalarQuantity::GetValue() const //------------------------------------------------------------------------------- template -double SEScalarQuantity::GetValue(const Unit& unit) const +double SEScalarQuantity::GetValue(Unit const& unit) const { #if defined(BIOGEARS_THROW_NAN_EXCEPTIONS) - if (std::isnan(m_value)) { + if (std::isnan(m_value) && m_unit != nullptr) { throw CommonDataModelException("Value is NaN"); } #else assert(!std::isnan(m_value)); #endif - if (std::isinf(m_value)) - return m_value; - if (m_value == 0) - return m_value; - if (m_unit == &unit) + if (std::isnan(m_value) + || std::isinf(m_value) + || (m_value == 0) + || (m_unit == &unit)) return m_value; return Convert(m_value, *m_unit, unit); } //------------------------------------------------------------------------------- template -double SEScalarQuantity::GetValue(const char* unit) const +double SEScalarQuantity::GetValue(char const* unit) const { return GetValue(std::string { unit }); } //------------------------------------------------------------------------------- template -double SEScalarQuantity::GetValue(const std::string& unit) const +double SEScalarQuantity::GetValue(std::string const& unit) const { #if defined(BIOGEARS_THROW_NAN_EXCEPTIONS) if (std::isnan(m_value)) { @@ -206,14 +166,14 @@ double SEScalarQuantity::GetValue(const std::string& unit) const if (m_value == 0) { return m_value; } - const Unit* unit_t = GetCompoundUnit(unit); + Unit const* unit_t = GetCompoundUnit(unit); if (m_unit == unit_t) return m_value; return Convert(m_value, *m_unit, *unit_t); } //------------------------------------------------------------------------------- template -void SEScalarQuantity::SetValue(double d, const Unit& unit) +void SEScalarQuantity::SetValue(double d, Unit const& unit) { if (m_readOnly) { #if defined(BIOGEARS_THROW_READONLY_EXCEPTIONS) @@ -227,7 +187,7 @@ void SEScalarQuantity::SetValue(double d, const Unit& unit) } //------------------------------------------------------------------------------- template -bool SEScalarQuantity::Equals(const SEScalarQuantity& rhs) const +bool SEScalarQuantity::Equals(SEScalarQuantity const& rhs) const { if (this == &rhs) return true; @@ -244,8 +204,8 @@ bool SEScalarQuantity::Equals(const SEScalarQuantity& rhs) const } if (m_unit == rhs.m_unit) { - if (std::isinf(m_value) && std::isinf(rhs.m_value) // This implies -> -inf == +inf - || (std::isnan(m_value) && std::isnan(rhs.m_value))) // This Violates C++ Spec + if ((std::isinf(m_value) && std::isinf(rhs.m_value)) // This implies -> -inf == +inf + || ((std::isnan(m_value) && std::isnan(rhs.m_value)))) // This Violates C++ Spec { return true; } @@ -256,13 +216,13 @@ bool SEScalarQuantity::Equals(const SEScalarQuantity& rhs) const } //------------------------------------------------------------------------------- template -const Unit* SEScalarQuantity::GetCompoundUnit(const char* unit) const +Unit const* SEScalarQuantity::GetCompoundUnit(char const* unit) const { return &Unit::GetCompoundUnit(unit); } //------------------------------------------------------------------------------- template -const Unit* SEScalarQuantity::GetCompoundUnit(const std::string& unit) const +Unit const* SEScalarQuantity::GetCompoundUnit(std::string const& unit) const { return &Unit::GetCompoundUnit(unit); } @@ -284,7 +244,7 @@ std::string SEScalarQuantity::ToString() const } //------------------------------------------------------------------------------- template -auto SEScalarQuantity::Increment(const SEScalarQuantity& s) -> SEScalarQuantity& +auto SEScalarQuantity::Increment(SEScalarQuantity const& s) -> SEScalarQuantity& { if (!s.IsValid()) { this->Invalidate(); @@ -295,19 +255,19 @@ auto SEScalarQuantity::Increment(const SEScalarQuantity& s) -> SESca } //------------------------------------------------------------------------------- template -auto SEScalarQuantity::IncrementValue(double d, const char* unit) -> SEScalarQuantity& +auto SEScalarQuantity::IncrementValue(double d, char const* unit) -> SEScalarQuantity& { return IncrementValue(d, std::string { unit }); } //------------------------------------------------------------------------------- template -auto SEScalarQuantity::IncrementValue(double d, const std::string& unit) -> SEScalarQuantity& +auto SEScalarQuantity::IncrementValue(double d, std::string const& unit) -> SEScalarQuantity& { return IncrementValue(d, *GetCompoundUnit(unit)); } //------------------------------------------------------------------------------- template -auto SEScalarQuantity::IncrementValue(double d, const Unit& unit) -> SEScalarQuantity& +auto SEScalarQuantity::IncrementValue(double d, Unit const& unit) -> SEScalarQuantity& { if (!IsValid()) { this->SetValue(d, unit); @@ -318,7 +278,7 @@ auto SEScalarQuantity::IncrementValue(double d, const Unit& unit) -> SESca } //------------------------------------------------------------------------------- template -auto SEScalarQuantity::Decrement(const SEScalarQuantity& s) -> SEScalarQuantity& +auto SEScalarQuantity::Decrement(SEScalarQuantity const& s) -> SEScalarQuantity& { if (!s.IsValid()) { this->Invalidate(); @@ -329,25 +289,25 @@ auto SEScalarQuantity::Decrement(const SEScalarQuantity& s) -> SEScalarQua } //------------------------------------------------------------------------------- template -auto SEScalarQuantity::DecrementValue(double d, const char* unit) -> SEScalarQuantity& +auto SEScalarQuantity::DecrementValue(double d, char const* unit) -> SEScalarQuantity& { return DecrementValue(d, std::string { unit }); } //------------------------------------------------------------------------------- template -auto SEScalarQuantity::DecrementValue(double d, const std::string& unit) -> SEScalarQuantity& +auto SEScalarQuantity::DecrementValue(double d, std::string const& unit) -> SEScalarQuantity& { return DecrementValue(d, *GetCompoundUnit(unit)); } //------------------------------------------------------------------------------- template -auto SEScalarQuantity::DecrementValue(double d, const Unit& unit) -> SEScalarQuantity& +auto SEScalarQuantity::DecrementValue(double d, Unit const& unit) -> SEScalarQuantity& { return IncrementValue(-d, unit); } //------------------------------------------------------------------------------- template -auto SEScalarQuantity::Multiply(const SEScalar& s) -> SEScalarQuantity& +auto SEScalarQuantity::Multiply(SEScalar const& s) -> SEScalarQuantity& { if (!s.IsValid()) { this->Invalidate(); @@ -369,7 +329,7 @@ auto SEScalarQuantity::MultiplyValue(double d) -> SEScalarQuantity& } //------------------------------------------------------------------------------- template -auto SEScalarQuantity::Divide(const SEScalar& s) -> SEScalarQuantity& +auto SEScalarQuantity::Divide(SEScalar const& s) -> SEScalarQuantity& { if (!s.IsValid()) this->Invalidate(); @@ -379,7 +339,7 @@ auto SEScalarQuantity::Divide(const SEScalar& s) -> SEScalarQuantity& } //------------------------------------------------------------------------------- template -auto SEScalarQuantity::operator=(const SEScalarQuantity& rhs) -> SEScalarQuantity& +auto SEScalarQuantity::operator=(SEScalarQuantity const& rhs) -> SEScalarQuantity& { if (this == &rhs) return *this; @@ -391,6 +351,18 @@ auto SEScalarQuantity::operator=(const SEScalarQuantity& rhs) -> SEScalarQ } //------------------------------------------------------------------------------- template +auto SEScalarQuantity::operator=(SEScalarQuantity&& rhs) -> SEScalarQuantity& +{ + if (this == &rhs) + return *this; + + this->SEScalar::operator=(std::move(rhs)); + this->m_unit = std::exchange(rhs.m_unit, nullptr); + + return *this; +} +//------------------------------------------------------------------------------- +template auto SEScalarQuantity::DivideValue(double d) -> SEScalarQuantity& { if (!IsValid()) { @@ -402,102 +374,102 @@ auto SEScalarQuantity::DivideValue(double d) -> SEScalarQuantity& } //------------------------------------------------------------------------------- template -bool SEScalarQuantity::operator<(const SEScalarQuantity& rhs) const +bool SEScalarQuantity::operator<(SEScalarQuantity const& rhs) const { return m_value < Convert(rhs.m_value, *rhs.m_unit, *m_unit); } //------------------------------------------------------------------------------- template -bool SEScalarQuantity::operator<=(const SEScalarQuantity& rhs) const +bool SEScalarQuantity::operator<=(SEScalarQuantity const& rhs) const { return m_value <= Convert(rhs.m_value, *rhs.m_unit, *m_unit); } //------------------------------------------------------------------------------- template -bool SEScalarQuantity::operator>(const SEScalarQuantity& rhs) const +bool SEScalarQuantity::operator>(SEScalarQuantity const& rhs) const { return m_value > Convert(rhs.m_value, *rhs.m_unit, *m_unit); } //------------------------------------------------------------------------------- template -bool SEScalarQuantity::operator>=(const SEScalarQuantity& rhs) const +bool SEScalarQuantity::operator>=(SEScalarQuantity const& rhs) const { return m_value >= Convert(rhs.m_value, *rhs.m_unit, *m_unit); } //------------------------------------------------------------------------------- template -bool SEScalarQuantity::operator==(const SEScalarQuantity& rhs) const +bool SEScalarQuantity::operator==(SEScalarQuantity const& rhs) const { return Equals(rhs); } //------------------------------------------------------------------------------- template -bool SEScalarQuantity::operator!=(const SEScalarQuantity& rhs) const +bool SEScalarQuantity::operator!=(SEScalarQuantity const& rhs) const { return !Equals(rhs); } //------------------------------------------------------------------------------- template -bool SEScalarQuantity::operator==(const SEUnitScalar& rhs) const +bool SEScalarQuantity::operator==(SEUnitScalar const& rhs) const { auto rhs_ptr = dynamic_cast(&rhs); return (rhs_ptr) ? this->operator==(*rhs_ptr) : false; } //------------------------------------------------------------------------------- template -bool SEScalarQuantity::operator!=(const SEUnitScalar& rhs) const +bool SEScalarQuantity::operator!=(SEUnitScalar const& rhs) const { return !this->operator==(rhs); } //------------------------------------------------------------------------------- template -auto SEScalarQuantity::operator+(const SEScalarQuantity& rhs) const -> SEScalarQuantity +auto SEScalarQuantity::operator+(SEScalarQuantity const& rhs) const -> SEScalarQuantity { SEScalarQuantity result { *this }; return result.Increment(rhs); } //------------------------------------------------------------------------------- template -auto SEScalarQuantity::operator+=(const SEScalarQuantity& rhs) -> SEScalarQuantity& +auto SEScalarQuantity::operator+=(SEScalarQuantity const& rhs) -> SEScalarQuantity& { return this->Increment(rhs); } //------------------------------------------------------------------------------- template -auto SEScalarQuantity::operator-(const SEScalarQuantity& rhs) const -> SEScalarQuantity +auto SEScalarQuantity::operator-(SEScalarQuantity const& rhs) const -> SEScalarQuantity { SEScalarQuantity result { *this }; return result.Decrement(rhs); } //------------------------------------------------------------------------------- template -auto SEScalarQuantity::operator-=(const SEScalarQuantity& rhs) -> SEScalarQuantity& +auto SEScalarQuantity::operator-=(SEScalarQuantity const& rhs) -> SEScalarQuantity& { return this->Decrement(rhs); } //------------------------------------------------------------------------------- template -auto SEScalarQuantity::operator/(const SEScalar& rhs) const -> SEScalarQuantity +auto SEScalarQuantity::operator/(SEScalar const& rhs) const -> SEScalarQuantity { SEScalarQuantity result { *this }; return result.Divide(rhs); } //------------------------------------------------------------------------------- template -auto SEScalarQuantity::operator/=(const SEScalar& rhs) -> SEScalarQuantity& +auto SEScalarQuantity::operator/=(SEScalar const& rhs) -> SEScalarQuantity& { return this->Divide(rhs); } //------------------------------------------------------------------------------- template -auto SEScalarQuantity::operator*(const SEScalar& rhs) const -> SEScalarQuantity +auto SEScalarQuantity::operator*(SEScalar const& rhs) const -> SEScalarQuantity { SEScalarQuantity result { *this }; return result.Multiply(rhs); } //------------------------------------------------------------------------------- template -auto SEScalarQuantity::operator*=(const SEScalar& rhs) -> SEScalarQuantity& +auto SEScalarQuantity::operator*=(SEScalar const& rhs) -> SEScalarQuantity& { return this->Multiply(rhs); } diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarTemperature.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarTemperature.h index 04c06e1fb..7e66e9ed3 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarTemperature.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarTemperature.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API TemperatureUnit : public CCompoundUnit { @@ -36,16 +35,8 @@ class BIOGEARS_API TemperatureUnit : public CCompoundUnit { static const TemperatureUnit R; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarTemperature : public SEScalarQuantity { -public: - SEScalarTemperature(); - virtual ~SEScalarTemperature(); - - CDM::ScalarTemperatureData* Unload() const override; - - using SEScalarQuantity::SetValue; - double GetValue(const TemperatureUnit& unit) const override; // Zero is not Zero for all units, gotta remove that logic for this scalar type -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarTemperature = SEScalarQuantity; +#pragma warning(default : 4661) } diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarTime.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarTime.h index 0b32d2e06..399f5651d 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarTime.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarTime.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API TimeUnit : public CCompoundUnit { @@ -37,16 +36,8 @@ class BIOGEARS_API TimeUnit : public CCompoundUnit { static const TimeUnit yr; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarTime : public SEScalarQuantity { -public: - SEScalarTime(); - virtual ~SEScalarTime(); - - CDM::ScalarTimeData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarTime = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarTimeMassPerVolume.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarTimeMassPerVolume.h index 85affa53d..501665bae 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarTimeMassPerVolume.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarTimeMassPerVolume.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API TimeMassPerVolumeUnit : public CCompoundUnit { @@ -38,16 +37,8 @@ class BIOGEARS_API TimeMassPerVolumeUnit : public CCompoundUnit { static const TimeMassPerVolumeUnit hr_ug_Per_mL; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarTimeMassPerVolume : public SEScalarQuantity { -public: - SEScalarTimeMassPerVolume(); - virtual ~SEScalarTimeMassPerVolume(); - - CDM::ScalarTimeMassPerVolumeData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarTimeMassPerVolume = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarVolume.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarVolume.h index 0ac28f140..ce1ee843f 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarVolume.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarVolume.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API VolumeUnit : public CCompoundUnit { @@ -37,16 +36,8 @@ class BIOGEARS_API VolumeUnit : public CCompoundUnit { static const VolumeUnit uL; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarVolume : public SEScalarQuantity { -public: - SEScalarVolume(); - virtual ~SEScalarVolume(); - - CDM::ScalarVolumeData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarVolume = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarVolumePerPressure.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarVolumePerPressure.h index b2f92ad47..f8f7f6377 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarVolumePerPressure.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarVolumePerPressure.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API VolumePerPressureUnit : public CCompoundUnit { @@ -34,16 +33,8 @@ class BIOGEARS_API VolumePerPressureUnit : public CCompoundUnit { static const VolumePerPressureUnit L_Per_cmH2O; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarVolumePerPressure : public SEScalarQuantity { -public: - SEScalarVolumePerPressure(); - virtual ~SEScalarVolumePerPressure(); - - CDM::ScalarVolumePerPressureData* Unload() const; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarVolumePerPressure = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarVolumePerTime.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarVolumePerTime.h index a82ad5d74..ad8a6389b 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarVolumePerTime.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarVolumePerTime.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API VolumePerTimeUnit : public CCompoundUnit { @@ -40,16 +39,9 @@ class BIOGEARS_API VolumePerTimeUnit : public CCompoundUnit { static const VolumePerTimeUnit mL_Per_hr; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarVolumePerTime = SEScalarQuantity; +#pragma warning(default : 4661) -class BIOGEARS_API SEScalarVolumePerTime : public SEScalarQuantity { -public: - SEScalarVolumePerTime(); - virtual ~SEScalarVolumePerTime(); - - CDM::ScalarVolumePerTimeData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarVolumePerTimeArea.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarVolumePerTimeArea.h index a11b95b63..d24e33b94 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarVolumePerTimeArea.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarVolumePerTimeArea.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API VolumePerTimeAreaUnit : public CCompoundUnit { @@ -35,17 +34,8 @@ class BIOGEARS_API VolumePerTimeAreaUnit : public CCompoundUnit { static const VolumePerTimeAreaUnit L_Per_min_m2; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarVolumePerTimeArea : public SEScalarQuantity { -public: - SEScalarVolumePerTimeArea(); - virtual ~SEScalarVolumePerTimeArea(); - - CDM::ScalarVolumePerTimeAreaData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; - -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarVolumePerTimeArea = SEScalarQuantity; +#pragma warning(default : 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarVolumePerTimeMass.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarVolumePerTimeMass.h index e788893a4..a1d1517a5 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarVolumePerTimeMass.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarVolumePerTimeMass.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API VolumePerTimeMassUnit : public CCompoundUnit { @@ -36,17 +35,10 @@ class BIOGEARS_API VolumePerTimeMassUnit : public CCompoundUnit { static const VolumePerTimeMassUnit mL_Per_s_kg; static const VolumePerTimeMassUnit uL_Per_min_kg; }; +#pragma warning(disable : 4661) -BG_EXT template class BIOGEARS_API SEScalarQuantity; +extern template class SEScalarQuantity; +using SEScalarVolumePerTimeMass = SEScalarQuantity; +#pragma warning(default : 4661) -class BIOGEARS_API SEScalarVolumePerTimeMass : public SEScalarQuantity { -public: - SEScalarVolumePerTimeMass(); - virtual ~SEScalarVolumePerTimeMass(); - - CDM::ScalarVolumePerTimeMassData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarVolumePerTimePressure.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarVolumePerTimePressure.h index 1aad43d99..34a8b5971 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarVolumePerTimePressure.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarVolumePerTimePressure.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API VolumePerTimePressureUnit : public CCompoundUnit { @@ -36,17 +35,8 @@ class BIOGEARS_API VolumePerTimePressureUnit : public CCompoundUnit { static const VolumePerTimePressureUnit mL_Per_min_mmHg; }; -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarVolumePerTimePressure : public SEScalarQuantity { -public: - SEScalarVolumePerTimePressure(); - virtual ~SEScalarVolumePerTimePressure(); - - CDM::ScalarVolumePerTimePressureData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; - -}; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarVolumePerTimePressure = SEScalarQuantity; +#pragma warning(default: 4661) } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarVolumePerTimePressureArea.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarVolumePerTimePressureArea.h index cf79c8ce7..cb4b99e2b 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarVolumePerTimePressureArea.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEScalarVolumePerTimePressureArea.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class BIOGEARS_API VolumePerTimePressureAreaUnit : public CCompoundUnit { @@ -33,17 +32,9 @@ class BIOGEARS_API VolumePerTimePressureAreaUnit : public CCompoundUnit { bool operator==(const VolumePerTimePressureAreaUnit&) const; bool operator!=(const VolumePerTimePressureAreaUnit&) const; }; +#pragma warning(disable : 4661) +extern template class SEScalarQuantity; +using SEScalarVolumePerTimePressureArea = SEScalarQuantity; +#pragma warning(default : 4661) -BG_EXT template class BIOGEARS_API SEScalarQuantity; - -class BIOGEARS_API SEScalarVolumePerTimePressureArea : public SEScalarQuantity { -public: - SEScalarVolumePerTimePressureArea(); - virtual ~SEScalarVolumePerTimePressureArea(); - - CDM::ScalarVolumePerTimePressureAreaData* Unload() const override; - - using SEScalarQuantity::SetValue; - using SEScalarQuantity::GetValue; -}; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEUnitScalar.h b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEUnitScalar.h index 657739626..0f3ea16a4 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/properties/SEUnitScalar.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/properties/SEUnitScalar.h @@ -12,6 +12,7 @@ specific language governing permissions and limitations under the License. #pragma once +#include #include namespace biogears { @@ -27,7 +28,7 @@ class BIOGEARS_API SEUnitScalar : public SEScalar { virtual const CCompoundUnit* GetUnit() const = 0; virtual const CCompoundUnit* GetCompoundUnit(const char* unit) const = 0; virtual const CCompoundUnit* GetCompoundUnit(const std::string& unit) const = 0; - virtual double GetValue() const = 0; + virtual double GetValue() const override = 0; virtual double GetValue(const char* unit) const = 0; virtual double GetValue(const std::string& unit) const = 0; @@ -39,4 +40,4 @@ class BIOGEARS_API SEUnitScalar : public SEScalar { virtual bool operator==(const SEUnitScalar&) const = 0; virtual bool operator!=(const SEUnitScalar&) const = 0; }; -} \ No newline at end of file +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEAction.h b/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEAction.h index 4b78ef3ac..91e0b0dc1 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEAction.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEAction.h @@ -18,26 +18,25 @@ specific language governing permissions and limitations under the License. #include -CDM_BIND_DECL(ActionData); namespace biogears { class SESubstanceManager; namespace io { - class Scenario; + class Actions; } } //namespace biogears namespace biogears{ class BIOGEARS_API SEAction : public Loggable { - friend io::Scenario; + friend io::Actions; public: virtual const char* classname() const = 0; - SEAction(); + SEAction( Logger* = nullptr); virtual ~SEAction(); - virtual void Clear(); // Deletes all members + virtual void Invalidate(); // Deletes all members /** Test if the action has all data it needs */ virtual bool IsValid() const { return true; } @@ -45,17 +44,10 @@ class BIOGEARS_API SEAction : public Loggable { * This method will encapsulate that logic in a single function */ virtual bool IsActive() const { return IsValid(); } - static SEAction* newFromBind(const CDM::ActionData& action, SESubstanceManager& substances, std::default_random_engine *rd = nullptr); - - virtual bool Load(const CDM::ActionData& in); - virtual CDM::ActionData* Unload() const; bool operator==(const SEAction& rhs) const; bool operator!=(const SEAction& rhs) const; -protected: - void Unload(CDM::ActionData& data) const; - public: virtual const char* GetComment() const; virtual void SetComment(const char* comment); @@ -78,6 +70,9 @@ inline std::ostream& operator<<(std::ostream& out, const SEAction& a) } }//namespace biogears +#pragma warning(disable : 4661) + namespace std { -BG_EXT template class BIOGEARS_API vector; -} \ No newline at end of file +extern template class vector; +} +#pragma warning(default : 4661) diff --git a/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEActionManager.h b/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEActionManager.h index 787396655..3fd9bf552 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEActionManager.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEActionManager.h @@ -20,18 +20,19 @@ namespace biogears { class SESubstanceManager; class SEAction; class PhysiologyEngine; +namespace io { + class Actions; +} class BIOGEARS_API SEActionManager : public Loggable { + friend class io::Actions; public: SEActionManager(SESubstanceManager&); ~SEActionManager(); - void Clear(); - - void Unload(std::vector& to); + void Invalidate(); bool ProcessAction(const SEAction& action, const PhysiologyEngine& engine); - bool ProcessAction(const CDM::ActionData& in, const PhysiologyEngine& engine); SEEnvironmentActionCollection& GetEnvironmentActions() { return m_EnvironmentActions; } SEPatientActionCollection& GetPatientActions() { return m_PatientActions; } @@ -45,8 +46,6 @@ class BIOGEARS_API SEActionManager : public Loggable { SEAnesthesiaMachineActionCollection m_AnesthesiaMachineActions; SEInhalerActionCollection m_InhalerActions; - std::vector m_ProcessedActions; - std::stringstream m_ss; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEAdvanceTime.h b/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEAdvanceTime.h index 059ad98d1..c609fe7da 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEAdvanceTime.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEAdvanceTime.h @@ -12,21 +12,15 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include -#include - -//#include - -CDM_BIND_DECL(AdvanceTimeData) namespace biogears { class TimeUnit; namespace io { - class Scenario; + class Actions; } class BIOGEARS_API SEAdvanceTime : public SEAction { - friend io::Scenario; + friend io::Actions; public: SEAdvanceTime(); @@ -35,19 +29,13 @@ class BIOGEARS_API SEAdvanceTime : public SEAction { static constexpr const char* TypeTag() { return "SEAdvanceTime"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; // clear memory + virtual void Invalidate() override; // clear memory virtual bool IsValid() const override; - virtual bool Load(const CDM::AdvanceTimeData& in, std::default_random_engine *rd = nullptr); - virtual CDM::AdvanceTimeData* Unload() const override; - bool operator==(SEAdvanceTime const&) const; bool operator!=(SEAdvanceTime const&) const; -protected: - virtual void Unload(CDM::AdvanceTimeData& data) const; - public: virtual void ToString(std::ostream& str) const override; @@ -58,4 +46,4 @@ class BIOGEARS_API SEAdvanceTime : public SEAction { protected: SEScalarTime* m_Time; }; -} \ No newline at end of file +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEAnesthesiaMachineActionCollection.h b/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEAnesthesiaMachineActionCollection.h index 1eb24654a..6dd1ee30b 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEAnesthesiaMachineActionCollection.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEAnesthesiaMachineActionCollection.h @@ -30,18 +30,20 @@ specific language governing permissions and limitations under the License. namespace biogears { class PhysiologyEngine; +namespace io { + class AnesthesiaActions; +} class BIOGEARS_API SEAnesthesiaMachineActionCollection : public Loggable { + friend io::AnesthesiaActions; + public: SEAnesthesiaMachineActionCollection(SESubstanceManager&); ~SEAnesthesiaMachineActionCollection(); - void Clear(); - - void Unload(std::vector& to); + void Invalidate(); bool ProcessAction(const SEAnesthesiaMachineAction& action, const PhysiologyEngine& engine); - bool ProcessAction(const CDM::AnesthesiaMachineActionData& action, const PhysiologyEngine& engine); // STATE ACTION bool HasConfiguration() const; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/scenario/SECondition.h b/projects/biogears/libBiogears/include/biogears/cdm/scenario/SECondition.h index 07c8301bb..3491c31b2 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/scenario/SECondition.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/scenario/SECondition.h @@ -14,36 +14,26 @@ specific language governing permissions and limitations under the License. #include #include -CDM_BIND_DECL(ConditionData); - namespace biogears { class SESubstanceManager; namespace io { - class Scenario; + class Conditions; } } // namespace biogears namespace biogears { class BIOGEARS_API SECondition : public Loggable { - friend io::Scenario; + friend io::Conditions; public: SECondition(); virtual ~SECondition(); - virtual void Clear(); // Deletes all members - - static SECondition* newFromBind(const CDM::ConditionData& condition, SESubstanceManager& substances); - - virtual bool Load(const CDM::ConditionData& in); - virtual CDM::ConditionData* Unload() const; + virtual void Invalidate(); // Deletes all members virtual bool operator==(SECondition const&) const = 0; virtual bool operator!=(SECondition const&) const = 0; -protected: - void Unload(CDM::ConditionData& data) const; - public: /** Test if the action has all data it needs */ virtual bool IsValid() const { return true; } @@ -71,6 +61,9 @@ inline std::ostream& operator<<(std::ostream& out, const SECondition& a) } } // namespace biogears +#pragma warning(disable : 4661) + namespace std { -BG_EXT template class BIOGEARS_API vector; -} \ No newline at end of file +extern template class vector; +} +#pragma warning(default : 4661) diff --git a/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEConditionManager.h b/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEConditionManager.h index da4066ba4..e89bfbae9 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEConditionManager.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEConditionManager.h @@ -28,23 +28,23 @@ specific language governing permissions and limitations under the License. #include #include -#include -CDM_BIND_DECL(ConditionData); namespace biogears { +namespace io { + class Conditions; +} class PhysiologyEngine; class BIOGEARS_API SEConditionManager : public Loggable { + friend class io::Conditions; + public: SEConditionManager(SESubstanceManager&); ~SEConditionManager(); - void Clear(); - - void Unload(std::vector& to); + void Invalidate(); - bool ProcessCondition(const SECondition& condition, const PhysiologyEngine& engine); - bool ProcessCondition(const CDM::ConditionData& condition, const PhysiologyEngine& engine); + bool ProcessCondition(const SECondition& condition, const PhysiologyEngine& engine);\ // Not too many conditions, so just have one manager // If we start getting alot, I will make patient/environment/equipment condition managers, like the action managers @@ -109,4 +109,4 @@ class BIOGEARS_API SEConditionManager : public Loggable { std::vector m_Conditions; std::stringstream m_ss; }; -} \ No newline at end of file +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEEnvironmentActionCollection.h b/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEEnvironmentActionCollection.h index 2e26e1809..1bcabaa44 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEEnvironmentActionCollection.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEEnvironmentActionCollection.h @@ -14,22 +14,22 @@ specific language governing permissions and limitations under the License. #include #include #include -#include namespace biogears { class PhysiologyEngine; - +namespace io { + class EnvironmentActions; +} class BIOGEARS_API SEEnvironmentActionCollection : public Loggable { + friend class io::EnvironmentActions; + public: SEEnvironmentActionCollection(SESubstanceManager&); ~SEEnvironmentActionCollection(); - void Clear(); - - void Unload(std::vector& to); + void Invalidate(); bool ProcessAction(const SEEnvironmentAction& action, const PhysiologyEngine& engine); - bool ProcessAction(const CDM::EnvironmentActionData& action, const PhysiologyEngine& engine); // STATE ACTION bool HasChange() const; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEInhalerActionCollection.h b/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEInhalerActionCollection.h index 64ff0cecc..1a03fc50a 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEInhalerActionCollection.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEInhalerActionCollection.h @@ -18,19 +18,20 @@ specific language governing permissions and limitations under the License. namespace biogears { class PhysiologyEngine; - +namespace io { + class InhalerActions; +} class BIOGEARS_API SEInhalerActionCollection : public Loggable { + friend class io::InhalerActions; + public: SEInhalerActionCollection(SESubstanceManager&); ~SEInhalerActionCollection(); - void Clear(); - - void Unload(std::vector& to); + void Invalidate(); bool ProcessAction(const SEInhalerAction& action, const PhysiologyEngine& engine); - bool ProcessAction(const CDM::InhalerActionData& action, const PhysiologyEngine& engine); - + // STATE ACTION bool HasConfiguration() const; SEInhalerConfiguration* GetConfiguration() const; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEPatientActionCollection.h b/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEPatientActionCollection.h index 0f7f180f3..33f8986de 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEPatientActionCollection.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEPatientActionCollection.h @@ -18,6 +18,7 @@ specific language governing permissions and limitations under the License. #include #include #include +#include #include #include #include @@ -27,11 +28,13 @@ specific language governing permissions and limitations under the License. #include #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -56,21 +59,28 @@ specific language governing permissions and limitations under the License. #include #include +#pragma warning(disable : 4661) + namespace std { -BG_EXT template class BIOGEARS_API map; -BG_EXT template class BIOGEARS_API map; -BG_EXT template class BIOGEARS_API map; -BG_EXT template class BIOGEARS_API map; -BG_EXT template class BIOGEARS_API map; -BG_EXT template class BIOGEARS_API map; -BG_EXT template class BIOGEARS_API map; -BG_EXT template class BIOGEARS_API map; -BG_EXT template class BIOGEARS_API map; +extern template class map; +extern template class map; +extern template class map; +extern template class map; +extern template class map; +extern template class map; +extern template class map; +extern template class map; +extern template class map; +extern template class map; } +#pragma warning(default : 4661) + namespace biogears { class PhysiologyEngine; - +namespace io { + class PatientActions; +} //! //! This is an emergency fix for working with UE4 //! If this stays around until 7.6 this code will @@ -162,35 +172,42 @@ class VectorWrapper { std::vector& _vector; }; -BG_EXT template class BIOGEARS_API PairWrapper; -BG_EXT template class BIOGEARS_API PairWrapper; -BG_EXT template class BIOGEARS_API PairWrapper; -BG_EXT template class BIOGEARS_API PairWrapper; -BG_EXT template class BIOGEARS_API PairWrapper; -BG_EXT template class BIOGEARS_API PairWrapper; -BG_EXT template class BIOGEARS_API PairWrapper; -BG_EXT template class BIOGEARS_API PairWrapper; -BG_EXT template class BIOGEARS_API PairWrapper; - -BG_EXT template class BIOGEARS_API MapIteratorWrapper; -BG_EXT template class BIOGEARS_API MapIteratorWrapper; -BG_EXT template class BIOGEARS_API MapIteratorWrapper; -BG_EXT template class BIOGEARS_API MapIteratorWrapper; -BG_EXT template class BIOGEARS_API MapIteratorWrapper; -BG_EXT template class BIOGEARS_API MapIteratorWrapper; -BG_EXT template class BIOGEARS_API MapIteratorWrapper; -BG_EXT template class BIOGEARS_API MapIteratorWrapper; -BG_EXT template class BIOGEARS_API MapIteratorWrapper; - -BG_EXT template class BIOGEARS_API MapWrapper; -BG_EXT template class BIOGEARS_API MapWrapper; -BG_EXT template class BIOGEARS_API MapWrapper; -BG_EXT template class BIOGEARS_API MapWrapper; -BG_EXT template class BIOGEARS_API MapWrapper; -BG_EXT template class BIOGEARS_API MapWrapper; -BG_EXT template class BIOGEARS_API MapWrapper; -BG_EXT template class BIOGEARS_API MapWrapper; -BG_EXT template class BIOGEARS_API MapWrapper; +#pragma warning(disable : 4661) + +extern template class PairWrapper; +extern template class PairWrapper; +extern template class PairWrapper; +extern template class PairWrapper; +extern template class PairWrapper; +extern template class PairWrapper; +extern template class PairWrapper; +extern template class PairWrapper; +extern template class PairWrapper; +extern template class PairWrapper; + +extern template class MapIteratorWrapper; +extern template class MapIteratorWrapper; +extern template class MapIteratorWrapper; +extern template class MapIteratorWrapper; +extern template class MapIteratorWrapper; +extern template class MapIteratorWrapper; +extern template class MapIteratorWrapper; +extern template class MapIteratorWrapper; +extern template class MapIteratorWrapper; +extern template class MapIteratorWrapper; + +extern template class MapWrapper; +extern template class MapWrapper; +extern template class MapWrapper; +extern template class MapWrapper; +extern template class MapWrapper; +extern template class MapWrapper; +extern template class MapWrapper; +extern template class MapWrapper; +extern template class MapWrapper; +extern template class MapWrapper; + +#pragma warning(default : 4661) } @@ -199,16 +216,15 @@ BG_EXT template class BIOGEARS_API MapWrapper& to); + void Invalidate(); bool ProcessAction(const SEPatientAction& action, const PhysiologyEngine& engine); - bool ProcessAction(const CDM::PatientActionData& action, const PhysiologyEngine& engine); bool HasAcuteRespiratoryDistress() const; SEAcuteRespiratoryDistress* GetAcuteRespiratoryDistress() const; @@ -226,6 +242,12 @@ class BIOGEARS_API SEPatientActionCollection : public Loggable { SEAirwayObstruction* GetAirwayObstruction() const; void RemoveAirwayObstruction(); + bool HasAmputation() const; + const std::map& GetAmputations() const; + const MapWrapper GetAmputationWrapper() const; + void RemoveAmputation(const char* cmpt); + void RemoveAmputation(const std::string& cmpt); + bool HasApnea() const; SEApnea* GetApnea() const; void RemoveApnea(); @@ -265,6 +287,14 @@ class BIOGEARS_API SEPatientActionCollection : public Loggable { SEChestOcclusiveDressing* GetRightChestOcclusiveDressing() const; void RemoveRightChestOcclusiveDressing(); + bool HasChestTube() const; + bool HasLeftChestTube() const; + SEChestTube* GetLeftChestTube() const; + void RemoveLeftChestTube(); + bool HasRightChestTube() const; + SEChestTube* GetRightChestTube() const; + void RemoveRightChestTube(); + bool HasConsciousRespiration() const; SEConsciousRespiration* GetConsciousRespiration() const; void RemoveConsciousRespiration(); @@ -287,6 +317,11 @@ class BIOGEARS_API SEPatientActionCollection : public Loggable { SEExercise* GetExercise() const; void RemoveExercise(); + /// \todo reconfigure to handle multiple similar to hemorrhage + bool HasFracture() const; + SEFracture* GetFracture() const; + void RemoveFracture(); + bool HasHemorrhage() const; const std::map& GetHemorrhages() const; const MapWrapper GetHemorrhageWrapper() const; @@ -413,10 +448,13 @@ class BIOGEARS_API SEPatientActionCollection : public Loggable { SEChestCompression* m_ChestCompression; SEChestOcclusiveDressing* m_LeftChestOcclusiveDressing; SEChestOcclusiveDressing* m_RightChestOcclusiveDressing; + SEChestTube* m_LeftChestTube; + SEChestTube* m_RightChestTube; SEConsciousRespiration* m_ConsciousRespiration; SEConsumeNutrients* m_ConsumeNutrients; SEEbola* m_Ebola; SEExercise* m_Exercise; + SEFracture* m_Fracture; SEInfection* m_Infection; SEIntubation* m_Intubation; SEMechanicalVentilation* m_MechanicalVentilation; @@ -436,32 +474,17 @@ class BIOGEARS_API SEPatientActionCollection : public Loggable { std::map m_Hemorrhages; mutable std::map::const_iterator m_HemorrhageItr; - + std::map m_Amputations; std::map m_Tourniquets; - mutable std::map::const_iterator m_TourniquetsItr; - std::map m_Escharotomies; - mutable std::map::const_iterator m_EscharotomiesItr; - std::map m_PainStimuli; - mutable std::map::const_iterator m_PainStimuliItr; - std::map m_SubstanceBolus; - mutable std::map::const_iterator m_SubstanceBolusItr; - std::map m_SubstanceInfusions; - mutable std::map::const_iterator m_SubstanceInfusionsItr; - std::map m_SubstanceOralDoses; - mutable std::map::const_iterator m_SubstanceOralDosesItr; - std::map m_SubstanceNasalDoses; - mutable std::map::const_iterator m_SubstanceNasalDosesItr; - std::map m_SubstanceCompoundInfusions; - mutable std::map::const_iterator m_SubstanceCompoundInfusionsItr; - bool AdministerSubstance(const CDM::SubstanceAdministrationData& subAdmin); + bool AdministerSubstance(const SESubstanceAdministration& subAdmin); SESubstanceManager& m_Substances; std::stringstream m_ss; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEScenario.h b/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEScenario.h index c0b1e56eb..e4735f4f2 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEScenario.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEScenario.h @@ -19,10 +19,6 @@ specific language governing permissions and limitations under the License. #include #include -#include -#include -#include - namespace biogears { class SEDecimalFormat; @@ -40,20 +36,11 @@ class BIOGEARS_API SEScenario : public Loggable { virtual ~SEScenario(); - virtual void Clear(); // clear memory - - bool Load(const CDM::ScenarioData& in); - bool Load(const CDM::ActionListData& in); - - CDM::ScenarioData* Unload() const; + virtual void Invalidate(); // clear memory bool operator==(SEScenario const&) const; bool operator!=(SEScenario const&) const; -protected: - void Unload(CDM::ScenarioData& data) const; - void Unload(CDM::ActionListData& data) const; - public: bool Load(const char* scenarioFile); bool Load(const std::string& scenarioFile); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEScenarioAutoSerialization.h b/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEScenarioAutoSerialization.h index b31a0f6fd..8ef2674dc 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEScenarioAutoSerialization.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEScenarioAutoSerialization.h @@ -13,9 +13,8 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include -CDM_BIND_DECL(ScenarioAutoSerializationData) namespace biogears { namespace io { class Scenario; @@ -27,36 +26,30 @@ class BIOGEARS_API SEScenarioAutoSerialization : public Loggable { SEScenarioAutoSerialization(Logger* logger); virtual ~SEScenarioAutoSerialization(); - virtual void Clear(); + virtual void Invalidate(); virtual bool IsValid() const; - virtual bool Load(const CDM::ScenarioAutoSerializationData& in); - virtual CDM::ScenarioAutoSerializationData* Unload() const; - bool operator==(SEScenarioAutoSerialization const&) const; bool operator!=(SEScenarioAutoSerialization const&) const; -protected: - virtual void Unload(CDM::ScenarioAutoSerializationData& data) const; - public: virtual bool HasPeriod() const; virtual SEScalarTime& GetPeriod(); virtual double GetPeriod(const TimeUnit& unit) const; virtual bool HasPeriodTimeStamps() const; - virtual CDM::enumOnOff::value GetPeriodTimeStamps() const; - virtual void SetPeriodTimeStamps(CDM::enumOnOff::value v); + virtual SEOnOff GetPeriodTimeStamps() const; + virtual void SetPeriodTimeStamps(SEOnOff v); virtual void InvalidatePeriodTimeStamps(); virtual bool HasAfterActions() const; - virtual CDM::enumOnOff::value GetAfterActions() const; - virtual void SetAfterActions(CDM::enumOnOff::value v); + virtual SEOnOff GetAfterActions() const; + virtual void SetAfterActions(SEOnOff v); virtual void InvalidateAfterActions(); virtual bool HasReloadState() const; - virtual CDM::enumOnOff::value GetReloadState() const; - virtual void SetReloadState(CDM::enumOnOff::value v); + virtual SEOnOff GetReloadState() const; + virtual void SetReloadState(SEOnOff v); virtual void InvalidateReloadState(); virtual bool HasDirectory() const; @@ -73,9 +66,9 @@ class BIOGEARS_API SEScenarioAutoSerialization : public Loggable { protected: SEScalarTime* m_Period; - CDM::enumOnOff::value m_PeriodTimeStamps; - CDM::enumOnOff::value m_AfterActions; - CDM::enumOnOff::value m_ReloadState; + SEOnOff m_PeriodTimeStamps; + SEOnOff m_AfterActions; + SEOnOff m_ReloadState; std::string m_Directory; std::string m_FileName; }; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEScenarioExec.h b/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEScenarioExec.h index 330ab7ce2..3fba1f56e 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEScenarioExec.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEScenarioExec.h @@ -17,7 +17,6 @@ specific language governing permissions and limitations under the License. #include #include -CDM_BIND_DECL(ScenarioData) namespace biogears { diff --git a/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEScenarioInitialParameters.h b/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEScenarioInitialParameters.h index de0b92d6d..729c51966 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEScenarioInitialParameters.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/scenario/SEScenarioInitialParameters.h @@ -12,15 +12,12 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include -#include - #include #include #include #include +#include -CDM_BIND_DECL(ScenarioInitialParametersData) namespace biogears { @@ -41,14 +38,7 @@ class BIOGEARS_API SEScenarioInitialParameters : public Loggable { bool operator==(SEScenarioInitialParameters const&) const; bool operator!=(SEScenarioInitialParameters const&) const; -public: - virtual void Clear(); // clear memory - - bool Load(const CDM::ScenarioInitialParametersData& in); - CDM::ScenarioInitialParametersData* Unload() const; - -protected: - void Unload(CDM::ScenarioInitialParametersData& data) const; + virtual void Invalidate(); // clear memory public: virtual bool IsValid() const; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/scenario/SESerializeState.h b/projects/biogears/libBiogears/include/biogears/cdm/scenario/SESerializeState.h index a8c763a69..546940003 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/scenario/SESerializeState.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/scenario/SESerializeState.h @@ -14,15 +14,15 @@ specific language governing permissions and limitations under the License. #include #include -#include -#include +#include +#include namespace biogears { namespace io { - class Scenario; + class Actions; } class BIOGEARS_API SESerializeState : public SEAction { - friend io::Scenario; + friend io::Actions; public: SESerializeState(); @@ -31,24 +31,18 @@ class BIOGEARS_API SESerializeState : public SEAction { static constexpr const char* TypeTag() { return "SESerializeState"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; //clear memory + virtual void Invalidate() override; //clear memory virtual bool IsValid() const override; - virtual bool Load(const CDM::SerializeStateData& in, std::default_random_engine *rd = nullptr); - virtual CDM::SerializeStateData* Unload() const override; - bool operator==(SESerializeState const&) const; bool operator!=(SESerializeState const&) const; -protected: - virtual void Unload(CDM::SerializeStateData& data) const; - public: virtual void ToString(std::ostream& str) const override; - virtual CDM::enumSerializationType::value GetType() const; - virtual void SetType(CDM::enumSerializationType::value t); + virtual SESerializationType GetType() const; + virtual void SetType(SESerializationType t); virtual bool HasType() const; virtual void InvalidateType(); @@ -61,6 +55,6 @@ class BIOGEARS_API SESerializeState : public SEAction { protected: std::string m_Filename; - CDM::enumSerializationType::value m_Type; + SESerializationType m_Type; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SECompartmentDataRequest.h b/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SECompartmentDataRequest.h index 1788b9ed9..4412f5ff5 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SECompartmentDataRequest.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SECompartmentDataRequest.h @@ -12,28 +12,24 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class SESubstance; class SESubstanceManager; class SEDataRequestManager; namespace io { - class Scenario; + class DataRequests; } class BIOGEARS_API SECompartmentDataRequest : public SEDataRequest { friend class SEDataRequestManager; - friend io::Scenario; + friend io::DataRequests; public: SECompartmentDataRequest(const SEDecimalFormat* dfault = nullptr); virtual ~SECompartmentDataRequest(); - virtual void Clear() override; // clear memory - - virtual bool Load(const CDM::CompartmentDataRequestData& in); - virtual CDM::CompartmentDataRequestData* Unload() const override = 0; + virtual void Invalidate() override; // clear memory size_t HashCode() const override; @@ -52,8 +48,7 @@ class BIOGEARS_API SECompartmentDataRequest : public SEDataRequest { virtual void Set(const std::string& cmpt, const std::string& name, const CCompoundUnit& unit); protected: - virtual void Unload(CDM::CompartmentDataRequestData& data) const; - + std::string m_Compartment; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SECompartmentSubstanceDataRequest.h b/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SECompartmentSubstanceDataRequest.h index a5c1c35ab..acfba9046 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SECompartmentSubstanceDataRequest.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SECompartmentSubstanceDataRequest.h @@ -18,28 +18,23 @@ class SESubstance; class SESubstanceManager; class SEDataRequestManager; namespace io { - class Scenario; + class DataRequests; } class BIOGEARS_API SECompartmentSubstanceDataRequest : public SECompartmentDataRequest { friend class SEDataRequestManager; - friend io::Scenario; + friend io::DataRequests; public: SECompartmentSubstanceDataRequest(const SEDecimalFormat* dfault = nullptr); virtual ~SECompartmentSubstanceDataRequest() override; - virtual void Clear() override; // clear memory - - virtual bool Load(const CDM::CompartmentSubstanceDataRequestData& in, const SESubstanceManager& substances); - virtual CDM::CompartmentSubstanceDataRequestData* Unload() const override = 0; + virtual void Invalidate() override; // clear memory + bool operator==(SECompartmentSubstanceDataRequest const&) const; bool operator!=(SECompartmentSubstanceDataRequest const&) const; -protected: - virtual void Unload(CDM::CompartmentSubstanceDataRequestData& data) const; - public: virtual size_t HashCode() const override; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEDataRequest.h b/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEDataRequest.h index 3ec9a2c87..1be86a0b4 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEDataRequest.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEDataRequest.h @@ -15,35 +15,29 @@ specific language governing permissions and limitations under the License. #include #include -#include namespace biogears { class SESubstanceManager; class SEDecimalFormat; class SEDataRequestManager; namespace io { - class Scenario; + class DataRequests; } class BIOGEARS_API SEDataRequest : public SEDecimalFormat { friend class SEDataRequestManager; - friend io::Scenario; + friend io::DataRequests; public: SEDataRequest(const SEDecimalFormat* dfault = nullptr); virtual ~SEDataRequest() override; - virtual void Clear(); //clear memory - - virtual bool Load(const CDM::DataRequestData& in); - virtual CDM::DataRequestData* Unload() const; + virtual void Invalidate(); //clear memory + bool operator==(SEDataRequest const&) const; bool operator!=(SEDataRequest const&) const; -protected: - virtual void Unload(CDM::DataRequestData& data) const; - public: virtual size_t HashCode() const = 0; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEDataRequestManager.h b/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEDataRequestManager.h index edf731bf8..1facedfaa 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEDataRequestManager.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEDataRequestManager.h @@ -24,30 +24,23 @@ specific language governing permissions and limitations under the License. #include #include -CDM_BIND_DECL(DataRequestManagerData) namespace biogears { namespace io { - class Scenario; + class DataRequests; } class BIOGEARS_API SEDataRequestManager : public Loggable { - friend io::Scenario; + friend io::DataRequests; public: SEDataRequestManager(Logger* logger); ~SEDataRequestManager(); - void Clear(); - - bool Load(const CDM::DataRequestManagerData& in, SESubstanceManager& subMgr); - CDM::DataRequestManagerData* Unload() const; + void Invalidate(); bool operator==(SEDataRequestManager const&) const; bool operator!=(SEDataRequestManager const&) const; -protected: - void Unload(CDM::DataRequestManagerData& data) const; - public: bool HasResultsFilename() const; std::string GetResultsFilename() const; @@ -79,6 +72,9 @@ class BIOGEARS_API SEDataRequestManager : public Loggable { virtual SEDecimalFormat& GetOverrideDecimalFormatting(); virtual void RemoveOverrideDecimalFormatting(); + + void CreateDataRequest(std::unique_ptr request); + SEEnvironmentDataRequest& CreateEnvironmentDataRequest(const SEDecimalFormat* dfault = nullptr); SEEquipmentDataRequest& CreateEquipmentDataRequest(const SEDecimalFormat* dfault = nullptr); SEPatientDataRequest& CreatePatientDataRequest(const SEDecimalFormat* dfault = nullptr); @@ -90,8 +86,6 @@ class BIOGEARS_API SEDataRequestManager : public Loggable { SEThermalCompartmentDataRequest& CreateThermalCompartmentDataRequest(const SEDecimalFormat* dfault = nullptr); SETissueCompartmentDataRequest& CreateTissueCompartmentDataRequest(const SEDecimalFormat* dfault = nullptr); - void CreateFromBind(const CDM::DataRequestData& input, SESubstanceManager& subMgr); - protected: double m_SamplesPerSecond; std::vector m_Requests; @@ -102,6 +96,5 @@ class BIOGEARS_API SEDataRequestManager : public Loggable { SEDecimalFormat* m_OverrideDecimalFormatting; bool DuplicateRequest(SEDataRequest* request); - static SEDataRequest* newFromBind(const CDM::DataRequestData& dataRequest, SESubstanceManager& substances, const SEDecimalFormat* dfault = nullptr); }; } diff --git a/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEEnvironmentDataRequest.h b/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEEnvironmentDataRequest.h index 6e5d97a81..f8cad5dbd 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEEnvironmentDataRequest.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEEnvironmentDataRequest.h @@ -26,14 +26,9 @@ class BIOGEARS_API SEEnvironmentDataRequest : public SEDataRequest { SEEnvironmentDataRequest(const SEDecimalFormat* dfault = nullptr); virtual ~SEEnvironmentDataRequest(); - virtual void Clear() override; //clear memory + virtual void Invalidate() override; //clear memory size_t HashCode() const override; - virtual bool Load(const CDM::EnvironmentDataRequestData& in); - virtual CDM::EnvironmentDataRequestData* Unload() const override; - -protected: - virtual void Unload(CDM::EnvironmentDataRequestData& data) const; - + public: protected: }; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEEquipmentDataRequest.h b/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEEquipmentDataRequest.h index 8f92d99dd..a3bfeeb5e 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEEquipmentDataRequest.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEEquipmentDataRequest.h @@ -14,32 +14,26 @@ specific language governing permissions and limitations under the License. #include #include -#include namespace biogears { class SEDataRequestManager; namespace io { - class Scenario; + class DataRequests; } class BIOGEARS_API SEEquipmentDataRequest : public SEDataRequest { friend class SEDataRequestManager; - friend io::Scenario; + friend io::DataRequests; public: SEEquipmentDataRequest(const SEDecimalFormat* dfault = nullptr); virtual ~SEEquipmentDataRequest(); - virtual void Clear() override; //clear memory + virtual void Invalidate() override; //clear memory size_t HashCode() const override; - virtual bool Load(const CDM::EquipmentDataRequestData& in); - virtual CDM::EquipmentDataRequestData* Unload() const override; - + bool operator==(SEEquipmentDataRequest const&) const; bool operator!=(SEEquipmentDataRequest const&) const; -protected: - virtual void Unload(CDM::EquipmentDataRequestData& data) const; - public: virtual const char* GetType() const; virtual void SetType(const char* t); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEGasCompartmentDataRequest.h b/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEGasCompartmentDataRequest.h index 169b7a214..8564a2348 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEGasCompartmentDataRequest.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEGasCompartmentDataRequest.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class SESubstance; @@ -29,13 +28,8 @@ class BIOGEARS_API SEGasCompartmentDataRequest : public SECompartmentSubstanceDa SEGasCompartmentDataRequest(const SEDecimalFormat* dfault = nullptr); virtual ~SEGasCompartmentDataRequest(); - virtual bool Load(const CDM::GasCompartmentDataRequestData& in, const SESubstanceManager& substances); - virtual CDM::GasCompartmentDataRequestData* Unload() const; - bool operator==(SEGasCompartmentDataRequest const&) const; bool operator!=(SEGasCompartmentDataRequest const&) const; -protected: - virtual void Unload(CDM::GasCompartmentDataRequestData& data) const; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SELiquidCompartmentDataRequest.h b/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SELiquidCompartmentDataRequest.h index d4f4e064b..a3272869d 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SELiquidCompartmentDataRequest.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SELiquidCompartmentDataRequest.h @@ -27,14 +27,9 @@ class BIOGEARS_API SELiquidCompartmentDataRequest : public SECompartmentSubstanc public: SELiquidCompartmentDataRequest(const SEDecimalFormat* dfault = nullptr); virtual ~SELiquidCompartmentDataRequest(); - - virtual bool Load(const CDM::LiquidCompartmentDataRequestData& in, const SESubstanceManager& substances); - virtual CDM::LiquidCompartmentDataRequestData* Unload() const; - + bool operator==(SELiquidCompartmentDataRequest const&) const; bool operator!=(SELiquidCompartmentDataRequest const&) const; -protected: - virtual void Unload(CDM::LiquidCompartmentDataRequestData& data) const; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEPatientDataRequest.h b/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEPatientDataRequest.h index 6c876108a..1654066f7 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEPatientDataRequest.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEPatientDataRequest.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class SEDataRequestManager; @@ -28,15 +27,8 @@ class BIOGEARS_API SEPatientDataRequest : public SEDataRequest { SEPatientDataRequest(const SEDecimalFormat* dfault = nullptr); virtual ~SEPatientDataRequest(); - virtual void Clear() override; //clear memory + virtual void Invalidate() override; //clear memory size_t HashCode() const override; - virtual bool Load(const CDM::PatientDataRequestData& in); - virtual CDM::PatientDataRequestData* Unload() const override; - -protected: - virtual void Unload(CDM::PatientDataRequestData& data) const; - -public: -protected: + }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEPhysiologyDataRequest.h b/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEPhysiologyDataRequest.h index ea01769c9..c6c2ecbf3 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEPhysiologyDataRequest.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEPhysiologyDataRequest.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class SEDataRequestManager; @@ -27,14 +26,9 @@ class BIOGEARS_API SEPhysiologyDataRequest : public SEDataRequest { SEPhysiologyDataRequest(const SEDecimalFormat* dfault = nullptr); virtual ~SEPhysiologyDataRequest(); - virtual void Clear() override; //clear memory + virtual void Invalidate() override; //clear memory size_t HashCode() const override; - virtual bool Load(const CDM::PhysiologyDataRequestData& in); - virtual CDM::PhysiologyDataRequestData* Unload() const override; - -protected: - virtual void Unload(CDM::PhysiologyDataRequestData& data) const; - + public: protected: }; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SESubstanceDataRequest.h b/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SESubstanceDataRequest.h index 941a0e9e5..737ce7342 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SESubstanceDataRequest.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SESubstanceDataRequest.h @@ -12,32 +12,25 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class SESubstance; class SESubstanceManager; class SEDataRequestManager; namespace io { - class Scenario; + class DataRequests; } class BIOGEARS_API SESubstanceDataRequest : public SEDataRequest { friend class SEDataRequestManager; - friend io::Scenario; + friend io::DataRequests; public: SESubstanceDataRequest(const SEDecimalFormat* dfault = nullptr); virtual ~SESubstanceDataRequest(); - virtual void Clear() override; //clear memory - - virtual bool Load(const CDM::SubstanceDataRequestData& in, const SESubstanceManager& substances); - virtual CDM::SubstanceDataRequestData* Unload() const override; - -protected: - virtual void Unload(CDM::SubstanceDataRequestData& data) const; + virtual void Invalidate() override; //clear memory public: size_t HashCode() const override; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEThermalCompartmentDataRequest.h b/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEThermalCompartmentDataRequest.h index 8798a2300..7d35c97af 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEThermalCompartmentDataRequest.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SEThermalCompartmentDataRequest.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class SESubstance; @@ -29,13 +28,9 @@ class BIOGEARS_API SEThermalCompartmentDataRequest : public SECompartmentDataReq public: SEThermalCompartmentDataRequest(const SEDecimalFormat* dfault = nullptr); virtual ~SEThermalCompartmentDataRequest(); - virtual bool Load(const CDM::ThermalCompartmentDataRequestData& in); - virtual CDM::ThermalCompartmentDataRequestData* Unload() const; bool operator==(SEThermalCompartmentDataRequest const&) const; bool operator!=(SEThermalCompartmentDataRequest const&) const; -protected: - virtual void Unload(CDM::ThermalCompartmentDataRequestData& data) const; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SETissueCompartmentDataRequest.h b/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SETissueCompartmentDataRequest.h index ef8a30640..597bdb5db 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SETissueCompartmentDataRequest.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/scenario/requests/SETissueCompartmentDataRequest.h @@ -30,16 +30,11 @@ class BIOGEARS_API SETissueCompartmentDataRequest : public SECompartmentDataRequ SETissueCompartmentDataRequest(const SEDecimalFormat* dfault = nullptr); virtual ~SETissueCompartmentDataRequest(); - virtual void Clear(); //clear memory - virtual bool Load(const CDM::TissueCompartmentDataRequestData& in); - virtual CDM::TissueCompartmentDataRequestData* Unload() const; - + virtual void Invalidate(); //clear memory + bool operator==(SETissueCompartmentDataRequest const&) const; bool operator!=(SETissueCompartmentDataRequest const&) const; -protected: - virtual void Unload(CDM::TissueCompartmentDataRequestData& data) const; - public: virtual size_t HashCode(); }; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstance.h b/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstance.h index 58c5d1c58..ebd6766d2 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstance.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstance.h @@ -14,57 +14,164 @@ specific language governing permissions and limitations under the License. #include #include -#include - +#include #include #include #include #include +#include #include -CDM_BIND_DECL(SubstanceData) - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace biogears { -class SEScalarAmountPerVolume; -class AmountPerVolumeUnit; -class SEScalarMass; -class MassUnit; -class SEScalarMassPerAmount; -class MassPerAmountUnit; -class SEScalarVolumePerTimePressure; -class VolumePerTimePressureUnit; -class SEScalarInversePressure; -class InversePressureUnit; -class SEScalarMassPerAreaTime; -class MassPerAreaTimeUnit; -class SESubstancePharmacodynamics; -class SEScalarElectricResistance; -class ElectricResistanceUnit; -class SEScalarVolumePerTime; -class VolumePerTimeUnit; -class SEScalarPressure; -class PressureUnit; -class SEScalarTimeMassPerVolume; -class TimeMassPerVolumeUnit; +class SESubstanceManager; namespace io { class Substance; +} // namespace io + +class BIOGEARS_API SESubstanceDefinition { +public: + SESubstanceDefinition(SESubstanceDefinition const& obj); + SESubstanceDefinition(SESubstanceDefinition&& obj); + ~SESubstanceDefinition(); + SESubstanceDefinition(Logger* logger = nullptr); + + SESubstanceDefinition(SESubstanceClearanceDefinition definition, Logger* logger = nullptr); + + SESubstanceDefinition& operator=(SESubstanceDefinition const& rhs); + SESubstanceDefinition& operator=(SESubstanceDefinition&& rhs); + bool operator==(SESubstanceDefinition const& rhs) const; + bool operator!=(SESubstanceDefinition const& rhs) const; + + std::string Name; + SESubstanceClass Classification = SESubstanceClass::Invalid; + SESubstanceState State = SESubstanceState::Invalid; + + SEScalarMassPerVolume Density; + SEScalarMassPerAmount MolarMass; + SEScalarMassPerAreaTime MaximumDiffusionFlux; + SEScalar MichaelisCoefficient; + SEScalarElectricResistance MembraneResistance; + SEScalarTimeMassPerVolume AreaUnderCurve; + SEScalarVolumePerTime AlveolarTransfer; + SEScalarVolumePerTimePressure DiffusingCapacity; + SEScalar RelativeDiffusionCoefficient; + SEScalarInversePressure SolubilityCoefficient; + + SESubstanceClearanceDefinition ClearanceDefinition; + SESubstanceAerosolization Aerosolization; + SESubstancePharmacokinetics Pharmacokinetics; + SESubstancePharmacodynamics Pharmacodynamics; +}; + +inline namespace StandardSubstances { + static constexpr char const* const Acetaminophen = "Acetaminophen"; + static constexpr char const* const Acetoacetate = "Acetoacetate"; + static constexpr char const* const Albumin = "Albumin"; + static constexpr char const* const Albuminar_25 = "Albuminar_25"; + static constexpr char const* const Albuminex_4PCT = "Albuminex_4PCT"; + static constexpr char const* const Albuminex_5PCT = "Albuminex_5PCT"; + static constexpr char const* const Albuterol = "Albuterol"; + static constexpr char const* const AminoAcids = "AminoAcids"; + static constexpr char const* const Antigen_A = "Antigen_A"; + static constexpr char const* const Antigen_B = "Antigen_B"; + static constexpr char const* const Atropine = "Atropine"; + static constexpr char const* const Bicarbonate = "Bicarbonate"; + static constexpr char const* const Blood_ABNegative = "Blood_ABNegative"; + static constexpr char const* const Blood_ABPositive = "Blood_ABPositive"; + static constexpr char const* const Blood_ANegative = "Blood_ANegative"; + static constexpr char const* const Blood_APositive = "Blood_APositive"; + static constexpr char const* const Blood_BNegative = "Blood_BNegative"; + static constexpr char const* const Blood_BPositive = "Blood_BPositive"; + static constexpr char const* const Blood_ONegative = "Blood_ONegative"; + static constexpr char const* const Blood_OPositive = "Blood_OPositive"; + static constexpr char const* const Caffeine = "Caffeine"; + static constexpr char const* const Calcium = "Calcium"; + static constexpr char const* const Carbaminohemoglobin = "Carbaminohemoglobin"; + static constexpr char const* const CarbonDioxide = "CarbonDioxide"; + static constexpr char const* const CarbonMonoxide = "CarbonMonoxide"; + static constexpr char const* const Carboxyhemoglobin = "Carboxyhemoglobin"; + static constexpr char const* const Chloride = "Chloride"; + static constexpr char const* const Creatinine = "Creatinine"; + static constexpr char const* const Desflurane = "Desflurane"; + static constexpr char const* const Epinephrine = "Epinephrine"; + static constexpr char const* const Ertapenem = "Ertapenem"; + static constexpr char const* const Etomidate = "Etomidate"; + static constexpr char const* const Fentanyl = "Fentanyl"; + static constexpr char const* const ForestFireParticulate = "ForestFireParticulate"; + static constexpr char const* const Furosemide = "Furosemide"; + static constexpr char const* const Globulin = "Globulin"; + static constexpr char const* const Glucagon = "Glucagon"; + static constexpr char const* const Glucose = "Glucose"; + static constexpr char const* const Hemoglobin = "Hemoglobin"; + static constexpr char const* const Insulin = "Insulin"; + static constexpr char const* const Ketamine = "Ketamine"; + static constexpr char const* const Ketones = "Ketones"; + static constexpr char const* const Lactate = "Lactate"; + static constexpr char const* const Magnesium = "Magnesium"; + static constexpr char const* const Midazolam = "Midazolam"; + static constexpr char const* const Morphine = "Morphine"; + static constexpr char const* const Moxifloxacin = "Moxifloxacin"; + static constexpr char const* const Naloxone = "Naloxone"; + static constexpr char const* const Nitrogen = "Nitrogen"; + static constexpr char const* const Norepinephrine = "Norepinephrine"; + static constexpr char const* const Ondansetron = "Ondansetron"; + static constexpr char const* const OxyCarbaminohemoglobin = "OxyCarbaminohemoglobin"; + static constexpr char const* const Oxygen = "Oxygen"; + static constexpr char const* const Oxyhemoglobin = "Oxyhemoglobin"; + static constexpr char const* const Piperacillin = "Piperacillin"; + static constexpr char const* const PiperacillinTazobactam = "PiperacillinTazobactam"; + static constexpr char const* const PlamsaLyteA = "PlamsaLyteA"; + static constexpr char const* const Plasma = "Plasma"; + static constexpr char const* const PlasmaLyteA = "PlasmaLyteA"; + static constexpr char const* const Platelet = "Platelet"; + static constexpr char const* const Potassium = "Potassium"; + static constexpr char const* const Pralidoxime = "Pralidoxime"; + static constexpr char const* const Prednisone = "Prednisone"; + static constexpr char const* const Propofol = "Propofol"; + static constexpr char const* const RedBloodCell = "RedBloodCell"; + static constexpr char const* const RingersLactate = "RingersLactate"; + static constexpr char const* const Rocuronium = "Rocuronium"; + static constexpr char const* const Saline = "Saline"; + static constexpr char const* const SalineSlowDrip = "SalineSlowDrip"; + static constexpr char const* const Sarin = "Sarin"; + static constexpr char const* const Sodium = "Sodium"; + static constexpr char const* const Succinylcholine = "Succinylcholine"; + static constexpr char const* const Tazobactam = "Tazobactam"; + static constexpr char const* const TranexamicAcid = "TranexamicAcid"; + static constexpr char const* const Triacylglycerol = "Triacylglycerol"; + static constexpr char const* const Tristearin = "Tristearin"; + static constexpr char const* const Urea = "Urea"; + static constexpr char const* const Vasopressin = "Vasopressin"; + static constexpr char const* const WhiteBloodCell = "WhiteBloodCell"; } + class BIOGEARS_API SESubstance : public Loggable { friend io::Substance; + friend SESubstanceManager; public: SESubstance(Logger* logger); + SESubstance(SESubstanceDefinition definition); virtual ~SESubstance(); - virtual void Clear(); + virtual void Invalidate(); virtual const SEScalar* GetScalar(const char* name); virtual const SEScalar* GetScalar(const std::string& name); - virtual bool Load(const CDM::SubstanceData& in); - virtual CDM::SubstanceData* Unload() const; - virtual std::string GetName() const; virtual const char* GetName_cStr() const; virtual void SetName(const char* name); @@ -72,13 +179,13 @@ class BIOGEARS_API SESubstance : public Loggable { virtual bool HasName() const; virtual void InvalidateName(); - virtual CDM::enumSubstanceState::value GetState() const; - virtual void SetState(CDM::enumSubstanceState::value state); + virtual SESubstanceState GetState() const; + virtual void SetState(SESubstanceState state); virtual bool HasState() const; virtual void InvalidateState(); - virtual CDM::enumSubstanceClass::value GetClassification() const; - virtual void SetClassification(CDM::enumSubstanceClass::value subClass); + virtual SESubstanceClass GetClassification() const; + virtual void SetClassification(SESubstanceClass subClass); virtual bool HasClassification() const; virtual void InvalidateClassification(); @@ -188,44 +295,44 @@ class BIOGEARS_API SESubstance : public Loggable { bool operator==(const SESubstance& rhs) const; bool operator!=(const SESubstance& rhs) const; -protected: - virtual void Unload(CDM::SubstanceData& data) const; - -protected: - std::string m_Name; - CDM::enumSubstanceClass::value m_Classification; - CDM::enumSubstanceState::value m_State; - SEScalarMassPerVolume* m_Density; - SEScalarMassPerAmount* m_MolarMass; - - SEScalarMassPerAreaTime* m_MaximumDiffusionFlux; - SEScalar* m_MichaelisCoefficient; - SEScalarElectricResistance* m_MembraneResistance; - - SESubstanceAerosolization* m_Aerosolization; - SEScalarTimeMassPerVolume* m_AreaUnderCurve; - SEScalarMassPerVolume* m_BloodConcentration; - SEScalarMassPerVolume* m_EffectSiteConcentration; - SEScalarMass* m_MassInBody; - SEScalarMass* m_MassInBlood; - SEScalarMass* m_MassInTissue; - SEScalarMassPerVolume* m_PlasmaConcentration; - SEScalarMass* m_SystemicMassCleared; - SEScalarMassPerVolume* m_TissueConcentration; - - SEScalarVolumePerTime* m_AlveolarTransfer; - SEScalarVolumePerTimePressure* m_DiffusingCapacity; - SEScalarFraction* m_EndTidalFraction; - SEScalarPressure* m_EndTidalPressure; - SEScalar* m_RelativeDiffusionCoefficient; - SEScalarInversePressure* m_SolubilityCoefficient; - - SESubstanceClearance* m_Clearance; - SESubstancePharmacokinetics* m_Pharmacokinetics; - SESubstancePharmacodynamics* m_Pharmacodynamics; + bool operator==(const SESubstanceDefinition& rhs) const; + bool operator!=(const SESubstanceDefinition& rhs) const; + + SESubstanceDefinition const& GetDefinition() const; + +private: + SESubstanceDefinition m_def; + + SESubstanceClearance m_Clearance; + + SEScalarMassPerVolume m_BloodConcentration; + SEScalarMassPerVolume m_EffectSiteConcentration; + SEScalarMass m_MassInBody; + SEScalarMass m_MassInBlood; + SEScalarMass m_MassInTissue; + SEScalarMassPerVolume m_PlasmaConcentration; + SEScalarMass m_SystemicMassCleared; + SEScalarMassPerVolume m_TissueConcentration; + + SEScalarFraction m_EndTidalFraction; + SEScalarPressure m_EndTidalPressure; }; -} //namespace biogears + +inline bool operator==(const SESubstanceDefinition& lhs, const SESubstance& rhs) +{ + return rhs == lhs; +} + +inline bool operator!=(const SESubstanceDefinition& lhs, const SESubstance& rhs) +{ + return rhs == lhs; +} + +} // namespace biogears +#pragma warning(disable : 4661) namespace std { -BG_EXT template class BIOGEARS_API vector; -} \ No newline at end of file +extern template class vector; +} // namespace std + +#pragma warning(default : 4661) diff --git a/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceAerosolization.h b/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceAerosolization.h index 65ddf942e..468cd3716 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceAerosolization.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceAerosolization.h @@ -13,7 +13,10 @@ specific language governing permissions and limitations under the License. #pragma once #include #include -#include + +#include +#include +#include namespace biogears { class SEScalar; @@ -25,21 +28,20 @@ namespace io { } class BIOGEARS_API SESubstanceAerosolization : public Loggable { friend io::Substance; + public: - SESubstanceAerosolization(Logger* logger); + SESubstanceAerosolization(SESubstanceAerosolization const& obj); + SESubstanceAerosolization(Logger* logger = nullptr); virtual ~SESubstanceAerosolization(); - virtual void Clear(); + virtual void Invalidate(); virtual bool IsValid() const; virtual const SEScalar* GetScalar(const char* name); virtual const SEScalar* GetScalar(const std::string& name); - virtual bool Load(const CDM::SubstanceAerosolizationData& in); - virtual CDM::SubstanceAerosolizationData* Unload() const; - - bool operator==( const SESubstanceAerosolization& rhs) const; - bool operator!=( const SESubstanceAerosolization& rhs) const; + bool operator==(const SESubstanceAerosolization& rhs) const; + bool operator!=(const SESubstanceAerosolization& rhs) const; public: virtual bool HasBronchioleModifier() const; @@ -52,15 +54,11 @@ class BIOGEARS_API SESubstanceAerosolization : public Loggable { virtual bool HasParticulateSizeDistribution() const; virtual SEHistogramFractionVsLength& GetParticulateSizeDistribution(); - virtual const SEHistogramFractionVsLength* GetParticulateSizeDistribution() const; - -protected: - virtual void Unload(CDM::SubstanceAerosolizationData& data) const; - + virtual const SEHistogramFractionVsLength GetParticulateSizeDistribution() const; protected: - SEScalarNeg1To1* m_BronchioleModifier; - SEScalar0To1* m_InflammationCoefficient; - SEHistogramFractionVsLength* m_ParticulateSizeDistribution; + SEScalarNeg1To1 m_BronchioleModifier; + SEScalar0To1 m_InflammationCoefficient; + SEHistogramFractionVsLength m_ParticulateSizeDistribution; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceClearance.h b/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceClearance.h index 449b47214..7349bc67f 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceClearance.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceClearance.h @@ -11,54 +11,79 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once +#include + #include #include -#include "biogears/cdm/properties/SEScalarFrequency.h" -#include +#include -CDM_BIND_DECL(SubstanceClearanceData) +#include +#include +#include +#include +#include namespace biogears { -class SEScalar; -class SEScalarVolumePerTimeMass; -class VolumePerTimeMassUnit; -class MassPerTimeUnit; -class SEScalarMassPerTime; -class SESubstanceClearanceAnatomyEffect; -class SEScalarVolumePerTimeMass; -class SEScalarFraction; namespace io { class Substance; } -enum class RenalDynamic { - Clearance, - Regulation + +struct BIOGEARS_API SESubstanceClearanceDefinition { + SESubstanceClearanceDefinition(SESubstanceClearanceDefinition const&) = default; + SESubstanceClearanceDefinition(SESubstanceClearanceDefinition&&) = default; + SESubstanceClearanceDefinition() = default; + + SESubstanceClearanceDefinition& operator=(SESubstanceClearanceDefinition const& rhs) = default; + SESubstanceClearanceDefinition& operator=(SESubstanceClearanceDefinition&& rhs) = default; + + bool HasSystemic = false; + bool HasCellular = false; + SEScalarFrequency CellBirthRate; + SEScalarFrequency CellDeathRate; + + SECharge ChargeInBlood = SECharge::Invalid; + + SEScalarVolumePerTimeMass IntrinsicClearance; + RenalDynamicsType RenalDynamic = RenalDynamicsType::Invalid; + SEScalarVolumePerTimeMass RenalClearance; + SEScalar RenalReabsorptionRatio; + SEScalarMassPerTime RenalTransportMaximum; + SEScalarMassPerTime RenalFiltrationRate; + SEScalarMassPerTime RenalReabsorptionRate; + SEScalarMassPerTime RenalExcretionRate; + SEScalar GlomerularFilterability; + SEScalarVolumePerTimeMass SystemicClearance; + + bool operator==(SESubstanceClearanceDefinition const& rhs) const; + bool operator!=(SESubstanceClearanceDefinition const& rhs) const; }; class BIOGEARS_API SESubstanceClearance : public Loggable { friend io::Substance; public: - SESubstanceClearance(Logger* logger); + SESubstanceClearance(Logger* logger = nullptr); + SESubstanceClearance(SESubstanceClearanceDefinition definition, Logger* logger); + SESubstanceClearance(SESubstanceClearance const& obj); + SESubstanceClearance(SESubstanceClearance&& obj); virtual ~SESubstanceClearance(); - virtual void Clear(); + SESubstanceClearance& operator=(SESubstanceClearance const& rhs); + SESubstanceClearance& operator=(SESubstanceClearance&& rhs); + + virtual void Invalidate(); virtual bool IsValid() const; virtual const SEScalar* GetScalar(const char* name); virtual const SEScalar* GetScalar(const std::string& name); - virtual bool Load(const CDM::SubstanceClearanceData& in); - virtual CDM::SubstanceClearanceData* Unload() const; - public: - virtual bool HasSystemic() const { return m_hasSystemic; } - virtual void SetSystemic(bool b) { m_hasSystemic = b; } - - virtual bool HasCellular() const { return m_hasCellular; } - virtual void SetCellular(bool b) { m_hasCellular = b; } + virtual bool HasSystemic() const; + virtual void SetSystemic(bool b); + virtual bool HasCellular() const; + virtual void SetCellular(bool b); virtual bool HasCellBirthRate() const; virtual SEScalarFrequency& GetCellBirthRate(); @@ -68,8 +93,8 @@ class BIOGEARS_API SESubstanceClearance : public Loggable { virtual SEScalarFrequency& GetCellDeathRate(); virtual double GetCellDeathRate(const FrequencyUnit& unit) const; - virtual CDM::enumCharge::value GetChargeInBlood() const; - virtual void SetChargeInBlood(CDM::enumCharge::value type); + virtual SECharge GetChargeInBlood() const; + virtual void SetChargeInBlood(SECharge type); virtual bool HasChargeInBlood() const; virtual void InvalidateChargeInBlood(); @@ -97,8 +122,8 @@ class BIOGEARS_API SESubstanceClearance : public Loggable { virtual SEScalarVolumePerTimeMass& GetIntrinsicClearance(); virtual double GetIntrinsicClearance(const VolumePerTimeMassUnit& unit) const; - virtual RenalDynamic GetRenalDynamic() const; - virtual void SetRenalDynamic(RenalDynamic d); + virtual RenalDynamicsType GetRenalDynamic() const; + virtual void SetRenalDynamic(RenalDynamicsType d); virtual bool HasRenalDynamic() const; virtual void InvalidateRenalDynamic(); @@ -134,28 +159,11 @@ class BIOGEARS_API SESubstanceClearance : public Loggable { bool operator!=(const SESubstanceClearance& rhs) const; protected: - virtual void Unload(CDM::SubstanceClearanceData& data) const; + SESubstanceClearanceDefinition m_def; -protected: - bool m_hasSystemic; - bool m_hasCellular; - SEScalarFrequency* m_CellBirthRate; - SEScalarFrequency* m_CellDeathRate; - - CDM::enumCharge::value m_ChargeInBlood; - SEScalarFraction* m_FractionExcretedInFeces; - SEScalarFraction* m_FractionExcretedInUrine; - SEScalarFraction* m_FractionMetabolizedInGut; - SEScalarFraction* m_FractionUnboundInPlasma; - SEScalarVolumePerTimeMass* m_IntrinsicClearance; - RenalDynamic m_RenalDynamic; - SEScalarVolumePerTimeMass* m_RenalClearance; - SEScalar* m_RenalReabsorptionRatio; - SEScalarMassPerTime* m_RenalTransportMaximum; - SEScalarMassPerTime* m_RenalFiltrationRate; - SEScalarMassPerTime* m_RenalReabsorptionRate; - SEScalarMassPerTime* m_RenalExcretionRate; - SEScalar* m_GlomerularFilterability; - SEScalarVolumePerTimeMass* m_SystemicClearance; + SEScalarFraction m_FractionExcretedInFeces; + SEScalarFraction m_FractionExcretedInUrine; + SEScalarFraction m_FractionMetabolizedInGut; + SEScalarFraction m_FractionUnboundInPlasma; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceCompound.h b/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceCompound.h index 70601a2a1..9f127dca9 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceCompound.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceCompound.h @@ -15,9 +15,10 @@ specific language governing permissions and limitations under the License. #include #include -#include #include -#include + +#include +#include namespace biogears { class SESubstance; @@ -25,20 +26,18 @@ class SESubstanceManager; namespace io { class Substance; } + class BIOGEARS_API SESubstanceCompound : public Loggable { friend io::Substance; public: explicit SESubstanceCompound(const std::string& name, Logger* logger); explicit SESubstanceCompound(const char* name, Logger* logger); - SESubstanceCompound(Logger* logger); + SESubstanceCompound(Logger* logger = nullptr); virtual ~SESubstanceCompound(); static std::unique_ptr make_unique(const std::string& name, Logger* logger); - virtual void Clear(); - - virtual bool Load(const CDM::SubstanceCompoundData& in, const SESubstanceManager& subMgr); - virtual CDM::SubstanceCompoundData* Unload() const; + virtual void Invalidate(); public: virtual std::string GetName() const; @@ -48,8 +47,8 @@ class BIOGEARS_API SESubstanceCompound : public Loggable { virtual bool HasName() const; virtual void InvalidateName(); - virtual CDM::enumSubstanceClass::value GetClassification() const; - virtual void SetClassification(CDM::enumSubstanceClass::value subClass); + virtual SESubstanceClass GetClassification() const; + virtual void SetClassification(SESubstanceClass subClass); virtual bool HasClassification() const; virtual void InvalidateClassification(); virtual bool GetRhFactor() const; @@ -60,19 +59,20 @@ class BIOGEARS_API SESubstanceCompound : public Loggable { bool HasComponent(const SESubstance& substance) const; std::vector& GetComponents(); const std::vector GetComponents() const; - SESubstanceConcentration& GetComponent(SESubstance& substance); - const SESubstanceConcentration GetComponent(SESubstance& substance) const; + SESubstanceConcentration& GetComponent(SESubstance const& substance); + SESubstanceConcentration GetComponent(SESubstance const& substance) const; + + SESubstanceConcentration& GetComponent(SESubstanceDefinition const& substance); + SESubstanceConcentration GetComponent(SESubstanceDefinition const& substance) const; + void RemoveComponent(const SESubstance& substance); - - bool operator==( const SESubstanceCompound& rhs) const; - bool operator!=( const SESubstanceCompound& rhs) const; -protected: - virtual void Unload(CDM::SubstanceCompoundData& data) const; + bool operator==(const SESubstanceCompound& rhs) const; + bool operator!=(const SESubstanceCompound& rhs) const; protected: std::string m_Name; - CDM::enumSubstanceClass::value m_Classification; + SESubstanceClass m_Classification; bool m_RhFactor; std::vector m_Components; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceConcentration.h b/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceConcentration.h index dcc68b659..d6ee9e63a 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceConcentration.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceConcentration.h @@ -12,10 +12,12 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include #include -CDM_BIND_DECL(SubstanceConcentrationData) +#include +#include +#include + namespace biogears { class SESubstance; @@ -30,32 +32,27 @@ class BIOGEARS_API SESubstanceConcentration : public Loggable { protected: friend SEEnvironmentalConditions; // So it can add substances to the manager public: - SESubstanceConcentration(SESubstance const& substance); - SESubstanceConcentration(SESubstance const& substance, SEScalarMassPerVolume const& concentration); - SESubstanceConcentration(SESubstance const& substance, double concentration, const MassPerVolumeUnit& unit); + SESubstanceConcentration(SESubstanceDefinition substance); + SESubstanceConcentration(SESubstanceDefinition substance, SEScalarMassPerVolume const& concentration); + SESubstanceConcentration(SESubstanceDefinition substance, double concentration, const MassPerVolumeUnit& unit); virtual ~SESubstanceConcentration(); - virtual void Clear(); - - virtual bool Load(const CDM::SubstanceConcentrationData& in); - virtual CDM::SubstanceConcentrationData* Unload() const; - -protected: - virtual void Unload(CDM::SubstanceConcentrationData& data) const; + virtual void Invalidate(); public: virtual bool HasConcentration() const; + virtual SEScalarMassPerVolume GetConcentration() const; virtual SEScalarMassPerVolume& GetConcentration(); virtual double GetConcentration(const MassPerVolumeUnit& unit) const; - virtual SESubstance& GetSubstance() const; + virtual SESubstanceDefinition const& GetSubstance() const; bool operator==(const SESubstanceConcentration& rhs) const; bool operator!=(const SESubstanceConcentration& rhs) const; SESubstanceConcentration& operator=(SESubstanceConcentration const& rhs); protected: - SESubstance const* m_Substance; + SESubstanceDefinition m_Substance; SEScalarMassPerVolume m_Concentration; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceFraction.h b/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceFraction.h index d8e0cc1f3..5c3e56721 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceFraction.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceFraction.h @@ -12,10 +12,10 @@ specific language governing permissions and limitations under the License.. #pragma once #include -#include + #include -CDM_BIND_DECL(SubstanceFractionData) +#include namespace biogears { class SESubstance; @@ -35,10 +35,7 @@ class BIOGEARS_API SESubstanceFraction : public Loggable { SESubstanceFraction(SESubstance const&, SEScalarFraction const& ); virtual ~SESubstanceFraction(); - virtual void Clear(); - - virtual bool Load(const CDM::SubstanceFractionData& in); - virtual CDM::SubstanceFractionData* Unload() const; + virtual void Invalidate(); virtual bool HasFractionAmount() const; virtual SEScalarFraction& GetFractionAmount(); @@ -49,9 +46,6 @@ class BIOGEARS_API SESubstanceFraction : public Loggable { bool operator==( const SESubstanceFraction& rhs) const; bool operator!=( const SESubstanceFraction& rhs) const; -protected: - virtual void Unload(CDM::SubstanceFractionData& data) const; - protected: SESubstance const& m_Substance; SEScalarFraction* m_FractionAmount; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceManager.h b/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceManager.h index 834f10b02..20adcdd43 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceManager.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceManager.h @@ -14,24 +14,26 @@ specific language governing permissions and limitations under the License. #include #include +#include #include #include -#include +#include +#include -CDM_BIND_DECL(SubstanceData); -CDM_BIND_DECL(SubstanceCompoundData); +#include namespace biogears { namespace io { class Scenario; } } // namespace biogears - +#pragma warning(disable : 4661) namespace std { -BG_EXT template class BIOGEARS_API map; -BG_EXT template class BIOGEARS_API map; +extern template class map; +extern template class map; } +#pragma warning(default : 4661) namespace biogears { class BIOGEARS_API SESubstanceManager : public Loggable { @@ -41,25 +43,28 @@ class BIOGEARS_API SESubstanceManager : public Loggable { SESubstanceManager(Logger* logger); virtual ~SESubstanceManager(); - virtual void Clear(); + virtual void Invalidate(); virtual void Reset(); virtual bool LoadSubstanceDirectory(); virtual const std::vector& GetSubstances() const; virtual SESubstance* GetSubstance(const char* name) const; virtual SESubstance* GetSubstance(const std::string& name) const; + virtual SESubstance* GetSubstance(const SESubstanceDefinition& definition) const; virtual void AddSubstance(SESubstance& substance); + virtual SESubstance* AddSubstance(SESubstanceDefinition const& substance); virtual bool IsActive(const SESubstance& substance) const; - virtual const std::vector& GetActiveSubstances() const; + virtual const std::unordered_set& GetActiveSubstances() const; virtual void AddActiveSubstance(SESubstance& substance); + virtual SESubstance* AddActiveSubstance(SESubstanceDefinition const& substance); virtual void RemoveActiveSubstance(const SESubstance& substance); - virtual void RemoveActiveSubstances(const std::vector& substances); + virtual void RemoveActiveSubstances(const std::unordered_set& substances); virtual void RemoveActiveSubstances(); - virtual const std::vector& GetActiveGases() const; - virtual const std::vector& GetActiveLiquids() const; - virtual const std::vector& GetActiveDrugs() const; + virtual const std::unordered_set& GetActiveGases() const; + virtual const std::unordered_set& GetActiveLiquids() const; + virtual const std::unordered_set& GetActiveDrugs() const; virtual const std::vector& GetCompounds() const; virtual SESubstanceCompound* GetCompound(const char* name) const; @@ -67,10 +72,10 @@ class BIOGEARS_API SESubstanceManager : public Loggable { virtual void AddCompound(SESubstanceCompound& compound); virtual bool IsActive(const SESubstanceCompound& compound) const; - virtual const std::vector& GetActiveCompounds() const; + virtual const std::unordered_set& GetActiveCompounds() const; virtual void AddActiveCompound(SESubstanceCompound& compound); virtual void RemoveActiveCompound(SESubstanceCompound& compound); - virtual void RemoveActiveCompounds(const std::vector& compounds); + virtual void RemoveActiveCompounds(const std::unordered_set& compounds); virtual SESubstance* ReadSubstanceFile(const char* xmlFile); virtual SESubstance* ReadSubstanceFile(const std::string& xmlFile); @@ -80,16 +85,17 @@ class BIOGEARS_API SESubstanceManager : public Loggable { protected: std::vector m_Substances; - std::vector m_ActiveSubstances; - std::vector m_ActiveGases; - std::vector m_ActiveLiquids; - std::vector m_ActiveDrugs; - std::vector m_Compounds; - std::vector m_ActiveCompounds; + + std::unordered_set m_ActiveSubstances; + std::unordered_set m_ActiveGases; + std::unordered_set m_ActiveLiquids; + std::unordered_set m_ActiveDrugs; + + std::unordered_set m_ActiveCompounds; private: - std::map m_OriginalSubstanceData; - std::map m_OriginalCompoundData; + std::unordered_map m_OriginalSubstanceData; + std::unordered_map m_OriginalCompoundData; }; } diff --git a/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstancePharmacodynamics.h b/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstancePharmacodynamics.h index 8452d09d7..530ef8cfb 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstancePharmacodynamics.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstancePharmacodynamics.h @@ -13,47 +13,47 @@ specific language governing permissions and limitations under the License. #pragma once #include #include -#include +#include #include - -CDM_BIND_DECL(SubstancePharmacodynamicsData) -CDM_BIND_DECL(PharmacodynamicModifierData) +#include +#include namespace biogears { -class SEScalarFrequency; -class FrequencyUnit; -class SEScalarMassPerVolume; -class MassPerVolumeUnit; class SEScalarFraction; class SEPharmacodynamicModifier; namespace io { class Substance; } -} //namespace biogears +} // namespace biogears +#pragma warning(disable : 4661) namespace std { - BG_EXT template class BIOGEARS_API map; +extern template class map; } +#pragma warning(default : 4661) namespace biogears { class BIOGEARS_API SESubstancePharmacodynamics : public Loggable { friend io::Substance; public: - SESubstancePharmacodynamics(Logger* logger); + SESubstancePharmacodynamics(SESubstancePharmacodynamics const& obj); + SESubstancePharmacodynamics(SESubstancePharmacodynamics&& obj); + SESubstancePharmacodynamics(Logger* logger = nullptr); + + SESubstancePharmacodynamics& operator=(SESubstancePharmacodynamics const& rhs); + SESubstancePharmacodynamics& operator=(SESubstancePharmacodynamics&& rhs); + virtual ~SESubstancePharmacodynamics(); - virtual void Clear(); + virtual void Invalidate(); virtual bool IsValid() const; virtual const SEScalar* GetScalar(const char* name); virtual const SEScalar* GetScalar(const std::string& name); - virtual bool Load(const CDM::SubstancePharmacodynamicsData& in); - virtual CDM::SubstancePharmacodynamicsData* Unload() const; - public: virtual bool HasAntibacterialEffect() const; virtual SEScalarFrequency& GetAntibacterialEffect(); @@ -61,11 +61,11 @@ class BIOGEARS_API SESubstancePharmacodynamics : public Loggable { virtual bool HasBronchodilation() const; virtual SEPharmacodynamicModifier& GetBronchodilation(); - virtual const SEPharmacodynamicModifier* GetBronchodilation() const; + virtual SEPharmacodynamicModifier const& GetBronchodilation() const; virtual bool HasDiastolicPressureModifier() const; virtual SEPharmacodynamicModifier& GetDiastolicPressureModifier(); - virtual const SEPharmacodynamicModifier* GetDiastolicPressureModifier() const; + virtual SEPharmacodynamicModifier const& GetDiastolicPressureModifier() const; virtual bool HasEMaxShapeParameter() const; virtual SEScalar& GetEMaxShapeParameter(); @@ -73,55 +73,55 @@ class BIOGEARS_API SESubstancePharmacodynamics : public Loggable { virtual bool HasFeverModifier() const; virtual SEPharmacodynamicModifier& GetFeverModifier(); - virtual const SEPharmacodynamicModifier* GetFeverModifier() const; + virtual SEPharmacodynamicModifier const& GetFeverModifier() const; virtual bool HasHeartRateModifier() const; virtual SEPharmacodynamicModifier& GetHeartRateModifier(); - virtual const SEPharmacodynamicModifier* GetHeartRateModifier() const; + virtual SEPharmacodynamicModifier const& GetHeartRateModifier() const; virtual bool HasHemorrhageModifier() const; virtual SEPharmacodynamicModifier& GetHemorrhageModifier(); - virtual const SEPharmacodynamicModifier* GetHemorrhageModifier() const; + virtual SEPharmacodynamicModifier const& GetHemorrhageModifier() const; virtual bool HasNeuromuscularBlock() const; virtual SEPharmacodynamicModifier& GetNeuromuscularBlock(); - virtual const SEPharmacodynamicModifier* GetNeuromuscularBlock() const; + virtual SEPharmacodynamicModifier const& GetNeuromuscularBlock() const; virtual bool HasPainModifier() const; virtual SEPharmacodynamicModifier& GetPainModifier(); - virtual const SEPharmacodynamicModifier* GetPainModifier() const; + virtual SEPharmacodynamicModifier const& GetPainModifier() const; virtual bool HasPupilReactivityModifier() const; virtual SEPharmacodynamicModifier& GetPupilReactivityModifier(); - virtual const SEPharmacodynamicModifier* GetPupilReactivityModifier() const; + virtual SEPharmacodynamicModifier const& GetPupilReactivityModifier() const; virtual bool HasPupilSizeModifier() const; virtual SEPharmacodynamicModifier& GetPupilSizeModifier(); - virtual const SEPharmacodynamicModifier* GetPupilSizeModifier() const; + virtual SEPharmacodynamicModifier const& GetPupilSizeModifier() const; virtual bool HasRespirationRateModifier() const; virtual SEPharmacodynamicModifier& GetRespirationRateModifier(); - virtual const SEPharmacodynamicModifier* GetRespirationRateModifier() const; + virtual SEPharmacodynamicModifier const& GetRespirationRateModifier() const; virtual bool HasSedation() const; virtual SEPharmacodynamicModifier& GetSedation(); - virtual const SEPharmacodynamicModifier* GetSedation() const; + virtual SEPharmacodynamicModifier const& GetSedation() const; virtual bool HasSystolicPressureModifier() const; virtual SEPharmacodynamicModifier& GetSystolicPressureModifier(); - virtual const SEPharmacodynamicModifier* GetSystolicPressureModifier() const; + virtual SEPharmacodynamicModifier const& GetSystolicPressureModifier() const; virtual bool HasTidalVolumeModifier() const; virtual SEPharmacodynamicModifier& GetTidalVolumeModifier(); - virtual const SEPharmacodynamicModifier* GetTidalVolumeModifier() const; + virtual SEPharmacodynamicModifier const& GetTidalVolumeModifier() const; virtual bool HasTubularPermeabilityModifier() const; virtual SEPharmacodynamicModifier& GetTubularPermeabilityModifier(); - virtual const SEPharmacodynamicModifier* GetTubularPermeabilityModifier() const; + virtual SEPharmacodynamicModifier const& GetTubularPermeabilityModifier() const; virtual bool HasCentralNervousModifier() const; virtual SEPharmacodynamicModifier& GetCentralNervousModifier(); - virtual const SEPharmacodynamicModifier* GetCentralNervousModifier() const; + virtual SEPharmacodynamicModifier const& GetCentralNervousModifier() const; virtual bool HasEffectSiteRateConstant() const; virtual SEScalarFrequency& GetEffectSiteRateConstant(); @@ -132,9 +132,6 @@ class BIOGEARS_API SESubstancePharmacodynamics : public Loggable { bool operator==(const SESubstancePharmacodynamics& rhs) const; bool operator!=(const SESubstancePharmacodynamics& rhs) const; -protected: - virtual void Unload(CDM::SubstancePharmacodynamicsData& data) const; - private: std::map m_Modifiers; SEScalarFrequency* m_AntibacterialEffect; @@ -161,18 +158,20 @@ class BIOGEARS_API SEPharmacodynamicModifier { friend io::Substance; public: - SEPharmacodynamicModifier(SEScalarMassPerVolume const&, SEScalarFraction const&); SEPharmacodynamicModifier(); + SEPharmacodynamicModifier(SEScalarMassPerVolume const&, SEScalarFraction const&); + SEPharmacodynamicModifier(SEPharmacodynamicModifier const& obj); + SEPharmacodynamicModifier(SEPharmacodynamicModifier&& obj); ~SEPharmacodynamicModifier(); - void Clear(); + SEPharmacodynamicModifier& operator=(SEPharmacodynamicModifier const& rhs); + SEPharmacodynamicModifier& operator=(SEPharmacodynamicModifier&& rhs); + + void Invalidate(); bool IsValid() const; const SEScalar* GetScalar(const char* name); const SEScalar* GetScalar(const std::string& name); - bool Load(const CDM::PharmacodynamicModifierData& in); - CDM::PharmacodynamicModifierData* Unload() const; - bool HasEMax() const; SEScalarFraction& GetEMax(); double GetEMax() const; @@ -186,9 +185,6 @@ class BIOGEARS_API SEPharmacodynamicModifier { bool operator==(const SEPharmacodynamicModifier& rhs) const; bool operator!=(const SEPharmacodynamicModifier& rhs) const; -protected: - virtual void Unload(CDM::PharmacodynamicModifierData& data) const; - private: SEScalarFraction* m_EMax; SEScalarMassPerVolume* m_EC50; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstancePharmacokinetics.h b/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstancePharmacokinetics.h index f1a8ca694..d13330fc5 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstancePharmacokinetics.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstancePharmacokinetics.h @@ -14,38 +14,38 @@ specific language governing permissions and limitations under the License. #include #include +#include #include #include -#include - -CDM_BIND_DECL(SubstancePharmacokineticsData) namespace biogears { namespace io { class Substance; } -} //namespace biogears +} // namespace biogears + +#pragma warning(disable : 4661) namespace std { -BG_EXT template class BIOGEARS_API map; +extern template class map; } +#pragma warning(default : 4661) + namespace biogears { class BIOGEARS_API SESubstancePharmacokinetics : public Loggable { friend io::Substance; public: - SESubstancePharmacokinetics(Logger* logger); + SESubstancePharmacokinetics(SESubstancePharmacokinetics const& obj); + SESubstancePharmacokinetics(Logger* logger = nullptr); virtual ~SESubstancePharmacokinetics(); - virtual void Clear(); + virtual void Invalidate(); virtual bool IsValid() const; virtual const SEScalar* GetScalar(const std::string& name); virtual const SEScalar* GetScalar(const char* name); - virtual bool Load(const CDM::SubstancePharmacokineticsData& in); - virtual CDM::SubstancePharmacokineticsData* Unload() const; - virtual bool HasPhysicochemicals() const; virtual SESubstancePhysicochemical& GetPhysicochemicals(); virtual const SESubstancePhysicochemical* GetPhysicochemicals() const; @@ -60,12 +60,10 @@ class BIOGEARS_API SESubstancePharmacokinetics : public Loggable { virtual void RemoveTissueKinetics(const char* name); virtual void RemoveTissueKinetics(const std::string& name); + SESubstancePharmacokinetics& operator=(SESubstancePharmacokinetics const& rhs); bool operator==(const SESubstancePharmacokinetics& rhs) const; bool operator!=(const SESubstancePharmacokinetics& rhs) const; -protected: - virtual void Unload(CDM::SubstancePharmacokineticsData& data) const; - protected: SESubstancePhysicochemical* m_Physicochemicals; std::map m_TissueKinetics; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstancePhysicochemical.h b/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstancePhysicochemical.h index d9113f70f..889d68fb1 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstancePhysicochemical.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstancePhysicochemical.h @@ -14,13 +14,11 @@ specific language governing permissions and limitations under the License. #include #include -#include - -CDM_BIND_DECL(SubstancePhysicochemicalData) +#include namespace biogears { - class SEScalar; - class SEScalarFraction; +class SEScalar; +class SEScalarFraction; namespace io { class Substance; } @@ -28,18 +26,16 @@ class BIOGEARS_API SESubstancePhysicochemical : public Loggable { friend io::Substance; public: + SESubstancePhysicochemical(SESubstancePhysicochemical const& obj); SESubstancePhysicochemical(Logger* logger); virtual ~SESubstancePhysicochemical(); - virtual void Clear(); + virtual void Invalidate(); virtual bool IsValid() const; virtual const SEScalar* GetScalar(const char* name); virtual const SEScalar* GetScalar(const std::string& name); - virtual bool Load(const CDM::SubstancePhysicochemicalData& in); - virtual CDM::SubstancePhysicochemicalData* Unload() const; - virtual bool HasPrimaryPKA() const; virtual SEScalar& GetPrimaryPKA(); virtual double GetPrimaryPKA() const; @@ -48,8 +44,8 @@ class BIOGEARS_API SESubstancePhysicochemical : public Loggable { virtual SEScalar& GetSecondaryPKA(); virtual double GetSecondaryPKA() const; - virtual CDM::enumSubstanceBindingProtein::value GetBindingProtein() const; - virtual void SetBindingProtein(CDM::enumSubstanceBindingProtein::value state); + virtual SESubstanceBindingProtein GetBindingProtein() const; + virtual void SetBindingProtein(SESubstanceBindingProtein state); virtual bool HasBindingProtein() const; virtual void InvalidateBindingProtein(); @@ -61,8 +57,8 @@ class BIOGEARS_API SESubstancePhysicochemical : public Loggable { virtual SEScalarFraction& GetFractionUnboundInPlasma(); virtual double GetFractionUnboundInPlasma() const; - virtual CDM::enumSubstanceIonicState::value GetIonicState() const; - virtual void SetIonicState(CDM::enumSubstanceIonicState::value state); + virtual SESubstanceIonicState GetIonicState() const; + virtual void SetIonicState(SESubstanceIonicState state); virtual bool HasIonicState() const; virtual void InvalidateIonicState(); @@ -76,20 +72,18 @@ class BIOGEARS_API SESubstancePhysicochemical : public Loggable { virtual bool HasPolarSurfaceArea() const; virtual SEScalar& GetPolarSurfaceArea(); - virtual double GetPolarSurfaceArea() const; - - bool operator==( const SESubstancePhysicochemical& rhs) const; - bool operator!=( const SESubstancePhysicochemical& rhs) const; + virtual double GetPolarSurfaceArea() const; -protected: - virtual void Unload(CDM::SubstancePhysicochemicalData& data) const; + SESubstancePhysicochemical& operator=(const SESubstancePhysicochemical& rhs); + bool operator==(const SESubstancePhysicochemical& rhs) const; + bool operator!=(const SESubstancePhysicochemical& rhs) const; protected: std::vector m_AcidDissociationConstants; - CDM::enumSubstanceBindingProtein::value m_BindingProtein; + SESubstanceBindingProtein m_BindingProtein; SEScalar* m_BloodPlasmaRatio; SEScalarFraction* m_FractionUnboundInPlasma; - CDM::enumSubstanceIonicState::value m_IonicState; + SESubstanceIonicState m_IonicState; SEScalar* m_LogP; SEScalar* m_HydrogenBondCount; SEScalar* m_PolarSurfaceArea; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstancePhysicochemicals.h b/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstancePhysicochemicals.h deleted file mode 100644 index b893a64c2..000000000 --- a/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstancePhysicochemicals.h +++ /dev/null @@ -1,97 +0,0 @@ -/************************************************************************************** -Copyright 2015 Applied Research Associates, Inc. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the License -at: -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software distributed under -the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -CONDITIONS OF ANY KIND, either express or implied. See the License for the -specific language governing permissions and limitations under the License. -**************************************************************************************/ - -#pragma once -#include - -#include -#include - -CDM_BIND_DECL(SubstancePhysicochemicalData) - -namespace biogears { - class SEScalar; - class SEScalarFraction; -namespace io { - class Substance; -} -class BIOGEARS_API SESubstancePhysicochemicals : public Loggable { - friend io::Substance; - -public: - SESubstancePhysicochemicals(Logger* logger); - virtual ~SESubstancePhysicochemicals(); - - virtual void Clear(); - virtual bool IsValid() const; - - virtual const SEScalar* GetScalar(const char* name); - virtual const SEScalar* GetScalar(const std::string& name); - - virtual bool Load(const CDM::SubstancePhysicochemicalData& in); - virtual CDM::SubstancePhysicochemicalData* Unload() const; - - virtual bool HasPrimaryPKA() const; - virtual SEScalar& GetPrimaryPKA(); - virtual double GetPrimaryPKA() const; - - virtual bool HasSecondaryPKA() const; - virtual SEScalar& GetSecondaryPKA(); - virtual double GetSecondaryPKA() const; - - virtual CDM::enumSubstanceBindingProtein::value GetBindingProtein() const; - virtual void SetBindingProtein(CDM::enumSubstanceBindingProtein::value state); - virtual bool HasBindingProtein() const; - virtual void InvalidateBindingProtein(); - - virtual bool HasBloodPlasmaRatio() const; - virtual SEScalar& GetBloodPlasmaRatio(); - virtual double GetBloodPlasmaRatio() const; - - virtual bool HasFractionUnboundInPlasma() const; - virtual SEScalarFraction& GetFractionUnboundInPlasma(); - virtual double GetFractionUnboundInPlasma() const; - - virtual CDM::enumSubstanceIonicState::value GetIonicState() const; - virtual void SetIonicState(CDM::enumSubstanceIonicState::value state); - virtual bool HasIonicState() const; - virtual void InvalidateIonicState(); - - virtual bool HasLogP() const; - virtual SEScalar& GetLogP(); - virtual double GetLogP() const; - - virtual bool HasHydrogenBondCount() const; - virtual SEScalar& GetHydrogenBondCount(); - virtual double GetHydrogenBondCount() const; - - virtual bool HasPolarSurfaceArea() const; - virtual SEScalar& GetPolarSurfaceArea(); - virtual double GetPolarSurfaceArea() const; - - bool operator==( const SESubstancePhysicochemicals& rhs) const; - bool operator!=( const SESubstancePhysicochemicals& rhs) const; - -protected: - virtual void Unload(CDM::SubstancePhysicochemicalData& data) const; - -protected: - std::vector m_AcidDissociationConstants; - CDM::enumSubstanceBindingProtein::value m_BindingProtein; - SEScalar* m_BloodPlasmaRatio; - SEScalarFraction* m_FractionUnboundInPlasma; - CDM::enumSubstanceIonicState::value m_IonicState; - SEScalar* m_LogP; - SEScalar* m_HydrogenBondCount; - SEScalar* m_PolarSurfaceArea; -}; -} \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceTissuePharmacokinetics.h b/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceTissuePharmacokinetics.h index cfeef65b5..16d51ba74 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceTissuePharmacokinetics.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceTissuePharmacokinetics.h @@ -14,7 +14,7 @@ specific language governing permissions and limitations under the License. #include #include -#include +#include namespace biogears { class SEScalar; @@ -25,13 +25,12 @@ class BIOGEARS_API SESubstanceTissuePharmacokinetics : public Loggable { friend io::Substance; public: - SESubstanceTissuePharmacokinetics(const std::string& name, Logger* logger); + SESubstanceTissuePharmacokinetics(SESubstanceTissuePharmacokinetics const& obj); + SESubstanceTissuePharmacokinetics(const std::string& name, Logger* logger = nullptr); virtual ~SESubstanceTissuePharmacokinetics(); - virtual void Clear(); + virtual void Invalidate(); - virtual bool Load(const CDM::SubstanceTissuePharmacokineticsData& in); - virtual CDM::SubstanceTissuePharmacokineticsData* Unload() const; public: const SEScalar* GetScalar(const char* name); const SEScalar* GetScalar(const std::string& name); @@ -46,9 +45,6 @@ class BIOGEARS_API SESubstanceTissuePharmacokinetics : public Loggable { bool operator==( const SESubstanceTissuePharmacokinetics& rhs) const; bool operator!=( const SESubstanceTissuePharmacokinetics& rhs) const; -protected: - virtual void Unload(CDM::SubstanceTissuePharmacokineticsData& data) const; - protected: std::string m_Name; SEScalar* m_PartitionCoefficient; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceTransport.h b/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceTransport.h index 478985dce..f38c41261 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceTransport.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceTransport.h @@ -11,16 +11,15 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once -#ifdef MSVC -#pragma warning(disable : 4503) -#endif - -#include "biogears/cdm/properties/SEScalarFraction.h" -#include "biogears/cdm/properties/SEScalarMass.h" -#include "biogears/cdm/properties/SEScalarMassPerVolume.h" -#include "biogears/cdm/properties/SEScalarVolume.h" -#include "biogears/cdm/properties/SEScalarVolumePerTime.h" + +#include +#include +#include +#include +#include +#include #include +#include #include #include @@ -30,23 +29,23 @@ specific language governing permissions and limitations under the License. #define TRANSPORT_VERTEX_TYPES QuantityScalar, ExtensiveScalar, IntensiveScalar #define TRANSPORT_EDGE_TYPES FluxScalar, QuantityScalar, ExtensiveScalar, IntensiveScalar +#pragma warning(disable : 4661) namespace biogears { template -class SESubstanceTransportAmount ; +class SESubstanceTransportAmount; template -class SESubstanceTransportVertex ; +class SESubstanceTransportVertex; template -class SESubstanceTransportEdge ; +class SESubstanceTransportEdge; template -class SESubstanceTransportGraph ; -template +class SESubstanceTransportGraph; +template class SESubstanceTransporter; template bool operator==(SESubstanceTransportVertex const& lhs, SESubstanceTransportVertex const& rhs); - template class SESubstanceTransportAmount { template @@ -55,7 +54,7 @@ class SESubstanceTransportAmount { public: virtual ~SESubstanceTransportAmount() { } - virtual void Invalidate() = 0; + virtual void MakeInvalid() = 0; virtual bool HasExtensive() const = 0; virtual ExtensiveScalar& GetExtensive() = 0; @@ -66,8 +65,9 @@ class SESubstanceTransportAmount { virtual bool operator==(SESubstanceTransportAmount const&) const = 0; virtual bool operator!=(SESubstanceTransportAmount const&) const = 0; }; -BG_EXT template class BIOGEARS_API SESubstanceTransportAmount; -BG_EXT template class BIOGEARS_API SESubstanceTransportAmount; + +extern template class SESubstanceTransportAmount; +extern template class SESubstanceTransportAmount; using SEGasTransportSubstance = SESubstanceTransportAmount; using SELiquidTransportSubstance = SESubstanceTransportAmount; @@ -78,7 +78,7 @@ template friend class SESubstanceTransporter; - + friend bool operator==<>(SESubstanceTransportVertex const& lhs, SESubstanceTransportVertex const& rhs); public: @@ -92,7 +92,7 @@ class SESubstanceTransportVertex { virtual QuantityScalar& GetQuantity() = 0; virtual std::vector*>& GetTransportSubstances() = 0; - virtual std::vector*> const & GetTransportSubstances() const= 0; + virtual std::vector*> const& GetTransportSubstances() const = 0; }; template @@ -123,8 +123,8 @@ bool operator!=(SESubstanceTransportVertex const& lhs, S using SEGasTransportVertex = SESubstanceTransportVertex; using SELiquidTransportVertex = SESubstanceTransportVertex; -BG_EXT template class BIOGEARS_API SESubstanceTransportVertex; -BG_EXT template class BIOGEARS_API SESubstanceTransportVertex; +extern template class SESubstanceTransportVertex; +extern template class SESubstanceTransportVertex; BG_EXT template bool BIOGEARS_API operator==(SESubstanceTransportVertex const& lhs, SESubstanceTransportVertex const& rhs); BG_EXT template bool BIOGEARS_API operator==(SESubstanceTransportVertex const& lhs, SESubstanceTransportVertex const& rhs); @@ -153,8 +153,8 @@ class SESubstanceTransportEdge { virtual SESubstanceTransportVertex& GetTargetVertex() = 0; }; -BG_EXT template class BIOGEARS_API SESubstanceTransportEdge; -BG_EXT template class BIOGEARS_API SESubstanceTransportEdge; +extern template class SESubstanceTransportEdge; +extern template class SESubstanceTransportEdge; using SEGasTransportEdge = SESubstanceTransportEdge; using SELiquidTransportEdge = SESubstanceTransportEdge; @@ -175,8 +175,8 @@ class SESubstanceTransportGraph { virtual const std::vector*>* GetTargetEdges(const SESubstanceTransportVertex& v) const = 0; }; -BG_EXT template class BIOGEARS_API SESubstanceTransportGraph; -BG_EXT template class BIOGEARS_API SESubstanceTransportGraph; +extern template class SESubstanceTransportGraph; +extern template class SESubstanceTransportGraph; using SEGasTransportGraph = SESubstanceTransportGraph; using SELiquidTransportGraph = SESubstanceTransportGraph; @@ -199,8 +199,8 @@ class SESubstanceTransporter : public Loggable { const IntensiveUnit& m_IntensiveUnit; }; -BG_EXT template class BIOGEARS_API SESubstanceTransporter; -BG_EXT template class BIOGEARS_API SESubstanceTransporter; +extern template class SESubstanceTransporter; +extern template class SESubstanceTransporter; using SEGasTransporter = SESubstanceTransporter; using SELiquidTransporter = SESubstanceTransporter; @@ -208,10 +208,12 @@ using SELiquidTransporter = SESubstanceTransporter; -BG_EXT template class BIOGEARS_API vector; -BG_EXT template class BIOGEARS_API map; -BG_EXT template class BIOGEARS_API map*>; +extern template class vector; +extern template class vector; +extern template class map; +extern template class map*>; } #include + +#pragma warning(default : 4661) diff --git a/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceTransport.inl b/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceTransport.inl index e6e9cf7e8..a9a8e8a08 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceTransport.inl +++ b/projects/biogears/libBiogears/include/biogears/cdm/substance/SESubstanceTransport.inl @@ -16,6 +16,8 @@ specific language governing permissions and limitations under the License. #include #include +#include +#include namespace biogears { template @@ -176,7 +178,7 @@ void SESubstanceTransporterGetTransportSubstances()[s]; if (q->HasExtensive()) { if (!v->HasQuantity()) { - q->Invalidate(); + q->MakeInvalid(); continue; } double newIntensiveVlaue = xVector(i); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/SESystem.h b/projects/biogears/libBiogears/include/biogears/cdm/system/SESystem.h index 6ff5e64b7..31a877403 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/SESystem.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/SESystem.h @@ -18,8 +18,6 @@ specific language governing permissions and limitations under the License. #include #include -CDM_BIND_DECL(SystemData) - namespace biogears { class SESubstanceManager; class SEScalar; @@ -35,7 +33,7 @@ class BIOGEARS_API SESystem : public Loggable { virtual const char* classname() const = 0; virtual size_t hash_code() const = 0; - virtual void Clear(); // Deletes all members + virtual void Invalidate(); // Deletes all members /** @name GetScalar * @brief - A reflextion type call that will return the Scalar associated @@ -54,13 +52,9 @@ class BIOGEARS_API SESystem : public Loggable { static const SEScalar* GetScalar(const char* name, std::vector* systems); static const SEScalar* GetScalar(const std::string& name, std::vector* systems); - bool Load(const CDM::SystemData& in); - virtual CDM::SystemData* Unload() const = 0; - virtual Tree GetPhysiologyRequestGraph() const = 0; protected: - void Unload(CDM::SystemData& data) const; std::stringstream m_ss; }; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/environment/SEActiveCooling.h b/projects/biogears/libBiogears/include/biogears/cdm/system/environment/SEActiveCooling.h index 097767449..36d55b9b8 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/environment/SEActiveCooling.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/environment/SEActiveCooling.h @@ -11,19 +11,18 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once #include -#include #include -#include +#include +#include +#include +#include #include namespace biogears { class SEScalar; class SEScalarFraction; -class SEScalarPower; -class PowerUnit; -class SEScalarArea; -class AreaUnit; + namespace io { class Environment; } @@ -33,19 +32,12 @@ class BIOGEARS_API SEActiveCooling : public Loggable { SEActiveCooling(Logger* logger); virtual ~SEActiveCooling(); - virtual void Clear(); + virtual void Invalidate(); virtual void Reset(); - virtual bool Load(const CDM::ActiveCoolingData& in, std::default_random_engine *rd = nullptr); - virtual CDM::ActiveCoolingData* Unload() const; - bool operator==(SEActiveCooling const&) const; bool operator!=(SEActiveCooling const&) const; -protected: - virtual void Unload(CDM::ActiveCoolingData& data) const; - -public: virtual const SEScalar* GetScalar(const char* name); virtual const SEScalar* GetScalar(const std::string& name); @@ -63,6 +55,8 @@ class BIOGEARS_API SEActiveCooling : public Loggable { virtual void ToString(std::ostream& str) const; + virtual bool IsValid() const; + protected: SEScalarPower* m_Power; SEScalarArea* m_SurfaceArea; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/environment/SEActiveHeating.h b/projects/biogears/libBiogears/include/biogears/cdm/system/environment/SEActiveHeating.h index 059a1d857..3222cabaa 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/environment/SEActiveHeating.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/environment/SEActiveHeating.h @@ -13,19 +13,15 @@ specific language governing permissions and limitations under the License. #include #include +#include #include - +#include +#include #include -CDM_BIND_DECL(ActiveHeatingData) - namespace biogears { class SEScalar; class SEScalarFraction; -class SEScalarPower; -class PowerUnit; -class SEScalarArea; -class AreaUnit; namespace io { class Environment; } @@ -35,19 +31,12 @@ class BIOGEARS_API SEActiveHeating : public Loggable { SEActiveHeating(Logger* logger); virtual ~SEActiveHeating(); - virtual void Clear(); + virtual void Invalidate(); virtual void Reset(); - virtual bool Load(const CDM::ActiveHeatingData& in, std::default_random_engine *rd = nullptr); - virtual CDM::ActiveHeatingData* Unload() const; - bool operator==(SEActiveHeating const&) const; bool operator!=(SEActiveHeating const&) const; -protected: - virtual void Unload(CDM::ActiveHeatingData& data) const; - -public: virtual const SEScalar* GetScalar(const char* name); virtual const SEScalar* GetScalar(const std::string& name); @@ -65,6 +54,8 @@ class BIOGEARS_API SEActiveHeating : public Loggable { virtual void ToString(std::ostream& str) const; + virtual bool IsValid() const; + protected: SEScalarPower* m_Power; SEScalarArea* m_SurfaceArea; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/environment/SEAppliedTemperature.h b/projects/biogears/libBiogears/include/biogears/cdm/system/environment/SEAppliedTemperature.h index 2ab066963..ad0b9d801 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/environment/SEAppliedTemperature.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/environment/SEAppliedTemperature.h @@ -11,16 +11,13 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once #include "biogears/cdm/properties/SEScalarFraction.h" +#include #include - -CDM_BIND_DECL(AppliedTemperatureData) +#include +#include namespace biogears { class SEScalar; -class SEScalarTemperature; -class TemperatureUnit; -class SEScalarArea; -class AreaUnit; namespace io { class Environment; } @@ -31,18 +28,11 @@ class BIOGEARS_API SEAppliedTemperature : public Loggable { SEAppliedTemperature(const SEAppliedTemperature& other) = delete; virtual ~SEAppliedTemperature(); - virtual void Clear(); - - virtual bool Load(const CDM::AppliedTemperatureData& in, std::default_random_engine *rd = nullptr); - virtual CDM::AppliedTemperatureData* Unload() const; + virtual void Invalidate(); bool operator==(SEAppliedTemperature const&) const; bool operator!=(SEAppliedTemperature const&) const; -protected: - virtual void Unload(CDM::AppliedTemperatureData& data) const; - -public: virtual const SEScalar* GetScalar(const char* name); virtual const SEScalar* GetScalar(const std::string& name); @@ -58,15 +48,17 @@ class BIOGEARS_API SEAppliedTemperature : public Loggable { virtual SEScalarFraction& GetSurfaceAreaFraction(); virtual double GetSurfaceAreaFraction() const; - virtual CDM::enumOnOff::value GetState() const; - virtual void SetState(CDM::enumOnOff::value onOff); + virtual SEOnOff GetState() const; + virtual void SetState(SEOnOff onOff); virtual void ToString(std::ostream& str) const; + virtual bool IsValid() const; + protected: SEScalarTemperature* m_Temperature; SEScalarArea* m_SurfaceArea; SEScalarFraction* m_SurfaceAreaFraction; - CDM::enumOnOff::value m_State; + SEOnOff m_State; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/environment/SEEnvironment.h b/projects/biogears/libBiogears/include/biogears/cdm/system/environment/SEEnvironment.h index 9997688a3..692a67bd3 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/environment/SEEnvironment.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/environment/SEEnvironment.h @@ -11,24 +11,22 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once +#include #include -#include +#include +#include namespace biogears { + class SESubstance; class SESubstanceFraction; class SESubstanceManager; class SEEnvironmentalConditions; class SEEnvironmentChange; class SEInitialEnvironment; +class SEAppliedTemperature; class SEActiveHeating; class SEActiveCooling; -class SEAppliedTemperature; - -class SEScalarPower; -class PowerUnit; -class SEScalarHeatConductancePerArea; -class HeatConductancePerAreaUnit; namespace io { class Environment; } @@ -44,16 +42,14 @@ class BIOGEARS_API SEEnvironment : public SESystem { const char* classname() const override { return TypeTag(); } size_t hash_code() const override { return TypeHash(); } - void Clear() override; + void Invalidate() override; - bool Load(const CDM::EnvironmentData& in); bool Load(const char* environmentFile); bool Load(const std::string& environmentFile); bool operator==(SEEnvironment const&) const; bool operator!=(SEEnvironment const&) const; - CDM::EnvironmentData* Unload() const override; Tree GetPhysiologyRequestGraph() const override; /** @name ProcessChange * @brief - Will change this class as directed by the Action @@ -119,8 +115,7 @@ class BIOGEARS_API SEEnvironment : public SESystem { SEScalarPower& GetSkinHeatLoss(); double GetSkinHeatLoss(const PowerUnit& unit) const; -protected: - void Unload(CDM::EnvironmentData& data) const; + bool IsValid() const; protected: std::string m_Name; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/environment/SEEnvironmentalConditions.h b/projects/biogears/libBiogears/include/biogears/cdm/system/environment/SEEnvironmentalConditions.h index 67a4a83cc..172e72ca9 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/environment/SEEnvironmentalConditions.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/environment/SEEnvironmentalConditions.h @@ -13,14 +13,20 @@ specific language governing permissions and limitations under the License. #pragma once #include #include -#include + +#include #include -CDM_BIND_DECL(EnvironmentalConditionsData) +#include +#include +#include +#include +#include namespace biogears { class SESubstance; +class SESubstanceDefinition; class SESubstanceFraction; class SESubstanceConcentration; class SEEnvironment; @@ -29,16 +35,6 @@ class SEEnvironmentChange; class SEInitialEnvironment; class SEScalar; -class SEScalarMassPerVolume; -class MassPerVolumeUnit; -class SEScalarLengthPerTime; -class LengthPerTimeUnit; -class SEScalarTemperature; -class TemperatureUnit; -class SEScalarHeatResistanceArea; -class HeatResistanceAreaUnit; -class SEScalarPressure; -class PressureUnit; class SEScalarFraction; namespace io { @@ -56,93 +52,91 @@ class BIOGEARS_API SEEnvironmentalConditions : public Loggable { SEEnvironmentalConditions(SESubstanceManager& substances); virtual ~SEEnvironmentalConditions(); - virtual void Clear(); + void Invalidate(); + bool IsValid() const; bool operator==(SEEnvironmentalConditions const& rhs) const; bool operator!=(SEEnvironmentalConditions const& rhs) const; - virtual bool Load(const CDM::EnvironmentalConditionsData& in); - virtual bool Load(const char* environmentFile); - virtual bool Load(const std::string& environmentFile); - virtual CDM::EnvironmentalConditionsData* Unload() const; + bool Load(const char* environmentFile); + bool Load(const std::string& environmentFile); - virtual const SEScalar* GetScalar(const char* name); - virtual const SEScalar* GetScalar(const std::string& name); + const SEScalar* GetScalar(const char* name); + const SEScalar* GetScalar(const std::string& name); - virtual std::string GetName() const; - virtual const char* GetName_cStr() const; - virtual void SetName(const char* name); - virtual void SetName(const std::string& name); - virtual bool HasName() const; - virtual void InvalidateName(); + std::string GetName() const; + const char* GetName_cStr() const; + void SetName(const char* name); + void SetName(const std::string& name); + bool HasName() const; + void InvalidateName(); - virtual CDM::enumSurroundingType::value GetSurroundingType() const; - virtual void SetSurroundingType(CDM::enumSurroundingType::value name); - virtual bool HasSurroundingType() const; - virtual void InvalidateSurroundingType(); + SESurroundingType GetSurroundingType() const; + void SetSurroundingType(SESurroundingType name); + bool HasSurroundingType() const; + void InvalidateSurroundingType(); - virtual bool HasAirDensity() const; - virtual SEScalarMassPerVolume& GetAirDensity(); - virtual double GetAirDensity(const MassPerVolumeUnit& unit) const; + bool HasAirDensity() const; + SEScalarMassPerVolume& GetAirDensity(); + double GetAirDensity(const MassPerVolumeUnit& unit) const; - virtual bool HasAirVelocity() const; - virtual SEScalarLengthPerTime& GetAirVelocity(); - virtual double GetAirVelocity(const LengthPerTimeUnit& unit) const; + bool HasAirVelocity() const; + SEScalarLengthPerTime& GetAirVelocity(); + double GetAirVelocity(const LengthPerTimeUnit& unit) const; - virtual bool HasAmbientTemperature() const; - virtual SEScalarTemperature& GetAmbientTemperature(); - virtual double GetAmbientTemperature(const TemperatureUnit& unit) const; + bool HasAmbientTemperature() const; + SEScalarTemperature& GetAmbientTemperature(); + double GetAmbientTemperature(const TemperatureUnit& unit) const; - virtual bool HasAtmosphericPressure() const; - virtual SEScalarPressure& GetAtmosphericPressure(); - virtual double GetAtmosphericPressure(const PressureUnit& unit) const; + bool HasAtmosphericPressure() const; + SEScalarPressure& GetAtmosphericPressure(); + double GetAtmosphericPressure(const PressureUnit& unit) const; - virtual bool HasClothingResistance() const; - virtual SEScalarHeatResistanceArea& GetClothingResistance(); - virtual double GetClothingResistance(const HeatResistanceAreaUnit& unit) const; + bool HasClothingResistance() const; + SEScalarHeatResistanceArea& GetClothingResistance(); + double GetClothingResistance(const HeatResistanceAreaUnit& unit) const; - virtual bool HasEmissivity() const; - virtual SEScalarFraction& GetEmissivity(); - virtual double GetEmissivity() const; + bool HasEmissivity() const; + SEScalarFraction& GetEmissivity(); + double GetEmissivity() const; - virtual bool HasMeanRadiantTemperature() const; - virtual SEScalarTemperature& GetMeanRadiantTemperature(); - virtual double GetMeanRadiantTemperature(const TemperatureUnit& unit) const; + bool HasMeanRadiantTemperature() const; + SEScalarTemperature& GetMeanRadiantTemperature(); + double GetMeanRadiantTemperature(const TemperatureUnit& unit) const; - virtual bool HasRelativeHumidity() const; - virtual SEScalarFraction& GetRelativeHumidity(); - virtual double GetRelativeHumidity() const; + bool HasRelativeHumidity() const; + SEScalarFraction& GetRelativeHumidity(); + double GetRelativeHumidity() const; - virtual bool HasRespirationAmbientTemperature() const; - virtual SEScalarTemperature& GetRespirationAmbientTemperature(); - virtual double GetRespirationAmbientTemperature(const TemperatureUnit& unit) const; + bool HasRespirationAmbientTemperature() const; + SEScalarTemperature& GetRespirationAmbientTemperature(); + double GetRespirationAmbientTemperature(const TemperatureUnit& unit) const; bool HasAmbientGas() const; - bool HasAmbientGas(const SESubstance& substance) const; + bool HasAmbientGas(SESubstanceDefinition const& substance) const; const std::vector& GetAmbientGases(); const std::vector& GetAmbientGases() const; - SESubstanceFraction& GetAmbientGas(SESubstance& substance); - const SESubstanceFraction* GetAmbientGas(const SESubstance& substance) const; - void AddAmbientGas(const SESubstance& substance, SEScalarFraction const& concentration); - void RemoveAmbientGas(const SESubstance& substance); + SESubstanceFraction& GetAmbientGas(SESubstanceDefinition const& substance); + const SESubstanceFraction* GetAmbientGas(SESubstanceDefinition const& substance) const; + void AddAmbientGas(SESubstanceDefinition const& substance, SEScalarFraction const& concentration); + void RemoveAmbientGas(SESubstanceDefinition const& substance); void RemoveAmbientGases(); bool HasAmbientAerosol() const; - bool HasAmbientAerosol(const SESubstance& substance) const; + bool HasAmbientAerosol(SESubstanceDefinition const& substance) const; const std::vector& GetAmbientAerosols(); const std::vector& GetAmbientAerosols() const; - SESubstanceConcentration& GetAmbientAerosol(SESubstance& substance); - const SESubstanceConcentration* GetAmbientAerosol(const SESubstance& substance) const; - void AddAmbientAerosol(const SESubstance& substance, SEScalarMassPerVolume const& concentration); - void RemoveAmbientAerosol(const SESubstance& substance); + SESubstanceConcentration& GetAmbientAerosol(SESubstanceDefinition const& substance); + const SESubstanceConcentration* GetAmbientAerosol(SESubstanceDefinition const& substance) const; + void AddAmbientAerosol(SESubstanceDefinition const& substance, SEScalarMassPerVolume const& concentration); + void RemoveAmbientAerosol(SESubstanceDefinition const& substance); void RemoveAmbientAerosols(); protected: - virtual void Unload(CDM::EnvironmentalConditionsData& data) const; - virtual void Merge(const SEEnvironmentalConditions& from); + void Merge(const SEEnvironmentalConditions& from); protected: - CDM::enumSurroundingType::value m_SurroundingType; + SESurroundingType m_SurroundingType; std::string m_Name; SEScalarMassPerVolume* m_AirDensity; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/environment/actions/SEEnvironmentAction.h b/projects/biogears/libBiogears/include/biogears/cdm/system/environment/actions/SEEnvironmentAction.h index 364b244ad..e0df261c8 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/environment/actions/SEEnvironmentAction.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/environment/actions/SEEnvironmentAction.h @@ -11,7 +11,6 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once #include -#include namespace biogears { namespace io { @@ -21,20 +20,13 @@ class BIOGEARS_API SEEnvironmentAction : public SEAction { friend io::EnvironmentActions; public: - SEEnvironmentAction(); + SEEnvironmentAction( Logger* = nullptr); virtual ~SEEnvironmentAction(); - virtual void Clear(); + virtual void Invalidate(); virtual bool IsValid() const; - virtual bool Load(const CDM::EnvironmentActionData& in); - virtual CDM::EnvironmentActionData* Unload() const; - -protected: - virtual void Unload(CDM::EnvironmentActionData& data) const; - -public: virtual void ToString(std::ostream& str) const = 0; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/environment/actions/SEEnvironmentChange.h b/projects/biogears/libBiogears/include/biogears/cdm/system/environment/actions/SEEnvironmentChange.h index 7d909e161..1e502bf5b 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/environment/actions/SEEnvironmentChange.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/environment/actions/SEEnvironmentChange.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include #include -#include namespace biogears { namespace io { @@ -27,17 +26,10 @@ class BIOGEARS_API SEEnvironmentChange : public SEEnvironmentAction { static constexpr const char* TypeTag() { return "SEEnvironmentChange"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; + virtual void Invalidate() override; virtual bool IsValid() const override; - virtual bool Load(const CDM::EnvironmentChangeData& in, std::default_random_engine *rd = nullptr); - virtual CDM::EnvironmentChangeData* Unload() const override; - -protected: - virtual void Unload(CDM::EnvironmentChangeData& data) const; - -public: virtual bool HasConditions() const; virtual SEEnvironmentalConditions& GetConditions(); virtual const SEEnvironmentalConditions* GetConditions() const; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/environment/actions/SEThermalApplication.h b/projects/biogears/libBiogears/include/biogears/cdm/system/environment/actions/SEThermalApplication.h index 1256816f9..cab2424e2 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/environment/actions/SEThermalApplication.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/environment/actions/SEThermalApplication.h @@ -11,7 +11,6 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once #include -#include namespace biogears { class SEActiveHeating; @@ -24,24 +23,17 @@ class BIOGEARS_API SEThermalApplication : public SEEnvironmentAction { friend io::EnvironmentActions; public: - SEThermalApplication(); + SEThermalApplication( Logger* = nullptr); virtual ~SEThermalApplication() override; static constexpr const char* TypeTag() { return "SEThermalApplication"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; + virtual void Invalidate() override; virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::ThermalApplicationData& in, std::default_random_engine *rd = nullptr); - virtual CDM::ThermalApplicationData* Unload() const override; - -protected: - virtual void Unload(CDM::ThermalApplicationData& data) const; - -public: virtual bool HasActiveHeating() const; virtual SEActiveHeating& GetActiveHeating(); virtual void RemoveActiveHeating(); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/environment/conditions/SEEnvironmentCondition.h b/projects/biogears/libBiogears/include/biogears/cdm/system/environment/conditions/SEEnvironmentCondition.h index 98ecf3809..04ac51635 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/environment/conditions/SEEnvironmentCondition.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/environment/conditions/SEEnvironmentCondition.h @@ -11,7 +11,6 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once #include -#include namespace biogears { namespace io { @@ -24,20 +23,14 @@ class BIOGEARS_API SEEnvironmentCondition : public SECondition { SEEnvironmentCondition(); virtual ~SEEnvironmentCondition(); - virtual void Clear(); + using SECondition::Invalidate; - virtual bool IsValid() const; + using SECondition::IsValid; - virtual bool Load(const CDM::EnvironmentConditionData& in); - virtual CDM::EnvironmentConditionData* Unload() const; - - bool operator==(SECondition const&) const = 0; - bool operator!=(SECondition const&) const = 0; - -protected: - virtual void Unload(CDM::EnvironmentConditionData& data) const; + bool operator==(SECondition const&) const override = 0; + bool operator!=(SECondition const&) const override = 0; public: - virtual void ToString(std::ostream& str) const = 0; + virtual void ToString(std::ostream& str) const override = 0; }; -} \ No newline at end of file +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/environment/conditions/SEInitialEnvironment.h b/projects/biogears/libBiogears/include/biogears/cdm/system/environment/conditions/SEInitialEnvironment.h index c7295c588..3e5ca0e83 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/environment/conditions/SEInitialEnvironment.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/environment/conditions/SEInitialEnvironment.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include #include -#include namespace biogears { namespace io { @@ -25,24 +24,18 @@ class BIOGEARS_API SEInitialEnvironment : public SEEnvironmentCondition { SEInitialEnvironment(SESubstanceManager& substances); virtual ~SEInitialEnvironment(); - virtual void Clear(); + virtual void Invalidate() override ; - virtual bool IsValid() const; - - virtual bool Load(const CDM::InitialEnvironmentData& in); - virtual CDM::InitialEnvironmentData* Unload() const; + virtual bool IsValid() const override ; bool operator==(SEInitialEnvironment const& rhs) const; bool operator!=(SEInitialEnvironment const& rhs) const; bool operator==(SECondition const&) const override; bool operator!=(SECondition const&) const override; -protected: - virtual void Unload(CDM::InitialEnvironmentData& data) const; - public: - virtual std::string GetName() const { return "InitialEnvironment"; } - virtual const char* GetName_cStr() const { return "InitialEnvironment"; } + virtual std::string GetName() const override { return "InitialEnvironment"; } + virtual const char* GetName_cStr() const override { return "InitialEnvironment"; } virtual bool HasConditions() const; virtual SEEnvironmentalConditions& GetConditions(); @@ -55,7 +48,7 @@ class BIOGEARS_API SEInitialEnvironment : public SEEnvironmentCondition { virtual bool HasConditionsFile() const; virtual void InvalidateConditionsFile(); - virtual void ToString(std::ostream& str) const; + virtual void ToString(std::ostream& str) const override ; protected: SESubstanceManager& m_Substances; @@ -63,4 +56,4 @@ class BIOGEARS_API SEInitialEnvironment : public SEEnvironmentCondition { std::string m_ConditionsFile; SEEnvironmentalConditions* m_Conditions; }; -} \ No newline at end of file +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/SEAnesthesiaMachine.h b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/SEAnesthesiaMachine.h index 3a2db77c1..345da7fec 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/SEAnesthesiaMachine.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/SEAnesthesiaMachine.h @@ -11,10 +11,14 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once +#include + #include +#include +#include +#include +#include #include -#include -#include namespace biogears { @@ -25,27 +29,22 @@ class SEAnesthesiaMachineOxygenBottle; class SEAnesthesiaMachineConfiguration; class Serializer; class TimeUnit; -class SEScalarVolumePerTime; -class VolumePerTimeUnit; -class SEScalarPressure; -class PressureUnit; -class SEScalarFrequency; -class FrequencyUnit; class SEScalarFraction; namespace io { class Anesthesia; } -} //namespace biogears +} // namespace biogears +#pragma warning(disable : 4661) namespace std { -BG_EXT template class BIOGEARS_API map; -BG_EXT template class BIOGEARS_API map; +extern template class map; +extern template class map; } +#pragma warning(default : 4661) namespace biogears { class BIOGEARS_API SEAnesthesiaMachine : public SESystem { -protected: friend SEAnesthesiaMachineConfiguration; friend io::Anesthesia; @@ -58,47 +57,40 @@ class BIOGEARS_API SEAnesthesiaMachine : public SESystem { const char* classname() const override { return TypeTag(); } size_t hash_code() const override { return TypeHash(); } - void Clear() override; - - bool Load(const CDM::AnesthesiaMachineData& in); - CDM::AnesthesiaMachineData* Unload() const override; + void Invalidate() override; Tree GetPhysiologyRequestGraph() const override; -protected: - void Unload(CDM::AnesthesiaMachineData& data) const; - /** @name StateChange - * @brief - This method is called when ever there is a state change - * Specically a new file has been loaded, configuration action, or the system reset - * Engine specific methodology can then update their logic. - */ + * @brief - This method is called when ever there is a state change + * Specically a new file has been loaded, configuration action, or the system reset + * Engine specific methodology can then update their logic. + */ virtual void StateChange(); void Merge(const SEAnesthesiaMachine& from); void ProcessConfiguration(const SEAnesthesiaMachineConfiguration& config); -public: bool Load(const std::string& file); const SEScalar* GetScalar(const char* name) override; const SEScalar* GetScalar(const std::string& name) override; - const std::map& GetEventStates() const { return m_EventState; } - void SetEvent(CDM::enumAnesthesiaMachineEvent::value state, bool active, const SEScalarTime& time); - bool IsEventActive(CDM::enumAnesthesiaMachineEvent::value state) const; - double GetEventDuration(CDM::enumAnesthesiaMachineEvent::value type, const TimeUnit& unit) const; + const std::map& GetEventStates() const { return m_EventState; } + void SetEvent(SEAnesthesiaMachineEvent state, bool active, const SEScalarTime& time); + bool IsEventActive(SEAnesthesiaMachineEvent state) const; + double GetEventDuration(SEAnesthesiaMachineEvent type, const TimeUnit& unit) const; void UpdateEvents(const SEScalarTime& timeStep); /** @name ForwardEvents - * @brief - Set a callback class to invoke when any event changes - * @details - Note that the handler callback can and will be called in the middle of a time step - * So system and compartment objects may not be completely up to date when called. - * Use the PhysiologyEngineInterface::SetEventHandler to ensure that all engine - * data is up to date at the time the callback is invoked - */ + * @brief - Set a callback class to invoke when any event changes + * @details - Note that the handler callback can and will be called in the middle of a time step + * So system and compartment objects may not be completely up to date when called. + * Use the PhysiologyEngineInterface::SetEventHandler to ensure that all engine + * data is up to date at the time the callback is invoked + */ void ForwardEvents(SEEventHandler* handler); - virtual CDM::enumAnesthesiaMachineConnection::value GetConnection() const; - virtual void SetConnection(CDM::enumAnesthesiaMachineConnection::value c); + virtual SEAnesthesiaMachineConnection GetConnection() const; + virtual void SetConnection(SEAnesthesiaMachineConnection c); virtual bool HasConnection() const; virtual void InvalidateConnection(); @@ -114,8 +106,8 @@ class BIOGEARS_API SEAnesthesiaMachine : public SESystem { SEScalarFraction& GetOxygenFraction(); double GetOxygenFraction() const; - CDM::enumAnesthesiaMachineOxygenSource::value GetOxygenSource() const; - void SetOxygenSource(CDM::enumAnesthesiaMachineOxygenSource::value name); + SEAnesthesiaMachineOxygenSource GetOxygenSource() const; + void SetOxygenSource(SEAnesthesiaMachineOxygenSource name); bool HasOxygenSource() const; void InvalidateOxygenSource(); @@ -123,8 +115,8 @@ class BIOGEARS_API SEAnesthesiaMachine : public SESystem { SEScalarPressure& GetPositiveEndExpiredPressure(); double GetPositiveEndExpiredPressure(const PressureUnit& unit) const; - CDM::enumAnesthesiaMachinePrimaryGas::value GetPrimaryGas() const; - void SetPrimaryGas(CDM::enumAnesthesiaMachinePrimaryGas::value name); + SEAnesthesiaMachinePrimaryGas GetPrimaryGas() const; + void SetPrimaryGas(SEAnesthesiaMachinePrimaryGas name); bool HasPrimaryGas() const; void InvalidatePrimaryGas(); @@ -166,16 +158,16 @@ class BIOGEARS_API SEAnesthesiaMachine : public SESystem { protected: std::stringstream m_ss; SEEventHandler* m_EventHandler; - std::map m_EventState; - std::map m_EventDuration_s; + std::map m_EventState; + std::map m_EventDuration_s; - CDM::enumAnesthesiaMachineConnection::value m_Connection; + SEAnesthesiaMachineConnection m_Connection; SEScalarVolumePerTime* m_InletFlow; SEScalar* m_InspiratoryExpiratoryRatio; SEScalarFraction* m_OxygenFraction; - CDM::enumAnesthesiaMachineOxygenSource::value m_OxygenSource; + SEAnesthesiaMachineOxygenSource m_OxygenSource; SEScalarPressure* m_PositiveEndExpiredPressure; - CDM::enumAnesthesiaMachinePrimaryGas::value m_PrimaryGas; + SEAnesthesiaMachinePrimaryGas m_PrimaryGas; SEScalarFrequency* m_RespiratoryRate; SEScalarPressure* m_ReliefValvePressure; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/SEAnesthesiaMachineChamber.h b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/SEAnesthesiaMachineChamber.h index a34844979..6867e641f 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/SEAnesthesiaMachineChamber.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/SEAnesthesiaMachineChamber.h @@ -14,8 +14,7 @@ specific language governing permissions and limitations under the License. #include #include -#include -#include +#include namespace biogears { class SESubstance; @@ -35,22 +34,13 @@ class BIOGEARS_API SEAnesthesiaMachineChamber : public Loggable { SEAnesthesiaMachineChamber(SESubstanceManager& substances); virtual ~SEAnesthesiaMachineChamber(); - virtual void Clear(); + virtual void Invalidate(); - virtual bool Load(const CDM::AnesthesiaMachineChamberData& in); - virtual CDM::AnesthesiaMachineChamberData* Unload() const; - -protected: - virtual void Unload(CDM::AnesthesiaMachineChamberData& data) const; - - virtual void Merge(const SEAnesthesiaMachineChamber& from); - -public: virtual const SEScalar* GetScalar(const char* name); virtual const SEScalar* GetScalar(const std::string& name); - virtual CDM::enumOnOff::value GetState() const; - virtual void SetState(CDM::enumOnOff::value name); + virtual SEOnOff GetState() const; + virtual void SetState(SEOnOff name); virtual bool HasState() const; virtual void InvalidateState(); @@ -69,7 +59,10 @@ class BIOGEARS_API SEAnesthesiaMachineChamber : public Loggable { bool operator!=(SEAnesthesiaMachineChamber const& rhs) const; protected: - CDM::enumOnOff::value m_State; + virtual void Merge(const SEAnesthesiaMachineChamber& from); + +protected: + SEOnOff m_State; const SESubstance* m_Substance; SEScalarFraction* m_SubstanceFraction; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/SEAnesthesiaMachineOxygenBottle.h b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/SEAnesthesiaMachineOxygenBottle.h index a298d175b..61d8b7a42 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/SEAnesthesiaMachineOxygenBottle.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/SEAnesthesiaMachineOxygenBottle.h @@ -13,16 +13,12 @@ specific language governing permissions and limitations under the License. #pragma once #include #include -#include - -CDM_BIND_DECL(AnesthesiaMachineOxygenBottleData) +#include namespace biogears { class SEAnesthesiaMachine; class SESubstanceManager; class SEScalar; -class SEScalarVolume; -class VolumeUnit; namespace io { class Anesthesia; } @@ -36,15 +32,7 @@ class BIOGEARS_API SEAnesthesiaMachineOxygenBottle : public Loggable { SEAnesthesiaMachineOxygenBottle(Logger* logger); virtual ~SEAnesthesiaMachineOxygenBottle(); - virtual void Clear(); - - virtual bool Load(const CDM::AnesthesiaMachineOxygenBottleData& in); - virtual CDM::AnesthesiaMachineOxygenBottleData* Unload() const; - -protected: - virtual void Unload(CDM::AnesthesiaMachineOxygenBottleData& data) const; - - virtual void Merge(const SEAnesthesiaMachineOxygenBottle& from); + virtual void Invalidate(); public: virtual const SEScalar* GetScalar(const char* name); @@ -59,6 +47,9 @@ class BIOGEARS_API SEAnesthesiaMachineOxygenBottle : public Loggable { bool operator==(SEAnesthesiaMachineOxygenBottle const& rhs) const; bool operator!=(SEAnesthesiaMachineOxygenBottle const& rhs) const; +protected: + virtual void Merge(const SEAnesthesiaMachineOxygenBottle& from); + protected: SEScalarVolume* m_Volume; }; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEAnesthesiaMachineAction.h b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEAnesthesiaMachineAction.h index d6c25f333..a47805b24 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEAnesthesiaMachineAction.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEAnesthesiaMachineAction.h @@ -11,7 +11,6 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once #include -#include namespace biogears { namespace io { @@ -23,17 +22,10 @@ class BIOGEARS_API SEAnesthesiaMachineAction : public SEAction { SEAnesthesiaMachineAction(); virtual ~SEAnesthesiaMachineAction(); - virtual void Clear(); + virtual void Invalidate(); virtual bool IsValid() const; - virtual bool Load(const CDM::AnesthesiaMachineActionData& in); - virtual CDM::AnesthesiaMachineActionData* Unload() const; - -protected: - virtual void Unload(CDM::AnesthesiaMachineActionData& data) const; - -public: virtual void ToString(std::ostream& str) const = 0; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEAnesthesiaMachineConfiguration.h b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEAnesthesiaMachineConfiguration.h index 387c6c115..9bb863ec7 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEAnesthesiaMachineConfiguration.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEAnesthesiaMachineConfiguration.h @@ -11,7 +11,6 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once #include -#include namespace biogears { class SEAnesthesiaMachine; @@ -25,17 +24,10 @@ class BIOGEARS_API SEAnesthesiaMachineConfiguration : public SEAnesthesiaMachine static constexpr const char* TypeTag() { return "SEAnesthesiaMachineConfiguration"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; + virtual void Invalidate() override; virtual bool IsValid() const override; - virtual bool Load(const CDM::AnesthesiaMachineConfigurationData& in, std::default_random_engine *rd = nullptr); - virtual CDM::AnesthesiaMachineConfigurationData* Unload() const override; - -protected: - virtual void Unload(CDM::AnesthesiaMachineConfigurationData& data) const; - -public: bool HasConfiguration() const; SEAnesthesiaMachine& GetConfiguration(); const SEAnesthesiaMachine* GetConfiguration() const; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEExpiratoryValveLeak.h b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEExpiratoryValveLeak.h index 9a088d437..8fee87ca7 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEExpiratoryValveLeak.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEExpiratoryValveLeak.h @@ -11,7 +11,6 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once #include -#include namespace biogears { class SEScalar0To1; @@ -27,21 +26,14 @@ class BIOGEARS_API SEExpiratoryValveLeak : public SEAnesthesiaMachineAction { static constexpr const char* TypeTag() { return "SEExpiratoryValveLeak"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; + virtual void Invalidate() override; virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::ExpiratoryValveLeakData& in, std::default_random_engine *rd = nullptr); - virtual CDM::ExpiratoryValveLeakData* Unload() const override; - bool operator==(SEExpiratoryValveLeak const& rhs) const; bool operator!=(SEExpiratoryValveLeak const& rhs) const; -protected: - virtual void Unload(CDM::ExpiratoryValveLeakData& data) const; - -public: virtual bool HasSeverity() const; virtual SEScalar0To1& GetSeverity(); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEExpiratoryValveObstruction.h b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEExpiratoryValveObstruction.h index 3f7d1d57f..3943ee67e 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEExpiratoryValveObstruction.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEExpiratoryValveObstruction.h @@ -11,7 +11,6 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once #include -#include namespace biogears { class SEScalar0To1; @@ -27,21 +26,14 @@ class BIOGEARS_API SEExpiratoryValveObstruction : public SEAnesthesiaMachineActi static constexpr const char* TypeTag() { return "SEExpiratoryValveObstruction"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; + virtual void Invalidate() override; virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::ExpiratoryValveObstructionData& in, std::default_random_engine *rd = nullptr); - virtual CDM::ExpiratoryValveObstructionData* Unload() const override; - bool operator==(SEExpiratoryValveObstruction const& rhs) const; bool operator!=(SEExpiratoryValveObstruction const& rhs) const; -protected: - virtual void Unload(CDM::ExpiratoryValveObstructionData& data) const; - -public: virtual bool HasSeverity() const; virtual SEScalar0To1& GetSeverity(); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEInspiratoryValveLeak.h b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEInspiratoryValveLeak.h index a6b75334c..b877d0399 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEInspiratoryValveLeak.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEInspiratoryValveLeak.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include "biogears/cdm/properties/SEScalar0To1.h" #include -#include namespace biogears { class SEScalar0To1; @@ -28,21 +27,14 @@ class BIOGEARS_API SEInspiratoryValveLeak : public SEAnesthesiaMachineAction { static constexpr const char* TypeTag() { return "SEInspiratoryValveLeak"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; + virtual void Invalidate() override; virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::InspiratoryValveLeakData& in, std::default_random_engine *rd = nullptr); - virtual CDM::InspiratoryValveLeakData* Unload() const override; - bool operator==(SEInspiratoryValveLeak const& rhs) const; bool operator!=(SEInspiratoryValveLeak const& rhs) const; -protected: - virtual void Unload(CDM::InspiratoryValveLeakData& data) const; - -public: virtual bool HasSeverity() const; virtual SEScalar0To1& GetSeverity(); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEInspiratoryValveObstruction.h b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEInspiratoryValveObstruction.h index e0125a1e3..a12da64ee 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEInspiratoryValveObstruction.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEInspiratoryValveObstruction.h @@ -11,7 +11,6 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once #include -#include namespace biogears { class SEScalar0To1; @@ -27,21 +26,14 @@ class BIOGEARS_API SEInspiratoryValveObstruction : public SEAnesthesiaMachineAct static constexpr const char* TypeTag() { return "SEInspiratoryValveObstruction"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; + virtual void Invalidate() override; virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::InspiratoryValveObstructionData& in, std::default_random_engine *rd = nullptr); - virtual CDM::InspiratoryValveObstructionData* Unload() const override; - bool operator==(SEInspiratoryValveObstruction const& rhs) const; bool operator!=(SEInspiratoryValveObstruction const& rhs) const; -protected: - virtual void Unload(CDM::InspiratoryValveObstructionData& data) const; - -public: virtual bool HasSeverity() const; virtual SEScalar0To1& GetSeverity(); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEMaskLeak.h b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEMaskLeak.h index 5c7a92bac..dec2b8e56 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEMaskLeak.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEMaskLeak.h @@ -11,7 +11,6 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once #include -#include namespace biogears { class SEScalar0To1; @@ -27,21 +26,14 @@ class BIOGEARS_API SEMaskLeak : public SEAnesthesiaMachineAction { static constexpr const char* TypeTag() { return "SEMaskLeak"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; + virtual void Invalidate() override; virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::MaskLeakData& in, std::default_random_engine *rd = nullptr); - virtual CDM::MaskLeakData* Unload() const override; - bool operator==(SEMaskLeak const& rhs) const; bool operator!=(SEMaskLeak const& rhs) const; -protected: - virtual void Unload(CDM::MaskLeakData& data) const; - -public: virtual bool HasSeverity() const; virtual SEScalar0To1& GetSeverity(); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEOxygenTankPressureLoss.h b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEOxygenTankPressureLoss.h index 09a303b5d..fd1aa53f6 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEOxygenTankPressureLoss.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEOxygenTankPressureLoss.h @@ -11,12 +11,15 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once #include -#include namespace biogears { class SEScalar0To1; - +namespace io { + class AnesthesiaActions; +} class BIOGEARS_API SEOxygenTankPressureLoss : public SEAnesthesiaMachineAction { + friend io::AnesthesiaActions; + public: SEOxygenTankPressureLoss(); virtual ~SEOxygenTankPressureLoss() override; @@ -24,25 +27,18 @@ class BIOGEARS_API SEOxygenTankPressureLoss : public SEAnesthesiaMachineAction { static constexpr const char* TypeTag() { return "SEOxygenTankPressureLoss"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; + virtual void Invalidate() override; virtual bool IsValid() const override; virtual bool IsActive() const override; virtual void SetActive(bool b); - virtual bool Load(const CDM::OxygenTankPressureLossData& in, std::default_random_engine *rd = nullptr); - virtual CDM::OxygenTankPressureLossData* Unload() const override; - bool operator==(SEOxygenTankPressureLoss const& rhs) const; bool operator!=(SEOxygenTankPressureLoss const& rhs) const; -protected: - virtual void Unload(CDM::OxygenTankPressureLossData& data) const; - -public: virtual void ToString(std::ostream& str) const override; protected: - CDM::enumOnOff::value m_State; + SEOnOff m_State; }; -} \ No newline at end of file +} diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEOxygenWallPortPressureLoss.h b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEOxygenWallPortPressureLoss.h index aa862e5ea..7871306af 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEOxygenWallPortPressureLoss.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEOxygenWallPortPressureLoss.h @@ -11,7 +11,6 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once #include -#include namespace biogears { class SEScalar0To1; @@ -24,25 +23,18 @@ class BIOGEARS_API SEOxygenWallPortPressureLoss : public SEAnesthesiaMachineActi static constexpr const char* TypeTag() { return "SEOxygenWallPortPressureLoss"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; + virtual void Invalidate() override; virtual bool IsValid() const override; virtual bool IsActive() const override; virtual void SetActive(bool b); - virtual bool Load(const CDM::OxygenWallPortPressureLossData& in, std::default_random_engine *rd = nullptr); - virtual CDM::OxygenWallPortPressureLossData* Unload() const override; - bool operator==(SEOxygenWallPortPressureLoss const& rhs) const; bool operator!=(SEOxygenWallPortPressureLoss const& rhs) const; -protected: - virtual void Unload(CDM::OxygenWallPortPressureLossData& data) const; - -public: virtual void ToString(std::ostream& str) const override; protected: - CDM::enumOnOff::value m_State; + SEOnOff m_State; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SESodaLimeFailure.h b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SESodaLimeFailure.h index 5d797692c..40ce827f4 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SESodaLimeFailure.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SESodaLimeFailure.h @@ -11,7 +11,6 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once #include -#include namespace biogears { class SEScalar0To1; @@ -27,18 +26,11 @@ class BIOGEARS_API SESodaLimeFailure : public SEAnesthesiaMachineAction { static constexpr const char* TypeTag() { return "SESodaLimeFailure"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; + virtual void Invalidate() override; virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::SodaLimeFailureData& in, std::default_random_engine *rd = nullptr); - virtual CDM::SodaLimeFailureData* Unload() const override; - -protected: - virtual void Unload(CDM::SodaLimeFailureData& data) const; - -public: virtual bool HasSeverity() const; virtual SEScalar0To1& GetSeverity(); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SETubeCuffLeak.h b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SETubeCuffLeak.h index 0dad48a45..6f97a4e59 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SETubeCuffLeak.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SETubeCuffLeak.h @@ -11,7 +11,6 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once #include -#include namespace biogears { class SEScalar0To1; @@ -27,18 +26,11 @@ class BIOGEARS_API SETubeCuffLeak : public SEAnesthesiaMachineAction { static constexpr const char* TypeTag() { return "SETubeCuffLeak"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; + virtual void Invalidate() override; virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::TubeCuffLeakData& in, std::default_random_engine *rd = nullptr); - virtual CDM::TubeCuffLeakData* Unload() const override; - -protected: - virtual void Unload(CDM::TubeCuffLeakData& data) const; - -public: virtual bool HasSeverity() const; virtual SEScalar0To1& GetSeverity(); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEVaporizerFailure.h b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEVaporizerFailure.h index 6a32b4357..6ceca1832 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEVaporizerFailure.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEVaporizerFailure.h @@ -11,7 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once #include -#include + namespace biogears { class SEScalar0To1; @@ -27,18 +27,11 @@ class BIOGEARS_API SEVaporizerFailure : public SEAnesthesiaMachineAction { static constexpr const char* TypeTag() { return "SEVaporizerFailure"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; + virtual void Invalidate() override; virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::VaporizerFailureData& in, std::default_random_engine *rd = nullptr); - virtual CDM::VaporizerFailureData* Unload() const override; - -protected: - virtual void Unload(CDM::VaporizerFailureData& data) const; - -public: virtual bool HasSeverity() const; virtual SEScalar0To1& GetSeverity(); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEVentilatorPressureLoss.h b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEVentilatorPressureLoss.h index a3c6fd2db..d49854a2c 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEVentilatorPressureLoss.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEVentilatorPressureLoss.h @@ -11,7 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once #include -#include + namespace biogears { class SEScalar0To1; @@ -27,18 +27,11 @@ class BIOGEARS_API SEVentilatorPressureLoss : public SEAnesthesiaMachineAction { static constexpr const char* TypeTag() { return "SEVentilatorPressureLoss"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; + virtual void Invalidate() override; virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::VentilatorPressureLossData& in, std::default_random_engine *rd = nullptr); - virtual CDM::VentilatorPressureLossData* Unload() const override; - -protected: - virtual void Unload(CDM::VentilatorPressureLossData& data) const; - -public: virtual bool HasSeverity() const; virtual SEScalar0To1& GetSeverity(); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEYPieceDisconnect.h b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEYPieceDisconnect.h index 613c20fc1..fab892a62 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEYPieceDisconnect.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Anesthesia/actions/SEYPieceDisconnect.h @@ -11,7 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once #include -#include + namespace biogears { class SEScalar0To1; @@ -27,18 +27,11 @@ class BIOGEARS_API SEYPieceDisconnect : public SEAnesthesiaMachineAction { static constexpr const char* TypeTag() { return "SEYPeiceDisconnect"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; + virtual void Invalidate() override; virtual bool IsValid() const override; virtual bool IsActive() const override; - virtual bool Load(const CDM::YPieceDisconnectData& in, std::default_random_engine *rd = nullptr); - virtual CDM::YPieceDisconnectData* Unload() const override; - -protected: - virtual void Unload(CDM::YPieceDisconnectData& data) const; - -public: virtual bool HasSeverity() const; virtual SEScalar0To1& GetSeverity(); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGram.h b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGram.h index 147195de8..158bd9a6e 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGram.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGram.h @@ -12,11 +12,9 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include namespace biogears { -class SEScalarElectricPotential; -class ElectricPotentialUnit; namespace io { class ElectroCardioGram; } @@ -33,22 +31,16 @@ class SEElectroCardioGram : public SESystem { BIOGEARS_API const char* classname() const override { return TypeTag(); } BIOGEARS_API size_t hash_code() const override { return TypeHash(); } - BIOGEARS_API void Clear() override; + BIOGEARS_API void Invalidate() override; BIOGEARS_API const SEScalar* GetScalar(const char* name) override; BIOGEARS_API const SEScalar* GetScalar(const std::string& name) override; - BIOGEARS_API bool Load(const CDM::ElectroCardioGramData& in); - BIOGEARS_API CDM::ElectroCardioGramData* Unload() const override; BIOGEARS_API Tree GetPhysiologyRequestGraph() const override; BIOGEARS_API bool operator==(SEElectroCardioGram const&) const; BIOGEARS_API bool operator!=(SEElectroCardioGram const&) const; -protected: - BIOGEARS_API void Unload(CDM::ElectroCardioGramData& data) const; - -public: BIOGEARS_API bool HasLead1ElectricPotential() const; BIOGEARS_API SEScalarElectricPotential& GetLead1ElectricPotential(); BIOGEARS_API double GetLead1ElectricPotential(const ElectricPotentialUnit& unit) const; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramInterpolationWaveform.h b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramInterpolationWaveform.h index a0151ab3b..c5ddbc8b3 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramInterpolationWaveform.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramInterpolationWaveform.h @@ -13,12 +13,12 @@ specific language governing permissions and limitations under the License. #pragma once #include +#include #include #include -#include -#include +#include -CDM_BIND_DECL(ElectroCardioGramInterpolationWaveformData) +#include namespace biogears { @@ -32,25 +32,18 @@ class BIOGEARS_API SEElectroCardioGramInterpolationWaveform : public Loggable { SEElectroCardioGramInterpolationWaveform(Logger* logger); virtual ~SEElectroCardioGramInterpolationWaveform(); - virtual void Clear(); // Deletes all members - - virtual bool Load(const CDM::ElectroCardioGramInterpolationWaveformData& in); - virtual CDM::ElectroCardioGramInterpolationWaveformData* Unload() const; + virtual void Invalidate(); // Deletes all members bool operator==(SEElectroCardioGramInterpolationWaveform const&) const; bool operator!=(SEElectroCardioGramInterpolationWaveform const&) const; -protected: - virtual void Unload(CDM::ElectroCardioGramInterpolationWaveformData& data) const; - -public: virtual bool HasLeadNumber() const; - virtual CDM::ElectroCardioGramWaveformLeadNumberData GetLeadNumber() const; - virtual void SetLeadNumber(CDM::ElectroCardioGramWaveformLeadNumberData n); + virtual SEElectroCardioGramWaveformLeadNumber GetLeadNumber() const; + virtual void SetLeadNumber(SEElectroCardioGramWaveformLeadNumber n); virtual void InvalidateLeadNumber(); - virtual CDM::enumHeartRhythm::value GetRhythm() const; - virtual void SetRhythm(CDM::enumHeartRhythm::value name); + virtual SEHeartRhythm GetRhythm() const; + virtual void SetRhythm(SEHeartRhythm name); virtual bool HasRhythm() const; virtual void InvalidateRhythm(); @@ -65,8 +58,8 @@ class BIOGEARS_API SEElectroCardioGramInterpolationWaveform : public Loggable { virtual std::vector& GetActiveIndicies() { return m_ActiveIndicies; } protected: - CDM::ElectroCardioGramWaveformLeadNumberData m_LeadNumber; - CDM::enumHeartRhythm::value m_Rhythm; + SEElectroCardioGramWaveformLeadNumber m_LeadNumber; + SEHeartRhythm m_Rhythm; SEScalarTime* m_TimeStep; SEFunctionElectricPotentialVsTime* m_Data; std::vector m_ActiveIndicies; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramInterpolator.h b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramInterpolator.h index 6a3096e52..6dc5177c3 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramInterpolator.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramInterpolator.h @@ -11,25 +11,32 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once -#include + +#include + #include -#include -CDM_BIND_DECL(ElectroCardioGramInterpolatorData) +#include +#include +#include +#include +#include namespace biogears { -class SEScalarElectricPotential; class SEElectroCardioGramInterpolationWaveform; namespace io { class ElectroCardioGram; } -} //namespace biogears +} // namespace biogears +#pragma warning(disable : 4661) + namespace std { -BG_EXT template class BIOGEARS_API map; -BG_EXT template class BIOGEARS_API map; -BG_EXT template class BIOGEARS_API map>; +extern template class map; +extern template class map; +extern template class map>; } +#pragma warning(default : 4661) namespace biogears { class SEElectroCardioGramInterpolator : public Loggable { @@ -39,39 +46,33 @@ class SEElectroCardioGramInterpolator : public Loggable { BIOGEARS_API SEElectroCardioGramInterpolator(Logger* logger); BIOGEARS_API virtual ~SEElectroCardioGramInterpolator(); - BIOGEARS_API virtual void Clear(); // Deletes all members + BIOGEARS_API virtual void Invalidate(); // Deletes all members BIOGEARS_API virtual bool LoadWaveforms(const char* file, const SEScalarTime* timeStep = nullptr); BIOGEARS_API virtual bool LoadWaveforms(const std::string& file, const SEScalarTime* timeStep = nullptr); - BIOGEARS_API virtual bool Load(const CDM::ElectroCardioGramInterpolatorData& in); - - BIOGEARS_API virtual CDM::ElectroCardioGramInterpolatorData* Unload() const; BIOGEARS_API bool operator==(SEElectroCardioGramInterpolator const&) const; BIOGEARS_API bool operator!=(SEElectroCardioGramInterpolator const&) const; -protected: - BIOGEARS_API virtual void Unload(CDM::ElectroCardioGramInterpolatorData& data) const; - public: BIOGEARS_API virtual void Interpolate(const SEScalarTime& timeStep); - BIOGEARS_API virtual bool StartNewCycle(CDM::enumHeartRhythm::value rhythm); + BIOGEARS_API virtual bool StartNewCycle(SEHeartRhythm rhythm); BIOGEARS_API virtual void CalculateWaveformsElectricPotential(); // These are where the interpolator will put the interpolated electric potential data for each lead when you call CalculateWaveformsElectricPotential // You must have a waveform for the lead of the current rhythm for these scalars to be populated - BIOGEARS_API virtual bool CanInterpolateLeadPotential(CDM::ElectroCardioGramWaveformLeadNumberData lead, CDM::enumHeartRhythm::value rhythm) const; - BIOGEARS_API virtual void SetLeadElectricPotential(CDM::ElectroCardioGramWaveformLeadNumberData lead, SEScalarElectricPotential& ep); + BIOGEARS_API virtual bool CanInterpolateLeadPotential(biogears::SEElectroCardioGramWaveformLeadNumber lead, SEHeartRhythm rhythm) const; + BIOGEARS_API virtual void SetLeadElectricPotential(biogears::SEElectroCardioGramWaveformLeadNumber lead, SEScalarElectricPotential& ep); - BIOGEARS_API virtual bool HasWaveform(CDM::ElectroCardioGramWaveformLeadNumberData lead, CDM::enumHeartRhythm::value rhythm) const; - BIOGEARS_API virtual SEElectroCardioGramInterpolationWaveform& GetWaveform(CDM::ElectroCardioGramWaveformLeadNumberData lead, CDM::enumHeartRhythm::value rhythm); - BIOGEARS_API virtual const SEElectroCardioGramInterpolationWaveform* GetWaveform(CDM::ElectroCardioGramWaveformLeadNumberData lead, CDM::enumHeartRhythm::value rhythm) const; - BIOGEARS_API virtual void RemoveWaveform(CDM::ElectroCardioGramWaveformLeadNumberData lead, CDM::enumHeartRhythm::value rhythm); + BIOGEARS_API virtual bool HasWaveform(biogears::SEElectroCardioGramWaveformLeadNumber lead, SEHeartRhythm rhythm) const; + BIOGEARS_API virtual SEElectroCardioGramInterpolationWaveform& GetWaveform(biogears::SEElectroCardioGramWaveformLeadNumber lead, SEHeartRhythm rhythm); + BIOGEARS_API virtual const SEElectroCardioGramInterpolationWaveform* GetWaveform(biogears::SEElectroCardioGramWaveformLeadNumber lead, SEHeartRhythm rhythm) const; + BIOGEARS_API virtual void RemoveWaveform(biogears::SEElectroCardioGramWaveformLeadNumber lead, SEHeartRhythm rhythm); protected: BIOGEARS_API virtual void Interpolate(SEElectroCardioGramInterpolationWaveform& waveform, const SEScalarTime& timeStep); - std::map m_Leads; - std::map> m_Waveforms; + std::map m_Leads; + std::map> m_Waveforms; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramInterpolatorWaveform.h b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramInterpolatorWaveform.h deleted file mode 100644 index e03f8d8c6..000000000 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramInterpolatorWaveform.h +++ /dev/null @@ -1,71 +0,0 @@ -/************************************************************************************** -Copyright 2015 Applied Research Associates, Inc. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the License -at: -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software distributed under -the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -CONDITIONS OF ANY KIND, either express or implied. See the License for the -specific language governing permissions and limitations under the License. -**************************************************************************************/ - -#pragma once -#include - -#include -#include -#include -#include - -CDM_BIND_DECL(ElectroCardioGramInterpolationWaveformData) - -namespace biogears { - -namespace io { - class ElectroCardioGram; -} -class BIOGEARS_API SEElectroCardioGramInterpolatorWaveform : public Loggable { - friend io::ElectroCardioGram; - -public: - SEElectroCardioGramInterpolatorWaveform(Logger* logger); - virtual ~SEElectroCardioGramInterpolatorWaveform(); - - virtual void Clear(); // Deletes all members - - virtual bool Load(const CDM::ElectroCardioGramInterpolationWaveformData& in); - virtual CDM::ElectroCardioGramInterpolationWaveformData* Unload() const; - -protected: - virtual void Unload(CDM::ElectroCardioGramInterpolationWaveformData& data) const; - -public: - virtual bool HasLeadNumber() const; - virtual CDM::ElectroCardioGramWaveformLeadNumberData GetLeadNumber() const; - virtual void SetLeadNumber(CDM::ElectroCardioGramWaveformLeadNumberData n); - virtual void InvalidateLeadNumber(); - - virtual CDM::enumHeartRhythm::value GetRhythm() const; - virtual void SetRhythm(CDM::enumHeartRhythm::value name); - virtual bool HasRhythm() const; - virtual void InvalidateRhythm(); - - virtual bool HasData() const; - virtual SEFunctionElectricPotentialVsTime& GetData(); - virtual const SEFunctionElectricPotentialVsTime* GetData() const; - - virtual bool HasTimeStep() const; - virtual SEScalarTime& GetTimeStep(); - virtual double GetTimeStep(const TimeUnit& unit) const; - - virtual std::vector& GetActiveIndicies() { return m_ActiveIndicies; } - -protected: - CDM::ElectroCardioGramWaveformLeadNumberData m_LeadNumber; - CDM::enumHeartRhythm::value m_Rhythm; - SEScalarTime* m_TimeStep; - SEFunctionElectricPotentialVsTime* m_Data; - std::vector m_ActiveIndicies; -}; -} \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramWaveformLeadNumber.h b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramWaveformLeadNumber.h index 3d5aa5722..9cb1284c2 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramWaveformLeadNumber.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramWaveformLeadNumber.h @@ -15,10 +15,6 @@ specific language governing permissions and limitations under the License. #include #include -#include -#include - -CDM_BIND_DECL(ElectroCardioGramInterpolationWaveformData) namespace biogears { @@ -33,12 +29,9 @@ class BIOGEARS_API SEElectroCardioGramWaveformLeadNumber : public Loggable { public: SEElectroCardioGramWaveformLeadNumber(Logger* logger); - SEElectroCardioGramWaveformLeadNumber(Logger* logger, int value); + SEElectroCardioGramWaveformLeadNumber(int value, Logger* logger = nullptr); ~SEElectroCardioGramWaveformLeadNumber() override; - bool Load(const CDM::ElectroCardioGramWaveformLeadNumberData& in); - CDM::ElectroCardioGramWaveformLeadNumberData* Unload() const; - operator int&(); operator int() const; @@ -46,9 +39,6 @@ class BIOGEARS_API SEElectroCardioGramWaveformLeadNumber : public Loggable { bool operator==(SEElectroCardioGramWaveformLeadNumber const&) const; bool operator!=(SEElectroCardioGramWaveformLeadNumber const&) const; -protected: - void Unload(CDM::ElectroCardioGramWaveformLeadNumberData& data) const; - public: int GetValue() const; void SetValue(int); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Inhaler/SEInhaler.h b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Inhaler/SEInhaler.h index 3aa46f564..d1bb331dc 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Inhaler/SEInhaler.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Inhaler/SEInhaler.h @@ -11,20 +11,17 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once +#include + #include -#include -#include +#include +#include namespace biogears { class Serializer; class SESubstance; class SESubstanceManager; class SEInhalerConfiguration; -class SEScalarVolume; -class VolumeUnit; -class SEScalarMass; -class MassUnit; -class SEScalarFraction; namespace io { class Inhaler; @@ -43,7 +40,7 @@ class BIOGEARS_API SEInhaler : public SESystem { const char* classname() const override { return TypeTag(); } size_t hash_code() const override { return TypeHash(); } - void Clear() override; + void Invalidate() override; /** @name GetScalar * @brief - A reflextion type call that will return the Scalar associated @@ -56,13 +53,9 @@ class BIOGEARS_API SEInhaler : public SESystem { const SEScalar* GetScalar(const char* name) override; const SEScalar* GetScalar(const std::string& name) override; - bool Load(const CDM::InhalerData& in); - CDM::InhalerData* Unload() const override; Tree GetPhysiologyRequestGraph() const override; protected: - void Unload(CDM::InhalerData& data) const; - /** @name StateChange * @brief - This method is called when ever there is a state change * Specically a new file has been loaded, configuration action, or the system reset @@ -75,8 +68,8 @@ class BIOGEARS_API SEInhaler : public SESystem { public: bool Load(const std::string& file); - CDM::enumOnOff::value GetState() const; - void SetState(CDM::enumOnOff::value name); + SEOnOff GetState() const; + void SetState(SEOnOff name); bool HasState() const; void InvalidateState(); @@ -102,7 +95,7 @@ class BIOGEARS_API SEInhaler : public SESystem { protected: std::stringstream m_ss; - CDM::enumOnOff::value m_State; + SEOnOff m_State; SEScalarMass* m_MeteredDose; SEScalarFraction* m_NozzleLoss; SEScalarVolume* m_SpacerVolume; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Inhaler/actions/SEInhalerAction.h b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Inhaler/actions/SEInhalerAction.h index 1dcb1dea5..581833f6d 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Inhaler/actions/SEInhalerAction.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Inhaler/actions/SEInhalerAction.h @@ -11,7 +11,6 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once #include -#include namespace biogears { class BIOGEARS_API SEInhalerAction : public SEAction { @@ -19,17 +18,10 @@ class BIOGEARS_API SEInhalerAction : public SEAction { SEInhalerAction(); virtual ~SEInhalerAction(); - virtual void Clear(); // Deletes all members + virtual void Invalidate(); // Deletes all members virtual bool IsValid() const; - virtual bool Load(const CDM::InhalerActionData& in); - virtual CDM::InhalerActionData* Unload() const; - -protected: - virtual void Unload(CDM::InhalerActionData& data) const; - -public: virtual void ToString(std::ostream& str) const = 0; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Inhaler/actions/SEInhalerConfiguration.h b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Inhaler/actions/SEInhalerConfiguration.h index e107b97c3..19c961aeb 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Inhaler/actions/SEInhalerConfiguration.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/equipment/Inhaler/actions/SEInhalerConfiguration.h @@ -12,7 +12,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include namespace biogears { class SEInhaler; @@ -30,17 +29,10 @@ class BIOGEARS_API SEInhalerConfiguration : public SEInhalerAction { static constexpr const char* TypeTag() { return "SEInhalerConfiguration"; }; const char* classname() const override { return TypeTag(); } - virtual void Clear() override; + virtual void Invalidate() override; virtual bool IsValid() const override; - virtual bool Load(const CDM::InhalerConfigurationData& in, std::default_random_engine *rd = nullptr); - virtual CDM::InhalerConfigurationData* Unload() const override; - -protected: - virtual void Unload(CDM::InhalerConfigurationData& data) const; - -public: bool HasConfiguration() const; SEInhaler& GetConfiguration(); const SEInhaler* GetConfiguration() const; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SEBloodChemistrySystem.h b/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SEBloodChemistrySystem.h index 771a53571..4bfd5bc2b 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SEBloodChemistrySystem.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SEBloodChemistrySystem.h @@ -11,29 +11,13 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once +#include +#include +#include #include -#include -#include namespace biogears { -class SEScalar; -class SEScalar0To1; -class SEScalarMass; -class MassUnit; -class SEScalarTime; -class TimeUnit; -class SEScalarMassPerVolume; -class MassPerVolumeUnit; -class SEScalarHeatCapacitancePerMass; -class HeatCapacitancePerMassUnit; -class SEScalarFraction; -class SEScalarVolume; -class VolumeUnit; -class SEScalarAmountPerVolume; -class AmountPerVolumeUnit; -class SEScalarPressure; -class PressureUnit; class SEInflammatoryResponse; namespace io { @@ -54,22 +38,16 @@ class BIOGEARS_API SEBloodChemistrySystem : public SESystem { const char* classname() const override { return TypeTag(); } size_t hash_code() const override { return TypeHash(); } - void Clear() override; /**< @copydoc DOXY_CDM_CLEAR */ + void Invalidate() override; /**< @copydoc DOXY_CDM_CLEAR */ const SEScalar* GetScalar(const char* name) override; const SEScalar* GetScalar(const std::string& name) override; /**< @copydoc DOXY_CDM_GET_SCALAR */ - /** @name Serialization */ //@{ - bool Load(const CDM::BloodChemistrySystemData& in); /**< @copydoc DOXY_CDM_LOAD */ - CDM::BloodChemistrySystemData* Unload() const override; /**< @copydoc DOXY_CDM_UNLOAD */ - Tree GetPhysiologyRequestGraph() const override; bool operator==(SEBloodChemistrySystem const&) const; bool operator!=(SEBloodChemistrySystem const&) const; -protected: - void Unload(CDM::BloodChemistrySystemData& data) const; /**< @copydoc DOXY_CDM_UNLOAD_TO */ //@} public: /** @name BloodDensity */ //@{ @copybrief Physiology_BloodChemistrySystemData_BloodDensity bool HasBloodDensity() const; /**< @copydoc DOXY_CDM_HAS */ @@ -484,10 +462,7 @@ class BIOGEARS_API SEInflammatoryResponse { const char* classname() const { return TypeTag(); } size_t hash_code() const { return TypeHash(); } - void Clear(); - - bool Load(const CDM::InflammatoryResponseData& in); - CDM::InflammatoryResponseData* Unload() const; + void Invalidate(); bool IsValid(); void Initialize(); @@ -497,9 +472,6 @@ class BIOGEARS_API SEInflammatoryResponse { bool operator==(SEInflammatoryResponse const&) const; bool operator!=(SEInflammatoryResponse const&) const; -protected: - void Unload(CDM::InflammatoryResponseData& data) const; - public: bool HasLocalPathogen() const; SEScalar& GetLocalPathogen(); @@ -517,9 +489,9 @@ class BIOGEARS_API SEInflammatoryResponse { SEScalar& GetLocalNeutrophil(); double GetLocalNeutrophil() const; - bool HasActiveTLR() const { return m_ActiveTLR == CDM::enumOnOff::value(-1) ? false : true; }; - CDM::enumOnOff GetActiveTLR() { return m_ActiveTLR; }; - void SetActiveTLR(CDM::enumOnOff value) { m_ActiveTLR = value; }; + bool HasActiveTLR() const { return m_ActiveTLR == SEOnOff(-1) ? false : true; }; + SEOnOff GetActiveTLR() { return m_ActiveTLR; }; + void SetActiveTLR(SEOnOff value) { m_ActiveTLR = value; }; bool HasAutonomicResponseLevel() const; SEScalar& GetAutonomicResponseLevel(); @@ -598,8 +570,8 @@ class BIOGEARS_API SEInflammatoryResponse { double GetInflammationTime(const TimeUnit& unit) const; bool HasInflammationSources() const; - std::vector& GetInflammationSources(); - bool HasInflammationSource(CDM::enumInflammationSource::value src); + std::vector& GetInflammationSources(); + bool HasInflammationSource(SEInflammationSource src); Tree GetPhysiologyRequestGraph() const; @@ -608,7 +580,7 @@ class BIOGEARS_API SEInflammatoryResponse { SEScalar* m_LocalMacrophage; SEScalar* m_LocalNeutrophil; SEScalar* m_LocalBarrier; - CDM::enumOnOff::value m_ActiveTLR; + SEOnOff m_ActiveTLR; SEScalar* m_AutonomicResponseLevel; SEScalar* m_Catecholamines; SEScalar* m_ConstitutiveNOS; @@ -628,6 +600,6 @@ class BIOGEARS_API SEInflammatoryResponse { SEScalar* m_Trauma; SEScalar* m_TumorNecrosisFactor; SEScalarTime* m_InflammationTime; - std::vector m_InflammationSources; + std::vector m_InflammationSources; }; } diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SECardiovascularSystem.h b/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SECardiovascularSystem.h index 17ae7e0b8..ec4e8438b 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SECardiovascularSystem.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SECardiovascularSystem.h @@ -11,26 +11,20 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include namespace biogears { -class SEScalarPressure; -class PressureUnit; -class SEScalarVolume; -class VolumeUnit; -class SEScalarVolumePerTimeArea; -class VolumePerTimeAreaUnit; -class SEScalarVolumePerTime; -class VolumePerTimeUnit; -class SEScalarFraction; -class FractionUnit; -class SEScalarFrequency; -class FrequencyUnit; -class SEScalarFlowResistance; -class FlowResistanceUnit; -class SEScalarPressureTimePerVolumeArea; -class PressureTimePerVolumeAreaUnit; namespace io { class Physiology; } @@ -46,22 +40,16 @@ class BIOGEARS_API SECardiovascularSystem : public SESystem { const char* classname() const override { return TypeTag(); } size_t hash_code() const override { return TypeHash(); } - void Clear() override; //! Deletes all members + void Invalidate() override; //! Deletes all members const SEScalar* GetScalar(const char* name) override; const SEScalar* GetScalar(const std::string& name) override; - bool Load(const CDM::CardiovascularSystemData& in); - CDM::CardiovascularSystemData* Unload() const override; - Tree GetPhysiologyRequestGraph() const override; bool operator==(SECardiovascularSystem const&) const; bool operator!=(SECardiovascularSystem const&) const; -protected: - void Unload(CDM::CardiovascularSystemData& data) const; - public: bool HasArterialPressure() const; SEScalarPressure& GetArterialPressure(); @@ -119,8 +107,8 @@ class BIOGEARS_API SECardiovascularSystem : public SESystem { SEScalarFrequency& GetHeartRate(); double GetHeartRate(const FrequencyUnit& unit) const; - CDM::enumHeartRhythm::value GetHeartRhythm() const; - void SetHeartRhythm(CDM::enumHeartRhythm::value Rhythm); + SEHeartRhythm GetHeartRhythm() const; + void SetHeartRhythm(SEHeartRhythm Rhythm); bool HasHeartRhythm() const; void InvalidateHeartRhythm(); @@ -219,7 +207,7 @@ class BIOGEARS_API SECardiovascularSystem : public SESystem { SEScalarPressure* m_ExtremityPressureRightLeg; SEScalarFraction* m_HeartEjectionFraction; SEScalarFrequency* m_HeartRate; - CDM::enumHeartRhythm::value m_HeartRhythm; + SEHeartRhythm m_HeartRhythm; SEScalarVolume* m_HeartStrokeVolume; SEScalarPressure* m_IntracranialPressure; SEScalarPressure* m_MeanArterialPressure; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SEDrugSystem.h b/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SEDrugSystem.h index 874bbff07..df6b90496 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SEDrugSystem.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SEDrugSystem.h @@ -13,21 +13,17 @@ specific language governing permissions and limitations under the License. #pragma once #include +#include #include #include -#include +#include +#include +#include +#include namespace biogears { class SEScalar; class SEScalarFraction; -class SEScalarTemperature; -class TemperatureUnit; -class SEScalarPressure; -class PressureUnit; -class SEScalarFrequency; -class FrequencyUnit; -class SEScalarVolume; -class VolumeUnit; namespace io { class Physiology; } @@ -43,22 +39,16 @@ class BIOGEARS_API SEDrugSystem : public SESystem { const char* classname() const override { return TypeTag(); } size_t hash_code() const override { return TypeHash(); } - void Clear() override; // Deletes all members + void Invalidate() override; // Deletes all members const SEScalar* GetScalar(const char* name) override; const SEScalar* GetScalar(const std::string& name) override; - bool Load(const CDM::DrugSystemData& in); - CDM::DrugSystemData* Unload() const override; - Tree GetPhysiologyRequestGraph() const override; bool operator==(SEDrugSystem const&) const; bool operator!=(SEDrugSystem const&) const; -protected: - void Unload(CDM::DrugSystemData& data) const; - public: bool HasAntibioticActivity() const; SEScalar& GetAntibioticActivity(); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SEEndocrineSystem.h b/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SEEndocrineSystem.h index 8b723425a..9c34b5426 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SEEndocrineSystem.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SEEndocrineSystem.h @@ -12,22 +12,11 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include +#include namespace biogears { class SEScalarFraction; -class SEScalarMass; -class MassUnit; -class SEScalarTemperature; -class TemperatureUnit; -class SEScalarAmountPerTime; -class AmountPerTimeUnit; -class SEScalarPressure; -class PressureUnit; -class SEScalarMassPerTime; -class MassPerTimeUnit; -class SEScalarPower; -class PowerUnit; namespace io { class Physiology; } @@ -43,22 +32,16 @@ class BIOGEARS_API SEEndocrineSystem : public SESystem { const char* classname() const override { return TypeTag(); } size_t hash_code() const override { return TypeHash(); } - void Clear() override; // Deletes all members + void Invalidate() override; // Deletes all members const SEScalar* GetScalar(const char* name) override; const SEScalar* GetScalar(const std::string& name) override; - bool Load(const CDM::EndocrineSystemData& in); - CDM::EndocrineSystemData* Unload() const override; - Tree GetPhysiologyRequestGraph() const override; bool operator==(SEEndocrineSystem const&) const; bool operator!=(SEEndocrineSystem const&) const; -protected: - void Unload(CDM::EndocrineSystemData& data) const; - public: bool HasInsulinSynthesisRate() const; SEScalarAmountPerTime& GetInsulinSynthesisRate(); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SEEnergySystem.h b/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SEEnergySystem.h index 47314af98..be722882b 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SEEnergySystem.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SEEnergySystem.h @@ -11,23 +11,12 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once +#include +#include #include -#include namespace biogears { class SEScalarFraction; -class SEScalarMass; -class MassUnit; -class SEScalarTemperature; -class TemperatureUnit; -class SEScalarAmountPerTime; -class AmountPerTimeUnit; -class SEScalarPressure; -class PressureUnit; -class SEScalarMassPerTime; -class MassPerTimeUnit; -class SEScalarPower; -class PowerUnit; namespace io { class Physiology; @@ -44,22 +33,16 @@ class BIOGEARS_API SEEnergySystem : public SESystem { const char* classname() const override { return TypeTag(); } size_t hash_code() const override { return TypeHash(); } - void Clear() override; // Deletes all members + void Invalidate() override; // Deletes all members const SEScalar* GetScalar(const char* name) override; const SEScalar* GetScalar(const std::string& name) override; - bool Load(const CDM::EnergySystemData& in); - CDM::EnergySystemData* Unload() const override; - Tree GetPhysiologyRequestGraph() const override; bool operator==(SEEnergySystem const&) const; bool operator!=(SEEnergySystem const&) const; -protected: - void Unload(CDM::EnergySystemData& data) const; - public: bool HasAchievedExerciseLevel() const; SEScalarFraction& GetAchievedExerciseLevel(); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SEGastrointestinalSystem.h b/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SEGastrointestinalSystem.h index a68559bfc..f04c32f68 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SEGastrointestinalSystem.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SEGastrointestinalSystem.h @@ -12,27 +12,28 @@ specific language governing permissions and limitations under the License. #pragma once #include +#include +#include #include -#include +#include +#include #include namespace biogears { -class SEScalarMass; -class MassUnit; -class SEScalarVolumePerTime; -class VolumePerTimeUnit; -class SESubstance; class SEDrugTransitState; +class SESubstance; namespace io { class Physiology; } -} //namespace biogears +} // namespace biogears +#pragma warning(disable : 4661) namespace std { -BG_EXT template class BIOGEARS_API map; +extern template class map; } +#pragma warning(default : 4661) namespace biogears { class BIOGEARS_API SEGastrointestinalSystem : public SESystem { @@ -47,7 +48,7 @@ class BIOGEARS_API SEGastrointestinalSystem : public SESystem { const char* classname() const override { return TypeTag(); } size_t hash_code() const override { return TypeHash(); } - void Clear() override; // Deletes all members + void Invalidate() override; // Deletes all members const SEScalar* GetScalar(const char* name) override; const SEScalar* GetScalar(const std::string& name) override; @@ -68,14 +69,8 @@ class BIOGEARS_API SEGastrointestinalSystem : public SESystem { SEDrugTransitState* GetDrugTransitState(const SESubstance* sub); SEDrugTransitState* NewDrugTransitState(const SESubstance* sub); - bool Load(const CDM::GastrointestinalSystemData& in); - CDM::GastrointestinalSystemData* Unload() const override; - Tree GetPhysiologyRequestGraph() const override; -protected: - void Unload(CDM::GastrointestinalSystemData& data) const; - protected: SEScalarVolumePerTime* m_ChymeAbsorptionRate; SENutrition* m_StomachContents; @@ -83,32 +78,30 @@ class BIOGEARS_API SEGastrointestinalSystem : public SESystem { }; class BIOGEARS_API SEDrugTransitState { + friend io::Physiology; public: SEDrugTransitState(const SESubstance& sub); ~SEDrugTransitState(); - virtual void Clear(); + virtual void Invalidate(); - virtual bool Load(const CDM::DrugTransitStateData& in); - virtual CDM::DrugTransitStateData* Unload() const; - - bool Initialize(SEScalarMass& dose, CDM::enumOralAdministration::value route); + bool Initialize(SEScalarMass& dose, SEOralAdministrationType route); std::vector GetLumenSolidMasses(const MassUnit& unit); std::vector GetLumenDissolvedMasses(const MassUnit& unit); std::vector GetEnterocyteMasses(const MassUnit& unit); - + bool SetLumenSolidMasses(std::vector& tsolid, const MassUnit& unit); bool SetLumenDissolvedMasses(std::vector& tdis, const MassUnit& unit); bool SetEnterocyteMasses(std::vector& esolid, const MassUnit& unit); - + void IncrementStomachDissolvedMass(double value, const MassUnit& unit); void IncrementStomachSolidMass(double value, const MassUnit& unit); - + double GetTotalSolidMassInLumen(const MassUnit& unit); double GetTotalDissolvedMassInLumen(const MassUnit& unit); double GetTotalMassInEnterocytes(const MassUnit& unit); - + SEScalarMass& GetTotalMassMetabolized(); SEScalarMass& GetTotalMassExcreted(); @@ -116,7 +109,7 @@ class BIOGEARS_API SEDrugTransitState { bool operator!=(SEDrugTransitState const&) const; protected: - virtual void Unload(CDM::DrugTransitStateData& data) const; + const SESubstance* m_Substance; std::vector m_LumenSolidMasses; std::vector m_LumenDissolvedMasses; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SEHepaticSystem.h b/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SEHepaticSystem.h index 5e5005bb4..217c75d00 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SEHepaticSystem.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SEHepaticSystem.h @@ -12,13 +12,11 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include +#include +#include namespace biogears { -class SEScalarAmountPerTime; -class AmountPerTimeUnit; -class SEScalarMassPerTime; -class MassPerTimeUnit; namespace io { class Physiology; } @@ -34,22 +32,16 @@ class BIOGEARS_API SEHepaticSystem : public SESystem { const char* classname() const override { return TypeTag(); } size_t hash_code() const override { return TypeHash(); } - void Clear() override; // Deletes all members + void Invalidate() override; // Deletes all members const SEScalar* GetScalar(const char* name) override; const SEScalar* GetScalar(const std::string& name) override; - bool Load(const CDM::HepaticSystemData& in); - CDM::HepaticSystemData* Unload() const override; - Tree GetPhysiologyRequestGraph() const override; bool operator==(SEHepaticSystem const&) const; bool operator!=(SEHepaticSystem const&) const; -protected: - void Unload(CDM::HepaticSystemData& data) const; - public: bool HasKetoneProductionRate() const; SEScalarAmountPerTime& GetKetoneProductionRate(); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SENervousSystem.h b/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SENervousSystem.h index 9b807cdeb..2f3837466 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SENervousSystem.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SENervousSystem.h @@ -17,7 +17,8 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include + namespace biogears { class TimeUnit; @@ -36,22 +37,16 @@ class BIOGEARS_API SENervousSystem : public SESystem { const char* classname() const override { return TypeTag(); } size_t hash_code() const override { return TypeHash(); } - void Clear() override; // Deletes all members + void Invalidate() override; // Deletes all members const SEScalar* GetScalar(const char* name) override; const SEScalar* GetScalar(const std::string& name) override; - bool Load(const CDM::NervousSystemData& in); - CDM::NervousSystemData* Unload() const override; - Tree GetPhysiologyRequestGraph() const override; bool operator==(SENervousSystem const&) const; bool operator!=(SENervousSystem const&) const; -protected: - void Unload(CDM::NervousSystemData& data) const; - public: bool HasComplianceScale() const; SEScalar& GetComplianceScale(); @@ -110,8 +105,8 @@ class BIOGEARS_API SENervousSystem : public SESystem { SEScalarTime& GetSleepTime(); double GetSleepTime(const TimeUnit& unit) const; - CDM::enumSleepState::value GetSleepState() const; - void SetSleepState(CDM::enumSleepState::value sleep); + SESleepState GetSleepState() const; + void SetSleepState(SESleepState sleep); void InvalidateSleepState(); bool HasSleepState() const; @@ -146,7 +141,7 @@ class BIOGEARS_API SENervousSystem : public SESystem { SEScalar* m_ResistanceScaleSplanchnic; SEScalarTime* m_SleepTime; SEScalarTime* m_WakeTime; - CDM::enumSleepState::value m_SleepState; + SESleepState m_SleepState; SEScalar* m_BiologicalDebt; SEScalarTime* m_ReactionTime; SEScalar* m_AttentionLapses; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SERenalSystem.h b/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SERenalSystem.h index 304e0c711..5f05d9bc8 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SERenalSystem.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SERenalSystem.h @@ -11,32 +11,23 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once -#include "biogears/cdm/properties/SEScalarVolumePerTimePressure.h" +#include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + namespace biogears { -class SEScalarPressure; -class PressureUnit; -class SEScalarFraction; -class SEScalarVolumePerTime; -class VolumePerTimeUnit; -class SEScalarFlowResistance; -class FlowResistanceUnit; -class SEScalarVolume; -class VolumeUnit; -class SEScalarVolumePerTimePressure; -class VolumePerTimePressureUnit; -class SEScalarArea; -class AreaUnit; -class SEScalarVolumePerTimePressureArea; -class VolumePerTimePressureAreaUnit; -class SEScalarOsmolarity; -class OsmolarityUnit; -class SEScalarOsmolality; -class OsmolalityUnit; -class SEScalarMassPerVolume; -class MassPerVolumeUnit; namespace io { class Physiology; } @@ -52,22 +43,16 @@ class BIOGEARS_API SERenalSystem : public SESystem { const char* classname() const override { return TypeTag(); } size_t hash_code() const override { return TypeHash(); } - void Clear() override; // Deletes all members + void Invalidate() override; // Deletes all members const SEScalar* GetScalar(const char* name) override; const SEScalar* GetScalar(const std::string& name) override; - bool Load(const CDM::RenalSystemData& in); - CDM::RenalSystemData* Unload() const override; - Tree GetPhysiologyRequestGraph() const override; bool operator==(SERenalSystem const&) const; bool operator!=(SERenalSystem const&) const; -protected: - void Unload(CDM::RenalSystemData& data) const; - public: bool HasBladderPressure() const; SEScalarPressure& GetBladderPressure(); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SERespiratorySystem.h b/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SERespiratorySystem.h index 2efa208eb..735ee8e4b 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SERespiratorySystem.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SERespiratorySystem.h @@ -12,23 +12,17 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace biogears { -class SEScalarPressure; -class PressureUnit; -class SEScalarFraction; -class SEScalar0To1; -class SEScalarVolumePerTime; -class VolumePerTimeUnit; -class SEScalarFlowCompliance; -class FlowComplianceUnit; -class SEScalarFlowResistance; -class FlowResistanceUnit; -class SEScalarFrequency; -class FrequencyUnit; -class SEScalarVolume; -class VolumeUnit; namespace io { class Physiology; } @@ -44,22 +38,16 @@ class BIOGEARS_API SERespiratorySystem : public SESystem { const char* classname() const override { return TypeTag(); } size_t hash_code() const override { return TypeHash(); } - void Clear() override; // Deletes all members + void Invalidate() override; // Deletes all members const SEScalar* GetScalar(const char* name) override; const SEScalar* GetScalar(const std::string& name) override; - bool Load(const CDM::RespiratorySystemData& in); - CDM::RespiratorySystemData* Unload() const override; - Tree GetPhysiologyRequestGraph() const override; bool operator==(SERespiratorySystem const&) const; bool operator!=(SERespiratorySystem const&) const; -protected: - void Unload(CDM::RespiratorySystemData& data) const; - public: bool HasAlveolarArterialGradient() const; SEScalarPressure& GetAlveolarArterialGradient(); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SETissueSystem.h b/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SETissueSystem.h index 518095de6..a5d106b74 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SETissueSystem.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/system/physiology/SETissueSystem.h @@ -12,20 +12,11 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include + +#include +#include namespace biogears { -class SEScalarVolumePerTime; -class VolumePerTimeUnit; -class SEScalar0To1; -class SEScalarVolume; -class VolumeUnit; -class SEScalarAmountPerVolume; -class AmountPerVolumeUnit; -class SEScalarMassPerVolume; -class MassPerVolumeUnit; -class SEScalarMass; -class MassUnit; namespace io { class Physiology; } @@ -41,22 +32,16 @@ class BIOGEARS_API SETissueSystem : public SESystem { const char* classname() const override { return TypeTag(); } size_t hash_code() const override { return TypeHash(); } - void Clear() override; // Deletes all members + void Invalidate() override; // Deletes all members const SEScalar* GetScalar(const char* name) override; const SEScalar* GetScalar(const std::string& name) override; - bool Load(const CDM::TissueSystemData& in); - CDM::TissueSystemData* Unload() const override; - Tree GetPhysiologyRequestGraph() const override; bool operator==(SETissueSystem const&) const; bool operator!=(SETissueSystem const&) const; -protected: - void Unload(CDM::TissueSystemData& data) const; - public: bool HasCarbonDioxideProductionRate() const; SEScalarVolumePerTime& GetCarbonDioxideProductionRate(); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/utils/DataTrack.h b/projects/biogears/libBiogears/include/biogears/cdm/utils/DataTrack.h index 6c6e79283..6738c852f 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/utils/DataTrack.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/utils/DataTrack.h @@ -42,7 +42,7 @@ class BIOGEARS_API DataTrack : public Loggable { DataTrack& operator=(DataTrack&&); ~DataTrack(); - void Clear(); + void Invalidate(); void Reset(); void UseTabDelimiter() { m_Delimiter = '\t'; } diff --git a/projects/biogears/libBiogears/include/biogears/cdm/utils/GeneralMath.h b/projects/biogears/libBiogears/include/biogears/cdm/utils/GeneralMath.h index dc15abf05..098a47045 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/utils/GeneralMath.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/utils/GeneralMath.h @@ -17,18 +17,19 @@ specific language governing permissions and limitations under the License. #include -namespace biogears { +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + -class SEScalarOsmolality; -class SEScalarOsmolarity; -class SEScalarTemperature; -class SEScalar; -class SEScalarAmountPerVolume; -class SEScalarPressure; -class SEScalarFraction; -class SEScalarMassPerVolume; -class SEScalarVolume; -class SEScalarMass; +namespace biogears { class SESubstance; class SESubstanceManager; class SELiquidCompartment; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/utils/Logger.h b/projects/biogears/libBiogears/include/biogears/cdm/utils/Logger.h index dccaf67e4..9bcad86a8 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/utils/Logger.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/utils/Logger.h @@ -21,8 +21,12 @@ specific language governing permissions and limitations under the License. namespace biogears { +class TimeUnit; +template +class SEScalarQuantity; +using SEScalarTime = SEScalarQuantity; + class Logger; -class SEScalarTime; class IOManager; class BIOGEARS_API Loggable { @@ -152,13 +156,13 @@ class BIOGEARS_API Logger { inline std::ostream& operator<<(std::ostream& os, Logger::LogLevel level) { os << ((Logger::eAll == level) ? "ALL" - : (Logger::eFatal== level) ? "FATAL" + : (Logger::eFatal == level) ? "FATAL" : (Logger::eDebug == level) ? "DEBUG" : (Logger::eError == level) ? "ERROR" - : (Logger::eException== level) ? "EXECPTION" + : (Logger::eException == level) ? "EXECPTION" : (Logger::eWarning == level) ? "WARNING" : (Logger::eInfo == level) ? "INFO" - : "UNKNWON"); + : "UNKNWON"); return os; } inline std::string ToString(Logger::LogLevel level) @@ -167,10 +171,10 @@ inline std::string ToString(Logger::LogLevel level) : (Logger::eFatal == level) ? "FATAL" : (Logger::eDebug == level) ? "DEBUG" : (Logger::eError == level) ? "ERROR" - : (Logger::eException== level) ? "EXECPTION" + : (Logger::eException == level) ? "EXECPTION" : (Logger::eWarning == level) ? "WARNING" : (Logger::eInfo == level) ? "INFO" - : "UNKNWON"; + : "UNKNWON"; } inline Logger::LogLevel FromString(std::string str) diff --git a/projects/biogears/libBiogears/include/biogears/cdm/utils/RunningAverage.h b/projects/biogears/libBiogears/include/biogears/cdm/utils/RunningAverage.h index 3272da93b..8c9970361 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/utils/RunningAverage.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/utils/RunningAverage.h @@ -13,7 +13,6 @@ specific language governing permissions and limitations under the License. #include #include -CDM_BIND_DECL(RunningAverageData); namespace biogears { namespace io { @@ -25,13 +24,6 @@ class BIOGEARS_API RunningAverage { RunningAverage(); virtual ~RunningAverage(); - bool Load(const CDM::RunningAverageData& in); - CDM::RunningAverageData* Unload() const; - -protected: - void Unload(CDM::RunningAverageData& data) const; - -public: /** Reset Counter info */ void Reset(); /** Add value to Sample list and return the new average */ @@ -39,7 +31,7 @@ class BIOGEARS_API RunningAverage { /** Return the average value */ double Value(); - unsigned int NumSamples() { return m_NumSamples; } + unsigned int NumSamples() const { return m_NumSamples; } protected: double m_Sum; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/utils/SEEventHandler.h b/projects/biogears/libBiogears/include/biogears/cdm/utils/SEEventHandler.h index 6ea45a98b..85b56c025 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/utils/SEEventHandler.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/utils/SEEventHandler.h @@ -13,8 +13,8 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include -#include +#include +#include #include namespace CDM = mil::tatrc::physiology::datamodel; @@ -25,7 +25,7 @@ class BIOGEARS_API SEEventHandler { SEEventHandler() = default; virtual ~SEEventHandler() = default; - virtual void HandlePatientEvent(CDM::enumPatientEvent::value type, bool active, const SEScalarTime* time = nullptr) = 0; - virtual void HandleAnesthesiaMachineEvent(CDM::enumAnesthesiaMachineEvent::value type, bool active, const SEScalarTime* time = nullptr) = 0; + virtual void HandlePatientEvent(SEPatientEventType type, bool active, const SEScalarTime* time = nullptr) = 0; + virtual void HandleAnesthesiaMachineEvent(SEAnesthesiaMachineEvent type, bool active, const SEScalarTime* time = nullptr) = 0; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/utils/SmartEnum.h b/projects/biogears/libBiogears/include/biogears/cdm/utils/SmartEnum.h deleted file mode 100644 index 95d2bd3cf..000000000 --- a/projects/biogears/libBiogears/include/biogears/cdm/utils/SmartEnum.h +++ /dev/null @@ -1,110 +0,0 @@ -/************************************************************************************** -Copyright 2015 Applied Research Associates, Inc. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the License -at: -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software distributed under -the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -CONDITIONS OF ANY KIND, either express or implied. See the License for the -specific language governing permissions and limitations under the License. -**************************************************************************************/ - -#pragma once - -#include -#include -#include -#include -#include -#include - -namespace biogears { -// Not sure why I have such a facination with enums, but.. -// This is a bit of a pet project, I have been curious to see how one can make -// and enum that both, has string mappings and is iterable -// It would really be nice to have unbound wildcard templates in C++ some how... -// I really want to be able to have a compartment manager be populated with -// a set of compartments defined in a custom enum definition -// and have the compartment manager getCompartment method take in the custom type -// And allow for support of multiple custom types.. -// At anyrate, I am only using this in unit testing -// Found these articles that helped come up with this junk -// http://www.cprogramming.com/c++11/c++11-nullptr-strongly-typed-enum-class.html -// http://www.cprogramming.com/tutorial/template_specialization.html -// http://codereview.stackexchange.com/questions/57626/iterable-enum-class-in-c11 -// http://codereview.stackexchange.com/questions/14309/conversion-between-enum-and-string-in-c-class-header?rq=1 -// http://stackoverflow.com/questions/6288812/template-in-c - -// This is the type that will hold all the strings. -// Each enumerate type will declare its own specialization. -// Any enum that does not have a specialization will generate a compiler error -// indicating that there is no definition of this variable (as there should be -// be no definition of a generic version). -template -struct enumStrings { - static char const* values[]; -}; - -// Here is a base class that works via an index and string -struct SmartEnum { - virtual int index() const = 0; - virtual const std::string& string() const = 0; -}; - -// Here are is a macro to fill out the contents of a SmartEnum struct -// You only need to provide the struct, the enum associated (and how many) -// and the strings mapped to those enums - -#define SMART_ENUM(Clazz, Type, Length) \ - static constexpr std::size_t _size = Length; \ - \ - Clazz() \ - : _idx(0) \ - { \ - } \ - Clazz(Type t) { _idx = static_cast(t); } \ - virtual ~Clazz() {} \ - \ - int index() const { return _idx; } \ - const Type value() const { return Type(_idx); } \ - const char* string() const { return Clazz::Value(_idx); } \ - void set(const Type& t) { _idx = static_cast(t); } \ - \ - Type operator++() \ - { \ - if (_idx != (_size - 1)) \ - _idx++; \ - return Type(_idx); \ - } \ - Type operator++(int) \ - { \ - if (_idx != (_size - 1)) \ - _idx++; \ - return Type(_idx); \ - } \ - bool operator==(Clazz const& rhs) { return _idx == rhs._idx; } \ - bool operator!=(Clazz const& rhs) { return _idx != rhs._idx; } \ - \ -protected: \ - int _idx; \ - \ -public: - -// Here is an example (You don't need to derive from SmartEnum if you don't want to) -//struct ExampleEnum : public SmartEnum -//{ -// // NOTE, THESE ENUMS MUST BE OF THE DEFAULT INDEXING (You can't say enum Type {A=10, B=30 } -// enum Type { A, B, C }; -// SMART_ENUM(ExampleEnum, Type, 3); -// static char const* Value(size_t idx); -//};// Length of enum and values[] must be the same, and reflected in the input to SMART_ENUM -// Put this in your cpp file -//template<> char const* enumStrings::values[] = { "Alpha", "Bravo", "Charlie" }; -//char const* ExampleEnum::Value(size_t idx) -//{ -// return enumStrings::values[idx]; -//} -//NOTE: You can also templitize this class with the enum type if you want, but how to you set the size? -//I will figure that out when/if I need it -} \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/cdm/utils/TimingProfile.h b/projects/biogears/libBiogears/include/biogears/cdm/utils/TimingProfile.h index 6e24a879a..7ad10bcd0 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/utils/TimingProfile.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/utils/TimingProfile.h @@ -33,10 +33,13 @@ struct Timer { State state = State::Ready; }; } //namespace biogearsK +#pragma warning(disable : 4661) namespace std { -BG_EXT template class BIOGEARS_API map; +extern template class map; } +#pragma warning(default : 4661) + namespace biogears { class BIOGEARS_API TimingProfile : public Loggable { public: @@ -44,7 +47,7 @@ class BIOGEARS_API TimingProfile : public Loggable { TimingProfile(Logger* logger); virtual ~TimingProfile(); - void Clear(); + void Invalidate(); /** * Resets the timer, this can have different effects based on the state of the timer: diff --git a/projects/biogears/libBiogears/include/biogears/cdm/utils/testing/SETestCase.h b/projects/biogears/libBiogears/include/biogears/cdm/utils/testing/SETestCase.h index a07b9b7cb..4b0fdee4c 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/utils/testing/SETestCase.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/utils/testing/SETestCase.h @@ -13,7 +13,6 @@ specific language governing permissions and limitations under the License. #pragma once #include #include -CDM_BIND_DECL(TestCaseData) namespace biogears { class SETestSuite; @@ -31,15 +30,9 @@ class BIOGEARS_API SETestCase : public Loggable { virtual ~SETestCase(); virtual void Reset(); // reset values - virtual void Clear(); // clear memory + virtual void Invalidate(); // clear memory - bool Load(const CDM::TestCaseData& in); - std::unique_ptr Unload() const; -protected: - void Unload(CDM::TestCaseData& data) const; - -public: void SetName(const std::string& name); std::string GetName() const; const char* GetName_cStr() const; diff --git a/projects/biogears/libBiogears/include/biogears/cdm/utils/testing/SETestErrorStatistics.h b/projects/biogears/libBiogears/include/biogears/cdm/utils/testing/SETestErrorStatistics.h index 561839fa8..9d8de2ff9 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/utils/testing/SETestErrorStatistics.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/utils/testing/SETestErrorStatistics.h @@ -16,7 +16,6 @@ specific language governing permissions and limitations under the License. #include #include -CDM_BIND_DECL(TestErrorStatisticsData) namespace biogears { class SETestCase; class SETestSuite; @@ -38,17 +37,11 @@ class BIOGEARS_API SETestErrorStatistics : public Loggable { virtual ~SETestErrorStatistics(); virtual void Reset(); // reset values - virtual void Clear(); // clear memory - - bool Load(const CDM::TestErrorStatisticsData& in); - std::unique_ptr Unload() const; + virtual void Invalidate(); // clear memory bool operator==(const SETestErrorStatistics&) const; bool operator!=(const SETestErrorStatistics&) const; -protected: - void Unload(CDM::TestErrorStatisticsData& data) const; - public: bool IsValid(); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/utils/testing/SETestReport.h b/projects/biogears/libBiogears/include/biogears/cdm/utils/testing/SETestReport.h index 85441a085..6595cfac6 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/utils/testing/SETestReport.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/utils/testing/SETestReport.h @@ -13,7 +13,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -CDM_BIND_DECL(TestReportData) namespace biogears { namespace io { class TestReport; @@ -26,18 +25,11 @@ class BIOGEARS_API SETestReport : public Loggable { virtual ~SETestReport(); virtual void Reset(); //reset values - virtual void Clear(); //clear memory - - bool Load(const CDM::TestReportData& in); - std::unique_ptr Unload() const; + virtual void Invalidate(); //clear memory bool operator==(SETestReport const&) const; bool operator!=(SETestReport const&) const; -protected: - void Unload(CDM::TestReportData& data) const; - -public: bool WriteFile(const std::string& filename); SETestSuite& CreateTestSuite(); diff --git a/projects/biogears/libBiogears/include/biogears/cdm/utils/testing/SETestSuite.h b/projects/biogears/libBiogears/include/biogears/cdm/utils/testing/SETestSuite.h index fb9981828..67390d405 100644 --- a/projects/biogears/libBiogears/include/biogears/cdm/utils/testing/SETestSuite.h +++ b/projects/biogears/libBiogears/include/biogears/cdm/utils/testing/SETestSuite.h @@ -13,8 +13,6 @@ specific language governing permissions and limitations under the License. #pragma once #include -CDM_BIND_DECL(TestSuiteData) - namespace biogears { class SETestReport; namespace io { @@ -29,17 +27,11 @@ class BIOGEARS_API SETestSuite : public Loggable { virtual ~SETestSuite(); virtual void Reset(); //reset values - virtual void Clear(); //clear memory - - bool Load(const CDM::TestSuiteData& in); - std::unique_ptr Unload() const; + virtual void Invalidate(); //clear memory bool operator==(SETestSuite const&) const; bool operator!=(SETestSuite const&) const; -protected: - void Unload(CDM::TestSuiteData& data) const; - public: void SetName(const std::string& Name); std::string GetName() const; diff --git a/projects/biogears/libBiogears/include/biogears/engine/BioGearsPhysiologyEngine.h b/projects/biogears/libBiogears/include/biogears/engine/BioGearsPhysiologyEngine.h index 0e5d5f76b..698f58aa0 100644 --- a/projects/biogears/libBiogears/include/biogears/engine/BioGearsPhysiologyEngine.h +++ b/projects/biogears/libBiogears/include/biogears/engine/BioGearsPhysiologyEngine.h @@ -30,740 +30,734 @@ BIOGEARS_API std::unique_ptr CreateBioGearsEngine(co BIOGEARS_API std::unique_ptr CreateBioGearsEngine(const char* working_dir, biogears::Logger* logger); } -namespace mil { -namespace tatrc { - namespace physiology { - namespace biogears { - namespace Graph { - - DEFINE_STATIC_STRING(ActiveCardiovascular); - DEFINE_STATIC_STRING(Cardiovascular); - DEFINE_STATIC_STRING(Cerebral); - DEFINE_STATIC_STRING(Renal); - DEFINE_STATIC_STRING(Respiratory); - DEFINE_STATIC_STRING(RespiratoryAndAnesthesiaMachine); - DEFINE_STATIC_STRING(RespiratoryAndInhaler); - DEFINE_STATIC_STRING(RespiratoryAndNasalCannula); - DEFINE_STATIC_STRING(RespiratoryAndMechanicalVentilator); - DEFINE_STATIC_STRING(Aerosol); - DEFINE_STATIC_STRING(AerosolAndInhaler); - DEFINE_STATIC_STRING(AnesthesiaMachine); - - static const std::vector& GetValues() - { - static std::vector _values = { - ActiveCardiovascular, Cardiovascular, Renal, Respiratory, RespiratoryAndAnesthesiaMachine, RespiratoryAndInhaler, RespiratoryAndNasalCannula, RespiratoryAndMechanicalVentilator, Aerosol, AerosolAndInhaler, AnesthesiaMachine - }; - return _values; - } +namespace biogears { +namespace physiology { + namespace Graph { + + DEFINE_STATIC_STRING(ActiveCardiovascular); + DEFINE_STATIC_STRING(Cardiovascular); + DEFINE_STATIC_STRING(Cerebral); + DEFINE_STATIC_STRING(Renal); + DEFINE_STATIC_STRING(Respiratory); + DEFINE_STATIC_STRING(RespiratoryAndAnesthesiaMachine); + DEFINE_STATIC_STRING(RespiratoryAndInhaler); + DEFINE_STATIC_STRING(RespiratoryAndNasalCannula); + DEFINE_STATIC_STRING(RespiratoryAndMechanicalVentilator); + DEFINE_STATIC_STRING(Aerosol); + DEFINE_STATIC_STRING(AerosolAndInhaler); + DEFINE_STATIC_STRING(AnesthesiaMachine); + + static const std::vector& GetValues() + { + static std::vector _values = { + ActiveCardiovascular, Cardiovascular, Renal, Respiratory, RespiratoryAndAnesthesiaMachine, RespiratoryAndInhaler, RespiratoryAndNasalCannula, RespiratoryAndMechanicalVentilator, Aerosol, AerosolAndInhaler, AnesthesiaMachine }; + return _values; + } + }; - namespace ChymeCompartment { + namespace ChymeCompartment { - DEFINE_STATIC_STRING_EX(SmallIntestine, SmallIntestineChyme); + DEFINE_STATIC_STRING_EX(SmallIntestine, SmallIntestineChyme); - static const std::vector& GetValues() - { - static std::vector _values = { - SmallIntestine - }; - return _values; - } + static const std::vector& GetValues() + { + static std::vector _values = { + SmallIntestine }; + return _values; + } + }; - namespace ChymeLink { + namespace ChymeLink { - DEFINE_STATIC_STRING(SmallIntestineChymeToVasculature); - static const std::vector& GetValues() - { + DEFINE_STATIC_STRING(SmallIntestineChymeToVasculature); + static const std::vector& GetValues() + { - static std::vector _values = { - SmallIntestineChymeToVasculature - }; - return _values; - } + static std::vector _values = { + SmallIntestineChymeToVasculature }; - - namespace PulmonaryCompartment { - DEFINE_STATIC_STRING(Mouth); - DEFINE_STATIC_STRING(Stomach); - DEFINE_STATIC_STRING(Trachea); - DEFINE_STATIC_STRING_EX(Lungs, PulmonaryLungs); - DEFINE_STATIC_STRING_EX(LeftLung, LeftLungPulmonary); - DEFINE_STATIC_STRING(LeftBronchi); - DEFINE_STATIC_STRING(LeftAlveoli); - DEFINE_STATIC_STRING_EX(RightLung, RightLungPulmonary); - DEFINE_STATIC_STRING(RightBronchi); - DEFINE_STATIC_STRING(RightAlveoli); - DEFINE_STATIC_STRING(PleuralCavity); - DEFINE_STATIC_STRING(LeftPleuralCavity); - DEFINE_STATIC_STRING(RightPleuralCavity); - - DEFINE_STATIC_STRING(LeftAlveoliLeak); - DEFINE_STATIC_STRING(LeftChestLeak); - DEFINE_STATIC_STRING(RightAlveoliLeak); - DEFINE_STATIC_STRING(RightChestLeak); - - static const std::vector& GetValues() - { - - static std::vector _values = { - Mouth, Stomach, Trachea, Lungs, LeftLung, LeftBronchi, LeftAlveoli, RightLung, RightBronchi, RightAlveoli, PleuralCavity, LeftPleuralCavity, RightPleuralCavity, LeftAlveoliLeak, LeftChestLeak, RightAlveoliLeak, RightChestLeak - }; - return _values; - } + return _values; + } + }; + + namespace PulmonaryCompartment { + DEFINE_STATIC_STRING(Mouth); + DEFINE_STATIC_STRING(Stomach); + DEFINE_STATIC_STRING(Trachea); + DEFINE_STATIC_STRING_EX(Lungs, PulmonaryLungs); + DEFINE_STATIC_STRING_EX(LeftLung, LeftLungPulmonary); + DEFINE_STATIC_STRING(LeftBronchi); + DEFINE_STATIC_STRING(LeftAlveoli); + DEFINE_STATIC_STRING_EX(RightLung, RightLungPulmonary); + DEFINE_STATIC_STRING(RightBronchi); + DEFINE_STATIC_STRING(RightAlveoli); + DEFINE_STATIC_STRING(PleuralCavity); + DEFINE_STATIC_STRING(LeftPleuralCavity); + DEFINE_STATIC_STRING(RightPleuralCavity); + + DEFINE_STATIC_STRING(LeftAlveoliLeak); + DEFINE_STATIC_STRING(LeftChestLeak); + DEFINE_STATIC_STRING(RightAlveoliLeak); + DEFINE_STATIC_STRING(RightChestLeak); + + static const std::vector& GetValues() + { + + static std::vector _values = { + Mouth, Stomach, Trachea, Lungs, LeftLung, LeftBronchi, LeftAlveoli, RightLung, RightBronchi, RightAlveoli, PleuralCavity, LeftPleuralCavity, RightPleuralCavity, LeftAlveoliLeak, LeftChestLeak, RightAlveoliLeak, RightChestLeak }; - - namespace PulmonaryLink { - - DEFINE_STATIC_STRING(EnvironmentToMouth); - DEFINE_STATIC_STRING(MouthToTrachea); - DEFINE_STATIC_STRING(MouthToStomach); - DEFINE_STATIC_STRING(TracheaToLeftBronchi); - DEFINE_STATIC_STRING(LeftBronchiToAlveoli); - DEFINE_STATIC_STRING(TracheaToRightBronchi); - DEFINE_STATIC_STRING(RightBronchiToAlveoli); - DEFINE_STATIC_STRING(EnvironmentToLeftChestLeak); - DEFINE_STATIC_STRING(EnvironmentToRightChestLeak); - DEFINE_STATIC_STRING(LeftAlveoliLeakToLeftPleuralCavity); - DEFINE_STATIC_STRING(LeftAlveoliToLeftAlveoliLeak); - DEFINE_STATIC_STRING(LeftChestLeakToLeftPleuralCavity); - DEFINE_STATIC_STRING(LeftPleuralCavityToEnvironment); - DEFINE_STATIC_STRING(RightAlveoliLeakToRightPleuralCavity); - DEFINE_STATIC_STRING(RightAlveoliToRightAlveoliLeak); - DEFINE_STATIC_STRING(RightChestLeakToRightPleuralCavity); - DEFINE_STATIC_STRING(RightPleuralCavityToEnvironment); - - static const std::vector& GetValues() - { - - static std::vector _values = { - EnvironmentToMouth, MouthToTrachea, MouthToStomach, TracheaToLeftBronchi, LeftBronchiToAlveoli, TracheaToRightBronchi, RightBronchiToAlveoli, EnvironmentToLeftChestLeak, EnvironmentToRightChestLeak, LeftAlveoliLeakToLeftPleuralCavity, LeftAlveoliToLeftAlveoliLeak, LeftChestLeakToLeftPleuralCavity, LeftPleuralCavityToEnvironment, RightAlveoliLeakToRightPleuralCavity, RightAlveoliToRightAlveoliLeak, RightChestLeakToRightPleuralCavity, RightPleuralCavityToEnvironment - }; - return _values; - } + return _values; + } + }; + + namespace PulmonaryLink { + + DEFINE_STATIC_STRING(EnvironmentToMouth); + DEFINE_STATIC_STRING(MouthToTrachea); + DEFINE_STATIC_STRING(MouthToStomach); + DEFINE_STATIC_STRING(TracheaToLeftBronchi); + DEFINE_STATIC_STRING(LeftBronchiToAlveoli); + DEFINE_STATIC_STRING(TracheaToRightBronchi); + DEFINE_STATIC_STRING(RightBronchiToAlveoli); + DEFINE_STATIC_STRING(EnvironmentToLeftChestLeak); + DEFINE_STATIC_STRING(EnvironmentToRightChestLeak); + DEFINE_STATIC_STRING(LeftAlveoliLeakToLeftPleuralCavity); + DEFINE_STATIC_STRING(LeftAlveoliToLeftAlveoliLeak); + DEFINE_STATIC_STRING(LeftChestLeakToLeftPleuralCavity); + DEFINE_STATIC_STRING(LeftPleuralCavityToEnvironment); + DEFINE_STATIC_STRING(RightAlveoliLeakToRightPleuralCavity); + DEFINE_STATIC_STRING(RightAlveoliToRightAlveoliLeak); + DEFINE_STATIC_STRING(RightChestLeakToRightPleuralCavity); + DEFINE_STATIC_STRING(RightPleuralCavityToEnvironment); + + static const std::vector& GetValues() + { + + static std::vector _values = { + EnvironmentToMouth, MouthToTrachea, MouthToStomach, TracheaToLeftBronchi, LeftBronchiToAlveoli, TracheaToRightBronchi, RightBronchiToAlveoli, EnvironmentToLeftChestLeak, EnvironmentToRightChestLeak, LeftAlveoliLeakToLeftPleuralCavity, LeftAlveoliToLeftAlveoliLeak, LeftChestLeakToLeftPleuralCavity, LeftPleuralCavityToEnvironment, RightAlveoliLeakToRightPleuralCavity, RightAlveoliToRightAlveoliLeak, RightChestLeakToRightPleuralCavity, RightPleuralCavityToEnvironment }; - - namespace TissueCompartment { - - DEFINE_STATIC_STRING_EX(Bone, BoneTissue); - DEFINE_STATIC_STRING_EX(Brain, BrainTissue); - DEFINE_STATIC_STRING_EX(Fat, FatTissue); - DEFINE_STATIC_STRING_EX(Gut, GutTissue); - DEFINE_STATIC_STRING_EX(LeftKidney, LeftKidneyTissue); - DEFINE_STATIC_STRING_EX(LeftLung, LeftLungTissue); - DEFINE_STATIC_STRING_EX(Liver, LiverTissue); - DEFINE_STATIC_STRING_EX(Muscle, MuscleTissue); - DEFINE_STATIC_STRING_EX(Myocardium, MyocardiumTissue); - DEFINE_STATIC_STRING_EX(RightKidney, RightKidneyTissue); - DEFINE_STATIC_STRING_EX(RightLung, RightLungTissue); - DEFINE_STATIC_STRING_EX(Skin, SkinTissue); - DEFINE_STATIC_STRING_EX(Spleen, SpleenTissue); - - static const std::vector& GetValues() - { - static std::vector _values = { - Bone, Brain, Fat, Gut, LeftKidney, LeftLung, Liver, Muscle, Myocardium, RightKidney, RightLung, Skin, Spleen - }; - return _values; - } + return _values; + } + }; + + namespace TissueCompartment { + + DEFINE_STATIC_STRING_EX(Bone, BoneTissue); + DEFINE_STATIC_STRING_EX(Brain, BrainTissue); + DEFINE_STATIC_STRING_EX(Fat, FatTissue); + DEFINE_STATIC_STRING_EX(Gut, GutTissue); + DEFINE_STATIC_STRING_EX(LeftKidney, LeftKidneyTissue); + DEFINE_STATIC_STRING_EX(LeftLung, LeftLungTissue); + DEFINE_STATIC_STRING_EX(Liver, LiverTissue); + DEFINE_STATIC_STRING_EX(Muscle, MuscleTissue); + DEFINE_STATIC_STRING_EX(Myocardium, MyocardiumTissue); + DEFINE_STATIC_STRING_EX(RightKidney, RightKidneyTissue); + DEFINE_STATIC_STRING_EX(RightLung, RightLungTissue); + DEFINE_STATIC_STRING_EX(Skin, SkinTissue); + DEFINE_STATIC_STRING_EX(Spleen, SpleenTissue); + + static const std::vector& GetValues() + { + static std::vector _values = { + Bone, Brain, Fat, Gut, LeftKidney, LeftLung, Liver, Muscle, Myocardium, RightKidney, RightLung, Skin, Spleen }; - - namespace ExtravascularCompartment { - - DEFINE_STATIC_STRING_EX(BoneExtracellular, BoneTissueExtracellular); - DEFINE_STATIC_STRING_EX(BrainExtracellular, BrainTissueExtracellular); - DEFINE_STATIC_STRING(CerebralSpinalFluid); - DEFINE_STATIC_STRING_EX(FatExtracellular, FatTissueExtracellular); - DEFINE_STATIC_STRING_EX(GutExtracellular, GutTissueExtracellular); - DEFINE_STATIC_STRING_EX(LeftKidneyExtracellular, LeftKidneyTissueExtracellular); - DEFINE_STATIC_STRING_EX(LeftLungExtracellular, LeftLungTissueExtracellular); - DEFINE_STATIC_STRING_EX(LiverExtracellular, LiverTissueExtracellular); - DEFINE_STATIC_STRING_EX(MuscleExtracellular, MuscleTissueExtracellular); - DEFINE_STATIC_STRING_EX(MyocardiumExtracellular, MyocardiumTissueExtracellular); - DEFINE_STATIC_STRING_EX(RightKidneyExtracellular, RightKidneyTissueExtracellular); - DEFINE_STATIC_STRING_EX(RightLungExtracellular, RightLungTissueExtracellular); - DEFINE_STATIC_STRING_EX(SkinExtracellular, SkinTissueExtracellular); - DEFINE_STATIC_STRING_EX(SpleenExtracellular, SpleenTissueExtracellular); - - DEFINE_STATIC_STRING_EX(BoneIntracellular, BoneTissueIntracellular); - DEFINE_STATIC_STRING_EX(BrainIntracellular, BrainTissueIntracellular); - DEFINE_STATIC_STRING_EX(FatIntracellular, FatTissueIntracellular); - DEFINE_STATIC_STRING_EX(GutIntracellular, GutTissueIntracellular); - DEFINE_STATIC_STRING_EX(LeftKidneyIntracellular, LeftKidneyTissueIntracellular); - DEFINE_STATIC_STRING_EX(LeftLungIntracellular, LeftLungTissueIntracellular); - DEFINE_STATIC_STRING_EX(LiverIntracellular, LiverTissueIntracellular); - DEFINE_STATIC_STRING_EX(MuscleIntracellular, MuscleTissueIntracellular); - DEFINE_STATIC_STRING_EX(MyocardiumIntracellular, MyocardiumTissueIntracellular); - DEFINE_STATIC_STRING_EX(RightKidneyIntracellular, RightKidneyTissueIntracellular); - DEFINE_STATIC_STRING_EX(RightLungIntracellular, RightLungTissueIntracellular); - DEFINE_STATIC_STRING_EX(SkinIntracellular, SkinTissueIntracellular); - DEFINE_STATIC_STRING_EX(SpleenIntracellular, SpleenTissueIntracellular); - - static const std::vector& GetValues() - { - static std::vector _values = { - BoneExtracellular, BrainExtracellular, CerebralSpinalFluid, FatExtracellular, GutExtracellular, LeftKidneyExtracellular, LeftLungExtracellular, LiverExtracellular, MuscleExtracellular, MyocardiumExtracellular, RightKidneyExtracellular, RightLungExtracellular, SkinExtracellular, SpleenExtracellular, BoneIntracellular, BrainIntracellular, FatIntracellular, GutIntracellular, LeftKidneyIntracellular, LeftLungIntracellular, LiverIntracellular, MuscleIntracellular, MyocardiumIntracellular, RightKidneyIntracellular, RightLungIntracellular, SkinIntracellular, SpleenIntracellular - }; - return _values; - } + return _values; + } + }; + + namespace ExtravascularCompartment { + + DEFINE_STATIC_STRING_EX(BoneExtracellular, BoneTissueExtracellular); + DEFINE_STATIC_STRING_EX(BrainExtracellular, BrainTissueExtracellular); + DEFINE_STATIC_STRING(CerebralSpinalFluid); + DEFINE_STATIC_STRING_EX(FatExtracellular, FatTissueExtracellular); + DEFINE_STATIC_STRING_EX(GutExtracellular, GutTissueExtracellular); + DEFINE_STATIC_STRING_EX(LeftKidneyExtracellular, LeftKidneyTissueExtracellular); + DEFINE_STATIC_STRING_EX(LeftLungExtracellular, LeftLungTissueExtracellular); + DEFINE_STATIC_STRING_EX(LiverExtracellular, LiverTissueExtracellular); + DEFINE_STATIC_STRING_EX(MuscleExtracellular, MuscleTissueExtracellular); + DEFINE_STATIC_STRING_EX(MyocardiumExtracellular, MyocardiumTissueExtracellular); + DEFINE_STATIC_STRING_EX(RightKidneyExtracellular, RightKidneyTissueExtracellular); + DEFINE_STATIC_STRING_EX(RightLungExtracellular, RightLungTissueExtracellular); + DEFINE_STATIC_STRING_EX(SkinExtracellular, SkinTissueExtracellular); + DEFINE_STATIC_STRING_EX(SpleenExtracellular, SpleenTissueExtracellular); + + DEFINE_STATIC_STRING_EX(BoneIntracellular, BoneTissueIntracellular); + DEFINE_STATIC_STRING_EX(BrainIntracellular, BrainTissueIntracellular); + DEFINE_STATIC_STRING_EX(FatIntracellular, FatTissueIntracellular); + DEFINE_STATIC_STRING_EX(GutIntracellular, GutTissueIntracellular); + DEFINE_STATIC_STRING_EX(LeftKidneyIntracellular, LeftKidneyTissueIntracellular); + DEFINE_STATIC_STRING_EX(LeftLungIntracellular, LeftLungTissueIntracellular); + DEFINE_STATIC_STRING_EX(LiverIntracellular, LiverTissueIntracellular); + DEFINE_STATIC_STRING_EX(MuscleIntracellular, MuscleTissueIntracellular); + DEFINE_STATIC_STRING_EX(MyocardiumIntracellular, MyocardiumTissueIntracellular); + DEFINE_STATIC_STRING_EX(RightKidneyIntracellular, RightKidneyTissueIntracellular); + DEFINE_STATIC_STRING_EX(RightLungIntracellular, RightLungTissueIntracellular); + DEFINE_STATIC_STRING_EX(SkinIntracellular, SkinTissueIntracellular); + DEFINE_STATIC_STRING_EX(SpleenIntracellular, SpleenTissueIntracellular); + + static const std::vector& GetValues() + { + static std::vector _values = { + BoneExtracellular, BrainExtracellular, CerebralSpinalFluid, FatExtracellular, GutExtracellular, LeftKidneyExtracellular, LeftLungExtracellular, LiverExtracellular, MuscleExtracellular, MyocardiumExtracellular, RightKidneyExtracellular, RightLungExtracellular, SkinExtracellular, SpleenExtracellular, BoneIntracellular, BrainIntracellular, FatIntracellular, GutIntracellular, LeftKidneyIntracellular, LeftLungIntracellular, LiverIntracellular, MuscleIntracellular, MyocardiumIntracellular, RightKidneyIntracellular, RightLungIntracellular, SkinIntracellular, SpleenIntracellular }; - - namespace VascularCompartment { - - // Cardio - DEFINE_STATIC_STRING(Aorta); - DEFINE_STATIC_STRING(Heart); - DEFINE_STATIC_STRING_EX(Myocardium, MyocardiumVasculature); - DEFINE_STATIC_STRING(LeftHeart); - DEFINE_STATIC_STRING(LeftAtrium); - DEFINE_STATIC_STRING(LeftVentricle); - DEFINE_STATIC_STRING(RightHeart); - DEFINE_STATIC_STRING(RightAtrium); - DEFINE_STATIC_STRING(RightVentricle); - DEFINE_STATIC_STRING(Pericardium); - DEFINE_STATIC_STRING(VenaCava); - //Cerebral - DEFINE_STATIC_STRING(NeckArteries); - DEFINE_STATIC_STRING(CerebralArteries); - DEFINE_STATIC_STRING(CerebralCapillaries); - DEFINE_STATIC_STRING(CerebralVeins); - DEFINE_STATIC_STRING(NeckVeins); - - // Pulmonary - DEFINE_STATIC_STRING(PulmonaryArteries); - DEFINE_STATIC_STRING(PulmonaryCapillaries); - DEFINE_STATIC_STRING(PulmonaryVeins); - DEFINE_STATIC_STRING_EX(Lungs, LungsVasculature); - DEFINE_STATIC_STRING_EX(LeftLung, LeftLungVasculature); - DEFINE_STATIC_STRING(LeftPulmonaryArteries); - DEFINE_STATIC_STRING(LeftPulmonaryCapillaries); - DEFINE_STATIC_STRING(LeftPulmonaryVeins); - DEFINE_STATIC_STRING_EX(RightLung, RightLungVasculature); - DEFINE_STATIC_STRING(RightPulmonaryArteries); - DEFINE_STATIC_STRING(RightPulmonaryCapillaries); - DEFINE_STATIC_STRING(RightPulmonaryVeins); - // Renal - DEFINE_STATIC_STRING_EX(Kidneys, KidneyVasculature); - DEFINE_STATIC_STRING_EX(LeftKidney, LeftKidneyVasculature); - DEFINE_STATIC_STRING(LeftRenalArtery); - DEFINE_STATIC_STRING(LeftNephron); - DEFINE_STATIC_STRING(LeftAfferentArteriole); - DEFINE_STATIC_STRING(LeftGlomerularCapillaries); - DEFINE_STATIC_STRING(LeftEfferentArteriole); - DEFINE_STATIC_STRING(LeftPeritubularCapillaries); - DEFINE_STATIC_STRING(LeftBowmansCapsules); - DEFINE_STATIC_STRING(LeftTubules); - DEFINE_STATIC_STRING(LeftRenalVein); - DEFINE_STATIC_STRING_EX(RightKidney, RightKidneyVasculature); - DEFINE_STATIC_STRING(RightRenalArtery); - DEFINE_STATIC_STRING(RightNephron); - DEFINE_STATIC_STRING(RightAfferentArteriole); - DEFINE_STATIC_STRING(RightGlomerularCapillaries); - DEFINE_STATIC_STRING(RightEfferentArteriole); - DEFINE_STATIC_STRING(RightPeritubularCapillaries); - DEFINE_STATIC_STRING(RightBowmansCapsules); - DEFINE_STATIC_STRING(RightTubules); - DEFINE_STATIC_STRING(RightRenalVein); - // General Organs and Periphery - DEFINE_STATIC_STRING_EX(Bone, BoneVasculature); - DEFINE_STATIC_STRING_EX(Brain, BrainVasculature); - DEFINE_STATIC_STRING_EX(Fat, FatVasculature); - DEFINE_STATIC_STRING_EX(Gut, GutVasculature); - DEFINE_STATIC_STRING_EX(Splanchnic, SplanchnicVasculature); - DEFINE_STATIC_STRING_EX(SmallIntestine, SmallIntestineVasculature); - DEFINE_STATIC_STRING_EX(LargeIntestine, LargeIntestineVasculature); - DEFINE_STATIC_STRING_EX(Liver, LiverVasculature); - DEFINE_STATIC_STRING_EX(Spleen, SpleenVasculature); - DEFINE_STATIC_STRING_EX(Skin, SkinVasculature); - DEFINE_STATIC_STRING_EX(Muscle, MuscleVasculature); - DEFINE_STATIC_STRING_EX(LeftArm, LeftArmVasculature); - DEFINE_STATIC_STRING_EX(LeftLeg, LeftLegVasculature); - DEFINE_STATIC_STRING_EX(RightArm, RightArmVasculature); - DEFINE_STATIC_STRING_EX(RightLeg, RightLegVasculature); - - DEFINE_STATIC_STRING(Ground); - - static const std::vector& GetValues() - { - static std::vector _values = { - Aorta, Heart, Myocardium, LeftHeart, LeftAtrium, LeftVentricle, RightHeart, RightAtrium, RightVentricle, Pericardium, VenaCava, CerebralArteries, CerebralCapillaries, CerebralVeins, NeckArteries, NeckVeins, PulmonaryArteries, PulmonaryCapillaries, PulmonaryVeins, Lungs, LeftLung, LeftPulmonaryArteries, LeftPulmonaryCapillaries, LeftPulmonaryVeins, RightLung, RightPulmonaryArteries, RightPulmonaryCapillaries, RightPulmonaryVeins, Kidneys, LeftKidney, LeftRenalArtery, LeftNephron, LeftAfferentArteriole, LeftGlomerularCapillaries, LeftEfferentArteriole, LeftPeritubularCapillaries, LeftBowmansCapsules, LeftTubules, LeftRenalVein, RightKidney, RightRenalArtery, RightNephron, RightAfferentArteriole, RightGlomerularCapillaries, RightEfferentArteriole, RightPeritubularCapillaries, RightBowmansCapsules, RightTubules, RightRenalVein, Bone, Brain, Fat, Gut, Splanchnic, SmallIntestine, LargeIntestine, Liver, Spleen, Skin, Muscle, LeftArm, LeftLeg, RightArm, RightLeg - //,Ground - }; - return _values; - } + return _values; + } + }; + + namespace VascularCompartment { + + // Cardio + DEFINE_STATIC_STRING(Aorta); + DEFINE_STATIC_STRING(Heart); + DEFINE_STATIC_STRING_EX(Myocardium, MyocardiumVasculature); + DEFINE_STATIC_STRING(LeftHeart); + DEFINE_STATIC_STRING(LeftAtrium); + DEFINE_STATIC_STRING(LeftVentricle); + DEFINE_STATIC_STRING(RightHeart); + DEFINE_STATIC_STRING(RightAtrium); + DEFINE_STATIC_STRING(RightVentricle); + DEFINE_STATIC_STRING(Pericardium); + DEFINE_STATIC_STRING(VenaCava); + // Cerebral + DEFINE_STATIC_STRING(NeckArteries); + DEFINE_STATIC_STRING(CerebralArteries); + DEFINE_STATIC_STRING(CerebralCapillaries); + DEFINE_STATIC_STRING(CerebralVeins); + DEFINE_STATIC_STRING(NeckVeins); + + // Pulmonary + DEFINE_STATIC_STRING(PulmonaryArteries); + DEFINE_STATIC_STRING(PulmonaryCapillaries); + DEFINE_STATIC_STRING(PulmonaryVeins); + DEFINE_STATIC_STRING_EX(Lungs, LungsVasculature); + DEFINE_STATIC_STRING_EX(LeftLung, LeftLungVasculature); + DEFINE_STATIC_STRING(LeftPulmonaryArteries); + DEFINE_STATIC_STRING(LeftPulmonaryCapillaries); + DEFINE_STATIC_STRING(LeftPulmonaryVeins); + DEFINE_STATIC_STRING_EX(RightLung, RightLungVasculature); + DEFINE_STATIC_STRING(RightPulmonaryArteries); + DEFINE_STATIC_STRING(RightPulmonaryCapillaries); + DEFINE_STATIC_STRING(RightPulmonaryVeins); + // Renal + DEFINE_STATIC_STRING_EX(Kidneys, KidneyVasculature); + DEFINE_STATIC_STRING_EX(LeftKidney, LeftKidneyVasculature); + DEFINE_STATIC_STRING(LeftRenalArtery); + DEFINE_STATIC_STRING(LeftNephron); + DEFINE_STATIC_STRING(LeftAfferentArteriole); + DEFINE_STATIC_STRING(LeftGlomerularCapillaries); + DEFINE_STATIC_STRING(LeftEfferentArteriole); + DEFINE_STATIC_STRING(LeftPeritubularCapillaries); + DEFINE_STATIC_STRING(LeftBowmansCapsules); + DEFINE_STATIC_STRING(LeftTubules); + DEFINE_STATIC_STRING(LeftRenalVein); + DEFINE_STATIC_STRING_EX(RightKidney, RightKidneyVasculature); + DEFINE_STATIC_STRING(RightRenalArtery); + DEFINE_STATIC_STRING(RightNephron); + DEFINE_STATIC_STRING(RightAfferentArteriole); + DEFINE_STATIC_STRING(RightGlomerularCapillaries); + DEFINE_STATIC_STRING(RightEfferentArteriole); + DEFINE_STATIC_STRING(RightPeritubularCapillaries); + DEFINE_STATIC_STRING(RightBowmansCapsules); + DEFINE_STATIC_STRING(RightTubules); + DEFINE_STATIC_STRING(RightRenalVein); + // General Organs and Periphery + DEFINE_STATIC_STRING_EX(Bone, BoneVasculature); + DEFINE_STATIC_STRING_EX(Brain, BrainVasculature); + DEFINE_STATIC_STRING_EX(Fat, FatVasculature); + DEFINE_STATIC_STRING_EX(Gut, GutVasculature); + DEFINE_STATIC_STRING_EX(Splanchnic, SplanchnicVasculature); + DEFINE_STATIC_STRING_EX(SmallIntestine, SmallIntestineVasculature); + DEFINE_STATIC_STRING_EX(LargeIntestine, LargeIntestineVasculature); + DEFINE_STATIC_STRING_EX(Liver, LiverVasculature); + DEFINE_STATIC_STRING_EX(Spleen, SpleenVasculature); + DEFINE_STATIC_STRING_EX(Skin, SkinVasculature); + DEFINE_STATIC_STRING_EX(Muscle, MuscleVasculature); + DEFINE_STATIC_STRING_EX(LeftArm, LeftArmVasculature); + DEFINE_STATIC_STRING_EX(LeftLeg, LeftLegVasculature); + DEFINE_STATIC_STRING_EX(RightArm, RightArmVasculature); + DEFINE_STATIC_STRING_EX(RightLeg, RightLegVasculature); + + DEFINE_STATIC_STRING(Ground); + + static const std::vector& GetValues() + { + static std::vector _values = { + Aorta, Heart, Myocardium, LeftHeart, LeftAtrium, LeftVentricle, RightHeart, RightAtrium, RightVentricle, Pericardium, VenaCava, CerebralArteries, CerebralCapillaries, CerebralVeins, NeckArteries, NeckVeins, PulmonaryArteries, PulmonaryCapillaries, PulmonaryVeins, Lungs, LeftLung, LeftPulmonaryArteries, LeftPulmonaryCapillaries, LeftPulmonaryVeins, RightLung, RightPulmonaryArteries, RightPulmonaryCapillaries, RightPulmonaryVeins, Kidneys, LeftKidney, LeftRenalArtery, LeftNephron, LeftAfferentArteriole, LeftGlomerularCapillaries, LeftEfferentArteriole, LeftPeritubularCapillaries, LeftBowmansCapsules, LeftTubules, LeftRenalVein, RightKidney, RightRenalArtery, RightNephron, RightAfferentArteriole, RightGlomerularCapillaries, RightEfferentArteriole, RightPeritubularCapillaries, RightBowmansCapsules, RightTubules, RightRenalVein, Bone, Brain, Fat, Gut, Splanchnic, SmallIntestine, LargeIntestine, Liver, Spleen, Skin, Muscle, LeftArm, LeftLeg, RightArm, RightLeg + //,Ground }; - - namespace VascularLink { - - // Heart and Lungs - DEFINE_STATIC_STRING(VenaCavaToRightAtrium); - DEFINE_STATIC_STRING(RightAtriumToRightVentricle); - DEFINE_STATIC_STRING(RightVentricleToLeftPulmonaryArteries); - DEFINE_STATIC_STRING(LeftPulmonaryArteriesToCapillaries); - DEFINE_STATIC_STRING(LeftPulmonaryArteriesToVeins); - DEFINE_STATIC_STRING(LeftPulmonaryCapillariesToVeins); - DEFINE_STATIC_STRING(LeftPulmonaryVeinsToLeftAtrium); - DEFINE_STATIC_STRING(RightVentricleToRightPulmonaryArteries); - DEFINE_STATIC_STRING(RightPulmonaryArteriesToCapillaries); - DEFINE_STATIC_STRING(RightPulmonaryArteriesToVeins); - DEFINE_STATIC_STRING(RightPulmonaryCapillariesToVeins); - DEFINE_STATIC_STRING(RightPulmonaryVeinsToLeftAtrium); - DEFINE_STATIC_STRING(LeftAtriumToLeftVentricle); - DEFINE_STATIC_STRING(LeftVentricleToAorta); - //Cerebral - DEFINE_STATIC_STRING(AortaToNeckArteries); - DEFINE_STATIC_STRING(NeckArteriesToCerebralArteries); - DEFINE_STATIC_STRING(CerebralArteriesToCerebralCapillaries); - DEFINE_STATIC_STRING(CerebralCapillariesToCerebralVeins); - DEFINE_STATIC_STRING(CerebralVeinsToNeckVeins); - DEFINE_STATIC_STRING(NeckVeinsToVenaCava); - // Bone - DEFINE_STATIC_STRING(AortaToBone); - DEFINE_STATIC_STRING(BoneToVenaCava); - // Brain - DEFINE_STATIC_STRING(AortaToBrain); - DEFINE_STATIC_STRING(BrainToVenaCava); - // Fat - DEFINE_STATIC_STRING(AortaToFat); - DEFINE_STATIC_STRING(FatToVenaCava); - // Large Intestine - DEFINE_STATIC_STRING(AortaToLargeIntestine); - DEFINE_STATIC_STRING(LargeIntestineToLiver); - // Left Arm - DEFINE_STATIC_STRING(AortaToLeftArm); - DEFINE_STATIC_STRING(LeftArmToVenaCava); - // Left Kidney - DEFINE_STATIC_STRING(AortaToLeftKidney); - DEFINE_STATIC_STRING(LeftKidneyToVenaCava); - // Left Leg - DEFINE_STATIC_STRING(AortaToLeftLeg); - DEFINE_STATIC_STRING(LeftLegToVenaCava); - // Liver - DEFINE_STATIC_STRING(AortaToLiver); - DEFINE_STATIC_STRING(LiverToVenaCava); - // Muscle - DEFINE_STATIC_STRING(AortaToMuscle); - DEFINE_STATIC_STRING(MuscleToVenaCava); - // Myocardium - DEFINE_STATIC_STRING(AortaToMyocardium); - DEFINE_STATIC_STRING(MyocardiumToVenaCava); - // Right Arm - DEFINE_STATIC_STRING(AortaToRightArm); - DEFINE_STATIC_STRING(RightArmToVenaCava); - // Right Kidney - DEFINE_STATIC_STRING(AortaToRightKidney); - DEFINE_STATIC_STRING(RightKidneyToVenaCava); - // Right Leg - DEFINE_STATIC_STRING(AortaToRightLeg); - DEFINE_STATIC_STRING(RightLegToVenaCava); - // Skin - DEFINE_STATIC_STRING(AortaToSkin); - DEFINE_STATIC_STRING(SkinToVenaCava); - // Small Intestine - DEFINE_STATIC_STRING(AortaToSmallIntestine); - DEFINE_STATIC_STRING(SmallIntestineToLiver); - // Splanchnic - DEFINE_STATIC_STRING(AortaToSplanchnic); - DEFINE_STATIC_STRING(SplanchnicToLiver); - // Spleen - DEFINE_STATIC_STRING(AortaToSpleen); - DEFINE_STATIC_STRING(SpleenToLiver); - - // Hemorrhage and IV - DEFINE_STATIC_STRING(VenaCavaIV); - DEFINE_STATIC_STRING(VenaCavaHemorrhage); - DEFINE_STATIC_STRING(AortaHemorrhage); - DEFINE_STATIC_STRING(BrainHemorrhage); - DEFINE_STATIC_STRING(HeartHemorrhage); - DEFINE_STATIC_STRING(LeftLungHemorrhage); - DEFINE_STATIC_STRING(RightLungHemorrhage); - DEFINE_STATIC_STRING(LeftArmHemorrhage); - DEFINE_STATIC_STRING(RightArmHemorrhage); - DEFINE_STATIC_STRING(SpleenHemorrhage); - DEFINE_STATIC_STRING(SmallIntestineHemorrhage); - DEFINE_STATIC_STRING(LargeIntestineHemorrhage); - DEFINE_STATIC_STRING(SplanchnicHemorrhage); - DEFINE_STATIC_STRING(LeftKidneyHemorrhage); - DEFINE_STATIC_STRING(RightKidneyHemorrhage); - DEFINE_STATIC_STRING(LiverHemorrhage); - DEFINE_STATIC_STRING(LeftLegHemorrhage); - DEFINE_STATIC_STRING(RightLegHemorrhage); - - // Vascular To Tissue Links - DEFINE_STATIC_STRING(BoneVascularToTissue); - DEFINE_STATIC_STRING(BrainVascularToTissue); - DEFINE_STATIC_STRING(FatVascularToTissue); - DEFINE_STATIC_STRING(SmallIntestineVascularToTissue); - DEFINE_STATIC_STRING(LargeIntestineVascularToTissue); - DEFINE_STATIC_STRING(SplanchnicVascularToTissue); - DEFINE_STATIC_STRING(LeftKidneyVascularToTissue); - DEFINE_STATIC_STRING(LeftLungVascularToTissue); - DEFINE_STATIC_STRING(LiverVascularToTissue); - DEFINE_STATIC_STRING(MuscleVascularToTissue); - DEFINE_STATIC_STRING(MyocardiumVascularToTissue); - DEFINE_STATIC_STRING(RightKidneyVascularToTissue); - DEFINE_STATIC_STRING(RightLungVascularToTissue); - DEFINE_STATIC_STRING(SkinVascularToTissue); - DEFINE_STATIC_STRING(SpleenVascularToTissue); - - // Renal Links - // Reusing 'AortaToLeftKidney' to connect the Aorta To Left Renal Artery - DEFINE_STATIC_STRING(LeftRenalArteryToAfferentArteriole); - DEFINE_STATIC_STRING(LeftAfferentArterioleToGlomerularCapillaries); - DEFINE_STATIC_STRING(LeftGlomerularCapillariesToEfferentArteriole); - DEFINE_STATIC_STRING(LeftGlomerularCapillariesToBowmansCapsules); - DEFINE_STATIC_STRING(LeftBowmansCapsulesToTubules); - DEFINE_STATIC_STRING(LeftTubulesToPeritubularCapillaries); - DEFINE_STATIC_STRING(LeftEfferentArterioleToPeritubularCapillaries); - DEFINE_STATIC_STRING(LeftPeritubularCapillariesToRenalVein); - // Reusing 'LeftKidneyToVenaCava' to connect the Left Renal Vein To Vena Cava - - // Reusing 'AortaToRightKidney' to connect the Aorta To Right Renal Artery - DEFINE_STATIC_STRING(RightRenalArteryToAfferentArteriole); - DEFINE_STATIC_STRING(RightAfferentArterioleToGlomerularCapillaries); - DEFINE_STATIC_STRING(RightGlomerularCapillariesToEfferentArteriole); - DEFINE_STATIC_STRING(RightGlomerularCapillariesToBowmansCapsules); - DEFINE_STATIC_STRING(RightBowmansCapsulesToTubules); - DEFINE_STATIC_STRING(RightTubulesToPeritubularCapillaries); - DEFINE_STATIC_STRING(RightEfferentArterioleToPeritubularCapillaries); - DEFINE_STATIC_STRING(RightPeritubularCapillariesToRenalVein); - // Reusing 'RightKidneyToVenaCava' to connect the Right Renal Vein To Vena Cava); - - static const std::vector& GetValues() - { - static std::vector _values = { - VenaCavaToRightAtrium, RightAtriumToRightVentricle, RightVentricleToLeftPulmonaryArteries, LeftPulmonaryArteriesToCapillaries, LeftPulmonaryArteriesToVeins, LeftPulmonaryCapillariesToVeins, LeftPulmonaryVeinsToLeftAtrium, RightVentricleToRightPulmonaryArteries, RightPulmonaryArteriesToCapillaries, RightPulmonaryArteriesToVeins, RightPulmonaryCapillariesToVeins, RightPulmonaryVeinsToLeftAtrium, LeftAtriumToLeftVentricle, LeftVentricleToAorta, AortaToBone, BoneToVenaCava, AortaToBrain, BrainToVenaCava, AortaToFat, FatToVenaCava, AortaToLargeIntestine, LargeIntestineToLiver, AortaToLeftArm, LeftArmToVenaCava, AortaToLeftKidney, LeftKidneyToVenaCava, AortaToLeftLeg, LeftLegToVenaCava, AortaToLiver, LiverToVenaCava, AortaToMuscle, MuscleToVenaCava, AortaToMyocardium, MyocardiumToVenaCava, AortaToRightArm, RightArmToVenaCava, AortaToRightKidney, RightKidneyToVenaCava, AortaToRightLeg, RightLegToVenaCava, AortaToSkin, SkinToVenaCava, AortaToSmallIntestine, SmallIntestineToLiver, AortaToSplanchnic, SplanchnicToLiver, AortaToSpleen, SpleenToLiver - - , - AortaToNeckArteries, NeckArteriesToCerebralArteries, CerebralArteriesToCerebralCapillaries, CerebralCapillariesToCerebralVeins, CerebralVeinsToNeckVeins, NeckVeinsToVenaCava - - , - BoneVascularToTissue, BrainVascularToTissue, FatVascularToTissue, SmallIntestineVascularToTissue, LargeIntestineVascularToTissue, SplanchnicVascularToTissue, LeftKidneyVascularToTissue, LeftLungVascularToTissue, LiverVascularToTissue, MuscleVascularToTissue, MyocardiumVascularToTissue, RightKidneyVascularToTissue, RightLungVascularToTissue, SkinVascularToTissue, SpleenVascularToTissue - - , - LeftRenalArteryToAfferentArteriole, LeftAfferentArterioleToGlomerularCapillaries, LeftGlomerularCapillariesToEfferentArteriole, LeftGlomerularCapillariesToBowmansCapsules, LeftBowmansCapsulesToTubules, LeftTubulesToPeritubularCapillaries, LeftEfferentArterioleToPeritubularCapillaries, LeftPeritubularCapillariesToRenalVein, RightRenalArteryToAfferentArteriole, RightAfferentArterioleToGlomerularCapillaries, RightGlomerularCapillariesToEfferentArteriole, RightGlomerularCapillariesToBowmansCapsules, RightBowmansCapsulesToTubules, RightTubulesToPeritubularCapillaries, RightEfferentArterioleToPeritubularCapillaries, RightPeritubularCapillariesToRenalVein - }; - return _values; - } + return _values; + } + }; + + namespace VascularLink { + + // Heart and Lungs + DEFINE_STATIC_STRING(VenaCavaToRightAtrium); + DEFINE_STATIC_STRING(RightAtriumToRightVentricle); + DEFINE_STATIC_STRING(RightVentricleToLeftPulmonaryArteries); + DEFINE_STATIC_STRING(LeftPulmonaryArteriesToCapillaries); + DEFINE_STATIC_STRING(LeftPulmonaryArteriesToVeins); + DEFINE_STATIC_STRING(LeftPulmonaryCapillariesToVeins); + DEFINE_STATIC_STRING(LeftPulmonaryVeinsToLeftAtrium); + DEFINE_STATIC_STRING(RightVentricleToRightPulmonaryArteries); + DEFINE_STATIC_STRING(RightPulmonaryArteriesToCapillaries); + DEFINE_STATIC_STRING(RightPulmonaryArteriesToVeins); + DEFINE_STATIC_STRING(RightPulmonaryCapillariesToVeins); + DEFINE_STATIC_STRING(RightPulmonaryVeinsToLeftAtrium); + DEFINE_STATIC_STRING(LeftAtriumToLeftVentricle); + DEFINE_STATIC_STRING(LeftVentricleToAorta); + // Cerebral + DEFINE_STATIC_STRING(AortaToNeckArteries); + DEFINE_STATIC_STRING(NeckArteriesToCerebralArteries); + DEFINE_STATIC_STRING(CerebralArteriesToCerebralCapillaries); + DEFINE_STATIC_STRING(CerebralCapillariesToCerebralVeins); + DEFINE_STATIC_STRING(CerebralVeinsToNeckVeins); + DEFINE_STATIC_STRING(NeckVeinsToVenaCava); + // Bone + DEFINE_STATIC_STRING(AortaToBone); + DEFINE_STATIC_STRING(BoneToVenaCava); + // Brain + DEFINE_STATIC_STRING(AortaToBrain); + DEFINE_STATIC_STRING(BrainToVenaCava); + // Fat + DEFINE_STATIC_STRING(AortaToFat); + DEFINE_STATIC_STRING(FatToVenaCava); + // Large Intestine + DEFINE_STATIC_STRING(AortaToLargeIntestine); + DEFINE_STATIC_STRING(LargeIntestineToLiver); + // Left Arm + DEFINE_STATIC_STRING(AortaToLeftArm); + DEFINE_STATIC_STRING(LeftArmToVenaCava); + // Left Kidney + DEFINE_STATIC_STRING(AortaToLeftKidney); + DEFINE_STATIC_STRING(LeftKidneyToVenaCava); + // Left Leg + DEFINE_STATIC_STRING(AortaToLeftLeg); + DEFINE_STATIC_STRING(LeftLegToVenaCava); + // Liver + DEFINE_STATIC_STRING(AortaToLiver); + DEFINE_STATIC_STRING(LiverToVenaCava); + // Muscle + DEFINE_STATIC_STRING(AortaToMuscle); + DEFINE_STATIC_STRING(MuscleToVenaCava); + // Myocardium + DEFINE_STATIC_STRING(AortaToMyocardium); + DEFINE_STATIC_STRING(MyocardiumToVenaCava); + // Right Arm + DEFINE_STATIC_STRING(AortaToRightArm); + DEFINE_STATIC_STRING(RightArmToVenaCava); + // Right Kidney + DEFINE_STATIC_STRING(AortaToRightKidney); + DEFINE_STATIC_STRING(RightKidneyToVenaCava); + // Right Leg + DEFINE_STATIC_STRING(AortaToRightLeg); + DEFINE_STATIC_STRING(RightLegToVenaCava); + // Skin + DEFINE_STATIC_STRING(AortaToSkin); + DEFINE_STATIC_STRING(SkinToVenaCava); + // Small Intestine + DEFINE_STATIC_STRING(AortaToSmallIntestine); + DEFINE_STATIC_STRING(SmallIntestineToLiver); + // Splanchnic + DEFINE_STATIC_STRING(AortaToSplanchnic); + DEFINE_STATIC_STRING(SplanchnicToLiver); + // Spleen + DEFINE_STATIC_STRING(AortaToSpleen); + DEFINE_STATIC_STRING(SpleenToLiver); + + // Hemorrhage and IV + DEFINE_STATIC_STRING(VenaCavaIV); + DEFINE_STATIC_STRING(VenaCavaHemorrhage); + DEFINE_STATIC_STRING(AortaHemorrhage); + DEFINE_STATIC_STRING(BrainHemorrhage); + DEFINE_STATIC_STRING(HeartHemorrhage); + DEFINE_STATIC_STRING(LeftLungHemorrhage); + DEFINE_STATIC_STRING(RightLungHemorrhage); + DEFINE_STATIC_STRING(LeftArmHemorrhage); + DEFINE_STATIC_STRING(RightArmHemorrhage); + DEFINE_STATIC_STRING(SpleenHemorrhage); + DEFINE_STATIC_STRING(SmallIntestineHemorrhage); + DEFINE_STATIC_STRING(LargeIntestineHemorrhage); + DEFINE_STATIC_STRING(SplanchnicHemorrhage); + DEFINE_STATIC_STRING(LeftKidneyHemorrhage); + DEFINE_STATIC_STRING(RightKidneyHemorrhage); + DEFINE_STATIC_STRING(LiverHemorrhage); + DEFINE_STATIC_STRING(LeftLegHemorrhage); + DEFINE_STATIC_STRING(RightLegHemorrhage); + + // Vascular To Tissue Links + DEFINE_STATIC_STRING(BoneVascularToTissue); + DEFINE_STATIC_STRING(BrainVascularToTissue); + DEFINE_STATIC_STRING(FatVascularToTissue); + DEFINE_STATIC_STRING(SmallIntestineVascularToTissue); + DEFINE_STATIC_STRING(LargeIntestineVascularToTissue); + DEFINE_STATIC_STRING(SplanchnicVascularToTissue); + DEFINE_STATIC_STRING(LeftKidneyVascularToTissue); + DEFINE_STATIC_STRING(LeftLungVascularToTissue); + DEFINE_STATIC_STRING(LiverVascularToTissue); + DEFINE_STATIC_STRING(MuscleVascularToTissue); + DEFINE_STATIC_STRING(MyocardiumVascularToTissue); + DEFINE_STATIC_STRING(RightKidneyVascularToTissue); + DEFINE_STATIC_STRING(RightLungVascularToTissue); + DEFINE_STATIC_STRING(SkinVascularToTissue); + DEFINE_STATIC_STRING(SpleenVascularToTissue); + + // Renal Links + // Reusing 'AortaToLeftKidney' to connect the Aorta To Left Renal Artery + DEFINE_STATIC_STRING(LeftRenalArteryToAfferentArteriole); + DEFINE_STATIC_STRING(LeftAfferentArterioleToGlomerularCapillaries); + DEFINE_STATIC_STRING(LeftGlomerularCapillariesToEfferentArteriole); + DEFINE_STATIC_STRING(LeftGlomerularCapillariesToBowmansCapsules); + DEFINE_STATIC_STRING(LeftBowmansCapsulesToTubules); + DEFINE_STATIC_STRING(LeftTubulesToPeritubularCapillaries); + DEFINE_STATIC_STRING(LeftEfferentArterioleToPeritubularCapillaries); + DEFINE_STATIC_STRING(LeftPeritubularCapillariesToRenalVein); + // Reusing 'LeftKidneyToVenaCava' to connect the Left Renal Vein To Vena Cava + + // Reusing 'AortaToRightKidney' to connect the Aorta To Right Renal Artery + DEFINE_STATIC_STRING(RightRenalArteryToAfferentArteriole); + DEFINE_STATIC_STRING(RightAfferentArterioleToGlomerularCapillaries); + DEFINE_STATIC_STRING(RightGlomerularCapillariesToEfferentArteriole); + DEFINE_STATIC_STRING(RightGlomerularCapillariesToBowmansCapsules); + DEFINE_STATIC_STRING(RightBowmansCapsulesToTubules); + DEFINE_STATIC_STRING(RightTubulesToPeritubularCapillaries); + DEFINE_STATIC_STRING(RightEfferentArterioleToPeritubularCapillaries); + DEFINE_STATIC_STRING(RightPeritubularCapillariesToRenalVein); + // Reusing 'RightKidneyToVenaCava' to connect the Right Renal Vein To Vena Cava); + + static const std::vector& GetValues() + { + static std::vector _values = { + VenaCavaToRightAtrium, RightAtriumToRightVentricle, RightVentricleToLeftPulmonaryArteries, LeftPulmonaryArteriesToCapillaries, LeftPulmonaryArteriesToVeins, LeftPulmonaryCapillariesToVeins, LeftPulmonaryVeinsToLeftAtrium, RightVentricleToRightPulmonaryArteries, RightPulmonaryArteriesToCapillaries, RightPulmonaryArteriesToVeins, RightPulmonaryCapillariesToVeins, RightPulmonaryVeinsToLeftAtrium, LeftAtriumToLeftVentricle, LeftVentricleToAorta, AortaToBone, BoneToVenaCava, AortaToBrain, BrainToVenaCava, AortaToFat, FatToVenaCava, AortaToLargeIntestine, LargeIntestineToLiver, AortaToLeftArm, LeftArmToVenaCava, AortaToLeftKidney, LeftKidneyToVenaCava, AortaToLeftLeg, LeftLegToVenaCava, AortaToLiver, LiverToVenaCava, AortaToMuscle, MuscleToVenaCava, AortaToMyocardium, MyocardiumToVenaCava, AortaToRightArm, RightArmToVenaCava, AortaToRightKidney, RightKidneyToVenaCava, AortaToRightLeg, RightLegToVenaCava, AortaToSkin, SkinToVenaCava, AortaToSmallIntestine, SmallIntestineToLiver, AortaToSplanchnic, SplanchnicToLiver, AortaToSpleen, SpleenToLiver + + , + AortaToNeckArteries, NeckArteriesToCerebralArteries, CerebralArteriesToCerebralCapillaries, CerebralCapillariesToCerebralVeins, CerebralVeinsToNeckVeins, NeckVeinsToVenaCava + + , + BoneVascularToTissue, BrainVascularToTissue, FatVascularToTissue, SmallIntestineVascularToTissue, LargeIntestineVascularToTissue, SplanchnicVascularToTissue, LeftKidneyVascularToTissue, LeftLungVascularToTissue, LiverVascularToTissue, MuscleVascularToTissue, MyocardiumVascularToTissue, RightKidneyVascularToTissue, RightLungVascularToTissue, SkinVascularToTissue, SpleenVascularToTissue + + , + LeftRenalArteryToAfferentArteriole, LeftAfferentArterioleToGlomerularCapillaries, LeftGlomerularCapillariesToEfferentArteriole, LeftGlomerularCapillariesToBowmansCapsules, LeftBowmansCapsulesToTubules, LeftTubulesToPeritubularCapillaries, LeftEfferentArterioleToPeritubularCapillaries, LeftPeritubularCapillariesToRenalVein, RightRenalArteryToAfferentArteriole, RightAfferentArterioleToGlomerularCapillaries, RightGlomerularCapillariesToEfferentArteriole, RightGlomerularCapillariesToBowmansCapsules, RightBowmansCapsulesToTubules, RightTubulesToPeritubularCapillaries, RightEfferentArterioleToPeritubularCapillaries, RightPeritubularCapillariesToRenalVein }; + return _values; + } + }; - namespace UrineCompartment { + namespace UrineCompartment { - DEFINE_STATIC_STRING(Ureters); - DEFINE_STATIC_STRING(LeftUreter); - DEFINE_STATIC_STRING(RightUreter); - DEFINE_STATIC_STRING(Bladder); + DEFINE_STATIC_STRING(Ureters); + DEFINE_STATIC_STRING(LeftUreter); + DEFINE_STATIC_STRING(RightUreter); + DEFINE_STATIC_STRING(Bladder); - static const std::vector& GetValues() - { - static std::vector _values = { - Ureters, LeftUreter, RightUreter, Bladder - }; - return _values; - } + static const std::vector& GetValues() + { + static std::vector _values = { + Ureters, LeftUreter, RightUreter, Bladder }; + return _values; + } + }; - namespace UrineLink { + namespace UrineLink { - DEFINE_STATIC_STRING(LeftTubulesToUreter); - DEFINE_STATIC_STRING(LeftUreterToBladder); + DEFINE_STATIC_STRING(LeftTubulesToUreter); + DEFINE_STATIC_STRING(LeftUreterToBladder); - DEFINE_STATIC_STRING(RightTubulesToUreter); - DEFINE_STATIC_STRING(RightUreterToBladder); + DEFINE_STATIC_STRING(RightTubulesToUreter); + DEFINE_STATIC_STRING(RightUreterToBladder); - DEFINE_STATIC_STRING(BladderToGround); - DEFINE_STATIC_STRING(BladderToGroundSource); + DEFINE_STATIC_STRING(BladderToGround); + DEFINE_STATIC_STRING(BladderToGroundSource); - static const std::vector& GetValues() - { - static std::vector _values = { - LeftTubulesToUreter, LeftUreterToBladder, RightTubulesToUreter, RightUreterToBladder, BladderToGround, BladderToGroundSource - }; - return _values; - } + static const std::vector& GetValues() + { + static std::vector _values = { + LeftTubulesToUreter, LeftUreterToBladder, RightTubulesToUreter, RightUreterToBladder, BladderToGround, BladderToGroundSource }; + return _values; + } + }; - namespace LymphCompartment { + namespace LymphCompartment { - DEFINE_STATIC_STRING(Lymph); + DEFINE_STATIC_STRING(Lymph); - static const std::vector& GetValues() - { - static std::vector _values = { - Lymph - }; - return _values; - } + static const std::vector& GetValues() + { + static std::vector _values = { + Lymph }; - - namespace LymphLink { - - DEFINE_STATIC_STRING(BoneTissueToLymph); - DEFINE_STATIC_STRING(BrainTissueToLymph); - DEFINE_STATIC_STRING(FatTissueToLymph); - DEFINE_STATIC_STRING(GutTissueToLymph); - DEFINE_STATIC_STRING(LeftKidneyTissueToLymph); - DEFINE_STATIC_STRING(LeftLungTissueToLymph); - DEFINE_STATIC_STRING(LiverTissueToLymph); - DEFINE_STATIC_STRING(MuscleTissueToLymph); - DEFINE_STATIC_STRING(MyocardiumTissueToLymph); - DEFINE_STATIC_STRING(RightKidneyTissueToLymph); - DEFINE_STATIC_STRING(RightLungTissueToLymph); - DEFINE_STATIC_STRING(SkinTissueToLymph); - DEFINE_STATIC_STRING(SpleenTissueToLymph); - - DEFINE_STATIC_STRING(LymphToVenaCava); - - static const std::vector& GetValues() - { - static std::vector _values = { - BoneTissueToLymph, BrainTissueToLymph, FatTissueToLymph, GutTissueToLymph, LeftKidneyTissueToLymph, LeftLungTissueToLymph, LiverTissueToLymph, MuscleTissueToLymph, MyocardiumTissueToLymph, RightKidneyTissueToLymph, RightLungTissueToLymph, SkinTissueToLymph, SpleenTissueToLymph, LymphToVenaCava - }; - return _values; - } + return _values; + } + }; + + namespace LymphLink { + + DEFINE_STATIC_STRING(BoneTissueToLymph); + DEFINE_STATIC_STRING(BrainTissueToLymph); + DEFINE_STATIC_STRING(FatTissueToLymph); + DEFINE_STATIC_STRING(GutTissueToLymph); + DEFINE_STATIC_STRING(LeftKidneyTissueToLymph); + DEFINE_STATIC_STRING(LeftLungTissueToLymph); + DEFINE_STATIC_STRING(LiverTissueToLymph); + DEFINE_STATIC_STRING(MuscleTissueToLymph); + DEFINE_STATIC_STRING(MyocardiumTissueToLymph); + DEFINE_STATIC_STRING(RightKidneyTissueToLymph); + DEFINE_STATIC_STRING(RightLungTissueToLymph); + DEFINE_STATIC_STRING(SkinTissueToLymph); + DEFINE_STATIC_STRING(SpleenTissueToLymph); + + DEFINE_STATIC_STRING(LymphToVenaCava); + + static const std::vector& GetValues() + { + static std::vector _values = { + BoneTissueToLymph, BrainTissueToLymph, FatTissueToLymph, GutTissueToLymph, LeftKidneyTissueToLymph, LeftLungTissueToLymph, LiverTissueToLymph, MuscleTissueToLymph, MyocardiumTissueToLymph, RightKidneyTissueToLymph, RightLungTissueToLymph, SkinTissueToLymph, SpleenTissueToLymph, LymphToVenaCava }; - - namespace TemperatureCompartment { - - DEFINE_STATIC_STRING(Active); - DEFINE_STATIC_STRING(Ambient); - DEFINE_STATIC_STRING(Clothing); - DEFINE_STATIC_STRING(Enclosure); - DEFINE_STATIC_STRING(ExternalCore); - DEFINE_STATIC_STRING(ExternalTorsoSkin); - DEFINE_STATIC_STRING(ExternalHeadSkin); - DEFINE_STATIC_STRING(ExternalLeftArmSkin); - DEFINE_STATIC_STRING(ExternalRightArmSkin); - DEFINE_STATIC_STRING(ExternalLeftLegSkin); - DEFINE_STATIC_STRING(ExternalRightLegSkin); - DEFINE_STATIC_STRING(ExternalGround); - DEFINE_STATIC_STRING(InternalCore); - DEFINE_STATIC_STRING(InternalTorsoSkin); - DEFINE_STATIC_STRING(InternalHeadSkin); - DEFINE_STATIC_STRING(InternalLeftArmSkin); - DEFINE_STATIC_STRING(InternalRightArmSkin); - DEFINE_STATIC_STRING(InternalLeftLegSkin); - DEFINE_STATIC_STRING(InternalRightLegSkin); - DEFINE_STATIC_STRING(InternalGround); - - static const std::vector& GetValues() - { - static std::vector _values = { - Active, Ambient, Clothing, Enclosure, ExternalCore, ExternalTorsoSkin, ExternalHeadSkin, ExternalLeftArmSkin, ExternalRightArmSkin, ExternalLeftLegSkin, ExternalRightLegSkin, ExternalGround, InternalCore, InternalTorsoSkin, InternalHeadSkin, InternalLeftArmSkin, InternalRightArmSkin, InternalLeftLegSkin, InternalRightLegSkin, InternalGround - }; - return _values; - } + return _values; + } + }; + + namespace TemperatureCompartment { + + DEFINE_STATIC_STRING(Active); + DEFINE_STATIC_STRING(Ambient); + DEFINE_STATIC_STRING(Clothing); + DEFINE_STATIC_STRING(Enclosure); + DEFINE_STATIC_STRING(ExternalCore); + DEFINE_STATIC_STRING(ExternalTorsoSkin); + DEFINE_STATIC_STRING(ExternalHeadSkin); + DEFINE_STATIC_STRING(ExternalLeftArmSkin); + DEFINE_STATIC_STRING(ExternalRightArmSkin); + DEFINE_STATIC_STRING(ExternalLeftLegSkin); + DEFINE_STATIC_STRING(ExternalRightLegSkin); + DEFINE_STATIC_STRING(ExternalGround); + DEFINE_STATIC_STRING(InternalCore); + DEFINE_STATIC_STRING(InternalTorsoSkin); + DEFINE_STATIC_STRING(InternalHeadSkin); + DEFINE_STATIC_STRING(InternalLeftArmSkin); + DEFINE_STATIC_STRING(InternalRightArmSkin); + DEFINE_STATIC_STRING(InternalLeftLegSkin); + DEFINE_STATIC_STRING(InternalRightLegSkin); + DEFINE_STATIC_STRING(InternalGround); + + static const std::vector& GetValues() + { + static std::vector _values = { + Active, Ambient, Clothing, Enclosure, ExternalCore, ExternalTorsoSkin, ExternalHeadSkin, ExternalLeftArmSkin, ExternalRightArmSkin, ExternalLeftLegSkin, ExternalRightLegSkin, ExternalGround, InternalCore, InternalTorsoSkin, InternalHeadSkin, InternalLeftArmSkin, InternalRightArmSkin, InternalLeftLegSkin, InternalRightLegSkin, InternalGround }; - - namespace TemperatureLink { - - DEFINE_STATIC_STRING(ActiveToClothing); - DEFINE_STATIC_STRING(ClothingToEnclosure); - DEFINE_STATIC_STRING(ClothingToEnvironment); - DEFINE_STATIC_STRING(ExternalCoreToGround); - DEFINE_STATIC_STRING(GroundToActive); - DEFINE_STATIC_STRING(GroundToClothing); - DEFINE_STATIC_STRING(GroundToEnclosure); - DEFINE_STATIC_STRING(GroundToEnvironment); - DEFINE_STATIC_STRING(ExternalTorsoSkinToGround); - DEFINE_STATIC_STRING(ExternalHeadSkinToGround); - DEFINE_STATIC_STRING(ExternalLeftArmSkinToGround); - DEFINE_STATIC_STRING(ExternalRightArmSkinToGround); - DEFINE_STATIC_STRING(ExternalLeftLegSkinToGround); - DEFINE_STATIC_STRING(ExternalRightLegSkinToGround); - DEFINE_STATIC_STRING(ExternalTorsoSkinToClothing); - DEFINE_STATIC_STRING(ExternalHeadSkinToClothing); - DEFINE_STATIC_STRING(ExternalLeftArmSkinToClothing); - DEFINE_STATIC_STRING(ExternalRightArmSkinToClothing); - DEFINE_STATIC_STRING(ExternalLeftLegSkinToClothing); - DEFINE_STATIC_STRING(ExternalRightLegSkinToClothing); - DEFINE_STATIC_STRING(GroundToInternalCore); - DEFINE_STATIC_STRING(GroundToInternalTorsoSkin); - DEFINE_STATIC_STRING(GroundToInternalHeadSkin); - DEFINE_STATIC_STRING(GroundToInternalLeftArmSkin); - DEFINE_STATIC_STRING(GroundToInternalRightArmSkin); - DEFINE_STATIC_STRING(GroundToInternalLeftLegSkin); - DEFINE_STATIC_STRING(GroundToInternalRightLegSkin); - DEFINE_STATIC_STRING(InternalCoreToInternalTorsoSkin); - DEFINE_STATIC_STRING(InternalCoreToInternalHeadSkin); - DEFINE_STATIC_STRING(InternalCoreToInternalLeftArmSkin); - DEFINE_STATIC_STRING(InternalCoreToInternalRightArmSkin); - DEFINE_STATIC_STRING(InternalCoreToInternalLeftLegSkin); - DEFINE_STATIC_STRING(InternalCoreToInternalRightLegSkin); - DEFINE_STATIC_STRING(InternalCoreToGround); - DEFINE_STATIC_STRING(InternalTorsoSkinToGround); - DEFINE_STATIC_STRING(InternalHeadSkinToGround); - DEFINE_STATIC_STRING(InternalLeftArmSkinToGround); - DEFINE_STATIC_STRING(InternalRightArmSkinToGround); - DEFINE_STATIC_STRING(InternalLeftLegSkinToGround); - DEFINE_STATIC_STRING(InternalRightLegSkinToGround); - DEFINE_STATIC_STRING(InternalCoreToExternalCore); - DEFINE_STATIC_STRING(InternalTorsoSkinToExternalTorsoSkin); - DEFINE_STATIC_STRING(InternalHeadSkinToExternalHeadSkin); - DEFINE_STATIC_STRING(InternalLeftArmSkinToExternalLeftArmSkin); - DEFINE_STATIC_STRING(InternalRightArmSkinToExternalRightArmSkin); - DEFINE_STATIC_STRING(InternalLeftLegSkinToExternalLeftLegSkin); - DEFINE_STATIC_STRING(InternalRightLegSkinToExternalRightLegSkin); - - static const std::vector& GetValues() - { - static std::vector _values = { - ActiveToClothing, ClothingToEnclosure, ClothingToEnvironment, ExternalCoreToGround, GroundToActive, GroundToClothing, GroundToEnclosure, GroundToEnvironment, ExternalTorsoSkinToGround, ExternalHeadSkinToGround, ExternalLeftArmSkinToGround, ExternalRightArmSkinToGround, ExternalLeftLegSkinToGround, ExternalRightLegSkinToGround, ExternalTorsoSkinToClothing, ExternalHeadSkinToClothing, ExternalLeftArmSkinToClothing, ExternalRightArmSkinToClothing, ExternalLeftLegSkinToClothing, ExternalRightLegSkinToClothing, GroundToInternalCore, GroundToInternalTorsoSkin, GroundToInternalHeadSkin, GroundToInternalLeftArmSkin, GroundToInternalRightArmSkin, GroundToInternalLeftLegSkin, GroundToInternalRightLegSkin, InternalCoreToInternalTorsoSkin, InternalCoreToInternalHeadSkin, InternalCoreToInternalLeftArmSkin, InternalCoreToInternalRightArmSkin, InternalCoreToInternalLeftLegSkin, InternalCoreToInternalRightLegSkin, InternalCoreToGround, InternalTorsoSkinToGround, InternalHeadSkinToGround, InternalLeftArmSkinToGround, InternalRightArmSkinToGround, InternalLeftLegSkinToGround, InternalRightLegSkinToGround, InternalCoreToExternalCore, InternalTorsoSkinToExternalTorsoSkin, InternalHeadSkinToExternalHeadSkin, InternalLeftArmSkinToExternalLeftArmSkin, InternalRightArmSkinToExternalRightArmSkin, InternalLeftLegSkinToExternalLeftLegSkin, InternalRightLegSkinToExternalRightLegSkin - }; - return _values; - } + return _values; + } + }; + + namespace TemperatureLink { + + DEFINE_STATIC_STRING(ActiveToClothing); + DEFINE_STATIC_STRING(ClothingToEnclosure); + DEFINE_STATIC_STRING(ClothingToEnvironment); + DEFINE_STATIC_STRING(ExternalCoreToGround); + DEFINE_STATIC_STRING(GroundToActive); + DEFINE_STATIC_STRING(GroundToClothing); + DEFINE_STATIC_STRING(GroundToEnclosure); + DEFINE_STATIC_STRING(GroundToEnvironment); + DEFINE_STATIC_STRING(ExternalTorsoSkinToGround); + DEFINE_STATIC_STRING(ExternalHeadSkinToGround); + DEFINE_STATIC_STRING(ExternalLeftArmSkinToGround); + DEFINE_STATIC_STRING(ExternalRightArmSkinToGround); + DEFINE_STATIC_STRING(ExternalLeftLegSkinToGround); + DEFINE_STATIC_STRING(ExternalRightLegSkinToGround); + DEFINE_STATIC_STRING(ExternalTorsoSkinToClothing); + DEFINE_STATIC_STRING(ExternalHeadSkinToClothing); + DEFINE_STATIC_STRING(ExternalLeftArmSkinToClothing); + DEFINE_STATIC_STRING(ExternalRightArmSkinToClothing); + DEFINE_STATIC_STRING(ExternalLeftLegSkinToClothing); + DEFINE_STATIC_STRING(ExternalRightLegSkinToClothing); + DEFINE_STATIC_STRING(GroundToInternalCore); + DEFINE_STATIC_STRING(GroundToInternalTorsoSkin); + DEFINE_STATIC_STRING(GroundToInternalHeadSkin); + DEFINE_STATIC_STRING(GroundToInternalLeftArmSkin); + DEFINE_STATIC_STRING(GroundToInternalRightArmSkin); + DEFINE_STATIC_STRING(GroundToInternalLeftLegSkin); + DEFINE_STATIC_STRING(GroundToInternalRightLegSkin); + DEFINE_STATIC_STRING(InternalCoreToInternalTorsoSkin); + DEFINE_STATIC_STRING(InternalCoreToInternalHeadSkin); + DEFINE_STATIC_STRING(InternalCoreToInternalLeftArmSkin); + DEFINE_STATIC_STRING(InternalCoreToInternalRightArmSkin); + DEFINE_STATIC_STRING(InternalCoreToInternalLeftLegSkin); + DEFINE_STATIC_STRING(InternalCoreToInternalRightLegSkin); + DEFINE_STATIC_STRING(InternalCoreToGround); + DEFINE_STATIC_STRING(InternalTorsoSkinToGround); + DEFINE_STATIC_STRING(InternalHeadSkinToGround); + DEFINE_STATIC_STRING(InternalLeftArmSkinToGround); + DEFINE_STATIC_STRING(InternalRightArmSkinToGround); + DEFINE_STATIC_STRING(InternalLeftLegSkinToGround); + DEFINE_STATIC_STRING(InternalRightLegSkinToGround); + DEFINE_STATIC_STRING(InternalCoreToExternalCore); + DEFINE_STATIC_STRING(InternalTorsoSkinToExternalTorsoSkin); + DEFINE_STATIC_STRING(InternalHeadSkinToExternalHeadSkin); + DEFINE_STATIC_STRING(InternalLeftArmSkinToExternalLeftArmSkin); + DEFINE_STATIC_STRING(InternalRightArmSkinToExternalRightArmSkin); + DEFINE_STATIC_STRING(InternalLeftLegSkinToExternalLeftLegSkin); + DEFINE_STATIC_STRING(InternalRightLegSkinToExternalRightLegSkin); + + static const std::vector& GetValues() + { + static std::vector _values = { + ActiveToClothing, ClothingToEnclosure, ClothingToEnvironment, ExternalCoreToGround, GroundToActive, GroundToClothing, GroundToEnclosure, GroundToEnvironment, ExternalTorsoSkinToGround, ExternalHeadSkinToGround, ExternalLeftArmSkinToGround, ExternalRightArmSkinToGround, ExternalLeftLegSkinToGround, ExternalRightLegSkinToGround, ExternalTorsoSkinToClothing, ExternalHeadSkinToClothing, ExternalLeftArmSkinToClothing, ExternalRightArmSkinToClothing, ExternalLeftLegSkinToClothing, ExternalRightLegSkinToClothing, GroundToInternalCore, GroundToInternalTorsoSkin, GroundToInternalHeadSkin, GroundToInternalLeftArmSkin, GroundToInternalRightArmSkin, GroundToInternalLeftLegSkin, GroundToInternalRightLegSkin, InternalCoreToInternalTorsoSkin, InternalCoreToInternalHeadSkin, InternalCoreToInternalLeftArmSkin, InternalCoreToInternalRightArmSkin, InternalCoreToInternalLeftLegSkin, InternalCoreToInternalRightLegSkin, InternalCoreToGround, InternalTorsoSkinToGround, InternalHeadSkinToGround, InternalLeftArmSkinToGround, InternalRightArmSkinToGround, InternalLeftLegSkinToGround, InternalRightLegSkinToGround, InternalCoreToExternalCore, InternalTorsoSkinToExternalTorsoSkin, InternalHeadSkinToExternalHeadSkin, InternalLeftArmSkinToExternalLeftArmSkin, InternalRightArmSkinToExternalRightArmSkin, InternalLeftLegSkinToExternalLeftLegSkin, InternalRightLegSkinToExternalRightLegSkin }; + return _values; + } + }; - namespace EnvironmentCompartment { + namespace EnvironmentCompartment { - DEFINE_STATIC_STRING(Ambient); + DEFINE_STATIC_STRING(Ambient); - static const std::vector& GetValues() - { - static std::vector _values = { - Ambient - }; - return _values; - } + static const std::vector& GetValues() + { + static std::vector _values = { + Ambient }; - - namespace AnesthesiaMachineCompartment { - - DEFINE_STATIC_STRING(AnesthesiaConnection); - DEFINE_STATIC_STRING(ExpiratoryLimb); - DEFINE_STATIC_STRING(GasInlet); - DEFINE_STATIC_STRING(GasSource); - DEFINE_STATIC_STRING(InspiratoryLimb); - DEFINE_STATIC_STRING(ReliefValve); - DEFINE_STATIC_STRING(Scrubber); - DEFINE_STATIC_STRING(Selector); - DEFINE_STATIC_STRING(Ventilator); - DEFINE_STATIC_STRING(VentilatorConnection); - DEFINE_STATIC_STRING(YPiece); - - static const std::vector& GetValues() - { - static std::vector _values = { - AnesthesiaConnection, ExpiratoryLimb, GasInlet, GasSource, InspiratoryLimb, ReliefValve, Scrubber, Selector, Ventilator, VentilatorConnection, YPiece - }; - return _values; - } + return _values; + } + }; + + namespace AnesthesiaMachineCompartment { + + DEFINE_STATIC_STRING(AnesthesiaConnection); + DEFINE_STATIC_STRING(ExpiratoryLimb); + DEFINE_STATIC_STRING(GasInlet); + DEFINE_STATIC_STRING(GasSource); + DEFINE_STATIC_STRING(InspiratoryLimb); + DEFINE_STATIC_STRING(ReliefValve); + DEFINE_STATIC_STRING(Scrubber); + DEFINE_STATIC_STRING(Selector); + DEFINE_STATIC_STRING(Ventilator); + DEFINE_STATIC_STRING(VentilatorConnection); + DEFINE_STATIC_STRING(YPiece); + + static const std::vector& GetValues() + { + static std::vector _values = { + AnesthesiaConnection, ExpiratoryLimb, GasInlet, GasSource, InspiratoryLimb, ReliefValve, Scrubber, Selector, Ventilator, VentilatorConnection, YPiece }; - - namespace AnesthesiaMachineLink { - - DEFINE_STATIC_STRING(VentilatorToSelector); - DEFINE_STATIC_STRING(SelectorToReliefValve); - DEFINE_STATIC_STRING(SelectorToScrubber); - DEFINE_STATIC_STRING(ScrubberToGasInlet); - DEFINE_STATIC_STRING(Exhaust); - DEFINE_STATIC_STRING(GasSourceToGasInlet); - DEFINE_STATIC_STRING(GasInletToInspiratoryLimb); - DEFINE_STATIC_STRING(InspiratoryLimbToYPiece); - DEFINE_STATIC_STRING(YPieceToExpiratoryLimb); - DEFINE_STATIC_STRING(ExpiratoryLimbToSelector); - DEFINE_STATIC_STRING(YPieceToAnesthesiaConnection); - DEFINE_STATIC_STRING(AnesthesiaConnectionLeak); - DEFINE_STATIC_STRING(Mask); - - static const std::vector& GetValues() - { - static std::vector _values = { - VentilatorToSelector, SelectorToReliefValve, SelectorToScrubber, ScrubberToGasInlet, Exhaust, GasSourceToGasInlet, GasInletToInspiratoryLimb, InspiratoryLimbToYPiece, YPieceToExpiratoryLimb, ExpiratoryLimbToSelector, YPieceToAnesthesiaConnection, AnesthesiaConnectionLeak, Mask - }; - return _values; - } + return _values; + } + }; + + namespace AnesthesiaMachineLink { + + DEFINE_STATIC_STRING(VentilatorToSelector); + DEFINE_STATIC_STRING(SelectorToReliefValve); + DEFINE_STATIC_STRING(SelectorToScrubber); + DEFINE_STATIC_STRING(ScrubberToGasInlet); + DEFINE_STATIC_STRING(Exhaust); + DEFINE_STATIC_STRING(GasSourceToGasInlet); + DEFINE_STATIC_STRING(GasInletToInspiratoryLimb); + DEFINE_STATIC_STRING(InspiratoryLimbToYPiece); + DEFINE_STATIC_STRING(YPieceToExpiratoryLimb); + DEFINE_STATIC_STRING(ExpiratoryLimbToSelector); + DEFINE_STATIC_STRING(YPieceToAnesthesiaConnection); + DEFINE_STATIC_STRING(AnesthesiaConnectionLeak); + DEFINE_STATIC_STRING(Mask); + + static const std::vector& GetValues() + { + static std::vector _values = { + VentilatorToSelector, SelectorToReliefValve, SelectorToScrubber, ScrubberToGasInlet, Exhaust, GasSourceToGasInlet, GasInletToInspiratoryLimb, InspiratoryLimbToYPiece, YPieceToExpiratoryLimb, ExpiratoryLimbToSelector, YPieceToAnesthesiaConnection, AnesthesiaConnectionLeak, Mask }; + return _values; + } + }; - namespace InhalerCompartment { + namespace InhalerCompartment { - DEFINE_STATIC_STRING(Mouthpiece); + DEFINE_STATIC_STRING(Mouthpiece); - static const std::vector& GetValues() - { - static std::vector _values = { - Mouthpiece - }; - return _values; - } + static const std::vector& GetValues() + { + static std::vector _values = { + Mouthpiece }; + return _values; + } + }; - namespace InhalerLink { + namespace InhalerLink { - DEFINE_STATIC_STRING(EnvironmentToMouthpiece); - DEFINE_STATIC_STRING(MouthpieceToMouth); + DEFINE_STATIC_STRING(EnvironmentToMouthpiece); + DEFINE_STATIC_STRING(MouthpieceToMouth); - static const std::vector& GetValues() - { - static std::vector _values = { - EnvironmentToMouthpiece, MouthpieceToMouth - }; - return _values; - } + static const std::vector& GetValues() + { + static std::vector _values = { + EnvironmentToMouthpiece, MouthpieceToMouth }; + return _values; + } + }; - namespace NasalCannulaCompartment { - - DEFINE_STATIC_STRING(Nosepiece); - DEFINE_STATIC_STRING(OxygenTank); + namespace NasalCannulaCompartment { + DEFINE_STATIC_STRING(Nosepiece); + DEFINE_STATIC_STRING(OxygenTank); - static const std::vector& GetValues() - { - static std::vector _values = { - Nosepiece, OxygenTank - }; - return _values; - } + static const std::vector& GetValues() + { + static std::vector _values = { + Nosepiece, OxygenTank }; + return _values; + } + }; - namespace NasalCannulaLink { - - DEFINE_STATIC_STRING(OxygenTankToNosepiece); - DEFINE_STATIC_STRING(EnvironmentToOxygentank); - DEFINE_STATIC_STRING(ReturnFlow); - DEFINE_STATIC_STRING(NosepieceToMouth); + namespace NasalCannulaLink { + DEFINE_STATIC_STRING(OxygenTankToNosepiece); + DEFINE_STATIC_STRING(EnvironmentToOxygentank); + DEFINE_STATIC_STRING(ReturnFlow); + DEFINE_STATIC_STRING(NosepieceToMouth); - static const std::vector& GetValues() - { - static std::vector _values = { - OxygenTankToNosepiece, EnvironmentToOxygentank, ReturnFlow, NosepieceToMouth - }; - return _values; - } + static const std::vector& GetValues() + { + static std::vector _values = { + OxygenTankToNosepiece, EnvironmentToOxygentank, ReturnFlow, NosepieceToMouth }; + return _values; + } + }; - namespace MechanicalVentilatorCompartment { + namespace MechanicalVentilatorCompartment { - DEFINE_STATIC_STRING(Connection); + DEFINE_STATIC_STRING(Connection); - static const std::vector& GetValues() - { - static std::vector _values = { - Connection - }; - return _values; - } + static const std::vector& GetValues() + { + static std::vector _values = { + Connection }; + return _values; + } + }; - namespace MechanicalVentilatorLink { + namespace MechanicalVentilatorLink { - DEFINE_STATIC_STRING(ConnectionToMouth); + DEFINE_STATIC_STRING(ConnectionToMouth); - static const std::vector& GetValues() - { - static std::vector _values = { - ConnectionToMouth - }; - return _values; - } + static const std::vector& GetValues() + { + static std::vector _values = { + ConnectionToMouth }; + return _values; + } + }; - } //namespace biogears - } //namespace physiology -} //namespace tatrc -} //namespace mil +} // namespace physiology +} // namespace biogears -namespace BGE = mil::tatrc::physiology::biogears; +namespace BGE = biogears::physiology; diff --git a/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGears.h b/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGears.h index 07a9fbd49..bca08eeea 100644 --- a/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGears.h +++ b/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGears.h @@ -23,6 +23,7 @@ specific language governing permissions and limitations under the License. #include #include #include +#include #include #include #include @@ -40,7 +41,6 @@ specific language governing permissions and limitations under the License. #include #include #include -#include #include @@ -81,7 +81,7 @@ class SEConditionManager; class BioGearsCircuits; class BioGearsCompartments; class BioGearsConfiguration; -class SEScalarTime; + namespace io { class BioGears; } @@ -147,8 +147,8 @@ class BIOGEARS_API BioGears : public Loggable { const SEScalarTime& GetEngineTime(); const SEScalarTime& GetSimulationTime(); const SEScalarTime& GetTimeStep(); - CDM::enumBioGearsAirwayMode::value GetAirwayMode(); - CDM::enumOnOff::value GetIntubation(); + SEBioGearsAirwayMode GetAirwayMode(); + SEOnOff GetIntubation(); const SEBloodChemistrySystem& GetBloodChemistry() const; const SECardiovascularSystem& GetCardiovascular() const; @@ -173,12 +173,12 @@ class BIOGEARS_API BioGears : public Loggable { const SEScalarTime& GetEngineTime() const; const SEScalarTime& GetSimulationTime() const; const SEScalarTime& GetTimeStep() const; - const CDM::enumBioGearsAirwayMode::value GetAirwayMode() const; - const CDM::enumOnOff::value GetIntubation() const; + const SEBioGearsAirwayMode GetAirwayMode() const; + const SEOnOff GetIntubation() const; bool CreateCircuitsAndCompartments(); - void SetIntubation(CDM::enumOnOff::value s); - void SetAirwayMode(CDM::enumBioGearsAirwayMode::value mode); + void SetIntubation(SEOnOff s); + void SetAirwayMode(SEBioGearsAirwayMode mode); Logger* GetLogger() const; @@ -209,19 +209,20 @@ class BIOGEARS_API BioGears : public Loggable { void ForwardFatal(const std::string& msg, const std::string& origin); + std::unique_ptr m_managedLogger; + std::unique_ptr m_Substances; + DataTrack* m_DataTrack; std::unique_ptr m_CurrentTime; std::unique_ptr m_SimulationTime; - CDM::enumBioGearsAirwayMode::value m_AirwayMode; - CDM::enumOnOff::value m_Intubation; + SEBioGearsAirwayMode m_AirwayMode; + SEOnOff m_Intubation; - std::unique_ptr m_Config; + std::unique_ptr m_Configuration; std::unique_ptr m_SaturationCalculator; std::unique_ptr m_DiffusionCalculator; - std::unique_ptr m_Substances; - std::unique_ptr m_Actions; std::unique_ptr m_Conditions; std::unique_ptr m_Circuits; @@ -248,7 +249,5 @@ class BIOGEARS_API BioGears : public Loggable { std::unique_ptr m_Inhaler; std::unique_ptr m_Patient; - - std::unique_ptr m_managedLogger; }; } // namespace biogears diff --git a/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGearsCircuits.h b/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGearsCircuits.h index 4b7b3d331..896f48e86 100644 --- a/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGearsCircuits.h +++ b/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGearsCircuits.h @@ -14,22 +14,23 @@ specific language governing permissions and limitations under the License. #include -#include - namespace biogears { class BioGears; +namespace io { + class BioGears; +} /** -* @brief Manages all circuits associated with all %BioGears systems/equipement -*/ + * @brief Manages all circuits associated with all %BioGears systems/equipement + */ class BIOGEARS_API BioGearsCircuits : public SECircuitManager { + friend class io::BioGears; + public: static auto make_unique(BioGears& bg) -> std::unique_ptr; BioGearsCircuits(BioGears& data); virtual ~BioGearsCircuits(); - void Clear(); - - virtual bool Load(const CDM::CircuitManagerData& in); + void Invalidate(); virtual void SetReadOnlyFluid(bool b); @@ -90,902 +91,900 @@ class BIOGEARS_API BioGearsCircuits : public SECircuitManager { // Respiratory Circuit Enums // /////////////////////////////// -namespace mil { -namespace tatrc { - namespace physiology { - namespace biogears { - - namespace Circuits { - - DEFINE_STATIC_STRING(FullCardiovascular); - DEFINE_STATIC_STRING(Cardiovascular); - DEFINE_STATIC_STRING(Cerebral); - DEFINE_STATIC_STRING(Renal); - DEFINE_STATIC_STRING(Respiratory); - DEFINE_STATIC_STRING(AnesthesiaMachine); - DEFINE_STATIC_STRING(RespiratoryAnesthesia); - DEFINE_STATIC_STRING(RespiratoryInhaler); - DEFINE_STATIC_STRING(RespiratoryNasalCannula); - DEFINE_STATIC_STRING(RespiratoryMechanicalVentilator); - DEFINE_STATIC_STRING(Temperature); - DEFINE_STATIC_STRING(InternalTemperature); - DEFINE_STATIC_STRING(ExternalTemperature); - }; - - /////////////////////////// - // Chyme Circuit Enums // - /////////////////////////// - - namespace ChymeNode { - - DEFINE_STATIC_STRING(SmallIntestineC1); - }; - - namespace ChymePath { - - DEFINE_STATIC_STRING(SmallIntestineC1ToSmallIntestine1); - DEFINE_STATIC_STRING(GroundToSmallIntestineC1); - DEFINE_STATIC_STRING(GutE3ToGroundGI); - }; - - namespace RespiratoryNode { - - DEFINE_STATIC_STRING(Trachea); - - DEFINE_STATIC_STRING(LeftAlveoli); - DEFINE_STATIC_STRING(LeftAlveoliLeak); - DEFINE_STATIC_STRING(LeftBronchi); - DEFINE_STATIC_STRING(LeftChestLeak); - DEFINE_STATIC_STRING(LeftPleuralCavity); - DEFINE_STATIC_STRING(LeftPleuralConnection); - - DEFINE_STATIC_STRING(Mouth); - - DEFINE_STATIC_STRING(RightAlveoli); - DEFINE_STATIC_STRING(RightAlveoliLeak); - DEFINE_STATIC_STRING(RightBronchi); - DEFINE_STATIC_STRING(RightChestLeak); - DEFINE_STATIC_STRING(RightPleuralCavity); - DEFINE_STATIC_STRING(RightPleuralConnection); - - DEFINE_STATIC_STRING(Stomach); - DEFINE_STATIC_STRING(RespiratoryMuscle); - }; - - namespace RespiratoryPath { - - DEFINE_STATIC_STRING(TracheaToLeftBronchi); - DEFINE_STATIC_STRING(TracheaToRightBronchi); - DEFINE_STATIC_STRING(TracheaToEnvironment); - - DEFINE_STATIC_STRING(EnvironmentToLeftChestLeak); - DEFINE_STATIC_STRING(EnvironmentToMouth); - DEFINE_STATIC_STRING(EnvironmentToRightChestLeak); - - DEFINE_STATIC_STRING(LeftAlveoliLeakToLeftPleuralCavity); - DEFINE_STATIC_STRING(LeftAlveoliToLeftAlveoliLeak); - DEFINE_STATIC_STRING(LeftAlveoliToLeftPleuralConnection); - DEFINE_STATIC_STRING(LeftPleuralConnectionToLeftPleuralCavity); - DEFINE_STATIC_STRING(LeftBronchiToLeftAlveoli); - DEFINE_STATIC_STRING(LeftBronchiToLeftPleuralConnection); - DEFINE_STATIC_STRING(LeftChestLeakToLeftPleuralCavity); - DEFINE_STATIC_STRING(LeftPleuralCavityToEnvironment); - DEFINE_STATIC_STRING(LeftPleuralCavityToRespiratoryMuscle); - - DEFINE_STATIC_STRING(MouthToTrachea); - DEFINE_STATIC_STRING(MouthToStomach); - - DEFINE_STATIC_STRING(RightAlveoliLeakToRightPleuralCavity); - DEFINE_STATIC_STRING(RightAlveoliToRightAlveoliLeak); - DEFINE_STATIC_STRING(RightAlveoliToRightPleuralConnection); - DEFINE_STATIC_STRING(RightPleuralConnectionToRightPleuralCavity); - DEFINE_STATIC_STRING(RightBronchiToRightAlveoli); - DEFINE_STATIC_STRING(RightBronchiToRightPleuralConnection); - DEFINE_STATIC_STRING(RightChestLeakToRightPleuralCavity); - DEFINE_STATIC_STRING(RightPleuralCavityToEnvironment); - DEFINE_STATIC_STRING(RightPleuralCavityToRespiratoryMuscle); - - DEFINE_STATIC_STRING(EnvironmentToRespiratoryMuscle); - DEFINE_STATIC_STRING(StomachToEnvironment); - }; - - ////////////////////////////////////// - // Anesthesia Machine Circuit Enums // - ////////////////////////////////////// - - namespace AnesthesiaMachineNode { - - DEFINE_STATIC_STRING(AnesthesiaConnection); - DEFINE_STATIC_STRING(ExpiratoryLimb); - DEFINE_STATIC_STRING(GasInlet); - DEFINE_STATIC_STRING(GasSource); - DEFINE_STATIC_STRING(InspiratoryLimb); - DEFINE_STATIC_STRING(ReliefValve); - DEFINE_STATIC_STRING(Scrubber); - DEFINE_STATIC_STRING(Selector); - DEFINE_STATIC_STRING(Ventilator); - DEFINE_STATIC_STRING(VentilatorConnection); - DEFINE_STATIC_STRING(YPiece); - }; - - namespace AnesthesiaMachinePath { - - DEFINE_STATIC_STRING(EnvironmentToVentilator); - DEFINE_STATIC_STRING(EnvironmentToReliefValve); - DEFINE_STATIC_STRING(VentilatorToVentilatorConnection); - DEFINE_STATIC_STRING(VentilatorConnectionToSelector); - DEFINE_STATIC_STRING(SelectorToReliefValve); - DEFINE_STATIC_STRING(SelectorToScrubber); - DEFINE_STATIC_STRING(ScrubberToGasInlet); - DEFINE_STATIC_STRING(EnvironmentToGasSource); - DEFINE_STATIC_STRING(GasSourceToGasInlet); - DEFINE_STATIC_STRING(GasInletToInspiratoryLimb); - DEFINE_STATIC_STRING(InspiratoryLimbToYPiece); - DEFINE_STATIC_STRING(YPieceToExpiratoryLimb); - DEFINE_STATIC_STRING(ExpiratoryLimbToSelector); - DEFINE_STATIC_STRING(YPieceToAnesthesiaConnection); - DEFINE_STATIC_STRING(AnesthesiaConnectionToEnvironment); - DEFINE_STATIC_STRING(SelectorToEnvironment); - }; - - namespace CombinedAnesthesiaMachinePath { - - DEFINE_STATIC_STRING(AnesthesiaConnectionToMouth); - DEFINE_STATIC_STRING(GroundConnection); - }; - - /////////////////////////// - // Inhaler Circuit Enums // - /////////////////////////// - - namespace InhalerNode { - - DEFINE_STATIC_STRING(Mouthpiece); - }; - - namespace InhalerPath { - - DEFINE_STATIC_STRING(EnvironmentToMouthpiece); - DEFINE_STATIC_STRING(MouthpieceToMouth); - }; - - - /////////////////////////// - // Nasal Cannula Circuit Enums // - /////////////////////////// - - namespace NasalCannulaNode { - - DEFINE_STATIC_STRING(Nosepiece); - DEFINE_STATIC_STRING(OxygenTank); - }; - - namespace NasalCannulaPath { - - DEFINE_STATIC_STRING(OxygenTankToNosepiece); - DEFINE_STATIC_STRING(EnvironmentToOxygentank); - DEFINE_STATIC_STRING(ReturnFlow); - DEFINE_STATIC_STRING(NosepieceToMouth); - - }; - - ////////////////////////////////////////// - // Mechanical Ventilator Circuit Enums // - //////////////////////////////////////// - - namespace MechanicalVentilatorNode { - - DEFINE_STATIC_STRING_EX(Connection, MechanicalVentilatorConnection); - }; - - namespace MechanicalVentilatorPath { - - DEFINE_STATIC_STRING_EX(ConnectionToMouth, MechanicalVentilatorConnectionToMouth); - DEFINE_STATIC_STRING_EX(GroundToConnection, MechanicalVentilatorGroundToConnection); - }; - - /////////////////////////////////// - // Environment Gas Circuit Enums // - /////////////////////////////////// - - namespace EnvironmentNode { - - DEFINE_STATIC_STRING(Ambient); - }; - - /////////////////////////////////////////// - // External Temperature Circuit Enums // - /////////////////////////////////////////// - - namespace ExternalTemperatureNode { - - DEFINE_STATIC_STRING(Active); - DEFINE_STATIC_STRING(Clothing); - DEFINE_STATIC_STRING(Enclosure); - DEFINE_STATIC_STRING(ExternalCore); - DEFINE_STATIC_STRING(ExternalTorsoSkin); - DEFINE_STATIC_STRING(ExternalHeadSkin); - DEFINE_STATIC_STRING(ExternalLeftArmSkin); - DEFINE_STATIC_STRING(ExternalRightArmSkin); - DEFINE_STATIC_STRING(ExternalLeftLegSkin); - DEFINE_STATIC_STRING(ExternalRightLegSkin); - DEFINE_STATIC_STRING(ExternalGround); - DEFINE_STATIC_STRING(Ambient); - }; - - namespace ExternalTemperaturePath { - - DEFINE_STATIC_STRING(ActiveToClothing); - DEFINE_STATIC_STRING(ClothingToEnclosure); - DEFINE_STATIC_STRING(ClothingToEnvironment); - DEFINE_STATIC_STRING(ExternalCoreToGround); - DEFINE_STATIC_STRING(GroundToActive); - DEFINE_STATIC_STRING(GroundToClothing); - DEFINE_STATIC_STRING(GroundToEnclosure); - DEFINE_STATIC_STRING(GroundToEnvironment); - DEFINE_STATIC_STRING(ExternalTorsoSkinToGround); - DEFINE_STATIC_STRING(ExternalTorsoSkinToClothing); - DEFINE_STATIC_STRING(ExternalHeadSkinToGround); - DEFINE_STATIC_STRING(ExternalHeadSkinToClothing); - DEFINE_STATIC_STRING(ExternalLeftArmSkinToGround); - DEFINE_STATIC_STRING(ExternalLeftArmSkinToClothing); - DEFINE_STATIC_STRING(ExternalRightArmSkinToGround); - DEFINE_STATIC_STRING(ExternalRightArmSkinToClothing); - DEFINE_STATIC_STRING(ExternalLeftLegSkinToGround); - DEFINE_STATIC_STRING(ExternalLeftLegSkinToClothing); - DEFINE_STATIC_STRING(ExternalRightLegSkinToGround); - DEFINE_STATIC_STRING(ExternalRightLegSkinToClothing); - }; - - //////////////////////////////////////// - // Internal Temperature Circuit Enums // - //////////////////////////////////////// - - namespace InternalTemperatureNode { - - DEFINE_STATIC_STRING(InternalCore); - DEFINE_STATIC_STRING(InternalGround); - DEFINE_STATIC_STRING(InternalTorsoSkin); - DEFINE_STATIC_STRING(InternalHeadSkin); - DEFINE_STATIC_STRING(InternalLeftArmSkin); - DEFINE_STATIC_STRING(InternalRightArmSkin); - DEFINE_STATIC_STRING(InternalLeftLegSkin); - DEFINE_STATIC_STRING(InternalRightLegSkin); - }; - - namespace InternalTemperaturePath { - - DEFINE_STATIC_STRING(GroundToInternalCore); - DEFINE_STATIC_STRING(InternalCoreToGround); - - DEFINE_STATIC_STRING(GroundToInternalTorsoSkin); - DEFINE_STATIC_STRING(GroundToInternalHeadSkin); - DEFINE_STATIC_STRING(GroundToInternalLeftArmSkin); - DEFINE_STATIC_STRING(GroundToInternalRightArmSkin); - DEFINE_STATIC_STRING(GroundToInternalLeftLegSkin); - DEFINE_STATIC_STRING(GroundToInternalRightLegSkin); - - DEFINE_STATIC_STRING(InternalTorsoSkinToTemperatureGround); - DEFINE_STATIC_STRING(InternalCoreToInternalTorsoSkin); - DEFINE_STATIC_STRING(InternalHeadSkinToTemperatureGround); - DEFINE_STATIC_STRING(InternalCoreToInternalHeadSkin); - - DEFINE_STATIC_STRING(InternalLeftArmSkinToTemperatureGround); - DEFINE_STATIC_STRING(InternalCoreToInternalLeftArmSkin); - DEFINE_STATIC_STRING(InternalRightArmSkinToTemperatureGround); - DEFINE_STATIC_STRING(InternalCoreToInternalRightArmSkin); - DEFINE_STATIC_STRING(InternalLeftLegSkinToTemperatureGround); - DEFINE_STATIC_STRING(InternalCoreToInternalLeftLegSkin); - DEFINE_STATIC_STRING(InternalRightLegSkinToTemperatureGround); - DEFINE_STATIC_STRING(InternalCoreToInternalRightLegSkin); - }; - - //////////////////////////////////////// - // Combined Temperature Circuit Enums // - //////////////////////////////////////// - - namespace CombinedTemperaturePath { - - DEFINE_STATIC_STRING(InternalCoreToExternalCore); - DEFINE_STATIC_STRING(InternalTorsoSkinToExternalTorsoSkin); - DEFINE_STATIC_STRING(InternalHeadSkinToExternalHeadSkin); - DEFINE_STATIC_STRING(InternalLeftArmSkinToExternalLeftArmSkin); - DEFINE_STATIC_STRING(InternalRightArmSkinToExternalRightArmSkin); - DEFINE_STATIC_STRING(InternalLeftLegSkinToExternalLeftLegSkin); - DEFINE_STATIC_STRING(InternalRightLegSkinToExternalRightLegSkin); - }; - - namespace CardiovascularNode { - - DEFINE_STATIC_STRING(RightAtrium1); - DEFINE_STATIC_STRING(RightAtrium2); - - DEFINE_STATIC_STRING(RightVentricle1); - DEFINE_STATIC_STRING(RightVentricle2); - - DEFINE_STATIC_STRING(MainPulmonaryArteries); - DEFINE_STATIC_STRING(LeftIntermediatePulmonaryArteries); - DEFINE_STATIC_STRING(LeftPulmonaryArteries); - DEFINE_STATIC_STRING(RightIntermediatePulmonaryArteries); - DEFINE_STATIC_STRING(RightPulmonaryArteries); - - DEFINE_STATIC_STRING(LeftPulmonaryCapillaries); - DEFINE_STATIC_STRING(RightPulmonaryCapillaries); - - DEFINE_STATIC_STRING(LeftIntermediatePulmonaryVeins); - DEFINE_STATIC_STRING(LeftPulmonaryVeins); - DEFINE_STATIC_STRING(RightIntermediatePulmonaryVeins); - DEFINE_STATIC_STRING(RightPulmonaryVeins); - - DEFINE_STATIC_STRING(LeftAtrium1); - DEFINE_STATIC_STRING(LeftAtrium2); - - DEFINE_STATIC_STRING(LeftVentricle1); - DEFINE_STATIC_STRING(LeftVentricle2); - - DEFINE_STATIC_STRING(Aorta1); - DEFINE_STATIC_STRING(Aorta2); - DEFINE_STATIC_STRING(Aorta3); - - DEFINE_STATIC_STRING(Bone1); - DEFINE_STATIC_STRING(Bone2); - - DEFINE_STATIC_STRING(Brain1); - DEFINE_STATIC_STRING(Brain2); - - DEFINE_STATIC_STRING(Fat1); - DEFINE_STATIC_STRING(Fat2); - - DEFINE_STATIC_STRING(LargeIntestine1); - - DEFINE_STATIC_STRING(Liver1); - DEFINE_STATIC_STRING(Liver2); - DEFINE_STATIC_STRING(PortalVein1); - - DEFINE_STATIC_STRING(LeftArm1); - DEFINE_STATIC_STRING(LeftArm2); - - DEFINE_STATIC_STRING(LeftKidney1); - DEFINE_STATIC_STRING(LeftKidney2); - - DEFINE_STATIC_STRING(LeftLeg1); - DEFINE_STATIC_STRING(LeftLeg2); - - DEFINE_STATIC_STRING(Muscle1); - DEFINE_STATIC_STRING(Muscle2); - - DEFINE_STATIC_STRING(Myocardium1); - DEFINE_STATIC_STRING(Myocardium2); - - DEFINE_STATIC_STRING(Pericardium1); - - DEFINE_STATIC_STRING(RightArm1); - DEFINE_STATIC_STRING(RightArm2); - - DEFINE_STATIC_STRING(RightKidney1); - DEFINE_STATIC_STRING(RightKidney2); - - DEFINE_STATIC_STRING(RightLeg1); - DEFINE_STATIC_STRING(RightLeg2); - - DEFINE_STATIC_STRING(Skin1); - DEFINE_STATIC_STRING(Skin2); - - DEFINE_STATIC_STRING(SmallIntestine1); - - DEFINE_STATIC_STRING(Splanchnic1); - - DEFINE_STATIC_STRING(Spleen1); - - DEFINE_STATIC_STRING(VenaCava); - - DEFINE_STATIC_STRING(Ground); - }; - - namespace CardiovascularPath { - - // Heart and Lungs - DEFINE_STATIC_STRING(VenaCavaToRightAtrium1); - DEFINE_STATIC_STRING(RightAtrium1ToGround); - DEFINE_STATIC_STRING(RightAtrium1ToRightAtrium2); - DEFINE_STATIC_STRING(RightAtrium2ToRightVentricle1); - DEFINE_STATIC_STRING(RightVentricle1ToRightVentricle2); - DEFINE_STATIC_STRING(RightVentricle2ToGround); - DEFINE_STATIC_STRING(RightVentricle1ToMainPulmonaryArteries); - DEFINE_STATIC_STRING(MainPulmonaryArteriesToRightIntermediatePulmonaryArteries); - DEFINE_STATIC_STRING(RightIntermediatePulmonaryArteriesToRightPulmonaryArteries); - DEFINE_STATIC_STRING(RightPulmonaryArteriesToRightPulmonaryVeins); - DEFINE_STATIC_STRING(RightPulmonaryArteriesToRightPulmonaryCapillaries); - DEFINE_STATIC_STRING(RightPulmonaryArteriesToGround); - DEFINE_STATIC_STRING(RightPulmonaryCapillariesToRightPulmonaryVeins); - DEFINE_STATIC_STRING(RightPulmonaryCapillariesToGround); - DEFINE_STATIC_STRING(RightPulmonaryVeinsToRightIntermediatePulmonaryVeins); - DEFINE_STATIC_STRING(RightPulmonaryVeinsToGround); - DEFINE_STATIC_STRING(RightIntermediatePulmonaryVeinsToLeftAtrium1); - DEFINE_STATIC_STRING(MainPulmonaryArteriesToLeftIntermediatePulmonaryArteries); - DEFINE_STATIC_STRING(LeftIntermediatePulmonaryArteriesToLeftPulmonaryArteries); - DEFINE_STATIC_STRING(LeftPulmonaryArteriesToLeftPulmonaryVeins); - DEFINE_STATIC_STRING(LeftPulmonaryArteriesToLeftPulmonaryCapillaries); - DEFINE_STATIC_STRING(LeftPulmonaryArteriesToGround); - DEFINE_STATIC_STRING(LeftPulmonaryCapillariesToGround); - DEFINE_STATIC_STRING(LeftPulmonaryCapillariesToLeftPulmonaryVeins); - DEFINE_STATIC_STRING(LeftPulmonaryVeinsToLeftIntermediatePulmonaryVeins); - DEFINE_STATIC_STRING(LeftPulmonaryVeinsToGround); - DEFINE_STATIC_STRING(LeftIntermediatePulmonaryVeinsToLeftAtrium1); - DEFINE_STATIC_STRING(LeftAtrium1ToGround); - DEFINE_STATIC_STRING(LeftAtrium1ToLeftAtrium2); - DEFINE_STATIC_STRING(LeftAtrium2ToLeftVentricle1); - DEFINE_STATIC_STRING(LeftVentricle1ToLeftVentricle2); - DEFINE_STATIC_STRING(LeftVentricle2ToGround); - DEFINE_STATIC_STRING(LeftVentricle1ToAorta2); - DEFINE_STATIC_STRING(Aorta2ToAorta3); - DEFINE_STATIC_STRING(Aorta3ToAorta1); - DEFINE_STATIC_STRING(Aorta1ToGround); - // Brain - DEFINE_STATIC_STRING(Aorta1ToBrain1); - DEFINE_STATIC_STRING(Brain1ToGround); - DEFINE_STATIC_STRING(Brain1ToBrain2); - DEFINE_STATIC_STRING(Brain2ToVenaCava); - DEFINE_STATIC_STRING(Aorta1ToNeckArteries); - DEFINE_STATIC_STRING(NeckVeinsToVenaCava); - // Bone - DEFINE_STATIC_STRING(Aorta1ToBone1); - DEFINE_STATIC_STRING(Bone1ToGround); - DEFINE_STATIC_STRING(Bone1ToBone2); - DEFINE_STATIC_STRING(Bone2ToVenaCava); - // Fat - DEFINE_STATIC_STRING(Aorta1ToFat1); - DEFINE_STATIC_STRING(Fat1ToGround); - DEFINE_STATIC_STRING(Fat1ToFat2); - DEFINE_STATIC_STRING(Fat2ToVenaCava); - // Large Intestine - DEFINE_STATIC_STRING(Aorta1ToLargeIntestine); - DEFINE_STATIC_STRING(LargeIntestineToGround); - DEFINE_STATIC_STRING(LargeIntestineToPortalVein); - // Left Arm - DEFINE_STATIC_STRING(Aorta1ToLeftArm1); - DEFINE_STATIC_STRING(LeftArm1ToGround); - DEFINE_STATIC_STRING(LeftArm1ToLeftArm2); - DEFINE_STATIC_STRING(LeftArm2ToVenaCava); - // Left Kidney - DEFINE_STATIC_STRING(Aorta1ToLeftKidney1); - DEFINE_STATIC_STRING(LeftKidney1ToGround); - DEFINE_STATIC_STRING(LeftKidney1ToLeftKidney2); - DEFINE_STATIC_STRING(LeftKidney2ToVenaCava); - // Left Leg - DEFINE_STATIC_STRING(Aorta1ToLeftLeg1); - DEFINE_STATIC_STRING(LeftLeg1ToGround); - DEFINE_STATIC_STRING(LeftLeg1ToLeftLeg2); - DEFINE_STATIC_STRING(LeftLeg2ToVenaCava); - // Liver - DEFINE_STATIC_STRING(Aorta1ToLiver1); - DEFINE_STATIC_STRING(Liver1ToGround); - DEFINE_STATIC_STRING(PortalVeinToLiver1); - DEFINE_STATIC_STRING(Liver1ToLiver2); - DEFINE_STATIC_STRING(Liver2ToVenaCava); - // Muscle - DEFINE_STATIC_STRING(Aorta1ToMuscle1); - DEFINE_STATIC_STRING(Muscle1ToGround); - DEFINE_STATIC_STRING(Muscle1ToMuscle2); - DEFINE_STATIC_STRING(Muscle2ToVenaCava); - // Myocardium - DEFINE_STATIC_STRING(Aorta1ToMyocardium1); - DEFINE_STATIC_STRING(Myocardium1ToGround); - DEFINE_STATIC_STRING(Myocardium1ToMyocardium2); - DEFINE_STATIC_STRING(Myocardium2ToVenaCava); - // Pericardium - DEFINE_STATIC_STRING(Pericardium1ToGround); - DEFINE_STATIC_STRING(GroundToPericardium1); - // Right Arm - DEFINE_STATIC_STRING(Aorta1ToRightArm1); - DEFINE_STATIC_STRING(RightArm1ToGround); - DEFINE_STATIC_STRING(RightArm1ToRightArm2); - DEFINE_STATIC_STRING(RightArm2ToVenaCava); - // Right Kidney - DEFINE_STATIC_STRING(Aorta1ToRightKidney1); - DEFINE_STATIC_STRING(RightKidney1ToGround); - DEFINE_STATIC_STRING(RightKidney1ToRightKidney2); - DEFINE_STATIC_STRING(RightKidney2ToVenaCava); - // Right Leg - DEFINE_STATIC_STRING(Aorta1ToRightLeg1); - DEFINE_STATIC_STRING(RightLeg1ToGround); - DEFINE_STATIC_STRING(RightLeg1ToRightLeg2); - DEFINE_STATIC_STRING(RightLeg2ToVenaCava); - // Skin - DEFINE_STATIC_STRING(Aorta1ToSkin1); - DEFINE_STATIC_STRING(Skin1ToGround); - DEFINE_STATIC_STRING(Skin1ToSkin2); - DEFINE_STATIC_STRING(Skin2ToVenaCava); - // Small Intestine - DEFINE_STATIC_STRING(Aorta1ToSmallIntestine); - DEFINE_STATIC_STRING(SmallIntestineToGround); - DEFINE_STATIC_STRING(SmallIntestineToPortalVein); - // Splanchnic - DEFINE_STATIC_STRING(Aorta1ToSplanchnic); - DEFINE_STATIC_STRING(SplanchnicToGround); - DEFINE_STATIC_STRING(SplanchnicToPortalVein); - // Spleen - DEFINE_STATIC_STRING(Aorta1ToSpleen); - DEFINE_STATIC_STRING(SpleenToGround); - DEFINE_STATIC_STRING(SpleenToPortalVein); - // Vena Cava - DEFINE_STATIC_STRING(VenaCavaToGround); - DEFINE_STATIC_STRING(IVToVenaCava); - //Hemorrhage - DEFINE_STATIC_STRING(AortaBleed); - DEFINE_STATIC_STRING(BrainBleed); - DEFINE_STATIC_STRING(MyocardiumBleed); - DEFINE_STATIC_STRING(LeftLungBleed); - DEFINE_STATIC_STRING(RightLungBleed); - DEFINE_STATIC_STRING(LeftArmBleed); - DEFINE_STATIC_STRING(RightArmBleed); - DEFINE_STATIC_STRING(SpleenBleed); - DEFINE_STATIC_STRING(SmallIntestineBleed); - DEFINE_STATIC_STRING(LargeIntestineBleed); - DEFINE_STATIC_STRING(SplanchnicBleed); - DEFINE_STATIC_STRING(RightKidneyBleed); - DEFINE_STATIC_STRING(LeftKidneyBleed); - DEFINE_STATIC_STRING(LiverBleed); - DEFINE_STATIC_STRING(PortalBleed); - DEFINE_STATIC_STRING(LeftLegBleed); - DEFINE_STATIC_STRING(RightLegBleed); - DEFINE_STATIC_STRING(VenaCavaBleed); - }; - - namespace CerebralNode { - DEFINE_STATIC_STRING(NeckArteries); - DEFINE_STATIC_STRING(CerebralArteries1); - DEFINE_STATIC_STRING(CerebralArteries2); - DEFINE_STATIC_STRING(CerebralCapillaries); - DEFINE_STATIC_STRING(CerebralVeins1); - DEFINE_STATIC_STRING(CerebralVeins2); - DEFINE_STATIC_STRING(NeckVeins); - DEFINE_STATIC_STRING(CerebralVeinsCheck); - DEFINE_STATIC_STRING(SpinalFluid); - DEFINE_STATIC_STRING(Ground); - }; - - namespace CerebralPath { - DEFINE_STATIC_STRING(NeckArteriesToCerebralArteries1); - DEFINE_STATIC_STRING(NeckArteriesToGround); - DEFINE_STATIC_STRING(CerebralArteries1ToCerebralArteries2); - DEFINE_STATIC_STRING(CerebralArteries1ToSpinalFluid); - DEFINE_STATIC_STRING(CerebralArteries2ToSpinalFluid); - DEFINE_STATIC_STRING(CerebralArteries2ToCapillaries); - DEFINE_STATIC_STRING(CerebralCapillariesToSpinalFluid); - DEFINE_STATIC_STRING(CerebralCapillariesToCerebralVeins1); - DEFINE_STATIC_STRING(CerebralVeins1ToSpinalFluid); - DEFINE_STATIC_STRING(CerebralVeins1ToCerebralVeins2); - DEFINE_STATIC_STRING(CerebralVeinsCheckToCerebralVeins2); - DEFINE_STATIC_STRING(SpinalFluidToCerebralVeinsCheck); - DEFINE_STATIC_STRING(CerebralVeins2ToNeckVeins); - DEFINE_STATIC_STRING(NeckVeinsToGround); - DEFINE_STATIC_STRING(SpinalFluidToGround); - } - - namespace TissueNode { - - DEFINE_STATIC_STRING(BoneE1); - DEFINE_STATIC_STRING(BoneE2); - DEFINE_STATIC_STRING(BoneE3); - DEFINE_STATIC_STRING(BoneI); - DEFINE_STATIC_STRING(BoneL1); - DEFINE_STATIC_STRING(BoneL2); - DEFINE_STATIC_STRING(BrainE1); - DEFINE_STATIC_STRING(BrainE2); - DEFINE_STATIC_STRING(BrainE3); - DEFINE_STATIC_STRING(BrainI); - DEFINE_STATIC_STRING(BrainL1); - DEFINE_STATIC_STRING(BrainL2); - DEFINE_STATIC_STRING(FatE1); - DEFINE_STATIC_STRING(FatE2); - DEFINE_STATIC_STRING(FatE3); - DEFINE_STATIC_STRING(FatI); - DEFINE_STATIC_STRING(FatL1); - DEFINE_STATIC_STRING(FatL2) - DEFINE_STATIC_STRING(GutE1); - DEFINE_STATIC_STRING(GutE2); - DEFINE_STATIC_STRING(GutE3); - DEFINE_STATIC_STRING(GutI); - DEFINE_STATIC_STRING(GutL1); - DEFINE_STATIC_STRING(GutL2) - DEFINE_STATIC_STRING(LiverE1); - DEFINE_STATIC_STRING(LiverE2); - DEFINE_STATIC_STRING(LiverE3); - DEFINE_STATIC_STRING(LiverI); - DEFINE_STATIC_STRING(LiverL1); - DEFINE_STATIC_STRING(LiverL2); - DEFINE_STATIC_STRING(LeftKidneyE1); - DEFINE_STATIC_STRING(LeftKidneyE2); - DEFINE_STATIC_STRING(LeftKidneyE3); - DEFINE_STATIC_STRING(LeftKidneyI); - DEFINE_STATIC_STRING(LeftKidneyL1); - DEFINE_STATIC_STRING(LeftKidneyL2); - DEFINE_STATIC_STRING(LeftLungE1); - DEFINE_STATIC_STRING(LeftLungE2); - DEFINE_STATIC_STRING(LeftLungE3); - DEFINE_STATIC_STRING(LeftLungI); - DEFINE_STATIC_STRING(LeftLungL1); - DEFINE_STATIC_STRING(LeftLungL2); - DEFINE_STATIC_STRING(Lymph) - DEFINE_STATIC_STRING(Lymph2); - DEFINE_STATIC_STRING(MuscleE1); - DEFINE_STATIC_STRING(MuscleE2); - DEFINE_STATIC_STRING(MuscleE3) - DEFINE_STATIC_STRING(MuscleI); - DEFINE_STATIC_STRING(MuscleL1); - DEFINE_STATIC_STRING(MuscleL2); - DEFINE_STATIC_STRING(MyocardiumE1); - DEFINE_STATIC_STRING(MyocardiumE2); - DEFINE_STATIC_STRING(MyocardiumE3); - DEFINE_STATIC_STRING(MyocardiumI); - DEFINE_STATIC_STRING(MyocardiumL1); - DEFINE_STATIC_STRING(MyocardiumL2); - DEFINE_STATIC_STRING(RightLungE1); - DEFINE_STATIC_STRING(RightLungE2); - DEFINE_STATIC_STRING(RightLungE3); - DEFINE_STATIC_STRING(RightLungI); - DEFINE_STATIC_STRING(RightLungL1); - DEFINE_STATIC_STRING(RightLungL2); - DEFINE_STATIC_STRING(RightKidneyE1); - DEFINE_STATIC_STRING(RightKidneyE2); - DEFINE_STATIC_STRING(RightKidneyE3); - DEFINE_STATIC_STRING(RightKidneyI); - DEFINE_STATIC_STRING(RightKidneyL1); - DEFINE_STATIC_STRING(RightKidneyL2); - DEFINE_STATIC_STRING(SkinE1); - DEFINE_STATIC_STRING(SkinE2); - DEFINE_STATIC_STRING(SkinE3); - DEFINE_STATIC_STRING(SkinI); - DEFINE_STATIC_STRING(SkinL1); - DEFINE_STATIC_STRING(SkinL2); - DEFINE_STATIC_STRING(SpleenE1); - DEFINE_STATIC_STRING(SpleenE2); - DEFINE_STATIC_STRING(SpleenE3); - DEFINE_STATIC_STRING(SpleenI); - DEFINE_STATIC_STRING(SpleenL1); - DEFINE_STATIC_STRING(SpleenL2); - }; - - namespace TissuePath { - DEFINE_STATIC_STRING(BoneVToBoneE1); - DEFINE_STATIC_STRING(BoneE1ToBoneE2); - DEFINE_STATIC_STRING(BoneE2ToBoneE3); - DEFINE_STATIC_STRING(BoneE3ToBoneI); - DEFINE_STATIC_STRING(BoneE3ToGround); - DEFINE_STATIC_STRING(BoneIToGround); - DEFINE_STATIC_STRING(BoneE3ToBoneL1); - DEFINE_STATIC_STRING(BoneL1ToBoneL2); - DEFINE_STATIC_STRING(BoneToLymphValve); - - DEFINE_STATIC_STRING(BrainVToBrainE1); - DEFINE_STATIC_STRING(BrainE1ToBrainE2); - DEFINE_STATIC_STRING(BrainE2ToBrainE3); - DEFINE_STATIC_STRING(BrainE3ToBrainI); - DEFINE_STATIC_STRING(BrainE3ToGround); - DEFINE_STATIC_STRING(BrainIToGround); - DEFINE_STATIC_STRING(BrainE3ToBrainL1); - DEFINE_STATIC_STRING(BrainL1ToBrainL2); - DEFINE_STATIC_STRING(BrainToLymphValve); - - DEFINE_STATIC_STRING(FatVToFatE1); - DEFINE_STATIC_STRING(FatE1ToFatE2); - DEFINE_STATIC_STRING(FatE2ToFatE3); - DEFINE_STATIC_STRING(FatE3ToFatI); - DEFINE_STATIC_STRING(FatE3ToGround); - DEFINE_STATIC_STRING(FatIToGround); - DEFINE_STATIC_STRING(FatE3ToFatL1); - DEFINE_STATIC_STRING(FatL1ToFatL2); - DEFINE_STATIC_STRING(FatToLymphValve); - - DEFINE_STATIC_STRING(SmallIntestineVToGutE1); - DEFINE_STATIC_STRING(LargeIntestineVToGutE1); - DEFINE_STATIC_STRING(SplanchnicVToGutE1); - DEFINE_STATIC_STRING(GutE1ToGutE2); - DEFINE_STATIC_STRING(GutE2ToGutE3); - DEFINE_STATIC_STRING(GutE3ToGutI); - DEFINE_STATIC_STRING(GutE3ToGround); - DEFINE_STATIC_STRING(GutIToGround); - DEFINE_STATIC_STRING(GutE3ToGutL1); - DEFINE_STATIC_STRING(GutL1ToGutL2); - DEFINE_STATIC_STRING(GutToLymphValve); - - DEFINE_STATIC_STRING(LiverVToLiverE1); - DEFINE_STATIC_STRING(LiverE1ToLiverE2); - DEFINE_STATIC_STRING(LiverE2ToLiverE3); - DEFINE_STATIC_STRING(LiverE3ToLiverI); - DEFINE_STATIC_STRING(LiverE3ToGround); - DEFINE_STATIC_STRING(LiverIToGround); - DEFINE_STATIC_STRING(LiverE3ToLiverL1); - DEFINE_STATIC_STRING(LiverL1ToLiverL2); - DEFINE_STATIC_STRING(LiverToLymphValve); - - DEFINE_STATIC_STRING(LeftKidneyVToLeftKidneyE1); - DEFINE_STATIC_STRING(LeftKidneyE1ToLeftKidneyE2); - DEFINE_STATIC_STRING(LeftKidneyE2ToLeftKidneyE3); - DEFINE_STATIC_STRING(LeftKidneyE3ToLeftKidneyI); - DEFINE_STATIC_STRING(LeftKidneyE3ToGround); - DEFINE_STATIC_STRING(LeftKidneyIToGround); - DEFINE_STATIC_STRING(LeftKidneyE3ToLeftKidneyL1); - DEFINE_STATIC_STRING(LeftKidneyL1ToLeftKidneyL2); - DEFINE_STATIC_STRING(LeftKidneyToLymphValve); - - DEFINE_STATIC_STRING(LeftLungVToLeftLungE1); - DEFINE_STATIC_STRING(LeftLungE1ToLeftLungE2); - DEFINE_STATIC_STRING(LeftLungE2ToLeftLungE3); - DEFINE_STATIC_STRING(LeftLungE3ToLeftLungI); - DEFINE_STATIC_STRING(LeftLungE3ToGround); - DEFINE_STATIC_STRING(LeftLungIToGround); - DEFINE_STATIC_STRING(LeftLungE3ToLeftLungL1); - DEFINE_STATIC_STRING(LeftLungL1ToLeftLungL2); - DEFINE_STATIC_STRING(LeftLungToLymphValve); - - DEFINE_STATIC_STRING(Lymph1ToLymph2); - DEFINE_STATIC_STRING(LymphToVenaCava); - DEFINE_STATIC_STRING(LymphToGround); - - DEFINE_STATIC_STRING(MuscleVToMuscleE1); - DEFINE_STATIC_STRING(MuscleE1ToMuscleE2); - DEFINE_STATIC_STRING(MuscleE2ToMuscleE3); - DEFINE_STATIC_STRING(MuscleE3ToMuscleI); - DEFINE_STATIC_STRING(MuscleE3ToGround); - DEFINE_STATIC_STRING(MuscleIToGround); - DEFINE_STATIC_STRING(MuscleE3ToMuscleL1); - DEFINE_STATIC_STRING(MuscleL1ToMuscleL2); - DEFINE_STATIC_STRING(MuscleToLymphValve); - - DEFINE_STATIC_STRING(MyocardiumVToMyocardiumE1); - DEFINE_STATIC_STRING(MyocardiumE1ToMyocardiumE2); - DEFINE_STATIC_STRING(MyocardiumE2ToMyocardiumE3); - DEFINE_STATIC_STRING(MyocardiumE3ToMyocardiumI); - DEFINE_STATIC_STRING(MyocardiumE3ToGround); - DEFINE_STATIC_STRING(MyocardiumIToGround); - DEFINE_STATIC_STRING(MyocardiumE3ToMyocardiumL1); - DEFINE_STATIC_STRING(MyocardiumL1ToMyocardiumL2); - DEFINE_STATIC_STRING(MyocardiumToLymphValve); - - DEFINE_STATIC_STRING(RightLungVToRightLungE1); - DEFINE_STATIC_STRING(RightLungE1ToRightLungE2); - DEFINE_STATIC_STRING(RightLungE2ToRightLungE3); - DEFINE_STATIC_STRING(RightLungE3ToRightLungI); - DEFINE_STATIC_STRING(RightLungE3ToGround); - DEFINE_STATIC_STRING(RightLungIToGround); - DEFINE_STATIC_STRING(RightLungE3ToRightLungL1); - DEFINE_STATIC_STRING(RightLungL1ToRightLungL2); - DEFINE_STATIC_STRING(RightLungToLymphValve); - - DEFINE_STATIC_STRING(RightKidneyVToRightKidneyE1); - DEFINE_STATIC_STRING(RightKidneyE1ToRightKidneyE2); - DEFINE_STATIC_STRING(RightKidneyE2ToRightKidneyE3); - DEFINE_STATIC_STRING(RightKidneyE3ToRightKidneyI); - DEFINE_STATIC_STRING(RightKidneyE3ToGround); - DEFINE_STATIC_STRING(RightKidneyIToGround); - DEFINE_STATIC_STRING(RightKidneyE3ToRightKidneyL1); - DEFINE_STATIC_STRING(RightKidneyL1ToRightKidneyL2); - DEFINE_STATIC_STRING(RightKidneyToLymphValve); - - DEFINE_STATIC_STRING(SkinVToSkinE1); - DEFINE_STATIC_STRING(SkinE1ToSkinE2); - DEFINE_STATIC_STRING(SkinE2ToSkinE3); - DEFINE_STATIC_STRING(SkinE3ToSkinI); - DEFINE_STATIC_STRING(SkinE3ToGround); - DEFINE_STATIC_STRING(SkinIToGround); - DEFINE_STATIC_STRING(SkinE3ToSkinL1); - DEFINE_STATIC_STRING(SkinL1ToSkinL2); - DEFINE_STATIC_STRING(SkinSweating); - DEFINE_STATIC_STRING(SkinToLymphValve); - - DEFINE_STATIC_STRING(SpleenVToSpleenE1); - DEFINE_STATIC_STRING(SpleenE1ToSpleenE2); - DEFINE_STATIC_STRING(SpleenE2ToSpleenE3); - DEFINE_STATIC_STRING(SpleenE3ToSpleenI); - DEFINE_STATIC_STRING(SpleenE3ToGround); - DEFINE_STATIC_STRING(SpleenIToGround); - DEFINE_STATIC_STRING(SpleenE3ToSpleenL1); - DEFINE_STATIC_STRING(SpleenL1ToSpleenL2); - DEFINE_STATIC_STRING(SpleenToLymphValve); - }; - - namespace RenalNode { - - // Blood - DEFINE_STATIC_STRING(RightAortaConnection); - DEFINE_STATIC_STRING(RightRenalArtery); - DEFINE_STATIC_STRING(RightAfferentArteriole); - DEFINE_STATIC_STRING(RightGlomerularCapillaries); - DEFINE_STATIC_STRING(RightNetGlomerularCapillaries); - DEFINE_STATIC_STRING(RightEfferentArteriole); - DEFINE_STATIC_STRING(RightPeritubularCapillaries); - DEFINE_STATIC_STRING(RightNetPeritubularCapillaries); - DEFINE_STATIC_STRING(RightRenalVein); - DEFINE_STATIC_STRING(RightVenaCavaConnection); - // Urine - DEFINE_STATIC_STRING(RightBowmansCapsules); - DEFINE_STATIC_STRING(RightNetBowmansCapsules); - DEFINE_STATIC_STRING(RightTubules); - DEFINE_STATIC_STRING(RightNetTubules); - DEFINE_STATIC_STRING(RightUreter); - - // Blood - DEFINE_STATIC_STRING(LeftAortaConnection); - DEFINE_STATIC_STRING(LeftRenalArtery); - DEFINE_STATIC_STRING(LeftAfferentArteriole); - DEFINE_STATIC_STRING(LeftGlomerularCapillaries); - DEFINE_STATIC_STRING(LeftNetGlomerularCapillaries); - DEFINE_STATIC_STRING(LeftEfferentArteriole); - DEFINE_STATIC_STRING(LeftPeritubularCapillaries); - DEFINE_STATIC_STRING(LeftNetPeritubularCapillaries); - DEFINE_STATIC_STRING(LeftRenalVein); - DEFINE_STATIC_STRING(LeftVenaCavaConnection); - // Urine - DEFINE_STATIC_STRING(LeftNetBowmansCapsules); - DEFINE_STATIC_STRING(LeftBowmansCapsules); - DEFINE_STATIC_STRING(LeftTubules); - DEFINE_STATIC_STRING(LeftNetTubules); - DEFINE_STATIC_STRING(LeftUreter); - - DEFINE_STATIC_STRING(Bladder); - - DEFINE_STATIC_STRING(Ground); - }; - - namespace RenalPath { - - DEFINE_STATIC_STRING(RightAortaConnectionToRenalArtery); - DEFINE_STATIC_STRING(RightRenalArteryToAfferentArteriole); - DEFINE_STATIC_STRING(RightRenalArteryCompliance); - DEFINE_STATIC_STRING(RightAfferentArterioleToGlomerularCapillaries); - DEFINE_STATIC_STRING(RightGlomerularCapillariesToEfferentArteriole); - DEFINE_STATIC_STRING(RightGlomerularCapillariesCompliance); - DEFINE_STATIC_STRING(RightEfferentArterioleToPeritubularCapillaries); - DEFINE_STATIC_STRING(RightPeritubularCapillariesToRenalVein); - DEFINE_STATIC_STRING(RightRenalVeinToVenaCavaConnection); - DEFINE_STATIC_STRING(RightRenalVeinCompliance); - - DEFINE_STATIC_STRING(RightGlomerularCapillariesToNetGlomerularCapillaries); - DEFINE_STATIC_STRING(RightNetGlomerularCapillariesToNetBowmansCapsules); - DEFINE_STATIC_STRING(RightBowmansCapsulesToNetBowmansCapsules); - DEFINE_STATIC_STRING(RightBowmansCapsulesToTubules); - DEFINE_STATIC_STRING(RightTubulesToUreter); - DEFINE_STATIC_STRING(RightTubulesToNetTubules); - DEFINE_STATIC_STRING(RightNetTubulesToNetPeritubularCapillaries); - DEFINE_STATIC_STRING(RightPeritubularCapillariesToNetPeritubularCapillaries); - DEFINE_STATIC_STRING(RightUreterToBladder); - - DEFINE_STATIC_STRING(LeftAortaConnectionToRenalArtery); - DEFINE_STATIC_STRING(LeftRenalArteryToAfferentArteriole); - DEFINE_STATIC_STRING(LeftRenalArteryCompliance); - DEFINE_STATIC_STRING(LeftAfferentArterioleToGlomerularCapillaries); - DEFINE_STATIC_STRING(LeftGlomerularCapillariesToEfferentArteriole); - DEFINE_STATIC_STRING(LeftGlomerularCapillariesCompliance); - DEFINE_STATIC_STRING(LeftEfferentArterioleToPeritubularCapillaries); - DEFINE_STATIC_STRING(LeftPeritubularCapillariesToRenalVein); - DEFINE_STATIC_STRING(LeftRenalVeinToVenaCavaConnection); - DEFINE_STATIC_STRING(LeftRenalVeinCompliance); - - DEFINE_STATIC_STRING(LeftGlomerularCapillariesToNetGlomerularCapillaries); - DEFINE_STATIC_STRING(LeftNetGlomerularCapillariesToNetBowmansCapsules); - DEFINE_STATIC_STRING(LeftBowmansCapsulesToNetBowmansCapsules); - DEFINE_STATIC_STRING(LeftBowmansCapsulesToTubules); - DEFINE_STATIC_STRING(LeftTubulesToUreter); - DEFINE_STATIC_STRING(LeftTubulesToNetTubules); - DEFINE_STATIC_STRING(LeftNetTubulesToNetPeritubularCapillaries); - DEFINE_STATIC_STRING(LeftPeritubularCapillariesToNetPeritubularCapillaries); - DEFINE_STATIC_STRING(LeftUreterToBladder); - - DEFINE_STATIC_STRING(BladderToGroundPressure); - DEFINE_STATIC_STRING(BladderToGroundUrinate); - }; - - namespace DigestionNode { - DEFINE_STATIC_STRING(GutChyme); - }; - - namespace DigestionPath { - - DEFINE_STATIC_STRING(GutChymeToSmallIntestineVascular); - }; - } //namespace biogears - } //namespace physiology -} //namespace tatric -} //namespace mil +namespace biogears { +namespace physiology { + + namespace Circuits { + + DEFINE_STATIC_STRING(FullCardiovascular); + DEFINE_STATIC_STRING(Cardiovascular); + DEFINE_STATIC_STRING(Cerebral); + DEFINE_STATIC_STRING(Renal); + DEFINE_STATIC_STRING(Respiratory); + DEFINE_STATIC_STRING(AnesthesiaMachine); + DEFINE_STATIC_STRING(RespiratoryAnesthesia); + DEFINE_STATIC_STRING(RespiratoryInhaler); + DEFINE_STATIC_STRING(RespiratoryNasalCannula); + DEFINE_STATIC_STRING(RespiratoryMechanicalVentilator); + DEFINE_STATIC_STRING(Temperature); + DEFINE_STATIC_STRING(InternalTemperature); + DEFINE_STATIC_STRING(ExternalTemperature); + }; + + /////////////////////////// + // Chyme Circuit Enums // + /////////////////////////// + + namespace ChymeNode { + + DEFINE_STATIC_STRING(SmallIntestineC1); + }; + + namespace ChymePath { + + DEFINE_STATIC_STRING(SmallIntestineC1ToSmallIntestine1); + DEFINE_STATIC_STRING(GroundToSmallIntestineC1); + DEFINE_STATIC_STRING(GutE3ToGroundGI); + }; + + namespace RespiratoryNode { + + DEFINE_STATIC_STRING(Trachea); + + DEFINE_STATIC_STRING(LeftAlveoli); + DEFINE_STATIC_STRING(LeftAlveoliLeak); + DEFINE_STATIC_STRING(LeftBronchi); + DEFINE_STATIC_STRING(LeftChestLeak); + DEFINE_STATIC_STRING(LeftPleuralCavity); + DEFINE_STATIC_STRING(LeftPleuralConnection); + + DEFINE_STATIC_STRING(Mouth); + + DEFINE_STATIC_STRING(RightAlveoli); + DEFINE_STATIC_STRING(RightAlveoliLeak); + DEFINE_STATIC_STRING(RightBronchi); + DEFINE_STATIC_STRING(RightChestLeak); + DEFINE_STATIC_STRING(RightPleuralCavity); + DEFINE_STATIC_STRING(RightPleuralConnection); + + DEFINE_STATIC_STRING(Stomach); + DEFINE_STATIC_STRING(RespiratoryMuscle); + }; + + namespace RespiratoryPath { + + DEFINE_STATIC_STRING(TracheaToLeftBronchi); + DEFINE_STATIC_STRING(TracheaToRightBronchi); + DEFINE_STATIC_STRING(TracheaToEnvironment); + + DEFINE_STATIC_STRING(EnvironmentToLeftChestLeak); + DEFINE_STATIC_STRING(EnvironmentToMouth); + DEFINE_STATIC_STRING(EnvironmentToRightChestLeak); + + DEFINE_STATIC_STRING(LeftAlveoliLeakToLeftPleuralCavity); + DEFINE_STATIC_STRING(LeftAlveoliToLeftAlveoliLeak); + DEFINE_STATIC_STRING(LeftAlveoliToLeftPleuralConnection); + DEFINE_STATIC_STRING(LeftPleuralConnectionToLeftPleuralCavity); + DEFINE_STATIC_STRING(LeftBronchiToLeftAlveoli); + DEFINE_STATIC_STRING(LeftBronchiToLeftPleuralConnection); + DEFINE_STATIC_STRING(LeftChestLeakToLeftPleuralCavity); + DEFINE_STATIC_STRING(LeftPleuralCavityToEnvironment); + DEFINE_STATIC_STRING(LeftPleuralCavityToRespiratoryMuscle); + + DEFINE_STATIC_STRING(MouthToTrachea); + DEFINE_STATIC_STRING(MouthToStomach); + + DEFINE_STATIC_STRING(RightAlveoliLeakToRightPleuralCavity); + DEFINE_STATIC_STRING(RightAlveoliToRightAlveoliLeak); + DEFINE_STATIC_STRING(RightAlveoliToRightPleuralConnection); + DEFINE_STATIC_STRING(RightPleuralConnectionToRightPleuralCavity); + DEFINE_STATIC_STRING(RightBronchiToRightAlveoli); + DEFINE_STATIC_STRING(RightBronchiToRightPleuralConnection); + DEFINE_STATIC_STRING(RightChestLeakToRightPleuralCavity); + DEFINE_STATIC_STRING(RightPleuralCavityToEnvironment); + DEFINE_STATIC_STRING(RightPleuralCavityToRespiratoryMuscle); + + DEFINE_STATIC_STRING(EnvironmentToRespiratoryMuscle); + DEFINE_STATIC_STRING(StomachToEnvironment); + }; + + ////////////////////////////////////// + // Anesthesia Machine Circuit Enums // + ////////////////////////////////////// + + namespace AnesthesiaMachineNode { + + DEFINE_STATIC_STRING(AnesthesiaConnection); + DEFINE_STATIC_STRING(ExpiratoryLimb); + DEFINE_STATIC_STRING(GasInlet); + DEFINE_STATIC_STRING(GasSource); + DEFINE_STATIC_STRING(InspiratoryLimb); + DEFINE_STATIC_STRING(ReliefValve); + DEFINE_STATIC_STRING(Scrubber); + DEFINE_STATIC_STRING(Selector); + DEFINE_STATIC_STRING(Ventilator); + DEFINE_STATIC_STRING(VentilatorConnection); + DEFINE_STATIC_STRING(YPiece); + }; + + namespace AnesthesiaMachinePath { + + DEFINE_STATIC_STRING(EnvironmentToVentilator); + DEFINE_STATIC_STRING(EnvironmentToReliefValve); + DEFINE_STATIC_STRING(VentilatorToVentilatorConnection); + DEFINE_STATIC_STRING(VentilatorConnectionToSelector); + DEFINE_STATIC_STRING(SelectorToReliefValve); + DEFINE_STATIC_STRING(SelectorToScrubber); + DEFINE_STATIC_STRING(ScrubberToGasInlet); + DEFINE_STATIC_STRING(EnvironmentToGasSource); + DEFINE_STATIC_STRING(GasSourceToGasInlet); + DEFINE_STATIC_STRING(GasInletToInspiratoryLimb); + DEFINE_STATIC_STRING(InspiratoryLimbToYPiece); + DEFINE_STATIC_STRING(YPieceToExpiratoryLimb); + DEFINE_STATIC_STRING(ExpiratoryLimbToSelector); + DEFINE_STATIC_STRING(YPieceToAnesthesiaConnection); + DEFINE_STATIC_STRING(AnesthesiaConnectionToEnvironment); + DEFINE_STATIC_STRING(SelectorToEnvironment); + }; + + namespace CombinedAnesthesiaMachinePath { + + DEFINE_STATIC_STRING(AnesthesiaConnectionToMouth); + DEFINE_STATIC_STRING(GroundConnection); + }; + + /////////////////////////// + // Inhaler Circuit Enums // + /////////////////////////// + + namespace InhalerNode { + + DEFINE_STATIC_STRING(Mouthpiece); + }; + + namespace InhalerPath { + + DEFINE_STATIC_STRING(EnvironmentToMouthpiece); + DEFINE_STATIC_STRING(MouthpieceToMouth); + }; + + /////////////////////////// + // Nasal Cannula Circuit Enums // + /////////////////////////// + + namespace NasalCannulaNode { + + DEFINE_STATIC_STRING(Nosepiece); + DEFINE_STATIC_STRING(OxygenTank); + }; + + namespace NasalCannulaPath { + + DEFINE_STATIC_STRING(OxygenTankToNosepiece); + DEFINE_STATIC_STRING(EnvironmentToOxygentank); + DEFINE_STATIC_STRING(ReturnFlow); + DEFINE_STATIC_STRING(NosepieceToMouth); + + }; + + ////////////////////////////////////////// + // Mechanical Ventilator Circuit Enums // + //////////////////////////////////////// + + namespace MechanicalVentilatorNode { + + DEFINE_STATIC_STRING_EX(Connection, MechanicalVentilatorConnection); + }; + + namespace MechanicalVentilatorPath { + + DEFINE_STATIC_STRING_EX(ConnectionToMouth, MechanicalVentilatorConnectionToMouth); + DEFINE_STATIC_STRING_EX(GroundToConnection, MechanicalVentilatorGroundToConnection); + }; + + /////////////////////////////////// + // Environment Gas Circuit Enums // + /////////////////////////////////// + + namespace EnvironmentNode { + + DEFINE_STATIC_STRING(Ambient); + }; + + /////////////////////////////////////////// + // External Temperature Circuit Enums // + /////////////////////////////////////////// + + namespace ExternalTemperatureNode { + + DEFINE_STATIC_STRING(Active); + DEFINE_STATIC_STRING(Clothing); + DEFINE_STATIC_STRING(Enclosure); + DEFINE_STATIC_STRING(ExternalCore); + DEFINE_STATIC_STRING(ExternalTorsoSkin); + DEFINE_STATIC_STRING(ExternalHeadSkin); + DEFINE_STATIC_STRING(ExternalLeftArmSkin); + DEFINE_STATIC_STRING(ExternalRightArmSkin); + DEFINE_STATIC_STRING(ExternalLeftLegSkin); + DEFINE_STATIC_STRING(ExternalRightLegSkin); + DEFINE_STATIC_STRING(ExternalGround); + DEFINE_STATIC_STRING(Ambient); + }; + + namespace ExternalTemperaturePath { + + DEFINE_STATIC_STRING(ActiveToClothing); + DEFINE_STATIC_STRING(ClothingToEnclosure); + DEFINE_STATIC_STRING(ClothingToEnvironment); + DEFINE_STATIC_STRING(ExternalCoreToGround); + DEFINE_STATIC_STRING(GroundToActive); + DEFINE_STATIC_STRING(GroundToClothing); + DEFINE_STATIC_STRING(GroundToEnclosure); + DEFINE_STATIC_STRING(GroundToEnvironment); + DEFINE_STATIC_STRING(ExternalTorsoSkinToGround); + DEFINE_STATIC_STRING(ExternalTorsoSkinToClothing); + DEFINE_STATIC_STRING(ExternalHeadSkinToGround); + DEFINE_STATIC_STRING(ExternalHeadSkinToClothing); + DEFINE_STATIC_STRING(ExternalLeftArmSkinToGround); + DEFINE_STATIC_STRING(ExternalLeftArmSkinToClothing); + DEFINE_STATIC_STRING(ExternalRightArmSkinToGround); + DEFINE_STATIC_STRING(ExternalRightArmSkinToClothing); + DEFINE_STATIC_STRING(ExternalLeftLegSkinToGround); + DEFINE_STATIC_STRING(ExternalLeftLegSkinToClothing); + DEFINE_STATIC_STRING(ExternalRightLegSkinToGround); + DEFINE_STATIC_STRING(ExternalRightLegSkinToClothing); + }; + + //////////////////////////////////////// + // Internal Temperature Circuit Enums // + //////////////////////////////////////// + + namespace InternalTemperatureNode { + + DEFINE_STATIC_STRING(InternalCore); + DEFINE_STATIC_STRING(InternalGround); + DEFINE_STATIC_STRING(InternalTorsoSkin); + DEFINE_STATIC_STRING(InternalHeadSkin); + DEFINE_STATIC_STRING(InternalLeftArmSkin); + DEFINE_STATIC_STRING(InternalRightArmSkin); + DEFINE_STATIC_STRING(InternalLeftLegSkin); + DEFINE_STATIC_STRING(InternalRightLegSkin); + }; + + namespace InternalTemperaturePath { + + DEFINE_STATIC_STRING(GroundToInternalCore); + DEFINE_STATIC_STRING(InternalCoreToGround); + + DEFINE_STATIC_STRING(GroundToInternalTorsoSkin); + DEFINE_STATIC_STRING(GroundToInternalHeadSkin); + DEFINE_STATIC_STRING(GroundToInternalLeftArmSkin); + DEFINE_STATIC_STRING(GroundToInternalRightArmSkin); + DEFINE_STATIC_STRING(GroundToInternalLeftLegSkin); + DEFINE_STATIC_STRING(GroundToInternalRightLegSkin); + + DEFINE_STATIC_STRING(InternalTorsoSkinToTemperatureGround); + DEFINE_STATIC_STRING(InternalCoreToInternalTorsoSkin); + DEFINE_STATIC_STRING(InternalHeadSkinToTemperatureGround); + DEFINE_STATIC_STRING(InternalCoreToInternalHeadSkin); + + DEFINE_STATIC_STRING(InternalLeftArmSkinToTemperatureGround); + DEFINE_STATIC_STRING(InternalCoreToInternalLeftArmSkin); + DEFINE_STATIC_STRING(InternalRightArmSkinToTemperatureGround); + DEFINE_STATIC_STRING(InternalCoreToInternalRightArmSkin); + DEFINE_STATIC_STRING(InternalLeftLegSkinToTemperatureGround); + DEFINE_STATIC_STRING(InternalCoreToInternalLeftLegSkin); + DEFINE_STATIC_STRING(InternalRightLegSkinToTemperatureGround); + DEFINE_STATIC_STRING(InternalCoreToInternalRightLegSkin); + }; + + //////////////////////////////////////// + // Combined Temperature Circuit Enums // + //////////////////////////////////////// + + namespace CombinedTemperaturePath { + + DEFINE_STATIC_STRING(InternalCoreToExternalCore); + DEFINE_STATIC_STRING(InternalTorsoSkinToExternalTorsoSkin); + DEFINE_STATIC_STRING(InternalHeadSkinToExternalHeadSkin); + DEFINE_STATIC_STRING(InternalLeftArmSkinToExternalLeftArmSkin); + DEFINE_STATIC_STRING(InternalRightArmSkinToExternalRightArmSkin); + DEFINE_STATIC_STRING(InternalLeftLegSkinToExternalLeftLegSkin); + DEFINE_STATIC_STRING(InternalRightLegSkinToExternalRightLegSkin); + }; + + namespace CardiovascularNode { + + DEFINE_STATIC_STRING(RightAtrium1); + DEFINE_STATIC_STRING(RightAtrium2); + + DEFINE_STATIC_STRING(RightVentricle1); + DEFINE_STATIC_STRING(RightVentricle2); + + DEFINE_STATIC_STRING(MainPulmonaryArteries); + DEFINE_STATIC_STRING(LeftIntermediatePulmonaryArteries); + DEFINE_STATIC_STRING(LeftPulmonaryArteries); + DEFINE_STATIC_STRING(RightIntermediatePulmonaryArteries); + DEFINE_STATIC_STRING(RightPulmonaryArteries); + + DEFINE_STATIC_STRING(LeftPulmonaryCapillaries); + DEFINE_STATIC_STRING(RightPulmonaryCapillaries); + + DEFINE_STATIC_STRING(LeftIntermediatePulmonaryVeins); + DEFINE_STATIC_STRING(LeftPulmonaryVeins); + DEFINE_STATIC_STRING(RightIntermediatePulmonaryVeins); + DEFINE_STATIC_STRING(RightPulmonaryVeins); + + DEFINE_STATIC_STRING(LeftAtrium1); + DEFINE_STATIC_STRING(LeftAtrium2); + + DEFINE_STATIC_STRING(LeftVentricle1); + DEFINE_STATIC_STRING(LeftVentricle2); + + DEFINE_STATIC_STRING(Aorta1); + DEFINE_STATIC_STRING(Aorta2); + DEFINE_STATIC_STRING(Aorta3); + + DEFINE_STATIC_STRING(Bone1); + DEFINE_STATIC_STRING(Bone2); + + DEFINE_STATIC_STRING(Brain1); + DEFINE_STATIC_STRING(Brain2); + + DEFINE_STATIC_STRING(Fat1); + DEFINE_STATIC_STRING(Fat2); + + DEFINE_STATIC_STRING(LargeIntestine1); + + DEFINE_STATIC_STRING(Liver1); + DEFINE_STATIC_STRING(Liver2); + DEFINE_STATIC_STRING(PortalVein1); + + DEFINE_STATIC_STRING(LeftArm1); + DEFINE_STATIC_STRING(LeftArm2); + + DEFINE_STATIC_STRING(LeftKidney1); + DEFINE_STATIC_STRING(LeftKidney2); + + DEFINE_STATIC_STRING(LeftLeg1); + DEFINE_STATIC_STRING(LeftLeg2); + + DEFINE_STATIC_STRING(Muscle1); + DEFINE_STATIC_STRING(Muscle2); + + DEFINE_STATIC_STRING(Myocardium1); + DEFINE_STATIC_STRING(Myocardium2); + + DEFINE_STATIC_STRING(Pericardium1); + + DEFINE_STATIC_STRING(RightArm1); + DEFINE_STATIC_STRING(RightArm2); + + DEFINE_STATIC_STRING(RightKidney1); + DEFINE_STATIC_STRING(RightKidney2); + + DEFINE_STATIC_STRING(RightLeg1); + DEFINE_STATIC_STRING(RightLeg2); + + DEFINE_STATIC_STRING(Skin1); + DEFINE_STATIC_STRING(Skin2); + + DEFINE_STATIC_STRING(SmallIntestine1); + + DEFINE_STATIC_STRING(Splanchnic1); + + DEFINE_STATIC_STRING(Spleen1); + + DEFINE_STATIC_STRING(VenaCava); + + DEFINE_STATIC_STRING(Ground); + }; + + namespace CardiovascularPath { + + // Heart and Lungs + DEFINE_STATIC_STRING(VenaCavaToRightAtrium1); + DEFINE_STATIC_STRING(RightAtrium1ToGround); + DEFINE_STATIC_STRING(RightAtrium1ToRightAtrium2); + DEFINE_STATIC_STRING(RightAtrium2ToRightVentricle1); + DEFINE_STATIC_STRING(RightVentricle1ToRightVentricle2); + DEFINE_STATIC_STRING(RightVentricle2ToGround); + DEFINE_STATIC_STRING(RightVentricle1ToMainPulmonaryArteries); + DEFINE_STATIC_STRING(MainPulmonaryArteriesToRightIntermediatePulmonaryArteries); + DEFINE_STATIC_STRING(RightIntermediatePulmonaryArteriesToRightPulmonaryArteries); + DEFINE_STATIC_STRING(RightPulmonaryArteriesToRightPulmonaryVeins); + DEFINE_STATIC_STRING(RightPulmonaryArteriesToRightPulmonaryCapillaries); + DEFINE_STATIC_STRING(RightPulmonaryArteriesToGround); + DEFINE_STATIC_STRING(RightPulmonaryCapillariesToRightPulmonaryVeins); + DEFINE_STATIC_STRING(RightPulmonaryCapillariesToGround); + DEFINE_STATIC_STRING(RightPulmonaryVeinsToRightIntermediatePulmonaryVeins); + DEFINE_STATIC_STRING(RightPulmonaryVeinsToGround); + DEFINE_STATIC_STRING(RightIntermediatePulmonaryVeinsToLeftAtrium1); + DEFINE_STATIC_STRING(MainPulmonaryArteriesToLeftIntermediatePulmonaryArteries); + DEFINE_STATIC_STRING(LeftIntermediatePulmonaryArteriesToLeftPulmonaryArteries); + DEFINE_STATIC_STRING(LeftPulmonaryArteriesToLeftPulmonaryVeins); + DEFINE_STATIC_STRING(LeftPulmonaryArteriesToLeftPulmonaryCapillaries); + DEFINE_STATIC_STRING(LeftPulmonaryArteriesToGround); + DEFINE_STATIC_STRING(LeftPulmonaryCapillariesToGround); + DEFINE_STATIC_STRING(LeftPulmonaryCapillariesToLeftPulmonaryVeins); + DEFINE_STATIC_STRING(LeftPulmonaryVeinsToLeftIntermediatePulmonaryVeins); + DEFINE_STATIC_STRING(LeftPulmonaryVeinsToGround); + DEFINE_STATIC_STRING(LeftIntermediatePulmonaryVeinsToLeftAtrium1); + DEFINE_STATIC_STRING(LeftAtrium1ToGround); + DEFINE_STATIC_STRING(LeftAtrium1ToLeftAtrium2); + DEFINE_STATIC_STRING(LeftAtrium2ToLeftVentricle1); + DEFINE_STATIC_STRING(LeftVentricle1ToLeftVentricle2); + DEFINE_STATIC_STRING(LeftVentricle2ToGround); + DEFINE_STATIC_STRING(LeftVentricle1ToAorta2); + DEFINE_STATIC_STRING(Aorta2ToAorta3); + DEFINE_STATIC_STRING(Aorta3ToAorta1); + DEFINE_STATIC_STRING(Aorta1ToGround); + // Brain + DEFINE_STATIC_STRING(Aorta1ToBrain1); + DEFINE_STATIC_STRING(Brain1ToGround); + DEFINE_STATIC_STRING(Brain1ToBrain2); + DEFINE_STATIC_STRING(Brain2ToVenaCava); + DEFINE_STATIC_STRING(Aorta1ToNeckArteries); + DEFINE_STATIC_STRING(NeckVeinsToVenaCava); + // Bone + DEFINE_STATIC_STRING(Aorta1ToBone1); + DEFINE_STATIC_STRING(Bone1ToGround); + DEFINE_STATIC_STRING(Bone1ToBone2); + DEFINE_STATIC_STRING(Bone2ToVenaCava); + // Fat + DEFINE_STATIC_STRING(Aorta1ToFat1); + DEFINE_STATIC_STRING(Fat1ToGround); + DEFINE_STATIC_STRING(Fat1ToFat2); + DEFINE_STATIC_STRING(Fat2ToVenaCava); + // Large Intestine + DEFINE_STATIC_STRING(Aorta1ToLargeIntestine); + DEFINE_STATIC_STRING(LargeIntestineToGround); + DEFINE_STATIC_STRING(LargeIntestineToPortalVein); + // Left Arm + DEFINE_STATIC_STRING(Aorta1ToLeftArm1); + DEFINE_STATIC_STRING(LeftArm1ToGround); + DEFINE_STATIC_STRING(LeftArm1ToLeftArm2); + DEFINE_STATIC_STRING(LeftArm2ToVenaCava); + // Left Kidney + DEFINE_STATIC_STRING(Aorta1ToLeftKidney1); + DEFINE_STATIC_STRING(LeftKidney1ToGround); + DEFINE_STATIC_STRING(LeftKidney1ToLeftKidney2); + DEFINE_STATIC_STRING(LeftKidney2ToVenaCava); + // Left Leg + DEFINE_STATIC_STRING(Aorta1ToLeftLeg1); + DEFINE_STATIC_STRING(LeftLeg1ToGround); + DEFINE_STATIC_STRING(LeftLeg1ToLeftLeg2); + DEFINE_STATIC_STRING(LeftLeg2ToVenaCava); + // Liver + DEFINE_STATIC_STRING(Aorta1ToLiver1); + DEFINE_STATIC_STRING(Liver1ToGround); + DEFINE_STATIC_STRING(PortalVeinToLiver1); + DEFINE_STATIC_STRING(Liver1ToLiver2); + DEFINE_STATIC_STRING(Liver2ToVenaCava); + // Muscle + DEFINE_STATIC_STRING(Aorta1ToMuscle1); + DEFINE_STATIC_STRING(Muscle1ToGround); + DEFINE_STATIC_STRING(Muscle1ToMuscle2); + DEFINE_STATIC_STRING(Muscle2ToVenaCava); + // Myocardium + DEFINE_STATIC_STRING(Aorta1ToMyocardium1); + DEFINE_STATIC_STRING(Myocardium1ToGround); + DEFINE_STATIC_STRING(Myocardium1ToMyocardium2); + DEFINE_STATIC_STRING(Myocardium2ToVenaCava); + // Pericardium + DEFINE_STATIC_STRING(Pericardium1ToGround); + DEFINE_STATIC_STRING(GroundToPericardium1); + // Right Arm + DEFINE_STATIC_STRING(Aorta1ToRightArm1); + DEFINE_STATIC_STRING(RightArm1ToGround); + DEFINE_STATIC_STRING(RightArm1ToRightArm2); + DEFINE_STATIC_STRING(RightArm2ToVenaCava); + // Right Kidney + DEFINE_STATIC_STRING(Aorta1ToRightKidney1); + DEFINE_STATIC_STRING(RightKidney1ToGround); + DEFINE_STATIC_STRING(RightKidney1ToRightKidney2); + DEFINE_STATIC_STRING(RightKidney2ToVenaCava); + // Right Leg + DEFINE_STATIC_STRING(Aorta1ToRightLeg1); + DEFINE_STATIC_STRING(RightLeg1ToGround); + DEFINE_STATIC_STRING(RightLeg1ToRightLeg2); + DEFINE_STATIC_STRING(RightLeg2ToVenaCava); + // Skin + DEFINE_STATIC_STRING(Aorta1ToSkin1); + DEFINE_STATIC_STRING(Skin1ToGround); + DEFINE_STATIC_STRING(Skin1ToSkin2); + DEFINE_STATIC_STRING(Skin2ToVenaCava); + // Small Intestine + DEFINE_STATIC_STRING(Aorta1ToSmallIntestine); + DEFINE_STATIC_STRING(SmallIntestineToGround); + DEFINE_STATIC_STRING(SmallIntestineToPortalVein); + // Splanchnic + DEFINE_STATIC_STRING(Aorta1ToSplanchnic); + DEFINE_STATIC_STRING(SplanchnicToGround); + DEFINE_STATIC_STRING(SplanchnicToPortalVein); + // Spleen + DEFINE_STATIC_STRING(Aorta1ToSpleen); + DEFINE_STATIC_STRING(SpleenToGround); + DEFINE_STATIC_STRING(SpleenToPortalVein); + // Vena Cava + DEFINE_STATIC_STRING(VenaCavaToGround); + DEFINE_STATIC_STRING(IVToVenaCava); + // Hemorrhage + DEFINE_STATIC_STRING(AortaBleed); + DEFINE_STATIC_STRING(BrainBleed); + DEFINE_STATIC_STRING(MyocardiumBleed); + DEFINE_STATIC_STRING(LeftLungBleed); + DEFINE_STATIC_STRING(RightLungBleed); + DEFINE_STATIC_STRING(LeftArmBleed); + DEFINE_STATIC_STRING(RightArmBleed); + DEFINE_STATIC_STRING(SpleenBleed); + DEFINE_STATIC_STRING(SmallIntestineBleed); + DEFINE_STATIC_STRING(LargeIntestineBleed); + DEFINE_STATIC_STRING(SplanchnicBleed); + DEFINE_STATIC_STRING(RightKidneyBleed); + DEFINE_STATIC_STRING(LeftKidneyBleed); + DEFINE_STATIC_STRING(LiverBleed); + DEFINE_STATIC_STRING(PortalBleed); + DEFINE_STATIC_STRING(LeftLegBleed); + DEFINE_STATIC_STRING(RightLegBleed); + DEFINE_STATIC_STRING(VenaCavaBleed); + }; + + namespace CerebralNode { + DEFINE_STATIC_STRING(NeckArteries); + DEFINE_STATIC_STRING(CerebralArteries1); + DEFINE_STATIC_STRING(CerebralArteries2); + DEFINE_STATIC_STRING(CerebralCapillaries); + DEFINE_STATIC_STRING(CerebralVeins1); + DEFINE_STATIC_STRING(CerebralVeins2); + DEFINE_STATIC_STRING(NeckVeins); + DEFINE_STATIC_STRING(CerebralVeinsCheck); + DEFINE_STATIC_STRING(SpinalFluid); + DEFINE_STATIC_STRING(Ground); + }; + + namespace CerebralPath { + DEFINE_STATIC_STRING(NeckArteriesToCerebralArteries1); + DEFINE_STATIC_STRING(NeckArteriesToGround); + DEFINE_STATIC_STRING(CerebralArteries1ToCerebralArteries2); + DEFINE_STATIC_STRING(CerebralArteries1ToSpinalFluid); + DEFINE_STATIC_STRING(CerebralArteries2ToSpinalFluid); + DEFINE_STATIC_STRING(CerebralArteries2ToCapillaries); + DEFINE_STATIC_STRING(CerebralCapillariesToSpinalFluid); + DEFINE_STATIC_STRING(CerebralCapillariesToCerebralVeins1); + DEFINE_STATIC_STRING(CerebralVeins1ToSpinalFluid); + DEFINE_STATIC_STRING(CerebralVeins1ToCerebralVeins2); + DEFINE_STATIC_STRING(CerebralVeinsCheckToCerebralVeins2); + DEFINE_STATIC_STRING(SpinalFluidToCerebralVeinsCheck); + DEFINE_STATIC_STRING(CerebralVeins2ToNeckVeins); + DEFINE_STATIC_STRING(NeckVeinsToGround); + DEFINE_STATIC_STRING(SpinalFluidToGround); + } + + namespace TissueNode { + + DEFINE_STATIC_STRING(BoneE1); + DEFINE_STATIC_STRING(BoneE2); + DEFINE_STATIC_STRING(BoneE3); + DEFINE_STATIC_STRING(BoneI); + DEFINE_STATIC_STRING(BoneL1); + DEFINE_STATIC_STRING(BoneL2); + DEFINE_STATIC_STRING(BrainE1); + DEFINE_STATIC_STRING(BrainE2); + DEFINE_STATIC_STRING(BrainE3); + DEFINE_STATIC_STRING(BrainI); + DEFINE_STATIC_STRING(BrainL1); + DEFINE_STATIC_STRING(BrainL2); + DEFINE_STATIC_STRING(FatE1); + DEFINE_STATIC_STRING(FatE2); + DEFINE_STATIC_STRING(FatE3); + DEFINE_STATIC_STRING(FatI); + DEFINE_STATIC_STRING(FatL1); + DEFINE_STATIC_STRING(FatL2) + DEFINE_STATIC_STRING(GutE1); + DEFINE_STATIC_STRING(GutE2); + DEFINE_STATIC_STRING(GutE3); + DEFINE_STATIC_STRING(GutI); + DEFINE_STATIC_STRING(GutL1); + DEFINE_STATIC_STRING(GutL2) + DEFINE_STATIC_STRING(LiverE1); + DEFINE_STATIC_STRING(LiverE2); + DEFINE_STATIC_STRING(LiverE3); + DEFINE_STATIC_STRING(LiverI); + DEFINE_STATIC_STRING(LiverL1); + DEFINE_STATIC_STRING(LiverL2); + DEFINE_STATIC_STRING(LeftKidneyE1); + DEFINE_STATIC_STRING(LeftKidneyE2); + DEFINE_STATIC_STRING(LeftKidneyE3); + DEFINE_STATIC_STRING(LeftKidneyI); + DEFINE_STATIC_STRING(LeftKidneyL1); + DEFINE_STATIC_STRING(LeftKidneyL2); + DEFINE_STATIC_STRING(LeftLungE1); + DEFINE_STATIC_STRING(LeftLungE2); + DEFINE_STATIC_STRING(LeftLungE3); + DEFINE_STATIC_STRING(LeftLungI); + DEFINE_STATIC_STRING(LeftLungL1); + DEFINE_STATIC_STRING(LeftLungL2); + DEFINE_STATIC_STRING(Lymph) + DEFINE_STATIC_STRING(Lymph2); + DEFINE_STATIC_STRING(MuscleE1); + DEFINE_STATIC_STRING(MuscleE2); + DEFINE_STATIC_STRING(MuscleE3) + DEFINE_STATIC_STRING(MuscleI); + DEFINE_STATIC_STRING(MuscleL1); + DEFINE_STATIC_STRING(MuscleL2); + DEFINE_STATIC_STRING(MyocardiumE1); + DEFINE_STATIC_STRING(MyocardiumE2); + DEFINE_STATIC_STRING(MyocardiumE3); + DEFINE_STATIC_STRING(MyocardiumI); + DEFINE_STATIC_STRING(MyocardiumL1); + DEFINE_STATIC_STRING(MyocardiumL2); + DEFINE_STATIC_STRING(RightLungE1); + DEFINE_STATIC_STRING(RightLungE2); + DEFINE_STATIC_STRING(RightLungE3); + DEFINE_STATIC_STRING(RightLungI); + DEFINE_STATIC_STRING(RightLungL1); + DEFINE_STATIC_STRING(RightLungL2); + DEFINE_STATIC_STRING(RightKidneyE1); + DEFINE_STATIC_STRING(RightKidneyE2); + DEFINE_STATIC_STRING(RightKidneyE3); + DEFINE_STATIC_STRING(RightKidneyI); + DEFINE_STATIC_STRING(RightKidneyL1); + DEFINE_STATIC_STRING(RightKidneyL2); + DEFINE_STATIC_STRING(SkinE1); + DEFINE_STATIC_STRING(SkinE2); + DEFINE_STATIC_STRING(SkinE3); + DEFINE_STATIC_STRING(SkinI); + DEFINE_STATIC_STRING(SkinL1); + DEFINE_STATIC_STRING(SkinL2); + DEFINE_STATIC_STRING(SpleenE1); + DEFINE_STATIC_STRING(SpleenE2); + DEFINE_STATIC_STRING(SpleenE3); + DEFINE_STATIC_STRING(SpleenI); + DEFINE_STATIC_STRING(SpleenL1); + DEFINE_STATIC_STRING(SpleenL2); + }; + + namespace TissuePath { + DEFINE_STATIC_STRING(BoneVToBoneE1); + DEFINE_STATIC_STRING(BoneE1ToBoneE2); + DEFINE_STATIC_STRING(BoneE2ToBoneE3); + DEFINE_STATIC_STRING(BoneE3ToBoneI); + DEFINE_STATIC_STRING(BoneE3ToGround); + DEFINE_STATIC_STRING(BoneIToGround); + DEFINE_STATIC_STRING(BoneE3ToBoneL1); + DEFINE_STATIC_STRING(BoneL1ToBoneL2); + DEFINE_STATIC_STRING(BoneToLymphValve); + + DEFINE_STATIC_STRING(BrainVToBrainE1); + DEFINE_STATIC_STRING(BrainE1ToBrainE2); + DEFINE_STATIC_STRING(BrainE2ToBrainE3); + DEFINE_STATIC_STRING(BrainE3ToBrainI); + DEFINE_STATIC_STRING(BrainE3ToGround); + DEFINE_STATIC_STRING(BrainIToGround); + DEFINE_STATIC_STRING(BrainE3ToBrainL1); + DEFINE_STATIC_STRING(BrainL1ToBrainL2); + DEFINE_STATIC_STRING(BrainToLymphValve); + + DEFINE_STATIC_STRING(FatVToFatE1); + DEFINE_STATIC_STRING(FatE1ToFatE2); + DEFINE_STATIC_STRING(FatE2ToFatE3); + DEFINE_STATIC_STRING(FatE3ToFatI); + DEFINE_STATIC_STRING(FatE3ToGround); + DEFINE_STATIC_STRING(FatIToGround); + DEFINE_STATIC_STRING(FatE3ToFatL1); + DEFINE_STATIC_STRING(FatL1ToFatL2); + DEFINE_STATIC_STRING(FatToLymphValve); + + DEFINE_STATIC_STRING(SmallIntestineVToGutE1); + DEFINE_STATIC_STRING(LargeIntestineVToGutE1); + DEFINE_STATIC_STRING(SplanchnicVToGutE1); + DEFINE_STATIC_STRING(GutE1ToGutE2); + DEFINE_STATIC_STRING(GutE2ToGutE3); + DEFINE_STATIC_STRING(GutE3ToGutI); + DEFINE_STATIC_STRING(GutE3ToGround); + DEFINE_STATIC_STRING(GutIToGround); + DEFINE_STATIC_STRING(GutE3ToGutL1); + DEFINE_STATIC_STRING(GutL1ToGutL2); + DEFINE_STATIC_STRING(GutToLymphValve); + + DEFINE_STATIC_STRING(LiverVToLiverE1); + DEFINE_STATIC_STRING(LiverE1ToLiverE2); + DEFINE_STATIC_STRING(LiverE2ToLiverE3); + DEFINE_STATIC_STRING(LiverE3ToLiverI); + DEFINE_STATIC_STRING(LiverE3ToGround); + DEFINE_STATIC_STRING(LiverIToGround); + DEFINE_STATIC_STRING(LiverE3ToLiverL1); + DEFINE_STATIC_STRING(LiverL1ToLiverL2); + DEFINE_STATIC_STRING(LiverToLymphValve); + + DEFINE_STATIC_STRING(LeftKidneyVToLeftKidneyE1); + DEFINE_STATIC_STRING(LeftKidneyE1ToLeftKidneyE2); + DEFINE_STATIC_STRING(LeftKidneyE2ToLeftKidneyE3); + DEFINE_STATIC_STRING(LeftKidneyE3ToLeftKidneyI); + DEFINE_STATIC_STRING(LeftKidneyE3ToGround); + DEFINE_STATIC_STRING(LeftKidneyIToGround); + DEFINE_STATIC_STRING(LeftKidneyE3ToLeftKidneyL1); + DEFINE_STATIC_STRING(LeftKidneyL1ToLeftKidneyL2); + DEFINE_STATIC_STRING(LeftKidneyToLymphValve); + + DEFINE_STATIC_STRING(LeftLungVToLeftLungE1); + DEFINE_STATIC_STRING(LeftLungE1ToLeftLungE2); + DEFINE_STATIC_STRING(LeftLungE2ToLeftLungE3); + DEFINE_STATIC_STRING(LeftLungE3ToLeftLungI); + DEFINE_STATIC_STRING(LeftLungE3ToGround); + DEFINE_STATIC_STRING(LeftLungIToGround); + DEFINE_STATIC_STRING(LeftLungE3ToLeftLungL1); + DEFINE_STATIC_STRING(LeftLungL1ToLeftLungL2); + DEFINE_STATIC_STRING(LeftLungToLymphValve); + + DEFINE_STATIC_STRING(Lymph1ToLymph2); + DEFINE_STATIC_STRING(LymphToVenaCava); + DEFINE_STATIC_STRING(LymphToGround); + + DEFINE_STATIC_STRING(MuscleVToMuscleE1); + DEFINE_STATIC_STRING(MuscleE1ToMuscleE2); + DEFINE_STATIC_STRING(MuscleE2ToMuscleE3); + DEFINE_STATIC_STRING(MuscleE3ToMuscleI); + DEFINE_STATIC_STRING(MuscleE3ToGround); + DEFINE_STATIC_STRING(MuscleIToGround); + DEFINE_STATIC_STRING(MuscleE3ToMuscleL1); + DEFINE_STATIC_STRING(MuscleL1ToMuscleL2); + DEFINE_STATIC_STRING(MuscleToLymphValve); + + DEFINE_STATIC_STRING(MyocardiumVToMyocardiumE1); + DEFINE_STATIC_STRING(MyocardiumE1ToMyocardiumE2); + DEFINE_STATIC_STRING(MyocardiumE2ToMyocardiumE3); + DEFINE_STATIC_STRING(MyocardiumE3ToMyocardiumI); + DEFINE_STATIC_STRING(MyocardiumE3ToGround); + DEFINE_STATIC_STRING(MyocardiumIToGround); + DEFINE_STATIC_STRING(MyocardiumE3ToMyocardiumL1); + DEFINE_STATIC_STRING(MyocardiumL1ToMyocardiumL2); + DEFINE_STATIC_STRING(MyocardiumToLymphValve); + + DEFINE_STATIC_STRING(RightLungVToRightLungE1); + DEFINE_STATIC_STRING(RightLungE1ToRightLungE2); + DEFINE_STATIC_STRING(RightLungE2ToRightLungE3); + DEFINE_STATIC_STRING(RightLungE3ToRightLungI); + DEFINE_STATIC_STRING(RightLungE3ToGround); + DEFINE_STATIC_STRING(RightLungIToGround); + DEFINE_STATIC_STRING(RightLungE3ToRightLungL1); + DEFINE_STATIC_STRING(RightLungL1ToRightLungL2); + DEFINE_STATIC_STRING(RightLungToLymphValve); + + DEFINE_STATIC_STRING(RightKidneyVToRightKidneyE1); + DEFINE_STATIC_STRING(RightKidneyE1ToRightKidneyE2); + DEFINE_STATIC_STRING(RightKidneyE2ToRightKidneyE3); + DEFINE_STATIC_STRING(RightKidneyE3ToRightKidneyI); + DEFINE_STATIC_STRING(RightKidneyE3ToGround); + DEFINE_STATIC_STRING(RightKidneyIToGround); + DEFINE_STATIC_STRING(RightKidneyE3ToRightKidneyL1); + DEFINE_STATIC_STRING(RightKidneyL1ToRightKidneyL2); + DEFINE_STATIC_STRING(RightKidneyToLymphValve); + + DEFINE_STATIC_STRING(SkinVToSkinE1); + DEFINE_STATIC_STRING(SkinE1ToSkinE2); + DEFINE_STATIC_STRING(SkinE2ToSkinE3); + DEFINE_STATIC_STRING(SkinE3ToSkinI); + DEFINE_STATIC_STRING(SkinE3ToGround); + DEFINE_STATIC_STRING(SkinIToGround); + DEFINE_STATIC_STRING(SkinE3ToSkinL1); + DEFINE_STATIC_STRING(SkinL1ToSkinL2); + DEFINE_STATIC_STRING(SkinSweating); + DEFINE_STATIC_STRING(SkinToLymphValve); + + DEFINE_STATIC_STRING(SpleenVToSpleenE1); + DEFINE_STATIC_STRING(SpleenE1ToSpleenE2); + DEFINE_STATIC_STRING(SpleenE2ToSpleenE3); + DEFINE_STATIC_STRING(SpleenE3ToSpleenI); + DEFINE_STATIC_STRING(SpleenE3ToGround); + DEFINE_STATIC_STRING(SpleenIToGround); + DEFINE_STATIC_STRING(SpleenE3ToSpleenL1); + DEFINE_STATIC_STRING(SpleenL1ToSpleenL2); + DEFINE_STATIC_STRING(SpleenToLymphValve); + }; + + namespace RenalNode { + + // Blood + DEFINE_STATIC_STRING(RightAortaConnection); + DEFINE_STATIC_STRING(RightRenalArtery); + DEFINE_STATIC_STRING(RightAfferentArteriole); + DEFINE_STATIC_STRING(RightGlomerularCapillaries); + DEFINE_STATIC_STRING(RightNetGlomerularCapillaries); + DEFINE_STATIC_STRING(RightEfferentArteriole); + DEFINE_STATIC_STRING(RightPeritubularCapillaries); + DEFINE_STATIC_STRING(RightNetPeritubularCapillaries); + DEFINE_STATIC_STRING(RightRenalVein); + DEFINE_STATIC_STRING(RightVenaCavaConnection); + // Urine + DEFINE_STATIC_STRING(RightBowmansCapsules); + DEFINE_STATIC_STRING(RightNetBowmansCapsules); + DEFINE_STATIC_STRING(RightTubules); + DEFINE_STATIC_STRING(RightNetTubules); + DEFINE_STATIC_STRING(RightUreter); + + // Blood + DEFINE_STATIC_STRING(LeftAortaConnection); + DEFINE_STATIC_STRING(LeftRenalArtery); + DEFINE_STATIC_STRING(LeftAfferentArteriole); + DEFINE_STATIC_STRING(LeftGlomerularCapillaries); + DEFINE_STATIC_STRING(LeftNetGlomerularCapillaries); + DEFINE_STATIC_STRING(LeftEfferentArteriole); + DEFINE_STATIC_STRING(LeftPeritubularCapillaries); + DEFINE_STATIC_STRING(LeftNetPeritubularCapillaries); + DEFINE_STATIC_STRING(LeftRenalVein); + DEFINE_STATIC_STRING(LeftVenaCavaConnection); + // Urine + DEFINE_STATIC_STRING(LeftNetBowmansCapsules); + DEFINE_STATIC_STRING(LeftBowmansCapsules); + DEFINE_STATIC_STRING(LeftTubules); + DEFINE_STATIC_STRING(LeftNetTubules); + DEFINE_STATIC_STRING(LeftUreter); + + DEFINE_STATIC_STRING(Bladder); + + DEFINE_STATIC_STRING(Ground); + }; + + namespace RenalPath { + + DEFINE_STATIC_STRING(RightAortaConnectionToRenalArtery); + DEFINE_STATIC_STRING(RightRenalArteryToAfferentArteriole); + DEFINE_STATIC_STRING(RightRenalArteryCompliance); + DEFINE_STATIC_STRING(RightAfferentArterioleToGlomerularCapillaries); + DEFINE_STATIC_STRING(RightGlomerularCapillariesToEfferentArteriole); + DEFINE_STATIC_STRING(RightGlomerularCapillariesCompliance); + DEFINE_STATIC_STRING(RightEfferentArterioleToPeritubularCapillaries); + DEFINE_STATIC_STRING(RightPeritubularCapillariesToRenalVein); + DEFINE_STATIC_STRING(RightRenalVeinToVenaCavaConnection); + DEFINE_STATIC_STRING(RightRenalVeinCompliance); + + DEFINE_STATIC_STRING(RightGlomerularCapillariesToNetGlomerularCapillaries); + DEFINE_STATIC_STRING(RightNetGlomerularCapillariesToNetBowmansCapsules); + DEFINE_STATIC_STRING(RightBowmansCapsulesToNetBowmansCapsules); + DEFINE_STATIC_STRING(RightBowmansCapsulesToTubules); + DEFINE_STATIC_STRING(RightTubulesToUreter); + DEFINE_STATIC_STRING(RightTubulesToNetTubules); + DEFINE_STATIC_STRING(RightNetTubulesToNetPeritubularCapillaries); + DEFINE_STATIC_STRING(RightPeritubularCapillariesToNetPeritubularCapillaries); + DEFINE_STATIC_STRING(RightUreterToBladder); + + DEFINE_STATIC_STRING(LeftAortaConnectionToRenalArtery); + DEFINE_STATIC_STRING(LeftRenalArteryToAfferentArteriole); + DEFINE_STATIC_STRING(LeftRenalArteryCompliance); + DEFINE_STATIC_STRING(LeftAfferentArterioleToGlomerularCapillaries); + DEFINE_STATIC_STRING(LeftGlomerularCapillariesToEfferentArteriole); + DEFINE_STATIC_STRING(LeftGlomerularCapillariesCompliance); + DEFINE_STATIC_STRING(LeftEfferentArterioleToPeritubularCapillaries); + DEFINE_STATIC_STRING(LeftPeritubularCapillariesToRenalVein); + DEFINE_STATIC_STRING(LeftRenalVeinToVenaCavaConnection); + DEFINE_STATIC_STRING(LeftRenalVeinCompliance); + + DEFINE_STATIC_STRING(LeftGlomerularCapillariesToNetGlomerularCapillaries); + DEFINE_STATIC_STRING(LeftNetGlomerularCapillariesToNetBowmansCapsules); + DEFINE_STATIC_STRING(LeftBowmansCapsulesToNetBowmansCapsules); + DEFINE_STATIC_STRING(LeftBowmansCapsulesToTubules); + DEFINE_STATIC_STRING(LeftTubulesToUreter); + DEFINE_STATIC_STRING(LeftTubulesToNetTubules); + DEFINE_STATIC_STRING(LeftNetTubulesToNetPeritubularCapillaries); + DEFINE_STATIC_STRING(LeftPeritubularCapillariesToNetPeritubularCapillaries); + DEFINE_STATIC_STRING(LeftUreterToBladder); + + DEFINE_STATIC_STRING(BladderToGroundPressure); + DEFINE_STATIC_STRING(BladderToGroundUrinate); + }; + + namespace DigestionNode { + DEFINE_STATIC_STRING(GutChyme); + }; + + namespace DigestionPath { + + DEFINE_STATIC_STRING(GutChymeToSmallIntestineVascular); + }; + +} // namespace physiology +} // namespace biogears + +namespace BGE = biogears::physiology; \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGearsCompartments.h b/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGearsCompartments.h index a2cc005fc..fafefaea0 100644 --- a/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGearsCompartments.h +++ b/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGearsCompartments.h @@ -18,20 +18,22 @@ specific language governing permissions and limitations under the License. namespace biogears { class BioGears; class SEGasCompartmentGraph; +namespace io { + class BioGears; +} /** * @brief Manages all compartments and graphs associated with all %BioGears systems/equipement */ class BIOGEARS_API BioGearsCompartments : public SECompartmentManager { friend class BioGearsSubstances; + friend class io::BioGears; public: static auto make_unique(BioGears& bg) -> std::unique_ptr; BioGearsCompartments(BioGears& data); virtual ~BioGearsCompartments(); - void Clear(); - - virtual bool Load(const CDM::CompartmentManagerData& in, SECircuitManager* circuits = nullptr); + void Invalidate(); void StateChange(); void UpdateAirwayGraph() diff --git a/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGearsConfiguration.h b/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGearsConfiguration.h index 85ebe7d1f..3e19db399 100644 --- a/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGearsConfiguration.h +++ b/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGearsConfiguration.h @@ -11,61 +11,39 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once +#include "biogears/cdm/properties/SEScalarFlowElastance.h" #include #include -#include -#include "biogears/cdm/properties/SEScalarFlowElastance.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace biogears { class SENutrition; class SEEnvironmentalConditions; -class SEScalarArea; -class AreaUnit; -class SEScalarLength; -class LengthUnit; -class SEScalarAreaPerTimePressure; -class AreaPerTimePressureUnit; -class SEScalarFlowElastance; -class FlowElastanceUnit; -class SEScalarPowerPerAreaTemperatureToTheFourth; -class PowerPerAreaTemperatureToTheFourthUnit; -class SEScalarHeatCapacitancePerAmount; -class HeatCapacitancePerAmountUnit; -class SEScalarHeatCapacitancePerMass; -class HeatCapacitancePerMassUnit; -class SEScalarEnergyPerAmount; -class EnergyPerAmountUnit; -class SEScalarHeatConductance; -class HeatConductanceUnit; -class SEScalarEnergyPerMass; -class EnergyPerMassUnit; -class SEScalarVolumePerTimePressureArea; -class VolumePerTimePressureAreaUnit; -class SEScalarInverseVolume; -class InverseVolumeUnit; -class SEScalarMassPerAmount; -class MassPerAmountUnit; -class VolumeUnit; -class SEScalarFlowResistance; -class FlowResistanceUnit; -class ElectricResistanceUnit; -class SEScalarElectricResistance; -class SEScalarHeatResistance; -class HeatResistanceUnit; -class SEScalarTemperatureUnit; -class TemperatureUnit; -class MassPerVolumeUnit; -class SEScalarMassPerTime; -class MassPerTimeUnit; -class SEScalarVolumePerTime; -class VolumePerTimeUnit; -class PressureUnit; namespace io { class BiogearsEngineConfiguration; } /** -* @brief %BioGears specific configuration parameters for all systems/equipment -*/ + * @brief %BioGears specific configuration parameters for all systems/equipment + */ class BIOGEARS_API BioGearsConfiguration : public PhysiologyEngineConfiguration { friend class io::BiogearsEngineConfiguration; @@ -73,7 +51,7 @@ class BIOGEARS_API BioGearsConfiguration : public PhysiologyEngineConfiguration BioGearsConfiguration(SESubstanceManager& substances); virtual ~BioGearsConfiguration(); - virtual void Clear(); + virtual void Invalidate(); virtual void Initialize(); virtual void Merge(const PhysiologyEngineConfiguration& from); @@ -81,13 +59,6 @@ class BIOGEARS_API BioGearsConfiguration : public PhysiologyEngineConfiguration bool Load(const std::string& file); - virtual bool Load(const CDM::PhysiologyEngineConfigurationData& in); - virtual bool Load(const CDM::BioGearsConfigurationData& in); - virtual CDM::BioGearsConfigurationData* Unload() const; - -protected: - virtual void Unload(CDM::BioGearsConfigurationData& data) const; - SESubstanceManager& m_Substances; ////////////////////// @@ -238,12 +209,12 @@ class BIOGEARS_API BioGearsConfiguration : public PhysiologyEngineConfiguration /** Drugs */ //////////// public: - virtual bool HasUsePDModel() const { return m_PDEnabled != (CDM::enumOnOff::value)-1; } - virtual bool IsPDEnabled() const { return m_PDEnabled == CDM::enumOnOff::On; } - virtual void UsePDModel(CDM::enumOnOff::value s) { m_PDEnabled = s; } + virtual bool HasUsePDModel() const { return m_PDEnabled != SEOnOff::Invalid; } + virtual bool IsPDEnabled() const { return m_PDEnabled == SEOnOff::On; } + virtual void UsePDModel(SEOnOff s) { m_PDEnabled = s; } protected: - CDM::enumOnOff::value m_PDEnabled; + SEOnOff m_PDEnabled; ///////////// /** Energy */ @@ -381,21 +352,21 @@ class BIOGEARS_API BioGearsConfiguration : public PhysiologyEngineConfiguration virtual SEScalarLength& GetPupilDiameterBaseline(); virtual double GetPupilDiameterBaseline(const LengthUnit& unit) const; - virtual bool HasEnableCerebral() const { return m_CerebralEnabled != (CDM::enumOnOff::value)-1; } - virtual bool IsCerebralEnabled() const { return m_CerebralEnabled == CDM::enumOnOff::On; } - virtual void EnableCerebral(CDM::enumOnOff::value s) { m_CerebralEnabled = s; } + virtual bool HasEnableCerebral() const { return m_CerebralEnabled != SEOnOff::Invalid; } + virtual bool IsCerebralEnabled() const { return m_CerebralEnabled == SEOnOff::On; } + virtual void EnableCerebral(SEOnOff s) { m_CerebralEnabled = s; } protected: - CDM::enumOnOff::value m_CerebralEnabled; + SEOnOff m_CerebralEnabled; SEScalarLength* m_PupilDiameterBaseline; //////////// /** Renal */ //////////// public: - virtual bool HasEnableRenal() const { return m_RenalEnabled != (CDM::enumOnOff::value)-1; } - virtual bool IsRenalEnabled() const { return m_RenalEnabled == CDM::enumOnOff::On; } - virtual void EnableRenal(CDM::enumOnOff::value s) { m_RenalEnabled = s; } + virtual bool HasEnableRenal() const { return m_RenalEnabled != SEOnOff::Invalid; } + virtual bool IsRenalEnabled() const { return m_RenalEnabled == SEOnOff::On; } + virtual void EnableRenal(SEOnOff s) { m_RenalEnabled = s; } virtual bool HasPlasmaSodiumConcentrationSetPoint() const; virtual SEScalarMassPerVolume& GetPlasmaSodiumConcentrationSetPoint(); @@ -449,7 +420,7 @@ class BIOGEARS_API BioGearsConfiguration : public PhysiologyEngineConfiguration virtual SEScalarMassPerTime& GetTargetSodiumDelivery(); protected: - CDM::enumOnOff::value m_RenalEnabled; + SEOnOff m_RenalEnabled; SEScalarMassPerVolume* m_PlasmaSodiumConcentrationSetPoint; SEScalarMassPerVolume* m_PeritubularPotassiumConcentrationSetPoint; @@ -494,11 +465,11 @@ class BIOGEARS_API BioGearsConfiguration : public PhysiologyEngineConfiguration /** Tissue */ ///////////// public: - virtual bool HasEnableTissue() const { return m_TissueEnabled != (CDM::enumOnOff::value)-1; } - virtual bool IsTissueEnabled() const { return m_TissueEnabled == CDM::enumOnOff::On; } - virtual void EnableTissue(CDM::enumOnOff::value s) { m_TissueEnabled = s; } + virtual bool HasEnableTissue() const { return m_TissueEnabled != SEOnOff::Invalid; } + virtual bool IsTissueEnabled() const { return m_TissueEnabled == SEOnOff::On; } + virtual void EnableTissue(SEOnOff s) { m_TissueEnabled = s; } protected: - CDM::enumOnOff::value m_TissueEnabled; + SEOnOff m_TissueEnabled; }; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGearsEngine.h b/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGearsEngine.h index 3e15e4943..35db7d7a9 100644 --- a/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGearsEngine.h +++ b/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGearsEngine.h @@ -55,10 +55,8 @@ class BIOGEARS_API BioGearsEngine : public PhysiologyEngine, public BioGears { virtual bool LoadState(const char* file, const SEScalarTime* simTime = nullptr) override; virtual bool LoadState(const std::string& file, const SEScalarTime* simTime = nullptr) override; - virtual bool LoadState(const CDM::PhysiologyEngineStateData& state, const SEScalarTime* simTime = nullptr) override; virtual bool LoadState(char const* buffer, size_t size) override; - virtual std::unique_ptr GetStateData() override; virtual void SaveStateToFile(const char* file) override; virtual void SaveStateToFile(const std::string& file = "") override; diff --git a/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGearsEnums.h b/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGearsEnums.h new file mode 100644 index 000000000..64f9dd00a --- /dev/null +++ b/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGearsEnums.h @@ -0,0 +1,50 @@ +/************************************************************************************** +Copyright 2019 Applied Research Associates, Inc. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the License +at: +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +**************************************************************************************/ + +#pragma once + +#include + +namespace biogears { + +enum class SEBioGearsAirwayMode { + Invalid = -1, + Free = 0, + AnesthesiaMachine, + Inhaler, + NasalCannula, + MechanicalVentilator +}; + +inline std::string ToString(const SEBioGearsAirwayMode& bit) +{ + switch (bit) { + case SEBioGearsAirwayMode::Free: + return "Free"; + case SEBioGearsAirwayMode::AnesthesiaMachine: + return "AnesthesiaMachine"; + case SEBioGearsAirwayMode::NasalCannula: + return "NasalCannula"; + case SEBioGearsAirwayMode::MechanicalVentilator: + return "MechanicalVentilator"; + default: + return "Invalid"; + } +} + +inline std::ostream& operator<<(std::ostream& os, const SEBioGearsAirwayMode& bit) +{ + os << ToString(bit); + return os; +} + +} diff --git a/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGearsSubstances.h b/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGearsSubstances.h index a99b3be1a..79ad7653b 100644 --- a/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGearsSubstances.h +++ b/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGearsSubstances.h @@ -12,18 +12,15 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #pragma once +#include + +#include #include namespace biogears { class SELiquidCompartment; class SETissueCompartment; -class SEScalarMass; -class SEScalarAmountPerVolume; -class AmountPerVolumeUnit; -class MassUnit; -class SEScalarMassPerVolume; -class MassPerVolumeUnit; class BioGears; @@ -46,17 +43,19 @@ class BIOGEARS_API SizeIndependentDepositionEfficencyCoefficient { double m_alveoli = 0; }; -} //namespace biogears +} // namespace biogears +#pragma warning(disable : 4661) namespace std { -BG_EXT template class BIOGEARS_API map; +extern template class map; } +#pragma warning(default : 4661) namespace biogears { /** -* @brief Manages and initializes all systems with substances needed by %BioGears -*/ + * @brief Manages and initializes all systems with substances needed by %BioGears + */ class BIOGEARS_API BioGearsSubstances : public SESubstanceManager { friend class BioGearsEngineTest; @@ -64,12 +63,13 @@ class BIOGEARS_API BioGearsSubstances : public SESubstanceManager { BioGearsSubstances(BioGears& data); virtual ~BioGearsSubstances(); - virtual void Clear(); + void Invalidate() override; - virtual bool LoadSubstanceDirectory(); - virtual void InitializeSubstances(); + bool LoadSubstanceDirectory() override; + void InitializeSubstances(); - virtual void AddActiveSubstance(SESubstance& substance); + void AddActiveSubstance(SESubstance& substance) override; + SESubstance* AddActiveSubstance(SESubstanceDefinition const& substance) override; virtual bool IsActive(const SESubstance& sub) const; inline SESubstance& GetO2() { return *m_O2; } @@ -121,12 +121,12 @@ class BIOGEARS_API BioGearsSubstances : public SESubstanceManager { void ProbeBloodGases(SELiquidCompartment& cmpt, const std::string& prefix = ""); protected: - virtual void InitializeGasCompartments(); - virtual void InitializeLiquidCompartmentGases(); - virtual void InitializeLiquidCompartmentNonGases(); + void InitializeGasCompartments(); + void InitializeLiquidCompartmentGases(); + void InitializeLiquidCompartmentNonGases(); - virtual void InitializeBloodGases(SETissueCompartment& tissue, SELiquidCompartment& vascular); - virtual void InitializeBloodGases(SELiquidCompartment& cmpt, double Hb_total_mM, double O2_sat, double O2_mmol_Per_L, double CO2_sat, double CO2_mmol_Per_L, double HCO3_mmol_Per_L, double pH, bool distribute = true); + void InitializeBloodGases(SETissueCompartment& tissue, SELiquidCompartment& vascular); + void InitializeBloodGases(SELiquidCompartment& cmpt, double Hb_total_mM, double O2_sat, double O2_mmol_Per_L, double CO2_sat, double CO2_mmol_Per_L, double HCO3_mmol_Per_L, double pH, bool distribute = true); void SetSubstanceMolarity(SESubstance&, const std::vector&, const SEScalarAmountPerVolume& molarity); void SetSubstanceMolarity(SESubstance&, const std::vector&, const SEScalarAmountPerVolume& molarity); @@ -138,7 +138,7 @@ class BIOGEARS_API BioGearsSubstances : public SESubstanceManager { void SetSubstanceConcentration(SESubstance&, const std::vector&, const SEScalarMassPerVolume& extracellular, const SEScalarMassPerVolume& intracellular); // Common Substances - //Substances + // Substances SESubstance* m_O2; SESubstance* m_CO; SESubstance* m_CO2; diff --git a/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGearsSystem.h b/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGearsSystem.h index 4aa36eb6b..55c30f087 100644 --- a/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGearsSystem.h +++ b/projects/biogears/libBiogears/include/biogears/engine/Controller/BioGearsSystem.h @@ -25,14 +25,35 @@ class BIOGEARS_API BioGearsSystem { public: /** - * @brief - Default system values to their homeostatic values - */ + * @brief - Default system values to their homeostatic values + */ + static size_t constexpr ALL_SYSTEMS_AND_EQUIPMENT_PRESENT = 0x7FFF; + + static size_t constexpr ANESTHESIA_NACHINE_EQUIPMENT = 0x1 << 12; + static size_t constexpr ELECTRO_CARDIO_GRAM_EQUIPMENT = 0x1 << 13; + static size_t constexpr INHALER_EQUIPMENT = 0x1 << 14; + + static size_t constexpr ENVIRONMENT_SYSTEM = 0x1 << 11; + static size_t constexpr TISSUE_SYSTEM = 0x1 << 10; + static size_t constexpr RESPIRATORY_SYSTEM = 0x1 << 9; + static size_t constexpr RENAL_SYSTEM = 0x1 << 8; + + static size_t constexpr NERVOUS_SYSTEM = 0x1 << 7; + static size_t constexpr HEPTIC_SYSTEM = 0x1 << 6; + static size_t constexpr GASTROINTESTINAL_SYSTEM = 0x1 << 5; + static size_t constexpr ENERGY_SYSTEM = 0x1 << 4; + + static size_t constexpr ENDOCRINE_SYSTEM = 0x1 << 3; + static size_t constexpr DRUG_SYSTEM = 0x1 << 2; + static size_t constexpr CARDIOVASCULAR_SYSTEM = 0x1 << 1; + static size_t constexpr BLOOD_CHEMISTRY_SYSTEM = 0x1 << 0; + virtual void Initialize() { SetUp(); } /// Notify systems that steady state has been achieved - virtual void AtSteadyState(){}; + virtual void AtSteadyState() {}; virtual void PreProcess() = 0; virtual void Process() = 0; virtual void PostProcess() = 0; @@ -44,4 +65,4 @@ class BIOGEARS_API BioGearsSystem { SetUp(); } }; -} \ No newline at end of file +} diff --git a/projects/biogears/libBiogears/include/biogears/engine/Equipment/AnesthesiaMachine.h b/projects/biogears/libBiogears/include/biogears/engine/Equipment/AnesthesiaMachine.h index 990a3c5c6..ac7f27891 100644 --- a/projects/biogears/libBiogears/include/biogears/engine/Equipment/AnesthesiaMachine.h +++ b/projects/biogears/libBiogears/include/biogears/engine/Equipment/AnesthesiaMachine.h @@ -17,8 +17,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include -#include +#include namespace biogears { class BioGears; @@ -53,18 +52,12 @@ class BIOGEARS_API AnesthesiaMachine : public SEAnesthesiaMachine, public BioGea const char* classname() const override { return TypeTag(); } size_t hash_code() const override { return TypeHash(); } - void Clear() override; + void Invalidate() override; // Set members to a stable homeostatic state void Initialize() override; - // Load a state - virtual bool Load(const CDM::BioGearsAnesthesiaMachineData& in); - virtual CDM::BioGearsAnesthesiaMachineData* Unload() const override; - protected: - virtual void Unload(CDM::BioGearsAnesthesiaMachineData& data) const; - // Set pointers and other member varialbes common to both homeostatic initialization and loading a state void SetUp() override; @@ -79,7 +72,7 @@ class BIOGEARS_API AnesthesiaMachine : public SEAnesthesiaMachine, public BioGea // Extending some functionality to these base class methods // We will update the BioGears Airway mode when these are called - void SetConnection(CDM::enumAnesthesiaMachineConnection::value c) override; + void SetConnection(SEAnesthesiaMachineConnection c) override; void InvalidateConnection() override; private: @@ -93,11 +86,11 @@ class BIOGEARS_API AnesthesiaMachine : public SEAnesthesiaMachine, public BioGea void CheckReliefValve(); // Serializable member variables (Set in Initialize and in schema) - bool m_inhaling; - SEScalarTime m_inspirationTime; - SEScalar m_O2InletVolumeFraction; - SEScalarTime m_currentbreathingCycleTime; - SEScalarTime m_totalBreathingCycleTime; + bool m_Inhaling; + SEScalarTime m_InspirationTime; + SEScalar m_OxygenInletVolumeFraction; + SEScalarTime m_CurrentBreathingCycleTime; + SEScalarTime m_TotalBreathingCycleTime; // Stateless member variable (Set in SetUp()) double m_dt_s; diff --git a/projects/biogears/libBiogears/include/biogears/engine/Equipment/ECG.h b/projects/biogears/libBiogears/include/biogears/engine/Equipment/ECG.h index 85c45e97a..f63cc733e 100644 --- a/projects/biogears/libBiogears/include/biogears/engine/Equipment/ECG.h +++ b/projects/biogears/libBiogears/include/biogears/engine/Equipment/ECG.h @@ -16,7 +16,6 @@ specific language governing permissions and limitations under the License. #include #include -#include #include #include @@ -47,18 +46,12 @@ class ECG : public SEElectroCardioGram, public BioGearsSystem { BIOGEARS_API const char* classname() const override { return TypeTag(); } BIOGEARS_API size_t hash_code() const override { return TypeHash(); } - BIOGEARS_API void Clear() override; + BIOGEARS_API void Invalidate() override; // Set members to a stable homeostatic state BIOGEARS_API void Initialize() override; - // Load a state - virtual bool Load(const CDM::BioGearsElectroCardioGramData& in); - virtual CDM::BioGearsElectroCardioGramData* Unload() const override; - protected: - virtual void Unload(CDM::BioGearsElectroCardioGramData& data) const; - // Set pointers and other member varialbes common to both homeostatic initialization and loading a state BIOGEARS_API void SetUp() override; diff --git a/projects/biogears/libBiogears/include/biogears/engine/Equipment/Inhaler.h b/projects/biogears/libBiogears/include/biogears/engine/Equipment/Inhaler.h index ba9625a44..a0dd0ce74 100644 --- a/projects/biogears/libBiogears/include/biogears/engine/Equipment/Inhaler.h +++ b/projects/biogears/libBiogears/include/biogears/engine/Equipment/Inhaler.h @@ -16,7 +16,6 @@ specific language governing permissions and limitations under the License. #include #include -#include namespace biogears { /** @@ -51,18 +50,13 @@ class BIOGEARS_API Inhaler : public SEInhaler, public BioGearsSystem { const char* classname() const override { return TypeTag(); } size_t hash_code() const override { return TypeHash(); } - void Clear() override; + void Invalidate() override; // Set members to a stable homeostatic state void Initialize() override; - // Load a state - bool Load(const CDM::BioGearsInhalerData& in); - CDM::BioGearsInhalerData* Unload() const override; protected: - void Unload(CDM::BioGearsInhalerData& data) const; - // Set pointers and other member varialbes common to both homeostatic initialization and loading a state void SetUp() override; diff --git a/projects/biogears/libBiogears/include/biogears/engine/Systems/BloodChemistry.h b/projects/biogears/libBiogears/include/biogears/engine/Systems/BloodChemistry.h index 6fd6b969d..d26e4adaf 100644 --- a/projects/biogears/libBiogears/include/biogears/engine/Systems/BloodChemistry.h +++ b/projects/biogears/libBiogears/include/biogears/engine/Systems/BloodChemistry.h @@ -14,11 +14,14 @@ specific language governing permissions and limitations under the License. #include #include +#include +#include #include +#include #include #include #include -#include + namespace biogears { class SEArterialBloodGasAnalysis; @@ -59,18 +62,12 @@ class BIOGEARS_API BloodChemistry : public SEBloodChemistrySystem, public BioGea const char* classname() const override { return TypeTag(); } size_t hash_code() const override { return TypeHash(); } - void Clear() override; + void Invalidate() override; // Set members to a stable homeostatic state void Initialize() override; - // Load a state - bool Load(const CDM::BioGearsBloodChemistrySystemData& in); - CDM::BioGearsBloodChemistrySystemData* Unload() const override; - protected: - void Unload(CDM::BioGearsBloodChemistrySystemData& data) const; - // Set pointers and other member variables common to both homeostatic initialization and loading a state void SetUp() override; @@ -93,22 +90,21 @@ class BIOGEARS_API BloodChemistry : public SEBloodChemistrySystem, public BioGea void CheckViralSymptoms(); void CheckBloodSubstanceLevels(); void InflammatoryResponse(); - void ManageSIRS(); //SIRS = Systemic Inflammatory Response Syndrome - + void ManageSIRS(); // SIRS = Systemic Inflammatory Response Syndrome - //Override + // Override void ProcessOverride(); void OverrideControlLoop(); // Serializable member variables (Set in Initialize and in schema) - RunningAverage m_ArterialOxygen_mmHg; - RunningAverage m_ArterialCarbonDioxide_mmHg; + RunningAverage m_ArterialOxygenAverage_mmHg; + RunningAverage m_ArterialCarbonDioxideAverage_mmHg; // Patient SEPatient* m_Patient; SEPatientActionCollection* m_PatientActions; - //substances + // substances SESubstance* m_Ondansetron; // Stateless member variable (Set in SetUp()) @@ -152,7 +148,7 @@ class BIOGEARS_API BloodChemistry : public SEBloodChemistrySystem, public BioGea SELiquidSubstanceQuantity* m_venaCavaTriacylglycerol; SELiquidSubstanceQuantity* m_venaCavaUrea; - //radiation model parameters, first sets are growing within the marrow and thymus + // radiation model parameters, first sets are growing within the marrow and thymus double m_progenitorLymphocytes_ct; double m_progenitorLymphocytes_wd_ct; double m_progenitorLymphocytes_d_ct; @@ -162,14 +158,14 @@ class BIOGEARS_API BloodChemistry : public SEBloodChemistrySystem, public BioGea double m_maturingLymphocytes_d_ct; double m_maturingLymphocytes_hd_ct; - //circulating counts + // circulating counts double m_Lymphocytes_ct; double m_Lymphocytes_d_ct; double m_Lymphocytes_hd_ct; - //track radiation + // track radiation double m_radAbsorbed_Gy; - //Initialize HTR concentrations + // Initialize HTR concentrations double m_donorRBC_ct; double m_patientRBC_ct; double m_2Agglutinate_ct; diff --git a/projects/biogears/libBiogears/include/biogears/engine/Systems/Cardiovascular.h b/projects/biogears/libBiogears/include/biogears/engine/Systems/Cardiovascular.h index 4f536304f..d5ab04cb9 100644 --- a/projects/biogears/libBiogears/include/biogears/engine/Systems/Cardiovascular.h +++ b/projects/biogears/libBiogears/include/biogears/engine/Systems/Cardiovascular.h @@ -20,7 +20,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include + namespace biogears { class SELiquidCompartmentGraph; @@ -65,21 +65,15 @@ class BIOGEARS_API Cardiovascular : public SECardiovascularSystem, public BioGea const char* classname() const override { return TypeTag(); } size_t hash_code() const override { return TypeHash(); } - void Clear() override; + void Invalidate() override; // Set members to a stable homeostatic state void Initialize() override; - // Load a state - virtual bool Load(const CDM::BioGearsCardiovascularSystemData& in); - virtual CDM::BioGearsCardiovascularSystemData* Unload() const override; - //Assessments SEScalar& CalculateCardiovascularSOFA(); protected: - virtual void Unload(CDM::BioGearsCardiovascularSystemData& data) const; - // Set pointers and other member variables common to both homeostatic initialization and loading a state void SetUp() override; @@ -112,6 +106,7 @@ class BIOGEARS_API Cardiovascular : public SECardiovascularSystem, public BioGea /**/ void CPR(); /****/ void CalculateAndSetCPRcompressionForce(); /**/ void Hemorrhage(); + /**/ void Amputation(); /**/ void PericardialEffusion(); /**/ void PericardialEffusionPressureApplication(); /**/ void CardiacArrest(); diff --git a/projects/biogears/libBiogears/include/biogears/engine/Systems/Drugs.h b/projects/biogears/libBiogears/include/biogears/engine/Systems/Drugs.h index a4af7e0fe..2f557407f 100644 --- a/projects/biogears/libBiogears/include/biogears/engine/Systems/Drugs.h +++ b/projects/biogears/libBiogears/include/biogears/engine/Systems/Drugs.h @@ -17,7 +17,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include + namespace biogears { class SETissueCompartment; @@ -32,12 +32,14 @@ namespace io { class BiogearsPhysiology; } } +#pragma warning(disable : 4661) namespace std { -BG_EXT template class BIOGEARS_API map; -BG_EXT template class BIOGEARS_API map; -BG_EXT template class BIOGEARS_API map; +extern template class map; +extern template class map; +extern template class map; } +#pragma warning(default : 4661) namespace biogears { class BioGears; @@ -66,18 +68,12 @@ class BIOGEARS_API Drugs : public SEDrugSystem, public BioGearsSystem { const char* classname() const override { return TypeTag(); } size_t hash_code() const override { return TypeHash(); } - void Clear() override; + void Invalidate() override; // Set members to a stable homeostatic state void Initialize() override; - // Load a state - virtual bool Load(const CDM::BioGearsDrugSystemData& in); - virtual CDM::BioGearsDrugSystemData* Unload() const override; - protected: - virtual void Unload(CDM::BioGearsDrugSystemData& data) const; - // Set pointers and other member varialbes common to both homeostatic initialization and loading a state void SetUp() override; diff --git a/projects/biogears/libBiogears/include/biogears/engine/Systems/Endocrine.h b/projects/biogears/libBiogears/include/biogears/engine/Systems/Endocrine.h index f8beb0a1c..ab715c3a0 100644 --- a/projects/biogears/libBiogears/include/biogears/engine/Systems/Endocrine.h +++ b/projects/biogears/libBiogears/include/biogears/engine/Systems/Endocrine.h @@ -17,7 +17,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include + namespace biogears { class SELiquidSubstanceQuantity; @@ -50,18 +50,12 @@ class BIOGEARS_API Endocrine : public SEEndocrineSystem, public BioGearsSystem { const char* classname() const override { return TypeTag(); } size_t hash_code() const override { return TypeHash(); } - void Clear() override; + void Invalidate() override; // Set members to a stable homeostatic state void Initialize() override; - // Load a state - virtual bool Load(const CDM::BioGearsEndocrineSystemData& in); - virtual CDM::BioGearsEndocrineSystemData* Unload() const override; - protected: - virtual void Unload(CDM::BioGearsEndocrineSystemData& data) const; - // Set pointers and other member variables common to both homeostatic initialization and loading a state void SetUp() override; diff --git a/projects/biogears/libBiogears/include/biogears/engine/Systems/Energy.h b/projects/biogears/libBiogears/include/biogears/engine/Systems/Energy.h index fada0f282..d771a5082 100644 --- a/projects/biogears/libBiogears/include/biogears/engine/Systems/Energy.h +++ b/projects/biogears/libBiogears/include/biogears/engine/Systems/Energy.h @@ -18,7 +18,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include + namespace biogears { class SEPatient; @@ -55,18 +55,12 @@ class BIOGEARS_API Energy : public SEEnergySystem, public BioGearsSystem { const char* classname() const override { return TypeTag(); } size_t hash_code() const override { return TypeHash(); } - void Clear() override; + void Invalidate() override; // Set members to a stable homeostatic state void Initialize() override; - // Load a state - virtual bool Load(const CDM::BioGearsEnergySystemData& in); - virtual CDM::BioGearsEnergySystemData* Unload() const override; - protected: - virtual void Unload(CDM::BioGearsEnergySystemData& data) const; - // Set pointers and other member variables common to both homeostatic initialization and loading a state void SetUp() override; diff --git a/projects/biogears/libBiogears/include/biogears/engine/Systems/Environment.h b/projects/biogears/libBiogears/include/biogears/engine/Systems/Environment.h index b8ebb6dec..2b9edbc83 100644 --- a/projects/biogears/libBiogears/include/biogears/engine/Systems/Environment.h +++ b/projects/biogears/libBiogears/include/biogears/engine/Systems/Environment.h @@ -14,9 +14,10 @@ specific language governing permissions and limitations under the License. #include #include +#include +#include #include #include -#include #include "Saturation.h" namespace biogears { @@ -53,18 +54,12 @@ class BIOGEARS_API Environment : public SEEnvironment, public BioGearsSystem { const char* classname() const override { return TypeTag(); } size_t hash_code() const override { return TypeHash(); } - void Clear() override; + void Invalidate() override; // Set members to a stable homeostatic state void Initialize() override; - // Load a state - virtual bool Load(const CDM::BioGearsEnvironmentData& in); - virtual CDM::BioGearsEnvironmentData* Unload() const override; - protected: - virtual void Unload(CDM::BioGearsEnvironmentData& data) const; - // Set pointers and other member varialbes common to both homeostatic initialization and loading a state void SetUp() override; diff --git a/projects/biogears/libBiogears/include/biogears/engine/Systems/Gastrointestinal.h b/projects/biogears/libBiogears/include/biogears/engine/Systems/Gastrointestinal.h index f53baa39a..3f6c7c426 100644 --- a/projects/biogears/libBiogears/include/biogears/engine/Systems/Gastrointestinal.h +++ b/projects/biogears/libBiogears/include/biogears/engine/Systems/Gastrointestinal.h @@ -18,7 +18,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include + namespace biogears { class SELiquidCompartment; @@ -29,10 +29,12 @@ namespace io { class BiogearsPhysiology; } } +#pragma warning(disable : 4661) namespace std { -BG_EXT template class BIOGEARS_API map; +extern template class map; } +#pragma warning(default : 4661) namespace biogears { /** @@ -56,19 +58,13 @@ class BIOGEARS_API Gastrointestinal : public SEGastrointestinalSystem, public Bi const char* classname() const override { return TypeTag(); } size_t hash_code() const override { return TypeHash(); } - void Clear() override; + void Invalidate() override; // Set members to a stable homeostatic state void Initialize() override; - // Load a state - virtual bool Load(const CDM::BioGearsGastrointestinalSystemData& in); - virtual CDM::BioGearsGastrointestinalSystemData* Unload() const override; - protected: - virtual void Unload(CDM::BioGearsGastrointestinalSystemData& data) const; - - // Set pointers and other member variables common to both homeostatic initialization and loading a state + // Set pointers and other member variables common to both homeostatic initialization and loading a state void SetUp() override; public: diff --git a/projects/biogears/libBiogears/include/biogears/engine/Systems/Hepatic.h b/projects/biogears/libBiogears/include/biogears/engine/Systems/Hepatic.h index 5b8a4722a..a9a463725 100644 --- a/projects/biogears/libBiogears/include/biogears/engine/Systems/Hepatic.h +++ b/projects/biogears/libBiogears/include/biogears/engine/Systems/Hepatic.h @@ -16,7 +16,7 @@ specific language governing permissions and limitations under the License. #include #include -#include + namespace biogears { class SETissueSystem; @@ -52,21 +52,16 @@ class BIOGEARS_API Hepatic : public SEHepaticSystem, public BioGearsSystem { const char* classname() const override { return TypeTag(); } size_t hash_code() const override { return TypeHash(); } - void Clear() override; + void Invalidate() override; // Set members to a stable homeostatic state void Initialize() override; - // Load a state - virtual bool Load(const CDM::BioGearsHepaticSystemData& in); - virtual CDM::BioGearsHepaticSystemData* Unload() const override; //Assessments SEScalar& CalculateLiverSOFA(); protected: - virtual void Unload(CDM::BioGearsHepaticSystemData& data) const; - // Set pointers and other member variables common to both homeostatic initialization and loading a state void SetUp() override; diff --git a/projects/biogears/libBiogears/include/biogears/engine/Systems/Nervous.h b/projects/biogears/libBiogears/include/biogears/engine/Systems/Nervous.h index 70f5f2575..caa5b78c7 100644 --- a/projects/biogears/libBiogears/include/biogears/engine/Systems/Nervous.h +++ b/projects/biogears/libBiogears/include/biogears/engine/Systems/Nervous.h @@ -16,7 +16,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include + #include @@ -50,23 +50,17 @@ class BIOGEARS_API Nervous : public SENervousSystem, public BioGearsSystem { const char* classname() const override { return TypeTag(); } size_t hash_code() const override { return TypeHash(); } - void Clear() override; + void Invalidate() override; // Set members to a stable homeostatic state void Initialize() override; - // Load a state - virtual bool Load(const CDM::BioGearsNervousSystemData& in); - virtual CDM::BioGearsNervousSystemData* Unload() const override; - //Assessments SEScalar& CalculateCentralNervousSOFA(); int GlasgowEstimator(double cbf); protected: - virtual void Unload(CDM::BioGearsNervousSystemData& data) const; - // Set pointers and other member variables common to both homeostatic initialization and loading a state void SetUp() override; diff --git a/projects/biogears/libBiogears/include/biogears/engine/Systems/Renal.h b/projects/biogears/libBiogears/include/biogears/engine/Systems/Renal.h index 7fe2fb114..e8729fd3e 100644 --- a/projects/biogears/libBiogears/include/biogears/engine/Systems/Renal.h +++ b/projects/biogears/libBiogears/include/biogears/engine/Systems/Renal.h @@ -18,7 +18,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include + namespace biogears { class SEUrinalysis; @@ -57,19 +57,13 @@ class BIOGEARS_API Renal : public SERenalSystem, public BioGearsSystem { const char* classname() const override { return TypeTag(); } size_t hash_code() const override { return TypeHash(); } - void Clear() override; + void Invalidate() override; // Set members to a stable homeostatic state void Initialize() override; - // Load a state - virtual bool Load(const CDM::BioGearsRenalSystemData& in); - virtual CDM::BioGearsRenalSystemData* Unload() const override; - protected: - virtual void Unload(CDM::BioGearsRenalSystemData& data) const; - - // Set pointers and other member varialbes common to both homeostatic initialization and loading a state + // Set pointers and other member varialbes common to both homeostatic initialization and loading a state void SetUp() override; public: @@ -125,138 +119,138 @@ class BIOGEARS_API Renal : public SERenalSystem, public BioGearsSystem { // Serializable member variables (Set in Initialize and in schema) bool m_Urinating; //Tubuloglomerular Feedback - double m_leftAfferentResistance_mmHg_s_Per_mL; - double m_rightAfferentResistance_mmHg_s_Per_mL; - double m_leftSodiumFlowSetPoint_mg_Per_s; - double m_rightSodiumFlowSetPoint_mg_Per_s; + double m_LeftAfferentResistance_mmHg_s_Per_mL; + double m_RightAfferentResistance_mmHg_s_Per_mL; + double m_LeftSodiumFlowSetPoint_mg_Per_s; + double m_RightSodiumFlowSetPoint_mg_Per_s; //Events - RunningAverage m_urineProductionRate_mL_Per_min_runningAvg; - RunningAverage m_urineOsmolarity_mOsm_Per_L_runningAvg; - RunningAverage m_sodiumConcentration_mg_Per_mL_runningAvg; - RunningAverage m_sodiumExcretionRate_mg_Per_min_runningAvg; - RunningAverage m_leftSodiumFlow_mg_Per_s_runningAvg; - RunningAverage m_rightSodiumFlow_mg_Per_s_runningAvg; - RunningAverage m_leftRenalArterialPressure_mmHg_runningAvg; - RunningAverage m_rightRenalArterialPressure_mmHg_runningAvg; + RunningAverage m_UrineProductionRate_mL_Per_min; + RunningAverage m_UrineOsmolarity_mOsm_Per_L; + RunningAverage m_SodiumConcentration_mg_Per_mL; + RunningAverage m_SodiumExcretionRate_mg_Per_min; + RunningAverage m_LeftSodiumFlow_mg_Per_s; + RunningAverage m_RightSodiumFlow_mg_Per_s; + RunningAverage m_LeftRenalArterialPressure_mmHg; + RunningAverage m_RightRenalArterialPressure_mmHg; // Stateless member variable (Set in SetUp()) - SEPatient* m_patient; + SEPatient* m_Patient; //Circuits SEFluidCircuit* m_RenalCircuit; //Nodes - SEFluidCircuitNode* m_leftGlomerularNode; - SEFluidCircuitNode* m_leftBowmansNode; - SEFluidCircuitNode* m_leftPeritubularNode; - SEFluidCircuitNode* m_leftTubulesNode; - SEFluidCircuitNode* m_leftRenalArteryNode; - SEFluidCircuitNode* m_rightGlomerularNode; - SEFluidCircuitNode* m_rightBowmansNode; - SEFluidCircuitNode* m_rightPeritubularNode; - SEFluidCircuitNode* m_rightTubulesNode; - SEFluidCircuitNode* m_rightRenalArteryNode; - SEFluidCircuitNode* m_bladderNode; - SEFluidCircuitNode* m_leftNetGlomerularCapillariesNode; - SEFluidCircuitNode* m_leftNetBowmansCapsulesNode; - SEFluidCircuitNode* m_leftNetPeritubularCapillariesNode; - SEFluidCircuitNode* m_leftNetTubulesNode; - SEFluidCircuitNode* m_rightNetGlomerularCapillariesNode; - SEFluidCircuitNode* m_rightNetBowmansCapsulesNode; - SEFluidCircuitNode* m_rightNetPeritubularCapillariesNode; - SEFluidCircuitNode* m_rightNetTubulesNode; + SEFluidCircuitNode* m_LeftGlomerularNode; + SEFluidCircuitNode* m_LeftBowmansNode; + SEFluidCircuitNode* m_LeftPeritubularNode; + SEFluidCircuitNode* m_LeftTubulesNode; + SEFluidCircuitNode* m_LeftRenalArteryNode; + SEFluidCircuitNode* m_RightGlomerularNode; + SEFluidCircuitNode* m_RightBowmansNode; + SEFluidCircuitNode* m_RightPeritubularNode; + SEFluidCircuitNode* m_RightTubulesNode; + SEFluidCircuitNode* m_RightRenalArteryNode; + SEFluidCircuitNode* m_BladderNode; + SEFluidCircuitNode* m_LeftNetGlomerularCapillariesNode; + SEFluidCircuitNode* m_LeftNetBowmansCapsulesNode; + SEFluidCircuitNode* m_LeftNetPeritubularCapillariesNode; + SEFluidCircuitNode* m_LeftNetTubulesNode; + SEFluidCircuitNode* m_RightNetGlomerularCapillariesNode; + SEFluidCircuitNode* m_RightNetBowmansCapsulesNode; + SEFluidCircuitNode* m_RightNetPeritubularCapillariesNode; + SEFluidCircuitNode* m_RightNetTubulesNode; //Paths - SEFluidCircuitPath* m_leftGlomerularOsmoticSourcePath; - SEFluidCircuitPath* m_leftBowmansOsmoticSourcePath; - SEFluidCircuitPath* m_leftReabsorptionResistancePath; - SEFluidCircuitPath* m_leftTubulesOsmoticSourcePath; - SEFluidCircuitPath* m_leftPeritubularOsmoticSourcePath; - SEFluidCircuitPath* m_leftUreterPath; - SEFluidCircuitPath* m_leftGlomerularFilterResistancePath; - SEFluidCircuitPath* m_leftAfferentArteriolePath; - SEFluidCircuitPath* m_rightReabsorptionResistancePath; - SEFluidCircuitPath* m_rightGlomerularOsmoticSourcePath; - SEFluidCircuitPath* m_rightBowmansOsmoticSourcePath; - SEFluidCircuitPath* m_rightTubulesOsmoticSourcePath; - SEFluidCircuitPath* m_rightPeritubularOsmoticSourcePath; - SEFluidCircuitPath* m_rightUreterPath; - SEFluidCircuitPath* m_rightGlomerularFilterResistancePath; - SEFluidCircuitPath* m_rightAfferentArteriolePath; - SEFluidCircuitPath* m_bladderToGroundPressurePath; - SEFluidCircuitPath* m_urethraPath; - SEFluidCircuitPath* m_leftTubulesPath; - SEFluidCircuitPath* m_rightTubulesPath; - SEFluidCircuitPath* m_leftEfferentArteriolePath; - SEFluidCircuitPath* m_rightEfferentArteriolePath; + SEFluidCircuitPath* m_LeftGlomerularOsmoticSourcePath; + SEFluidCircuitPath* m_LeftBowmansOsmoticSourcePath; + SEFluidCircuitPath* m_LeftReabsorptionResistancePath; + SEFluidCircuitPath* m_LeftTubulesOsmoticSourcePath; + SEFluidCircuitPath* m_LeftPeritubularOsmoticSourcePath; + SEFluidCircuitPath* m_LeftUreterPath; + SEFluidCircuitPath* m_LeftGlomerularFilterResistancePath; + SEFluidCircuitPath* m_LeftAfferentArteriolePath; + SEFluidCircuitPath* m_RightReabsorptionResistancePath; + SEFluidCircuitPath* m_RightGlomerularOsmoticSourcePath; + SEFluidCircuitPath* m_RightBowmansOsmoticSourcePath; + SEFluidCircuitPath* m_RightTubulesOsmoticSourcePath; + SEFluidCircuitPath* m_RightPeritubularOsmoticSourcePath; + SEFluidCircuitPath* m_RightUreterPath; + SEFluidCircuitPath* m_RightGlomerularFilterResistancePath; + SEFluidCircuitPath* m_RightAfferentArteriolePath; + SEFluidCircuitPath* m_BladderToGroundPressurePath; + SEFluidCircuitPath* m_UrethraPath; + SEFluidCircuitPath* m_LeftTubulesPath; + SEFluidCircuitPath* m_RightTubulesPath; + SEFluidCircuitPath* m_LeftEfferentArteriolePath; + SEFluidCircuitPath* m_RightEfferentArteriolePath; //Substances - SESubstance* m_albumin; - SESubstance* m_sodium; - SESubstance* m_urea; - SESubstance* m_glucose; - SESubstance* m_lactate; - SESubstance* m_potassium; + SESubstance* m_Albumin; + SESubstance* m_Sodium; + SESubstance* m_Urea; + SESubstance* m_Glucose; + SESubstance* m_Lactate; + SESubstance* m_Potassium; //Compartments - SELiquidCompartment* m_aorta; - SELiquidCompartment* m_venaCava; - SELiquidCompartment* m_bladder; - SETissueCompartment* m_rightKidneyTissue; - SETissueCompartment* m_leftKidneyTissue; - SELiquidCompartment* m_leftUreter; - SELiquidCompartment* m_leftPeritubular; - SELiquidCompartment* m_rightUreter; - SELiquidCompartment* m_rightPeritubular; - SELiquidCompartment* m_leftGlomerular; - SELiquidCompartment* m_leftBowmans; - SELiquidCompartment* m_rightGlomerular; - SELiquidCompartment* m_rightBowmans; - SELiquidCompartment* m_leftTubules; - SELiquidCompartment* m_rightTubules; - SELiquidCompartment* m_ground; + SELiquidCompartment* m_Aorta; + SELiquidCompartment* m_VenaCava; + SELiquidCompartment* m_Bladder; + SETissueCompartment* m_RightKidneyTissue; + SETissueCompartment* m_LeftKidneyTissue; + SELiquidCompartment* m_LeftUreter; + SELiquidCompartment* m_LeftPeritubular; + SELiquidCompartment* m_RightUreter; + SELiquidCompartment* m_RightPeritubular; + SELiquidCompartment* m_LeftGlomerular; + SELiquidCompartment* m_LeftBowmans; + SELiquidCompartment* m_RightGlomerular; + SELiquidCompartment* m_RightBowmans; + SELiquidCompartment* m_LeftTubules; + SELiquidCompartment* m_RightTubules; + SELiquidCompartment* m_Ground; // Compartment Substance Quantites - SELiquidSubstanceQuantity* m_aortaLactate; + SELiquidSubstanceQuantity* m_AortaLactate; - SELiquidSubstanceQuantity* m_leftPeritubularGlucose; - SELiquidSubstanceQuantity* m_leftPeritubularPotassium; - SELiquidSubstanceQuantity* m_leftUreterPotassium; - SELiquidSubstanceQuantity* m_leftUreterLactate; + SELiquidSubstanceQuantity* m_LeftPeritubularGlucose; + SELiquidSubstanceQuantity* m_LeftPeritubularPotassium; + SELiquidSubstanceQuantity* m_LeftUreterPotassium; + SELiquidSubstanceQuantity* m_LeftUreterLactate; - SELiquidSubstanceQuantity* m_rightPeritubularGlucose; - SELiquidSubstanceQuantity* m_rightPeritubularPotassium; - SELiquidSubstanceQuantity* m_rightUreterPotassium; - SELiquidSubstanceQuantity* m_rightUreterLactate; + SELiquidSubstanceQuantity* m_RightPeritubularGlucose; + SELiquidSubstanceQuantity* m_RightPeritubularPotassium; + SELiquidSubstanceQuantity* m_RightUreterPotassium; + SELiquidSubstanceQuantity* m_RightUreterLactate; - SELiquidSubstanceQuantity* m_bladderGlucose; - SELiquidSubstanceQuantity* m_bladderPotassium; - SELiquidSubstanceQuantity* m_bladderAlbumin; - SELiquidSubstanceQuantity* m_bladderSodium; - SELiquidSubstanceQuantity* m_bladderUrea; - SELiquidSubstanceQuantity* m_leftTubulesSodium; - SELiquidSubstanceQuantity* m_rightTubulesSodium; + SELiquidSubstanceQuantity* m_BladderGlucose; + SELiquidSubstanceQuantity* m_BladderPotassium; + SELiquidSubstanceQuantity* m_BladderAlbumin; + SELiquidSubstanceQuantity* m_BladderSodium; + SELiquidSubstanceQuantity* m_BladderUrea; + SELiquidSubstanceQuantity* m_LeftTubulesSodium; + SELiquidSubstanceQuantity* m_RightTubulesSodium; - SELiquidSubstanceQuantity* m_leftKidneyIntracellularLactate; - SELiquidSubstanceQuantity* m_rightKidneyIntracellularLactate; + SELiquidSubstanceQuantity* m_LeftKidneyIntracellularLactate; + SELiquidSubstanceQuantity* m_RightKidneyIntracellularLactate; // Configuration - double m_defaultOpenResistance_mmHg_s_Per_mL; - double m_defaultClosedResistance_mmHg_s_Per_mL; + double m_DefaultOpenResistance_mmHg_s_Per_mL; + double m_DefaultClosedResistance_mmHg_s_Per_mL; // Ultrafiltration double m_CVOpenResistance_mmHg_s_Per_mL; // Tubuloglomerular Feedback - double m_maxLeftAfferentResistance_mmHg_s_Per_mL; - double m_minLeftAfferentResistance_mmHg_s_Per_mL; - double m_maxRightAfferentResistance_mmHg_s_Per_mL; - double m_minRightAfferentResistance_mmHg_s_Per_mL; + double m_MaxLeftAfferentResistance_mmHg_s_Per_mL; + double m_MinLeftAfferentResistance_mmHg_s_Per_mL; + double m_MaxRightAfferentResistance_mmHg_s_Per_mL; + double m_MinRightAfferentResistance_mmHg_s_Per_mL; // Osmoreceptor Feedback - double m_leftReabsorptionPermeabilityModificationFactor; - double m_rightReabsorptionPermeabilityModificationFactor; - double m_sodiumPlasmaConcentrationSetpoint_mg_Per_mL; + double m_LeftReabsorptionPermeabilityModificationFactor; + double m_RightReabsorptionPermeabilityModificationFactor; + double m_SodiumPlasmaConcentrationSetpoint_mg_Per_mL; // Secretion - double m_baselinePotassiumConcentration_g_Per_dL; + double m_BaselinePotassiumConcentration_g_Per_dL; // Reabsorption - double m_leftReabsorptionPermeabilitySetpoint_mL_Per_s_mmHg_m2; - double m_rightReabsorptionPermeabilitySetpoint_mL_Per_s_mmHg_m2; + double m_LeftReabsorptionPermeabilitySetpoint_mL_Per_s_mmHg_m2; + double m_RightReabsorptionPermeabilitySetpoint_mL_Per_s_mmHg_m2; // Utility/ScratchPads - SEScalarMass m_spCleared; + SEScalarMass m_SPCleared; ActiveTransport m_SubstanceTransport; }; diff --git a/projects/biogears/libBiogears/include/biogears/engine/Systems/Respiratory.h b/projects/biogears/libBiogears/include/biogears/engine/Systems/Respiratory.h index 9c427fd04..38a02ad5a 100644 --- a/projects/biogears/libBiogears/include/biogears/engine/Systems/Respiratory.h +++ b/projects/biogears/libBiogears/include/biogears/engine/Systems/Respiratory.h @@ -20,7 +20,6 @@ specific language governing permissions and limitations under the License. #include #include #include -#include namespace biogears { class SEPulmonaryFunctionTest; @@ -71,17 +70,11 @@ class BIOGEARS_API Respiratory : public SERespiratorySystem, public BioGearsSyst const char* classname() const override { return TypeTag(); } size_t hash_code() const override { return TypeHash(); } - void Clear() override; + void Invalidate() override; // Set members to a stable homeostatic state void Initialize() override; - // Load a state - virtual bool Load(const CDM::BioGearsRespiratorySystemData& in); - virtual CDM::BioGearsRespiratorySystemData* Unload() const override; - -protected: - virtual void Unload(CDM::BioGearsRespiratorySystemData& data) const; // Set pointers and other member varialbes common to both homeostatic initialization and loading a state void SetUp() override; @@ -135,6 +128,9 @@ class BIOGEARS_API Respiratory : public SERespiratorySystem, public BioGearsSyst // Pneumothorax void DoLeftNeedleDecompression(double dFlowResistance); void DoRightNeedleDecompression(double dFlowResistance); + void DoLeftChestTube(double ctFlowResistance); + void DoRightChestTube(double ctFlowResistance); + void AdjustPleuralCavity(); // Aerosol Deposition and various Effects void ProcessAerosolSubstances(); @@ -168,8 +164,8 @@ class BIOGEARS_API Respiratory : public SERespiratorySystem, public BioGearsSyst bool m_BreathingCycle; double m_ArterialO2PartialPressure_mmHg; double m_ArterialCO2PartialPressure_mmHg; - RunningAverage m_ArterialO2Average_mmHg; - RunningAverage m_ArterialCO2Average_mmHg; + RunningAverage m_ArterialOxygenAverage_mmHg; + RunningAverage m_ArterialCarbonDioxideAverage_mmHg; double m_BreathingCycleTime_s; double m_BreathTimeExhale_min; double m_DefaultDrivePressure_cmH2O; @@ -231,6 +227,7 @@ class BIOGEARS_API Respiratory : public SERespiratorySystem, public BioGearsSyst SEGasCompartment* m_RightLung; SEGasCompartment* m_Lungs; SEGasCompartment* m_Trachea; + SEGasCompartment* m_pleuralCavity; SEGasSubstanceQuantity* m_TracheaO2; SEGasSubstanceQuantity* m_TracheaCO2; SELiquidSubstanceQuantity* m_AortaO2; diff --git a/projects/biogears/libBiogears/include/biogears/engine/Systems/Saturation.h b/projects/biogears/libBiogears/include/biogears/engine/Systems/Saturation.h index 22d93c0b3..14cf888b8 100644 --- a/projects/biogears/libBiogears/include/biogears/engine/Systems/Saturation.h +++ b/projects/biogears/libBiogears/include/biogears/engine/Systems/Saturation.h @@ -18,6 +18,7 @@ specific language governing permissions and limitations under the License. #include #include +#include namespace biogears { struct error_functor; @@ -26,7 +27,7 @@ class SELiquidCompartment; class SELiquidSubstanceQuantity; class BioGears; class SEScalarFraction; -class SEScalarTemperature; + /** * @brief diff --git a/projects/biogears/libBiogears/include/biogears/engine/Systems/Tissue.h b/projects/biogears/libBiogears/include/biogears/engine/Systems/Tissue.h index 8409a954b..0a3207579 100644 --- a/projects/biogears/libBiogears/include/biogears/engine/Systems/Tissue.h +++ b/projects/biogears/libBiogears/include/biogears/engine/Systems/Tissue.h @@ -19,10 +19,11 @@ specific language governing permissions and limitations under the License. #include #include +#include #include #include #include -#include + namespace biogears { class SESubstance; @@ -38,13 +39,15 @@ namespace io { class BiogearsPhysiology; } } +#pragma warning(disable : 4661) namespace std { -BG_EXT template class BIOGEARS_API map; -BG_EXT template class BIOGEARS_API map; -BG_EXT template class BIOGEARS_API map; -BG_EXT template class BIOGEARS_API vector; +extern template class map; +extern template class map; +extern template class map; +extern template class vector; } +#pragma warning(default : 4661) namespace biogears { /** @@ -72,17 +75,12 @@ class BIOGEARS_API Tissue : public SETissueSystem, public BioGearsSystem { const char* classname() const override { return TypeTag(); } size_t hash_code() const override { return TypeHash(); } - void Clear() override; + void Invalidate() override; // Set members to a stable homeostatic state void Initialize() override; - // Load a state - virtual bool Load(const CDM::BioGearsTissueSystemData& in); - virtual CDM::BioGearsTissueSystemData* Unload() const override; - protected: - virtual void Unload(CDM::BioGearsTissueSystemData& data) const; // Set pointers and other member variables common to both homeostatic initialization and loading a state void SetUp() override; @@ -102,7 +100,6 @@ class BIOGEARS_API Tissue : public SETissueSystem, public BioGearsSystem { void FatStorageAndRelease(); // Process Methods - double CalculateBurnIntensity(double burnTBSA, CDM::enumBurnDegree::value degreeOfBurn) const; void CalculateCompartmentalBurn(); void CalculateDiffusion(); void CalculatePulmonaryCapillarySubstanceTransfer(); diff --git a/projects/biogears/libBiogears/src/cdm/Serializer.cpp b/projects/biogears/libBiogears/src/cdm/Serializer.cpp index 3487632f4..a06dd730f 100644 --- a/projects/biogears/libBiogears/src/cdm/Serializer.cpp +++ b/projects/biogears/libBiogears/src/cdm/Serializer.cpp @@ -16,6 +16,8 @@ specific language governing permissions and limitations under the License. #include #include +#include + //Project Includes #include @@ -105,12 +107,17 @@ bool ErrorHandler::handleError(const xercesc::DOMError& err) char* uri(xercesc::XMLString::transcode(loc->getURI())); char* msg(xercesc::XMLString::transcode(err.getMessage())); + std::stringstream error_; + error_.str() = ""; error_ << uri << ":" << loc->getLineNumber() << ":" << loc->getColumnNumber() << " " << (warn ? "warning: " : "error: ") << msg << std::ends; /// \error Invalid schema file - std::cerr << std::flush << error_.str() << "\n" << err.getRelatedData() << "\n" << err.getRelatedException() << std::endl; - + std::cerr << std::flush << uri << ":" << loc->getLineNumber() << ":" << loc->getColumnNumber() << " " + << (warn ? "warning: " : "error: ") << msg << "\n" + << err.getRelatedData() << "\n" << err.getRelatedException() << std::endl; + + xercesc::XMLString::release(&uri); xercesc::XMLString::release(&msg); @@ -329,6 +336,7 @@ std::unique_ptr Serializer::ReadBuffer(XMLByte const* buffer, s } else { std::cerr << err.str(); } + err.str() = ""; return std::unique_ptr(); } // Let's see what kind of object this is @@ -339,35 +347,35 @@ std::unique_ptr Serializer::ReadBuffer(XMLByte const* buffer, s std::unique_ptr obj = std::unique_ptr(); // Check the name and read it into the right object type if (name.compare("Substance") == 0) - return std::unique_ptr((CDM::ObjectData*)CDM::Substance(*doc).release()); + return std::unique_ptr(CDM::Substance(*doc).release()); if (name.compare("Patient") == 0) - return std::unique_ptr((CDM::ObjectData*)CDM::Patient(*doc).release()); + return std::unique_ptr(CDM::Patient(*doc).release()); if (name.compare("SubstanceCompound") == 0) - return std::unique_ptr((CDM::ObjectData*)CDM::SubstanceCompound(*doc).release()); + return std::unique_ptr(CDM::SubstanceCompound(*doc).release()); if (name.compare("Scenario") == 0) - return std::unique_ptr((CDM::ObjectData*)CDM::Scenario(*doc).release()); + return std::unique_ptr(CDM::Scenario(*doc).release()); if (name.compare("EnvironmentalConditions") == 0) - return std::unique_ptr((CDM::ObjectData*)CDM::EnvironmentalConditions(*doc).release()); + return std::unique_ptr(CDM::EnvironmentalConditions(*doc).release()); if (name.compare("ElectroCardioGramWaveformInterpolator") == 0) - return std::unique_ptr((CDM::ObjectData*)CDM::ElectroCardioGramWaveformInterpolator(*doc).release()); + return std::unique_ptr(CDM::ElectroCardioGramWaveformInterpolator(*doc).release()); if (name.compare("Nutrition") == 0) - return std::unique_ptr((CDM::ObjectData*)CDM::Nutrition(*doc).release()); + return std::unique_ptr(CDM::Nutrition(*doc).release()); if (name.compare("PhysiologyEngineDynamicStabilization") == 0) - return std::unique_ptr((CDM::ObjectData*)CDM::PhysiologyEngineDynamicStabilization(*doc).release()); + return std::unique_ptr(CDM::PhysiologyEngineDynamicStabilization(*doc).release()); if (name.compare("PhysiologyEngineTimedStabilization") == 0) - return std::unique_ptr((CDM::ObjectData*)CDM::PhysiologyEngineTimedStabilization(*doc).release()); + return std::unique_ptr(CDM::PhysiologyEngineTimedStabilization(*doc).release()); if (name.compare("CircuitManager") == 0) - return std::unique_ptr((CDM::ObjectData*)CDM::CircuitManager(*doc).release()); + return std::unique_ptr(CDM::CircuitManager(*doc).release()); if (name.compare("CompartmentManager") == 0) - return std::unique_ptr((CDM::ObjectData*)CDM::CompartmentManager(*doc).release()); + return std::unique_ptr(CDM::CompartmentManager(*doc).release()); if (name.compare("BioGearsConfiguration") == 0) - return std::unique_ptr((CDM::ObjectData*)CDM::BioGearsConfiguration(*doc).release()); + return std::unique_ptr(CDM::BioGearsConfiguration(*doc).release()); if (name.compare("BioGearsState") == 0) - return std::unique_ptr((CDM::ObjectData*)CDM::BioGearsState(*doc).release()); + return std::unique_ptr(CDM::BioGearsState(*doc).release()); if (name.compare("DataRequests") == 0) - return std::unique_ptr((CDM::ObjectData*)CDM::DataRequests(*doc).release()); + return std::unique_ptr(CDM::DataRequests(*doc).release()); if (name.compare("Actions") == 0) - return std::unique_ptr((CDM::ObjectData*)CDM::Actions(*doc).release()); + return std::unique_ptr(CDM::Actions(*doc).release()); /// \error Unsupported root tag err << "Unsupported root tag " << name << " found in buffer" << std::ends; @@ -376,6 +384,7 @@ std::unique_ptr Serializer::ReadBuffer(XMLByte const* buffer, s } else { std::cerr << err.str(); } + err.str() = ""; return obj; } diff --git a/projects/biogears/libBiogears/src/cdm/circuit/SECircuit.cpp b/projects/biogears/libBiogears/src/cdm/circuit/SECircuit.cpp new file mode 100644 index 000000000..6a7a957eb --- /dev/null +++ b/projects/biogears/libBiogears/src/cdm/circuit/SECircuit.cpp @@ -0,0 +1,17 @@ +#include +#include + +#include + +#include +#include +#include + +namespace biogears { + +template class SECircuit; +template class SECircuit; +template class SECircuit; + +} + diff --git a/projects/biogears/libBiogears/src/cdm/circuit/SECircuitCalculator.cpp b/projects/biogears/libBiogears/src/cdm/circuit/SECircuitCalculator.cpp index a828ba7f8..16620edd0 100644 --- a/projects/biogears/libBiogears/src/cdm/circuit/SECircuitCalculator.cpp +++ b/projects/biogears/libBiogears/src/cdm/circuit/SECircuitCalculator.cpp @@ -11,12 +11,10 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include - namespace biogears { // Note this must match the enum values -template <> -char const* enumStrings::values[] = { "Direct", "PartialPivLu", "FullPivLu", "JacobiSvd", "HouseholderQr", "Ldlt", "Llt", "SparseLU", "SparseQR", "BiCGSTAB", "ConjugateGradient" }; + char const* EigenCircuitSolver::Value(size_t idx) { - return enumStrings::values[idx]; + return ToString( (EigenCircuitSolver::Type)idx ); }} diff --git a/projects/biogears/libBiogears/src/engine/Controller/BioGearsInterCircuitConnections_h b/projects/biogears/libBiogears/src/cdm/circuit/SECircuitLedger.cpp similarity index 55% rename from projects/biogears/libBiogears/src/engine/Controller/BioGearsInterCircuitConnections_h rename to projects/biogears/libBiogears/src/cdm/circuit/SECircuitLedger.cpp index 4bc0a17f8..bfc7d045c 100644 --- a/projects/biogears/libBiogears/src/engine/Controller/BioGearsInterCircuitConnections_h +++ b/projects/biogears/libBiogears/src/cdm/circuit/SECircuitLedger.cpp @@ -10,27 +10,8 @@ CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **************************************************************************************/ -#pragma once -class BioGears; -#include "Serializer.h" -#include "circuit/SECircuitContainer.h" +#include namespace biogears { -class BIOGEARS_API BioGearsInterCircuitConnections : public SECircuitContainer { -public: - BioGearsInterCircuitConnections(BioGears& data); - virtual ~BioGearsInterCircuitConnections(); - void Reset(); - void Clear(); - bool IsValid(); - - bool LoadInterCircuitConnections(const std::string& circuitFile, Serializer& serlializer); - - SEInterCircuitConnection* GetRespiratoryAnesthesiaMachineInterCircuitConnection(); - -protected: - BioGears* m_Data; - SEInterCircuitConnection* m_RespiratoryAnesthesiaMachineInterCircuitConnection; -}; } \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/cdm/circuit/SECircuitManager.cpp b/projects/biogears/libBiogears/src/cdm/circuit/SECircuitManager.cpp index 54600256e..fd1f15ba0 100644 --- a/projects/biogears/libBiogears/src/cdm/circuit/SECircuitManager.cpp +++ b/projects/biogears/libBiogears/src/cdm/circuit/SECircuitManager.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Circuit.h" #include #include #include @@ -18,9 +19,9 @@ specific language governing permissions and limitations under the License. namespace biogears { -template class SECircuitLedger; -template class SECircuitLedger; -template class SECircuitLedger; +template class SECircuitLedger; +template class SECircuitLedger; +template class SECircuitLedger; SECircuitManager::SECircuitManager(Logger* logger) : Loggable(logger) @@ -29,109 +30,16 @@ SECircuitManager::SECircuitManager(Logger* logger) //------------------------------------------------------------------------------- SECircuitManager::~SECircuitManager() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SECircuitManager::Clear() +void SECircuitManager::Invalidate() { - m_ElectricalLedger.Clear(); - m_FluidLedger.Clear(); - m_ThermalLedger.Clear(); + m_ElectricalLedger.Invalidate(); + m_FluidLedger.Invalidate(); + m_ThermalLedger.Invalidate(); } -//------------------------------------------------------------------------------- -bool SECircuitManager::Load(const CDM::CircuitManagerData& in) -{ - Clear(); - for (const CDM::ElectricalCircuitNodeData& n : in.ElectricalNode()) { - CreateNode(n.Name(), m_ElectricalLedger).Load(n); - } - for (const CDM::ElectricalCircuitPathData& p : in.ElectricalPath()) { - SEElectricalCircuitNode* src = GetNode(p.SourceNode(), m_ElectricalLedger); - if (src == nullptr) { - Error(std::string { "Could not find source node " } + std::string { p.SourceNode() } + " from path " + p.Name().c_str()); - return false; - } - SEElectricalCircuitNode* tgt = GetNode(p.TargetNode(), m_ElectricalLedger); - if (tgt == nullptr) { - Error(std::string { "Could not find target node " } + std::string { p.TargetNode() } + " from path " + p.Name().c_str()); - return false; - } - CreatePath(*src, *tgt, p.Name(), m_ElectricalLedger).Load(p); - } - for (const CDM::ElectricalCircuitData& c : in.ElectricalCircuit()) { - CreateCircuit(c.Name(), m_ElectricalLedger).Load(c, m_ElectricalLedger.nodes, m_ElectricalLedger.paths); - } - for (const CDM::FluidCircuitNodeData& n : in.FluidNode()) { - CreateNode(n.Name(), m_FluidLedger).Load(n); - } - for (const CDM::FluidCircuitPathData& p : in.FluidPath()) { - SEFluidCircuitNode* src = GetNode(p.SourceNode(), m_FluidLedger); - if (src == nullptr) { - Error(std::string { "Could not find source node " } + std::string { p.SourceNode() } + " from path " + p.Name().c_str()); - return false; - } - SEFluidCircuitNode* tgt = GetNode(p.TargetNode(), m_FluidLedger); - if (tgt == nullptr) { - Error(std::string { "Could not find target node " } + std::string { p.TargetNode() } + " from path " + p.Name().c_str()); - return false; - } - CreatePath(*src, *tgt, p.Name(), m_FluidLedger).Load(p); - } - for (const CDM::FluidCircuitData& c : in.FluidCircuit()) { - CreateCircuit(c.Name(), m_FluidLedger).Load(c, m_FluidLedger.nodes, m_FluidLedger.paths); - } - for (const CDM::ThermalCircuitNodeData& n : in.ThermalNode()) { - CreateNode(n.Name(), m_ThermalLedger).Load(n); - } - for (const CDM::ThermalCircuitPathData& p : in.ThermalPath()) { - SEThermalCircuitNode* src = GetNode(p.SourceNode(), m_ThermalLedger); - if (src == nullptr) { - Error(std::string { "Could not find source node " } + std::string { p.SourceNode() } + " from path " + p.Name().c_str()); - return false; - } - SEThermalCircuitNode* tgt = GetNode(p.TargetNode(), m_ThermalLedger); - if (tgt == nullptr) { - Error(std::string { "Could not find target node " } + std::string { p.TargetNode() } + " from path " + p.Name().c_str()); - return false; - } - CreatePath(*src, *tgt, p.Name(), m_ThermalLedger).Load(p); - } - for (const CDM::ThermalCircuitData& c : in.ThermalCircuit()) { - CreateCircuit(c.Name(), m_ThermalLedger).Load(c, m_ThermalLedger.nodes, m_ThermalLedger.paths); - } - return true; -} -//------------------------------------------------------------------------------- -CDM::CircuitManagerData* SECircuitManager::Unload() const -{ - CDM::CircuitManagerData* data = new CDM::CircuitManagerData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SECircuitManager::Unload(CDM::CircuitManagerData& data) const -{ - for (auto itr : m_ElectricalLedger.nodes) - data.ElectricalNode().push_back(std::unique_ptr(itr.second->Unload())); - for (auto itr : m_ElectricalLedger.paths) - data.ElectricalPath().push_back(std::unique_ptr(itr.second->Unload())); - for (auto itr : m_ElectricalLedger.circuits) - data.ElectricalCircuit().push_back(std::unique_ptr(itr.second->Unload())); - - for (auto itr : m_FluidLedger.nodes) - data.FluidNode().push_back(std::unique_ptr(itr.second->Unload())); - for (auto itr : m_FluidLedger.paths) - data.FluidPath().push_back(std::unique_ptr(itr.second->Unload())); - for (auto itr : m_FluidLedger.circuits) - data.FluidCircuit().push_back(std::unique_ptr(itr.second->Unload())); - for (auto itr : m_ThermalLedger.nodes) - data.ThermalNode().push_back(std::unique_ptr(itr.second->Unload())); - for (auto itr : m_ThermalLedger.paths) - data.ThermalPath().push_back(std::unique_ptr(itr.second->Unload())); - for (auto itr : m_ThermalLedger.circuits) - data.ThermalCircuit().push_back(std::unique_ptr(itr.second->Unload())); -} //------------------------------------------------------------------------------- void SECircuitManager::SetReadOnly(bool b) { diff --git a/projects/biogears/libBiogears/src/cdm/circuit/SECircuitNode.cpp b/projects/biogears/libBiogears/src/cdm/circuit/SECircuitNode.cpp index ee311bb56..0ffcfa0d4 100644 --- a/projects/biogears/libBiogears/src/cdm/circuit/SECircuitNode.cpp +++ b/projects/biogears/libBiogears/src/cdm/circuit/SECircuitNode.cpp @@ -1,5 +1,7 @@ -#include +#include +#include +#include namespace biogears { template class SECircuitNode; diff --git a/projects/biogears/libBiogears/src/cdm/circuit/SECircuitPath.cpp b/projects/biogears/libBiogears/src/cdm/circuit/SECircuitPath.cpp index cdb3f3352..24b43541b 100644 --- a/projects/biogears/libBiogears/src/cdm/circuit/SECircuitPath.cpp +++ b/projects/biogears/libBiogears/src/cdm/circuit/SECircuitPath.cpp @@ -1,6 +1,6 @@ #include - -#include +#include +#include namespace biogears { diff --git a/projects/biogears/libBiogears/src/cdm/circuit/electrical/SEElectricalCircuit.cpp b/projects/biogears/libBiogears/src/cdm/circuit/electrical/SEElectricalCircuit.cpp index 9cb8ef190..6b6439d26 100644 --- a/projects/biogears/libBiogears/src/cdm/circuit/electrical/SEElectricalCircuit.cpp +++ b/projects/biogears/libBiogears/src/cdm/circuit/electrical/SEElectricalCircuit.cpp @@ -10,27 +10,30 @@ CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **************************************************************************************/ -#include #include +#include "io/cdm/Circuit.h" +#include +#include + namespace std { - template class vector; - template class vector; - template class map*>; - template class map; +template class vector; +template class vector; +template class map*>; +template class map; } namespace biogears { -template class SECircuit; +template class SECircuit; SEElectricalCircuit::SEElectricalCircuit(const std::string& name, SECircuitManager& mgr) - : SECircuit(name, mgr.GetLogger()) + : SECircuit(name, mgr.GetLogger()) , m_Mgr(mgr) { } //------------------------------------------------------------------------------- SEElectricalCircuit::SEElectricalCircuit(const char* name, SECircuitManager& mgr) - : SECircuit(name, mgr.GetLogger()) + : SECircuit(name, mgr.GetLogger()) , m_Mgr(mgr) { } diff --git a/projects/biogears/libBiogears/src/cdm/circuit/electrical/SEElectricalCircuitNode.cpp b/projects/biogears/libBiogears/src/cdm/circuit/electrical/SEElectricalCircuitNode.cpp index 2bed82600..8dd9e61e3 100644 --- a/projects/biogears/libBiogears/src/cdm/circuit/electrical/SEElectricalCircuitNode.cpp +++ b/projects/biogears/libBiogears/src/cdm/circuit/electrical/SEElectricalCircuitNode.cpp @@ -12,6 +12,8 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/Circuit.h" + namespace biogears { SEElectricalCircuitNode::SEElectricalCircuitNode(const char* name, Logger* logger) : SECircuitNode(name, logger) @@ -27,49 +29,10 @@ SEElectricalCircuitNode::~SEElectricalCircuitNode() { } //------------------------------------------------------------------------------- -void SEElectricalCircuitNode::Clear() -{ - SECircuitNode::Clear(); -} -//------------------------------------------------------------------------------- -bool SEElectricalCircuitNode::Load(const CDM::ElectricalCircuitNodeData& in) +void SEElectricalCircuitNode::Invalidate() { - SECircuitNode::Load(in); - if (in.Voltage().present()) - GetVoltage().Load(in.Voltage().get()); - if (in.NextVoltage().present()) - GetNextVoltage().Load(in.NextVoltage().get()); - if (in.Charge().present()) - GetCharge().Load(in.Charge().get()); - if (in.NextCharge().present()) - GetNextCharge().Load(in.NextCharge().get()); - if (in.ChargeBaseline().present()) - GetChargeBaseline().Load(in.ChargeBaseline().get()); - return true; + SECircuitNode::Invalidate(); } -//------------------------------------------------------------------------------- -CDM::ElectricalCircuitNodeData* SEElectricalCircuitNode::Unload() const -{ - CDM::ElectricalCircuitNodeData* data = new CDM::ElectricalCircuitNodeData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEElectricalCircuitNode::Unload(CDM::ElectricalCircuitNodeData& data) const -{ - SECircuitNode::Unload(data); - if (HasVoltage()) - data.Voltage(std::unique_ptr(m_Potential->Unload())); - if (HasNextVoltage()) - data.NextVoltage(std::unique_ptr(m_NextPotential->Unload())); - if (HasCharge()) - data.Charge(std::unique_ptr(m_Quantity->Unload())); - if (HasNextCharge()) - data.NextCharge(std::unique_ptr(m_NextQuantity->Unload())); - if (HasChargeBaseline()) - data.ChargeBaseline(std::unique_ptr(m_QuantityBaseline->Unload())); -} - //------------------------------------------------------------------------------- bool SEElectricalCircuitNode::HasVoltage() const { diff --git a/projects/biogears/libBiogears/src/cdm/circuit/electrical/SEElectricalCircuitPath.cpp b/projects/biogears/libBiogears/src/cdm/circuit/electrical/SEElectricalCircuitPath.cpp index a47a67c72..13d38c933 100644 --- a/projects/biogears/libBiogears/src/cdm/circuit/electrical/SEElectricalCircuitPath.cpp +++ b/projects/biogears/libBiogears/src/cdm/circuit/electrical/SEElectricalCircuitPath.cpp @@ -12,7 +12,12 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/Circuit.h" + namespace biogears { + + template class SECircuitPath; + SEElectricalCircuitPath::SEElectricalCircuitPath(SEElectricalCircuitNode& src, SEElectricalCircuitNode& tgt, const char* name) : SECircuitPath(src, tgt, name) , m_ElectricalSourceNode(src) @@ -29,98 +34,9 @@ SEElectricalCircuitPath::~SEElectricalCircuitPath() { } -void SEElectricalCircuitPath::Clear() +void SEElectricalCircuitPath::Invalidate() { - SECircuitPath::Clear(); -} - -bool SEElectricalCircuitPath::Load(const CDM::ElectricalCircuitPathData& in) -{ - SECircuitPath::Load(in); - if (in.Resistance().present()) - GetResistance().Load(in.Resistance().get()); - if (in.NextResistance().present()) - GetNextResistance().Load(in.NextResistance().get()); - if (in.ResistanceBaseline().present()) - GetResistanceBaseline().Load(in.ResistanceBaseline().get()); - if (in.Capacitance().present()) - GetCapacitance().Load(in.Capacitance().get()); - if (in.NextCapacitance().present()) - GetNextCapacitance().Load(in.NextCapacitance().get()); - if (in.CapacitanceBaseline().present()) - GetCapacitanceBaseline().Load(in.CapacitanceBaseline().get()); - if (in.Inductance().present()) - GetInductance().Load(in.Inductance().get()); - if (in.NextInductance().present()) - GetNextInductance().Load(in.NextInductance().get()); - if (in.InductanceBaseline().present()) - GetInductanceBaseline().Load(in.InductanceBaseline().get()); - if (in.Current().present()) - GetCurrent().Load(in.Current().get()); - if (in.NextCurrent().present()) - GetNextCurrent().Load(in.NextCurrent().get()); - if (in.CurrentSource().present()) - GetCurrentSource().Load(in.CurrentSource().get()); - if (in.NextCurrentSource().present()) - GetNextCurrentSource().Load(in.NextCurrentSource().get()); - if (in.CurrentSourceBaseline().present()) - GetCurrentSourceBaseline().Load(in.CurrentSourceBaseline().get()); - if (in.VoltageSource().present()) - GetVoltageSource().Load(in.VoltageSource().get()); - if (in.NextVoltageSource().present()) - GetNextVoltageSource().Load(in.NextVoltageSource().get()); - if (in.VoltageSourceBaseline().present()) - GetVoltageSourceBaseline().Load(in.VoltageSourceBaseline().get()); - if (in.ValveBreakdownVoltage().present()) - GetValveBreakdownVoltage().Load(in.ValveBreakdownVoltage().get()); - - return HasValidElements(); -} -CDM::ElectricalCircuitPathData* SEElectricalCircuitPath::Unload() const -{ - CDM::ElectricalCircuitPathData* data = new CDM::ElectricalCircuitPathData(); - Unload(*data); - return data; -} -void SEElectricalCircuitPath::Unload(CDM::ElectricalCircuitPathData& data) const -{ - SECircuitPath::Unload(data); - if (HasResistance()) - data.Resistance(std::unique_ptr(m_Resistance->Unload())); - if (HasNextResistance()) - data.NextResistance(std::unique_ptr(m_NextResistance->Unload())); - if (HasResistanceBaseline()) - data.ResistanceBaseline(std::unique_ptr(m_ResistanceBaseline->Unload())); - if (HasCapacitance()) - data.Capacitance(std::unique_ptr(m_Capacitance->Unload())); - if (HasNextCapacitance()) - data.NextCapacitance(std::unique_ptr(m_NextCapacitance->Unload())); - if (HasCapacitanceBaseline()) - data.CapacitanceBaseline(std::unique_ptr(m_CapacitanceBaseline->Unload())); - if (HasInductance()) - data.Inductance(std::unique_ptr(m_Inductance->Unload())); - if (HasNextInductance()) - data.NextInductance(std::unique_ptr(m_NextInductance->Unload())); - if (HasInductanceBaseline()) - data.InductanceBaseline(std::unique_ptr(m_InductanceBaseline->Unload())); - if (HasCurrent()) - data.Current(std::unique_ptr(m_Flux->Unload())); - if (HasNextCurrent()) - data.NextCurrent(std::unique_ptr(m_NextFlux->Unload())); - if (HasCurrentSource()) - data.CurrentSource(std::unique_ptr(m_FluxSource->Unload())); - if (HasNextCurrentSource()) - data.NextCurrentSource(std::unique_ptr(m_NextFluxSource->Unload())); - if (HasCurrentSourceBaseline()) - data.CurrentSourceBaseline(std::unique_ptr(m_FluxSourceBaseline->Unload())); - if (HasVoltageSource()) - data.VoltageSource(std::unique_ptr(m_PotentialSource->Unload())); - if (HasNextVoltageSource()) - data.NextVoltageSource(std::unique_ptr(m_NextPotentialSource->Unload())); - if (HasVoltageSourceBaseline()) - data.VoltageSourceBaseline(std::unique_ptr(m_PotentialSourceBaseline->Unload())); - if (HasValveBreakdownVoltage()) - data.ValveBreakdownVoltage(std::unique_ptr(m_ValveBreakdownPotential->Unload())); + SECircuitPath::Invalidate(); } //////////////////////////////// diff --git a/projects/biogears/libBiogears/src/cdm/circuit/fluid/SEFluidCircuit.cpp b/projects/biogears/libBiogears/src/cdm/circuit/fluid/SEFluidCircuit.cpp index 30a0004f8..f27e9ce73 100644 --- a/projects/biogears/libBiogears/src/cdm/circuit/fluid/SEFluidCircuit.cpp +++ b/projects/biogears/libBiogears/src/cdm/circuit/fluid/SEFluidCircuit.cpp @@ -10,9 +10,14 @@ CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **************************************************************************************/ -#include #include +#include "io/cdm/Circuit.h" +#include +#include +#include +#include + namespace std { template class vector; template class vector; @@ -20,24 +25,24 @@ template class map; } namespace biogears { -template class SECircuit; SEFluidCircuit::SEFluidCircuit(const char* name, SECircuitManager& mgr) - : SECircuit(name, mgr.GetLogger()) + : SECircuit(name, mgr.GetLogger()) , m_Mgr(mgr) { } //----------------------------------------------------------------------------- SEFluidCircuit::SEFluidCircuit(const std::string& name, SECircuitManager& mgr) - : SECircuit(name, mgr.GetLogger()) + : SECircuit(name, mgr.GetLogger()) , m_Mgr(mgr) { } //----------------------------------------------------------------------------- SEFluidCircuit::~SEFluidCircuit() { - Clear(); + Invalidate(); } + //----------------------------------------------------------------------------- SEFluidCircuitNode& SEFluidCircuit::CreateNode(const char* name) { @@ -77,4 +82,4 @@ void SEFluidCircuit::AddCircuit(SEFluidCircuit& circuit) AddReferenceNode(*node); } //----------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/projects/biogears/libBiogears/src/cdm/circuit/fluid/SEFluidCircuitNode.cpp b/projects/biogears/libBiogears/src/cdm/circuit/fluid/SEFluidCircuitNode.cpp index b600380ce..605d56f4e 100644 --- a/projects/biogears/libBiogears/src/cdm/circuit/fluid/SEFluidCircuitNode.cpp +++ b/projects/biogears/libBiogears/src/cdm/circuit/fluid/SEFluidCircuitNode.cpp @@ -12,6 +12,8 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/Circuit.h" + namespace biogears { SEFluidCircuitNode::SEFluidCircuitNode(const char* name, Logger* logger) : SECircuitNode(std::string{ name }, logger) @@ -25,50 +27,12 @@ SEFluidCircuitNode::SEFluidCircuitNode(const std::string& name, Logger* logger) //----------------------------------------------------------------------------- SEFluidCircuitNode::~SEFluidCircuitNode() { - Clear(); -} -//----------------------------------------------------------------------------- -void SEFluidCircuitNode::Clear() -{ - SECircuitNode::Clear(); -} -//----------------------------------------------------------------------------- -bool SEFluidCircuitNode::Load(const CDM::FluidCircuitNodeData& in) -{ - SECircuitNode::Load(in); - if (in.Pressure().present()) - GetPressure().Load(in.Pressure().get()); - if (in.NextPressure().present()) - GetNextPressure().Load(in.NextPressure().get()); - if (in.Volume().present()) - GetVolume().Load(in.Volume().get()); - if (in.NextVolume().present()) - GetNextVolume().Load(in.NextVolume().get()); - if (in.VolumeBaseline().present()) - GetVolumeBaseline().Load(in.VolumeBaseline().get()); - return true; -} -//----------------------------------------------------------------------------- -CDM::FluidCircuitNodeData* SEFluidCircuitNode::Unload() const -{ - CDM::FluidCircuitNodeData* data = new CDM::FluidCircuitNodeData(); - Unload(*data); - return data; + Invalidate(); } //----------------------------------------------------------------------------- -void SEFluidCircuitNode::Unload(CDM::FluidCircuitNodeData& data) const +void SEFluidCircuitNode::Invalidate() { - SECircuitNode::Unload(data); - if (HasPressure()) - data.Pressure(std::unique_ptr(m_Potential->Unload())); - if (HasNextPressure()) - data.NextPressure(std::unique_ptr(m_NextPotential->Unload())); - if (HasVolume()) - data.Volume(std::unique_ptr(m_Quantity->Unload())); - if (HasNextVolume()) - data.NextVolume(std::unique_ptr(m_NextQuantity->Unload())); - if (HasVolumeBaseline()) - data.VolumeBaseline(std::unique_ptr(m_QuantityBaseline->Unload())); + SECircuitNode::Invalidate(); } //----------------------------------------------------------------------------- bool SEFluidCircuitNode::HasPressure() const diff --git a/projects/biogears/libBiogears/src/cdm/circuit/fluid/SEFluidCircuitPath.cpp b/projects/biogears/libBiogears/src/cdm/circuit/fluid/SEFluidCircuitPath.cpp index 4a22e4074..10e4529f1 100644 --- a/projects/biogears/libBiogears/src/cdm/circuit/fluid/SEFluidCircuitPath.cpp +++ b/projects/biogears/libBiogears/src/cdm/circuit/fluid/SEFluidCircuitPath.cpp @@ -12,127 +12,39 @@ specific language governing permissions and limitations under the License. #include +#include +#include "io/cdm/Circuit.h" + namespace biogears { + +template class SECircuitPath; + SEFluidCircuitPath::SEFluidCircuitPath(SEFluidCircuitNode& src, SEFluidCircuitNode& tgt, const char* name) : SECircuitPath(src, tgt, std::string{ name }) , m_FluidSourceNode(src) , m_FluidTargetNode(tgt) { - m_CardiovascularRegion = (CDM::enumResistancePathType::value)-1; + m_CardiovascularRegion = SEResistancePathType::Invalid; } SEFluidCircuitPath::SEFluidCircuitPath(SEFluidCircuitNode& src, SEFluidCircuitNode& tgt, const std::string& name) : SECircuitPath(src, tgt, name) , m_FluidSourceNode(src) , m_FluidTargetNode(tgt) { - m_CardiovascularRegion = (CDM::enumResistancePathType::value)-1; + m_CardiovascularRegion = SEResistancePathType::Invalid; } SEFluidCircuitPath::~SEFluidCircuitPath() { - Clear(); -} - -void SEFluidCircuitPath::Clear() -{ - SECircuitPath::Clear(); - m_CardiovascularRegion = (CDM::enumResistancePathType::value)-1; + Invalidate(); } -bool SEFluidCircuitPath::Load(const CDM::FluidCircuitPathData& in) -{ - SECircuitPath::Load(in); - if (in.Resistance().present()) - GetResistance().Load(in.Resistance().get()); - if (in.NextResistance().present()) - GetNextResistance().Load(in.NextResistance().get()); - if (in.ResistanceBaseline().present()) - GetResistanceBaseline().Load(in.ResistanceBaseline().get()); - if (in.Compliance().present()) - GetCompliance().Load(in.Compliance().get()); - if (in.NextCompliance().present()) - GetNextCompliance().Load(in.NextCompliance().get()); - if (in.ComplianceBaseline().present()) - GetComplianceBaseline().Load(in.ComplianceBaseline().get()); - if (in.Inertance().present()) - GetInertance().Load(in.Inertance().get()); - if (in.NextInertance().present()) - GetNextInertance().Load(in.NextInertance().get()); - if (in.InertanceBaseline().present()) - GetInertanceBaseline().Load(in.InertanceBaseline().get()); - if (in.Flow().present()) - GetFlow().Load(in.Flow().get()); - if (in.NextFlow().present()) - GetNextFlow().Load(in.NextFlow().get()); - if (in.FlowSource().present()) - GetFlowSource().Load(in.FlowSource().get()); - if (in.NextFlowSource().present()) - GetNextFlowSource().Load(in.NextFlowSource().get()); - if (in.FlowSourceBaseline().present()) - GetFlowSourceBaseline().Load(in.FlowSourceBaseline().get()); - if (in.PressureSource().present()) - GetPressureSource().Load(in.PressureSource().get()); - if (in.NextPressureSource().present()) - GetNextPressureSource().Load(in.NextPressureSource().get()); - if (in.PressureSourceBaseline().present()) - GetPressureSourceBaseline().Load(in.PressureSourceBaseline().get()); - if (in.ValveBreakdownPressure().present()) - GetValveBreakdownPressure().Load(in.ValveBreakdownPressure().get()); - if (in.CardiovascularRegion().present()) - SetCardiovascularRegion(in.CardiovascularRegion().get()); - - return HasValidElements(); -} - -CDM::FluidCircuitPathData* SEFluidCircuitPath::Unload() const +void SEFluidCircuitPath::Invalidate() { - CDM::FluidCircuitPathData* data = new CDM::FluidCircuitPathData(); - Unload(*data); - return data; + SECircuitPath::Invalidate(); + m_CardiovascularRegion = SEResistancePathType::Invalid; } -void SEFluidCircuitPath::Unload(CDM::FluidCircuitPathData& data) const -{ - SECircuitPath::Unload(data); - if (HasResistance()) - data.Resistance(std::unique_ptr(m_Resistance->Unload())); - if (HasNextResistance()) - data.NextResistance(std::unique_ptr(m_NextResistance->Unload())); - if (HasResistanceBaseline()) - data.ResistanceBaseline(std::unique_ptr(m_ResistanceBaseline->Unload())); - if (HasCompliance()) - data.Compliance(std::unique_ptr(m_Capacitance->Unload())); - if (HasNextCompliance()) - data.NextCompliance(std::unique_ptr(m_NextCapacitance->Unload())); - if (HasComplianceBaseline()) - data.ComplianceBaseline(std::unique_ptr(m_CapacitanceBaseline->Unload())); - if (HasInertance()) - data.Inertance(std::unique_ptr(m_Inductance->Unload())); - if (HasNextInertance()) - data.NextInertance(std::unique_ptr(m_NextInductance->Unload())); - if (HasInertanceBaseline()) - data.InertanceBaseline(std::unique_ptr(m_InductanceBaseline->Unload())); - if (HasFlow()) - data.Flow(std::unique_ptr(m_Flux->Unload())); - if (HasNextFlow()) - data.NextFlow(std::unique_ptr(m_NextFlux->Unload())); - if (HasFlowSource()) - data.FlowSource(std::unique_ptr(m_FluxSource->Unload())); - if (HasNextFlowSource()) - data.NextFlowSource(std::unique_ptr(m_NextFluxSource->Unload())); - if (HasFlowSourceBaseline()) - data.FlowSourceBaseline(std::unique_ptr(m_FluxSourceBaseline->Unload())); - if (HasPressureSource()) - data.PressureSource(std::unique_ptr(m_PotentialSource->Unload())); - if (HasNextPressureSource()) - data.NextPressureSource(std::unique_ptr(m_NextPotentialSource->Unload())); - if (HasPressureSourceBaseline()) - data.PressureSourceBaseline(std::unique_ptr(m_PotentialSourceBaseline->Unload())); - if (HasValveBreakdownPressure()) - data.ValveBreakdownPressure(std::unique_ptr(m_ValveBreakdownPotential->Unload())); - if (HasCardiovascularRegion()) - data.CardiovascularRegion(m_CardiovascularRegion); -} //////////////////////////////// // Fluid Resistance Types// @@ -410,18 +322,18 @@ double SEFluidCircuitPath::GetValveBreakdownPressure(const PressureUnit& unit) c } bool SEFluidCircuitPath::HasCardiovascularRegion() const { - return m_CardiovascularRegion == ((CDM::enumResistancePathType::value)-1) ? false : true; + return m_CardiovascularRegion == (SEResistancePathType::Invalid) ? false : true; } -CDM::enumResistancePathType::value SEFluidCircuitPath::GetCardiovascularRegion() const +SEResistancePathType SEFluidCircuitPath::GetCardiovascularRegion() const { return m_CardiovascularRegion; } -void SEFluidCircuitPath::SetCardiovascularRegion(CDM::enumResistancePathType::value pType) +void SEFluidCircuitPath::SetCardiovascularRegion(SEResistancePathType pType) { m_CardiovascularRegion = pType; } void SEFluidCircuitPath::InvalidateCardiovascularRegion() { - m_CardiovascularRegion = (CDM::enumResistancePathType::value)-1; + m_CardiovascularRegion = SEResistancePathType::Invalid; } } \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/cdm/circuit/thermal/SEThermalCircuit.cpp b/projects/biogears/libBiogears/src/cdm/circuit/thermal/SEThermalCircuit.cpp index b9ec1c459..2128ce5c8 100644 --- a/projects/biogears/libBiogears/src/cdm/circuit/thermal/SEThermalCircuit.cpp +++ b/projects/biogears/libBiogears/src/cdm/circuit/thermal/SEThermalCircuit.cpp @@ -10,9 +10,12 @@ CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **************************************************************************************/ -#include #include +#include "io/cdm/Circuit.h" +#include +#include + namespace std { template class vector; template class vector; @@ -22,7 +25,7 @@ template class map; namespace biogears { -template class SECircuit; +template class SECircuit; SEThermalCircuit::SEThermalCircuit(const char* name, SECircuitManager& mgr) : SEThermalCircuit(std::string { name }, mgr) @@ -30,15 +33,16 @@ SEThermalCircuit::SEThermalCircuit(const char* name, SECircuitManager& mgr) } //------------------------------------------------------------------------------- SEThermalCircuit::SEThermalCircuit(const std::string& name, SECircuitManager& mgr) - : SECircuit(name, mgr.GetLogger()) + : SECircuit(name, mgr.GetLogger()) , m_Mgr(mgr) { } //------------------------------------------------------------------------------- SEThermalCircuit::~SEThermalCircuit() { - Clear(); + Invalidate(); } + //------------------------------------------------------------------------------- SEThermalCircuitNode& SEThermalCircuit::CreateNode(const char* name) { diff --git a/projects/biogears/libBiogears/src/cdm/circuit/thermal/SEThermalCircuitCalculator.cpp b/projects/biogears/libBiogears/src/cdm/circuit/thermal/SEThermalCircuitCalculator.cpp index 69c389288..cf3c9151e 100644 --- a/projects/biogears/libBiogears/src/cdm/circuit/thermal/SEThermalCircuitCalculator.cpp +++ b/projects/biogears/libBiogears/src/cdm/circuit/thermal/SEThermalCircuitCalculator.cpp @@ -12,6 +12,8 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/Circuit.h" + namespace biogears { template class SECircuitCalculator; SEThermalCircuitCalculator::SEThermalCircuitCalculator(Logger* logger) diff --git a/projects/biogears/libBiogears/src/cdm/circuit/thermal/SEThermalCircuitNode.cpp b/projects/biogears/libBiogears/src/cdm/circuit/thermal/SEThermalCircuitNode.cpp index bfb1eae90..39f1a84a6 100644 --- a/projects/biogears/libBiogears/src/cdm/circuit/thermal/SEThermalCircuitNode.cpp +++ b/projects/biogears/libBiogears/src/cdm/circuit/thermal/SEThermalCircuitNode.cpp @@ -12,6 +12,8 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/Circuit.h" + namespace biogears { SEThermalCircuitNode::SEThermalCircuitNode(const char* name, Logger* logger) : SEThermalCircuitNode(std::string{ name }, logger) @@ -25,50 +27,12 @@ SEThermalCircuitNode::SEThermalCircuitNode(const std::string& name, Logger* logg //------------------------------------------------------------------------------- SEThermalCircuitNode::~SEThermalCircuitNode() { - Clear(); -} -//------------------------------------------------------------------------------- -void SEThermalCircuitNode::Clear() -{ - SECircuitNode::Clear(); -} -//------------------------------------------------------------------------------- -bool SEThermalCircuitNode::Load(const CDM::ThermalCircuitNodeData& in) -{ - SECircuitNode::Load(in); - if (in.Temperature().present()) - GetTemperature().Load(in.Temperature().get()); - if (in.NextTemperature().present()) - GetNextTemperature().Load(in.NextTemperature().get()); - if (in.Heat().present()) - GetHeat().Load(in.Heat().get()); - if (in.NextHeat().present()) - GetNextHeat().Load(in.NextHeat().get()); - if (in.HeatBaseline().present()) - GetHeatBaseline().Load(in.HeatBaseline().get()); - return true; -} -//------------------------------------------------------------------------------- -CDM::ThermalCircuitNodeData* SEThermalCircuitNode::Unload() const -{ - CDM::ThermalCircuitNodeData* data = new CDM::ThermalCircuitNodeData(); - Unload(*data); - return data; + Invalidate(); } //------------------------------------------------------------------------------- -void SEThermalCircuitNode::Unload(CDM::ThermalCircuitNodeData& data) const +void SEThermalCircuitNode::Invalidate() { - SECircuitNode::Unload(data); - if (HasTemperature()) - data.Temperature(std::unique_ptr(m_Potential->Unload())); - if (HasNextTemperature()) - data.NextTemperature(std::unique_ptr(m_NextPotential->Unload())); - if (HasHeat()) - data.Heat(std::unique_ptr(m_Quantity->Unload())); - if (HasNextHeat()) - data.NextHeat(std::unique_ptr(m_NextQuantity->Unload())); - if (HasHeatBaseline()) - data.HeatBaseline(std::unique_ptr(m_QuantityBaseline->Unload())); + SECircuitNode::Invalidate(); } //------------------------------------------------------------------------------- bool SEThermalCircuitNode::HasTemperature() const diff --git a/projects/biogears/libBiogears/src/cdm/circuit/thermal/SEThermalCircuitPath.cpp b/projects/biogears/libBiogears/src/cdm/circuit/thermal/SEThermalCircuitPath.cpp index 8adf4cc25..956fd8132 100644 --- a/projects/biogears/libBiogears/src/cdm/circuit/thermal/SEThermalCircuitPath.cpp +++ b/projects/biogears/libBiogears/src/cdm/circuit/thermal/SEThermalCircuitPath.cpp @@ -12,7 +12,12 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/Circuit.h" + namespace biogears { + +template class SECircuitPath; + SEThermalCircuitPath::SEThermalCircuitPath(SEThermalCircuitNode& src, SEThermalCircuitNode& tgt, const char* name) :SEThermalCircuitPath(src, tgt, std::string{name}) {} @@ -26,103 +31,12 @@ SEThermalCircuitPath::SEThermalCircuitPath(SEThermalCircuitNode& src, SEThermalC //------------------------------------------------------------------------------- SEThermalCircuitPath::~SEThermalCircuitPath() { - Clear(); -} -//------------------------------------------------------------------------------- -void SEThermalCircuitPath::Clear() -{ - SECircuitPath::Clear(); -} -//------------------------------------------------------------------------------- -bool SEThermalCircuitPath::Load(const CDM::ThermalCircuitPathData& in) -{ - SECircuitPath::Load(in); - if (in.Resistance().present()) - GetResistance().Load(in.Resistance().get()); - if (in.NextResistance().present()) - GetNextResistance().Load(in.NextResistance().get()); - if (in.ResistanceBaseline().present()) - GetResistanceBaseline().Load(in.ResistanceBaseline().get()); - if (in.Capacitance().present()) - GetCapacitance().Load(in.Capacitance().get()); - if (in.NextCapacitance().present()) - GetNextCapacitance().Load(in.NextCapacitance().get()); - if (in.CapacitanceBaseline().present()) - GetCapacitanceBaseline().Load(in.CapacitanceBaseline().get()); - if (in.Inductance().present()) - GetInductance().Load(in.Inductance().get()); - if (in.NextInductance().present()) - GetNextInductance().Load(in.NextInductance().get()); - if (in.InductanceBaseline().present()) - GetInductanceBaseline().Load(in.InductanceBaseline().get()); - if (in.HeatTransferRate().present()) - GetHeatTransferRate().Load(in.HeatTransferRate().get()); - if (in.NextHeatTransferRate().present()) - GetNextHeatTransferRate().Load(in.NextHeatTransferRate().get()); - if (in.HeatSource().present()) - GetHeatSource().Load(in.HeatSource().get()); - if (in.NextHeatSource().present()) - GetNextHeatSource().Load(in.NextHeatSource().get()); - if (in.HeatSourceBaseline().present()) - GetHeatSourceBaseline().Load(in.HeatSourceBaseline().get()); - if (in.TemperatureSource().present()) - GetTemperatureSource().Load(in.TemperatureSource().get()); - if (in.NextTemperatureSource().present()) - GetNextTemperatureSource().Load(in.NextTemperatureSource().get()); - if (in.TemperatureSourceBaseline().present()) - GetTemperatureSourceBaseline().Load(in.TemperatureSourceBaseline().get()); - if (in.ValveBreakdownTemperature().present()) - GetValveBreakdownTemperature().Load(in.ValveBreakdownTemperature().get()); - - return HasValidElements(); -} -//------------------------------------------------------------------------------- -CDM::ThermalCircuitPathData* SEThermalCircuitPath::Unload() const -{ - CDM::ThermalCircuitPathData* data = new CDM::ThermalCircuitPathData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEThermalCircuitPath::Unload(CDM::ThermalCircuitPathData& data) const -{ - SECircuitPath::Unload(data); - if (HasResistance()) - data.Resistance(std::unique_ptr(m_Resistance->Unload())); - if (HasNextResistance()) - data.NextResistance(std::unique_ptr(m_NextResistance->Unload())); - if (HasResistanceBaseline()) - data.ResistanceBaseline(std::unique_ptr(m_ResistanceBaseline->Unload())); - if (HasCapacitance()) - data.Capacitance(std::unique_ptr(m_Capacitance->Unload())); - if (HasNextCapacitance()) - data.NextCapacitance(std::unique_ptr(m_NextCapacitance->Unload())); - if (HasCapacitanceBaseline()) - data.CapacitanceBaseline(std::unique_ptr(m_CapacitanceBaseline->Unload())); - if (HasInductance()) - data.Inductance(std::unique_ptr(m_Inductance->Unload())); - if (HasNextInductance()) - data.NextInductance(std::unique_ptr(m_NextInductance->Unload())); - if (HasInductanceBaseline()) - data.InductanceBaseline(std::unique_ptr(m_InductanceBaseline->Unload())); - if (HasHeatTransferRate()) - data.HeatTransferRate(std::unique_ptr(m_Flux->Unload())); - if (HasNextHeatTransferRate()) - data.NextHeatTransferRate(std::unique_ptr(m_NextFlux->Unload())); - if (HasHeatSource()) - data.HeatSource(std::unique_ptr(m_FluxSource->Unload())); - if (HasNextHeatSource()) - data.NextHeatSource(std::unique_ptr(m_NextFluxSource->Unload())); - if (HasHeatSourceBaseline()) - data.HeatSourceBaseline(std::unique_ptr(m_FluxSourceBaseline->Unload())); - if (HasTemperatureSource()) - data.TemperatureSource(std::unique_ptr(m_PotentialSource->Unload())); - if (HasNextTemperatureSource()) - data.NextTemperatureSource(std::unique_ptr(m_NextPotentialSource->Unload())); - if (HasTemperatureSourceBaseline()) - data.TemperatureSourceBaseline(std::unique_ptr(m_PotentialSourceBaseline->Unload())); - if (HasValveBreakdownTemperature()) - data.ValveBreakdownTemperature(std::unique_ptr(m_ValveBreakdownPotential->Unload())); + Invalidate(); +} +//------------------------------------------------------------------------------- +void SEThermalCircuitPath::Invalidate() +{ + SECircuitPath::Invalidate(); } //------------------------------------------------------------------------------- diff --git a/projects/biogears/libBiogears/src/cdm/compartment/SECompartment.cpp b/projects/biogears/libBiogears/src/cdm/compartment/SECompartment.cpp index 564051a0c..5d8a27f47 100644 --- a/projects/biogears/libBiogears/src/cdm/compartment/SECompartment.cpp +++ b/projects/biogears/libBiogears/src/cdm/compartment/SECompartment.cpp @@ -10,6 +10,7 @@ CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **************************************************************************************/ +#include "io/cdm/Compartment.h" #include #include #include @@ -28,24 +29,13 @@ SECompartment::SECompartment(const std::string& name, Logger* logger) //----------------------------------------------------------------------------- SECompartment::~SECompartment() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SECompartment::Clear() +void SECompartment::Invalidate() { } //----------------------------------------------------------------------------- -bool SECompartment::Load(const CDM::CompartmentData& in, SECircuitManager* circuits) -{ - Clear(); - return true; -} -//----------------------------------------------------------------------------- -void SECompartment::Unload(CDM::CompartmentData& data) -{ - data.Name(m_Name); -} -//----------------------------------------------------------------------------- std::string SECompartment::GetName() const { return m_Name; diff --git a/projects/biogears/libBiogears/src/cdm/compartment/SECompartmentLink.cpp b/projects/biogears/libBiogears/src/cdm/compartment/SECompartmentLink.cpp index 5c4b31933..eb9556412 100644 --- a/projects/biogears/libBiogears/src/cdm/compartment/SECompartmentLink.cpp +++ b/projects/biogears/libBiogears/src/cdm/compartment/SECompartmentLink.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Compartment.h" #include #include @@ -28,23 +29,13 @@ SECompartmentLink::SECompartmentLink(const std::string& name, Logger* logger) //------------------------------------------------------------------------------- SECompartmentLink::~SECompartmentLink() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SECompartmentLink::Clear() +void SECompartmentLink::Invalidate() { } -//------------------------------------------------------------------------------- -bool SECompartmentLink::Load(const CDM::CompartmentLinkData& in, SECircuitManager* circuits) -{ - Clear(); - return true; -} -//------------------------------------------------------------------------------- -void SECompartmentLink::Unload(CDM::CompartmentLinkData& data) -{ - data.Name(m_Name); -} + //------------------------------------------------------------------------------- std::string SECompartmentLink::GetName() const { diff --git a/projects/biogears/libBiogears/src/cdm/compartment/SECompartmentManager.cpp b/projects/biogears/libBiogears/src/cdm/compartment/SECompartmentManager.cpp index 0af22f3bf..b17483add 100644 --- a/projects/biogears/libBiogears/src/cdm/compartment/SECompartmentManager.cpp +++ b/projects/biogears/libBiogears/src/cdm/compartment/SECompartmentManager.cpp @@ -11,37 +11,41 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Compartment.h" #include #include #include +#include #include #include #include #include namespace std { - template class vector ; - template class map ; - template class vector ; - template class map ; - template class vector ; - template class map ; - template class vector ; - - template class vector ; - template class map ; - template class vector ; - template class map ; - template class vector ; - template class map ; - - template class vector ; - template class map ; - template class vector ; - template class map ; - - template class vector ; - template class map ; +template class vector; +template class map; +template class vector; +template class map; +template class vector; +template class map; +template class vector; + +template class vector; +template class map; +template class vector; +template class map; +template class vector; +template class map; + +template class vector; +template class map; +template class vector; +template class map; + +template class vector; +template class map; } namespace biogears { @@ -49,24 +53,32 @@ SECompartmentManager::SECompartmentManager(SESubstanceManager& subMgr) : Loggable(subMgr.GetLogger()) , m_subMgr(subMgr) { - m_O2 = subMgr.GetSubstance("Oxygen"); - m_CO2 = subMgr.GetSubstance("CarbonDioxide"); - m_CO = subMgr.GetSubstance("CarbonMonoxide"); - m_Hb = subMgr.GetSubstance("Hemoglobin"); - m_HbO2 = subMgr.GetSubstance("Oxyhemoglobin"); - m_HbCO2 = subMgr.GetSubstance("Carbaminohemoglobin"); - m_HbO2CO2 = subMgr.GetSubstance("OxyCarbaminohemoglobin"); - m_HbCO = subMgr.GetSubstance("Carboxyhemoglobin"); - Clear(); + m_O2 = subMgr.GetSubstance(StandardSubstances::Oxygen); + m_CO2 = subMgr.GetSubstance(StandardSubstances::CarbonDioxide); + m_CO = subMgr.GetSubstance(StandardSubstances::CarbonMonoxide); + m_Hb = subMgr.GetSubstance(StandardSubstances::Hemoglobin); + m_HbO2 = subMgr.GetSubstance(StandardSubstances::Oxyhemoglobin); + m_HbCO2 = subMgr.GetSubstance(StandardSubstances::Carbaminohemoglobin); + m_HbO2CO2 = subMgr.GetSubstance(StandardSubstances::OxyCarbaminohemoglobin); + m_HbCO = subMgr.GetSubstance(StandardSubstances::Carboxyhemoglobin); + Invalidate(); } SECompartmentManager::~SECompartmentManager() { - Clear(); + Invalidate(); } - -void SECompartmentManager::Clear() +#pragma optimize("", off) +void SECompartmentManager::Invalidate() { - DELETE_VECTOR(m_GasCompartments); + try { + DELETE_VECTOR(m_GasCompartments); + } catch (CommonDataModelException ex) { + std::cout << ex.what() << std::endl; + + } catch (std::exception ex) { + std::cout << ex.what() << std::endl; + ; + } m_GasName2Compartments.clear(); m_GasLeafCompartments.clear(); DELETE_VECTOR(m_GasLinks); @@ -95,136 +107,23 @@ void SECompartmentManager::Clear() m_TissueLeafCompartments.clear(); m_TissueName2Compartments.clear(); } - -#define LOAD_COMPARTMENT(type) \ - for (auto& cData : in.type##Compartment()) { \ - if (!Create##type##Compartment(cData.Name()).Load(cData, m_subMgr, circuits)) \ - return false; \ - } -#define LOAD_THERMAL_COMPARTMENT(type) \ - for (auto& cData : in.type##Compartment()) { \ - if (!Create##type##Compartment(cData.Name()).Load(cData, circuits)) \ - return false; \ - } -#define LOAD_LINK(type) \ - for (auto& cData : in.type##Link()) { \ - auto* src = Get##type##Compartment(cData.SourceCompartment()); \ - if (src == nullptr) { \ - Error("Unable to find source compartment " + std::string { cData.SourceCompartment() } + " for link " + cData.Name().c_str()); \ - return false; \ - } \ - auto* tgt = Get##type##Compartment(cData.TargetCompartment()); \ - if (src == nullptr) { \ - Error("Unable to find target compartment " + std::string { cData.TargetCompartment() } + " for link " + cData.Name().c_str()); \ - return false; \ - } \ - if (!Create##type##Link(*src, *tgt, cData.Name()).Load(cData, circuits)) \ - return false; \ - } -#define LOAD_HIERARCHY(type) \ - for (auto& cData : in.type##Compartment()) { \ - auto* cmpt = Get##type##Compartment(cData.Name()); \ - for (auto name : cData.Child()) { \ - auto* child = Get##type##Compartment(name); \ - if (child == nullptr) { \ - Error("Could not find child " + std::string { name } + " for node " + cmpt->GetName()); \ - return false; \ - } \ - cmpt->AddChild(*child); \ - } \ - } -#define LOAD_GRAPH(type) \ - for (auto& cData : in.type##Graph()) { \ - if (!Create##type##Graph(cData.Name()).Load(cData, *this)) \ - return false; \ - } -#define LOAD_SUBSTANCE(type) \ - for (auto subName : in.type##Substance()) { \ - SESubstance* sub = m_subMgr.GetSubstance(subName); \ - if (sub == nullptr) { \ - Error("Could not find substance " + std::string { subName }); \ - return false; \ - } \ - Add##type##CompartmentSubstance(*sub); \ - } - -bool SECompartmentManager::Load(const CDM::CompartmentManagerData& in, SECircuitManager* circuits) -{ - Clear(); - - LOAD_COMPARTMENT(Gas); - LOAD_LINK(Gas); - LOAD_HIERARCHY(Gas); - LOAD_SUBSTANCE(Gas); - LOAD_GRAPH(Gas); - - LOAD_COMPARTMENT(Liquid); - LOAD_LINK(Liquid); - LOAD_HIERARCHY(Liquid); - LOAD_SUBSTANCE(Liquid); - LOAD_GRAPH(Liquid); - - LOAD_THERMAL_COMPARTMENT(Thermal); - LOAD_LINK(Thermal); - LOAD_HIERARCHY(Thermal); - - LOAD_COMPARTMENT(Tissue); - - StateChange(); - return true; -} -//------------------------------------------------------------------------------- -CDM::CompartmentManagerData* SECompartmentManager::Unload() const -{ - CDM::CompartmentManagerData* data = new CDM::CompartmentManagerData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SECompartmentManager::Unload(CDM::CompartmentManagerData& data) const -{ - for (SELiquidCompartment* cmpt : m_LiquidCompartments) - data.LiquidCompartment().push_back(std::unique_ptr(cmpt->Unload())); - for (SELiquidCompartmentLink* link : m_LiquidLinks) - data.LiquidLink().push_back(std::unique_ptr(link->Unload())); - for (SELiquidCompartmentGraph* graph : m_LiquidGraphs) - data.LiquidGraph().push_back(std::unique_ptr(graph->Unload())); - for (SESubstance* sub : m_LiquidSubstances) - data.LiquidSubstance().push_back(sub->GetName()); - - for (SEGasCompartment* cmpt : m_GasCompartments) - data.GasCompartment().push_back(std::unique_ptr(cmpt->Unload())); - for (SEGasCompartmentLink* link : m_GasLinks) - data.GasLink().push_back(std::unique_ptr(link->Unload())); - for (SEGasCompartmentGraph* graph : m_GasGraphs) - data.GasGraph().push_back(std::unique_ptr(graph->Unload())); - for (SESubstance* sub : m_GasSubstances) - data.GasSubstance().push_back(sub->GetName()); - - for (SEThermalCompartment* cmpt : m_ThermalCompartments) - data.ThermalCompartment().push_back(std::unique_ptr(cmpt->Unload())); - for (SEThermalCompartmentLink* link : m_ThermalLinks) - data.ThermalLink().push_back(std::unique_ptr(link->Unload())); - - for (SETissueCompartment* cmpt : m_TissueCompartments) - data.TissueCompartment().push_back(std::unique_ptr(cmpt->Unload())); -} +#pragma optimize("", on) //------------------------------------------------------------------------------- -bool SECompartmentManager::HasCompartment(CDM::enumCompartmentType::value type, const char* name) const +bool SECompartmentManager::HasCompartment(SECompartmentType type, const char* name) const { return HasCompartment(type, std::string { name }); } //------------------------------------------------------------------------------- -bool SECompartmentManager::HasCompartment(CDM::enumCompartmentType::value type, const std::string& name) const +bool SECompartmentManager::HasCompartment(SECompartmentType type, const std::string& name) const { switch (type) { - case CDM::enumCompartmentType::Gas: + case SECompartmentType::Gas: return HasGasCompartment(name); - case CDM::enumCompartmentType::Liquid: + case SECompartmentType::Liquid: return HasLiquidCompartment(name); - case CDM::enumCompartmentType::Thermal: + case SECompartmentType::Thermal: return HasThermalCompartment(name); - case CDM::enumCompartmentType::Tissue: + case SECompartmentType::Tissue: return HasTissueCompartment(name); default: return false; @@ -232,21 +131,21 @@ bool SECompartmentManager::HasCompartment(CDM::enumCompartmentType::value type, return false; } //------------------------------------------------------------------------------- -SECompartment* SECompartmentManager::GetCompartment(CDM::enumCompartmentType::value type, const char* name) +SECompartment* SECompartmentManager::GetCompartment(SECompartmentType type, const char* name) { return GetCompartment(type, std::string { name }); } //------------------------------------------------------------------------------- -SECompartment* SECompartmentManager::GetCompartment(CDM::enumCompartmentType::value type, const std::string& name) +SECompartment* SECompartmentManager::GetCompartment(SECompartmentType type, const std::string& name) { switch (type) { - case CDM::enumCompartmentType::Gas: + case SECompartmentType::Gas: return GetGasCompartment(name); - case CDM::enumCompartmentType::Liquid: + case SECompartmentType::Liquid: return GetLiquidCompartment(name); - case CDM::enumCompartmentType::Thermal: + case SECompartmentType::Thermal: return GetThermalCompartment(name); - case CDM::enumCompartmentType::Tissue: + case SECompartmentType::Tissue: return GetTissueCompartment(name); default: return nullptr; @@ -254,21 +153,21 @@ SECompartment* SECompartmentManager::GetCompartment(CDM::enumCompartmentType::va return nullptr; } //------------------------------------------------------------------------------- -const SECompartment* SECompartmentManager::GetCompartment(CDM::enumCompartmentType::value type, const char* name) const +const SECompartment* SECompartmentManager::GetCompartment(SECompartmentType type, const char* name) const { return GetCompartment(type, std::string { name }); } //------------------------------------------------------------------------------- -const SECompartment* SECompartmentManager::GetCompartment(CDM::enumCompartmentType::value type, const std::string& name) const +const SECompartment* SECompartmentManager::GetCompartment(SECompartmentType type, const std::string& name) const { switch (type) { - case CDM::enumCompartmentType::Gas: + case SECompartmentType::Gas: return GetGasCompartment(name); - case CDM::enumCompartmentType::Liquid: + case SECompartmentType::Liquid: return GetLiquidCompartment(name); - case CDM::enumCompartmentType::Thermal: + case SECompartmentType::Thermal: return GetThermalCompartment(name); - case CDM::enumCompartmentType::Tissue: + case SECompartmentType::Tissue: return GetTissueCompartment(name); default: return nullptr; diff --git a/projects/biogears/libBiogears/src/cdm/compartment/fluid/SEFluidCompartment.cpp b/projects/biogears/libBiogears/src/cdm/compartment/fluid/SEFluidCompartment.cpp new file mode 100644 index 000000000..8dd9b7961 --- /dev/null +++ b/projects/biogears/libBiogears/src/cdm/compartment/fluid/SEFluidCompartment.cpp @@ -0,0 +1,18 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include + + +namespace biogears { + + template class SEFluidCompartment; + +} \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/cdm/compartment/fluid/SEGasCompartment.cpp b/projects/biogears/libBiogears/src/cdm/compartment/fluid/SEGasCompartment.cpp index a6c907696..b36ff4762 100644 --- a/projects/biogears/libBiogears/src/cdm/compartment/fluid/SEGasCompartment.cpp +++ b/projects/biogears/libBiogears/src/cdm/compartment/fluid/SEGasCompartment.cpp @@ -11,6 +11,10 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Compartment.h" +#include +#include + #include #include #include @@ -18,6 +22,12 @@ specific language governing permissions and limitations under the License. #include #include +namespace std { + template class vector; +//template class map; +} + + namespace biogears { SEGasCompartment::SEGasCompartment(const char* name, Logger* logger) : SEGasCompartment(std::string { name }, logger) @@ -32,38 +42,7 @@ SEGasCompartment::SEGasCompartment(const std::string& name, Logger* logger) SEGasCompartment::~SEGasCompartment() { } -//------------------------------------------------------------------------------- -bool SEGasCompartment::Load(const CDM::GasCompartmentData& in, SESubstanceManager& subMgr, SECircuitManager* circuits) -{ - if (!SEFluidCompartment::Load(in, circuits)) - return false; - if (in.Child().empty()) { - for (const CDM::GasSubstanceQuantityData& d : in.SubstanceQuantity()) { - SESubstance* sub = subMgr.GetSubstance(d.Substance()); - if (sub == nullptr) { - Error("Could not find a substance for " + std::string { d.Substance() }); - return false; - } - CreateSubstanceQuantity(*sub).Load(d); - ; - } - } - return true; -} -//------------------------------------------------------------------------------- -CDM::GasCompartmentData* SEGasCompartment::Unload() -{ - CDM::GasCompartmentData* data = new CDM::GasCompartmentData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEGasCompartment::Unload(CDM::GasCompartmentData& data) -{ - SEFluidCompartment::Unload(data); - for (SEGasSubstanceQuantity* subQ : m_SubstanceQuantities) - data.SubstanceQuantity().push_back(std::unique_ptr(subQ->Unload())); -} + //------------------------------------------------------------------------------- void SEGasCompartment::StateChange() { @@ -86,7 +65,7 @@ void SEGasCompartment::Balance(BalanceGasBy by) } for (SEGasSubstanceQuantity* subQ : GetSubstanceQuantities()) { if (!subQ->HasVolume()) { - subQ->Invalidate(); + subQ->MakeInvalid(); continue; } else { subQ->GetVolumeFraction().SetValue(subQ->GetVolume(VolumeUnit::mL) / totalVolume_mL); @@ -100,7 +79,7 @@ void SEGasCompartment::Balance(BalanceGasBy by) case BalanceGasBy::VolumeFraction: { if (!HasVolume()) { for (SEGasSubstanceQuantity* subQ : GetSubstanceQuantities()) { - subQ->Invalidate(); + subQ->MakeInvalid(); if (HasPressure()) GeneralMath::CalculatePartialPressureInGas(subQ->GetVolumeFraction(), GetPressure(), subQ->GetPartialPressure(), m_Logger); } @@ -117,7 +96,7 @@ void SEGasCompartment::Balance(BalanceGasBy by) double totalVolume_mL = GetVolume(VolumeUnit::mL); for (SEGasSubstanceQuantity* subQ : GetSubstanceQuantities()) { if (!subQ->HasVolumeFraction()) - subQ->Invalidate(); + subQ->MakeInvalid(); else { totalFraction += subQ->GetVolumeFraction().GetValue(); subQ->GetVolume().SetValue(subQ->GetVolumeFraction().GetValue() * totalVolume_mL, VolumeUnit::mL); diff --git a/projects/biogears/libBiogears/src/cdm/compartment/fluid/SEGasCompartmentGraph.cpp b/projects/biogears/libBiogears/src/cdm/compartment/fluid/SEGasCompartmentGraph.cpp index 5458aa152..c4a3491ca 100644 --- a/projects/biogears/libBiogears/src/cdm/compartment/fluid/SEGasCompartmentGraph.cpp +++ b/projects/biogears/libBiogears/src/cdm/compartment/fluid/SEGasCompartmentGraph.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Compartment.h" #include #include #include @@ -21,6 +22,7 @@ specific language governing permissions and limitations under the License. #include #include + namespace std { template class vector; template class vector; @@ -42,44 +44,7 @@ SEGasCompartmentGraph::SEGasCompartmentGraph(const std::string& name, Logger* lo SEGasCompartmentGraph::~SEGasCompartmentGraph() { } -//----------------------------------------------------------------------------- -bool SEGasCompartmentGraph::Load(const CDM::GasCompartmentGraphData& in, SECompartmentManager& cmptMgr) -{ - m_Name = in.Name(); - for (auto name : in.Compartment()) { - SEGasCompartment* cmpt = cmptMgr.GetGasCompartment(name); - if (cmpt == nullptr) { - Error("Could not find compartment " + std::string { name } + " for graph " + m_Name); - return false; - } - AddCompartment(*cmpt); - } - for (auto name : in.Link()) { - SEGasCompartmentLink* link = cmptMgr.GetGasLink(name); - if (link == nullptr) { - Error("Could not find link " + std::string { name } + " for graph " + m_Name); - return false; - } - AddLink(*link); - } - return true; -} -//----------------------------------------------------------------------------- -CDM::GasCompartmentGraphData* SEGasCompartmentGraph::Unload() -{ - CDM::GasCompartmentGraphData* data = new CDM::GasCompartmentGraphData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEGasCompartmentGraph::Unload(CDM::GasCompartmentGraphData& data) -{ - data.Name(m_Name); - for (SEGasCompartment* cmpt : m_Compartments) - data.Compartment().push_back(cmpt->GetName()); - for (SEGasCompartmentLink* link : m_CompartmentLinks) - data.Link().push_back(link->GetName()); -} + //----------------------------------------------------------------------------- void SEGasCompartmentGraph::BalanceByIntensive() { diff --git a/projects/biogears/libBiogears/src/cdm/compartment/fluid/SEGasCompartmentLink.cpp b/projects/biogears/libBiogears/src/cdm/compartment/fluid/SEGasCompartmentLink.cpp index 4cf5d4e38..7da742c1b 100644 --- a/projects/biogears/libBiogears/src/cdm/compartment/fluid/SEGasCompartmentLink.cpp +++ b/projects/biogears/libBiogears/src/cdm/compartment/fluid/SEGasCompartmentLink.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Compartment.h" #include #include @@ -29,12 +30,6 @@ SEGasCompartmentLink::SEGasCompartmentLink(SEGasCompartment& src, SEGasCompartme : SEFluidCompartmentLink(src, tgt, name) { } -//----------------------------------------------------------------------------- -CDM::GasCompartmentLinkData* SEGasCompartmentLink::Unload() -{ - CDM::GasCompartmentLinkData* data = new CDM::GasCompartmentLinkData(); - SEFluidCompartmentLink::Unload(*data); - return data; -} + //----------------------------------------------------------------------------- } \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/cdm/compartment/fluid/SELiquidCompartment.cpp b/projects/biogears/libBiogears/src/cdm/compartment/fluid/SELiquidCompartment.cpp index 049e9395c..f031dc2cf 100644 --- a/projects/biogears/libBiogears/src/cdm/compartment/fluid/SELiquidCompartment.cpp +++ b/projects/biogears/libBiogears/src/cdm/compartment/fluid/SELiquidCompartment.cpp @@ -11,11 +11,19 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Compartment.h" #include #include +#include #include #include #include +#include + +namespace std { +template class vector; +template class map; +} namespace biogears { @@ -33,56 +41,22 @@ SELiquidCompartment::SELiquidCompartment(const std::string& name, Logger* logger //----------------------------------------------------------------------------- SELiquidCompartment::~SELiquidCompartment() { - Clear(); -} -//----------------------------------------------------------------------------- -void SELiquidCompartment::Clear() -{ - SEFluidCompartment::Clear(); SAFE_DELETE(m_pH); SAFE_DELETE(m_WaterVolumeFraction); - m_Children.clear(); } //----------------------------------------------------------------------------- -bool SELiquidCompartment::Load(const CDM::LiquidCompartmentData& in, SESubstanceManager& subMgr, SECircuitManager* circuits) +void SELiquidCompartment::Invalidate() { - if (!SEFluidCompartment::Load(in, circuits)) - return false; - if (in.Child().empty()) { - for (const CDM::LiquidSubstanceQuantityData& d : in.SubstanceQuantity()) { - SESubstance* sub = subMgr.GetSubstance(d.Substance()); - if (sub == nullptr) { - Error("Could not find a substance for " + std::string { d.Substance() }); - return false; - } - CreateSubstanceQuantity(*sub).Load(d); - ; - } - if (in.pH().present()) - GetPH().Load(in.pH().get()); - if (in.WaterVolumeFraction().present()) - GetWaterVolumeFraction().Load(in.WaterVolumeFraction().get()); - } - return true; -} -//----------------------------------------------------------------------------- -CDM::LiquidCompartmentData* SELiquidCompartment::Unload() -{ - CDM::LiquidCompartmentData* data = new CDM::LiquidCompartmentData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SELiquidCompartment::Unload(CDM::LiquidCompartmentData& data) -{ - SEFluidCompartment::Unload(data); - for (SELiquidSubstanceQuantity* subQ : m_SubstanceQuantities) - data.SubstanceQuantity().push_back(std::unique_ptr(subQ->Unload())); - if (HasPH()) - data.pH(std::unique_ptr(GetPH().Unload())); - if (HasWaterVolumeFraction()) - data.WaterVolumeFraction(std::unique_ptr(GetWaterVolumeFraction().Unload())); + SEFluidCompartment::Invalidate(); + if (m_pH && !m_pH->IsReadOnly()) { + m_pH->Invalidate(); + }; + if (m_WaterVolumeFraction && !m_WaterVolumeFraction->IsReadOnly()) { + m_WaterVolumeFraction->Invalidate(); + }; + m_Children.clear(); } + //----------------------------------------------------------------------------- const SEScalar* SELiquidCompartment::GetScalar(const char* name) { @@ -111,7 +85,7 @@ void SELiquidCompartment::StateChange() void SELiquidCompartment::Balance(BalanceLiquidBy by) { for (SELiquidSubstanceQuantity* subQ : m_SubstanceQuantities) { - if (by == BalanceLiquidBy::PartialPressure && subQ->GetSubstance().GetState() != CDM::enumSubstanceState::Gas) + if (by == BalanceLiquidBy::PartialPressure && subQ->GetSubstance().GetState() != SESubstanceState::Gas) continue; // Partial pressures only make sense for gases in liquids diff --git a/projects/biogears/libBiogears/src/cdm/compartment/fluid/SELiquidCompartmentGraph.cpp b/projects/biogears/libBiogears/src/cdm/compartment/fluid/SELiquidCompartmentGraph.cpp index 44fa3fb54..c0d1da70d 100644 --- a/projects/biogears/libBiogears/src/cdm/compartment/fluid/SELiquidCompartmentGraph.cpp +++ b/projects/biogears/libBiogears/src/cdm/compartment/fluid/SELiquidCompartmentGraph.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Compartment.h" #include #include #include @@ -19,6 +20,7 @@ specific language governing permissions and limitations under the License. #include #include + namespace std { template class vector; template class vector; @@ -35,42 +37,6 @@ SELiquidCompartmentGraph::SELiquidCompartmentGraph(const std::string& name, Logg SELiquidCompartmentGraph::~SELiquidCompartmentGraph() { } -bool SELiquidCompartmentGraph::Load(const CDM::LiquidCompartmentGraphData& in, SECompartmentManager& cmptMgr) -{ - m_Name = in.Name(); - for (auto name : in.Compartment()) { - SELiquidCompartment* cmpt = cmptMgr.GetLiquidCompartment(name); - if (cmpt == nullptr) { - Error("Could not find compartment " + std::string { name } + " for graph " + m_Name); - return false; - } - AddCompartment(*cmpt); - } - for (auto name : in.Link()) { - SELiquidCompartmentLink* link = cmptMgr.GetLiquidLink(name); - if (link == nullptr) { - Error("Could not find link " + std::string { name } + " for graph " + m_Name); - return false; - } - AddLink(*link); - } - return true; -} -CDM::LiquidCompartmentGraphData* SELiquidCompartmentGraph::Unload() -{ - CDM::LiquidCompartmentGraphData* data = new CDM::LiquidCompartmentGraphData(); - Unload(*data); - return data; -} -void SELiquidCompartmentGraph::Unload(CDM::LiquidCompartmentGraphData& data) -{ - data.Name(m_Name); - for (SELiquidCompartment* cmpt : m_Compartments) - data.Compartment().push_back(cmpt->GetName()); - for (SELiquidCompartmentLink* link : m_CompartmentLinks) - data.Link().push_back(link->GetName()); -} - void SELiquidCompartmentGraph::BalanceByIntensive() { for (auto cmpt : GetCompartments()) diff --git a/projects/biogears/libBiogears/src/cdm/compartment/fluid/SELiquidCompartmentLink.cpp b/projects/biogears/libBiogears/src/cdm/compartment/fluid/SELiquidCompartmentLink.cpp index f2fc4b86f..1b0f8b4c0 100644 --- a/projects/biogears/libBiogears/src/cdm/compartment/fluid/SELiquidCompartmentLink.cpp +++ b/projects/biogears/libBiogears/src/cdm/compartment/fluid/SELiquidCompartmentLink.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Compartment.h" #include #include #include @@ -19,6 +20,9 @@ specific language governing permissions and limitations under the License. #include namespace biogears { + +template class SEFluidCompartmentLink; + SELiquidCompartmentLink::SELiquidCompartmentLink(SELiquidCompartment& src, SELiquidCompartment& tgt, const char* name) : SELiquidCompartmentLink(src, tgt, std::string { name }) { @@ -32,12 +36,6 @@ SELiquidCompartmentLink::SELiquidCompartmentLink(SELiquidCompartment& src, SELiq SELiquidCompartmentLink::~SELiquidCompartmentLink() { } -//------------------------------------------------------------------------------- -CDM::LiquidCompartmentLinkData* SELiquidCompartmentLink::Unload() -{ - CDM::LiquidCompartmentLinkData* data = new CDM::LiquidCompartmentLinkData(); - SEFluidCompartmentLink::Unload(*data); - return data; -} + //------------------------------------------------------------------------------- } \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/cdm/compartment/substances/SEGasSubstanceQuantity.cpp b/projects/biogears/libBiogears/src/cdm/compartment/substances/SEGasSubstanceQuantity.cpp index f3c895d00..a93e4b9e9 100644 --- a/projects/biogears/libBiogears/src/cdm/compartment/substances/SEGasSubstanceQuantity.cpp +++ b/projects/biogears/libBiogears/src/cdm/compartment/substances/SEGasSubstanceQuantity.cpp @@ -11,13 +11,17 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/SubstanceQuantity.h" +#include #include #include #include #include #include #include +#include #include +#include namespace biogears { SEGasSubstanceQuantity::SEGasSubstanceQuantity(SESubstance& sub, SEGasCompartment& compartment) @@ -28,16 +32,16 @@ SEGasSubstanceQuantity::SEGasSubstanceQuantity(SESubstance& sub, SEGasCompartmen m_Volume = nullptr; m_VolumeFraction = nullptr; - if (m_Substance.GetState() != CDM::enumSubstanceState::Gas) + if (m_Substance.GetState() != SESubstanceState::Gas) Fatal("The substance for a Gas Substance quantity must be a gas"); } //------------------------------------------------------------------------------- SEGasSubstanceQuantity::~SEGasSubstanceQuantity() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEGasSubstanceQuantity::Invalidate() +void SEGasSubstanceQuantity::MakeInvalid() { if (m_PartialPressure != nullptr) m_PartialPressure->Invalidate(); @@ -47,46 +51,14 @@ void SEGasSubstanceQuantity::Invalidate() m_VolumeFraction->Invalidate(); } //------------------------------------------------------------------------------- -void SEGasSubstanceQuantity::Clear() +void SEGasSubstanceQuantity::Invalidate() { SAFE_DELETE(m_PartialPressure); SAFE_DELETE(m_Volume); SAFE_DELETE(m_VolumeFraction); m_Children.clear(); } -//------------------------------------------------------------------------------- -bool SEGasSubstanceQuantity::Load(const CDM::GasSubstanceQuantityData& in) -{ - SESubstanceQuantity::Load(in); - if (!m_Compartment.HasChildren()) { - if (in.PartialPressure().present()) - GetPartialPressure().Load(in.PartialPressure().get()); - if (in.Volume().present()) - GetVolume().Load(in.Volume().get()); - if (in.VolumeFraction().present()) - GetVolumeFraction().Load(in.VolumeFraction().get()); - } - return true; -} -//------------------------------------------------------------------------------- -CDM::GasSubstanceQuantityData* SEGasSubstanceQuantity::Unload() -{ - CDM::GasSubstanceQuantityData* data = new CDM::GasSubstanceQuantityData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEGasSubstanceQuantity::Unload(CDM::GasSubstanceQuantityData& data) -{ - SESubstanceQuantity::Unload(data); - // Even if you have children, I am unloading everything, this makes the xml actually usefull... - if (HasPartialPressure()) - data.PartialPressure(std::unique_ptr(GetPartialPressure().Unload())); - if (HasVolume()) - data.Volume(std::unique_ptr(GetVolume().Unload())); - if (HasVolumeFraction()) - data.VolumeFraction(std::unique_ptr(GetVolumeFraction().Unload())); -} + //------------------------------------------------------------------------------- void SEGasSubstanceQuantity::SetToZero() { @@ -238,15 +210,16 @@ void SEGasSubstanceQuantity::AddChild(SEGasSubstanceQuantity& subQ) } //----------------------------------------------------------------------------- + bool SEGasSubstanceQuantity::operator==(SEGasSubstanceQuantity const& rhs) const { if (this == &rhs) return true; - bool equivilant = ((m_PartialPressure && rhs.m_PartialPressure) ? m_PartialPressure->operator==(*rhs.m_PartialPressure) : m_PartialPressure == rhs.m_PartialPressure) - && ((m_Volume && rhs.m_Volume) ? m_Volume->operator==(*rhs.m_Volume) : m_Volume == rhs.m_Volume) - && ((m_VolumeFraction && rhs.m_VolumeFraction) ? m_VolumeFraction->operator==(*rhs.m_VolumeFraction) : m_VolumeFraction == rhs.m_VolumeFraction) - && m_Compartment.operator==(rhs.m_Compartment); + bool equivilant = ((m_PartialPressure && rhs.m_PartialPressure) ? m_PartialPressure->operator==(*rhs.m_PartialPressure) : m_PartialPressure == rhs.m_PartialPressure); + equivilant &= ((m_Volume && rhs.m_Volume) ? m_Volume->operator==(*rhs.m_Volume) : m_Volume == rhs.m_Volume); + equivilant &= ((m_VolumeFraction && rhs.m_VolumeFraction) ? m_VolumeFraction->operator==(*rhs.m_VolumeFraction) : m_VolumeFraction == rhs.m_VolumeFraction); + equivilant &= m_Compartment.operator==(rhs.m_Compartment); if (equivilant) { for (auto i = 0; i < m_Children.size(); ++i) { diff --git a/projects/biogears/libBiogears/src/cdm/compartment/substances/SELiquidSubstanceQuantity.cpp b/projects/biogears/libBiogears/src/cdm/compartment/substances/SELiquidSubstanceQuantity.cpp index d607a05ce..453bf8f31 100644 --- a/projects/biogears/libBiogears/src/cdm/compartment/substances/SELiquidSubstanceQuantity.cpp +++ b/projects/biogears/libBiogears/src/cdm/compartment/substances/SELiquidSubstanceQuantity.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/SubstanceQuantity.h" #include #include #include @@ -22,6 +23,9 @@ specific language governing permissions and limitations under the License. #include #include #include +#include +#include +#include namespace biogears { SELiquidSubstanceQuantity::SELiquidSubstanceQuantity(SESubstance& sub, SELiquidCompartment& compartment) @@ -46,23 +50,30 @@ SELiquidSubstanceQuantity::SELiquidSubstanceQuantity(SESubstance& sub, SELiquidC m_isO2 = false; m_isCO2 = false; m_isCO = false; - if (sub.GetName() == "Oxygen") + if (sub.GetName() == StandardSubstances::Oxygen) m_isO2 = true; - else if (sub.GetName() == "CarbonMonoxide") + else if (sub.GetName() == StandardSubstances::CarbonMonoxide) m_isCO = true; - else if (sub.GetName() == "CarbonDioxide") + else if (sub.GetName() == StandardSubstances::CarbonDioxide) m_isCO2 = true; - if (m_Substance.GetState() != CDM::enumSubstanceState::Gas) + if (m_Substance.GetState() != SESubstanceState::Gas) GetPartialPressure().SetReadOnly(true); // Cannot have a partial pressure of a non gas } //----------------------------------------------------------------------------- SELiquidSubstanceQuantity::~SELiquidSubstanceQuantity() { - Clear(); + SAFE_DELETE(m_Concentration); + SAFE_DELETE(m_Mass); + SAFE_DELETE(m_MassCleared); + SAFE_DELETE(m_MassDeposited); + SAFE_DELETE(m_MassExcreted); + SAFE_DELETE(m_Molarity); + SAFE_DELETE(m_PartialPressure); + SAFE_DELETE(m_Saturation); } //----------------------------------------------------------------------------- -void SELiquidSubstanceQuantity::Invalidate() +void SELiquidSubstanceQuantity::MakeInvalid() { if (m_Concentration != nullptr) m_Concentration->Invalidate(); @@ -74,13 +85,13 @@ void SELiquidSubstanceQuantity::Invalidate() m_MassDeposited->Invalidate(); if (m_MassExcreted != nullptr) m_MassExcreted->Invalidate(); - if (m_PartialPressure != nullptr && m_Substance.GetState() == CDM::enumSubstanceState::Gas) + if (m_PartialPressure != nullptr && m_Substance.GetState() == SESubstanceState::Gas) m_PartialPressure->Invalidate(); if (m_Saturation != nullptr) m_Saturation->Invalidate(); } //----------------------------------------------------------------------------- -void SELiquidSubstanceQuantity::Clear() +void SELiquidSubstanceQuantity::Invalidate() { SAFE_DELETE(m_Concentration); SAFE_DELETE(m_Mass); @@ -92,66 +103,14 @@ void SELiquidSubstanceQuantity::Clear() SAFE_DELETE(m_Saturation); m_Children.clear(); } -//----------------------------------------------------------------------------- -bool SELiquidSubstanceQuantity::Load(const CDM::LiquidSubstanceQuantityData& in) -{ - SESubstanceQuantity::Load(in); - if (!m_Compartment.HasChildren()) { - if (in.Concentration().present()) - GetConcentration().Load(in.Concentration().get()); - if (in.Mass().present()) - GetMass().Load(in.Mass().get()); - if (in.MassCleared().present()) - GetMassCleared().Load(in.MassCleared().get()); - if (in.MassDeposited().present()) - GetMassDeposited().Load(in.MassDeposited().get()); - if (in.MassExcreted().present()) - GetMassExcreted().Load(in.MassExcreted().get()); - if (in.Molarity().present()) - GetMolarity().Load(in.Molarity().get()); - if (in.PartialPressure().present()) - GetPartialPressure().Load(in.PartialPressure().get()); - if (in.Saturation().present()) - GetSaturation().Load(in.Saturation().get()); - } - return true; -} -//----------------------------------------------------------------------------- -CDM::LiquidSubstanceQuantityData* SELiquidSubstanceQuantity::Unload() -{ - CDM::LiquidSubstanceQuantityData* data = new CDM::LiquidSubstanceQuantityData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SELiquidSubstanceQuantity::Unload(CDM::LiquidSubstanceQuantityData& data) -{ - SESubstanceQuantity::Unload(data); - // Even if you have children, I am unloading everything, this makes the xml actually usefull... - if (HasConcentration()) - data.Concentration(std::unique_ptr(GetConcentration().Unload())); - if (HasMass()) - data.Mass(std::unique_ptr(GetMass().Unload())); - if (m_MassCleared != nullptr) - data.MassCleared(std::unique_ptr(m_MassCleared->Unload())); - if (m_MassDeposited != nullptr) - data.MassDeposited(std::unique_ptr(m_MassDeposited->Unload())); - if (m_MassExcreted != nullptr) - data.MassExcreted(std::unique_ptr(m_MassExcreted->Unload())); - if (HasMolarity()) - data.Molarity(std::unique_ptr(GetMolarity().Unload())); - if (HasPartialPressure()) - data.PartialPressure(std::unique_ptr(GetPartialPressure().Unload())); - if (HasSaturation()) - data.Saturation(std::unique_ptr(GetSaturation().Unload())); -} + //----------------------------------------------------------------------------- void SELiquidSubstanceQuantity::SetToZero() { GetConcentration().SetValue(0, MassPerVolumeUnit::mg_Per_mL); GetMass().SetValue(0, MassUnit::mg); GetMolarity().SetValue(0, AmountPerVolumeUnit::mmol_Per_mL); - if (m_Substance.GetState() == CDM::enumSubstanceState::Gas) + if (m_Substance.GetState() == SESubstanceState::Gas) GetPartialPressure().SetValue(0, PressureUnit::mmHg); if (m_isO2 || m_isCO || m_isCO2) GetSaturation().SetValue(0); @@ -190,7 +149,7 @@ void SELiquidSubstanceQuantity::Balance(BalanceLiquidBy by) { SEScalarVolume& volume = m_Compartment.GetVolume(); if (!volume.IsValid()) { - Invalidate(); + MakeInvalid(); return; } if (!m_Children.empty()) { @@ -206,7 +165,7 @@ void SELiquidSubstanceQuantity::Balance(BalanceLiquidBy by) GetMass().SetValue(std::numeric_limits::infinity(), MassUnit::ug); else GeneralMath::CalculateMass(volume, GetConcentration(), GetMass(), m_Logger); - if (m_Substance.GetState() == CDM::enumSubstanceState::Gas) + if (m_Substance.GetState() == SESubstanceState::Gas) GeneralMath::CalculatePartialPressureInLiquid(m_Substance, GetConcentration(), GetPartialPressure(), m_Logger); double molarity_mmol_Per_mL = GetMass(MassUnit::ug) / m_Substance.GetMolarMass(MassPerAmountUnit::ug_Per_mmol) / volume.GetValue(VolumeUnit::mL); GetMolarity().SetValue(molarity_mmol_Per_mL, AmountPerVolumeUnit::mmol_Per_mL); @@ -216,7 +175,7 @@ void SELiquidSubstanceQuantity::Balance(BalanceLiquidBy by) if (!volume.IsValid() || volume.IsInfinity() || !GetMass().IsValid() || GetMass().IsInfinity()) Fatal("Cannot balance by Mass if volume or mass is invalid or set to Infinity", "SELiquidSubstanceQuantity::Balance"); GeneralMath::CalculateConcentration(GetMass(), volume, GetConcentration(), m_Logger); - if (m_Substance.GetState() == CDM::enumSubstanceState::Gas) + if (m_Substance.GetState() == SESubstanceState::Gas) GeneralMath::CalculatePartialPressureInLiquid(m_Substance, GetConcentration(), GetPartialPressure(), m_Logger); double molarity_mmol_Per_mL = GetMass(MassUnit::ug) / m_Substance.GetMolarMass(MassPerAmountUnit::ug_Per_mmol) / volume.GetValue(VolumeUnit::mL); GetMolarity().SetValue(molarity_mmol_Per_mL, AmountPerVolumeUnit::mmol_Per_mL); @@ -228,12 +187,12 @@ void SELiquidSubstanceQuantity::Balance(BalanceLiquidBy by) double mass_ug = GetMolarity(AmountPerVolumeUnit::mmol_Per_mL) * m_Substance.GetMolarMass(MassPerAmountUnit::ug_Per_mmol) * volume.GetValue(VolumeUnit::mL); GetMass().SetValue(mass_ug, MassUnit::ug); GeneralMath::CalculateConcentration(GetMass(), volume, GetConcentration(), m_Logger); - if (m_Substance.GetState() == CDM::enumSubstanceState::Gas) + if (m_Substance.GetState() == SESubstanceState::Gas) GeneralMath::CalculatePartialPressureInLiquid(m_Substance, GetConcentration(), GetPartialPressure(), m_Logger); break; } case BalanceLiquidBy::PartialPressure: { - if (m_Substance.GetState() != CDM::enumSubstanceState::Gas) + if (m_Substance.GetState() != SESubstanceState::Gas) Fatal("Cannot balance by Partial Pressure if substance is not a gas", "SELiquidSubstanceQuantity::Balance"); if (!volume.IsValid() || volume.IsInfinity() || !GetPartialPressure().IsValid() || GetPartialPressure().IsInfinity()) Fatal("Cannot balance by Partial Pressure if volume or partial pressure is invalid or set to Infinity", "SELiquidSubstanceQuantity::Balance"); @@ -596,32 +555,33 @@ bool SELiquidSubstanceQuantity::operator==(SELiquidSubstanceQuantity const& rhs) if (this == &rhs) return true; - bool equivilant = ((m_Concentration && rhs.m_Concentration) ? m_Concentration->operator==(*rhs.m_Concentration) : m_Concentration == rhs.m_Concentration) - && ((m_Mass && rhs.m_Mass) ? m_Mass->operator==(*rhs.m_Mass) : m_Mass == rhs.m_Mass) - && ((m_MassCleared && rhs.m_MassCleared) ? m_MassCleared->operator==(*rhs.m_MassCleared) : m_MassCleared == rhs.m_MassCleared) - && ((m_MassDeposited && rhs.m_MassDeposited) ? m_MassDeposited->operator==(*rhs.m_MassDeposited) : m_MassDeposited == rhs.m_MassDeposited) - && ((m_MassExcreted && rhs.m_MassExcreted) ? m_MassExcreted->operator==(*rhs.m_MassExcreted) : m_MassExcreted == rhs.m_MassExcreted) - && ((m_Molarity && rhs.m_Molarity) ? m_Molarity->operator==(*rhs.m_Molarity) : m_Molarity == rhs.m_Molarity) - && ((m_PartialPressure && rhs.m_PartialPressure) ? m_PartialPressure->operator==(*rhs.m_PartialPressure) : m_PartialPressure == rhs.m_PartialPressure) - && ((m_Saturation && rhs.m_Saturation) ? m_Saturation->operator==(*rhs.m_Saturation) : m_Saturation == rhs.m_Saturation) - && m_Compartment.operator==(rhs.m_Compartment); + bool equivilant = ((m_Concentration && rhs.m_Concentration) ? m_Concentration->operator==(*rhs.m_Concentration) : m_Concentration == rhs.m_Concentration); + equivilant &= ((m_Mass && rhs.m_Mass) ? m_Mass->operator==(*rhs.m_Mass) : m_Mass == rhs.m_Mass); + equivilant &= ((m_MassCleared && rhs.m_MassCleared) ? m_MassCleared->operator==(*rhs.m_MassCleared) : m_MassCleared == rhs.m_MassCleared); + equivilant &= ((m_MassDeposited && rhs.m_MassDeposited) ? m_MassDeposited->operator==(*rhs.m_MassDeposited) : m_MassDeposited == rhs.m_MassDeposited); + equivilant &= ((m_MassExcreted && rhs.m_MassExcreted) ? m_MassExcreted->operator==(*rhs.m_MassExcreted) : m_MassExcreted == rhs.m_MassExcreted); + equivilant &= ((m_Molarity && rhs.m_Molarity) ? m_Molarity->operator==(*rhs.m_Molarity) : m_Molarity == rhs.m_Molarity); + equivilant &= ((m_PartialPressure && rhs.m_PartialPressure) ? m_PartialPressure->operator==(*rhs.m_PartialPressure) : m_PartialPressure == rhs.m_PartialPressure); + equivilant &= ((m_Saturation && rhs.m_Saturation) ? m_Saturation->operator==(*rhs.m_Saturation) : m_Saturation == rhs.m_Saturation); + equivilant &= m_Compartment.operator==(rhs.m_Compartment); + + // m_Children is not part of the serializtion of SELiquidSubstanceQuantity so we will not + // concider it as part of the equivilance + // if (equivilant) { + // for (auto i = 0; i < m_Children.size(); ++i) { + // equivilant &= (m_Children[i] && rhs.m_Children[i]) + // ? m_Children[i]->operator==(*rhs.m_Children[i]) + // : m_Children[i] == rhs.m_Children[i]; + // } + // } + equivilant &= m_isO2 == rhs.m_isO2 && m_isCO == rhs.m_isCO && m_isCO2 == rhs.m_isCO2; + // Inorder to caluclate a hierarchical saturation, we need these substances - //m_Children is not part of the serializtion of SELiquidSubstanceQuantity so we will not - // concider it as part of the equivilance - //if (equivilant) { - // for (auto i = 0; i < m_Children.size(); ++i) { - // equivilant &= (m_Children[i] && rhs.m_Children[i]) - // ? m_Children[i]->operator==(*rhs.m_Children[i]) - // : m_Children[i] == rhs.m_Children[i]; - // } - //} - equivilant &= m_isO2 == rhs.m_isO2 && m_isCO == rhs.m_isCO && m_isCO2 == rhs.m_isCO2 - // Inorder to caluclate a hierarchical saturation, we need these substances - && ((m_Hb && rhs.m_Hb) ? m_Hb->operator==(*rhs.m_Hb) : m_Hb == rhs.m_Hb) - && ((m_HbO2 && rhs.m_HbO2) ? m_HbO2->operator==(*rhs.m_HbO2) : m_HbO2 == rhs.m_HbO2) - && ((m_HbCO2 && rhs.m_HbCO2) ? m_HbCO2->operator==(*rhs.m_HbCO2) : m_HbCO2 == rhs.m_HbCO2) - && ((m_HbO2CO2 && rhs.m_HbO2CO2) ? m_HbO2CO2->operator==(*rhs.m_HbO2CO2) : m_HbO2CO2 == rhs.m_HbO2CO2) - && ((m_HbCO && rhs.m_HbCO) ? m_HbCO->operator==(*rhs.m_HbCO) : m_HbCO == rhs.m_HbCO); + equivilant &= ((m_Hb && rhs.m_Hb) ? m_Hb->operator==(*rhs.m_Hb) : m_Hb == rhs.m_Hb); + equivilant &= ((m_HbO2 && rhs.m_HbO2) ? m_HbO2->operator==(*rhs.m_HbO2) : m_HbO2 == rhs.m_HbO2); + equivilant &= ((m_HbCO2 && rhs.m_HbCO2) ? m_HbCO2->operator==(*rhs.m_HbCO2) : m_HbCO2 == rhs.m_HbCO2); + equivilant &= ((m_HbO2CO2 && rhs.m_HbO2CO2) ? m_HbO2CO2->operator==(*rhs.m_HbO2CO2) : m_HbO2CO2 == rhs.m_HbO2CO2); + equivilant &= ((m_HbCO && rhs.m_HbCO) ? m_HbCO->operator==(*rhs.m_HbCO) : m_HbCO == rhs.m_HbCO); return equivilant; } diff --git a/projects/biogears/libBiogears/src/cdm/compartment/substances/SESubstanceQuantity.cpp b/projects/biogears/libBiogears/src/cdm/compartment/substances/SESubstanceQuantity.cpp index 080dccbb3..fe2d7981d 100644 --- a/projects/biogears/libBiogears/src/cdm/compartment/substances/SESubstanceQuantity.cpp +++ b/projects/biogears/libBiogears/src/cdm/compartment/substances/SESubstanceQuantity.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/SubstanceQuantity.h" #include namespace biogears { @@ -23,15 +24,5 @@ SESubstanceQuantity::SESubstanceQuantity(SESubstance& sub) SESubstanceQuantity::~SESubstanceQuantity() { } -//------------------------------------------------------------------------------- -bool SESubstanceQuantity::Load(const CDM::SubstanceQuantityData& in) -{ - Clear(); - return true; -} -//------------------------------------------------------------------------------- -void SESubstanceQuantity::Unload(CDM::SubstanceQuantityData& data) -{ - data.Substance(m_Substance.GetName()); -} + } \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/cdm/compartment/thermal/SEThermalCompartment.cpp b/projects/biogears/libBiogears/src/cdm/compartment/thermal/SEThermalCompartment.cpp index aa1e5254b..7eb44a6b5 100644 --- a/projects/biogears/libBiogears/src/cdm/compartment/thermal/SEThermalCompartment.cpp +++ b/projects/biogears/libBiogears/src/cdm/compartment/thermal/SEThermalCompartment.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Compartment.h" #include #include #include @@ -36,74 +37,32 @@ SEThermalCompartment::SEThermalCompartment(const std::string& name, Logger* logg //----------------------------------------------------------------------------- SEThermalCompartment::~SEThermalCompartment() { - Clear(); -} -//----------------------------------------------------------------------------- -void SEThermalCompartment::Clear() -{ - SECompartment::Clear(); SAFE_DELETE(m_HeatTransferRateIn); SAFE_DELETE(m_HeatTransferRateOut); SAFE_DELETE(m_Heat); SAFE_DELETE(m_Temperature); - m_Links.clear(); - m_Children.clear(); - m_Nodes.Clear(); } //----------------------------------------------------------------------------- -bool SEThermalCompartment::Load(const CDM::ThermalCompartmentData& in, SECircuitManager* circuits) +void SEThermalCompartment::Invalidate() { - if (!SECompartment::Load(in, circuits)) - return false; - // Not Loading In/Out HeatTransferRate, those are calculated on demand - if (!in.Child().empty()) - return true; - else if (!in.Node().empty()) { - if (circuits == nullptr) { - Error("Compartment is mapped to circuit nodes, but no circuit manager was provided, cannot load"); - return false; - } - for (auto name : in.Node()) { - SEThermalCircuitNode* node = circuits->GetThermalNode(name); - if (node == nullptr) { - Error("Compartment is mapped to circuit node, " + std::string { name } + ", but provided circuit manager did not have that node"); - return false; - } - MapNode(*node); - } - } else { // Only load these if you don't have children or nodes - if (in.Heat().present()) - GetHeat().Load(in.Heat().get()); - if (in.Temperature().present()) - GetTemperature().Load(in.Temperature().get()); + SECompartment::Invalidate(); + if (m_HeatTransferRateIn && !m_HeatTransferRateIn->IsReadOnly()) { + m_HeatTransferRateIn->Invalidate(); } - return true; -} -//----------------------------------------------------------------------------- -CDM::ThermalCompartmentData* SEThermalCompartment::Unload() -{ - CDM::ThermalCompartmentData* data = new CDM::ThermalCompartmentData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEThermalCompartment::Unload(CDM::ThermalCompartmentData& data) -{ - SECompartment::Unload(data); - for (SEThermalCompartment* child : m_Children) - data.Child().push_back(child->GetName()); - for (SEThermalCircuitNode* nodes : m_Nodes.GetNodes()) - data.Node().push_back(nodes->GetName()); - // Even if you have children or nodes, I am unloading everything, this makes the xml actually usefull... - if (HasHeatTransferRateIn()) - data.HeatTransferRateIn(std::unique_ptr(GetHeatTransferRateIn().Unload())); - if (HasHeatTransferRateOut()) - data.HeatTransferRateOut(std::unique_ptr(GetHeatTransferRateOut().Unload())); - if (HasHeat()) - data.Heat(std::unique_ptr(GetHeat().Unload())); - if (HasTemperature()) - data.Temperature(std::unique_ptr(GetTemperature().Unload())); + if (m_HeatTransferRateOut && !m_HeatTransferRateIn->IsReadOnly()) { + m_HeatTransferRateOut->Invalidate(); + } + if (m_Heat && !m_HeatTransferRateIn->IsReadOnly()) { + m_Heat->Invalidate(); + } + if (m_Temperature && !m_HeatTransferRateIn->IsReadOnly()) { + m_Temperature->Invalidate(); + } + m_Links.clear(); + m_Children.clear(); + m_Nodes.Invalidate(); } + //----------------------------------------------------------------------------- const SEScalar* SEThermalCompartment::GetScalar(const char* name) { diff --git a/projects/biogears/libBiogears/src/cdm/compartment/thermal/SEThermalCompartmentLink.cpp b/projects/biogears/libBiogears/src/cdm/compartment/thermal/SEThermalCompartmentLink.cpp index 2b90db65f..b0e5a874f 100644 --- a/projects/biogears/libBiogears/src/cdm/compartment/thermal/SEThermalCompartmentLink.cpp +++ b/projects/biogears/libBiogears/src/cdm/compartment/thermal/SEThermalCompartmentLink.cpp @@ -9,9 +9,10 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **************************************************************************************/ -#include #include +#include +#include "io/cdm/Compartment.h" #include #include @@ -33,49 +34,9 @@ SEThermalCompartmentLink::SEThermalCompartmentLink(SEThermalCompartment& src, SE SEThermalCompartmentLink::~SEThermalCompartmentLink() { } + //------------------------------------------------------------------------------- -bool SEThermalCompartmentLink::Load(const CDM::ThermalCompartmentLinkData& in, SECircuitManager* circuits) -{ - if (!SECompartmentLink::Load(in, circuits)) - return false; - if (in.Path().present()) { - if (circuits == nullptr) { - Error("Link is mapped to circuit path, " + std::string { in.Path().get() } + ", but no circuit manager was provided, cannot load"); - return false; - } - SEThermalCircuitPath* path = circuits->GetThermalPath(in.Path().get()); - if (path == nullptr) { - Error("Link is mapped to circuit path, " + std::string { in.Path().get() } + ", but provided circuit manager did not have that path"); - return false; - } - MapPath(*path); - } else { - if (in.HeatTransferRate().present()) - const_cast(GetHeatTransferRate()).Load(in.HeatTransferRate().get()); - } - return true; -} -//------------------------------------------------------------------------------- -CDM::ThermalCompartmentLinkData* SEThermalCompartmentLink::Unload() -{ - CDM::ThermalCompartmentLinkData* data = new CDM::ThermalCompartmentLinkData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEThermalCompartmentLink::Unload(CDM::ThermalCompartmentLinkData& data) -{ - SECompartmentLink::Unload(data); - data.SourceCompartment(m_SourceCmpt.GetName()); - data.TargetCompartment(m_TargetCmpt.GetName()); - if (m_Path != nullptr) - data.Path(m_Path->GetName()); - // Even if you have a path, I am unloading everything, this makes the xml actually usefull... - if (HasHeatTransferRate()) - data.HeatTransferRate(std::unique_ptr(GetHeatTransferRate().Unload())); -} -//------------------------------------------------------------------------------- -void SEThermalCompartmentLink::Clear() +void SEThermalCompartmentLink::Invalidate() { m_Path = nullptr; SAFE_DELETE(m_HeatTransferRate); diff --git a/projects/biogears/libBiogears/src/cdm/compartment/tissue/SETissueCompartment.cpp b/projects/biogears/libBiogears/src/cdm/compartment/tissue/SETissueCompartment.cpp index c550725c9..6be558449 100644 --- a/projects/biogears/libBiogears/src/cdm/compartment/tissue/SETissueCompartment.cpp +++ b/projects/biogears/libBiogears/src/cdm/compartment/tissue/SETissueCompartment.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Compartment.h" #include #include #include @@ -44,12 +45,12 @@ SETissueCompartment::SETissueCompartment(const std::string& name, Logger* logger //----------------------------------------------------------------------------- SETissueCompartment::~SETissueCompartment() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SETissueCompartment::Clear() +void SETissueCompartment::Invalidate() { - SECompartment::Clear(); + SECompartment::Invalidate(); SAFE_DELETE(m_AcidicPhospohlipidConcentration); SAFE_DELETE(m_MatrixVolume); SAFE_DELETE(m_MembranePotential); @@ -61,68 +62,7 @@ void SETissueCompartment::Clear() SAFE_DELETE(m_TissueToPlasmaLipoproteinRatio); SAFE_DELETE(m_TotalMass); } -//----------------------------------------------------------------------------- -bool SETissueCompartment::Load(const CDM::TissueCompartmentData& in, SESubstanceManager& subMgr, SECircuitManager* circuits) -{ - if (!SECompartment::Load(in)) - return false; - if (in.AcidicPhospohlipidConcentration().present()) - GetAcidicPhospohlipidConcentration().Load(in.AcidicPhospohlipidConcentration().get()); - if (in.MatrixVolume().present()) - GetMatrixVolume().Load(in.MatrixVolume().get()); - if (in.MembranePotential().present()) - GetMembranePotential().Load(in.MembranePotential().get()); - if (in.NeutralLipidsVolumeFraction().present()) - GetNeutralLipidsVolumeFraction().Load(in.NeutralLipidsVolumeFraction().get()); - if (in.NeutralPhospholipidsVolumeFraction().present()) - GetNeutralPhospholipidsVolumeFraction().Load(in.NeutralPhospholipidsVolumeFraction().get()); - if (in.ReflectionCoefficient().present()) - GetReflectionCoefficient().Load(in.ReflectionCoefficient().get()); - if (in.TissueToPlasmaAlbuminRatio().present()) - GetTissueToPlasmaAlbuminRatio().Load(in.TissueToPlasmaAlbuminRatio().get()); - if (in.TissueToPlasmaAlphaAcidGlycoproteinRatio().present()) - GetTissueToPlasmaAlphaAcidGlycoproteinRatio().Load(in.TissueToPlasmaAlphaAcidGlycoproteinRatio().get()); - if (in.TissueToPlasmaLipoproteinRatio().present()) - GetTissueToPlasmaLipoproteinRatio().Load(in.TissueToPlasmaLipoproteinRatio().get()); - if (in.TotalMass().present()) - GetTotalMass().Load(in.TotalMass().get()); - return true; -} -//----------------------------------------------------------------------------- -CDM::TissueCompartmentData* SETissueCompartment::Unload() -{ - CDM::TissueCompartmentData* data = new CDM::TissueCompartmentData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SETissueCompartment::Unload(CDM::TissueCompartmentData& data) -{ - SECompartment::Unload(data); - if (HasAcidicPhospohlipidConcentration()) - data.AcidicPhospohlipidConcentration(std::unique_ptr(m_AcidicPhospohlipidConcentration->Unload())); - if (HasMatrixVolume()) - data.MatrixVolume(std::unique_ptr(m_MatrixVolume->Unload())); - if (HasMembranePotential()) - data.MembranePotential(std::unique_ptr(m_MembranePotential->Unload())); - if (HasNeutralLipidsVolumeFraction()) - data.NeutralLipidsVolumeFraction(std::unique_ptr(m_NeutralLipidsVolumeFraction->Unload())); - if (HasNeutralPhospholipidsVolumeFraction()) - data.NeutralPhospholipidsVolumeFraction(std::unique_ptr(m_NeutralPhospholipidsVolumeFraction->Unload())); - if (HasReflectionCoefficient()) - data.ReflectionCoefficient(std::unique_ptr(m_ReflectionCoefficient->Unload())); - if (HasTissueToPlasmaAlbuminRatio()) - data.TissueToPlasmaAlbuminRatio(std::unique_ptr(m_TissueToPlasmaAlbuminRatio->Unload())); - if (HasTissueToPlasmaAlbuminRatio()) - data.TissueToPlasmaAlbuminRatio(std::unique_ptr(m_TissueToPlasmaAlbuminRatio->Unload())); - if (HasTissueToPlasmaAlphaAcidGlycoproteinRatio()) - data.TissueToPlasmaAlphaAcidGlycoproteinRatio(std::unique_ptr(m_TissueToPlasmaAlphaAcidGlycoproteinRatio->Unload())); - if (HasTissueToPlasmaLipoproteinRatio()) - data.TissueToPlasmaLipoproteinRatio(std::unique_ptr(m_TissueToPlasmaLipoproteinRatio->Unload())); - if (HasTotalMass()) - data.TotalMass(std::unique_ptr(m_TotalMass->Unload())); -} //----------------------------------------------------------------------------- const SEScalar* SETissueCompartment::GetScalar(const char* name) { diff --git a/projects/biogears/libBiogears/src/cdm/engine/PhysiologyEngineConfiguration.cpp b/projects/biogears/libBiogears/src/cdm/engine/PhysiologyEngineConfiguration.cpp index 00a94c0e3..f2b3029fe 100644 --- a/projects/biogears/libBiogears/src/cdm/engine/PhysiologyEngineConfiguration.cpp +++ b/projects/biogears/libBiogears/src/cdm/engine/PhysiologyEngineConfiguration.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/EngineConfiguration.h" +#include "io/cdm/Property.h" + #include #include #include @@ -33,28 +36,30 @@ PhysiologyEngineConfiguration::PhysiologyEngineConfiguration(Logger* logger) m_TimedStabilizationCriteria = nullptr; m_DynamicStabilizationCriteria = nullptr; m_TimeStep = nullptr; - m_WritePatientBaselineFile = CDM::enumOnOff::value(-1); + m_WritePatientBaselineFile = SEOnOff::Invalid; } //----------------------------------------------------------------------------- PhysiologyEngineConfiguration::~PhysiologyEngineConfiguration() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void PhysiologyEngineConfiguration::Clear() +void PhysiologyEngineConfiguration::Invalidate() { SAFE_DELETE(m_ECGInterpolator); RemoveStabilizationCriteria(); SAFE_DELETE(m_TimeStep); - m_WritePatientBaselineFile = CDM::enumOnOff::value(-1); + m_WritePatientBaselineFile = SEOnOff::Invalid; } //----------------------------------------------------------------------------- void PhysiologyEngineConfiguration::Merge(const PhysiologyEngineConfiguration& from) { m_Merge = true; - CDM_COPY((&from), this); + CDM::PhysiologyEngineConfigurationData middle; + io::EngineConfiguration::Marshall(from, middle); + io::EngineConfiguration::UnMarshall(middle, *this); m_Merge = false; } //----------------------------------------------------------------------------- @@ -89,91 +94,10 @@ bool PhysiologyEngineConfiguration::Load(const std::string& file) Info(ss); return true; } - return Load(*pData); -} -//----------------------------------------------------------------------------- - -bool PhysiologyEngineConfiguration::Load(const CDM::PhysiologyEngineConfigurationData& in) -{ - if (!m_Merge) - Clear(); // Reset only if we are not merging - - if (in.TimeStep().present()) - GetTimeStep().Load(in.TimeStep().get()); - if (in.WritePatientBaselineFile().present()) - SetWritePatientBaselineFile(in.WritePatientBaselineFile().get()); - - if (in.ElectroCardioGramInterpolatorFile().present()) { - if (!GetECGInterpolator().LoadWaveforms(in.ElectroCardioGramInterpolatorFile().get())) { - Error("Unable to load ElectroCardioGram Waveforms file"); - return false; - } - } else if (in.ElectroCardioGramInterpolator().present()) { - if (!GetECGInterpolator().Load(in.ElectroCardioGramInterpolator().get())) { - Error("Unable to load ElectroCardioGram Waveforms"); - return false; - } - } - - std::unique_ptr sData; - const CDM::PhysiologyEngineTimedStabilizationData* tData = nullptr; - const CDM::PhysiologyEngineDynamicStabilizationData* dData = nullptr; - if (in.StabilizationCriteriaFile().present()) { - auto io = m_Logger->GetIoManager().lock(); - auto possible_path = io->FindConfigFile(in.StabilizationCriteriaFile().get().c_str()); - if (possible_path.empty()) { -#ifdef BIOGEARS_IO_PRESENT - size_t content_size; - auto content = io::get_embedded_config_file(in.StabilizationCriteriaFile().get().c_str(), content_size); - sData = Serializer::ReadBuffer((XMLByte*)content, content_size, m_Logger); -#endif - } else { - sData = Serializer::ReadFile(possible_path, m_Logger); - } - if (sData == nullptr) { - Error("Unable to load Stabilization Criteria file"); - return false; - } - tData = dynamic_cast(sData.get()); - dData = dynamic_cast(sData.get()); - } else if (in.StabilizationCriteria().present()) { - tData = dynamic_cast(&in.StabilizationCriteria().get()); - dData = dynamic_cast(&in.StabilizationCriteria().get()); - } - if (tData != nullptr) { - if (!GetTimedStabilizationCriteria().Load(*tData)) { - Error("Unable to load Stabilization Criteria"); - return false; - } - } else if (dData != nullptr) { - if (!GetDynamicStabilizationCriteria().Load(*dData)) { - Error("Unable to load Stabilization Criteria"); - return false; - } - } - + io::EngineConfiguration::UnMarshall(*pData, *this); return true; } //----------------------------------------------------------------------------- -CDM::PhysiologyEngineConfigurationData* PhysiologyEngineConfiguration::Unload() const -{ - CDM::PhysiologyEngineConfigurationData* data(new CDM::PhysiologyEngineConfigurationData()); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void PhysiologyEngineConfiguration::Unload(CDM::PhysiologyEngineConfigurationData& data) const -{ - if (HasECGInterpolator()) - data.ElectroCardioGramInterpolator(std::unique_ptr(m_ECGInterpolator->Unload())); - if (HasStabilizationCriteria()) - data.StabilizationCriteria(std::unique_ptr(m_StabilizationCriteria->Unload())); - if (HasTimeStep()) - data.TimeStep(std::unique_ptr(m_TimeStep->Unload())); - if (HasWritePatientBaselineFile()) - data.WritePatientBaselineFile(m_WritePatientBaselineFile); -} -//----------------------------------------------------------------------------- bool PhysiologyEngineConfiguration::HasECGInterpolator() const { return m_ECGInterpolator != nullptr; @@ -310,4 +234,4 @@ bool PhysiologyEngineConfiguration::operator!=(PhysiologyEngineConfiguration con return !(*this == rhs); } //----------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/projects/biogears/libBiogears/src/cdm/engine/PhysiologyEngineDynamicStabilization.cpp b/projects/biogears/libBiogears/src/cdm/engine/PhysiologyEngineDynamicStabilization.cpp index c47816bc8..51fc9848b 100644 --- a/projects/biogears/libBiogears/src/cdm/engine/PhysiologyEngineDynamicStabilization.cpp +++ b/projects/biogears/libBiogears/src/cdm/engine/PhysiologyEngineDynamicStabilization.cpp @@ -14,6 +14,7 @@ specific language governing permissions and limitations under the License. // Standad Includes #include // Project Includes +#include "io/cdm/EngineConfiguration.h" #include #include #include @@ -251,7 +252,7 @@ bool PhysiologyEngineDynamicStabilization::Merge() // From there find the PropertyConvergence with the largest %diff // Add that pointer to the m_MergedConditions (will need new friend method as that method should not be public) Info("Merging Conditions"); - m_MergedConditions.Clear(); + m_MergedConditions.Invalidate(); m_MergedConditions.SetName("MergedCondition"); // May want to include what conditions we are combining in the name? double time_s; double maxConv_s = 0; @@ -307,7 +308,7 @@ bool PhysiologyEngineDynamicStabilization::Merge() m_MergedConditions.m_PropertyConvergence.push_back(pConv); } - DELETE_MAP_SECOND(cMap); // Clean up our Map + DELETE_MAP_OF_POINTERS(cMap); // Clean up our Map m_MergedConditions.GetConvergenceTime().SetValue(maxConv_s, TimeUnit::s); m_ss << "Merged Convergence Time : " << m_MergedConditions.GetConvergenceTime(); Info(m_ss); @@ -351,61 +352,24 @@ PhysiologyEngineDynamicStabilization::PhysiologyEngineDynamicStabilization(Logge //----------------------------------------------------------------------------- PhysiologyEngineDynamicStabilization::~PhysiologyEngineDynamicStabilization() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void PhysiologyEngineDynamicStabilization::Clear() +void PhysiologyEngineDynamicStabilization::Invalidate() { - PhysiologyEngineStabilization::Clear(); + PhysiologyEngineStabilization::Invalidate(); m_MergedConditions.m_PropertyConvergence.clear(); // \todo Make copies of stabilization criteria - m_MergedConditions.Clear(); + m_MergedConditions.Invalidate(); m_ActiveConditions.clear(); - m_RestingCriteria.Clear(); + m_RestingCriteria.Invalidate(); SAFE_DELETE(m_FeedbackCriteria); DELETE_VECTOR(m_ConditionCriteria); } //----------------------------------------------------------------------------- -bool PhysiologyEngineDynamicStabilization::Load(const CDM::PhysiologyEngineDynamicStabilizationData& in) -{ - PhysiologyEngineStabilization::Load(in); - GetRestingCriteria().Load(in.RestingStabilizationCriteria()); - if (in.FeedbackStabilizationCriteria().present()) - GetFeedbackCriteria().Load(in.FeedbackStabilizationCriteria().get()); - for (auto cData : in.ConditionStabilization()) { - PhysiologyEngineDynamicStabilizationCriteria* c = new PhysiologyEngineDynamicStabilizationCriteria(GetLogger()); - c->Load(cData.Criteria()); - c->SetName(cData.Name()); - AddConditionCriteria(*c); - } - return true; -} -//----------------------------------------------------------------------------- -CDM::PhysiologyEngineDynamicStabilizationData* PhysiologyEngineDynamicStabilization::Unload() const -{ - CDM::PhysiologyEngineDynamicStabilizationData* data(new CDM::PhysiologyEngineDynamicStabilizationData()); - Unload(*data); - return data; +bool PhysiologyEngineDynamicStabilization::Load(char const* file) { + return Load(std::string(file)); } -//----------------------------------------------------------------------------- -void PhysiologyEngineDynamicStabilization::Unload(CDM::PhysiologyEngineDynamicStabilizationData& data) const -{ - PhysiologyEngineStabilization::Unload(data); - data.RestingStabilizationCriteria(std::unique_ptr(GetRestingCriteria().Unload())); - if (HasFeedbackCriteria()) - data.FeedbackStabilizationCriteria(std::unique_ptr(GetFeedbackCriteria()->Unload())); - for (auto& c : m_ConditionCriteria) { - std::unique_ptr csData(new CDM::PhysiologyEngineDynamicConditionStabilizationData()); - csData->Criteria(std::unique_ptr(c->Unload())); - csData->Name(c->GetName()); - data.ConditionStabilization().push_back(*csData); - } -} -//----------------------------------------------------------------------------- -bool PhysiologyEngineDynamicStabilization::Load(const char* file) -{ - return Load(std::string { file }); -} -//----------------------------------------------------------------------------- + //----------------------------------------------------------------------------- bool PhysiologyEngineDynamicStabilization::Load(const std::string& file) { CDM::PhysiologyEngineDynamicStabilizationData* pData; @@ -430,7 +394,8 @@ bool PhysiologyEngineDynamicStabilization::Load(const std::string& file) Info(ss); return false; } - return Load(*pData); + io::EngineConfiguration::UnMarshall(*pData, *this); + return true; } //----------------------------------------------------------------------------- PhysiologyEngineDynamicStabilizationCriteria& PhysiologyEngineDynamicStabilization::GetRestingCriteria() @@ -520,10 +485,10 @@ PhysiologyEngineDynamicStabilizationCriteria::PhysiologyEngineDynamicStabilizati //----------------------------------------------------------------------------- PhysiologyEngineDynamicStabilizationCriteria::~PhysiologyEngineDynamicStabilizationCriteria() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void PhysiologyEngineDynamicStabilizationCriteria::Clear() +void PhysiologyEngineDynamicStabilizationCriteria::Invalidate() { SAFE_DELETE(m_ConvergenceTime); SAFE_DELETE(m_MinimumReactionTime); @@ -531,43 +496,6 @@ void PhysiologyEngineDynamicStabilizationCriteria::Clear() DELETE_VECTOR(m_PropertyConvergence); } //----------------------------------------------------------------------------- -bool PhysiologyEngineDynamicStabilizationCriteria::Load(const CDM::PhysiologyEngineDynamicStabilizationCriteriaData& in) -{ - Clear(); - GetConvergenceTime().Load(in.ConvergenceTime()); - GetMinimumReactionTime().Load(in.MinimumReactionTime()); - GetMaximumAllowedStabilizationTime().Load(in.MaximumAllowedStabilizationTime()); - for (auto pcData : in.PropertyConvergence()) - CreateSystemPropertyConvergence(pcData.PercentDifference(), pcData.Name()); - return true; -} -//----------------------------------------------------------------------------- -CDM::PhysiologyEngineDynamicStabilizationCriteriaData* PhysiologyEngineDynamicStabilizationCriteria::Unload() const -{ - CDM::PhysiologyEngineDynamicStabilizationCriteriaData* data(new CDM::PhysiologyEngineDynamicStabilizationCriteriaData()); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void PhysiologyEngineDynamicStabilizationCriteria::Unload(CDM::PhysiologyEngineDynamicStabilizationCriteriaData& data) const -{ - if (m_ConvergenceTime) { - data.ConvergenceTime(std::unique_ptr(m_ConvergenceTime->Unload())); - } - if (m_MinimumReactionTime) { - data.MinimumReactionTime(std::unique_ptr(m_MinimumReactionTime->Unload())); - } - if (m_MaximumAllowedStabilizationTime) { - data.MaximumAllowedStabilizationTime(std::unique_ptr(m_MaximumAllowedStabilizationTime->Unload())); - } - for (auto pc : m_PropertyConvergence) { - std::unique_ptr pcData(new CDM::PhysiologyEngineDynamicStabilizationCriteriaPropertyData()); - pcData->Name(pc->GetDataRequest().GetName()); - pcData->PercentDifference(pc->m_Target); - data.PropertyConvergence().push_back(*pcData.get()); - } -} -//----------------------------------------------------------------------------- std::string PhysiologyEngineDynamicStabilizationCriteria::GetName() const { return m_Name; diff --git a/projects/biogears/libBiogears/src/cdm/engine/PhysiologyEngineStabilization.cpp b/projects/biogears/libBiogears/src/cdm/engine/PhysiologyEngineStabilization.cpp index df728c34d..686ab3dff 100644 --- a/projects/biogears/libBiogears/src/cdm/engine/PhysiologyEngineStabilization.cpp +++ b/projects/biogears/libBiogears/src/cdm/engine/PhysiologyEngineStabilization.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/EngineConfiguration.h" #include #include #include @@ -21,61 +22,22 @@ PhysiologyEngineStabilization::PhysiologyEngineStabilization(Logger* logger) : Loggable(logger) { m_StabilizationDuration = nullptr; - m_currentTime = nullptr; - + m_CurrentTime = nullptr; } //------------------------------------------------------------------------------- PhysiologyEngineStabilization::~PhysiologyEngineStabilization() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void PhysiologyEngineStabilization::Clear() +void PhysiologyEngineStabilization::Invalidate() { m_LogProgress = true; m_Canceled = false; SAFE_DELETE(m_StabilizationDuration); - SAFE_DELETE(m_currentTime); + SAFE_DELETE(m_CurrentTime); } -//------------------------------------------------------------------------------- -bool PhysiologyEngineStabilization::Load(const CDM::PhysiologyEngineStabilizationData& in) -{ - Clear(); - if (in.Canceled().present()) { - m_Canceled = in.Canceled().get(); - } - if (in.LogProgress().present()) { - m_LogProgress = in.LogProgress().get(); - } - if (in.CurrentTime().present()) { - GetCurrentTime().Load(in.CurrentTime().get()); - } - if (in.StabilizationDuration().present()) { - GetStabilizationDuration().Load(in.StabilizationDuration().get()); - } - return true; -} -//------------------------------------------------------------------------------- -CDM::PhysiologyEngineStabilizationData* PhysiologyEngineStabilization::Unload() const -{ - CDM::PhysiologyEngineStabilizationData* data(new CDM::PhysiologyEngineStabilizationData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void PhysiologyEngineStabilization::Unload(CDM::PhysiologyEngineStabilizationData& data) const -{ - data.Canceled(m_Canceled); - data.LogProgress(m_LogProgress); - if (HasCurrentTime()) { - data.CurrentTime(std::unique_ptr(m_currentTime->Unload())); - } - if (HasStabilizationDuration()) { - data.StabilizationDuration(std::unique_ptr(m_StabilizationDuration->Unload())); - } - data.CurrentTime(); -} //------------------------------------------------------------------------------- void PhysiologyEngineStabilization::LogProgress(bool b) { @@ -87,7 +49,7 @@ void PhysiologyEngineStabilization::CancelStabilization() m_Canceled = true; } //------------------------------------------------------------------------------- -bool PhysiologyEngineStabilization::HasStabilizationDuration() const +bool PhysiologyEngineStabilization::HasStabilizationDuration() const { return m_StabilizationDuration == nullptr ? false : m_StabilizationDuration->IsValid(); } @@ -101,26 +63,33 @@ SEScalarTime& PhysiologyEngineStabilization::GetStabilizationDuration() //------------------------------------------------------------------------------- bool PhysiologyEngineStabilization::HasCurrentTime() const { - return m_currentTime == nullptr ? false : m_currentTime->IsValid(); + return m_CurrentTime == nullptr ? false : m_CurrentTime->IsValid(); } //------------------------------------------------------------------------------- SEScalarTime& PhysiologyEngineStabilization::GetCurrentTime() { - if (m_currentTime == nullptr) - m_currentTime = new SEScalarTime(); - return *m_currentTime; + if (m_CurrentTime == nullptr) + m_CurrentTime = new SEScalarTime(); + return *m_CurrentTime; } //------------------------------------------------------------------------------- + bool PhysiologyEngineStabilization::operator==(PhysiologyEngineStabilization const& rhs) const { - return m_Canceled == rhs.m_Canceled - && rhs.m_LogProgress == rhs.m_LogProgress - && ((m_currentTime && rhs.m_currentTime) ? m_currentTime->operator==(*rhs.m_currentTime) : m_currentTime == rhs.m_currentTime) - && ((m_StabilizationDuration && rhs.m_StabilizationDuration) ? m_StabilizationDuration->operator==(*rhs.m_StabilizationDuration) : m_StabilizationDuration == rhs.m_StabilizationDuration); + bool equivilant = m_Canceled == rhs.m_Canceled; + ; + equivilant &= m_LogProgress == rhs.m_LogProgress; + equivilant &= ((m_CurrentTime && rhs.m_CurrentTime) ? m_CurrentTime->operator==(*rhs.m_CurrentTime) + : m_CurrentTime == rhs.m_CurrentTime); + equivilant &= ((m_StabilizationDuration && rhs.m_StabilizationDuration) + ? m_StabilizationDuration->operator==(*rhs.m_StabilizationDuration) + : m_StabilizationDuration == rhs.m_StabilizationDuration); + return equivilant; } + bool PhysiologyEngineStabilization::operator!=(PhysiologyEngineStabilization const& rhs) const { return !(*this == rhs); } //------------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/projects/biogears/libBiogears/src/cdm/engine/PhysiologyEngineTimedStabilization.cpp b/projects/biogears/libBiogears/src/cdm/engine/PhysiologyEngineTimedStabilization.cpp index 8d0cb4142..bf6a79163 100644 --- a/projects/biogears/libBiogears/src/cdm/engine/PhysiologyEngineTimedStabilization.cpp +++ b/projects/biogears/libBiogears/src/cdm/engine/PhysiologyEngineTimedStabilization.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/EngineConfiguration.h" #include #include #include @@ -91,12 +92,12 @@ bool PhysiologyEngineTimedStabilization::Stabilize(PhysiologyEngine& engine, con // if it is we can break our loop. This will allow us to record our stabilization data engine.AdvanceModelTime(); - m_currentTime->IncrementValue(dT_s, TimeUnit::s); + m_CurrentTime->IncrementValue(dT_s, TimeUnit::s); if (m_LogProgress) { statusTime_s += dT_s; if (statusTime_s > statusStep_s) { statusTime_s = 0; - ss << "Current Time is " << m_currentTime->GetValue(TimeUnit::s) << "s, it took " + ss << "Current Time is " << m_CurrentTime->GetValue(TimeUnit::s) << "s, it took " << profiler.GetElapsedTime_s("Status") << "s to simulate the past " << statusStep_s << "s" << std::flush; profiler.Reset("Status"); @@ -127,49 +128,17 @@ PhysiologyEngineTimedStabilization::PhysiologyEngineTimedStabilization(Logger* l //------------------------------------------------------------------------------- PhysiologyEngineTimedStabilization::~PhysiologyEngineTimedStabilization() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void PhysiologyEngineTimedStabilization::Clear() +void PhysiologyEngineTimedStabilization::Invalidate() { - PhysiologyEngineStabilization::Clear(); + PhysiologyEngineStabilization::Invalidate(); m_RestingStabilizationTime.Invalidate(); SAFE_DELETE(m_FeedbackStabilizationTime); DELETE_VECTOR(m_ConditionCriteria); } //------------------------------------------------------------------------------- -bool PhysiologyEngineTimedStabilization::Load(const CDM::PhysiologyEngineTimedStabilizationData& in) -{ - PhysiologyEngineStabilization::Load(in); - GetRestingStabilizationTime().Load(in.RestingStabilizationTime()); - if (in.FeedbackStabilizationTime().present()) - GetFeedbackStabilizationTime().Load(in.FeedbackStabilizationTime().get()); - for (auto cc : in.ConditionStabilization()) { - PhysiologyEngineTimedStabilizationCriteria* sc = new PhysiologyEngineTimedStabilizationCriteria(nullptr); - sc->Load(cc); - m_ConditionCriteria.push_back(sc); - } - return true; -} -//------------------------------------------------------------------------------- -CDM::PhysiologyEngineTimedStabilizationData* PhysiologyEngineTimedStabilization::Unload() const -{ - CDM::PhysiologyEngineTimedStabilizationData* data(new CDM::PhysiologyEngineTimedStabilizationData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void PhysiologyEngineTimedStabilization::Unload(CDM::PhysiologyEngineTimedStabilizationData& data) const -{ - PhysiologyEngineStabilization::Unload(data); - data.RestingStabilizationTime(std::unique_ptr(m_RestingStabilizationTime.Unload())); - if (HasFeedbackStabilizationTime()) - data.FeedbackStabilizationTime(std::unique_ptr(m_FeedbackStabilizationTime->Unload())); - for (auto cc : m_ConditionCriteria) { - data.ConditionStabilization().push_back(std::unique_ptr(cc->Unload())); - } -} -//------------------------------------------------------------------------------- bool PhysiologyEngineTimedStabilization::Load(const char* file) { return Load(std::string { file }); @@ -199,7 +168,8 @@ bool PhysiologyEngineTimedStabilization::Load(const std::string& file) Info(ss); return false; } - return Load(*pData); + io::EngineConfiguration::UnMarshall(*pData, *this); + return true; } //------------------------------------------------------------------------------- SEScalarTime& PhysiologyEngineTimedStabilization::GetRestingStabilizationTime() @@ -305,41 +275,20 @@ const std::vector& PhysiologyEngine PhysiologyEngineTimedStabilizationCriteria::PhysiologyEngineTimedStabilizationCriteria(Logger* logger) : Loggable(logger) { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- PhysiologyEngineTimedStabilizationCriteria::~PhysiologyEngineTimedStabilizationCriteria() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void PhysiologyEngineTimedStabilizationCriteria::Clear() +void PhysiologyEngineTimedStabilizationCriteria::Invalidate() { InvalidateName(); m_Time.Invalidate(); } //------------------------------------------------------------------------------- -bool PhysiologyEngineTimedStabilizationCriteria::Load(const CDM::PhysiologyEngineTimedConditionStabilizationData& in) -{ - Clear(); - SetName(in.Name()); - GetTime().Load(in.Time()); - return true; -} -//------------------------------------------------------------------------------- -CDM::PhysiologyEngineTimedConditionStabilizationData* PhysiologyEngineTimedStabilizationCriteria::Unload() const -{ - CDM::PhysiologyEngineTimedConditionStabilizationData* data(new CDM::PhysiologyEngineTimedConditionStabilizationData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void PhysiologyEngineTimedStabilizationCriteria::Unload(CDM::PhysiologyEngineTimedConditionStabilizationData& data) const -{ - data.Name(m_Name); - data.Time(std::unique_ptr(GetTime().Unload())); -} -//------------------------------------------------------------------------------- std::string PhysiologyEngineTimedStabilizationCriteria::GetName() const { return m_Name; diff --git a/projects/biogears/libBiogears/src/cdm/engine/PhysiologyEngineTrack.cpp b/projects/biogears/libBiogears/src/cdm/engine/PhysiologyEngineTrack.cpp index 8b3b6eb6f..9d41978d9 100644 --- a/projects/biogears/libBiogears/src/cdm/engine/PhysiologyEngineTrack.cpp +++ b/projects/biogears/libBiogears/src/cdm/engine/PhysiologyEngineTrack.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/EngineConfiguration.h" #include #include #include @@ -181,14 +182,14 @@ PhysiologyEngineTrack& PhysiologyEngineTrack::operator=(PhysiologyEngineTrack&& } PhysiologyEngineTrack::~PhysiologyEngineTrack() { - Clear(); + Invalidate(); } -void PhysiologyEngineTrack::Clear() +void PhysiologyEngineTrack::Invalidate() { ResetFile(); m_ForceConnection = false; - DELETE_MAP_SECOND(m_Request2Scalar); + DELETE_MAP_OF_POINTERS(m_Request2Scalar); } void PhysiologyEngineTrack::ResetFile() diff --git a/projects/biogears/libBiogears/src/cdm/patient/SENutrition.cpp b/projects/biogears/libBiogears/src/cdm/patient/SENutrition.cpp index ebbf673d0..3d0a8a379 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/SENutrition.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/SENutrition.cpp @@ -11,13 +11,17 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Patient.h" +#include "io/cdm/PatientNutrition.h" + #include #include #include #include +#include #include #include -#include + #ifdef BIOGEARS_IO_PRESENT #include #endif @@ -37,10 +41,10 @@ SENutrition::SENutrition(Logger* logger) //----------------------------------------------------------------------------- SENutrition::~SENutrition() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SENutrition::Clear() +void SENutrition::Invalidate() { m_Name = ""; SAFE_DELETE(m_Carbohydrate); @@ -75,56 +79,6 @@ void SENutrition::Increment(const SENutrition& from) GetWater().Increment(*from.m_Water); } //----------------------------------------------------------------------------- -bool SENutrition::Load(const CDM::NutritionData& in, std::default_random_engine *rd) -{ - Clear(); - - if (in.Name().present()) { - m_Name = in.Name().get(); - } else { - m_Name = "Standard Meal"; - } - if (in.Carbohydrate().present()) - GetCarbohydrate().Load(in.Carbohydrate().get(), rd); - if (in.Fat().present()) - GetFat().Load(in.Fat().get(), rd); - if (in.Protein().present()) - GetProtein().Load(in.Protein().get(), rd); - if (in.Calcium().present()) - GetCalcium().Load(in.Calcium().get(), rd); - if (in.Sodium().present()) - GetSodium().Load(in.Sodium().get(), rd); - if (in.Water().present()) - GetWater().Load(in.Water().get(), rd); - return true; -} -//----------------------------------------------------------------------------- -CDM::NutritionData* SENutrition::Unload() const -{ - CDM::NutritionData* data = new CDM::NutritionData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SENutrition::Unload(CDM::NutritionData& data) const -{ - if (!m_Name.empty()) { - data.Name(m_Name); - } - if (m_Carbohydrate != nullptr) - data.Carbohydrate(std::unique_ptr(m_Carbohydrate->Unload())); - if (m_Fat != nullptr) - data.Fat(std::unique_ptr(m_Fat->Unload())); - if (m_Protein != nullptr) - data.Protein(std::unique_ptr(m_Protein->Unload())); - if (m_Calcium != nullptr) - data.Calcium(std::unique_ptr(m_Calcium->Unload())); - if (m_Sodium != nullptr) - data.Sodium(std::unique_ptr(m_Sodium->Unload())); - if (m_Water != nullptr) - data.Water(std::unique_ptr(m_Water->Unload())); -} -//----------------------------------------------------------------------------- const SEScalar* SENutrition::GetScalar(const char* name) { return GetScalar(std::string { name }); @@ -176,7 +130,8 @@ bool SENutrition::Load(const std::string& given) Error(ss); return false; } - return Load(*pData); + io::PatientNutrition::UnMarshall(*pData, *this); + return true; } //----------------------------------------------------------------------------- std::string SENutrition::GetName() const @@ -341,6 +296,18 @@ double SENutrition::GetWeight(const MassUnit& unit) const return w; } //----------------------------------------------------------------------------- +bool SENutrition::IsValid() const { + //Todo: Refine the meaning if IsValid nutrition. Is it a meal with all members at least at Zero + // or is it a meal with a Name and at least one member. + return HasName() + && (HasCarbohydrate() + || HasFat() + || HasProtein() + || HasCalcium() + || HasSodium() + || HasWater()); +} +//----------------------------------------------------------------------------- void SENutrition::ToString(std::ostream& str) const { str << "Nutrient Contents"; diff --git a/projects/biogears/libBiogears/src/cdm/patient/SEPatient.cpp b/projects/biogears/libBiogears/src/cdm/patient/SEPatient.cpp index 18ff50812..97f9e0e07 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/SEPatient.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/SEPatient.cpp @@ -11,11 +11,23 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Patient.h" #include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include #include - #ifdef BIOGEARS_IO_PRESENT #include #endif @@ -24,9 +36,9 @@ specific language governing permissions and limitations under the License. #include namespace std { -template class map; -template class map; -template class map; +template class map; +template class map; +template class map; } namespace biogears { SEPatient::SEPatient(Logger* logger) @@ -35,7 +47,7 @@ SEPatient::SEPatient(Logger* logger) m_EventHandler = nullptr; m_Name = ""; - m_Gender = (CDM::enumSex::value)-1; + m_Sex = SESex::Invalid; m_Age = nullptr; m_Weight = nullptr; m_Height = nullptr; @@ -43,7 +55,7 @@ SEPatient::SEPatient(Logger* logger) m_AlveoliSurfaceArea = nullptr; m_BasalMetabolicRate = nullptr; m_BloodRh = true; - m_BloodType = (CDM::enumBloodType::value)-1; + m_BloodType = SEBloodType::Invalid; m_BloodVolumeBaseline = nullptr; m_BodyDensity = nullptr; m_BodyFatFraction = nullptr; @@ -73,8 +85,10 @@ SEPatient::SEPatient(Logger* logger) m_TotalLungCapacity = nullptr; m_VitalCapacity = nullptr; - for (CDM::enumPatientEvent::value key = static_cast(0); key < CDM::enumPatientEvent::TotalPatientEvents; key = static_cast(key + 1)) { - // CDM::enumPatientEvent::value is a code generated C style enum. + for (SEPatientEventType key = SEPatientEventType::_begin; + key < SEPatientEventType::_end; + key = static_cast((size_t)key + 1)) { + // SEPatientEventType is a code generated C style enum. // To my knowladge it must be conitnguous as XSD does not support assinigng manual values to XML Enums that are use dto generated C++ counterpart // Short story is the goal is to set every possible enum to a value of false and accomidate future extensions ot the enum. m_EventState[key] = false; @@ -84,7 +98,7 @@ SEPatient::SEPatient(Logger* logger) //----------------------------------------------------------------------------- SEPatient::~SEPatient() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- bool SEPatient::Load(const char* patientFile) @@ -119,15 +133,18 @@ bool SEPatient::Load(const std::string& patientFile) Error(ss); return false; } - return Load(*pData); + io::Patient::UnMarshall(*pData, *this); + return true; } //----------------------------------------------------------------------------- -void SEPatient::Clear() +void SEPatient::Invalidate() { m_EventHandler = nullptr; - for (CDM::enumPatientEvent::value key = static_cast(0); key < CDM::enumPatientEvent::TotalPatientEvents; key = static_cast(key + 1)) { - // CDM::enumPatientEvent::value is a code generated C style enum. + for (SEPatientEventType key = SEPatientEventType::_begin; + key < SEPatientEventType::_end; + key = static_cast((size_t)key + 1)) { + // SEPatientEventType is a code generated C style enum. // To my knowladge it must be conitnguous as XSD does not support assinigng manual values to XML Enums that are use dto generated C++ counterpart // Short story is the goal is to set every possible enum to a value of false and accomidate future extensions ot the enum. m_EventState[key] = false; @@ -135,7 +152,7 @@ void SEPatient::Clear() } m_Name = ""; - m_Gender = (CDM::enumSex::value)-1; + m_Sex = SESex::Invalid; SAFE_DELETE(m_Age); SAFE_DELETE(m_Weight); SAFE_DELETE(m_Height); @@ -143,7 +160,7 @@ void SEPatient::Clear() SAFE_DELETE(m_AlveoliSurfaceArea); SAFE_DELETE(m_BasalMetabolicRate); m_BloodRh = true; - m_BloodType = (CDM::enumBloodType::value)-1; + m_BloodType = SEBloodType::Invalid; SAFE_DELETE(m_BloodVolumeBaseline); SAFE_DELETE(m_BodyDensity); SAFE_DELETE(m_BodyFatFraction); @@ -251,293 +268,12 @@ const SEScalar* SEPatient::GetScalar(const std::string& name) return nullptr; } //----------------------------------------------------------------------------- -bool SEPatient::Load(const CDM::PatientData& in) -{ - Clear(); - - m_Name = in.Name(); - if (in.Annotation().present()) { - m_Annotation = in.Annotation().get(); - } - if (in.Sex().present()) { - m_Gender = in.Sex().get(); - } - if (in.Age().present()) { - GetAge().Load(in.Age().get()); - } - if (in.Weight().present()) { - GetWeight().Load(in.Weight().get()); - } - if (in.Height().present()) { - GetHeight().Load(in.Height().get()); - } - if (in.BodyMassIndex().present()) { - if (!in.Weight().present() && in.Height().present()) { - CalculateWeightByBMI(in.BodyMassIndex().get()); - } else if (in.Weight().present() && !in.Height().present()) { - CalculateHeightByBMI(in.BodyMassIndex().get()); - } else { - std::stringstream ss; - ss << "BodyMassIndex as an input must be provided with height OR weight (and not neither/both). BMI input value is not being used and default inputs will be used." << std::endl; - Warning(ss); - } - } - if (in.AlveoliSurfaceArea().present()) { - GetAlveoliSurfaceArea().Load(in.AlveoliSurfaceArea().get()); - } - if (in.BasalMetabolicRate().present()) { - GetBasalMetabolicRate().Load(in.BasalMetabolicRate().get()); - } - if (in.BloodTypeRh().present()) { - m_BloodRh = in.BloodTypeRh().get(); - } - if (in.BloodTypeABO().present()) { - m_BloodType = in.BloodTypeABO().get(); - } - if (in.BloodVolumeBaseline().present()) { - GetBloodVolumeBaseline().Load(in.BloodVolumeBaseline().get()); - } - if (in.BodyDensity().present()) { - GetBodyDensity().Load(in.BodyDensity().get()); - } - if (in.BodyFatFraction().present()) { - GetBodyFatFraction().Load(in.BodyFatFraction().get()); - } - if (in.DiastolicArterialPressureBaseline().present()) { - GetDiastolicArterialPressureBaseline().Load(in.DiastolicArterialPressureBaseline().get()); - } - if (in.ExpiratoryReserveVolume().present()) { - GetExpiratoryReserveVolume().Load(in.ExpiratoryReserveVolume().get()); - } - if (in.FunctionalResidualCapacity().present()) { - GetFunctionalResidualCapacity().Load(in.FunctionalResidualCapacity().get()); - } - if (in.HeartRateBaseline().present()) { - GetHeartRateBaseline().Load(in.HeartRateBaseline().get()); - } - if (in.HeartRateMaximum().present()) { - GetHeartRateMaximum().Load(in.HeartRateMaximum().get()); - } - if (in.HeartRateMinimum().present()) { - GetHeartRateMinimum().Load(in.HeartRateMinimum().get()); - } - if (in.Hyperhidrosis().present()) { - GetHyperhidrosis().Load(in.Hyperhidrosis().get()); - } - if (in.InspiratoryCapacity().present()) { - GetInspiratoryCapacity().Load(in.InspiratoryCapacity().get()); - } - if (in.InspiratoryReserveVolume().present()) { - GetInspiratoryReserveVolume().Load(in.InspiratoryReserveVolume().get()); - } - if (in.LeanBodyMass().present()) { - GetLeanBodyMass().Load(in.LeanBodyMass().get()); - } - if (in.MaxWorkRate().present()) { - GetMaxWorkRate().Load(in.MaxWorkRate().get()); - } - if (in.MuscleMass().present()) { - GetMuscleMass().Load(in.MuscleMass().get()); - } - if (in.MeanArterialPressureBaseline().present()) { - GetMeanArterialPressureBaseline().Load(in.MeanArterialPressureBaseline().get()); - } - if (in.PainSusceptibility().present()) { - GetPainSusceptibility().Load(in.PainSusceptibility().get()); - } - if (in.ResidualVolume().present()) { - GetResidualVolume().Load(in.ResidualVolume().get()); - } - if (in.RespirationRateBaseline().present()) { - GetRespirationRateBaseline().Load(in.RespirationRateBaseline().get()); - } - if (in.RespiratoryDriverAmplitudeBaseline().present()) { - GetRespiratoryDriverAmplitudeBaseline().Load(in.RespiratoryDriverAmplitudeBaseline().get()); - } - if (in.RightLungRatio().present()) { - GetRightLungRatio().Load(in.RightLungRatio().get()); - } - if (in.SkinSurfaceArea().present()) { - GetSkinSurfaceArea().Load(in.SkinSurfaceArea().get()); - } - if (in.SleepAmount().present()) { - GetSleepAmount().Load(in.SleepAmount().get()); - } - if (in.SystolicArterialPressureBaseline().present()) { - GetSystolicArterialPressureBaseline().Load(in.SystolicArterialPressureBaseline().get()); - } - if (in.TotalVentilationBaseline().present()) { - GetTotalVentilationBaseline().Load(in.TotalVentilationBaseline().get()); - } - if (in.TidalVolumeBaseline().present()) { - GetTidalVolumeBaseline().Load(in.TidalVolumeBaseline().get()); - } - if (in.TotalLungCapacity().present()) { - GetTotalLungCapacity().Load(in.TotalLungCapacity().get()); - } - if (in.VitalCapacity().present()) { - GetVitalCapacity().Load(in.VitalCapacity().get()); - } - - SEScalarTime time; - for (auto e : in.ActiveEvent()) { - time.Load(e.Duration()); - m_EventState[e.Event()] = true; - m_EventDuration_s[e.Event()] = time.GetValue(TimeUnit::s); - } - - return true; -} -//----------------------------------------------------------------------------- -CDM::PatientData* SEPatient::Unload() const -{ - CDM::PatientData* data = new CDM::PatientData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEPatient::Unload(CDM::PatientData& data) const -{ - if (HasName()) { - data.Name(m_Name); - } - if (HasAnnotation()) { - data.Annotation(m_Annotation); - } - if (HasGender()) { - data.Sex(m_Gender); - } - if (m_Age != nullptr) { - data.Age(std::unique_ptr(m_Age->Unload())); - } - if (m_Weight != nullptr) { - data.Weight(std::unique_ptr(m_Weight->Unload())); - } - if (m_Height != nullptr) { - data.Height(std::unique_ptr(m_Height->Unload())); - } - if (m_AlveoliSurfaceArea != nullptr) { - data.AlveoliSurfaceArea(std::unique_ptr(m_AlveoliSurfaceArea->Unload())); - } - if (m_BasalMetabolicRate != nullptr) { - data.BasalMetabolicRate(std::unique_ptr(m_BasalMetabolicRate->Unload())); - } - if (HasBloodRh()) { - data.BloodTypeRh(m_BloodRh); - } - if (HasBloodType()) { - data.BloodTypeABO(m_BloodType); - } - if (m_BloodVolumeBaseline != nullptr) { - data.BloodVolumeBaseline(std::unique_ptr(m_BloodVolumeBaseline->Unload())); - } - if (m_BodyDensity != nullptr) { - data.BodyDensity(std::unique_ptr(m_BodyDensity->Unload())); - } - if (m_BodyFatFraction != nullptr) { - data.BodyFatFraction(std::unique_ptr(m_BodyFatFraction->Unload())); - } - if (m_DiastolicArterialPressureBaseline != nullptr) { - data.DiastolicArterialPressureBaseline(std::unique_ptr(m_DiastolicArterialPressureBaseline->Unload())); - } - if (m_ExpiratoryReserveVolume != nullptr) { - data.ExpiratoryReserveVolume(std::unique_ptr(m_ExpiratoryReserveVolume->Unload())); - } - if (m_FunctionalResidualCapacity != nullptr) { - data.FunctionalResidualCapacity(std::unique_ptr(m_FunctionalResidualCapacity->Unload())); - } - if (m_HeartRateBaseline != nullptr) { - data.HeartRateBaseline(std::unique_ptr(m_HeartRateBaseline->Unload())); - } - if (m_HeartRateMaximum != nullptr) { - data.HeartRateMaximum(std::unique_ptr(m_HeartRateMaximum->Unload())); - } - if (m_HeartRateMinimum != nullptr) { - data.HeartRateMinimum(std::unique_ptr(m_HeartRateMinimum->Unload())); - } - if (m_Hyperhidrosis != nullptr) { - data.Hyperhidrosis(std::unique_ptr(m_Hyperhidrosis->Unload())); - } - if (m_InspiratoryCapacity != nullptr) { - data.InspiratoryCapacity(std::unique_ptr(m_InspiratoryCapacity->Unload())); - } - if (m_InspiratoryReserveVolume != nullptr) { - data.InspiratoryReserveVolume(std::unique_ptr(m_InspiratoryReserveVolume->Unload())); - } - if (m_LeanBodyMass != nullptr) { - data.LeanBodyMass(std::unique_ptr(m_LeanBodyMass->Unload())); - } - if (m_MaxWorkRate != nullptr) { - data.MaxWorkRate(std::unique_ptr(m_MaxWorkRate->Unload())); - } - if (m_MuscleMass != nullptr) { - data.MuscleMass(std::unique_ptr(m_MuscleMass->Unload())); - } - if (m_MeanArterialPressureBaseline != nullptr) { - data.MeanArterialPressureBaseline(std::unique_ptr(m_MeanArterialPressureBaseline->Unload())); - } - if (m_PainSusceptibility != nullptr) { - data.PainSusceptibility(std::unique_ptr(m_PainSusceptibility->Unload())); - } - if (m_ResidualVolume != nullptr) { - data.ResidualVolume(std::unique_ptr(m_ResidualVolume->Unload())); - } - if (m_RespirationRateBaseline != nullptr) { - data.RespirationRateBaseline(std::unique_ptr(m_RespirationRateBaseline->Unload())); - } - if (m_RespiratoryDriverAmplitudeBaseline != nullptr) { - data.RespiratoryDriverAmplitudeBaseline(std::unique_ptr(m_RespiratoryDriverAmplitudeBaseline->Unload())); - } - if (m_RightLungRatio != nullptr) { - data.RightLungRatio(std::unique_ptr(m_RightLungRatio->Unload())); - } - if (m_SkinSurfaceArea != nullptr) { - data.SkinSurfaceArea(std::unique_ptr(m_SkinSurfaceArea->Unload())); - } - if (m_SleepAmount != nullptr) { - data.SleepAmount(std::unique_ptr(m_SleepAmount->Unload())); - } - if (m_SystolicArterialPressureBaseline != nullptr) { - data.SystolicArterialPressureBaseline(std::unique_ptr(m_SystolicArterialPressureBaseline->Unload())); - } - if (m_TotalVentilationBaseline != nullptr) { - data.TotalVentilationBaseline(std::unique_ptr(m_TotalVentilationBaseline->Unload())); - } - if (m_TidalVolumeBaseline != nullptr) { - data.TidalVolumeBaseline(std::unique_ptr(m_TidalVolumeBaseline->Unload())); - } - if (m_TotalLungCapacity != nullptr) { - data.TotalLungCapacity(std::unique_ptr(m_TotalLungCapacity->Unload())); - } - if (m_VitalCapacity != nullptr) { - data.VitalCapacity(std::unique_ptr(m_VitalCapacity->Unload())); - } - - SEScalarTime time; - for (auto itr : m_EventState) { - if (!itr.second) { - continue; - } - - auto it2 = m_EventDuration_s.find(itr.first); - if (it2 == m_EventDuration_s.end()) // This should not happen... - { - time.SetValue(0, TimeUnit::s); - } else { - time.SetValue(it2->second, TimeUnit::s); - } - CDM::ActivePatientEventData* eData = new CDM::ActivePatientEventData(); - eData->Event(itr.first); - eData->Duration(std::unique_ptr(time.Unload())); - data.ActiveEvent().push_back(std::unique_ptr(eData)); - } -}; -void SEPatient::SetEventCallback(CDM::enumPatientEvent::value type, void (*callback)(bool)) +void SEPatient::SetEventCallback(SEPatientEventType type, void (*callback)(bool)) { m_EventCallbacks[type] = callback; } //----------------------------------------------------------------------------- -void SEPatient::SetEvent(CDM::enumPatientEvent::value type, bool active, const SEScalarTime& time) +void SEPatient::SetEvent(SEPatientEventType type, bool active, const SEScalarTime& time) { if (m_EventState[type] == active) { return; // No Change @@ -546,386 +282,386 @@ void SEPatient::SetEvent(CDM::enumPatientEvent::value type, bool active, const S m_ss << "[Event] " << time << ", "; if (active) { switch (type) { - case CDM::enumPatientEvent::AcuteLungInjury: + case SEPatientEventType::AcuteLungInjury: m_ss << " Carrico Index < 300 mmHg: Patient has Acute Lung Injury"; break; - case CDM::enumPatientEvent::AcuteRespiratoryDistress: + case SEPatientEventType::AcuteRespiratoryDistress: m_ss << " Carrico Index < 200 mmHg: Patient has Acute Respiratory Distress"; break; - case CDM::enumPatientEvent::Antidiuresis: + case SEPatientEventType::Antidiuresis: m_ss << " Patient has Antidiuresis"; break; - case CDM::enumPatientEvent::Asystole: + case SEPatientEventType::Asystole: m_ss << " Patient has Asystole"; break; - case CDM::enumPatientEvent::Bradycardia: + case SEPatientEventType::Bradycardia: m_ss << " Patient has Bradycardia"; break; - case CDM::enumPatientEvent::Bradypnea: + case SEPatientEventType::Bradypnea: m_ss << " Patient has Bradypnea"; break; - case CDM::enumPatientEvent::BrainOxygenDeficit: + case SEPatientEventType::BrainOxygenDeficit: m_ss << " Oxygen tension in the brain is dangerously low"; break; - case CDM::enumPatientEvent::CardiacArrest: + case SEPatientEventType::CardiacArrest: m_ss << " Patient has Cardiac Arrest"; break; - case CDM::enumPatientEvent::CardiogenicShock: + case SEPatientEventType::CardiogenicShock: m_ss << " Patient has Cardiogenic Shock"; break; - case CDM::enumPatientEvent::CompartmentSyndrome_Abdominal: + case SEPatientEventType::CompartmentSyndromeAbdominal: m_ss << " Patient has Abdominal Compartment Syndrome"; break; - case CDM::enumPatientEvent::CompartmentSyndrome_LeftArm: + case SEPatientEventType::CompartmentSyndromeLeftArm: m_ss << " Patient has Compartment Syndrome in the Left Arm"; break; - case CDM::enumPatientEvent::CompartmentSyndrome_LeftLeg: + case SEPatientEventType::CompartmentSyndromeLeftLeg: m_ss << " Patient has Compartment Syndrome in the Left Leg"; break; - case CDM::enumPatientEvent::CompartmentSyndrome_RightArm: + case SEPatientEventType::CompartmentSyndromeRightArm: m_ss << " Patient has Compartment Syndrome in the Right Arm"; break; - case CDM::enumPatientEvent::CompartmentSyndrome_RightLeg: + case SEPatientEventType::CompartmentSyndromeRightLeg: m_ss << " Patient has Compartment Syndrome in the Right Leg"; break; - case CDM::enumPatientEvent::CriticalBrainOxygenDeficit: + case SEPatientEventType::CriticalBrainOxygenDeficit: m_ss << " Oxygen tension in the brain is critically low"; break; - case CDM::enumPatientEvent::Dehydration: + case SEPatientEventType::Dehydration: m_ss << " Patient has entered state of Dehydration"; break; - case CDM::enumPatientEvent::MildDiarrhea: + case SEPatientEventType::MildDiarrhea: m_ss << " Patient has mild diarrhea"; break; - case CDM::enumPatientEvent::SevereDiarrhea: + case SEPatientEventType::SevereDiarrhea: m_ss << " Patient has severe diarrhea"; break; - case CDM::enumPatientEvent::Diuresis: + case SEPatientEventType::Diuresis: m_ss << " Patient has entered Diuresis"; break; - case CDM::enumPatientEvent::Fasciculation: + case SEPatientEventType::Fasciculation: m_ss << "Patient has Fasciculation"; break; - case CDM::enumPatientEvent::FlaccidParalysis: + case SEPatientEventType::FlaccidParalysis: m_ss << "Patient has Flaccid Paralysis"; break; - case CDM::enumPatientEvent::FunctionalIncontinence: + case SEPatientEventType::FunctionalIncontinence: m_ss << " Patient has involuntarily emptied their bladder"; break; - case CDM::enumPatientEvent::MildHeadache: + case SEPatientEventType::MildHeadache: m_ss << " Patient has a mild headache"; break; - case CDM::enumPatientEvent::SevereHeadache: + case SEPatientEventType::SevereHeadache: m_ss << " Patient has a severe headache"; break; - case CDM::enumPatientEvent::HemolyticTransfusionReaction: + case SEPatientEventType::HemolyticTransfusionReaction: m_ss << " Patient is undergoing an incompatible blood transfusion"; break; - case CDM::enumPatientEvent::Hypercapnia: + case SEPatientEventType::Hypercapnia: m_ss << " Patient has Hypercapnia"; break; - case CDM::enumPatientEvent::Hyperglycemia: + case SEPatientEventType::Hyperglycemia: m_ss << " Patient has Hyperglycemia"; break; - case CDM::enumPatientEvent::Hyperthermia: + case SEPatientEventType::Hyperthermia: m_ss << " Patient is Hyperthermic"; break; - case CDM::enumPatientEvent::Hypoglycemia: + case SEPatientEventType::Hypoglycemia: m_ss << " Patient has Hypoglycemia"; break; - case CDM::enumPatientEvent::HypoglycemicShock: + case SEPatientEventType::HypoglycemicShock: m_ss << " Patient is in Hypoglycemic Shock"; break; - case CDM::enumPatientEvent::HypoglycemicComa: + case SEPatientEventType::HypoglycemicComa: m_ss << " Patient has fallen into Hypoglycemic Coma"; break; - case CDM::enumPatientEvent::MildHypothermia: + case SEPatientEventType::MildHypothermia: m_ss << " Patient is mildly Hypothermic"; break; - case CDM::enumPatientEvent::ModerateHypothermia: + case SEPatientEventType::ModerateHypothermia: m_ss << " Patient is moderately Hypothermic"; break; - case CDM::enumPatientEvent::SevereHypothermia: + case SEPatientEventType::SevereHypothermia: m_ss << " Patient is Severely Hypothermic"; break; - case CDM::enumPatientEvent::Hypoxia: + case SEPatientEventType::Hypoxia: m_ss << " Patient has Hypoxia"; break; - case CDM::enumPatientEvent::IntracranialHypertension: + case SEPatientEventType::IntracranialHypertension: m_ss << " Patient has Intracranial Hypertension"; break; - case CDM::enumPatientEvent::IntracranialHypotension: + case SEPatientEventType::IntracranialHypotension: m_ss << " Patient has Intracranial Hypotension"; break; - case CDM::enumPatientEvent::HypovolemicShock: + case SEPatientEventType::HypovolemicShock: m_ss << " Patient is in Hypovolemic Shock"; break; - case CDM::enumPatientEvent::IrreversibleState: + case SEPatientEventType::IrreversibleState: m_ss << " Patient has entered irreversible state"; break; - case CDM::enumPatientEvent::Ketoacidosis: + case SEPatientEventType::Ketoacidosis: m_ss << " Patient has Ketoacidosis"; break; - case CDM::enumPatientEvent::LacticAcidosis: + case SEPatientEventType::LacticAcidosis: m_ss << " Patient has Lactic Acidosis"; break; - case CDM::enumPatientEvent::LiverGlycogenDepleted: + case SEPatientEventType::LiverGlycogenDepleted: m_ss << " Patient's liver glycogen is depleted"; break; - case CDM::enumPatientEvent::MaximumPulmonaryVentilationRate: + case SEPatientEventType::MaximumPulmonaryVentilationRate: m_ss << " Patient's Respiratory Driver has exceeded the maximum target pulmonary ventilation rate, setting value to the maximum allowable rate"; break; - case CDM::enumPatientEvent::MetabolicAcidosis: + case SEPatientEventType::MetabolicAcidosis: m_ss << " The patient is in a state of metabolic acidosis"; break; - case CDM::enumPatientEvent::MetabolicAlkalosis: + case SEPatientEventType::MetabolicAlkalosis: m_ss << " The patient is in a state of metabolic alkalosis"; break; - case CDM::enumPatientEvent::MildDiaphoresis: + case SEPatientEventType::MildDiaphoresis: m_ss << " Patient has Mild Diaphoresis"; break; - case CDM::enumPatientEvent::ModerateDiaphoresis: + case SEPatientEventType::ModerateDiaphoresis: m_ss << " Patient has Moderate Diaphoresis"; break; - case CDM::enumPatientEvent::SevereDiaphoresis: + case SEPatientEventType::SevereDiaphoresis: m_ss << " Patient has Severe Diaphoresis"; break; - case CDM::enumPatientEvent::MildSecretions: + case SEPatientEventType::MildSecretions: m_ss << " Patient has Mild Secretions"; break; - case CDM::enumPatientEvent::ModerateSecretions: + case SEPatientEventType::ModerateSecretions: m_ss << " Patient has Moderate Secretions"; break; - case CDM::enumPatientEvent::MildWeakness: + case SEPatientEventType::MildWeakness: m_ss << " Patient has Mild Weakness"; break; - case CDM::enumPatientEvent::ModerateWeakness: + case SEPatientEventType::ModerateWeakness: m_ss << " Patient has Moderate Weakness"; break; - case CDM::enumPatientEvent::MuscleCatabolism: + case SEPatientEventType::MuscleCatabolism: m_ss << " Patient has begun muscle catabolism"; break; - case CDM::enumPatientEvent::MuscleGlycogenDepleted: + case SEPatientEventType::MuscleGlycogenDepleted: m_ss << " Patient's muscle glycogen is depleted"; break; - case CDM::enumPatientEvent::MyocardiumOxygenDeficit: + case SEPatientEventType::MyocardiumOxygenDeficit: m_ss << " The patient's heart is not receiving enough oxygen"; break; - case CDM::enumPatientEvent::Natriuresis: + case SEPatientEventType::Natriuresis: m_ss << " Patient has Natriuresis"; break; - case CDM::enumPatientEvent::Nausea: + case SEPatientEventType::Nausea: m_ss << " Patient is Nauseous"; break; - case CDM::enumPatientEvent::NutritionDepleted: + case SEPatientEventType::NutritionDepleted: m_ss << " Patient has depleted all nutrition in body"; break; - case CDM::enumPatientEvent::PulselessRhythm: + case SEPatientEventType::PulselessRhythm: m_ss << " Patient has a Pulseless Rhythm"; break; - case CDM::enumPatientEvent::RenalHypoperfusion: + case SEPatientEventType::RenalHypoperfusion: m_ss << " Patient has Renal Hypoperfusion"; break; - case CDM::enumPatientEvent::Seizures: + case SEPatientEventType::Seizures: m_ss << " The patient is having a seizure"; break; - case CDM::enumPatientEvent::SevereAcuteRespiratoryDistress: + case SEPatientEventType::SevereAcuteRespiratoryDistress: m_ss << " Carrico Index < 100 : Patient has Severe Acute Respiratory Distress"; break; - case CDM::enumPatientEvent::SevereSecretions: + case SEPatientEventType::SevereSecretions: m_ss << " The patient has severe Secretions"; break; - case CDM::enumPatientEvent::SevereSepsis: + case SEPatientEventType::SevereSepsis: m_ss << " The patient has severe sepsis"; break; - case CDM::enumPatientEvent::Shivering: + case SEPatientEventType::Shivering: m_ss << " The patient is shivering"; break; - case CDM::enumPatientEvent::Tachycardia: + case SEPatientEventType::Tachycardia: m_ss << " Patient has Tachycardia"; break; - case CDM::enumPatientEvent::Tachypnea: + case SEPatientEventType::Tachypnea: m_ss << " Patient has Tachypnea"; break; - case CDM::enumPatientEvent::Fatigue: + case SEPatientEventType::Fatigue: m_ss << " Patient has fatigue"; break; - case CDM::enumPatientEvent::Vomiting: + case SEPatientEventType::Vomiting: m_ss << " Patient is Vomiting"; break; - case CDM::enumPatientEvent::StartOfCardiacCycle: - case CDM::enumPatientEvent::StartOfExhale: - case CDM::enumPatientEvent::StartOfInhale: + case SEPatientEventType::StartOfCardiacCycle: + case SEPatientEventType::StartOfExhale: + case SEPatientEventType::StartOfInhale: m_ss.str(""); // make m_ss empty and nothing will be logged, this event does not need to get logged each activation break; default: - m_ss << " Patient has entered state : " << type; // TODO CDM::enumPatientEvent::_xsd_enumPatientEvent_literals_[type]; + m_ss << " Patient has entered state : " << type; // TODO SEPatientEventType::_xsd_enumPatientEvent_literals_[type]; } } else { switch (type) { - case CDM::enumPatientEvent::AcuteLungInjury: + case SEPatientEventType::AcuteLungInjury: m_ss << " Patient no longer has Acute Lung Injury"; break; - case CDM::enumPatientEvent::AcuteRespiratoryDistress: + case SEPatientEventType::AcuteRespiratoryDistress: m_ss << " Patient no longer has Acute Respiratory Distress"; break; - case CDM::enumPatientEvent::Antidiuresis: + case SEPatientEventType::Antidiuresis: m_ss << " Patient no longer is in Antidiuresis"; break; - case CDM::enumPatientEvent::Asystole: + case SEPatientEventType::Asystole: m_ss << " Patient no longer is in Asystole"; break; - case CDM::enumPatientEvent::Bradycardia: + case SEPatientEventType::Bradycardia: m_ss << " Patient no longer has Bradycardia"; break; - case CDM::enumPatientEvent::Bradypnea: + case SEPatientEventType::Bradypnea: m_ss << " Patient no longer has Bradypnea"; break; - case CDM::enumPatientEvent::BrainOxygenDeficit: + case SEPatientEventType::BrainOxygenDeficit: m_ss << " Oxygen tension in the brain has increased above the danger threshold"; break; - case CDM::enumPatientEvent::CardiacArrest: + case SEPatientEventType::CardiacArrest: m_ss << " Patient no longer has Cardiac Arrest"; break; - case CDM::enumPatientEvent::CardiogenicShock: + case SEPatientEventType::CardiogenicShock: m_ss << " Patient no longer has Cardiogenic Shock"; break; - case CDM::enumPatientEvent::CompartmentSyndrome_Abdominal: + case SEPatientEventType::CompartmentSyndromeAbdominal: m_ss << " Patient no longer has Abdominal Compartment Syndrome"; break; - case CDM::enumPatientEvent::CompartmentSyndrome_LeftArm: + case SEPatientEventType::CompartmentSyndromeLeftArm: m_ss << " Patient no longer has Compartment Syndrome in the Left Arm"; break; - case CDM::enumPatientEvent::CompartmentSyndrome_LeftLeg: + case SEPatientEventType::CompartmentSyndromeLeftLeg: m_ss << " Patient no longer has Compartment Syndrome in the Left Leg"; break; - case CDM::enumPatientEvent::CompartmentSyndrome_RightArm: + case SEPatientEventType::CompartmentSyndromeRightArm: m_ss << " Patient no longer has Compartment Syndrome in the Right Arm"; break; - case CDM::enumPatientEvent::CompartmentSyndrome_RightLeg: + case SEPatientEventType::CompartmentSyndromeRightLeg: m_ss << " Patient no longer has Compartment Syndrome in the Right Leg"; break; - case CDM::enumPatientEvent::CriticalBrainOxygenDeficit: + case SEPatientEventType::CriticalBrainOxygenDeficit: m_ss << " Oxygen tension in the brain has increased above the critical threshold"; break; - case CDM::enumPatientEvent::Dehydration: + case SEPatientEventType::Dehydration: m_ss << " Patient no longer is in Dehydration state"; break; - case CDM::enumPatientEvent::Diuresis: + case SEPatientEventType::Diuresis: m_ss << " Patient no longer has Diuresis"; break; - case CDM::enumPatientEvent::Fasciculation: + case SEPatientEventType::Fasciculation: m_ss << "Patient no longer has Fasciculation"; break; - case CDM::enumPatientEvent::FunctionalIncontinence: + case SEPatientEventType::FunctionalIncontinence: m_ss << " Patient has an empty bladder"; break; - case CDM::enumPatientEvent::HemolyticTransfusionReaction: + case SEPatientEventType::HemolyticTransfusionReaction: m_ss << " Patient is no longer undergoing a hemolytic transfusion reaction"; break; - case CDM::enumPatientEvent::Hypercapnia: + case SEPatientEventType::Hypercapnia: m_ss << " Patient no longer has Hypercapnia"; break; - case CDM::enumPatientEvent::Hyperglycemia: + case SEPatientEventType::Hyperglycemia: m_ss << " Patient no longer has Hyperglycemia"; break; - case CDM::enumPatientEvent::Hyperthermia: + case SEPatientEventType::Hyperthermia: m_ss << " Patient is no longer has Hyperthermic"; break; - case CDM::enumPatientEvent::Hypoglycemia: + case SEPatientEventType::Hypoglycemia: m_ss << " Patient no longer has Hypoglycemia"; break; - case CDM::enumPatientEvent::HypoglycemicShock: + case SEPatientEventType::HypoglycemicShock: m_ss << " Patient is no longer in Hypoglycemic Shock"; break; - case CDM::enumPatientEvent::HypoglycemicComa: + case SEPatientEventType::HypoglycemicComa: m_ss << " Patient is no longer in a Hypoglycemic Coma"; break; - case CDM::enumPatientEvent::MildHypothermia: + case SEPatientEventType::MildHypothermia: m_ss << " Patient is no longer Mildly Hypothermic"; break; - case CDM::enumPatientEvent::ModerateHypothermia: + case SEPatientEventType::ModerateHypothermia: m_ss << " Patient is no longer Moderately Hypothermic"; break; - case CDM::enumPatientEvent::SevereHypothermia: + case SEPatientEventType::SevereHypothermia: m_ss << " Patient is no longer Severely Hypothermic"; break; - case CDM::enumPatientEvent::Hypoxia: + case SEPatientEventType::Hypoxia: m_ss << " Patient no longer has Hypoxia"; break; - case CDM::enumPatientEvent::HypovolemicShock: + case SEPatientEventType::HypovolemicShock: m_ss << " Patient is no longer in Hypovolemic Shock"; break; - case CDM::enumPatientEvent::IntracranialHypertension: + case SEPatientEventType::IntracranialHypertension: m_ss << " Patient no longer has Intracranial Hypertension"; break; - case CDM::enumPatientEvent::IntracranialHypotension: + case SEPatientEventType::IntracranialHypotension: m_ss << " Patient no longer has Intracranial Hypotension"; break; - case CDM::enumPatientEvent::IrreversibleState: + case SEPatientEventType::IrreversibleState: m_ss << " Patient no longer is in irreversible state?!"; break; - case CDM::enumPatientEvent::Ketoacidosis: + case SEPatientEventType::Ketoacidosis: m_ss << " Patient no longer has Ketoacidosis"; break; - case CDM::enumPatientEvent::LacticAcidosis: + case SEPatientEventType::LacticAcidosis: m_ss << " Patient no longer has Lactic Acidosis"; break; - case CDM::enumPatientEvent::LiverGlycogenDepleted: + case SEPatientEventType::LiverGlycogenDepleted: m_ss << " Patient's liver glycogen is no longer depleted"; break; - case CDM::enumPatientEvent::MaximumPulmonaryVentilationRate: + case SEPatientEventType::MaximumPulmonaryVentilationRate: m_ss << " Patient's Respiratory Driver is no longer exceeding the maximum target pulmonary ventilation rate"; break; - case CDM::enumPatientEvent::MetabolicAcidosis: + case SEPatientEventType::MetabolicAcidosis: m_ss << " The patient is no longer in a state of metabolic acidosis"; break; - case CDM::enumPatientEvent::MetabolicAlkalosis: + case SEPatientEventType::MetabolicAlkalosis: m_ss << " The patient is no longer in a state of metabolic alkalosis"; break; - case CDM::enumPatientEvent::MuscleGlycogenDepleted: + case SEPatientEventType::MuscleGlycogenDepleted: m_ss << " Patient's muscle glycogen is no longer depleted"; break; - case CDM::enumPatientEvent::MyocardiumOxygenDeficit: + case SEPatientEventType::MyocardiumOxygenDeficit: m_ss << " Patient no longer has a Myocardium Oxygen Deficit"; break; - case CDM::enumPatientEvent::Natriuresis: + case SEPatientEventType::Natriuresis: m_ss << " Patient no longer has Natriuresis"; break; - case CDM::enumPatientEvent::NutritionDepleted: + case SEPatientEventType::NutritionDepleted: m_ss << " Patient has nutrition in body"; break; - case CDM::enumPatientEvent::PulselessRhythm: + case SEPatientEventType::PulselessRhythm: m_ss << " Patient no longer has a Pulseless Rhythm"; break; - case CDM::enumPatientEvent::RenalHypoperfusion: + case SEPatientEventType::RenalHypoperfusion: m_ss << " Patient no longer has Renal Hypoperfusion"; break; - case CDM::enumPatientEvent::SevereAcuteRespiratoryDistress: + case SEPatientEventType::SevereAcuteRespiratoryDistress: m_ss << " Patient no longer has a Severe Acute Respiratory Distress"; break; - case CDM::enumPatientEvent::SevereSepsis: + case SEPatientEventType::SevereSepsis: m_ss << " Patient no longer has severe sepsis"; break; - case CDM::enumPatientEvent::Shivering: + case SEPatientEventType::Shivering: m_ss << " Patient is longer shivering"; break; - case CDM::enumPatientEvent::Tachycardia: + case SEPatientEventType::Tachycardia: m_ss << " Patient no longer has Tachycardia"; break; - case CDM::enumPatientEvent::Tachypnea: + case SEPatientEventType::Tachypnea: m_ss << " Patient no longer has Tachypnea"; break; - case CDM::enumPatientEvent::Fatigue: + case SEPatientEventType::Fatigue: m_ss << " Patient is no longer fatigued"; break; - case CDM::enumPatientEvent::StartOfCardiacCycle: - case CDM::enumPatientEvent::StartOfExhale: - case CDM::enumPatientEvent::StartOfInhale: + case SEPatientEventType::StartOfCardiacCycle: + case SEPatientEventType::StartOfExhale: + case SEPatientEventType::StartOfInhale: m_ss.str(""); // make m_ss empty and nothing will be logged, this event does not need to get logged each activation break; default: - m_ss << " Patient has exited state : " << type; // TODO CDM::enumPatientEvent::_xsd_enumPatientEvent_literals_[type]; + m_ss << " Patient has exited state : " << type; // TODO SEPatientEventType::_xsd_enumPatientEvent_literals_[type]; } } if (!m_ss.str().empty()) @@ -941,12 +677,12 @@ void SEPatient::SetEvent(CDM::enumPatientEvent::value type, bool active, const S } } //----------------------------------------------------------------------------- -bool SEPatient::IsEventActive(CDM::enumPatientEvent::value type) const +bool SEPatient::IsEventActive(SEPatientEventType type) const { return m_EventState.at(type); } //----------------------------------------------------------------------------- -double SEPatient::GetEventDuration(CDM::enumPatientEvent::value type, const TimeUnit& unit) const +double SEPatient::GetEventDuration(SEPatientEventType type, const TimeUnit& unit) const { auto i = m_EventDuration_s.find(type); if (i == m_EventDuration_s.end()) { @@ -1027,44 +763,24 @@ void SEPatient::InvalidateAnnotation() m_Annotation = ""; } //----------------------------------------------------------------------------- -CDM::enumSex::value SEPatient::GetGender() const -{ - return m_Gender; -} -//----------------------------------------------------------------------------- -void SEPatient::SetGender(CDM::enumSex::value sex) -{ - m_Gender = sex; -} -//----------------------------------------------------------------------------- -bool SEPatient::HasGender() const -{ - return m_Gender == ((CDM::enumSex::value)-1) ? false : true; -} -//----------------------------------------------------------------------------- -void SEPatient::InvalidateGender() -{ - m_Gender = (CDM::enumSex::value)-1; -} -//----------------------------------------------------------------------------- -[[deprecated("Use GetGender instead")]] CDM::enumSex::value SEPatient::GetSex() const +SESex SEPatient::GetSex() const { - return m_Gender; + return m_Sex; } //----------------------------------------------------------------------------- -[[deprecated("Use SetGender instead")]] void SEPatient::SetSex(CDM::enumSex::value gender) +void SEPatient::SetSex(SESex gender) { - m_Gender = gender; + m_Sex = gender; } //----------------------------------------------------------------------------- -[[deprecated("Use HasGender instead")]] bool SEPatient::HasSex() const +bool SEPatient::HasSex() const { - return m_Gender == ((CDM::enumSex::value)-1) ? false : true; + return m_Sex == (SESex::Invalid) ? false : true; } //----------------------------------------------------------------------------- -[[deprecated("Use InvalidateGender instead")]] void SEPatient::InvalidateSex() +void SEPatient::InvalidateSex() { - m_Gender = (CDM::enumSex::value)-1; + m_Sex = SESex::Invalid; } //----------------------------------------------------------------------------- bool SEPatient::HasAge() const @@ -1130,12 +846,12 @@ double SEPatient::GetHeight(const LengthUnit& unit) const return m_Height->GetValue(unit); } //----------------------------------------------------------------------------- -void SEPatient::CalculateWeightByBMI(const CDM::ScalarData& bmi) +void SEPatient::CalculateWeightByBMI(const double& bmi) { if (!HasWeight()) { m_Weight = new SEScalarMass(); double height_m = GetHeight(LengthUnit::m); - double weightByBMI_kg = bmi.value() * std::pow(height_m, 2.); + double weightByBMI_kg = bmi * std::pow(height_m, 2.); m_Weight->SetValue(weightByBMI_kg, MassUnit::kg); std::stringstream ss; @@ -1144,12 +860,12 @@ void SEPatient::CalculateWeightByBMI(const CDM::ScalarData& bmi) } } //----------------------------------------------------------------------------- -void SEPatient::CalculateHeightByBMI(const CDM::ScalarData& bmi) +void SEPatient::CalculateHeightByBMI(const double& bmi) { if (!HasHeight()) { m_Height = new SEScalarLength(); double weight_kg = GetWeight(MassUnit::kg); - double heightByBMI_m = std::sqrt(weight_kg / bmi.value()); + double heightByBMI_m = std::sqrt(weight_kg / bmi); m_Height->SetValue(heightByBMI_m, LengthUnit::m); std::stringstream ss; @@ -1200,24 +916,24 @@ double SEPatient::GetBasalMetabolicRate(const PowerUnit& unit) const return m_BasalMetabolicRate->GetValue(unit); } //------------------------------------------------------------------------------ -CDM::enumBloodType::value SEPatient::GetBloodType() const +SEBloodType SEPatient::GetBloodType() const { return m_BloodType; } //----------------------------------------------------------------------------- -void SEPatient::SetBloodType(CDM::enumBloodType::value bloodAntigen) +void SEPatient::SetBloodType(SEBloodType bloodAntigen) { m_BloodType = bloodAntigen; } //----------------------------------------------------------------------------- bool SEPatient::HasBloodType() const { - return m_BloodType == ((CDM::enumBloodType::value)-1) ? false : true; + return m_BloodType == SEBloodType::Invalid ? false : true; } //----------------------------------------------------------------------------- void SEPatient::InvalidateBloodType() { - m_BloodType = (CDM::enumBloodType::value)-1; + m_BloodType = SEBloodType::Invalid; } //----------------------------------------------------------------------------- bool SEPatient::GetBloodRh() const @@ -1832,7 +1548,7 @@ bool SEPatient::operator==(SEPatient const& rhs) const return m_EventDuration_s == rhs.m_EventDuration_s && m_Name == rhs.m_Name && m_Annotation == rhs.m_Annotation - && m_Gender == rhs.m_Gender + && m_Sex == rhs.m_Sex && ((m_Age && rhs.m_Age) ? m_Age->operator==(*rhs.m_Age) : m_Age == rhs.m_Age) diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEAcuteRespiratoryDistress.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEAcuteRespiratoryDistress.cpp index dd7faec97..b5c768199 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEAcuteRespiratoryDistress.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEAcuteRespiratoryDistress.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientActions.h" #include #include @@ -20,62 +21,41 @@ SEAcuteRespiratoryDistress::SEAcuteRespiratoryDistress() { m_Severity = nullptr; } - +//------------------------------------------------------------------------------- SEAcuteRespiratoryDistress::~SEAcuteRespiratoryDistress() { - Clear(); + Invalidate(); } - -void SEAcuteRespiratoryDistress::Clear() +//------------------------------------------------------------------------------- +void SEAcuteRespiratoryDistress::Invalidate() { - SEPatientAction::Clear(); + SEPatientAction::Invalidate(); SAFE_DELETE(m_Severity); } - +//------------------------------------------------------------------------------- bool SEAcuteRespiratoryDistress::IsValid() const { return SEPatientAction::IsValid() && HasSeverity(); } - +//------------------------------------------------------------------------------- bool SEAcuteRespiratoryDistress::IsActive() const { return IsValid() ? !m_Severity->IsZero() : false; } - -bool SEAcuteRespiratoryDistress::Load(const CDM::AcuteRespiratoryDistressData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - GetSeverity().Load(in.Severity(), rd); - return true; -} - -CDM::AcuteRespiratoryDistressData* SEAcuteRespiratoryDistress::Unload() const -{ - CDM::AcuteRespiratoryDistressData* data(new CDM::AcuteRespiratoryDistressData()); - Unload(*data); - return data; -} - -void SEAcuteRespiratoryDistress::Unload(CDM::AcuteRespiratoryDistressData& data) const -{ - SEPatientAction::Unload(data); - if (m_Severity != nullptr) - data.Severity(std::unique_ptr(m_Severity->Unload())); -} - +//------------------------------------------------------------------------------- bool SEAcuteRespiratoryDistress::HasSeverity() const { return m_Severity == nullptr ? false : m_Severity->IsValid(); } - +//------------------------------------------------------------------------------- SEScalar0To1& SEAcuteRespiratoryDistress::GetSeverity() { if (m_Severity == nullptr) m_Severity = new SEScalar0To1(); return *m_Severity; } - +//------------------------------------------------------------------------------- void SEAcuteRespiratoryDistress::ToString(std::ostream& str) const { str << "Patient Action : Acute Respiratory Distress"; diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEAcuteStress.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEAcuteStress.cpp index 567398ae0..cd070b44f 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEAcuteStress.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEAcuteStress.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientActions.h" #include #include @@ -23,13 +24,13 @@ SEAcuteStress::SEAcuteStress() //------------------------------------------------------------------------------- SEAcuteStress::~SEAcuteStress() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEAcuteStress::Clear() +void SEAcuteStress::Invalidate() { - SEPatientAction::Clear(); + SEPatientAction::Invalidate(); SAFE_DELETE(m_Severity); } //------------------------------------------------------------------------------- @@ -43,27 +44,6 @@ bool SEAcuteStress::IsActive() const return IsValid() ? !m_Severity->IsZero() : false; } //------------------------------------------------------------------------------- -bool SEAcuteStress::Load(const CDM::AcuteStressData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - GetSeverity().Load(in.Severity(), rd); - return true; -} -//------------------------------------------------------------------------------- -CDM::AcuteStressData* SEAcuteStress::Unload() const -{ - CDM::AcuteStressData* data(new CDM::AcuteStressData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEAcuteStress::Unload(CDM::AcuteStressData& data) const -{ - SEPatientAction::Unload(data); - if (m_Severity != nullptr) - data.Severity(std::unique_ptr(m_Severity->Unload())); -} -//------------------------------------------------------------------------------- bool SEAcuteStress::HasSeverity() const { return m_Severity == nullptr ? false : m_Severity->IsValid(); diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEAirwayObstruction.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEAirwayObstruction.cpp index e472d87dd..7f2899796 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEAirwayObstruction.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEAirwayObstruction.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientActions.h" #include #include @@ -23,13 +24,13 @@ SEAirwayObstruction::SEAirwayObstruction() //------------------------------------------------------------------------------- SEAirwayObstruction::~SEAirwayObstruction() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEAirwayObstruction::Clear() +void SEAirwayObstruction::Invalidate() { - SEPatientAction::Clear(); + SEPatientAction::Invalidate(); SAFE_DELETE(m_Severity); } //------------------------------------------------------------------------------- @@ -43,27 +44,6 @@ bool SEAirwayObstruction::IsActive() const return IsValid() ? !m_Severity->IsZero() : false; } //------------------------------------------------------------------------------- -bool SEAirwayObstruction::Load(const CDM::AirwayObstructionData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - GetSeverity().Load(in.Severity(), rd); - return true; -} -//------------------------------------------------------------------------------- -CDM::AirwayObstructionData* SEAirwayObstruction::Unload() const -{ - CDM::AirwayObstructionData* data(new CDM::AirwayObstructionData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEAirwayObstruction::Unload(CDM::AirwayObstructionData& data) const -{ - SEPatientAction::Unload(data); - if (m_Severity != nullptr) - data.Severity(std::unique_ptr(m_Severity->Unload())); -} -//------------------------------------------------------------------------------- bool SEAirwayObstruction::HasSeverity() const { return m_Severity == nullptr ? false : m_Severity->IsValid(); diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEAmputation.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEAmputation.cpp new file mode 100644 index 000000000..6c8295a68 --- /dev/null +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEAmputation.cpp @@ -0,0 +1,142 @@ +/************************************************************************************** +Copyright 2015 Applied Research Associates, Inc. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the License +at: +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +**************************************************************************************/ +#include + +#include "io/cdm/PatientActions.h" +#include +#include +#include + +namespace biogears { +SEAmputation::SEAmputation() + : SEPatientAction() + , m_BleedResistance(nullptr) +{ + m_Compartment = ""; // User input, location of Amputation + m_WeightPercent = "WeightNotLost"; +} +//----------------------------------------------------------------------------- +SEAmputation::~SEAmputation() +{ + Invalidate(); +} +//----------------------------------------------------------------------------- +void SEAmputation::Invalidate() +{ + SEPatientAction::Invalidate(); + m_Compartment = ""; + SAFE_DELETE(m_BleedResistance); +} +//----------------------------------------------------------------------------- +bool SEAmputation::IsValid() const +{ + return SEPatientAction::IsValid() && HasCompartment(); +} +//----------------------------------------------------------------------------- +const char* SEAmputation::GetCompartment_cStr() const +{ + return m_Compartment.c_str(); +} +//----------------------------------------------------------------------------- +//! +//! \brief String representing the location of the event. +//! \return std::string +//! +//! Only a single Amputation can exist at the exsact same compartment string +//! Any string value can be used. Submitting the same value overwrites the previous event. +std::string SEAmputation::GetCompartment() const +{ + return m_Compartment; +} +//----------------------------------------------------------------------------- +bool SEAmputation::HasCompartment() const +{ + return !m_Compartment.empty(); +} +//----------------------------------------------------------------------------- +void SEAmputation::SetCompartment(const char* name) +{ + return SetCompartment(std::string { name }); +} +//----------------------------------------------------------------------------- +void SEAmputation::SetCompartment(const std::string& name) +{ + m_Compartment = name; +} +//----------------------------------------------------------------------------- +void SEAmputation::InvalidateCompartment() +{ + m_Compartment = ""; +} +//----------------------------------------------------------------------------- +bool SEAmputation::HasBleedResistance() const +{ + return m_BleedResistance == nullptr ? false : m_BleedResistance->IsValid(); +} +//----------------------------------------------------------------------------- +SEScalarFlowResistance& SEAmputation::GetBleedResistance() +{ + if (m_BleedResistance == nullptr) { + m_BleedResistance = new SEScalarFlowResistance(); + } + return *m_BleedResistance; +} +SEScalarFlowResistance const& SEAmputation::GetBleedResistance() const +{ + if (m_BleedResistance == nullptr) { + const_cast(this)->m_BleedResistance = new SEScalarFlowResistance(); + } + return *m_BleedResistance; +} +//----------------------------------------------------------------------------- +const char* SEAmputation::GetWeightPercent_cStr() const +{ + return m_WeightPercent.c_str(); +} +std::string SEAmputation::GetWeightPercent() const +{ + return m_WeightPercent; +} +//----------------------------------------------------------------------------- +void SEAmputation::SetWeightPercent(const char* name) +{ + return SetWeightPercent(std::string { name }); +} +//----------------------------------------------------------------------------- +void SEAmputation::SetWeightPercent(const std::string& name) +{ + m_WeightPercent = name; +} +//----------------------------------------------------------------------------- +void SEAmputation::ToString(std::ostream& str) const +{ + str << "Patient Action : Amputation"; + if (HasComment()) + str << "\n\tComment: " << m_Comment; + str << "\n\tCompartment: "; + HasCompartment() ? str << GetCompartment() : str << "No Compartment Set"; + str << std::flush; + + +} +//------------------------------------------------------------------------------- +bool SEAmputation::operator==(const SEAmputation& rhs) const +{ + return m_Comment == rhs.m_Comment + && m_Compartment == rhs.m_Compartment; +} +//------------------------------------------------------------------------------- +bool SEAmputation::operator!=(const SEAmputation& rhs) const +{ + return !(*this == rhs); +} +} \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEApnea.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEApnea.cpp index 6ede974b7..e187f081e 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEApnea.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEApnea.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientActions.h" #include #include @@ -23,13 +24,13 @@ SEApnea::SEApnea() //------------------------------------------------------------------------------- SEApnea::~SEApnea() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEApnea::Clear() +void SEApnea::Invalidate() { - SEPatientAction::Clear(); + SEPatientAction::Invalidate(); SAFE_DELETE(m_Severity); } //------------------------------------------------------------------------------- @@ -43,27 +44,6 @@ bool SEApnea::IsActive() const return IsValid() ? !m_Severity->IsZero() : false; } //------------------------------------------------------------------------------- -bool SEApnea::Load(const CDM::ApneaData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - GetSeverity().Load(in.Severity(), rd); - return true; -} -//------------------------------------------------------------------------------- -CDM::ApneaData* SEApnea::Unload() const -{ - CDM::ApneaData* data(new CDM::ApneaData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEApnea::Unload(CDM::ApneaData& data) const -{ - SEPatientAction::Unload(data); - if (m_Severity != nullptr) - data.Severity(std::unique_ptr(m_Severity->Unload())); -} -//------------------------------------------------------------------------------- bool SEApnea::HasSeverity() const { return m_Severity == nullptr ? false : m_Severity->IsValid(); diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEAsthmaAttack.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEAsthmaAttack.cpp index 33cd5e4e1..02bfa6ab4 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEAsthmaAttack.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEAsthmaAttack.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientActions.h" #include #include @@ -23,12 +24,12 @@ SEAsthmaAttack::SEAsthmaAttack() //------------------------------------------------------------------------------- SEAsthmaAttack::~SEAsthmaAttack() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEAsthmaAttack::Clear() +void SEAsthmaAttack::Invalidate() { - SEPatientAction::Clear(); + SEPatientAction::Invalidate(); SAFE_DELETE(m_Severity); } //------------------------------------------------------------------------------- @@ -42,27 +43,6 @@ bool SEAsthmaAttack::IsActive() const return IsValid() ? !m_Severity->IsZero() : false; } //------------------------------------------------------------------------------- -bool SEAsthmaAttack::Load(const CDM::AsthmaAttackData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - GetSeverity().Load(in.Severity(), rd); - return true; -} -//------------------------------------------------------------------------------- -CDM::AsthmaAttackData* SEAsthmaAttack::Unload() const -{ - CDM::AsthmaAttackData* data(new CDM::AsthmaAttackData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEAsthmaAttack::Unload(CDM::AsthmaAttackData& data) const -{ - SEPatientAction::Unload(data); - if (m_Severity != nullptr) - data.Severity(std::unique_ptr(m_Severity->Unload())); -} -//------------------------------------------------------------------------------- bool SEAsthmaAttack::HasSeverity() const { return m_Severity == nullptr ? false : m_Severity->IsValid(); diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEBrainInjury.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEBrainInjury.cpp index 8cac6356c..ac8810ab6 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEBrainInjury.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEBrainInjury.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientActions.h" #include #include @@ -19,20 +20,20 @@ SEBrainInjury::SEBrainInjury() : SEPatientAction() { m_Severity = nullptr; - m_Type = (CDM::enumBrainInjuryType::value)-1; + m_Type = SEBrainInjuryType::Invalid; } //------------------------------------------------------------------------------- SEBrainInjury::~SEBrainInjury() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEBrainInjury::Clear() +void SEBrainInjury::Invalidate() { - SEPatientAction::Clear(); + SEPatientAction::Invalidate(); SAFE_DELETE(m_Severity); - m_Type = (CDM::enumBrainInjuryType::value)-1; + m_Type = SEBrainInjuryType::Invalid; } //------------------------------------------------------------------------------- bool SEBrainInjury::IsValid() const @@ -45,30 +46,6 @@ bool SEBrainInjury::IsActive() const return IsValid() ? !m_Severity->IsZero() : false; } //------------------------------------------------------------------------------- -bool SEBrainInjury::Load(const CDM::BrainInjuryData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - GetSeverity().Load(in.Severity(), rd); - m_Type = in.Type(); - return true; -} -//------------------------------------------------------------------------------- -CDM::BrainInjuryData* SEBrainInjury::Unload() const -{ - CDM::BrainInjuryData* data(new CDM::BrainInjuryData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEBrainInjury::Unload(CDM::BrainInjuryData& data) const -{ - SEPatientAction::Unload(data); - if (m_Severity != nullptr) - data.Severity(std::unique_ptr(m_Severity->Unload())); - if (HasType()) - data.Type(m_Type); -} -//------------------------------------------------------------------------------- bool SEBrainInjury::HasSeverity() const { return m_Severity == nullptr ? false : m_Severity->IsValid(); @@ -81,24 +58,24 @@ SEScalar0To1& SEBrainInjury::GetSeverity() return *m_Severity; } //------------------------------------------------------------------------------- -CDM::enumBrainInjuryType::value SEBrainInjury::GetType() const +SEBrainInjuryType SEBrainInjury::GetType() const { return m_Type; } //------------------------------------------------------------------------------- -void SEBrainInjury::SetType(CDM::enumBrainInjuryType::value Type) +void SEBrainInjury::SetType(SEBrainInjuryType Type) { m_Type = Type; } //------------------------------------------------------------------------------- bool SEBrainInjury::HasType() const { - return m_Type == ((CDM::enumBrainInjuryType::value)-1) ? false : true; + return m_Type == SEBrainInjuryType::Invalid ? false : true; } //------------------------------------------------------------------------------- void SEBrainInjury::InvalidateType() { - m_Type = (CDM::enumBrainInjuryType::value)-1; + m_Type = SEBrainInjuryType::Invalid; } //------------------------------------------------------------------------------- void SEBrainInjury::ToString(std::ostream& str) const @@ -113,7 +90,7 @@ void SEBrainInjury::ToString(std::ostream& str) const str << std::flush; } //------------------------------------------------------------------------------- -bool SEBrainInjury::operator==( const SEBrainInjury& rhs) const +bool SEBrainInjury::operator==(const SEBrainInjury& rhs) const { bool equivilant = m_Comment == rhs.m_Comment; equivilant &= (m_Severity && rhs.m_Severity) ? m_Severity->operator==(*rhs.m_Severity) : m_Severity == rhs.m_Severity; @@ -121,7 +98,7 @@ bool SEBrainInjury::operator==( const SEBrainInjury& rhs) const return equivilant; } //------------------------------------------------------------------------------- -bool SEBrainInjury::operator!=( const SEBrainInjury& rhs) const +bool SEBrainInjury::operator!=(const SEBrainInjury& rhs) const { return !(*this == rhs); } diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEBreathHold.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEBreathHold.cpp index b9b832ac3..a41959325 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEBreathHold.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEBreathHold.cpp @@ -12,6 +12,7 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/PatientActions.h" #include #include @@ -24,12 +25,12 @@ SEBreathHold::SEBreathHold() //------------------------------------------------------------------------------- SEBreathHold::~SEBreathHold() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEBreathHold::Clear() +void SEBreathHold::Invalidate() { - SEConsciousRespirationCommand::Clear(); + SEConsciousRespirationCommand::Invalidate(); SAFE_DELETE(m_Period); } //------------------------------------------------------------------------------- @@ -43,27 +44,6 @@ bool SEBreathHold::IsActive() const return SEConsciousRespirationCommand::IsActive(); } //------------------------------------------------------------------------------- -bool SEBreathHold::Load(const CDM::BreathHoldData& in, std::default_random_engine *rd) -{ - SEConsciousRespirationCommand::Load(in); - GetPeriod().Load(in.Period(), rd); - return true; -} -//------------------------------------------------------------------------------- -CDM::BreathHoldData* SEBreathHold::Unload() const -{ - CDM::BreathHoldData* data(new CDM::BreathHoldData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEBreathHold::Unload(CDM::BreathHoldData& data) const -{ - SEConsciousRespirationCommand::Unload(data); - if (m_Period != nullptr) - data.Period(std::unique_ptr(m_Period->Unload())); -} -//------------------------------------------------------------------------------- bool SEBreathHold::HasPeriod() const { return m_Period == nullptr ? false : m_Period->IsValid(); diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEBronchoconstriction.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEBronchoconstriction.cpp index 0138cff42..646e39f19 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEBronchoconstriction.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEBronchoconstriction.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include + +#include "io/cdm/PatientActions.h" #include namespace biogears { @@ -22,12 +24,12 @@ SEBronchoconstriction::SEBronchoconstriction() //------------------------------------------------------------------------------- SEBronchoconstriction::~SEBronchoconstriction() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEBronchoconstriction::Clear() +void SEBronchoconstriction::Invalidate() { - SEPatientAction::Clear(); + SEPatientAction::Invalidate(); SAFE_DELETE(m_Severity); } //------------------------------------------------------------------------------- @@ -41,27 +43,6 @@ bool SEBronchoconstriction::IsActive() const return IsValid() ? !m_Severity->IsZero() : false; } //------------------------------------------------------------------------------- -bool SEBronchoconstriction::Load(const CDM::BronchoconstrictionData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - GetSeverity().Load(in.Severity(), rd); - return true; -} -//------------------------------------------------------------------------------- -CDM::BronchoconstrictionData* SEBronchoconstriction::Unload() const -{ - CDM::BronchoconstrictionData* data(new CDM::BronchoconstrictionData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEBronchoconstriction::Unload(CDM::BronchoconstrictionData& data) const -{ - SEPatientAction::Unload(data); - if (m_Severity != nullptr) - data.Severity(std::unique_ptr(m_Severity->Unload())); -} -//------------------------------------------------------------------------------- bool SEBronchoconstriction::HasSeverity() const { return m_Severity == nullptr ? false : m_Severity->IsValid(); diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEBurnWound.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEBurnWound.cpp index 069c38b72..92ae8c5a9 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEBurnWound.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEBurnWound.cpp @@ -11,7 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include -#include +#include "io/cdm/PatientActions.h" +#include #include namespace biogears { @@ -24,7 +25,7 @@ SEBurnWound::SEBurnWound() , m_compartments(5) { m_Inflammation = false; // When the burn wound is constructed, the corresponding inflammation state has not been established - m_DegreeOfBurn = (CDM::enumBurnDegree::value)-1; // User input, burn degree afflicting specified TBSA + m_DegreeOfBurn = SEBurnDegree::Invalid; // User input, burn degree afflicting specified TBSA for (auto& sa : m_compartments) { sa.SetValue(0.0); } @@ -32,18 +33,18 @@ SEBurnWound::SEBurnWound() //----------------------------------------------------------------------------- SEBurnWound::~SEBurnWound() { - Clear(); + Invalidate(); SAFE_DELETE(m_TBSA); } //----------------------------------------------------------------------------- -void SEBurnWound::Clear() +void SEBurnWound::Invalidate() { - SEPatientAction::Clear(); + SEPatientAction::Invalidate(); m_Inflammation = false; m_compartmentsAffected.clear(); - m_DegreeOfBurn = (CDM::enumBurnDegree::value)-1; + m_DegreeOfBurn = SEBurnDegree::Invalid; m_burnInitiationTime = 0.; - m_TBSA->Clear(); + m_TBSA->Invalidate(); } //----------------------------------------------------------------------------- bool SEBurnWound::IsValid() const @@ -56,62 +57,6 @@ bool SEBurnWound::IsActive() const return IsValid() ? !(m_TBSA->GetValue() < ZERO_APPROX) : false; } //----------------------------------------------------------------------------- -bool SEBurnWound::Load(const CDM::BurnWoundData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - SetTotalBodySurfaceArea(0.); - // The degree modifier is a v1.0 methodology for scaling burn response based on instantiated degree of burn specific to the minimal physiology response of first degree as compared to second and third. - // Minimal validation data exists differentiating the physiology of the three in the hours following a burn, so inital values for second and third are tuned to mimic TBSA data of both. - - if (in.DegreeOfBurn().present()) { - SetDegreeOfBurn(in.DegreeOfBurn().get()); - } else { - SetDegreeOfBurn(CDM::enumBurnDegree::Third); - } - - if (in.BurnInitiationTime().present()) { - SetTimeOfBurn(in.BurnInitiationTime().get()); - } - - m_compartmentsAffected.clear(); - std::string compt; - for (const std::string compData : in.Compartments()) { - AddCompartment(compData); - } - - if (!HasCompartment()) { - Warning("No compartment declared for burn. BioGears will assume primarily trunk burn."); - m_compartmentsAffected.push_back("Trunk"); - } - - SetTotalBodySurfaceArea(in.TotalBodySurfaceArea().value()); - - - return true; -} -//----------------------------------------------------------------------------- -CDM::BurnWoundData* SEBurnWound::Unload() const -{ - CDM::BurnWoundData* data(new CDM::BurnWoundData()); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEBurnWound::Unload(CDM::BurnWoundData& data) const -{ - SEPatientAction::Unload(data); - if (m_TBSA != nullptr) - data.TotalBodySurfaceArea(std::unique_ptr(m_TBSA->Unload())); - if (HasDegreeOfBurn()) - data.DegreeOfBurn(m_DegreeOfBurn); - if (m_burnInitiationTime != 0.) { - data.BurnInitiationTime(m_burnInitiationTime); - } - for (std::string compData : m_compartmentsAffected) { - data.Compartments().push_back(compData); - } -} -//----------------------------------------------------------------------------- bool SEBurnWound::HasTotalBodySurfaceArea() const { return m_TBSA == nullptr ? false : m_TBSA->IsValid(); @@ -150,25 +95,25 @@ void SEBurnWound::SetTotalBodySurfaceArea(double rhs) //----------------------------------------------------------------------------- bool SEBurnWound::HasDegreeOfBurn() const { - return m_DegreeOfBurn == ((CDM::enumBurnDegree::value)-1) ? false : true; + return m_DegreeOfBurn == SEBurnDegree::Invalid ? false : true; } //----------------------------------------------------------------------------- -CDM::enumBurnDegree::value SEBurnWound::GetDegreeOfBurn() const +SEBurnDegree SEBurnWound::GetDegreeOfBurn() const { return m_DegreeOfBurn; } //----------------------------------------------------------------------------- -void SEBurnWound::SetDegreeOfBurn(CDM::enumBurnDegree::value bd) +void SEBurnWound::SetDegreeOfBurn(SEBurnDegree bd) { m_DegreeOfBurn = bd; switch (bd) { - case CDM::enumBurnDegree::First: + case SEBurnDegree::First: m_DegreeModifier = 0.05; break; - case CDM::enumBurnDegree::Second: + case SEBurnDegree::Second: m_DegreeModifier = 0.99; break; - case CDM::enumBurnDegree::Third: + case SEBurnDegree::Third: m_DegreeModifier = 1.0; break; default: @@ -203,13 +148,13 @@ void SEBurnWound::SetInflammation(bool activate) //----------------------------------------------------------------------------- bool SEBurnWound::HasCompartment() const { - return m_compartmentsAffected.size() == 0 ? false : true; + return m_compartmentsAffected.empty() ? false : true; } //----------------------------------------------------------------------------- bool SEBurnWound::HasCompartment(const std::string compartment) const { for (const std::string ca : m_compartmentsAffected) { - if (compartment == ca && m_DegreeOfBurn != CDM::enumBurnDegree::First) + if (compartment == ca && m_DegreeOfBurn != SEBurnDegree::First) return true; } return false; diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SECardiacArrest.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SECardiacArrest.cpp index 35534f5d7..9370aa451 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SECardiacArrest.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SECardiacArrest.cpp @@ -12,22 +12,23 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/PatientActions.h" namespace biogears { SECardiacArrest::SECardiacArrest() : SEPatientAction() { - m_State = CDM::enumOnOff::Off; + m_State = SEOnOff::Off; } //------------------------------------------------------------------------------- SECardiacArrest::~SECardiacArrest() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SECardiacArrest::Clear() +void SECardiacArrest::Invalidate() { - SEPatientAction::Clear(); - m_State = CDM::enumOnOff::Off; + SEPatientAction::Invalidate(); + m_State = SEOnOff::Off; } //------------------------------------------------------------------------------- bool SECardiacArrest::IsValid() const @@ -37,32 +38,12 @@ bool SECardiacArrest::IsValid() const //------------------------------------------------------------------------------- bool SECardiacArrest::IsActive() const { - return IsValid() && m_State == CDM::enumOnOff::On; + return IsValid() && m_State == SEOnOff::On; } //------------------------------------------------------------------------------- void SECardiacArrest::SetActive(bool b) { - m_State = b ? CDM::enumOnOff::On : CDM::enumOnOff::Off; -} -//------------------------------------------------------------------------------- -bool SECardiacArrest::Load(const CDM::CardiacArrestData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - m_State = in.State(); - return true; -} -//------------------------------------------------------------------------------- -CDM::CardiacArrestData* SECardiacArrest::Unload() const -{ - CDM::CardiacArrestData* data(new CDM::CardiacArrestData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SECardiacArrest::Unload(CDM::CardiacArrestData& data) const -{ - SEPatientAction::Unload(data); - data.State(m_State); + m_State = b ? SEOnOff::On : SEOnOff::Off; } //------------------------------------------------------------------------------- void SECardiacArrest::ToString(std::ostream& str) const diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEChestCompression.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEChestCompression.cpp index c937c3839..f5a8e0638 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEChestCompression.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEChestCompression.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientActions.h" namespace biogears { SEChestCompression::SEChestCompression() : SEPatientAction() @@ -19,12 +20,12 @@ SEChestCompression::SEChestCompression() //------------------------------------------------------------------------------- SEChestCompression::~SEChestCompression() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEChestCompression::Clear() +void SEChestCompression::Invalidate() { - SEPatientAction::Clear(); + SEPatientAction::Invalidate(); } //------------------------------------------------------------------------------- bool SEChestCompression::IsValid() const @@ -37,24 +38,6 @@ bool SEChestCompression::IsActive() const return IsValid(); } //------------------------------------------------------------------------------- -bool SEChestCompression::Load(const CDM::ChestCompressionData& in) -{ - SEPatientAction::Load(in); - return true; -} -//------------------------------------------------------------------------------- -CDM::ChestCompressionData* SEChestCompression::Unload() const -{ - CDM::ChestCompressionData* data(new CDM::ChestCompressionData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEChestCompression::Unload(CDM::ChestCompressionData& data) const -{ - SEPatientAction::Unload(data); -} -//------------------------------------------------------------------------------- void SEChestCompression::ToString(std::ostream& str) const { str << "Patient Action : Chest Compression"; diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEChestCompressionForce.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEChestCompressionForce.cpp index 6536237d2..cc19c2d2b 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEChestCompressionForce.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEChestCompressionForce.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientActions.h" #include #include @@ -23,12 +24,12 @@ SEChestCompressionForce::SEChestCompressionForce() //------------------------------------------------------------------------------- SEChestCompressionForce::~SEChestCompressionForce() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEChestCompressionForce::Clear() +void SEChestCompressionForce::Invalidate() { - SEChestCompression::Clear(); + SEChestCompression::Invalidate(); SAFE_DELETE(m_Force); } //------------------------------------------------------------------------------- @@ -42,27 +43,6 @@ bool SEChestCompressionForce::IsActive() const return IsValid() ? !m_Force->IsZero() : false; } //------------------------------------------------------------------------------- -bool SEChestCompressionForce::Load(const CDM::ChestCompressionForceData& in, std::default_random_engine *rd) -{ - SEChestCompression::Load(in); - GetForce().Load(in.Force(), rd); - return true; -} -//------------------------------------------------------------------------------- -CDM::ChestCompressionForceData* SEChestCompressionForce::Unload() const -{ - CDM::ChestCompressionForceData* data(new CDM::ChestCompressionForceData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEChestCompressionForce::Unload(CDM::ChestCompressionForceData& data) const -{ - SEChestCompression::Unload(data); - if (m_Force != nullptr) - data.Force(std::unique_ptr(m_Force->Unload())); -} -//------------------------------------------------------------------------------- bool SEChestCompressionForce::HasForce() const { return m_Force == nullptr ? false : m_Force->IsValid(); diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEChestCompressionForceScale.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEChestCompressionForceScale.cpp index 5faad3ebd..f5c92a3d6 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEChestCompressionForceScale.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEChestCompressionForceScale.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include + +#include "io/cdm/PatientActions.h" #include #include @@ -21,76 +23,53 @@ SEChestCompressionForceScale::SEChestCompressionForceScale() m_ForceScale = nullptr; m_ForcePeriod = nullptr; } - +//------------------------------------------------------------------------------- SEChestCompressionForceScale::~SEChestCompressionForceScale() { - Clear(); + Invalidate(); } - -void SEChestCompressionForceScale::Clear() +//------------------------------------------------------------------------------- +void SEChestCompressionForceScale::Invalidate() { - SEChestCompression::Clear(); + SEChestCompression::Invalidate(); SAFE_DELETE(m_ForceScale); SAFE_DELETE(m_ForcePeriod); } - +//------------------------------------------------------------------------------- bool SEChestCompressionForceScale::IsValid() const { return SEChestCompression::IsValid() && HasForceScale(); } - +//------------------------------------------------------------------------------- bool SEChestCompressionForceScale::IsActive() const { return IsValid() ? !m_ForceScale->IsZero() : false; } - -bool SEChestCompressionForceScale::Load(const CDM::ChestCompressionForceScaleData& in, std::default_random_engine *rd) -{ - SEChestCompression::Load(in); - GetForceScale().Load(in.ForceScale(), rd); - if (in.ForcePeriod().present()) - GetForcePeriod().Load(in.ForcePeriod().get(), rd); - return true; -} - -CDM::ChestCompressionForceScaleData* SEChestCompressionForceScale::Unload() const -{ - CDM::ChestCompressionForceScaleData* data(new CDM::ChestCompressionForceScaleData()); - Unload(*data); - return data; -} - -void SEChestCompressionForceScale::Unload(CDM::ChestCompressionForceScaleData& data) const -{ - SEChestCompression::Unload(data); - if (m_ForceScale != nullptr) - data.ForceScale(std::unique_ptr(m_ForceScale->Unload())); - if (m_ForcePeriod != nullptr) - data.ForcePeriod(std::unique_ptr(m_ForcePeriod->Unload())); -} - +//------------------------------------------------------------------------------- bool SEChestCompressionForceScale::HasForceScale() const { return m_ForceScale == nullptr ? false : m_ForceScale->IsValid(); } +//------------------------------------------------------------------------------- SEScalar0To1& SEChestCompressionForceScale::GetForceScale() { if (m_ForceScale == nullptr) m_ForceScale = new SEScalar0To1(); return *m_ForceScale; } - +//------------------------------------------------------------------------------- bool SEChestCompressionForceScale::HasForcePeriod() const { return m_ForcePeriod == nullptr ? false : m_ForcePeriod->IsValid(); } +//------------------------------------------------------------------------------- SEScalarTime& SEChestCompressionForceScale::GetForcePeriod() { if (m_ForcePeriod == nullptr) m_ForcePeriod = new SEScalarTime(); return *m_ForcePeriod; } - +//------------------------------------------------------------------------------- void SEChestCompressionForceScale::ToString(std::ostream& str) const { str << "Patient Action : Chest Compression"; diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEChestOcclusiveDressing.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEChestOcclusiveDressing.cpp index 4b93cc486..147af817c 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEChestOcclusiveDressing.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEChestOcclusiveDressing.cpp @@ -12,24 +12,25 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/PatientActions.h" namespace biogears { SEChestOcclusiveDressing::SEChestOcclusiveDressing() : SEPatientAction() { - m_State = CDM::enumOnOff::Off; - m_Side = (CDM::enumSide::value)-1; + m_State = SEOnOff::Off; + m_Side = SESide::Invalid; } //------------------------------------------------------------------------------- SEChestOcclusiveDressing::~SEChestOcclusiveDressing() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEChestOcclusiveDressing::Clear() +void SEChestOcclusiveDressing::Invalidate() { - SEPatientAction::Clear(); - m_State = CDM::enumOnOff::Off; - m_Side = (CDM::enumSide::value)-1; + SEPatientAction::Invalidate(); + m_State = SEOnOff::Off; + m_Side = SESide::Invalid; } //------------------------------------------------------------------------------- bool SEChestOcclusiveDressing::IsValid() const @@ -39,55 +40,32 @@ bool SEChestOcclusiveDressing::IsValid() const //------------------------------------------------------------------------------- bool SEChestOcclusiveDressing::IsActive() const { - return IsValid() && m_State == CDM::enumOnOff::On; + return IsValid() && m_State == SEOnOff::On; } //------------------------------------------------------------------------------- void SEChestOcclusiveDressing::SetActive(bool b) { - m_State = b ? CDM::enumOnOff::On : CDM::enumOnOff::Off; + m_State = b ? SEOnOff::On : SEOnOff::Off; } //------------------------------------------------------------------------------- -bool SEChestOcclusiveDressing::Load(const CDM::ChestOcclusiveDressingData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - m_Side = in.Side(); - m_State = in.State(); - return true; -} -//------------------------------------------------------------------------------- -CDM::ChestOcclusiveDressingData* SEChestOcclusiveDressing::Unload() const -{ - CDM::ChestOcclusiveDressingData* data(new CDM::ChestOcclusiveDressingData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEChestOcclusiveDressing::Unload(CDM::ChestOcclusiveDressingData& data) const -{ - SEPatientAction::Unload(data); - data.State(m_State); - if (HasSide()) - data.Side(m_Side); -} -//------------------------------------------------------------------------------- -CDM::enumSide::value SEChestOcclusiveDressing::GetSide() const +SESide SEChestOcclusiveDressing::GetSide() const { return m_Side; } //------------------------------------------------------------------------------- -void SEChestOcclusiveDressing::SetSide(CDM::enumSide::value Side) +void SEChestOcclusiveDressing::SetSide(SESide Side) { m_Side = Side; } //------------------------------------------------------------------------------- bool SEChestOcclusiveDressing::HasSide() const { - return m_Side == ((CDM::enumSide::value)-1) ? false : true; + return m_Side == SESide::Invalid ? false : true; } //------------------------------------------------------------------------------- void SEChestOcclusiveDressing::InvalidateSide() { - m_Side = (CDM::enumSide::value)-1; + m_Side = SESide::Invalid; } //------------------------------------------------------------------------------- void SEChestOcclusiveDressing::ToString(std::ostream& str) const diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEActionExample.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEChestTube.cpp similarity index 53% rename from projects/biogears/libBiogears/src/cdm/patient/actions/SEActionExample.cpp rename to projects/biogears/libBiogears/src/cdm/patient/actions/SEChestTube.cpp index c2474cf08..22433d80a 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEActionExample.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEChestTube.cpp @@ -9,91 +9,85 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **************************************************************************************/ -#include -#include -#include +#include +#include "io/cdm/PatientActions.h" namespace biogears { -SEActionExample::SEActionExample() +SEChestTube::SEChestTube() : SEPatientAction() { - m_Severity = nullptr; + m_State = SEOnOff::Off; + m_Side = SESide::Invalid; } //------------------------------------------------------------------------------- -SEActionExample::~SEActionExample() +SEChestTube::~SEChestTube() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEActionExample::Clear() +void SEChestTube::Invalidate() { - - SEPatientAction::Clear(); - SAFE_DELETE(m_Severity); + SEPatientAction::Invalidate(); + m_State = SEOnOff::Off; + m_Side = SESide::Invalid; } //------------------------------------------------------------------------------- -bool SEActionExample::IsValid() const +bool SEChestTube::IsValid() const { - return HasSeverity(); + return SEPatientAction::IsValid() && HasSide(); } //------------------------------------------------------------------------------- -bool SEActionExample::IsActive() const +bool SEChestTube::IsActive() const { - return IsValid() ? !m_Severity->IsZero() : false; + return IsValid() && m_State == SEOnOff::On; } //------------------------------------------------------------------------------- -bool SEActionExample::Load(const CDM::ExampleActionData& in, std::default_random_engine *rd) +void SEChestTube::SetActive(bool b) { - SEPatientAction::Load(in); - GetSeverity().Load(in.Severity(), rd); - return true; + m_State = b ? SEOnOff::On : SEOnOff::Off; } //------------------------------------------------------------------------------- -CDM::ExampleActionData* SEActionExample::Unload() const +SESide SEChestTube::GetSide() const { - CDM::ExampleActionData* data(new CDM::ExampleActionData()); - Unload(*data); - return data; + return m_Side; } //------------------------------------------------------------------------------- -void SEActionExample::Unload(CDM::ExampleActionData& data) const +void SEChestTube::SetSide(SESide Side) { - SEPatientAction::Unload(data); - if (m_Severity != nullptr) - data.Severity(std::unique_ptr(m_Severity->Unload())); + m_Side = Side; } //------------------------------------------------------------------------------- -bool SEActionExample::HasSeverity() const +bool SEChestTube::HasSide() const { - return m_Severity == nullptr ? false : m_Severity->IsValid(); + return m_Side == SESide::Invalid ? false : true; } //------------------------------------------------------------------------------- -SEScalar0To1& SEActionExample::GetSeverity() +void SEChestTube::InvalidateSide() { - if (m_Severity == nullptr) - m_Severity = new SEScalar0To1(); - return *m_Severity; + m_Side = SESide::Invalid; } //------------------------------------------------------------------------------- -void SEActionExample::ToString(std::ostream& str) const +void SEChestTube::ToString(std::ostream& str) const { - str << "Patient Action : Action Example"; + str << "Patient Action : Chest Tube"; if (HasComment()) str << "\n\tComment: " << m_Comment; - str << "\n\tSeverity: "; - HasSeverity() ? str << *m_Severity : str << "Not Set"; + str << "\n\tState: " << IsActive(); + str << "\n\tSide: "; + HasSide() ? str << GetSide() : str << "No Side Set"; str << std::flush; } //------------------------------------------------------------------------------- -bool SEActionExample::operator==(const SEActionExample& rhs) const +bool SEChestTube::operator==(const SEChestTube& rhs) const { bool equivilant = m_Comment == rhs.m_Comment; - equivilant &= (m_Severity && rhs.m_Severity) ? m_Severity->operator==(*rhs.m_Severity) : m_Severity == rhs.m_Severity; + equivilant &= m_Side == rhs.m_Side; + equivilant &= m_State == rhs.m_State; return equivilant; } //------------------------------------------------------------------------------- -bool SEActionExample::operator!=(const SEActionExample& rhs) const +bool SEChestTube::operator!=(const SEChestTube& rhs) const { return !(*this == rhs); } diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEConsciousRespiration.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEConsciousRespiration.cpp index ea0154096..06354c5ef 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEConsciousRespiration.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEConsciousRespiration.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientActions.h" #include #include #include @@ -28,13 +29,13 @@ SEConsciousRespiration::SEConsciousRespiration() SEConsciousRespiration::~SEConsciousRespiration() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEConsciousRespiration::Clear() +void SEConsciousRespiration::Invalidate() { - SEPatientAction::Clear(); + SEPatientAction::Invalidate(); if (m_ClearCommands) DELETE_VECTOR(m_Commands); } @@ -51,62 +52,6 @@ bool SEConsciousRespiration::IsActive() const return SEPatientAction::IsActive(); } //------------------------------------------------------------------------------- - -bool SEConsciousRespiration::Load(const CDM::ConsciousRespirationData& in, const SESubstanceManager& substances, std::default_random_engine *rd) -{ - // Set this before our super class tells us to Clear if the action wants us to keep our current data - m_ClearCommands = !in.AppendToPrevious(); - SEPatientAction::Load(in); - m_ClearCommands = true; - CDM::ConsciousRespirationCommandData* command; - for (unsigned int i = 0; i < in.Command().size(); i++) { - command = (CDM::ConsciousRespirationCommandData*)&in.Command()[i]; - - CDM::BreathHoldData* bh = dynamic_cast(command); - if (bh != nullptr) { - AddBreathHold().Load(*bh, rd); - continue; - } - - CDM::ForcedInhaleData* fi = dynamic_cast(command); - if (fi != nullptr) { - AddForcedInhale().Load(*fi, rd); - continue; - } - - CDM::ForcedExhaleData* fe = dynamic_cast(command); - if (fe != nullptr) { - AddForcedExhale().Load(*fe, rd); - continue; - } - - CDM::UseInhalerData* si = dynamic_cast(command); - if (si != nullptr) { - AddUseInhaler().Load(*si, rd); - continue; - } - } - return true; -} -//------------------------------------------------------------------------------- - -CDM::ConsciousRespirationData* SEConsciousRespiration::Unload() const -{ - CDM::ConsciousRespirationData* data(new CDM::ConsciousRespirationData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- - -void SEConsciousRespiration::Unload(CDM::ConsciousRespirationData& data) const -{ - SEPatientAction::Unload(data); - data.AppendToPrevious(false); - for (SEConsciousRespirationCommand* cmd : m_Commands) - data.Command().push_back(std::unique_ptr(cmd->Unload())); -} -//------------------------------------------------------------------------------- - SEConsciousRespirationCommand* SEConsciousRespiration::GetActiveCommand() { if (!m_Commands.empty()) diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEConsciousRespirationCommand.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEConsciousRespirationCommand.cpp index c3c4ff1fe..0cbfb3696 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEConsciousRespirationCommand.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEConsciousRespirationCommand.cpp @@ -12,6 +12,7 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/PatientActions.h" namespace biogears { SEConsciousRespirationCommand::SEConsciousRespirationCommand() { @@ -20,27 +21,14 @@ SEConsciousRespirationCommand::SEConsciousRespirationCommand() //------------------------------------------------------------------------------- SEConsciousRespirationCommand::~SEConsciousRespirationCommand() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEConsciousRespirationCommand::Clear() +void SEConsciousRespirationCommand::Invalidate() { m_Comment = ""; } //------------------------------------------------------------------------------- -bool SEConsciousRespirationCommand::Load(const CDM::ConsciousRespirationCommandData& in) -{ - if (in.Comment().present()) - m_Comment = in.Comment().get(); - return true; -} -//------------------------------------------------------------------------------- -void SEConsciousRespirationCommand::Unload(CDM::ConsciousRespirationCommandData& data) const -{ - if (HasComment()) - data.Comment(m_Comment); -} -//------------------------------------------------------------------------------- bool SEConsciousRespirationCommand::IsValid() const { return true; diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEConsumeNutrients.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEConsumeNutrients.cpp index d52f4282f..8e0b585a2 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEConsumeNutrients.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEConsumeNutrients.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientActions.h" #include #include #include @@ -25,12 +26,12 @@ namespace biogears { //----------------------------------------------------------------------------- SEConsumeNutrients::~SEConsumeNutrients() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- - void SEConsumeNutrients::Clear() + void SEConsumeNutrients::Invalidate() { - SEPatientAction::Clear(); + SEPatientAction::Invalidate(); SAFE_DELETE(m_Nutrition); InvalidateNutritionFile(); } @@ -45,35 +46,9 @@ namespace biogears { return IsValid(); } //----------------------------------------------------------------------------- - bool SEConsumeNutrients::Load(const CDM::ConsumeNutrientsData& in, std::default_random_engine *rd) - { - SEPatientAction::Load(in); - if (in.Nutrition().present()) - GetNutrition().Load(in.Nutrition().get(), rd); - else if (in.NutritionFile().present()) - SetNutritionFile(in.NutritionFile().get()); - return true; - } - //----------------------------------------------------------------------------- - CDM::ConsumeNutrientsData* SEConsumeNutrients::Unload() const - { - CDM::ConsumeNutrientsData* data(new CDM::ConsumeNutrientsData()); - Unload(*data); - return data; - } - //----------------------------------------------------------------------------- - void SEConsumeNutrients::Unload(CDM::ConsumeNutrientsData& data) const - { - SEPatientAction::Unload(data); - if (HasNutrition()) - data.Nutrition(std::unique_ptr(m_Nutrition->Unload())); - if (HasNutritionFile()) - data.NutritionFile(m_NutritionFile); - } - //----------------------------------------------------------------------------- bool SEConsumeNutrients::HasNutrition() const { - return m_Nutrition != nullptr; + return m_Nutrition != nullptr && m_Nutrition->IsValid(); } //----------------------------------------------------------------------------- SENutrition& SEConsumeNutrients::GetNutrition() diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEEbola.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEEbola.cpp index ed03bdd1e..b05272e1b 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEEbola.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEEbola.cpp @@ -10,6 +10,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientActions.h" #include #include @@ -18,18 +19,18 @@ namespace biogears SEEbola::SEEbola() : SEPatientAction() { - m_Severity = (CDM::enumInfectionSeverity::value)-1; + m_Severity = SEInfectionSeverity::Invalid; } //------------------------------------------------------------------------------- SEEbola::~SEEbola() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- - void SEEbola::Clear() + void SEEbola::Invalidate() { - SEPatientAction::Clear(); - m_Severity = (CDM::enumInfectionSeverity::value)-1; + SEPatientAction::Invalidate(); + m_Severity = SEInfectionSeverity::Invalid; } //------------------------------------------------------------------------------- bool SEEbola::IsValid() const @@ -39,48 +40,27 @@ SEEbola::SEEbola() //------------------------------------------------------------------------------- bool SEEbola::IsActive() const { - return m_Severity == CDM::enumInfectionSeverity::Eliminated ? false : true; + return m_Severity == SEInfectionSeverity::Eliminated ? false : true; } //------------------------------------------------------------------------------- - bool SEEbola::Load(const CDM::EbolaData& in, std::default_random_engine *rd) - { - SEPatientAction::Load(in); - m_Severity = in.Severity(); - return true; - } - //------------------------------------------------------------------------------- - CDM::EbolaData* SEEbola::Unload() const - { - CDM::EbolaData* data(new CDM::EbolaData()); - Unload(*data); - return data; - } - //------------------------------------------------------------------------------- - void SEEbola::Unload(CDM::EbolaData& data) const - { - SEPatientAction::Unload(data); - if (HasSeverity()) - data.Severity(m_Severity); - } - //------------------------------------------------------------------------------- - CDM::enumInfectionSeverity::value SEEbola::GetSeverity() const + SEInfectionSeverity SEEbola::GetSeverity() const { return m_Severity; } //------------------------------------------------------------------------------- - void SEEbola::SetSeverity(CDM::enumInfectionSeverity::value t) + void SEEbola::SetSeverity(SEInfectionSeverity t) { m_Severity = t; } //------------------------------------------------------------------------------- bool SEEbola::HasSeverity() const { - return m_Severity == ((CDM::enumInfectionSeverity::value)-1) ? false : true; + return m_Severity == SEInfectionSeverity::Invalid ? false : true; } //------------------------------------------------------------------------------- void SEEbola::InvalidateSeverity() { - m_Severity = (CDM::enumInfectionSeverity::value)-1; + m_Severity = SEInfectionSeverity::Invalid; } //------------------------------------------------------------------------------- void SEEbola::ToString(std::ostream& str) const diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEEscharotomy.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEEscharotomy.cpp index 34a80ba42..bfc56663c 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEEscharotomy.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEEscharotomy.cpp @@ -11,7 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include -#include +#include "io/cdm/PatientActions.h" +#include #include namespace biogears { @@ -21,50 +22,28 @@ SEEscharotomy::SEEscharotomy() { m_Location = ""; //User input, location of escharotomy, check for compartment syndrome at location occurs later } - +//------------------------------------------------------------------------------- SEEscharotomy::~SEEscharotomy() { - Clear(); + Invalidate(); } - -void SEEscharotomy::Clear() +//------------------------------------------------------------------------------- +void SEEscharotomy::Invalidate() { - SEPatientAction::Clear(); + SEPatientAction::Invalidate(); m_Location = ""; } - +//------------------------------------------------------------------------------- bool SEEscharotomy::IsValid() const { const std::vector validCmpts { "LeftArm", "LeftLeg", "RightArm", "RightLeg", "Trunk" }; return SEPatientAction::IsValid() && HasLocation() && std::find(validCmpts.begin(), validCmpts.end(), GetLocation()) != validCmpts.end(); } - +//------------------------------------------------------------------------------- bool SEEscharotomy::IsActive() const { return IsValid(); } - -bool SEEscharotomy::Load(const CDM::EscharotomyData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - m_Location = in.Location(); - return true; -} - -CDM::EscharotomyData* SEEscharotomy::Unload() const -{ - CDM::EscharotomyData* data(new CDM::EscharotomyData()); - Unload(*data); - return data; -} - -void SEEscharotomy::Unload(CDM::EscharotomyData& data) const -{ - SEPatientAction::Unload(data); - if (HasLocation()) - data.Location(m_Location); -} - //------------------------------------------------------------------------------- std::string SEEscharotomy::GetLocation() const { @@ -91,7 +70,6 @@ void SEEscharotomy::SetLocation(const std::string& name) m_Location = name; } //------------------------------------------------------------------------------- - void SEEscharotomy::ToString(std::ostream& str) const { str << "Patient Action : Escharotomy"; diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEExampleAction.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEExampleAction.cpp index 16ac99ad4..61bc1e5d1 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEExampleAction.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEExampleAction.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientActions.h" #include #include @@ -23,13 +24,13 @@ SEExampleAction::SEExampleAction() //------------------------------------------------------------------------------- SEExampleAction::~SEExampleAction() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEExampleAction::Clear() +void SEExampleAction::Invalidate() { - SEPatientAction::Clear(); + SEPatientAction::Invalidate(); SAFE_DELETE(m_Severity); } //------------------------------------------------------------------------------- @@ -43,27 +44,6 @@ bool SEExampleAction::IsActive() const return IsValid() ? !m_Severity->IsZero() : false; } //------------------------------------------------------------------------------- -bool SEExampleAction::Load(const CDM::ExampleActionData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - GetSeverity().Load(in.Severity(), rd); - return true; -} -//------------------------------------------------------------------------------- -CDM::ExampleActionData* SEExampleAction::Unload() const -{ - CDM::ExampleActionData* data(new CDM::ExampleActionData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEExampleAction::Unload(CDM::ExampleActionData& data) const -{ - SEPatientAction::Unload(data); - if (m_Severity != nullptr) - data.Severity(std::unique_ptr(m_Severity->Unload())); -} -//------------------------------------------------------------------------------- bool SEExampleAction::HasSeverity() const { return m_Severity == nullptr ? false : m_Severity->IsValid(); diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEExercise.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEExercise.cpp index 293431fe7..3d54d9aeb 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEExercise.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEExercise.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientActions.h" #include #include #include @@ -52,25 +53,25 @@ SEExercise::~SEExercise() { } //------------------------------------------------------------------------------- -void SEExercise::Clear() +void SEExercise::Invalidate() { m_mode = NONE; - SEPatientAction::Clear(); + SEPatientAction::Invalidate(); SEGeneric gen; - gen.Intensity.Clear(); - gen.DesiredWorkRate.Clear(); + gen.Intensity.Invalidate(); + gen.DesiredWorkRate.Invalidate(); SECycling cyc; - cyc.CadenceCycle.Clear(); - cyc.PowerCycle.Clear(); - cyc.AddedWeight.Clear(); + cyc.CadenceCycle.Invalidate(); + cyc.PowerCycle.Invalidate(); + cyc.AddedWeight.Invalidate(); SERunning run; - run.SpeedRun.Clear(); - run.InclineRun.Clear(); - run.AddedWeight.Clear(); + run.SpeedRun.Invalidate(); + run.InclineRun.Invalidate(); + run.AddedWeight.Invalidate(); SEStrengthTraining str; - str.WeightStrength.Clear(); - str.RepsStrength.Clear(); + str.WeightStrength.Invalidate(); + str.RepsStrength.Invalidate(); } //------------------------------------------------------------------------------- bool SEExercise::IsValid() const @@ -98,119 +99,11 @@ bool SEExercise::IsActive() const } } //------------------------------------------------------------------------------- -bool SEExercise::Load(const CDM::ExerciseData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - if (in.GenericExercise().present()) { - LoadGeneric(in.GenericExercise().get(), rd); - } else if (in.CyclingExercise().present()) { - LoadCycling(in.CyclingExercise().get(), rd); - } else if (in.RunningExercise().present()) { - LoadRunning(in.RunningExercise().get(), rd); - } else if (in.StrengthExercise().present()) { - LoadStrength(in.StrengthExercise().get(), rd); - } - return true; -} -//------------------------------------------------------------------------------- SEExercise::ExerciseType SEExercise::GetExerciseType() const { return m_mode; } //------------------------------------------------------------------------------- -bool SEExercise::LoadGeneric(const CDM::GenericExerciseData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - m_mode = GENERIC; - if (in.Intensity().present()) { - m_genericExercise.Intensity.Load(in.Intensity().get()); - } else if (in.DesiredWorkRate().present()) { - m_genericExercise.DesiredWorkRate.Load(in.DesiredWorkRate().get()); - } - return true; -} -//------------------------------------------------------------------------------- -bool SEExercise::LoadCycling(const CDM::CyclingExerciseData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - m_mode = CYCLING; - m_cyclingExercise.CadenceCycle.Load(in.Cadence(), rd); - m_cyclingExercise.PowerCycle.Load(in.Power(), rd); - if (in.AddedWeight().present()) { - m_cyclingExercise.AddedWeight.Load(in.AddedWeight().get(), rd); - } else { - m_cyclingExercise.AddedWeight.SetValue(0, MassUnit::kg); - } - return true; -} -//------------------------------------------------------------------------------- -bool SEExercise::LoadRunning(const CDM::RunningExerciseData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - m_mode = RUNNING; - m_runningExercise.SpeedRun.Load(in.Speed(), rd); - m_runningExercise.InclineRun.Load(in.Incline(), rd); - if (in.AddedWeight().present()) { - m_runningExercise.AddedWeight.Load(in.AddedWeight().get(), rd); - } else { - m_runningExercise.AddedWeight.SetValue(0, MassUnit::kg); - } - return true; -} -//------------------------------------------------------------------------------- -bool SEExercise::LoadStrength(const CDM::StrengthExerciseData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - m_mode = STRENGTH_TRAINING; - m_strengthExercise.WeightStrength.Load(in.Weight(), rd); - m_strengthExercise.RepsStrength.Load(in.Repetitions(), rd); - return true; -} -//------------------------------------------------------------------------------- -CDM::ExerciseData* SEExercise::Unload() const -{ - CDM::ExerciseData* data(new CDM::ExerciseData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEExercise::Unload(CDM::ExerciseData& data) const -{ - SEPatientAction::Unload(data); - if (HasGenericExercise()) { - data.GenericExercise(std::make_unique()); - if (m_genericExercise.Intensity.IsValid()) { - data.GenericExercise()->Intensity(std::unique_ptr(m_genericExercise.Intensity.Unload())); - } else if (m_genericExercise.DesiredWorkRate.IsValid()) { - data.GenericExercise()->DesiredWorkRate(std::unique_ptr(m_genericExercise.DesiredWorkRate.Unload())); - } - } else if (HasCyclingExercise()) { - data.CyclingExercise(std::make_unique( - std::unique_ptr(), - std::unique_ptr())); - data.CyclingExercise()->Cadence(std::unique_ptr(m_cyclingExercise.CadenceCycle.Unload())); - data.CyclingExercise()->Power(std::unique_ptr(m_cyclingExercise.PowerCycle.Unload())); - if (m_cyclingExercise.AddedWeight.IsValid()) { - data.CyclingExercise()->AddedWeight(std::unique_ptr(m_cyclingExercise.AddedWeight.Unload())); - } - } else if (HasRunningExercise()) { - data.RunningExercise(std::make_unique( - std::unique_ptr(), - std::unique_ptr())); - data.RunningExercise()->Speed(std::unique_ptr(m_runningExercise.SpeedRun.Unload())); - data.RunningExercise()->Incline(std::unique_ptr(m_runningExercise.InclineRun.Unload())); - if (m_runningExercise.AddedWeight.IsValid()) { - data.RunningExercise()->AddedWeight(std::unique_ptr(m_runningExercise.AddedWeight.Unload())); - } - } else if (HasStrengthExercise()) { - data.StrengthExercise(std::make_unique( - std::unique_ptr(), - std::unique_ptr())); - data.StrengthExercise()->Weight(std::unique_ptr(m_strengthExercise.WeightStrength.Unload())); - data.StrengthExercise()->Repetitions(std::unique_ptr(m_strengthExercise.RepsStrength.Unload())); - } -} -//------------------------------------------------------------------------------- bool SEExercise::HasGenericExercise() const { return m_mode == GENERIC; }; //------------------------------------------------------------------------------- bool SEExercise::HasRunningExercise() const { return m_mode == RUNNING; }; diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEForcedExhale.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEForcedExhale.cpp index 8f61a5421..fc794019a 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEForcedExhale.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEForcedExhale.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientActions.h" #include #include @@ -21,76 +22,53 @@ SEForcedExhale::SEForcedExhale() m_ExpiratoryReserveVolumeFraction = nullptr; m_Period = nullptr; } - +//------------------------------------------------------------------------------- SEForcedExhale::~SEForcedExhale() { - Clear(); + Invalidate(); } - -void SEForcedExhale::Clear() +//------------------------------------------------------------------------------- +void SEForcedExhale::Invalidate() { - SEConsciousRespirationCommand::Clear(); + SEConsciousRespirationCommand::Invalidate(); SAFE_DELETE(m_ExpiratoryReserveVolumeFraction); SAFE_DELETE(m_Period); } - +//------------------------------------------------------------------------------- bool SEForcedExhale::IsValid() const { return SEConsciousRespirationCommand::IsValid() && HasExpiratoryReserveVolumeFraction() && HasPeriod(); } - +//------------------------------------------------------------------------------- bool SEForcedExhale::IsActive() const { return SEConsciousRespirationCommand::IsActive(); } - -bool SEForcedExhale::Load(const CDM::ForcedExhaleData& in, std::default_random_engine *rd) -{ - SEConsciousRespirationCommand::Load(in); - - GetExpiratoryReserveVolumeFraction().Load(in.ExpiratoryReserveVolumeFraction(), rd); - GetPeriod().Load(in.Period(), rd); - return true; -} - -CDM::ForcedExhaleData* SEForcedExhale::Unload() const -{ - CDM::ForcedExhaleData* data(new CDM::ForcedExhaleData()); - Unload(*data); - return data; -} - -void SEForcedExhale::Unload(CDM::ForcedExhaleData& data) const -{ - SEConsciousRespirationCommand::Unload(data); - if (m_ExpiratoryReserveVolumeFraction != nullptr) - data.ExpiratoryReserveVolumeFraction(std::unique_ptr(m_ExpiratoryReserveVolumeFraction->Unload())); - if (m_Period != nullptr) - data.Period(std::unique_ptr(m_Period->Unload())); -} - +//------------------------------------------------------------------------------- bool SEForcedExhale::HasExpiratoryReserveVolumeFraction() const { return m_ExpiratoryReserveVolumeFraction == nullptr ? false : m_ExpiratoryReserveVolumeFraction->IsValid(); } +//------------------------------------------------------------------------------- SEScalar0To1& SEForcedExhale::GetExpiratoryReserveVolumeFraction() { if (m_ExpiratoryReserveVolumeFraction == nullptr) m_ExpiratoryReserveVolumeFraction = new SEScalar0To1(); return *m_ExpiratoryReserveVolumeFraction; } - +//------------------------------------------------------------------------------- bool SEForcedExhale::HasPeriod() const { return m_Period == nullptr ? false : m_Period->IsValid(); } +//------------------------------------------------------------------------------- SEScalarTime& SEForcedExhale::GetPeriod() { if (m_Period == nullptr) m_Period = new SEScalarTime(); return *m_Period; } - +//------------------------------------------------------------------------------- void SEForcedExhale::ToString(std::ostream& str) const { str << "Forced Exhale"; @@ -102,4 +80,5 @@ void SEForcedExhale::ToString(std::ostream& str) const HasPeriod() ? str << *m_Period : str << "NaN"; str << std::flush; } +//------------------------------------------------------------------------------- } \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEForcedInhale.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEForcedInhale.cpp index e9c9b3996..924c76a76 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEForcedInhale.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEForcedInhale.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientActions.h" #include #include @@ -24,16 +25,21 @@ SEForcedInhale::SEForcedInhale() //------------------------------------------------------------------------------- SEForcedInhale::~SEForcedInhale() { - Clear(); -} -//------------------------------------------------------------------------------- -void SEForcedInhale::Clear() -{ - SEConsciousRespirationCommand::Clear(); SAFE_DELETE(m_InspiratoryCapacityFraction); SAFE_DELETE(m_Period); } //------------------------------------------------------------------------------- +void SEForcedInhale::Invalidate() +{ + SEConsciousRespirationCommand::Invalidate(); + if (m_InspiratoryCapacityFraction) { + m_InspiratoryCapacityFraction->Invalidate(); + } + if (m_Period) { + m_Period->Invalidate(); + } + } +//------------------------------------------------------------------------------- bool SEForcedInhale::IsValid() const { return SEConsciousRespirationCommand::IsValid() && HasInspiratoryCapacityFraction() && HasPeriod(); @@ -44,30 +50,6 @@ bool SEForcedInhale::IsActive() const return SEConsciousRespirationCommand::IsActive(); } //------------------------------------------------------------------------------- -bool SEForcedInhale::Load(const CDM::ForcedInhaleData& in, std::default_random_engine *rd) -{ - SEConsciousRespirationCommand::Load(in); - GetInspiratoryCapacityFraction().Load(in.InspiratoryCapacityFraction(), rd); - GetPeriod().Load(in.Period(), rd); - return true; -} -//------------------------------------------------------------------------------- -CDM::ForcedInhaleData* SEForcedInhale::Unload() const -{ - CDM::ForcedInhaleData* data(new CDM::ForcedInhaleData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEForcedInhale::Unload(CDM::ForcedInhaleData& data) const -{ - SEConsciousRespirationCommand::Unload(data); - if (m_InspiratoryCapacityFraction != nullptr) - data.InspiratoryCapacityFraction(std::unique_ptr(m_InspiratoryCapacityFraction->Unload())); - if (m_Period != nullptr) - data.Period(std::unique_ptr(m_Period->Unload())); -} -//------------------------------------------------------------------------------- bool SEForcedInhale::HasInspiratoryCapacityFraction() const { return m_InspiratoryCapacityFraction == nullptr ? false : m_InspiratoryCapacityFraction->IsValid(); @@ -104,7 +86,7 @@ void SEForcedInhale::ToString(std::ostream& str) const str << std::flush; } //------------------------------------------------------------------------------- -bool SEForcedInhale::operator==( const SEForcedInhale& rhs) const +bool SEForcedInhale::operator==(const SEForcedInhale& rhs) const { bool equivilant = m_Comment == rhs.m_Comment; equivilant &= (m_InspiratoryCapacityFraction && rhs.m_InspiratoryCapacityFraction) ? m_InspiratoryCapacityFraction->operator==(*rhs.m_InspiratoryCapacityFraction) : m_InspiratoryCapacityFraction == rhs.m_InspiratoryCapacityFraction; @@ -112,7 +94,7 @@ bool SEForcedInhale::operator==( const SEForcedInhale& rhs) const return equivilant; } //------------------------------------------------------------------------------- -bool SEForcedInhale::operator!=( const SEForcedInhale& rhs) const +bool SEForcedInhale::operator!=(const SEForcedInhale& rhs) const { return !(*this == rhs); } diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEFracture.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEFracture.cpp new file mode 100644 index 000000000..6ec0601ca --- /dev/null +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEFracture.cpp @@ -0,0 +1,185 @@ +/************************************************************************************** +Copyright 2015 Applied Research Associates, Inc. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the License +at: +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +**************************************************************************************/ +#include + +#include "io/cdm/PatientActions.h" +#include + +namespace biogears { + +SEFracture::SEFracture() + : SEPatientAction() + , m_Severity(new SEScalar0To1()) +{ + + m_Inflammation = false; // When the fracture is constructed, the corresponding inflammation state has not been established + m_FracturedBone = SEFracturedBone::Invalid; // User input, bone affected + m_FractureType = SEFractureType::Invalid; // User input, type of fracture on bone + m_Side = SESide::Invalid; //Side of Affected Fracture +} +//----------------------------------------------------------------------------- +SEFracture::~SEFracture() +{ + Invalidate(); +} +//----------------------------------------------------------------------------- +void SEFracture::Invalidate() +{ + SEPatientAction::Invalidate(); + m_Inflammation = false; + m_FracturedBone = SEFracturedBone::Invalid; + m_Side = SESide::Invalid; + m_FractureType = SEFractureType::Invalid; + SAFE_DELETE(m_Severity); +} +//----------------------------------------------------------------------------- +bool SEFracture::IsValid() const +{ + return SEPatientAction::IsValid() && HasFracturedBone() && HasSide() && HasFractureType() && HasSeverity(); +} +//----------------------------------------------------------------------------- +bool SEFracture::IsActive() const +{ + return IsValid() ? !m_Severity->IsZero() : false; +} +//----------------------------------------------------------------------------- +bool SEFracture::HasFracturedBone() const +{ + return m_FracturedBone == SEFracturedBone::Invalid ? false : true; +} +//----------------------------------------------------------------------------- +SEFracturedBone SEFracture::GetFracturedBone() const +{ + return m_FracturedBone; +} +//----------------------------------------------------------------------------- +void SEFracture::SetFracturedBone(SEFracturedBone bone) +{ + m_FracturedBone = bone; +} +//------------------------------------------------------------------------------- +bool SEFracture::HasSide() const +{ + return m_Side == SESide::Invalid ? false : true; +} +//------------------------------------------------------------------------------- +SESide SEFracture::GetSide() const +{ + return m_Side; +} +//------------------------------------------------------------------------------- +void SEFracture::SetSide(SESide Side) +{ + m_Side = Side; +} +//------------------------------------------------------------------------------- +void SEFracture::InvalidateSide() +{ + m_Side = SESide::Invalid; +} +//----------------------------------------------------------------------------- +bool SEFracture::HasFractureType() const +{ + return m_FractureType == SEFractureType::Invalid ? false : true; +} +//----------------------------------------------------------------------------- +SEFractureType SEFracture::GetFractureType() const +{ + return m_FractureType; +} +//----------------------------------------------------------------------------- +void SEFracture::SetFractureType(SEFractureType type) +{ + m_FractureType = type; +} +//----------------------------------------------------------------------------- +bool SEFracture::HasSeverity() const +{ + return m_Severity == nullptr ? false : m_Severity->IsValid(); +} +//----------------------------------------------------------------------------- +SEScalar0To1& SEFracture::GetSeverity() +{ + if (m_Severity == nullptr) + m_Severity = new SEScalar0To1(); + return *m_Severity; +} +//----------------------------------------------------------------------------- +/* void SEFracture::SetSeverity(SEFracturedBone bone, SEFractureType type) +{ + switch (bone) { + case SEFracturedBone::Radius: + switch (type) { + case SEFractureType::Comminuted: + m_Severity->SetValue(0.3); // If comminuted AIS code 3 (severe, not life threatening) + break; + default: + m_Severity->SetValue(0.2); // Default to AIS code 2 (moderate) for radius fracture + } + break; + case SEFracturedBone::Tibia: + switch (type) { + case SEFractureType::Comminuted: + m_Severity->SetValue(0.3); // If comminuted AIS code 3 (severe, not life threatening) + break; + default: + m_Severity->SetValue(0.2); // Default to AIS code 2 (moderate) for tibia fracture + } + default: + m_Severity->SetValue(0.0); + break; + } +} */ +//----------------------------------------------------------------------------- +bool SEFracture::HasInflammation() const +{ + return m_Inflammation; +} +//----------------------------------------------------------------------------- +void SEFracture::SetInflammation(bool activate) +{ + m_Inflammation = activate; +} +//----------------------------------------------------------------------------- +void SEFracture::ToString(std::ostream& str) const +{ + // Currently all fields are required, but this should be updated if/when that is changed + str << "Patient Action : Musculoskeletal Fracture"; + if (HasComment()) + str << "\n\tComment: " << m_Comment; + str << "\n\tFractured Bone: "; + str << m_FracturedBone; + str << "\n\tFracture Type: "; + str << m_FractureType; + str << "\n\tSide: "; + str << m_Side; + str << "\n\tSeverity: "; + str << *m_Severity; + str << std::flush; +} +//------------------------------------------------------------------------------- +bool SEFracture::operator==(const SEFracture& rhs) const +{ + bool equivilant = m_Comment == rhs.m_Comment; + equivilant &= m_FracturedBone == rhs.m_FracturedBone; + equivilant &= m_FractureType == rhs.m_FractureType; + equivilant &= (m_Severity && rhs.m_Severity) ? m_Severity->operator==(*rhs.m_Severity) : m_Severity == rhs.m_Severity; + equivilant &= m_Side == rhs.m_Side; + + return equivilant; +} +//------------------------------------------------------------------------------- +bool SEFracture::operator!=(const SEFracture& rhs) const +{ + return !(*this == rhs); +} +} diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEHemorrhage.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEHemorrhage.cpp index b8520196a..653432958 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEHemorrhage.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEHemorrhage.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientActions.h" #include #include #include @@ -42,14 +43,15 @@ SEHemorrhage::SEHemorrhage() //----------------------------------------------------------------------------- SEHemorrhage::~SEHemorrhage() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SEHemorrhage::Clear() +void SEHemorrhage::Invalidate() { - SEPatientAction::Clear(); + SEPatientAction::Invalidate(); m_Compartment = ""; m_MCIS.clear(); + SAFE_DELETE(m_BleedResistance); SAFE_DELETE(m_InitialRate); } //----------------------------------------------------------------------------- @@ -63,37 +65,6 @@ bool SEHemorrhage::IsActive() const return IsValid() ? !(m_InitialRate->GetValue(VolumePerTimeUnit::mL_Per_min) <= ZERO_APPROX) : false; } //----------------------------------------------------------------------------- -bool SEHemorrhage::Load(const CDM::HemorrhageData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - m_Compartment = in.Compartment(); - GetInitialRate().Load(in.InitialRate(), rd); - if ( in.BleedResistance().present() ){ - GetBleedResistance().Load(in.BleedResistance().get(), rd); - } - SetMCIS(); - - return true; -} -//----------------------------------------------------------------------------- -CDM::HemorrhageData* SEHemorrhage::Unload() const -{ - CDM::HemorrhageData* data(new CDM::HemorrhageData()); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEHemorrhage::Unload(CDM::HemorrhageData& data) const -{ - SEPatientAction::Unload(data); - if (HasCompartment()) - data.Compartment(m_Compartment); - if (HasInitialRate()) - data.InitialRate(std::unique_ptr(m_InitialRate->Unload())); - if (HasBleedResistance()) - data.BleedResistance(std::unique_ptr(m_BleedResistance->Unload())); -} -//----------------------------------------------------------------------------- void SEHemorrhage::SetMCIS() { m_MCIS.clear(); @@ -177,7 +148,7 @@ void SEHemorrhage::InvalidateCompartment() //----------------------------------------------------------------------------- bool SEHemorrhage::HasInitialRate() const { - return m_InitialRate == nullptr ? false : true; + return m_InitialRate == nullptr ? false : m_InitialRate->IsValid(); } //----------------------------------------------------------------------------- //! @@ -199,7 +170,7 @@ SEScalarVolumePerTime const & SEHemorrhage::GetInitialRate() const //----------------------------------------------------------------------------- bool SEHemorrhage::HasBleedResistance() const { - return m_BleedResistance == nullptr ? false : true; + return m_BleedResistance == nullptr ? false : m_BleedResistance->IsValid(); } //----------------------------------------------------------------------------- SEScalarFlowResistance& SEHemorrhage::GetBleedResistance() diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEInfection.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEInfection.cpp index b5b292c1a..8252ef897 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEInfection.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEInfection.cpp @@ -9,6 +9,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientActions.h" #include #include @@ -18,20 +19,20 @@ namespace biogears : SEPatientAction() { m_Location = ""; //User input, location of infection - m_Severity = (CDM::enumInfectionSeverity::value)-1; + m_Severity = SEInfectionSeverity::Invalid; m_MinimumInhibitoryConcentration = nullptr; } //------------------------------------------------------------------------------- SEInfection::~SEInfection() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- - void SEInfection::Clear() + void SEInfection::Invalidate() { - SEPatientAction::Clear(); + SEPatientAction::Invalidate(); m_Location = ""; - m_Severity = (CDM::enumInfectionSeverity::value)-1; + m_Severity = SEInfectionSeverity::Invalid; SAFE_DELETE(m_MinimumInhibitoryConcentration); } //------------------------------------------------------------------------------- @@ -42,34 +43,7 @@ namespace biogears //------------------------------------------------------------------------------- bool SEInfection::IsActive() const { - return m_Severity == CDM::enumInfectionSeverity::Eliminated ? false : true; - } - //------------------------------------------------------------------------------- - bool SEInfection::Load(const CDM::InfectionData& in, std::default_random_engine * rd) - { - SEPatientAction::Load(in); - m_Location = in.Location(); - m_Severity = in.Severity(); - GetMinimumInhibitoryConcentration().Load(in.MinimumInhibitoryConcentration(), rd); - return true; - } - //------------------------------------------------------------------------------- - CDM::InfectionData* SEInfection::Unload() const - { - CDM::InfectionData* data(new CDM::InfectionData()); - Unload(*data); - return data; - } - //------------------------------------------------------------------------------- - void SEInfection::Unload(CDM::InfectionData& data) const - { - SEPatientAction::Unload(data); - if (HasLocation()) - data.Location(m_Location); - if (HasSeverity()) - data.Severity(m_Severity); - if (m_MinimumInhibitoryConcentration != nullptr) - data.MinimumInhibitoryConcentration(std::unique_ptr(m_MinimumInhibitoryConcentration->Unload())); + return m_Severity == SEInfectionSeverity::Eliminated ? false : true; } //------------------------------------------------------------------------------- const char* SEInfection::GetLocation_cStr() const @@ -102,24 +76,24 @@ namespace biogears m_Location = name; } //------------------------------------------------------------------------------- - CDM::enumInfectionSeverity::value SEInfection::GetSeverity() const + SEInfectionSeverity SEInfection::GetSeverity() const { return m_Severity; } //------------------------------------------------------------------------------- - void SEInfection::SetSeverity(CDM::enumInfectionSeverity::value t) + void SEInfection::SetSeverity(SEInfectionSeverity t) { m_Severity = t; } //------------------------------------------------------------------------------- bool SEInfection::HasSeverity() const { - return m_Severity == ((CDM::enumInfectionSeverity::value)-1) ? false : true; + return m_Severity == (SEInfectionSeverity::Invalid) ? false : true; } //------------------------------------------------------------------------------- void SEInfection::InvalidateSeverity() { - m_Severity = (CDM::enumInfectionSeverity::value)-1; + m_Severity = SEInfectionSeverity::Invalid; } //----------------------------------------------------------------------------- bool SEInfection::HasMinimumInhibitoryConcentration() const diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEIntubation.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEIntubation.cpp index 52bc4242a..53a62387d 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEIntubation.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEIntubation.cpp @@ -12,22 +12,23 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/PatientActions.h" namespace biogears { SEIntubation::SEIntubation() : SEPatientAction() { - m_Type = (CDM::enumIntubationType::value)-1; + m_Type = SEIntubationType::Invalid; } //------------------------------------------------------------------------------- SEIntubation::~SEIntubation() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEIntubation::Clear() +void SEIntubation::Invalidate() { - SEPatientAction::Clear(); - m_Type = (CDM::enumIntubationType::value)-1; + SEPatientAction::Invalidate(); + m_Type = SEIntubationType::Invalid; } //------------------------------------------------------------------------------- bool SEIntubation::IsValid() const @@ -37,48 +38,27 @@ bool SEIntubation::IsValid() const //------------------------------------------------------------------------------- bool SEIntubation::IsActive() const { - return HasType() && GetType() != CDM::enumIntubationType::Off; + return HasType() && GetType() != SEIntubationType::Off; } //------------------------------------------------------------------------------- -bool SEIntubation::Load(const CDM::IntubationData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - m_Type = in.Type(); - return true; -} -//------------------------------------------------------------------------------- -CDM::IntubationData* SEIntubation::Unload() const -{ - CDM::IntubationData* data(new CDM::IntubationData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEIntubation::Unload(CDM::IntubationData& data) const -{ - SEPatientAction::Unload(data); - if (HasType()) - data.Type(m_Type); -} -//------------------------------------------------------------------------------- -CDM::enumIntubationType::value SEIntubation::GetType() const +SEIntubationType SEIntubation::GetType() const { return m_Type; } //------------------------------------------------------------------------------- -void SEIntubation::SetType(CDM::enumIntubationType::value Type) +void SEIntubation::SetType(SEIntubationType Type) { m_Type = Type; } //------------------------------------------------------------------------------- bool SEIntubation::HasType() const { - return m_Type == ((CDM::enumIntubationType::value)-1) ? false : true; + return m_Type == SEIntubationType::Invalid ? false : true; } //------------------------------------------------------------------------------- void SEIntubation::InvalidateType() { - m_Type = (CDM::enumIntubationType::value)-1; + m_Type = SEIntubationType::Invalid; } //------------------------------------------------------------------------------- void SEIntubation::ToString(std::ostream& str) const diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEMechanicalVentilation.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEMechanicalVentilation.cpp index 31e962e81..a596e7d3d 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEMechanicalVentilation.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEMechanicalVentilation.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientActions.h" #include #include #include @@ -25,21 +26,21 @@ namespace biogears { SEMechanicalVentilation::SEMechanicalVentilation() : SEPatientAction() { - m_State = CDM::enumOnOff::value(-1); + m_State = SEOnOff::Invalid; m_Flow = nullptr; m_Pressure = nullptr; } //------------------------------------------------------------------------------- SEMechanicalVentilation::~SEMechanicalVentilation() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEMechanicalVentilation::Clear() +void SEMechanicalVentilation::Invalidate() { - SEPatientAction::Clear(); + SEPatientAction::Invalidate(); - m_State = CDM::enumOnOff::value(-1); + m_State = SEOnOff::Invalid; SAFE_DELETE(m_Flow); SAFE_DELETE(m_Pressure); @@ -53,7 +54,7 @@ bool SEMechanicalVentilation::IsValid() const Error("Mechanical Ventilation must have state."); return false; } - if (GetState() == CDM::enumOnOff::Off) + if (GetState() == SEOnOff::Off) return true; else { if (HasGasFraction()) { @@ -78,80 +79,24 @@ bool SEMechanicalVentilation::IsActive() const { if (!HasState()) return false; - return GetState() == CDM::enumOnOff::On; + return GetState() == SEOnOff::On; } //------------------------------------------------------------------------------- -bool SEMechanicalVentilation::Load(const CDM::MechanicalVentilationData& in, const SESubstanceManager& subMgr, std::default_random_engine *rd) -{ - SEPatientAction::Clear(); - SetState(in.State()); - if (in.Flow().present()) - GetFlow().Load(in.Flow().get(), rd); - else - GetFlow().Invalidate(); - if (in.Pressure().present()) - GetPressure().Load(in.Pressure().get(), rd); - else - GetPressure().Invalidate(); - - m_GasFractions.clear(); - m_cGasFractions.clear(); - SESubstance* sub; - for (const CDM::SubstanceFractionData& sfData : in.GasFraction()) { - sub = subMgr.GetSubstance(sfData.Name()); - if (sub == nullptr) { - Error("Substance not found : " + sfData.Name()); - return false; - } - if (sub->GetState() != CDM::enumSubstanceState::Gas) { - Error("Substance not gas : " + sfData.Name()); - return false; - } - SESubstanceFraction* sf = new SESubstanceFraction(*sub); - sf->Load(sfData); - m_GasFractions.push_back(sf); - m_cGasFractions.push_back(sf); - } - - return IsValid(); -} -//------------------------------------------------------------------------------- -CDM::MechanicalVentilationData* SEMechanicalVentilation::Unload() const -{ - CDM::MechanicalVentilationData* data = new CDM::MechanicalVentilationData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEMechanicalVentilation::Unload(CDM::MechanicalVentilationData& data) const -{ - SEPatientAction::Unload(data); - if (HasState()) - data.State(m_State); - if (HasFlow()) - data.Flow(std::unique_ptr(m_Flow->Unload())); - if (HasPressure()) - data.Pressure(std::unique_ptr(m_Pressure->Unload())); - - for (SESubstanceFraction* sf : m_GasFractions) - data.GasFraction().push_back(std::unique_ptr(sf->Unload())); -} -//------------------------------------------------------------------------------- -CDM::enumOnOff::value SEMechanicalVentilation::GetState() const +SEOnOff SEMechanicalVentilation::GetState() const { return m_State; } -void SEMechanicalVentilation::SetState(CDM::enumOnOff::value state) +void SEMechanicalVentilation::SetState(SEOnOff state) { m_State = state; } bool SEMechanicalVentilation::HasState() const { - return m_State == ((CDM::enumOnOff::value)-1) ? false : true; + return m_State == SEOnOff::Invalid ? false : true; } void SEMechanicalVentilation::InvalidateState() { - m_State = (CDM::enumOnOff::value)-1; + m_State = SEOnOff::Invalid; } //------------------------------------------------------------------------------- bool SEMechanicalVentilation::HasFlow() const @@ -190,7 +135,7 @@ double SEMechanicalVentilation::GetPressure(const PressureUnit& unit) const //------------------------------------------------------------------------------- bool SEMechanicalVentilation::HasGasFraction() const { - return m_GasFractions.size() == 0 ? false : true; + return m_GasFractions.empty() ? false : true; } bool SEMechanicalVentilation::HasGasFraction(const SESubstance& s) const { @@ -272,7 +217,7 @@ bool SEMechanicalVentilation::operator==(const SEMechanicalVentilation& rhs) con { /* - CDM::enumOnOff::value m_State; + SEOnOff m_State; SEScalarVolumePerTime* m_Flow; SEScalarPressure* m_Pressure; diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SENasalCannula.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SENasalCannula.cpp index f43ffc26e..7c4b977eb 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SENasalCannula.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SENasalCannula.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientActions.h" #include #include #include @@ -25,13 +26,13 @@ SENasalCannula::SENasalCannula() //------------------------------------------------------------------------------- SENasalCannula::~SENasalCannula() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SENasalCannula::Clear() +void SENasalCannula::Invalidate() { - SEPatientAction::Clear(); + SEPatientAction::Invalidate(); SAFE_DELETE(m_FlowRate); } //------------------------------------------------------------------------------- @@ -45,27 +46,6 @@ bool SENasalCannula::IsActive() const return IsValid() ? ! (m_FlowRate->GetValue(VolumePerTimeUnit::mL_Per_min) <= ZERO_APPROX) : false; } //------------------------------------------------------------------------------- -bool SENasalCannula::Load(const CDM::NasalCannulaData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - GetFlowRate().Load(in.FlowRate(), rd); - return true; -} -//------------------------------------------------------------------------------- -CDM::NasalCannulaData* SENasalCannula::Unload() const -{ - CDM::NasalCannulaData* data(new CDM::NasalCannulaData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SENasalCannula::Unload(CDM::NasalCannulaData& data) const -{ - SEPatientAction::Unload(data); - if (m_FlowRate != nullptr) - data.FlowRate(std::unique_ptr(m_FlowRate->Unload())); -} -//------------------------------------------------------------------------------- bool SENasalCannula::HasFlowRate() const { return m_FlowRate == nullptr ? false : m_FlowRate->IsValid(); diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SENeedleDecompression.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SENeedleDecompression.cpp index 89322d052..95df02b98 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SENeedleDecompression.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SENeedleDecompression.cpp @@ -12,24 +12,25 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/PatientActions.h" namespace biogears { SENeedleDecompression::SENeedleDecompression() : SEPatientAction() { - m_State = CDM::enumOnOff::Off; - m_Side = (CDM::enumSide::value)-1; + m_State = SEOnOff::Off; + m_Side = SESide::Invalid; } //------------------------------------------------------------------------------- SENeedleDecompression::~SENeedleDecompression() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SENeedleDecompression::Clear() +void SENeedleDecompression::Invalidate() { - SEPatientAction::Clear(); - m_State = CDM::enumOnOff::Off; - m_Side = (CDM::enumSide::value)-1; + SEPatientAction::Invalidate(); + m_State = SEOnOff::Off; + m_Side = SESide::Invalid; } //------------------------------------------------------------------------------- bool SENeedleDecompression::IsValid() const @@ -39,55 +40,32 @@ bool SENeedleDecompression::IsValid() const //------------------------------------------------------------------------------- bool SENeedleDecompression::IsActive() const { - return IsValid() && m_State == CDM::enumOnOff::On; + return IsValid() && m_State == SEOnOff::On; } //------------------------------------------------------------------------------- void SENeedleDecompression::SetActive(bool b) { - m_State = b ? CDM::enumOnOff::On : CDM::enumOnOff::Off; + m_State = b ? SEOnOff::On : SEOnOff::Off; } //------------------------------------------------------------------------------- -bool SENeedleDecompression::Load(const CDM::NeedleDecompressionData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - m_Side = in.Side(); - m_State = in.State(); - return true; -} -//------------------------------------------------------------------------------- -CDM::NeedleDecompressionData* SENeedleDecompression::Unload() const -{ - CDM::NeedleDecompressionData* data(new CDM::NeedleDecompressionData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SENeedleDecompression::Unload(CDM::NeedleDecompressionData& data) const -{ - SEPatientAction::Unload(data); - data.State(m_State); - if (HasSide()) - data.Side(m_Side); -} -//------------------------------------------------------------------------------- -CDM::enumSide::value SENeedleDecompression::GetSide() const +SESide SENeedleDecompression::GetSide() const { return m_Side; } //------------------------------------------------------------------------------- -void SENeedleDecompression::SetSide(CDM::enumSide::value Side) +void SENeedleDecompression::SetSide(SESide Side) { m_Side = Side; } //------------------------------------------------------------------------------- bool SENeedleDecompression::HasSide() const { - return m_Side == ((CDM::enumSide::value)-1) ? false : true; + return m_Side == SESide::Invalid ? false : true; } //------------------------------------------------------------------------------- void SENeedleDecompression::InvalidateSide() { - m_Side = (CDM::enumSide::value)-1; + m_Side = SESide::Invalid; } //------------------------------------------------------------------------------- void SENeedleDecompression::ToString(std::ostream& str) const diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEOverride.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEOverride.cpp index 8d7069810..d0f5e89d4 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEOverride.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEOverride.cpp @@ -12,6 +12,10 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/PatientActions.h" +#include +#include + #include #include #include @@ -25,8 +29,8 @@ namespace biogears { SEOverride::SEOverride() : SEPatientAction() { - m_OverrideState = CDM::enumOnOff::Off; - m_OverrideConformance = CDM::enumOnOff::On; + m_OverrideState = SEOnOff::Off; + m_OverrideConformance = SEOnOff::On; m_ArterialBloodPHOverride = nullptr; m_VenousBloodPHOverride = nullptr; m_CarbonDioxideSaturationOverride = nullptr; @@ -95,14 +99,14 @@ SEOverride::SEOverride() //------------------------------------------------------------------------------- SEOverride::~SEOverride() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEOverride::Clear() +void SEOverride::Invalidate() { - SEPatientAction::Clear(); - m_OverrideState = CDM::enumOnOff::Off; - m_OverrideConformance = CDM::enumOnOff::On; + SEPatientAction::Invalidate(); + m_OverrideState = SEOnOff::Off; + m_OverrideConformance = SEOnOff::On; SAFE_DELETE(m_ArterialBloodPHOverride); SAFE_DELETE(m_VenousBloodPHOverride); SAFE_DELETE(m_CarbonDioxideSaturationOverride); @@ -171,7 +175,7 @@ void SEOverride::Clear() //------------------------------------------------------------------------------- bool SEOverride::IsValid() const { - if ((GetOverrideState() == CDM::enumOnOff::On) + if ((GetOverrideState() == SEOnOff::On) && (HasOverrideConformance())) { if (HasBloodChemistryOverride() || HasCardiovascularOverride() @@ -182,7 +186,7 @@ bool SEOverride::IsValid() const || HasTissueOverride()) { return true; } - } else if ((GetOverrideState() == CDM::enumOnOff::Off) + } else if ((GetOverrideState() == SEOnOff::Off) && (HasOverrideConformance())) { return true; } else { @@ -193,585 +197,41 @@ bool SEOverride::IsValid() const //------------------------------------------------------------------------------- bool SEOverride::IsActive() const { - return (GetOverrideState() == CDM::enumOnOff::On); -} -//------------------------------------------------------------------------------- -bool SEOverride::Load(const CDM::OverrideData& in, std::default_random_engine *rd) -{ - SEPatientAction::Clear(); - SetOverrideState(in.State()); - SetOverrideConformance(in.Conformant()); - if (in.ArterialBloodPHOverride().present()) { - GetArterialPHOverride().Load(in.ArterialBloodPHOverride().get(), rd); - } else { - GetArterialPHOverride().Invalidate(); - } - if (in.VenousBloodPHOverride().present()) { - GetVenousPHOverride().Load(in.VenousBloodPHOverride().get(), rd); - } else { - GetVenousPHOverride().Invalidate(); - } - if (in.CarbonDioxideSaturationOverride().present()) { - GetCO2SaturationOverride().Load(in.CarbonDioxideSaturationOverride().get(), rd); - } else { - GetCO2SaturationOverride().Invalidate(); - } - if (in.CarbonMonoxideSaturationOverride().present()) { - GetCOSaturationOverride().Load(in.CarbonMonoxideSaturationOverride().get(), rd); - } else { - GetCOSaturationOverride().Invalidate(); - } - if (in.OxygenSaturationOverride().present()) { - GetO2SaturationOverride().Load(in.OxygenSaturationOverride().get(), rd); - } else { - GetO2SaturationOverride().Invalidate(); - } - if (in.PhosphateOverride().present()) { - GetPhosphateOverride().Load(in.PhosphateOverride().get(), rd); - } else { - GetPhosphateOverride().Invalidate(); - } - if (in.WhiteBloodCellCountOverride().present()) { - GetWBCCountOverride().Load(in.WhiteBloodCellCountOverride().get(), rd); - } else { - GetWBCCountOverride().Invalidate(); - } - if (in.TotalBilirubinOverride().present()) { - GetTotalBilirubinOverride().Load(in.TotalBilirubinOverride().get(), rd); - } else { - GetTotalBilirubinOverride().Invalidate(); - } - if (in.CalciumConcentrationOverride().present()) { - GetCalciumConcentrationOverride().Load(in.CalciumConcentrationOverride().get(), rd); - } else { - GetCalciumConcentrationOverride().Invalidate(); - } - if (in.GlucoseConcentrationOverride().present()) { - GetGlucoseConcentrationOverride().Load(in.GlucoseConcentrationOverride().get(), rd); - } else { - GetGlucoseConcentrationOverride().Invalidate(); - } - if (in.LactateConcentrationOverride().present()) { - GetLactateConcentrationOverride().Load(in.LactateConcentrationOverride().get(), rd); - } else { - GetLactateConcentrationOverride().Invalidate(); - } - if (in.PotassiumConcentrationOverride().present()) { - GetPotassiumConcentrationOverride().Load(in.PotassiumConcentrationOverride().get(), rd); - } else { - GetPotassiumConcentrationOverride().Invalidate(); - } - if (in.SodiumConcentrationOverride().present()) { - GetSodiumConcentrationOverride().Load(in.SodiumConcentrationOverride().get(), rd); - } else { - GetSodiumConcentrationOverride().Invalidate(); - } - if (in.BloodVolumeOverride().present()) { - GetBloodVolumeOverride().Load(in.BloodVolumeOverride().get(), rd); - } else { - GetBloodVolumeOverride().Invalidate(); - } - if (in.CardiacOutputOverride().present()) { - GetCardiacOutputOverride().Load(in.CardiacOutputOverride().get(), rd); - } else { - GetCardiacOutputOverride().Invalidate(); - } - if (in.DiastolicArterialPressureOverride().present()) { - GetDiastolicArterialPressureOverride().Load(in.DiastolicArterialPressureOverride().get(), rd); - } else { - GetDiastolicArterialPressureOverride().Invalidate(); - } - if (in.MeanArterialPressureOverride().present()) { - if (!in.DiastolicArterialPressureOverride().present() || !in.SystolicArterialPressureOverride().present()) { - GetMAPOverride().Load(in.MeanArterialPressureOverride().get(), rd); - } else { - Warning("If overriding systolic or diastolic pressures, the mean arterial pressure will change according to those changes."); - GetMAPOverride().Invalidate(); - } - } else { - GetMAPOverride().Invalidate(); - } - if (in.HeartRateOverride().present()) { - GetHeartRateOverride().Load(in.HeartRateOverride().get(), rd); - } else { - GetHeartRateOverride().Invalidate(); - } - if (in.HeartStrokeVolumeOverride().present()) { - GetHeartStrokeVolumeOverride().Load(in.HeartStrokeVolumeOverride().get(), rd); - } else { - GetHeartStrokeVolumeOverride().Invalidate(); - } - if (in.SystolicArterialPressureOverride().present()) { - GetSystolicArterialPressureOverride().Load(in.SystolicArterialPressureOverride().get(), rd); - } else { - GetSystolicArterialPressureOverride().Invalidate(); - } - if (in.InsulinSynthesisRateOverride().present()) { - GetInsulinSynthesisRateOverride().Load(in.InsulinSynthesisRateOverride().get(), rd); - } else { - GetInsulinSynthesisRateOverride().Invalidate(); - } - if (in.GlucagonSynthesisRateOverride().present()) { - GetGlucagonSynthesisRateOverride().Load(in.GlucagonSynthesisRateOverride().get(), rd); - } else { - GetGlucagonSynthesisRateOverride().Invalidate(); - } - if (in.AchievedExerciseLevelOverride().present()) { - GetAchievedExerciseLevelOverride().Load(in.AchievedExerciseLevelOverride().get(), rd); - } else { - GetAchievedExerciseLevelOverride().Invalidate(); - } - if (in.CoreTemperatureOverride().present()) { - GetCoreTemperatureOverride().Load(in.CoreTemperatureOverride().get(), rd); - } else { - GetCoreTemperatureOverride().Invalidate(); - } - if (in.CreatinineProductionRateOverride().present()) { - GetCreatinineProductionRateOverride().Load(in.CreatinineProductionRateOverride().get(), rd); - } else { - GetCreatinineProductionRateOverride().Invalidate(); - } - if (in.ExerciseMeanArterialPressureDeltaOverride().present()) { - GetExerciseMeanArterialPressureDeltaOverride().Load(in.ExerciseMeanArterialPressureDeltaOverride().get(), rd); - } else { - GetExerciseMeanArterialPressureDeltaOverride().Invalidate(); - } - if (in.FatigueLevelOverride().present()) { - GetFatigueLevelOverride().Load(in.FatigueLevelOverride().get(), rd); - } else { - GetFatigueLevelOverride().Invalidate(); - } - if (in.LactateProductionRateOverride().present()) { - GetLactateProductionRateOverride().Load(in.LactateProductionRateOverride().get(), rd); - } else { - GetLactateProductionRateOverride().Invalidate(); - } - if (in.SkinTemperatureOverride().present()) { - GetSkinTemperatureOverride().Load(in.SkinTemperatureOverride().get(), rd); - } else { - GetSkinTemperatureOverride().Invalidate(); - } - if (in.SweatRateOverride().present()) { - GetSweatRateOverride().Load(in.SweatRateOverride().get(), rd); - } else { - GetSweatRateOverride().Invalidate(); - } - if (in.TotalMetabolicRateOverride().present()) { - GetTotalMetabolicOverride().Load(in.TotalMetabolicRateOverride().get(), rd); - } else { - GetTotalMetabolicOverride().Invalidate(); - } - if (in.TotalWorkRateLevelOverride().present()) { - GetTotalWorkRateLevelOverride().Load(in.TotalWorkRateLevelOverride().get(), rd); - } else { - GetTotalWorkRateLevelOverride().Invalidate(); - } - if (in.SodiumLostToSweatOverride().present()) { - GetSodiumLostToSweatOverride().Load(in.SodiumLostToSweatOverride().get(), rd); - } else { - GetSodiumLostToSweatOverride().Invalidate(); - } - if (in.PotassiumLostToSweatOverride().present()) { - GetPotassiumLostToSweatOverride().Load(in.PotassiumLostToSweatOverride().get(), rd); - } else { - GetPotassiumLostToSweatOverride().Invalidate(); - } - if (in.ChlorideLostToSweatOverride().present()) { - GetChlorideLostToSweatOverride().Load(in.ChlorideLostToSweatOverride().get(), rd); - } else { - GetChlorideLostToSweatOverride().Invalidate(); - } - if (in.LeftAfferentArterioleResistanceOverride().present()) { - GetLeftAfferentArterioleResistanceOverride().Load(in.LeftAfferentArterioleResistanceOverride().get(), rd); - } else { - GetLeftAfferentArterioleResistanceOverride().Invalidate(); - } - if (in.LeftGlomerularFiltrationRateOverride().present()) { - GetLeftGlomerularFiltrationRateOverride().Load(in.LeftGlomerularFiltrationRateOverride().get(), rd); - } else { - GetLeftGlomerularFiltrationRateOverride().Invalidate(); - } - if (in.LeftReabsorptionRateOverride().present()) { - GetLeftReaborptionRateOverride().Load(in.LeftReabsorptionRateOverride().get(), rd); - } else { - GetLeftReaborptionRateOverride().Invalidate(); - } - if (in.RenalBloodFlowOverride().present()) { - GetRenalBloodFlowOverride().Load(in.RenalBloodFlowOverride().get(), rd); - } else { - GetRenalBloodFlowOverride().Invalidate(); - } - if (in.RenalPlasmaFlowOverride().present()) { - GetRenalPlasmaFlowOverride().Load(in.RenalPlasmaFlowOverride().get(), rd); - } else { - GetRenalPlasmaFlowOverride().Invalidate(); - } - if (in.RightAfferentArterioleResistanceOverride().present()) { - GetRightAfferentArterioleResistanceOverride().Load(in.RightAfferentArterioleResistanceOverride().get(), rd); - } else { - GetRightAfferentArterioleResistanceOverride().Invalidate(); - } - if (in.RightGlomerularFiltrationRateOverride().present()) { - GetRightGlomerularFiltrationRateOverride().Load(in.RightGlomerularFiltrationRateOverride().get(), rd); - } else { - GetRightGlomerularFiltrationRateOverride().Invalidate(); - } - if (in.RightReabsorptionRateOverride().present()) { - GetRightReaborptionRateOverride().Load(in.RightReabsorptionRateOverride().get(), rd); - } else { - GetRightReaborptionRateOverride().Invalidate(); - } - if (in.UrinationRateOverride().present()) { - GetUrinationRateOverride().Load(in.UrinationRateOverride().get(), rd); - } else { - GetUrinationRateOverride().Invalidate(); - } - if (in.UrineProductionRateOverride().present()) { - GetUrineProductionRateOverride().Load(in.UrineProductionRateOverride().get(), rd); - } else { - GetUrineProductionRateOverride().Invalidate(); - } - if (in.UrineOsmolalityOverride().present()) { - GetUrineOsmolalityOverride().Load(in.UrineOsmolalityOverride().get(), rd); - } else { - GetUrineOsmolalityOverride().Invalidate(); - } - if (in.UrineVolumeOverride().present()) { - GetUrineVolumeOverride().Load(in.UrineVolumeOverride().get(), rd); - } else { - GetUrineVolumeOverride().Invalidate(); - } - if (in.UrineUreaNitrogenConcentrationOverride().present()) { - GetUrineUreaNitrogenConcentrationOverride().Load(in.UrineUreaNitrogenConcentrationOverride().get(), rd); - } else { - GetUrineUreaNitrogenConcentrationOverride().Invalidate(); - } - if (in.ExpiratoryFlowOverride().present()) { - GetExpiratoryFlowOverride().Load(in.ExpiratoryFlowOverride().get(), rd); - } else { - GetExpiratoryFlowOverride().Invalidate(); - } - if (in.InspiratoryFlowOverride().present()) { - GetInspiratoryFlowOverride().Load(in.InspiratoryFlowOverride().get(), rd); - } else { - GetInspiratoryFlowOverride().Invalidate(); - } - if (in.PulmonaryComplianceOverride().present()) { - GetPulmonaryComplianceOverride().Load(in.PulmonaryComplianceOverride().get(), rd); - } else { - GetPulmonaryComplianceOverride().Invalidate(); - } - if (in.PulmonaryResistanceOverride().present()) { - GetPulmonaryResistanceOverride().Load(in.PulmonaryResistanceOverride().get(), rd); - } else { - GetPulmonaryResistanceOverride().Invalidate(); - } - if (in.RespirationRateOverride().present()) { - GetRespirationRateOverride().Load(in.RespirationRateOverride().get(), rd); - } else { - GetRespirationRateOverride().Invalidate(); - } - if (in.TidalVolumeOverride().present()) { - GetTidalVolumeOverride().Load(in.TidalVolumeOverride().get(), rd); - } else { - GetTidalVolumeOverride().Invalidate(); - } - if (in.TargetPulmonaryVentilationOverride().present()) { - GetTargetPulmonaryVentilationOverride().Load(in.TargetPulmonaryVentilationOverride().get(), rd); - } else { - GetTargetPulmonaryVentilationOverride().Invalidate(); - } - if (in.TotalAlveolarVentilationOverride().present()) { - GetTotalAlveolarVentilationOverride().Load(in.TotalAlveolarVentilationOverride().get(), rd); - } else { - GetTotalAlveolarVentilationOverride().Invalidate(); - } - if (in.TotalLungVolumeOverride().present()) { - GetTotalLungVolumeOverride().Load(in.TotalLungVolumeOverride().get(), rd); - } else { - GetTotalLungVolumeOverride().Invalidate(); - } - if (in.TotalPulmonaryVentilationOverride().present()) { - GetTotalPulmonaryVentilationOverride().Load(in.TotalPulmonaryVentilationOverride().get(), rd); - } else { - GetTotalPulmonaryVentilationOverride().Invalidate(); - } - if (in.ExtravascularFluidVolumeOverride().present()) { - GetExtravascularFluidVolumeOverride().Load(in.ExtravascularFluidVolumeOverride().get(), rd); - } else { - GetExtravascularFluidVolumeOverride().Invalidate(); - } - if (in.IntracellularFluidVolumeOverride().present()) { - GetIntracellularFluidVolumeOverride().Load(in.IntracellularFluidVolumeOverride().get(), rd); - } else { - GetIntracellularFluidVolumeOverride().Invalidate(); - } - if (in.LiverGlycogenOverride().present()) { - GetLiverGlycogenOverride().Load(in.LiverGlycogenOverride().get(), rd); - } else { - GetLiverGlycogenOverride().Invalidate(); - } - if (in.MuscleGlycogenOverride().present()) { - GetMuscleGlycogenOverride().Load(in.MuscleGlycogenOverride().get(), rd); - } else { - GetMuscleGlycogenOverride().Invalidate(); - } - if (in.StoredProteinOverride().present()) { - GetStoredProteinOverride().Load(in.StoredProteinOverride().get(), rd); - } else { - GetStoredProteinOverride().Invalidate(); - } - if (in.StoredFatOverride().present()) { - GetStoredFatOverride().Load(in.StoredFatOverride().get(), rd); - } else { - GetStoredFatOverride().Invalidate(); - } - //SEPatientAction::Load(in); - //return true; - return IsValid(); -} -//------------------------------------------------------------------------------- -CDM::OverrideData* SEOverride::Unload() const -{ - CDM::OverrideData* data(new CDM::OverrideData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEOverride::Unload(CDM::OverrideData& data) const -{ - SEPatientAction::Unload(data); - if (HasOverrideState()) { - data.State(m_OverrideState); - } - if (HasOverrideConformance()) { - data.Conformant(m_OverrideConformance); - } - if (HasArterialPHOverride()) { - data.ArterialBloodPHOverride(std::unique_ptr(m_ArterialBloodPHOverride->Unload())); - } - if (HasVenousPHOverride()) { - data.VenousBloodPHOverride(std::unique_ptr(m_VenousBloodPHOverride->Unload())); - } - if (HasCO2SaturationOverride()) { - data.CarbonDioxideSaturationOverride(std::unique_ptr(m_CarbonDioxideSaturationOverride->Unload())); - } - if (HasCOSaturationOverride()) { - data.CarbonMonoxideSaturationOverride(std::unique_ptr(m_CarbonMonoxideSaturationOverride->Unload())); - } - if (HasO2SaturationOverride()) { - data.OxygenSaturationOverride(std::unique_ptr(m_OxygenSaturationOverride->Unload())); - } - if (HasPhosphateOverride()) { - data.PhosphateOverride(std::unique_ptr(m_PhosphateOverride->Unload())); - } - if (HasWBCCountOverride()) { - data.WhiteBloodCellCountOverride(std::unique_ptr(m_WhiteBloodCellCountOverride->Unload())); - } - if (HasTotalBilirubinOverride()) { - data.TotalBilirubinOverride(std::unique_ptr(m_TotalBilirubinOverride->Unload())); - } - if (HasCalciumConcentrationOverride()) { - data.CalciumConcentrationOverride(std::unique_ptr(m_CalciumConcentrationOverride->Unload())); - } - if (HasGlucoseConcentrationOverride()) { - data.GlucoseConcentrationOverride(std::unique_ptr(m_GlucoseConcentrationOverride->Unload())); - } - if (HasLactateConcentrationOverride()) { - data.LactateConcentrationOverride(std::unique_ptr(m_LactateConcentrationOverride->Unload())); - } - if (HasPotassiumConcentrationOverride()) { - data.PotassiumConcentrationOverride(std::unique_ptr(m_PotassiumConcentrationOverride->Unload())); - } - if (HasSodiumConcentrationOverride()) { - data.SodiumConcentrationOverride(std::unique_ptr(m_SodiumConcentrationOverride->Unload())); - } - if (HasBloodVolumeOverride()) { - data.BloodVolumeOverride(std::unique_ptr(m_BloodVolumeOverride->Unload())); - } - if (HasCardiacOutputOverride()) { - data.CardiacOutputOverride(std::unique_ptr(m_CardiacOutputOverride->Unload())); - } - if (HasDiastolicArterialPressureOverride()) { - data.DiastolicArterialPressureOverride(std::unique_ptr(m_DiastolicArterialPressureOverride->Unload())); - } - if (HasMAPOverride()) { - data.MeanArterialPressureOverride(std::unique_ptr(m_MeanArterialPressureOverride->Unload())); - } - if (HasHeartRateOverride()) { - data.HeartRateOverride(std::unique_ptr(m_HeartRateOverride->Unload())); - } - if (HasHeartStrokeVolumeOverride()) { - data.HeartStrokeVolumeOverride(std::unique_ptr(m_HeartStrokeVolumeOverride->Unload())); - } - if (HasSystolicArterialPressureOverride()) { - data.SystolicArterialPressureOverride(std::unique_ptr(m_SystolicArterialPressureOverride->Unload())); - } - if (HasInsulinSynthesisRateOverride()) { - data.InsulinSynthesisRateOverride(std::unique_ptr(m_InsulinSynthesisRateOverride->Unload())); - } - if (HasGlucagonSynthesisRateOverride()) { - data.GlucagonSynthesisRateOverride(std::unique_ptr(m_GlucagonSynthesisRateOverride->Unload())); - } - if (HasAchievedExerciseLevelOverride()) { - data.AchievedExerciseLevelOverride(std::unique_ptr(m_AchievedExerciseLevelOverride->Unload())); - } - if (HasCoreTemperatureOverride()) { - data.CoreTemperatureOverride(std::unique_ptr(m_CoreTemperatureOverride->Unload())); - } - if (HasCreatinineProductionRateOverride()) { - data.CreatinineProductionRateOverride(std::unique_ptr(m_CreatinineProductionRateOverride->Unload())); - } - if (HasExerciseMeanArterialPressureDeltaOverride()) { - data.ExerciseMeanArterialPressureDeltaOverride(std::unique_ptr(m_ExerciseMeanArterialPressureDeltaOverride->Unload())); - } - if (HasFatigueLevelOverride()) { - data.FatigueLevelOverride(std::unique_ptr(m_FatigueLevelOverride->Unload())); - } - if (HasLactateProductionRateOverride()) { - data.LactateProductionRateOverride(std::unique_ptr(m_LactateProductionRateOverride->Unload())); - } - if (HasSkinTemperatureOverride()) { - data.SkinTemperatureOverride(std::unique_ptr(m_SkinTemperatureOverride->Unload())); - } - if (HasSweatRateOverride()) { - data.SweatRateOverride(std::unique_ptr(m_SweatRateOverride->Unload())); - } - if (HasTotalMetabolicOverride()) { - data.TotalMetabolicRateOverride(std::unique_ptr(m_TotalMetabolicRateOverride->Unload())); - } - if (HasTotalWorkRateLevelOverride()) { - data.TotalWorkRateLevelOverride(std::unique_ptr(m_TotalWorkRateLevelOverride->Unload())); - } - if (HasSodiumLostToSweatOverride()) { - data.SodiumLostToSweatOverride(std::unique_ptr(m_SodiumLostToSweatOverride->Unload())); - } - if (HasPotassiumLostToSweatOverride()) { - data.PotassiumLostToSweatOverride(std::unique_ptr(m_PotassiumLostToSweatOverride->Unload())); - } - if (HasChlorideLostToSweatOverride()) { - data.ChlorideLostToSweatOverride(std::unique_ptr(m_ChlorideLostToSweatOverride->Unload())); - } - if (HasLeftAfferentArterioleResistanceOverride()) { - data.LeftAfferentArterioleResistanceOverride(std::unique_ptr(m_LeftAfferentArterioleResistanceOverride->Unload())); - } - if (HasLeftGlomerularFiltrationRateOverride()) { - data.LeftGlomerularFiltrationRateOverride(std::unique_ptr(m_LeftGlomerularFiltrationRateOverride->Unload())); - } - if (HasLeftReaborptionRateOverride()) { - data.LeftReabsorptionRateOverride(std::unique_ptr(m_LeftReabsorptionRateOverride->Unload())); - } - if (HasRenalBloodFlowOverride()) { - data.RenalBloodFlowOverride(std::unique_ptr(m_RenalBloodFlowOverride->Unload())); - } - if (HasRenalPlasmaFlowOverride()) { - data.RenalPlasmaFlowOverride(std::unique_ptr(m_RenalPlasmaFlowOverride->Unload())); - } - if (HasRightAfferentArterioleResistanceOverride()) { - data.RightAfferentArterioleResistanceOverride(std::unique_ptr(m_RightAfferentArterioleResistanceOverride->Unload())); - } - if (HasRightGlomerularFiltrationRateOverride()) { - data.RightGlomerularFiltrationRateOverride(std::unique_ptr(m_RightGlomerularFiltrationRateOverride->Unload())); - } - if (HasRightReaborptionRateOverride()) { - data.RightReabsorptionRateOverride(std::unique_ptr(m_RightReabsorptionRateOverride->Unload())); - } - if (HasUrineProductionRateOverride()) { - data.UrineProductionRateOverride(std::unique_ptr(m_UrineProductionRateOverride->Unload())); - } - if (HasUrineOsmolalityOverride()) { - data.UrineOsmolalityOverride(std::unique_ptr(m_UrineOsmolalityOverride->Unload())); - } - if (HasUrineVolumeOverride()) { - data.UrineVolumeOverride(std::unique_ptr(m_UrineVolumeOverride->Unload())); - } - if (HasUrineUreaNitrogenConcentrationOverride()) { - data.UrineUreaNitrogenConcentrationOverride(std::unique_ptr(m_UrineUreaNitrogenConcentrationOverride->Unload())); - } - if (HasExpiratoryFlowOverride()) { - data.ExpiratoryFlowOverride(std::unique_ptr(m_ExpiratoryFlowOverride->Unload())); - } - if (HasInspiratoryFlowOverride()) { - data.InspiratoryFlowOverride(std::unique_ptr(m_InspiratoryFlowOverride->Unload())); - } - if (HasPulmonaryComplianceOverride()) { - data.PulmonaryComplianceOverride(std::unique_ptr(m_PulmonaryComplianceOverride->Unload())); - } - if (HasPulmonaryResistanceOverride()) { - data.PulmonaryResistanceOverride(std::unique_ptr(m_PulmonaryResistanceOverride->Unload())); - } - if (HasRespirationRateOverride()) { - data.RespirationRateOverride(std::unique_ptr(m_RespirationRateOverride->Unload())); - } - if (HasTidalVolumeOverride()) { - data.TidalVolumeOverride(std::unique_ptr(m_TidalVolumeOverride->Unload())); - } - if (HasTargetPulmonaryVentilationOverride()) { - data.TargetPulmonaryVentilationOverride(std::unique_ptr(m_TargetPulmonaryVentilationOverride->Unload())); - } - if (HasTotalAlveolarVentilationOverride()) { - data.TotalAlveolarVentilationOverride(std::unique_ptr(m_TotalAlveolarVentilationOverride->Unload())); - } - if (HasTotalLungVolumeOverride()) { - data.TotalLungVolumeOverride(std::unique_ptr(m_TotalLungVolumeOverride->Unload())); - } - if (HasTotalPulmonaryVentilationOverride()) { - data.TotalPulmonaryVentilationOverride(std::unique_ptr(m_TotalPulmonaryVentilationOverride->Unload())); - } - if (HasExtravascularFluidVolumeOverride()) { - data.ExtravascularFluidVolumeOverride(std::unique_ptr(m_ExtravascularFluidVolumeOverride->Unload())); - } - if (HasIntracellularFluidVolumeOverride()) { - data.IntracellularFluidVolumeOverride(std::unique_ptr(m_IntracellularFluidVolumeOverride->Unload())); - } - if (HasLiverGlycogenOverride()) { - data.LiverGlycogenOverride(std::unique_ptr(m_LiverGlycogenOverride->Unload())); - } - if (HasMuscleGlycogenOverride()) { - data.MuscleGlycogenOverride(std::unique_ptr(m_MuscleGlycogenOverride->Unload())); - } - if (HasStoredProteinOverride()) { - data.StoredProteinOverride(std::unique_ptr(m_StoredProteinOverride->Unload())); - } - if (HasStoredFatOverride()) { - data.StoredFatOverride(std::unique_ptr(m_StoredFatOverride->Unload())); - } + return (GetOverrideState() == SEOnOff::On); } //------------------------------------------------------------------------------- -CDM::enumOnOff::value SEOverride::GetOverrideState() const +SEOnOff SEOverride::GetOverrideState() const { return m_OverrideState; } -void SEOverride::SetOverrideState(CDM::enumOnOff::value state) +void SEOverride::SetOverrideState(SEOnOff state) { m_OverrideState = state; } bool SEOverride::HasOverrideState() const { - return (m_OverrideState == CDM::enumOnOff::Off) ? true : (m_OverrideState == CDM::enumOnOff::On) ? true - : false; + return (m_OverrideState == SEOnOff::Invalid) ? false : true; } void SEOverride::InvalidateOverrideState() { - m_OverrideState = (CDM::enumOnOff::Off); + m_OverrideState = SEOnOff::Invalid; } //------------------------------------------------------------------------------- -CDM::enumOnOff::value SEOverride::GetOverrideConformance() const +SEOnOff SEOverride::GetOverrideConformance() const { return m_OverrideConformance; } -void SEOverride::SetOverrideConformance(CDM::enumOnOff::value valid) +void SEOverride::SetOverrideConformance(SEOnOff valid) { m_OverrideConformance = valid; } bool SEOverride::HasOverrideConformance() const { - return (m_OverrideConformance == CDM::enumOnOff::Off) ? true : (m_OverrideConformance == CDM::enumOnOff::On) ? true - : false; + return (m_OverrideConformance == SEOnOff::Invalid) ? false : true; } void SEOverride::InvalidateOverrideConformance() { - m_OverrideConformance = (CDM::enumOnOff::Off); + m_OverrideConformance = SEOnOff::Invalid; } // Blood Chemistry Overrides // @@ -2102,14 +1562,14 @@ void SEOverride::ToString(std::ostream& str) const HasOverrideState() ? str << GetOverrideState() : str << "Not Set"; str << "\n\tConformant: "; HasOverrideConformance() ? str << GetOverrideConformance() : str << "Not Set"; - if (GetOverrideConformance() == CDM::enumOnOff::Off - && GetOverrideState() == CDM::enumOnOff::On) { + if (GetOverrideConformance() == SEOnOff::Off + && GetOverrideState() == SEOnOff::On) { str << ("\n\tOverride has turned conformance off. Outputs no longer resemble validated parameters."); } if (HasArterialPHOverride()) { str << "\n\tArterial PH: "; HasArterialPHOverride() ? str << *m_ArterialBloodPHOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tArterial PH has a lower bound of 0 and an upper bound of 14."; } str << std::flush; @@ -2117,7 +1577,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasVenousPHOverride()) { str << "\n\tVenous PH: "; HasVenousPHOverride() ? str << *m_VenousBloodPHOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tVenous PH has a lower bound of 0 and an upper bound of 14."; } str << std::flush; @@ -2125,7 +1585,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasCO2SaturationOverride()) { str << "\n\tCarbon Dioxide Saturation: "; HasCO2SaturationOverride() ? str << *m_CarbonDioxideSaturationOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tCO2 Saturation has a lower bound of 0 and an upper bound of 1."; } str << std::flush; @@ -2133,7 +1593,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasCOSaturationOverride()) { str << "\n\tCarbon Monoxide Saturation: "; HasCOSaturationOverride() ? str << *m_CarbonMonoxideSaturationOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tCO Saturation has a lower bound of 0 and an upper bound of 1."; } str << std::flush; @@ -2141,7 +1601,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasO2SaturationOverride()) { str << "\n\tOxygen Saturation: "; HasO2SaturationOverride() ? str << *m_OxygenSaturationOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tO2 Saturation has a lower bound of 0 and an upper bound of 1."; } str << std::flush; @@ -2149,7 +1609,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasPhosphateOverride()) { str << "\n\tPhosphate: "; HasPhosphateOverride() ? str << *m_PhosphateOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tPhosphate has a lower bound of 0 mmol/L and an upper bound of 1000 mmol/L."; } str << std::flush; @@ -2157,7 +1617,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasWBCCountOverride()) { str << "\n\tWhite Blood Cell Count: "; HasWBCCountOverride() ? str << *m_WhiteBloodCellCountOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tWBC Count has a lower bound of 0 ct/uL and an upper bound of 50000 ct/uL."; } str << std::flush; @@ -2165,7 +1625,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasTotalBilirubinOverride()) { str << "\n\tTotal Bilirubin: "; HasTotalBilirubinOverride() ? str << *m_TotalBilirubinOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tTotal Bilirubin has a lower bound of 0 mg/dL and an upper bound of 500 mg/dL."; } str << std::flush; @@ -2173,7 +1633,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasCalciumConcentrationOverride()) { str << "\n\tCalcium Concentration: "; HasCalciumConcentrationOverride() ? str << *m_CalciumConcentrationOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tCalcium Concentration has a lower bound of 0 mg/dL and an upper bound of 500 mg/dL."; } str << std::flush; @@ -2181,7 +1641,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasGlucoseConcentrationOverride()) { str << "\n\tGlucose Concentration: "; HasGlucoseConcentrationOverride() ? str << *m_GlucoseConcentrationOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tGlucose Concentration has a lower bound of 0 mg/dL and an upper bound of 1000 mg/dL."; } str << std::flush; @@ -2189,7 +1649,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasLactateConcentrationOverride()) { str << "\n\tLactate Concentration: "; HasLactateConcentrationOverride() ? str << *m_LactateConcentrationOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tLactate Concentration has a lower bound of 0 mg/dL and an upper bound of 1000 mg/dL."; } str << std::flush; @@ -2197,7 +1657,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasPotassiumConcentrationOverride()) { str << "\n\tPotassium Concentration: "; HasPotassiumConcentrationOverride() ? str << *m_PotassiumConcentrationOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tPotassium Concentration has a lower bound of 0 mg/dL and an upper bound of 500 mg/dL."; } str << std::flush; @@ -2205,7 +1665,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasSodiumConcentrationOverride()) { str << "\n\tSodium Concentration: "; HasSodiumConcentrationOverride() ? str << *m_SodiumConcentrationOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tSodium Concentration has a lower bound of 0 mg/dL and an upper bound of 500 mg/dL."; } str << std::flush; @@ -2213,7 +1673,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasBloodVolumeOverride()) { str << "\n\tBlood Volume: "; HasBloodVolumeOverride() ? str << *m_BloodVolumeOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tBlood Volume has a lower bound of 0 L and an upper bound of 25 L."; } str << std::flush; @@ -2221,7 +1681,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasCardiacOutputOverride()) { str << "\n\tCardiac Output: "; HasCardiacOutputOverride() ? str << *m_CardiacOutputOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tCardiac Output has a lower bound of 0 L/min and an upper bound of 100 L/min."; } str << std::flush; @@ -2234,7 +1694,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasMAPOverride()) { str << "\n\tMean Arterial Pressure: "; HasMAPOverride() ? str << *m_MeanArterialPressureOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::Off) { + if (m_OverrideConformance == SEOnOff::Off) { str << "\n\tPharmacodynamics affecting this value have been turned off due to conformance being turned off."; } str << std::flush; @@ -2242,7 +1702,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasHeartRateOverride()) { str << "\n\tHeart Rate: "; HasHeartRateOverride() ? str << *m_HeartRateOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tHeart Rate has a lower/upper bound dependent on the patient."; } else { str << "\n\tPharmacodynamics affecting this value have been turned off due to conformance being turned off."; @@ -2252,7 +1712,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasHeartStrokeVolumeOverride()) { str << "\n\tHeart Stroke Volume: "; HasHeartStrokeVolumeOverride() ? str << *m_HeartStrokeVolumeOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tHeart Stroke Volume has a lower bound of 0 mL and an upper bound of 5000 mL."; } str << std::flush; @@ -2265,7 +1725,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasInsulinSynthesisRateOverride()) { str << "\n\tInsulin Synthesis Rate: "; HasInsulinSynthesisRateOverride() ? str << *m_InsulinSynthesisRateOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tInsulin Synthesis Rate has a lower bound of 0 pmol/min and an upper bound of 10 pmol/min."; } str << std::flush; @@ -2273,7 +1733,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasGlucagonSynthesisRateOverride()) { str << "\n\tGlucagon Synthesis Rate: "; HasGlucagonSynthesisRateOverride() ? str << *m_GlucagonSynthesisRateOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tGlucagon Synthesis Rate has a lower bound of 0 pmol/min and an upper bound of 10 pmol/min."; } str << std::flush; @@ -2281,7 +1741,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasAchievedExerciseLevelOverride()) { str << "\n\tAcieved Exercise Level: "; HasAchievedExerciseLevelOverride() ? str << *m_AchievedExerciseLevelOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tAcheived Exercise Level has a lower bound of 0 and an upper bound of 1."; } str << std::flush; @@ -2289,7 +1749,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasCoreTemperatureOverride()) { str << "\n\tCore Temperature: "; HasCoreTemperatureOverride() ? str << *m_CoreTemperatureOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tCore Temperature has a lower bound of 0 degrees Celsius and an upper bound of 200 degrees Celsius."; } str << std::flush; @@ -2297,7 +1757,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasCreatinineProductionRateOverride()) { str << "\n\tCreatinine Production Rate: "; HasCreatinineProductionRateOverride() ? str << *m_CreatinineProductionRateOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tCreatinine Production has a lower bound of 0 mol/s and an upper bound of 100 mol/s."; } str << std::flush; @@ -2305,7 +1765,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasExerciseMeanArterialPressureDeltaOverride()) { str << "\n\tExercise MAP Delta: "; HasExerciseMeanArterialPressureDeltaOverride() ? str << *m_ExerciseMeanArterialPressureDeltaOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tExercise MAP Delta has a lower bound of 0 mmHg and an upper bound of 200 mmHg."; } str << std::flush; @@ -2313,7 +1773,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasFatigueLevelOverride()) { str << "\n\tFatigue Level: "; HasFatigueLevelOverride() ? str << *m_FatigueLevelOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tFatigue Level has a lower bound of 0 and an upper bound of 1."; } str << std::flush; @@ -2321,7 +1781,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasLactateProductionRateOverride()) { str << "\n\tLactate Production: "; HasLactateProductionRateOverride() ? str << *m_LactateProductionRateOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tLactate Production has a lower bound of 0 mol/s and an upper bound of 200 mol/s."; } str << std::flush; @@ -2329,7 +1789,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasSkinTemperatureOverride()) { str << "\n\tSkin Temperature: "; HasSkinTemperatureOverride() ? str << *m_SkinTemperatureOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tSkin Temperature has a lower bound of 0 degrees Celsius and an upper bound of 200 degrees Celsius."; } str << std::flush; @@ -2337,7 +1797,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasSweatRateOverride()) { str << "\n\tSweat Rate: "; HasSweatRateOverride() ? str << *m_SweatRateOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tSweat Rate has a lower bound of 0 g/s and an upper bound of 50 g/s."; } str << std::flush; @@ -2345,7 +1805,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasTotalMetabolicOverride()) { str << "\n\tTotal Metabolic Rate: "; HasTotalMetabolicOverride() ? str << *m_TotalMetabolicRateOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tTotal Metabolic Rate has a lower bound of 1 kcal/day and an upper bound of 5000 kcal/day."; } str << std::flush; @@ -2353,7 +1813,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasTotalWorkRateLevelOverride()) { str << "\n\tTotal Work Rate Level: "; HasTotalWorkRateLevelOverride() ? str << *m_TotalWorkRateLevelOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tTotal Work Rate Level has a lower bound of 0 and an upper bound of 1."; } str << std::flush; @@ -2361,7 +1821,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasSodiumLostToSweatOverride()) { str << "\n\tSodium Lost to Sweat: "; HasSodiumLostToSweatOverride() ? str << *m_SodiumLostToSweatOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tSodium Lost to Sweat has a lower bound of 0 g and an upper bound of 500 g."; } str << std::flush; @@ -2369,7 +1829,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasPotassiumLostToSweatOverride()) { str << "\n\tPotassium Lost to Sweat: "; HasPotassiumLostToSweatOverride() ? str << *m_PotassiumLostToSweatOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tPotassium Lost to Sweat has a lower bound of 0 g and an upper bound of 500 g."; } str << std::flush; @@ -2377,7 +1837,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasChlorideLostToSweatOverride()) { str << "\n\tChloride Lost to Sweat: "; HasChlorideLostToSweatOverride() ? str << *m_ChlorideLostToSweatOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tChloride Lost to Sweat has a lower bound of 0 g and an upper bound of 500 g."; } str << std::flush; @@ -2385,7 +1845,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasLeftAfferentArterioleResistanceOverride()) { str << "\n\tLeft Afferent Arteriole Resistance: "; HasLeftAfferentArterioleResistanceOverride() ? str << *m_LeftAfferentArterioleResistanceOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tLeft Afferent Arteriole Resistance has a lower bound of 0 mmHg min/mL and an upper bound of 1 mmHg min/mL."; } str << std::flush; @@ -2393,7 +1853,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasLeftGlomerularFiltrationRateOverride()) { str << "\n\tLeft Glomerular Filtration Rate: "; HasLeftGlomerularFiltrationRateOverride() ? str << *m_LeftGlomerularFiltrationRateOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tLeft Glomerular Filtration Rate has a lower bound of 0 mL/min and an upper bound of 1000 mL/min."; } str << std::flush; @@ -2401,7 +1861,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasLeftReaborptionRateOverride()) { str << "\n\tLeft Reabsorption Rate: "; HasLeftReaborptionRateOverride() ? str << *m_LeftReabsorptionRateOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tLeft Reabsorption Rate has a lower bound of 0 mL/min and an upper bound of 1000 mL/min."; } str << std::flush; @@ -2409,7 +1869,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasRenalBloodFlowOverride()) { str << "\n\tRenal Blood Flow: "; HasRenalBloodFlowOverride() ? str << *m_RenalBloodFlowOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tRenal Blood Flow has a lower bound of 0 mL/min and an upper bound of 3000 mL/min."; } str << std::flush; @@ -2417,7 +1877,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasRenalPlasmaFlowOverride()) { str << "\n\tRenal Plasma Flow: "; HasRenalPlasmaFlowOverride() ? str << *m_RenalPlasmaFlowOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tRenal Plasma Flow has a lower bound of 0 mL/min and an upper bound of 3000 mL/min."; } str << std::flush; @@ -2425,7 +1885,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasRightAfferentArterioleResistanceOverride()) { str << "\n\tRight Afferent Arteriole Resistance: "; HasRightAfferentArterioleResistanceOverride() ? str << *m_RightAfferentArterioleResistanceOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tRight Afferent Arteriole Resistance has a lower bound of 0 mmHg min/mL and an upper bound of 1 mmHg min/mL."; } str << std::flush; @@ -2433,7 +1893,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasRightGlomerularFiltrationRateOverride()) { str << "\n\tRight Glomerular Filtration Rate: "; HasRightGlomerularFiltrationRateOverride() ? str << *m_RightGlomerularFiltrationRateOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tRight Glomerular Filtration Rate has a lower bound of 0 mL/min and an upper bound of 1000 mL/min."; } str << std::flush; @@ -2441,7 +1901,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasRightReaborptionRateOverride()) { str << "\n\tRight Reabsorption Rate: "; HasRightReaborptionRateOverride() ? str << *m_RightReabsorptionRateOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tRight Reabsorption Rate has a lower bound of 0 mL/min and an upper bound of 1000 mL/min."; } str << std::flush; @@ -2449,7 +1909,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasUrinationRateOverride()) { str << "\n\tUrination Rate: "; HasUrinationRateOverride() ? str << *m_UrinationRateOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tUrination Rate has a lower bound of 0 mL/min and an upper bound of 1000 mL/min."; } str << std::flush; @@ -2457,7 +1917,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasUrineProductionRateOverride()) { str << "\n\tUrine Production Rate: "; HasUrineProductionRateOverride() ? str << *m_UrineProductionRateOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tUrine Production Rate has a lower bound of 0 mL/min and an upper bound of 100 mL/min."; } str << std::flush; @@ -2465,7 +1925,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasUrineOsmolalityOverride()) { str << "\n\tUrine Osmolality: "; HasUrineOsmolalityOverride() ? str << *m_UrineOsmolalityOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tUrine Osmolality has a lower bound of 0 mOsm/kg and an upper bound of 2000 mOsm/kg."; } str << std::flush; @@ -2473,7 +1933,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasUrineVolumeOverride()) { str << "\n\tUrine Volume: "; HasUrineVolumeOverride() ? str << *m_UrineVolumeOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tUrine Volume has a lower bound of 0 mL and an upper bound of 1000 mL."; } str << std::flush; @@ -2481,7 +1941,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasUrineUreaNitrogenConcentrationOverride()) { str << "\n\tUrine Urea Nitrogen Concentration: "; HasUrineUreaNitrogenConcentrationOverride() ? str << *m_UrineUreaNitrogenConcentrationOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tUrine Urea Nitrogen Concentration has a lower bound of 0 g/L and an upper bound of 100 g/L."; } str << std::flush; @@ -2489,7 +1949,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasExpiratoryFlowOverride()) { str << "\n\tExpiratory Flow: "; HasExpiratoryFlowOverride() ? str << *m_ExpiratoryFlowOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tExpiratory Flow has a lower bound of 0 L/min and an upper bound of 1000 L/min."; } str << std::flush; @@ -2497,7 +1957,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasInspiratoryFlowOverride()) { str << "\n\tInspiratory Flow: "; HasInspiratoryFlowOverride() ? str << *m_InspiratoryFlowOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tInspiratory Flow has a lower bound of 0 L/min and an upper bound of 1000 L/min."; } str << std::flush; @@ -2505,7 +1965,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasPulmonaryComplianceOverride()) { str << "\n\tPulmonary Compliance: "; HasPulmonaryComplianceOverride() ? str << *m_PulmonaryComplianceOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tPulmonary Compliance has a lower bound of 0 L/cmH2O and an upper bound of 1000 L/cmH20."; } str << std::flush; @@ -2513,7 +1973,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasPulmonaryResistanceOverride()) { str << "\n\tPulmonary Resistance: "; HasPulmonaryResistanceOverride() ? str << *m_PulmonaryResistanceOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tPulmonary Resistance has a lower bound of 0 cmH2O*s/L and an upper bound of 1000 cmH2O*s/L."; } str << std::flush; @@ -2526,7 +1986,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasTidalVolumeOverride()) { str << "\n\tTidal Volume: "; HasTidalVolumeOverride() ? str << *m_TidalVolumeOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tTidal Volume has a lower bound of 0 mL and an upper bound of 10000 mL."; } str << std::flush; @@ -2534,7 +1994,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasTargetPulmonaryVentilationOverride()) { str << "\n\tTarget Pulmonary Ventilation: "; HasTargetPulmonaryVentilationOverride() ? str << *m_TargetPulmonaryVentilationOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tTarget Pulmonary Ventilation has a lower bound of 0 L/min and an upper bound of 1000 L/min."; } str << std::flush; @@ -2542,7 +2002,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasTotalAlveolarVentilationOverride()) { str << "\n\tTotal Alveolar Ventilation: "; HasTotalAlveolarVentilationOverride() ? str << *m_TotalAlveolarVentilationOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tTotal Alveolar Ventilation has a lower bound of 0 L/min and an upper bound of 1000 L/min."; } str << std::flush; @@ -2550,7 +2010,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasTotalLungVolumeOverride()) { str << "\n\tTotal Lung Volume: "; HasTotalLungVolumeOverride() ? str << *m_TotalLungVolumeOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tTotal Lung Volume has a lower bound of 0 L and an upper bound of 500 L."; } str << std::flush; @@ -2558,7 +2018,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasTotalPulmonaryVentilationOverride()) { str << "\n\tTotal Pulmonary Ventilation: "; HasTotalPulmonaryVentilationOverride() ? str << *m_TotalPulmonaryVentilationOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tTotal Pulmonary Ventilation has a lower bound of 0 L/min and an upper bound of 1000 L/min."; } str << std::flush; @@ -2566,7 +2026,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasExtravascularFluidVolumeOverride()) { str << "\n\tExtravascular Fluid Volume: "; HasExtravascularFluidVolumeOverride() ? str << *m_ExtravascularFluidVolumeOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tExtravascular Fluid Volume has a lower bound of 0 L and an upper bound of 1000 L."; } str << std::flush; @@ -2574,7 +2034,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasIntracellularFluidVolumeOverride()) { str << "\n\tIntracellular Fluid Volume: "; HasIntracellularFluidVolumeOverride() ? str << *m_IntracellularFluidVolumeOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tIntracellular Fluid Volume has a lower bound of 0 L and an upper bound of 1000 L."; } str << std::flush; @@ -2582,7 +2042,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasLiverGlycogenOverride()) { str << "\n\tLiver Glycogen: "; HasLiverGlycogenOverride() ? str << *m_LiverGlycogenOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tLiver Glycogen has a lower bound of 0 g and an upper bound of 1000 g."; } str << std::flush; @@ -2590,7 +2050,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasMuscleGlycogenOverride()) { str << "\n\tMuscle Glycogen: "; HasMuscleGlycogenOverride() ? str << *m_MuscleGlycogenOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tMuscle Glycogen has a lower bound of 0 g and an upper bound of 2000 g."; } str << std::flush; @@ -2598,7 +2058,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasStoredProteinOverride()) { str << "\n\tStored Protein: "; HasStoredProteinOverride() ? str << *m_StoredProteinOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tStored Protein has a lower bound of 0 g and an upper bound of 5000 g."; } str << std::flush; @@ -2606,7 +2066,7 @@ void SEOverride::ToString(std::ostream& str) const if (HasStoredFatOverride()) { str << "\n\tStored Fat: "; HasStoredFatOverride() ? str << *m_StoredFatOverride : str << "Not Set"; - if (m_OverrideConformance == CDM::enumOnOff::On) { + if (m_OverrideConformance == SEOnOff::On) { str << "\n\tStored Fat has a lower bound of 0 g and an upper bound of 5000 g."; } str << std::flush; diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEPainStimulus.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEPainStimulus.cpp index 7aa38d954..3eb58e971 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEPainStimulus.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEPainStimulus.cpp @@ -12,6 +12,7 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/PatientActions.h" namespace biogears { SEPainStimulus::SEPainStimulus() : SEPatientAction() @@ -23,13 +24,13 @@ SEPainStimulus::SEPainStimulus() //----------------------------------------------------------------------------- SEPainStimulus::~SEPainStimulus() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SEPainStimulus::Clear() +void SEPainStimulus::Invalidate() { - SEPatientAction::Clear(); + SEPatientAction::Invalidate(); SAFE_DELETE(m_Severity); SAFE_DELETE(m_HalfLife); m_Location.clear(); @@ -45,37 +46,6 @@ bool SEPainStimulus::IsActive() const return IsValid() ? !m_Severity->IsZero() : false; } //----------------------------------------------------------------------------- -bool SEPainStimulus::Load(const CDM::PainStimulusData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - GetSeverity().Load(in.Severity(), rd); - if (in.HalfLife().present()) { - GetHalfLife().Load(in.HalfLife().get(), rd); - } else { - GetHalfLife().Invalidate(); - } - m_Location = in.Location(); - return true; -} -//----------------------------------------------------------------------------- -CDM::PainStimulusData* SEPainStimulus::Unload() const -{ - CDM::PainStimulusData* data(new CDM::PainStimulusData()); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEPainStimulus::Unload(CDM::PainStimulusData& data) const -{ - SEPatientAction::Unload(data); - if (m_Severity != nullptr) - data.Severity(std::unique_ptr(m_Severity->Unload())); - if (HasHalfLife()) - data.HalfLife(std::unique_ptr(m_HalfLife->Unload())); - if (HasLocation()) - data.Location(m_Location); -} -//----------------------------------------------------------------------------- bool SEPainStimulus::HasSeverity() const { return m_Severity == nullptr ? false : m_Severity->IsValid(); diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEPatientAction.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEPatientAction.cpp index 9c1de83d2..8d12a8812 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEPatientAction.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEPatientAction.cpp @@ -12,6 +12,7 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/PatientActions.h" namespace biogears { SEPatientAction::SEPatientAction() : SEAction() @@ -20,12 +21,12 @@ SEPatientAction::SEPatientAction() //------------------------------------------------------------------------------- SEPatientAction::~SEPatientAction() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEPatientAction::Clear() +void SEPatientAction::Invalidate() { - SEAction::Clear(); + SEAction::Invalidate(); } //------------------------------------------------------------------------------- bool SEPatientAction::IsValid() const @@ -33,17 +34,6 @@ bool SEPatientAction::IsValid() const return SEAction::IsValid(); } //------------------------------------------------------------------------------- -bool SEPatientAction::Load(const CDM::PatientActionData& in) -{ - SEAction::Load(in); - return true; -} -//------------------------------------------------------------------------------- -void SEPatientAction::Unload(CDM::PatientActionData& data) const -{ - SEAction::Unload(data); -} -//------------------------------------------------------------------------------- bool SEPatientAction::operator==(const SEPatientAction& rhs) const { return SEAction::operator==(rhs); diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEPatientAssessmentRequest.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEPatientAssessmentRequest.cpp index a53634ecd..d5dd65361 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEPatientAssessmentRequest.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEPatientAssessmentRequest.cpp @@ -12,22 +12,23 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/PatientActions.h" namespace biogears { SEPatientAssessmentRequest::SEPatientAssessmentRequest() : SEPatientAction() { - m_Type = (CDM::enumPatientAssessment::value)-1; + m_Type = SEPatientAssessmentType::Invalid; } //------------------------------------------------------------------------------- SEPatientAssessmentRequest::~SEPatientAssessmentRequest() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEPatientAssessmentRequest::Clear() +void SEPatientAssessmentRequest::Invalidate() { - SEPatientAction::Clear(); - m_Type = (CDM::enumPatientAssessment::value)-1; + SEPatientAction::Invalidate(); + m_Type = SEPatientAssessmentType::Invalid; } //------------------------------------------------------------------------------- bool SEPatientAssessmentRequest::IsValid() const @@ -40,45 +41,24 @@ bool SEPatientAssessmentRequest::IsActive() const return IsValid(); } //------------------------------------------------------------------------------- -bool SEPatientAssessmentRequest::Load(const CDM::PatientAssessmentRequestData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - m_Type = in.Type(); - return true; -} -//------------------------------------------------------------------------------- -CDM::PatientAssessmentRequestData* SEPatientAssessmentRequest::Unload() const -{ - CDM::PatientAssessmentRequestData* data(new CDM::PatientAssessmentRequestData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEPatientAssessmentRequest::Unload(CDM::PatientAssessmentRequestData& data) const -{ - SEPatientAction::Unload(data); - if (HasType()) - data.Type(m_Type); -} -//------------------------------------------------------------------------------- -CDM::enumPatientAssessment::value SEPatientAssessmentRequest::GetType() const +SEPatientAssessmentType SEPatientAssessmentRequest::GetType() const { return m_Type; } //------------------------------------------------------------------------------- -void SEPatientAssessmentRequest::SetType(CDM::enumPatientAssessment::value Type) +void SEPatientAssessmentRequest::SetType(SEPatientAssessmentType Type) { m_Type = Type; } //------------------------------------------------------------------------------- bool SEPatientAssessmentRequest::HasType() const { - return m_Type == ((CDM::enumPatientAssessment::value)-1) ? false : true; + return m_Type == SEPatientAssessmentType::Invalid ? false : true; } //------------------------------------------------------------------------------- void SEPatientAssessmentRequest::InvalidateType() { - m_Type = (CDM::enumPatientAssessment::value)-1; + m_Type = SEPatientAssessmentType::Invalid; } //------------------------------------------------------------------------------- void SEPatientAssessmentRequest::ToString(std::ostream& str) const diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEPericardialEffusion.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEPericardialEffusion.cpp index 35e92f576..b8eeb01e7 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEPericardialEffusion.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEPericardialEffusion.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientActions.h" #include #include @@ -23,12 +24,12 @@ SEPericardialEffusion::SEPericardialEffusion() //------------------------------------------------------------------------------- SEPericardialEffusion::~SEPericardialEffusion() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEPericardialEffusion::Clear() +void SEPericardialEffusion::Invalidate() { - SEPatientAction::Clear(); + SEPatientAction::Invalidate(); SAFE_DELETE(m_EffusionRate); } //------------------------------------------------------------------------------- @@ -42,27 +43,6 @@ bool SEPericardialEffusion::IsActive() const return IsValid() ? !m_EffusionRate->IsZero() : false; } //------------------------------------------------------------------------------- -bool SEPericardialEffusion::Load(const CDM::PericardialEffusionData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - GetEffusionRate().Load(in.EffusionRate(), rd); - return true; -} -//------------------------------------------------------------------------------- -CDM::PericardialEffusionData* SEPericardialEffusion::Unload() const -{ - CDM::PericardialEffusionData* data(new CDM::PericardialEffusionData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEPericardialEffusion::Unload(CDM::PericardialEffusionData& data) const -{ - SEPatientAction::Unload(data); - if (m_EffusionRate != nullptr) - data.EffusionRate(std::unique_ptr(m_EffusionRate->Unload())); -} -//------------------------------------------------------------------------------- bool SEPericardialEffusion::HasEffusionRate() const { return m_EffusionRate == nullptr ? false : m_EffusionRate->IsValid(); diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEPulmonaryShunt.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEPulmonaryShunt.cpp index cf25848b3..73d646941 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEPulmonaryShunt.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEPulmonaryShunt.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientActions.h" #include #include @@ -20,55 +21,34 @@ SEPulmonaryShunt::SEPulmonaryShunt() { m_FlowRateScaling = nullptr; } - +//------------------------------------------------------------------------------- SEPulmonaryShunt::~SEPulmonaryShunt() { - Clear(); + Invalidate(); } - -void SEPulmonaryShunt::Clear() +//------------------------------------------------------------------------------- +void SEPulmonaryShunt::Invalidate() { - SEPatientAction::Clear(); + SEPatientAction::Invalidate(); SAFE_DELETE(m_FlowRateScaling); } - +//------------------------------------------------------------------------------- bool SEPulmonaryShunt::IsValid() const { return SEPatientAction::IsValid() && HasFlowRateScale(); } - +//------------------------------------------------------------------------------- bool SEPulmonaryShunt::IsActive() const { return IsValid() ? !m_FlowRateScaling->IsZero() : false; } - -bool SEPulmonaryShunt::Load(const CDM::PulmonaryShuntData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - GetFlowRateScale().Load(in.FlowRateScaling(), rd); - return true; -} - -CDM::PulmonaryShuntData* SEPulmonaryShunt::Unload() const -{ - CDM::PulmonaryShuntData* data(new CDM::PulmonaryShuntData()); - Unload(*data); - return data; -} - -void SEPulmonaryShunt::Unload(CDM::PulmonaryShuntData& data) const -{ - SEPatientAction::Unload(data); - if (m_FlowRateScaling != nullptr) - data.FlowRateScaling(std::unique_ptr(m_FlowRateScaling->Unload())); -} - +//------------------------------------------------------------------------------- bool SEPulmonaryShunt::HasFlowRateScale() const { return m_FlowRateScaling == nullptr ? false : m_FlowRateScaling->IsValid(); } - +//------------------------------------------------------------------------------- SEScalar0To1& SEPulmonaryShunt::GetFlowRateScale() { if (m_FlowRateScaling == nullptr) @@ -88,7 +68,7 @@ bool SEPulmonaryShunt::operator!=(const SEPulmonaryShunt& rhs) const { return !(*this == rhs); } - +//------------------------------------------------------------------------------- void SEPulmonaryShunt::ToString(std::ostream& str) const { str << "Patient Action : Pulmonary Shunt"; @@ -98,4 +78,5 @@ void SEPulmonaryShunt::ToString(std::ostream& str) const HasFlowRateScale() ? str << *m_FlowRateScaling : str << "Not Set"; str << std::flush; } +//------------------------------------------------------------------------------- } \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEPupillaryResponse.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEPupillaryResponse.cpp index 84248960f..20f88e08b 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEPupillaryResponse.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEPupillaryResponse.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Physiology.h" #include namespace biogears { @@ -23,10 +24,10 @@ SEPupillaryResponse::SEPupillaryResponse() //----------------------------------------------------------------------------- SEPupillaryResponse::~SEPupillaryResponse() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SEPupillaryResponse::Clear() +void SEPupillaryResponse::Invalidate() { SAFE_DELETE(m_ReactivityModifier); SAFE_DELETE(m_ShapeModifier); @@ -48,34 +49,7 @@ const SEScalar* SEPupillaryResponse::GetScalar(const std::string& name) return &GetSizeModifier(); return nullptr; } -//----------------------------------------------------------------------------- -bool SEPupillaryResponse::Load(const CDM::PupillaryResponseData& in) -{ - if (in.ReactivityModifier().present()) - GetReactivityModifier().Load(in.ReactivityModifier().get()); - if (in.ShapeModifier().present()) - GetShapeModifier().Load(in.ShapeModifier().get()); - if (in.SizeModifier().present()) - GetSizeModifier().Load(in.SizeModifier().get()); - return true; -} -//----------------------------------------------------------------------------- -CDM::PupillaryResponseData* SEPupillaryResponse::Unload() const -{ - CDM::PupillaryResponseData* data = new CDM::PupillaryResponseData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEPupillaryResponse::Unload(CDM::PupillaryResponseData& data) const -{ - if (m_ReactivityModifier != nullptr) - data.ReactivityModifier(std::unique_ptr(m_ReactivityModifier->Unload())); - if (m_ShapeModifier != nullptr) - data.ShapeModifier(std::unique_ptr(m_ShapeModifier->Unload())); - if (m_SizeModifier != nullptr) - data.SizeModifier(std::unique_ptr(m_SizeModifier->Unload())); -} + //----------------------------------------------------------------------------- bool SEPupillaryResponse::HasReactivityModifier() const { @@ -148,9 +122,13 @@ double SEPupillaryResponse::GetSizeModifier() const //----------------------------------------------------------------------------- bool SEPupillaryResponse::operator==(const SEPupillaryResponse& rhs) const { - return ((m_ReactivityModifier && rhs.m_ReactivityModifier) ? m_ReactivityModifier->operator==(*rhs.m_ReactivityModifier) : m_ReactivityModifier == rhs.m_ReactivityModifier) - && ((m_ShapeModifier && rhs.m_ShapeModifier) ? m_ShapeModifier->operator==(*rhs.m_ShapeModifier) : m_ShapeModifier == rhs.m_ShapeModifier) - && ((m_SizeModifier && rhs.m_SizeModifier) ? m_SizeModifier->operator==(*rhs.m_SizeModifier) : m_SizeModifier == rhs.m_SizeModifier); + bool equivilant = true; + + equivilant &= ((m_ReactivityModifier && rhs.m_ReactivityModifier) ? m_ReactivityModifier->operator==(*rhs.m_ReactivityModifier) : m_ReactivityModifier == rhs.m_ReactivityModifier); + equivilant &= ((m_ShapeModifier && rhs.m_ShapeModifier) ? m_ShapeModifier->operator==(*rhs.m_ShapeModifier) : m_ShapeModifier == rhs.m_ShapeModifier); + equivilant &= ((m_SizeModifier && rhs.m_SizeModifier) ? m_SizeModifier->operator==(*rhs.m_SizeModifier) : m_SizeModifier == rhs.m_SizeModifier); + + return equivilant; } //----------------------------------------------------------------------------- bool SEPupillaryResponse::operator!=(const SEPupillaryResponse& rhs) const diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SERadiationAbsorbedDose.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SERadiationAbsorbedDose.cpp index a1eabdf6f..7eedd0f4f 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SERadiationAbsorbedDose.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SERadiationAbsorbedDose.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientActions.h" #include #include @@ -23,13 +24,13 @@ SERadiationAbsorbedDose::SERadiationAbsorbedDose() //------------------------------------------------------------------------------- SERadiationAbsorbedDose::~SERadiationAbsorbedDose() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SERadiationAbsorbedDose::Clear() +void SERadiationAbsorbedDose::Invalidate() { - SEPatientAction::Clear(); + SEPatientAction::Invalidate(); SAFE_DELETE(m_RadiationDose); } //------------------------------------------------------------------------------- @@ -43,27 +44,6 @@ bool SERadiationAbsorbedDose::IsActive() const return IsValid() ? !m_RadiationDose->IsZero() : false; } //------------------------------------------------------------------------------- -bool SERadiationAbsorbedDose::Load(const CDM::RadiationAbsorbedDoseData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - GetDose().Load(in.RadiationDose(), rd); - return true; -} -//------------------------------------------------------------------------------- -CDM::RadiationAbsorbedDoseData* SERadiationAbsorbedDose::Unload() const -{ - CDM::RadiationAbsorbedDoseData* data(new CDM::RadiationAbsorbedDoseData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SERadiationAbsorbedDose::Unload(CDM::RadiationAbsorbedDoseData& data) const -{ - SEPatientAction::Unload(data); - if (m_RadiationDose != nullptr) - data.RadiationDose(std::unique_ptr(m_RadiationDose->Unload())); -} -//------------------------------------------------------------------------------- bool SERadiationAbsorbedDose::HasDose() const { return m_RadiationDose == nullptr ? false : m_RadiationDose->IsValid(); diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SESleep.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SESleep.cpp index a4a59e2aa..f56db52b5 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SESleep.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SESleep.cpp @@ -10,23 +10,24 @@ specific language governing permissions and limitations under the License. #include "biogears/cdm/patient/actions/SESleep.h" +#include "io/cdm/PatientActions.h" namespace biogears { SESleep::SESleep() : SEPatientAction() { - m_SleepState = CDM::enumOnOff::Off; + m_SleepState = SEOnOff::Off; } //------------------------------------------------------------------------------- SESleep::~SESleep() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- - void SESleep::Clear() + void SESleep::Invalidate() { - SEPatientAction::Clear(); - m_SleepState = CDM::enumOnOff::Off;; + SEPatientAction::Invalidate(); + m_SleepState = SEOnOff::Off;; } //------------------------------------------------------------------------------- bool SESleep::IsValid() const @@ -36,41 +37,20 @@ namespace biogears //------------------------------------------------------------------------------- bool SESleep::IsActive() const { - return m_SleepState == CDM::enumOnOff::Off ? false : true; + return m_SleepState == SEOnOff::Off ? false : true; } //------------------------------------------------------------------------------- - bool SESleep::Load(const CDM::SleepData& in, std::default_random_engine *rd) - { - SEPatientAction::Load(in); - m_SleepState = in.Sleep(); - return true; - } - //------------------------------------------------------------------------------- - CDM::SleepData* SESleep::Unload() const - { - CDM::SleepData* data(new CDM::SleepData()); - Unload(*data); - return data; - } - //------------------------------------------------------------------------------- - void SESleep::Unload(CDM::SleepData& data) const - { - SEPatientAction::Unload(data); - if (HasSleepState()) - data.Sleep(m_SleepState); - } - //------------------------------------------------------------------------------- - CDM::enumOnOff SESleep::GetSleepState() const + SEOnOff SESleep::GetSleepState() const { return m_SleepState; } //------------------------------------------------------------------------------- bool SESleep::HasSleepState() const { - return m_SleepState == ((CDM::enumOnOff::value) - 1) ? false : true; + return m_SleepState == SEOnOff::Invalid ? false : true; } //------------------------------------------------------------------------------- - void SESleep::SetSleepState(CDM::enumOnOff::value t) + void SESleep::SetSleepState(SEOnOff t) { m_SleepState = t; } diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SESubstanceAdministration.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SESubstanceAdministration.cpp index 746d97257..80e4449e6 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SESubstanceAdministration.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SESubstanceAdministration.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientActions.h" #include namespace biogears { @@ -20,12 +21,12 @@ SESubstanceAdministration::SESubstanceAdministration() } SESubstanceAdministration::~SESubstanceAdministration() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SESubstanceAdministration::Clear() +void SESubstanceAdministration::Invalidate() { - SEPatientAction::Clear(); + SEPatientAction::Invalidate(); } //------------------------------------------------------------------------------- bool SESubstanceAdministration::IsValid() const @@ -38,17 +39,6 @@ bool SESubstanceAdministration::IsActive() const return IsValid(); } //------------------------------------------------------------------------------- -bool SESubstanceAdministration::Load(const CDM::SubstanceAdministrationData& in) -{ - SEPatientAction::Load(in); - return true; -} -//------------------------------------------------------------------------------- -void SESubstanceAdministration::Unload(CDM::SubstanceAdministrationData& data) const -{ - SEPatientAction::Unload(data); -} -//------------------------------------------------------------------------------- bool SESubstanceAdministration::operator==(const SESubstanceAdministration& rhs) const { return m_Comment == rhs.m_Comment; diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SESubstanceBolus.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SESubstanceBolus.cpp index 12ece0a79..1463fbdd2 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SESubstanceBolus.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SESubstanceBolus.cpp @@ -11,8 +11,12 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientActions.h" + #include #include +#include +#include #include namespace biogears { @@ -20,7 +24,7 @@ SESubstanceBolus::SESubstanceBolus(const SESubstance& substance) : SESubstanceAdministration() , m_Substance(substance) { - m_AdminRoute = (CDM::enumBolusAdministration::value)-1; + m_AdminRoute = (SEBolusAdministration)-1; m_AdminTime = nullptr; m_Dose = nullptr; m_Concentration = nullptr; @@ -28,13 +32,13 @@ SESubstanceBolus::SESubstanceBolus(const SESubstance& substance) //------------------------------------------------------------------------------- SESubstanceBolus::~SESubstanceBolus() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SESubstanceBolus::Clear() +void SESubstanceBolus::Invalidate() { - SESubstanceAdministration::Clear(); - m_AdminRoute = (CDM::enumBolusAdministration::value)-1; + SESubstanceAdministration::Invalidate(); + m_AdminRoute = (SEBolusAdministration)-1; SAFE_DELETE(m_AdminTime); SAFE_DELETE(m_Dose); SAFE_DELETE(m_Concentration); @@ -51,39 +55,6 @@ bool SESubstanceBolus::IsActive() const return IsValid(); } //------------------------------------------------------------------------------- -bool SESubstanceBolus::Load(const CDM::SubstanceBolusData& in, std::default_random_engine *rd) -{ - SESubstanceAdministration::Load(in); - if (in.AdminTime().present()) { - GetAdminTime().Load(in.AdminTime().get(), rd); - } - GetDose().Load(in.Dose()); - GetConcentration().Load(in.Concentration(), rd); - m_AdminRoute = in.AdminRoute(); - return true; -} -//------------------------------------------------------------------------------- -CDM::SubstanceBolusData* SESubstanceBolus::Unload() const -{ - CDM::SubstanceBolusData* data(new CDM::SubstanceBolusData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SESubstanceBolus::Unload(CDM::SubstanceBolusData& data) const -{ - SESubstanceAdministration::Unload(data); - if (m_Dose != nullptr) - data.Dose(std::unique_ptr(m_Dose->Unload())); - if (m_Concentration != nullptr) - data.Concentration(std::unique_ptr(m_Concentration->Unload())); - if (HasAdminRoute()) - data.AdminRoute(m_AdminRoute); - if (HasAdminTime()) - data.AdminTime(std::unique_ptr(m_AdminTime->Unload())); - data.Substance(m_Substance.GetName()); -} -//------------------------------------------------------------------------------- bool SESubstanceBolus::HasAdminTime() const { return m_AdminTime == nullptr ? false : m_AdminTime->IsValid(); @@ -96,24 +67,24 @@ SEScalarTime& SESubstanceBolus::GetAdminTime() return *m_AdminTime; } //------------------------------------------------------------------------------- -CDM::enumBolusAdministration::value SESubstanceBolus::GetAdminRoute() const +SEBolusAdministration SESubstanceBolus::GetAdminRoute() const { return m_AdminRoute; } //------------------------------------------------------------------------------- -void SESubstanceBolus::SetAdminRoute(CDM::enumBolusAdministration::value route) +void SESubstanceBolus::SetAdminRoute(SEBolusAdministration route) { m_AdminRoute = route; } //------------------------------------------------------------------------------- bool SESubstanceBolus::HasAdminRoute() const { - return m_AdminRoute == ((CDM::enumBolusAdministration::value)-1) ? false : true; + return m_AdminRoute == SEBolusAdministration::Invalid ? false : true; } //------------------------------------------------------------------------------- void SESubstanceBolus::InvalidateAdminRoute() { - m_AdminRoute = (CDM::enumBolusAdministration::value)-1; + m_AdminRoute = (SEBolusAdministration)-1; } //------------------------------------------------------------------------------- bool SESubstanceBolus::HasDose() const @@ -172,27 +143,6 @@ SESubstanceBolusState::~SESubstanceBolusState() { } //------------------------------------------------------------------------------- -bool SESubstanceBolusState::Load(const CDM::SubstanceBolusStateData& in, std::default_random_engine *rd) -{ - m_ElapsedTime.Load(in.ElapsedTime(), rd); - m_AdministeredDose.Load(in.AdministeredDose(), rd); - return true; -} -//------------------------------------------------------------------------------- -CDM::SubstanceBolusStateData* SESubstanceBolusState::Unload() const -{ - CDM::SubstanceBolusStateData* data = new CDM::SubstanceBolusStateData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SESubstanceBolusState::Unload(CDM::SubstanceBolusStateData& data) const -{ - data.Substance(m_Substance.GetName()); - data.ElapsedTime(std::unique_ptr(m_ElapsedTime.Unload())); - data.AdministeredDose(std::unique_ptr(m_AdministeredDose.Unload())); -} -//------------------------------------------------------------------------------- bool SESubstanceBolus::operator==(const SESubstanceBolus& rhs) const { bool equivilant = m_Comment == rhs.m_Comment; @@ -211,9 +161,9 @@ bool SESubstanceBolus::operator!=(const SESubstanceBolus& rhs) const //------------------------------------------------------------------------------- bool SESubstanceBolusState::operator==(const SESubstanceBolusState& rhs) const { - bool equivilant = m_ElapsedTime == rhs.m_ElapsedTime; - equivilant &= m_AdministeredDose == rhs.m_AdministeredDose; - equivilant &= m_Substance == rhs.m_Substance; + bool equivilant = m_ElapsedTime == rhs.m_ElapsedTime; + equivilant &= m_AdministeredDose == rhs.m_AdministeredDose; + equivilant &= m_Substance == rhs.m_Substance; return equivilant; } //------------------------------------------------------------------------------- diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SESubstanceCompoundInfusion.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SESubstanceCompoundInfusion.cpp index d47618bdf..ea2ff7fe4 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SESubstanceCompoundInfusion.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SESubstanceCompoundInfusion.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientActions.h" #include #include #include @@ -27,25 +28,22 @@ SESubstanceCompoundInfusion::SESubstanceCompoundInfusion(const SESubstanceCompou //------------------------------------------------------------------------------- SESubstanceCompoundInfusion::~SESubstanceCompoundInfusion() { - Clear(); + SAFE_DELETE(m_Rate); + SAFE_DELETE(m_BagVolume); } //------------------------------------------------------------------------------- -void SESubstanceCompoundInfusion::Clear() -{ - SESubstanceAdministration::Clear(); - m_Rate = nullptr; - m_BagVolume = nullptr; +void SESubstanceCompoundInfusion::Invalidate() +{ + SESubstanceAdministration::Invalidate(); + if (m_Rate) { + m_Rate->Invalidate(); + } + if (m_BagVolume) { + m_BagVolume->Invalidate(); + } // m_Compound=nullptr; Keeping mapping!! } //------------------------------------------------------------------------------- -bool SESubstanceCompoundInfusion::Load(const CDM::SubstanceCompoundInfusionData& in, std::default_random_engine *rd) -{ - SESubstanceAdministration::Load(in); - GetRate().Load(in.Rate(), rd); - GetBagVolume().Load(in.BagVolume(), rd); - return true; -} -//------------------------------------------------------------------------------- bool SESubstanceCompoundInfusion::IsValid() const { return SESubstanceAdministration::IsValid() && HasRate() && HasBagVolume(); @@ -56,23 +54,6 @@ bool SESubstanceCompoundInfusion::IsActive() const return IsValid() ? !m_Rate->IsZero() : false; } //------------------------------------------------------------------------------- -CDM::SubstanceCompoundInfusionData* SESubstanceCompoundInfusion::Unload() const -{ - CDM::SubstanceCompoundInfusionData* data(new CDM::SubstanceCompoundInfusionData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SESubstanceCompoundInfusion::Unload(CDM::SubstanceCompoundInfusionData& data) const -{ - SESubstanceAdministration::Unload(data); - if (m_Rate != nullptr) - data.Rate(std::unique_ptr(m_Rate->Unload())); - if (m_BagVolume != nullptr) - data.BagVolume(std::unique_ptr(m_BagVolume->Unload())); - data.SubstanceCompound(m_Compound.GetName()); -} -//------------------------------------------------------------------------------- bool SESubstanceCompoundInfusion::HasRate() const { return m_Rate == nullptr ? false : m_Rate->IsValid(); diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SESubstanceInfusion.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SESubstanceInfusion.cpp index b25b0a56e..948748f3c 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SESubstanceInfusion.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SESubstanceInfusion.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientActions.h" #include #include #include @@ -28,12 +29,12 @@ SESubstanceInfusion::SESubstanceInfusion(const SESubstance& substance) //------------------------------------------------------------------------------- SESubstanceInfusion::~SESubstanceInfusion() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SESubstanceInfusion::Clear() +void SESubstanceInfusion::Invalidate() { - SESubstanceAdministration::Clear(); + SESubstanceAdministration::Invalidate(); m_Rate = nullptr; m_Concentration = nullptr; } @@ -48,31 +49,6 @@ bool SESubstanceInfusion::IsActive() const return IsValid() ? !m_Rate->IsZero() : false; } //------------------------------------------------------------------------------- -bool SESubstanceInfusion::Load(const CDM::SubstanceInfusionData& in, std::default_random_engine *rd) -{ - SESubstanceAdministration::Load(in); - GetRate().Load(in.Rate(), rd); - GetConcentration().Load(in.Concentration(), rd); - return true; -} -//------------------------------------------------------------------------------- -CDM::SubstanceInfusionData* SESubstanceInfusion::Unload() const -{ - CDM::SubstanceInfusionData* data(new CDM::SubstanceInfusionData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SESubstanceInfusion::Unload(CDM::SubstanceInfusionData& data) const -{ - SESubstanceAdministration::Unload(data); - if (m_Rate != nullptr) - data.Rate(std::unique_ptr(m_Rate->Unload())); - if (m_Concentration != nullptr) - data.Concentration(std::unique_ptr(m_Concentration->Unload())); - data.Substance(m_Substance.GetName()); -} -//------------------------------------------------------------------------------- bool SESubstanceInfusion::HasRate() const { return m_Rate == nullptr ? false : m_Rate->IsValid(); diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SESubstanceNasalDose.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SESubstanceNasalDose.cpp index 119516a16..b79a50506 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SESubstanceNasalDose.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SESubstanceNasalDose.cpp @@ -10,11 +10,10 @@ CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **************************************************************************************/ #include -#include + #include -#include -#include +#pragma warning(disable : 4661) namespace biogears { SESubstanceNasalDose::SESubstanceNasalDose(const SESubstance& substance) : SESubstanceAdministration() @@ -25,12 +24,12 @@ SESubstanceNasalDose::SESubstanceNasalDose(const SESubstance& substance) //------------------------------------------------------------------------------- SESubstanceNasalDose::~SESubstanceNasalDose() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SESubstanceNasalDose::Clear() +void SESubstanceNasalDose::Invalidate() { - SESubstanceAdministration::Clear(); + SESubstanceAdministration::Invalidate(); SAFE_DELETE(m_Dose); } //------------------------------------------------------------------------------- @@ -44,28 +43,6 @@ bool SESubstanceNasalDose::IsActive() const return IsValid(); } //------------------------------------------------------------------------------- -bool SESubstanceNasalDose::Load(const CDM::SubstanceNasalDoseData& in, std::default_random_engine *rd) -{ - SESubstanceAdministration::Load(in); - GetDose().Load(in.Dose(), rd); - return true; -} -//------------------------------------------------------------------------------- -CDM::SubstanceNasalDoseData* SESubstanceNasalDose::Unload() const -{ - CDM::SubstanceNasalDoseData* data(new CDM::SubstanceNasalDoseData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SESubstanceNasalDose::Unload(CDM::SubstanceNasalDoseData& data) const -{ - SESubstanceAdministration::Unload(data); - if (m_Dose != nullptr) - data.Dose(std::unique_ptr(m_Dose->Unload())); - data.Substance(m_Substance.GetName()); -} -//------------------------------------------------------------------------------- bool SESubstanceNasalDose::HasDose() const { return m_Dose == nullptr ? false : m_Dose->IsValid(); @@ -111,20 +88,20 @@ SENasalState::SENasalState(const SESubstance& sub) : m_Substance(&sub) { m_TotalNasalDose = nullptr; - //m_VenaCavaConcentration = nullptr; + // m_VenaCavaConcentration = nullptr; m_NumUnreleasedMasses = 3; // Hard-coded for current model implementation! m_NumReleasedMasses = 3; // Hard-coded for current model implementation! } //------------------------------------------------------------------------------- SENasalState::~SENasalState() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SENasalState::Clear() +void SENasalState::Invalidate() { SAFE_DELETE(m_TotalNasalDose); - //SAFE_DELETE(m_VenaCavaConcentration); + // SAFE_DELETE(m_VenaCavaConcentration); m_UnreleasedDrugMasses.clear(); m_ReleasedDrugMasses.clear(); } @@ -132,7 +109,7 @@ void SENasalState::Clear() bool SENasalState::Initialize(SEScalarMass& dose) { GetTotalNasalDose().Set(dose); - //GetVenaCavaConcentration().SetValue(0.0, MassPerVolumeUnit::ug_Per_mL); + // GetVenaCavaConcentration().SetValue(0.0, MassPerVolumeUnit::ug_Per_mL); std::vector initUnreleasedMasses(m_NumUnreleasedMasses); std::vector initReleasedMasses(m_NumReleasedMasses); bool unrelSet = SetUnreleasedNasalMasses(initUnreleasedMasses, MassUnit::mg); @@ -140,44 +117,6 @@ bool SENasalState::Initialize(SEScalarMass& dose) return (unrelSet && relSet); } //------------------------------------------------------------------------------- -bool SENasalState::Load(const CDM::NasalStateData& in, std::default_random_engine *rd) -{ - - GetTotalNasalDose().Load(in.TotalNasalDose()); - m_UnreleasedDrugMasses.clear(); - for (auto umData : in.UnreleasedDrugMasses()) { - SEScalarMass unrelMass; - unrelMass.Load(umData, rd); - m_UnreleasedDrugMasses.push_back(unrelMass); - } - m_ReleasedDrugMasses.clear(); - for (auto rmData : in.ReleasedDrugMasses()) { - SEScalarMass relMass; - relMass.Load(rmData, rd); - m_ReleasedDrugMasses.push_back(relMass); - } - return true; -} -//------------------------------------------------------------------------------- -CDM::NasalStateData* SENasalState::Unload() const -{ - CDM::NasalStateData* data = new CDM::NasalStateData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SENasalState::Unload(CDM::NasalStateData& data) const -{ - data.TotalNasalDose(std::unique_ptr(m_TotalNasalDose->Unload())); - for (auto umData : m_UnreleasedDrugMasses) { - data.UnreleasedDrugMasses().push_back(std::unique_ptr(umData.Unload())); - } - for (auto rmData : m_ReleasedDrugMasses) { - data.ReleasedDrugMasses().push_back(std::unique_ptr(rmData.Unload())); - } - data.Substance(m_Substance->GetName()); -} -//------------------------------------------------------------------------------- SEScalarMass& SENasalState::GetTotalNasalDose() { if (m_TotalNasalDose == nullptr) @@ -185,7 +124,7 @@ SEScalarMass& SENasalState::GetTotalNasalDose() return *m_TotalNasalDose; } //------------------------------------------------------------------------------- -//SEScalarMassPerVolume& SENasalState::GetVenaCavaConcentration() +// SEScalarMassPerVolume& SENasalState::GetVenaCavaConcentration() //{ // if (m_VenaCavaConcentration == nullptr) // m_VenaCavaConcentration = new SEScalarMassPerVolume(); @@ -274,8 +213,8 @@ bool SENasalState::operator==(const SENasalState& rhs) const bool equivilant = (m_Substance && rhs.m_Substance) ? m_Substance->operator==(*rhs.m_Substance) : m_Substance == rhs.m_Substance; equivilant &= (m_TotalNasalDose && rhs.m_TotalNasalDose) ? m_TotalNasalDose->operator==(*rhs.m_TotalNasalDose) : m_TotalNasalDose == rhs.m_TotalNasalDose; - //equivilant &= (m_VenaCavaConcentration && rhs.m_VenaCavaConcentration) ? m_VenaCavaConcentration->operator==(*rhs.m_VenaCavaConcentration) - //: m_VenaCavaConcentration == rhs.m_VenaCavaConcentration; + // equivilant &= (m_VenaCavaConcentration && rhs.m_VenaCavaConcentration) ? m_VenaCavaConcentration->operator==(*rhs.m_VenaCavaConcentration) + //: m_VenaCavaConcentration == rhs.m_VenaCavaConcentration; equivilant &= m_UnreleasedDrugMasses == rhs.m_UnreleasedDrugMasses; equivilant &= m_ReleasedDrugMasses == rhs.m_ReleasedDrugMasses; equivilant &= m_NumUnreleasedMasses == rhs.m_NumUnreleasedMasses; diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SESubstanceOralDose.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SESubstanceOralDose.cpp index 0ab9f6971..64e29c5d9 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SESubstanceOralDose.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SESubstanceOralDose.cpp @@ -1,36 +1,37 @@ -/************************************************************************************** -Copyright 2015 Applied Research Associates, Inc. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the License -at: -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software distributed under -the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -CONDITIONS OF ANY KIND, either express or implied. See the License for the -specific language governing permissions and limitations under the License. -**************************************************************************************/ +///************************************************************************************** +//Copyright 2015 Applied Research Associates, Inc. +//Licensed under the Apache License, Version 2.0 (the "License"); you may not use +//this file except in compliance with the License. You may obtain a copy of the License +//at: +//http://www.apache.org/licenses/LICENSE-2.0 +//Unless required by applicable law or agreed to in writing, software distributed under +//the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +//CONDITIONS OF ANY KIND, either express or implied. See the License for the +//specific language governing permissions and limitations under the License. +//**************************************************************************************/ #include +// #include -#include - +#include +// namespace biogears { SESubstanceOralDose::SESubstanceOralDose(const SESubstance& substance) : SESubstanceAdministration() , m_Substance(substance) { - m_AdminRoute = (CDM::enumOralAdministration::value)-1; + m_AdminRoute = (SEOralAdministrationType)-1; m_Dose = nullptr; } //------------------------------------------------------------------------------- SESubstanceOralDose::~SESubstanceOralDose() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SESubstanceOralDose::Clear() +void SESubstanceOralDose::Invalidate() { - SESubstanceAdministration::Clear(); - m_AdminRoute = (CDM::enumOralAdministration::value)-1; + SESubstanceAdministration::Invalidate(); + m_AdminRoute = (SEOralAdministrationType)-1; SAFE_DELETE(m_Dose); } //------------------------------------------------------------------------------- @@ -46,44 +47,19 @@ bool SESubstanceOralDose::IsActive() const return IsValid(); } //------------------------------------------------------------------------------- -bool SESubstanceOralDose::Load(const CDM::SubstanceOralDoseData& in, std::default_random_engine *rd) -{ - SESubstanceAdministration::Load(in); - GetDose().Load(in.Dose(), rd); - m_AdminRoute = in.AdminRoute(); - return true; -} -//------------------------------------------------------------------------------- -CDM::SubstanceOralDoseData* SESubstanceOralDose::Unload() const -{ - CDM::SubstanceOralDoseData* data(new CDM::SubstanceOralDoseData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SESubstanceOralDose::Unload(CDM::SubstanceOralDoseData& data) const -{ - SESubstanceAdministration::Unload(data); - if (m_Dose != nullptr) - data.Dose(std::unique_ptr(m_Dose->Unload())); - if (HasAdminRoute()) - data.AdminRoute(m_AdminRoute); - data.Substance(m_Substance.GetName()); -} -//------------------------------------------------------------------------------- -CDM::enumOralAdministration::value SESubstanceOralDose::GetAdminRoute() const +SEOralAdministrationType SESubstanceOralDose::GetAdminRoute() const { return m_AdminRoute; } //------------------------------------------------------------------------------- -void SESubstanceOralDose::SetAdminRoute(CDM::enumOralAdministration::value route) +void SESubstanceOralDose::SetAdminRoute(SEOralAdministrationType route) { m_AdminRoute = route; } //------------------------------------------------------------------------------- bool SESubstanceOralDose::HasAdminRoute() const { - return m_AdminRoute == ((CDM::enumOralAdministration::value)-1) ? false : true; + return m_AdminRoute == SEOralAdministrationType::Invalid ? false : true; } //------------------------------------------------------------------------------- bool SESubstanceOralDose::HasDose() const @@ -131,8 +107,8 @@ bool SESubstanceOralDose::operator!=(const SESubstanceOralDose& rhs) const // Oral Transmucosal State methods SETransmucosalState::SETransmucosalState(const SESubstance& sub) : m_Substance(&sub) - ,m_NumBuccalRegions(7) // Hard-coded for current model implementation! - ,m_NumSublingualRegions(7) // Hard-coded for current model implementation! + , m_NumBuccalRegions(7) // Hard-coded for current model implementation! + , m_NumSublingualRegions(7) // Hard-coded for current model implementation! { m_MouthSolidMass = nullptr; m_SalivaConcentration = nullptr; @@ -140,10 +116,10 @@ SETransmucosalState::SETransmucosalState(const SESubstance& sub) //------------------------------------------------------------------------------- SETransmucosalState::~SETransmucosalState() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SETransmucosalState::Clear() +void SETransmucosalState::Invalidate() { SAFE_DELETE(m_MouthSolidMass); SAFE_DELETE(m_SalivaConcentration); @@ -161,46 +137,7 @@ bool SETransmucosalState::Initialize(SEScalarMass& dose) bool subSet = SetSublingualConcentrations(initSublingual, MassPerVolumeUnit::ug_Per_mL); return (bucSet && subSet); } -//------------------------------------------------------------------------------- -bool SETransmucosalState::Load(const CDM::TransmucosalStateData& in, std::default_random_engine *rd) -{ - GetMouthSolidMass().Load(in.MouthSolidMass()); - GetSalivaConcentration().Load(in.SalivaConcentration()); - m_BuccalConcentrations.clear(); - for (auto brData : in.BuccalConcentrations()) { - SEScalarMassPerVolume buc; - buc.Load(brData, rd); - m_BuccalConcentrations.push_back(buc); - } - m_SublingualConcentrations.clear(); - for (auto slData : in.SublingualConcentrations()) { - SEScalarMassPerVolume sl; - sl.Load(slData, rd); - m_SublingualConcentrations.push_back(sl); - } - return true; -} -//------------------------------------------------------------------------------- -CDM::TransmucosalStateData* SETransmucosalState::Unload() const -{ - CDM::TransmucosalStateData* data = new CDM::TransmucosalStateData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SETransmucosalState::Unload(CDM::TransmucosalStateData& data) const -{ - data.MouthSolidMass(std::unique_ptr(m_MouthSolidMass->Unload())); - data.SalivaConcentration(std::unique_ptr(m_SalivaConcentration->Unload())); - for (auto bcData : m_BuccalConcentrations) { - data.BuccalConcentrations().push_back(std::unique_ptr(bcData.Unload())); - } - for (auto slData : m_SublingualConcentrations) { - data.SublingualConcentrations().push_back(std::unique_ptr(slData.Unload())); - } - data.Substance(m_Substance->GetName()); -} //------------------------------------------------------------------------------- SEScalarMass& SETransmucosalState::GetMouthSolidMass() { @@ -293,7 +230,7 @@ bool SETransmucosalState::SetSublingualConcentrations(std::vector& slMas return true; } //------------------------------------------------------------------------------- - +#pragma warning(disable : 4661) bool SETransmucosalState::operator==(const SETransmucosalState& rhs) const { diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SETensionPneumothorax.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SETensionPneumothorax.cpp index 04b6efca8..3dd18cbed 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SETensionPneumothorax.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SETensionPneumothorax.cpp @@ -1,4 +1,4 @@ - /************************************************************************************** +/************************************************************************************** Copyright 2015 Applied Research Associates, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientActions.h" #include #include @@ -18,49 +19,24 @@ namespace biogears { SETensionPneumothorax::SETensionPneumothorax() : SEPatientAction() { - m_Type = (CDM::enumPneumothoraxType::value)-1; - m_Side = (CDM::enumSide::value)-1; + m_Type = (SEPneumothoraxType)-1; + m_Side = SESide::Invalid; m_Severity = nullptr; } //------------------------------------------------------------------------------- SETensionPneumothorax::~SETensionPneumothorax() { - Clear(); -} -//------------------------------------------------------------------------------- -void SETensionPneumothorax::Clear() -{ - SEPatientAction::Clear(); - m_Type = (CDM::enumPneumothoraxType::value)-1; - m_Side = (CDM::enumSide::value)-1; - SAFE_DELETE(m_Severity); -} -//------------------------------------------------------------------------------- -bool SETensionPneumothorax::Load(const CDM::TensionPneumothoraxData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - GetSeverity().Load(in.Severity(), rd); - m_Type = in.Type(); - m_Side = in.Side(); - return true; -} -//------------------------------------------------------------------------------- -CDM::TensionPneumothoraxData* SETensionPneumothorax::Unload() const -{ - CDM::TensionPneumothoraxData* data(new CDM::TensionPneumothoraxData()); - Unload(*data); - return data; + delete m_Severity; + m_Severity = nullptr; } //------------------------------------------------------------------------------- -void SETensionPneumothorax::Unload(CDM::TensionPneumothoraxData& data) const +void SETensionPneumothorax::Invalidate() { - SEPatientAction::Unload(data); - if (m_Severity != nullptr) - data.Severity(std::unique_ptr(m_Severity->Unload())); - if (HasType()) - data.Type(m_Type); - if (HasSide()) - data.Side(m_Side); + SEPatientAction::Invalidate(); + m_Type = SEPneumothoraxType::Invalid; + m_Side = SESide::Invalid; + if (m_Severity) + m_Severity->Invalidate(); } //------------------------------------------------------------------------------- bool SETensionPneumothorax::IsValid() const @@ -73,43 +49,43 @@ bool SETensionPneumothorax::IsActive() const return IsValid(); } //------------------------------------------------------------------------------- -CDM::enumPneumothoraxType::value SETensionPneumothorax::GetType() const +SEPneumothoraxType SETensionPneumothorax::GetType() const { return m_Type; } //------------------------------------------------------------------------------- -void SETensionPneumothorax::SetType(CDM::enumPneumothoraxType::value Type) +void SETensionPneumothorax::SetType(SEPneumothoraxType Type) { m_Type = Type; } //------------------------------------------------------------------------------- bool SETensionPneumothorax::HasType() const { - return m_Type == ((CDM::enumPneumothoraxType::value)-1) ? false : true; + return m_Type == SEPneumothoraxType::Invalid ? false : true; } //------------------------------------------------------------------------------- void SETensionPneumothorax::InvalidateType() { - m_Type = (CDM::enumPneumothoraxType::value)-1; + m_Type = (SEPneumothoraxType)-1; } //------------------------------------------------------------------------------- -CDM::enumSide::value SETensionPneumothorax::GetSide() const +SESide SETensionPneumothorax::GetSide() const { return m_Side; } //------------------------------------------------------------------------------- -void SETensionPneumothorax::SetSide(CDM::enumSide::value Side) +void SETensionPneumothorax::SetSide(SESide Side) { m_Side = Side; } bool SETensionPneumothorax::HasSide() const { - return m_Side == ((CDM::enumSide::value)-1) ? false : true; + return m_Side == SESide::Invalid ? false : true; } //------------------------------------------------------------------------------- void SETensionPneumothorax::InvalidateSide() { - m_Side = (CDM::enumSide::value)-1; + m_Side = SESide::Invalid; } //------------------------------------------------------------------------------- bool SETensionPneumothorax::HasSeverity() const @@ -138,7 +114,7 @@ void SETensionPneumothorax::ToString(std::ostream& str) const str << std::flush; } //------------------------------------------------------------------------------- -bool SETensionPneumothorax::operator==( const SETensionPneumothorax& rhs) const +bool SETensionPneumothorax::operator==(const SETensionPneumothorax& rhs) const { bool equivilant = m_Comment == rhs.m_Comment; equivilant &= m_Side == rhs.m_Side; @@ -147,7 +123,7 @@ bool SETensionPneumothorax::operator==( const SETensionPneumothorax& rhs) const return equivilant; } //------------------------------------------------------------------------------- -bool SETensionPneumothorax::operator!=( const SETensionPneumothorax& rhs) const +bool SETensionPneumothorax::operator!=(const SETensionPneumothorax& rhs) const { return !(*this == rhs); } diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SETourniquet.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SETourniquet.cpp index f52efd71f..b0e9e37a2 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SETourniquet.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SETourniquet.cpp @@ -12,24 +12,26 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/PatientActions.h" + namespace biogears { SETourniquet::SETourniquet() : SEPatientAction() { m_Compartment = ""; //User input, location of Tourniquet - m_TourniquetLevel = (CDM::enumTourniquetApplicationLevel::value)-1; + m_TourniquetLevel = SETourniquetApplicationType::Invalid; } //----------------------------------------------------------------------------- SETourniquet::~SETourniquet() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SETourniquet::Clear() +void SETourniquet::Invalidate() { - SEPatientAction::Clear(); + SEPatientAction::Invalidate(); m_Compartment = ""; - m_TourniquetLevel = (CDM::enumTourniquetApplicationLevel::value)-1; + m_TourniquetLevel = SETourniquetApplicationType::Invalid; } //----------------------------------------------------------------------------- bool SETourniquet::IsValid() const @@ -41,31 +43,7 @@ bool SETourniquet::IsValid() const //----------------------------------------------------------------------------- bool SETourniquet::IsActive() const { - return IsValid() ? !(m_TourniquetLevel == (CDM::enumTourniquetApplicationLevel::None)) : false; -}//----------------------------------------------------------------------------- -bool SETourniquet::Load(const CDM::TourniquetData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - m_TourniquetLevel = in.TourniquetLevel(); - m_Compartment = in.Compartment(); - - return true; -} -//----------------------------------------------------------------------------- -CDM::TourniquetData* SETourniquet::Unload() const -{ - CDM::TourniquetData* data(new CDM::TourniquetData()); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SETourniquet::Unload(CDM::TourniquetData& data) const -{ - SEPatientAction::Unload(data); - if (HasCompartment()) - data.Compartment(m_Compartment); - if (HasTourniquetLevel()) - data.TourniquetLevel(m_TourniquetLevel); + return IsValid() ? !(m_TourniquetLevel == (SETourniquetApplicationType::NotApplied)) : false; } //----------------------------------------------------------------------------- const char* SETourniquet::GetCompartment_cStr() const @@ -100,22 +78,22 @@ void SETourniquet::InvalidateCompartment() //----------------------------------------------------------------------------- bool SETourniquet::HasTourniquetLevel() const { - return m_TourniquetLevel == ((CDM::enumTourniquetApplicationLevel::value)-1) ? false : true; + return m_TourniquetLevel == SETourniquetApplicationType::Invalid ? false : true; } //----------------------------------------------------------------------------- -CDM::enumTourniquetApplicationLevel SETourniquet::GetTourniquetLevel() +SETourniquetApplicationType SETourniquet::GetTourniquetLevel() { return m_TourniquetLevel; } //----------------------------------------------------------------------------- -void SETourniquet::SetTourniquetLevel(CDM::enumTourniquetApplicationLevel::value level) +void SETourniquet::SetTourniquetLevel(SETourniquetApplicationType level) { m_TourniquetLevel = level; } //----------------------------------------------------------------------------- void SETourniquet::ToString(std::ostream& str) const { - if (m_TourniquetLevel == CDM::enumTourniquetApplicationLevel::None) { + if (m_TourniquetLevel == SETourniquetApplicationType::NotApplied) { str << "Patient Action : Remove tourniquet"; if (HasComment()) str << "\n\tComment: "; diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEUrinate.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEUrinate.cpp index d38adcea1..95525a079 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEUrinate.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEUrinate.cpp @@ -12,6 +12,7 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/PatientActions.h" namespace biogears { SEUrinate::SEUrinate() : SEPatientAction() @@ -20,12 +21,12 @@ SEUrinate::SEUrinate() //------------------------------------------------------------------------------- SEUrinate::~SEUrinate() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEUrinate::Clear() +void SEUrinate::Invalidate() { - SEPatientAction::Clear(); + SEPatientAction::Invalidate(); } //------------------------------------------------------------------------------- bool SEUrinate::IsValid() const @@ -38,24 +39,6 @@ bool SEUrinate::IsActive() const return IsValid(); } //------------------------------------------------------------------------------- -bool SEUrinate::Load(const CDM::UrinateData& in, std::default_random_engine *rd) -{ - SEPatientAction::Load(in); - return true; -} -//------------------------------------------------------------------------------- -CDM::UrinateData* SEUrinate::Unload() const -{ - CDM::UrinateData* data(new CDM::UrinateData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEUrinate::Unload(CDM::UrinateData& data) const -{ - SEPatientAction::Unload(data); -} -//------------------------------------------------------------------------------- void SEUrinate::ToString(std::ostream& str) const { str << "Patient Action : Urinate"; diff --git a/projects/biogears/libBiogears/src/cdm/patient/actions/SEUseInhaler.cpp b/projects/biogears/libBiogears/src/cdm/patient/actions/SEUseInhaler.cpp index a451ee92a..5c895ce12 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/actions/SEUseInhaler.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/actions/SEUseInhaler.cpp @@ -11,9 +11,10 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include + #include #include - +#include "io/cdm/PatientActions.h" namespace biogears { SEUseInhaler::SEUseInhaler() : SEConsciousRespirationCommand() @@ -22,12 +23,12 @@ SEUseInhaler::SEUseInhaler() //------------------------------------------------------------------------------- SEUseInhaler::~SEUseInhaler() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEUseInhaler::Clear() +void SEUseInhaler::Invalidate() { - SEConsciousRespirationCommand::Clear(); + SEConsciousRespirationCommand::Invalidate(); } //------------------------------------------------------------------------------- bool SEUseInhaler::IsValid() const @@ -40,24 +41,6 @@ bool SEUseInhaler::IsActive() const return SEConsciousRespirationCommand::IsActive(); } //------------------------------------------------------------------------------- -bool SEUseInhaler::Load(const CDM::UseInhalerData& in, std::default_random_engine *rd) -{ - SEConsciousRespirationCommand::Load(in); - return true; -} -//------------------------------------------------------------------------------- -CDM::UseInhalerData* SEUseInhaler::Unload() const -{ - CDM::UseInhalerData* data(new CDM::UseInhalerData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEUseInhaler::Unload(CDM::UseInhalerData& data) const -{ - SEConsciousRespirationCommand::Unload(data); -} -//------------------------------------------------------------------------------- void SEUseInhaler::ToString(std::ostream& str) const { str << "Use Inhaler"; diff --git a/projects/biogears/libBiogears/src/cdm/patient/assessments/SEArterialBloodGasAnalysis.cpp b/projects/biogears/libBiogears/src/cdm/patient/assessments/SEArterialBloodGasAnalysis.cpp index 35938434a..e1c49b97b 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/assessments/SEArterialBloodGasAnalysis.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/assessments/SEArterialBloodGasAnalysis.cpp @@ -16,6 +16,7 @@ specific language governing permissions and limitations under the License. #include #include #include +#include "io/cdm/PatientAssessments.h" namespace biogears { SEArterialBloodGasAnalysis::SEArterialBloodGasAnalysis() @@ -31,12 +32,12 @@ SEArterialBloodGasAnalysis::SEArterialBloodGasAnalysis() //------------------------------------------------------------------------------- SEArterialBloodGasAnalysis::~SEArterialBloodGasAnalysis() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEArterialBloodGasAnalysis::Clear() +void SEArterialBloodGasAnalysis::Invalidate() { - SEPatientAssessment::Clear(); + SEPatientAssessment::Invalidate(); SAFE_DELETE(m_pH); SAFE_DELETE(m_PartialPressureOxygen); SAFE_DELETE(m_PartialPressureCarbonDioxide); @@ -55,36 +56,7 @@ void SEArterialBloodGasAnalysis::Reset() INVALIDATE_PROPERTY(m_StandardBicarbonate); INVALIDATE_PROPERTY(m_OxygenSaturation); } -//------------------------------------------------------------------------------- -bool SEArterialBloodGasAnalysis::Load(const CDM::ArterialBloodGasAnalysisData& in) -{ - SEPatientAssessment::Load(in); - return true; -} -//------------------------------------------------------------------------------- -CDM::ArterialBloodGasAnalysisData* SEArterialBloodGasAnalysis::Unload() -{ - CDM::ArterialBloodGasAnalysisData* data = new CDM::ArterialBloodGasAnalysisData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEArterialBloodGasAnalysis::Unload(CDM::ArterialBloodGasAnalysisData& data) -{ - SEPatientAssessment::Unload(data); - if (m_pH != nullptr) - data.pH(std::unique_ptr(m_pH->Unload())); - if (m_PartialPressureOxygen != nullptr) - data.PartialPressureOxygen(std::unique_ptr(m_PartialPressureOxygen->Unload())); - if (m_PartialPressureCarbonDioxide != nullptr) - data.PartialPressureCarbonDioxide(std::unique_ptr(m_PartialPressureCarbonDioxide->Unload())); - if (m_BaseExcess != nullptr) - data.BaseExcess(std::unique_ptr(m_BaseExcess->Unload())); - if (m_StandardBicarbonate != nullptr) - data.StandardBicarbonate(std::unique_ptr(m_StandardBicarbonate->Unload())); - if (m_OxygenSaturation != nullptr) - data.OxygenSaturation(std::unique_ptr(m_OxygenSaturation->Unload())); -} + //------------------------------------------------------------------------------- bool SEArterialBloodGasAnalysis::HaspH() { diff --git a/projects/biogears/libBiogears/src/cdm/patient/assessments/SECompleteBloodCount.cpp b/projects/biogears/libBiogears/src/cdm/patient/assessments/SECompleteBloodCount.cpp index cbfeae83f..99f6eb4e3 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/assessments/SECompleteBloodCount.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/assessments/SECompleteBloodCount.cpp @@ -17,6 +17,7 @@ specific language governing permissions and limitations under the License. #include #include #include +#include "io/cdm/PatientAssessments.h" namespace biogears { SECompleteBloodCount::SECompleteBloodCount() @@ -36,12 +37,12 @@ SECompleteBloodCount::SECompleteBloodCount() //------------------------------------------------------------------------------- SECompleteBloodCount::~SECompleteBloodCount() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SECompleteBloodCount::Clear() +void SECompleteBloodCount::Invalidate() { - SEPatientAssessment::Clear(); + SEPatientAssessment::Invalidate(); SAFE_DELETE(m_Hematocrit); SAFE_DELETE(m_Hemoglobin); SAFE_DELETE(m_LymphocyteCellCount); @@ -70,45 +71,6 @@ void SECompleteBloodCount::Reset() INVALIDATE_PROPERTY(m_WhiteBloodCellCount); } //------------------------------------------------------------------------------- -bool SECompleteBloodCount::Load(const CDM::CompleteBloodCountData& in) -{ - SEPatientAssessment::Load(in); - // TODO Implement Load Complete Blood Count - return true; -} -//------------------------------------------------------------------------------- -CDM::CompleteBloodCountData* SECompleteBloodCount::Unload() -{ - CDM::CompleteBloodCountData* data = new CDM::CompleteBloodCountData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SECompleteBloodCount::Unload(CDM::CompleteBloodCountData& data) -{ - SEPatientAssessment::Unload(data); - if (HasHematocrit()) - data.Hematocrit(std::unique_ptr(m_Hematocrit->Unload())); - if (HasHemoglobin()) - data.Hemoglobin(std::unique_ptr(m_Hemoglobin->Unload())); - if (HasLymphocyteCellCount()) - data.LymphocyteCellCount(std::unique_ptr(m_LymphocyteCellCount->Unload())); - if (HasPlateletCount()) - data.PlateletCount(std::unique_ptr(m_PlateletCount->Unload())); - if (HasMeanCorpuscularHemoglobin()) - data.MeanCorpuscularHemoglobin(std::unique_ptr(m_MeanCorpuscularHemoglobin->Unload())); - if (HasMeanCorpuscularHemoglobinConcentration()) - data.MeanCorpuscularHemoglobinConcentration(std::unique_ptr(m_MeanCorpuscularHemoglobinConcentration->Unload())); - if (HasMeanCorpuscularVolume()) - data.MeanCorpuscularVolume(std::unique_ptr(m_MeanCorpuscularVolume->Unload())); - if (HasNeutrophilCount()) - data.NeutrophilCellCount(std::unique_ptr(m_NeutrophilCellCount->Unload())); - if (HasRedBloodCellCount()) - data.RedBloodCellCount(std::unique_ptr(m_RedBloodCellCount->Unload())); - if (HasWhiteBloodCellCount()) - data.WhiteBloodCellCount(std::unique_ptr(m_WhiteBloodCellCount->Unload())); -} -//------------------------------------------------------------------------------- bool SECompleteBloodCount::HasHematocrit() const { return m_Hematocrit == nullptr ? false : m_Hematocrit->IsValid(); diff --git a/projects/biogears/libBiogears/src/cdm/patient/assessments/SEComprehensiveMetabolicPanel.cpp b/projects/biogears/libBiogears/src/cdm/patient/assessments/SEComprehensiveMetabolicPanel.cpp index dcde3a0e7..adf104544 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/assessments/SEComprehensiveMetabolicPanel.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/assessments/SEComprehensiveMetabolicPanel.cpp @@ -15,6 +15,7 @@ specific language governing permissions and limitations under the License. #include #include #include +#include "io/cdm/PatientAssessments.h" namespace biogears { SEComprehensiveMetabolicPanel::SEComprehensiveMetabolicPanel() @@ -37,12 +38,12 @@ SEComprehensiveMetabolicPanel::SEComprehensiveMetabolicPanel() //------------------------------------------------------------------------------- SEComprehensiveMetabolicPanel::~SEComprehensiveMetabolicPanel() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEComprehensiveMetabolicPanel::Clear() +void SEComprehensiveMetabolicPanel::Invalidate() { - SEPatientAssessment::Clear(); + SEPatientAssessment::Invalidate(); SAFE_DELETE(m_Albumin); SAFE_DELETE(m_ALP); SAFE_DELETE(m_ALT); @@ -77,53 +78,7 @@ void SEComprehensiveMetabolicPanel::Reset() INVALIDATE_PROPERTY(m_TotalBilirubin); INVALIDATE_PROPERTY(m_TotalProtein); } -//------------------------------------------------------------------------------- -bool SEComprehensiveMetabolicPanel::Load(const CDM::ComprehensiveMetabolicPanelData& in) -{ - SEPatientAssessment::Load(in); - // TODO - return true; -} -//------------------------------------------------------------------------------- -CDM::ComprehensiveMetabolicPanelData* SEComprehensiveMetabolicPanel::Unload() -{ - CDM::ComprehensiveMetabolicPanelData* data = new CDM::ComprehensiveMetabolicPanelData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEComprehensiveMetabolicPanel::Unload(CDM::ComprehensiveMetabolicPanelData& data) -{ - SEPatientAssessment::Unload(data); - if (HasAlbumin()) - data.Albumin(std::unique_ptr(m_Albumin->Unload())); - if (HasALP()) - data.ALP(std::unique_ptr(m_ALP->Unload())); - if (HasALT()) - data.ALT(std::unique_ptr(m_ALT->Unload())); - if (HasAST()) - data.AST(std::unique_ptr(m_AST->Unload())); - if (HasBUN()) - data.BUN(std::unique_ptr(m_BUN->Unload())); - if (HasCalcium()) - data.Calcium(std::unique_ptr(m_Calcium->Unload())); - if (HasChloride()) - data.Chloride(std::unique_ptr(m_Chloride->Unload())); - if (HasCO2()) - data.CO2(std::unique_ptr(m_CO2->Unload())); - if (HasCreatinine()) - data.Creatinine(std::unique_ptr(m_Creatinine->Unload())); - if (HasGlucose()) - data.Glucose(std::unique_ptr(m_Glucose->Unload())); - if (HasPotassium()) - data.Potassium(std::unique_ptr(m_Potassium->Unload())); - if (HasSodium()) - data.Sodium(std::unique_ptr(m_Sodium->Unload())); - if (HasTotalBilirubin()) - data.TotalBilirubin(std::unique_ptr(m_TotalBilirubin->Unload())); - if (HasTotalProtein()) - data.TotalProtein(std::unique_ptr(m_TotalProtein->Unload())); -} + //------------------------------------------------------------------------------- bool SEComprehensiveMetabolicPanel::HasAlbumin() const { diff --git a/projects/biogears/libBiogears/src/cdm/patient/assessments/SEPatientAssessment.cpp b/projects/biogears/libBiogears/src/cdm/patient/assessments/SEPatientAssessment.cpp index 44c7842d5..b601dd7dd 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/assessments/SEPatientAssessment.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/assessments/SEPatientAssessment.cpp @@ -12,6 +12,7 @@ specific language governing permissions and limitations under the License. #include #include +#include "io/cdm/PatientAssessments.h" namespace biogears { SEPatientAssessment::SEPatientAssessment() @@ -20,10 +21,10 @@ SEPatientAssessment::SEPatientAssessment() SEPatientAssessment::~SEPatientAssessment() { - Clear(); + Invalidate(); } -void SEPatientAssessment::Clear() +void SEPatientAssessment::Invalidate() { } @@ -31,19 +32,4 @@ void SEPatientAssessment::Reset() { } -bool SEPatientAssessment::Load(const CDM::PatientAssessmentData& in) -{ - return true; -} - -CDM::PatientAssessmentData* SEPatientAssessment::Unload() -{ - CDM::PatientAssessmentData* data = new CDM::PatientAssessmentData(); - Unload(*data); - return data; -} - -void SEPatientAssessment::Unload(CDM::PatientAssessmentData& data) -{ -} } \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/cdm/patient/assessments/SEProthrombinTime.cpp b/projects/biogears/libBiogears/src/cdm/patient/assessments/SEProthrombinTime.cpp index c583f21f7..df7a8d866 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/assessments/SEProthrombinTime.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/assessments/SEProthrombinTime.cpp @@ -14,6 +14,7 @@ specific language governing permissions and limitations under the License. #include #include +#include "io/cdm/PatientAssessments.h" namespace biogears { SEProthrombinTime::SEProthrombinTime() @@ -23,12 +24,12 @@ SEProthrombinTime::SEProthrombinTime() //------------------------------------------------------------------------------- SEProthrombinTime::~SEProthrombinTime() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEProthrombinTime::Clear() +void SEProthrombinTime::Invalidate() { - SEPatientAssessment::Clear(); + SEPatientAssessment::Invalidate(); SAFE_DELETE(m_InternationalNormalizedRatio); } //------------------------------------------------------------------------------- @@ -38,29 +39,6 @@ void SEProthrombinTime::Reset() INVALIDATE_PROPERTY(m_InternationalNormalizedRatio); } //------------------------------------------------------------------------------- -bool SEProthrombinTime::Load(const CDM::ProthrombinTimeData& in) -{ - SEPatientAssessment::Load(in); - if (in.InternationalNormalizedRatio().present()) { - GetInternationalNormalizedRatio().Load(in.InternationalNormalizedRatio().get()); - } - return true; -} -//------------------------------------------------------------------------------- -CDM::ProthrombinTimeData* SEProthrombinTime::Unload() -{ - CDM::ProthrombinTimeData* data = new CDM::ProthrombinTimeData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEProthrombinTime::Unload(CDM::ProthrombinTimeData& data) -{ - SEPatientAssessment::Unload(data); - if (m_InternationalNormalizedRatio != nullptr) - data.InternationalNormalizedRatio(std::unique_ptr(m_InternationalNormalizedRatio->Unload())); -} -//------------------------------------------------------------------------------- bool SEProthrombinTime::HasInternationalNormalizedRatio() { return m_InternationalNormalizedRatio == nullptr ? false : m_InternationalNormalizedRatio->IsValid(); diff --git a/projects/biogears/libBiogears/src/cdm/patient/assessments/SEPsychomotorVigilanceTask.cpp b/projects/biogears/libBiogears/src/cdm/patient/assessments/SEPsychomotorVigilanceTask.cpp index 5388306e7..c132cd482 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/assessments/SEPsychomotorVigilanceTask.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/assessments/SEPsychomotorVigilanceTask.cpp @@ -14,6 +14,7 @@ specific language governing permissions and limitations under the License. #include #include #include +#include "io/cdm/PatientAssessments.h" namespace biogears { SEPsychomotorVigilanceTask::SEPsychomotorVigilanceTask() @@ -24,12 +25,12 @@ SEPsychomotorVigilanceTask::SEPsychomotorVigilanceTask() //------------------------------------------------------------------------------- SEPsychomotorVigilanceTask::~SEPsychomotorVigilanceTask() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEPsychomotorVigilanceTask::Clear() +void SEPsychomotorVigilanceTask::Invalidate() { - SEPatientAssessment::Clear(); + SEPatientAssessment::Invalidate(); SAFE_DELETE(m_AttentionLapses); SAFE_DELETE(m_ReactionTime); } @@ -40,34 +41,7 @@ void SEPsychomotorVigilanceTask::Reset() INVALIDATE_PROPERTY(m_AttentionLapses); INVALIDATE_PROPERTY(m_ReactionTime); } -//------------------------------------------------------------------------------- -bool SEPsychomotorVigilanceTask::Load(const CDM::PsychomotorVigilanceTaskData& in) -{ - SEPatientAssessment::Load(in); - if (in.AttentionLapses().present()) { - GetAttentionLapses().Load(in.AttentionLapses().get()); - } - if (in.ReactionTime().present()) { - GetReactionTime().Load(in.ReactionTime().get()); - } - return true; -} -//------------------------------------------------------------------------------- -CDM::PsychomotorVigilanceTaskData* SEPsychomotorVigilanceTask::Unload() -{ - CDM::PsychomotorVigilanceTaskData* data = new CDM::PsychomotorVigilanceTaskData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEPsychomotorVigilanceTask::Unload(CDM::PsychomotorVigilanceTaskData& data) -{ - SEPatientAssessment::Unload(data); - if (HasAttentionLapses()) - data.AttentionLapses(std::unique_ptr(m_AttentionLapses->Unload())); - if (HasReactionTime()) - data.ReactionTime(std::unique_ptr(m_ReactionTime->Unload())); -} + //------------------------------------------------------------------------------- bool SEPsychomotorVigilanceTask::HasAttentionLapses() { diff --git a/projects/biogears/libBiogears/src/cdm/patient/assessments/SEPulmonaryFunctionTest.cpp b/projects/biogears/libBiogears/src/cdm/patient/assessments/SEPulmonaryFunctionTest.cpp index d561e524b..d45b58459 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/assessments/SEPulmonaryFunctionTest.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/assessments/SEPulmonaryFunctionTest.cpp @@ -17,6 +17,7 @@ specific language governing permissions and limitations under the License. #include #include #include +#include "io/cdm/PatientAssessments.h" namespace biogears { SEPulmonaryFunctionTest::SEPulmonaryFunctionTest() @@ -41,12 +42,12 @@ SEPulmonaryFunctionTest::SEPulmonaryFunctionTest() //------------------------------------------------------------------------------- SEPulmonaryFunctionTest::~SEPulmonaryFunctionTest() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEPulmonaryFunctionTest::Clear() +void SEPulmonaryFunctionTest::Invalidate() { - SEPatientAssessment::Clear(); + SEPatientAssessment::Invalidate(); SAFE_DELETE(m_ExpiratoryReserveVolume); SAFE_DELETE(m_ForcedVitalCapacity); SAFE_DELETE(m_ForcedExpiratoryVolume); @@ -83,53 +84,7 @@ void SEPulmonaryFunctionTest::Reset() INVALIDATE_PROPERTY(m_LungVolumePlot); } -//------------------------------------------------------------------------------- -bool SEPulmonaryFunctionTest::Load(const CDM::PulmonaryFunctionTestData& in) -{ - SEPatientAssessment::Load(in); - // TODO - return true; -} -//------------------------------------------------------------------------------- -CDM::PulmonaryFunctionTestData* SEPulmonaryFunctionTest::Unload() -{ - CDM::PulmonaryFunctionTestData* data = new CDM::PulmonaryFunctionTestData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEPulmonaryFunctionTest::Unload(CDM::PulmonaryFunctionTestData& data) -{ - SEPatientAssessment::Unload(data); - if (m_ExpiratoryReserveVolume != nullptr) - data.ExpiratoryReserveVolume(std::unique_ptr(m_ExpiratoryReserveVolume->Unload())); - if (m_ForcedVitalCapacity != nullptr) - data.ForcedVitalCapacity(std::unique_ptr(m_ForcedVitalCapacity->Unload())); - if (m_ForcedExpiratoryVolume != nullptr) - data.ForcedExpiratoryVolume(std::unique_ptr(m_ForcedExpiratoryVolume->Unload())); - if (m_ForcedExpiratoryFlow != nullptr) - data.ForcedExpiratoryFlow(std::unique_ptr(m_ForcedExpiratoryFlow->Unload())); - if (m_FunctionalResidualCapacity != nullptr) - data.FunctionalResidualCapacity(std::unique_ptr(m_FunctionalResidualCapacity->Unload())); - if (m_InspiratoryCapacity != nullptr) - data.InspiratoryCapacity(std::unique_ptr(m_InspiratoryCapacity->Unload())); - if (m_InspiratoryReserveVolume != nullptr) - data.InspiratoryReserveVolume(std::unique_ptr(m_InspiratoryReserveVolume->Unload())); - if (m_MaximumVoluntaryVentilation != nullptr) - data.MaximumVoluntaryVentilation(std::unique_ptr(m_MaximumVoluntaryVentilation->Unload())); - if (m_PeakExpiratoryFlow != nullptr) - data.PeakExpiratoryFlow(std::unique_ptr(m_PeakExpiratoryFlow->Unload())); - if (m_ResidualVolume != nullptr) - data.ResidualVolume(std::unique_ptr(m_ResidualVolume->Unload())); - if (m_SlowVitalCapacity != nullptr) - data.SlowVitalCapacity(std::unique_ptr(m_SlowVitalCapacity->Unload())); - if (m_TotalLungCapacity != nullptr) - data.TotalLungCapacity(std::unique_ptr(m_TotalLungCapacity->Unload())); - if (m_VitalCapacity != nullptr) - data.VitalCapacity(std::unique_ptr(m_VitalCapacity->Unload())); - if (m_LungVolumePlot != nullptr) - data.LungVolumePlot(std::unique_ptr(m_LungVolumePlot->Unload())); -} + //------------------------------------------------------------------------------- bool SEPulmonaryFunctionTest::HasExpiratoryReserveVolume() { diff --git a/projects/biogears/libBiogears/src/cdm/patient/assessments/SESequentialOrganFailureAssessment.cpp b/projects/biogears/libBiogears/src/cdm/patient/assessments/SESequentialOrganFailureAssessment.cpp index 4f24ed951..02a1d4431 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/assessments/SESequentialOrganFailureAssessment.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/assessments/SESequentialOrganFailureAssessment.cpp @@ -17,6 +17,7 @@ specific language governing permissions and limitations under the License. #include #include #include +#include "io/cdm/PatientAssessments.h" namespace biogears { SESequentialOrganFailureAssessment::SESequentialOrganFailureAssessment() @@ -31,12 +32,12 @@ SESequentialOrganFailureAssessment::SESequentialOrganFailureAssessment() //------------------------------------------------------------------------------- SESequentialOrganFailureAssessment::~SESequentialOrganFailureAssessment() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SESequentialOrganFailureAssessment::Clear() +void SESequentialOrganFailureAssessment::Invalidate() { - SEPatientAssessment::Clear(); + SEPatientAssessment::Invalidate(); SAFE_DELETE(m_RespirationSOFA); SAFE_DELETE(m_CoagulationSOFA); SAFE_DELETE(m_LiverSOFA); @@ -55,42 +56,7 @@ void SESequentialOrganFailureAssessment::Reset() INVALIDATE_PROPERTY(m_CentralNervousSOFA); INVALIDATE_PROPERTY(m_RenalSOFA); } -//------------------------------------------------------------------------------- -bool SESequentialOrganFailureAssessment::Load(const CDM::SequentialOrganFailureAssessmentData& in) -{ - SEPatientAssessment::Load(in); - GetRespirationSOFA().Load(in.RespirationSOFA()); - GetCoagulationSOFA().Load(in.CoagulationSOFA()); - GetLiverSOFA().Load(in.LiverSOFA()); - GetCardiovascularSOFA().Load(in.CardiovascularSOFA()); - GetCentralNervousSOFA().Load(in.CentralNervousSOFA()); - GetRenalSOFA().Load(in.RenalSOFA()); - return true; -} -//------------------------------------------------------------------------------- -CDM::SequentialOrganFailureAssessmentData* SESequentialOrganFailureAssessment::Unload() -{ - CDM::SequentialOrganFailureAssessmentData* data = new CDM::SequentialOrganFailureAssessmentData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SESequentialOrganFailureAssessment::Unload(CDM::SequentialOrganFailureAssessmentData& data) -{ - SEPatientAssessment::Unload(data); - if (HasRespirationSOFA()) - data.RespirationSOFA(std::unique_ptr(m_RespirationSOFA->Unload())); - if (HasCoagulationSOFA()) - data.CoagulationSOFA(std::unique_ptr(m_CoagulationSOFA->Unload())); - if (HasLiverSOFA()) - data.LiverSOFA(std::unique_ptr(m_LiverSOFA->Unload())); - if (HasCardiovascularSOFA()) - data.CardiovascularSOFA(std::unique_ptr(m_CardiovascularSOFA->Unload())); - if (HasCentralNervousSOFA()) - data.CentralNervousSOFA(std::unique_ptr(m_CentralNervousSOFA->Unload())); - if (HasRenalSOFA()) - data.RenalSOFA(std::unique_ptr(m_RenalSOFA->Unload())); -} + //------------------------------------------------------------------------------- bool SESequentialOrganFailureAssessment::HasRespirationSOFA() { diff --git a/projects/biogears/libBiogears/src/cdm/patient/assessments/SEUrinalysis.cpp b/projects/biogears/libBiogears/src/cdm/patient/assessments/SEUrinalysis.cpp index b3e495daf..2f3a8925d 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/assessments/SEUrinalysis.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/assessments/SEUrinalysis.cpp @@ -14,46 +14,49 @@ specific language governing permissions and limitations under the License. #include #include #include +#include +#include +#include "io/cdm/PatientAssessments.h" namespace biogears { SEUrinalysis::SEUrinalysis() { - m_Color = CDM::enumUrineColor::value(-1); - m_Appearance = CDM::enumClarityIndicator::value(-1); - m_Glucose = CDM::enumPresenceIndicator::value(-1); - m_Ketone = CDM::enumPresenceIndicator::value(-1); + m_Color = SEUrineColor::Invalid; + m_Appearance = SEClarityIndicator::Invalid; + m_Glucose = SEPresenceIndicator::Invalid; + m_Ketone = SEPresenceIndicator::Invalid; m_Bilirubin = nullptr; m_SpecificGravity = nullptr; - m_Blood = CDM::enumPresenceIndicator::value(-1); + m_Blood = SEPresenceIndicator::Invalid; m_pH = nullptr; - m_Protein = CDM::enumPresenceIndicator::value(-1); + m_Protein = SEPresenceIndicator::Invalid; m_Urobilinogen = nullptr; - m_Nitrite = CDM::enumPresenceIndicator::value(-1); - m_LeukocyteEsterase = CDM::enumPresenceIndicator::value(-1); + m_Nitrite = SEPresenceIndicator::Invalid; + m_LeukocyteEsterase = SEPresenceIndicator::Invalid; m_Microscopic = nullptr; } //------------------------------------------------------------------------------- SEUrinalysis::~SEUrinalysis() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEUrinalysis::Clear() +void SEUrinalysis::Invalidate() { - SEPatientAssessment::Clear(); - m_Color = CDM::enumUrineColor::value(-1); - m_Appearance = CDM::enumClarityIndicator::value(-1); - m_Glucose = CDM::enumPresenceIndicator::value(-1); - m_Ketone = CDM::enumPresenceIndicator::value(-1); + SEPatientAssessment::Invalidate(); + m_Color = SEUrineColor::Invalid; + m_Appearance = SEClarityIndicator::Invalid; + m_Glucose = SEPresenceIndicator::Invalid; + m_Ketone = SEPresenceIndicator::Invalid; SAFE_DELETE(m_Bilirubin); SAFE_DELETE(m_SpecificGravity); - m_Blood = CDM::enumPresenceIndicator::value(-1); + m_Blood = SEPresenceIndicator::Invalid; SAFE_DELETE(m_pH); - m_Protein = CDM::enumPresenceIndicator::value(-1); + m_Protein = SEPresenceIndicator::Invalid; SAFE_DELETE(m_Urobilinogen); - m_Nitrite = CDM::enumPresenceIndicator::value(-1); - m_LeukocyteEsterase = CDM::enumPresenceIndicator::value(-1); + m_Nitrite = SEPresenceIndicator::Invalid; + m_LeukocyteEsterase = SEPresenceIndicator::Invalid; SAFE_DELETE(m_Microscopic); } @@ -61,133 +64,89 @@ void SEUrinalysis::Clear() void SEUrinalysis::Reset() { SEPatientAssessment::Reset(); - m_Color = CDM::enumUrineColor::value(-1); - m_Appearance = CDM::enumClarityIndicator::value(-1); - m_Glucose = CDM::enumPresenceIndicator::value(-1); - m_Ketone = CDM::enumPresenceIndicator::value(-1); + m_Color = SEUrineColor::Invalid; + m_Appearance = SEClarityIndicator::Invalid; + m_Glucose = SEPresenceIndicator::Invalid; + m_Ketone = SEPresenceIndicator::Invalid; INVALIDATE_PROPERTY(m_Bilirubin); INVALIDATE_PROPERTY(m_SpecificGravity); - m_Blood = CDM::enumPresenceIndicator::value(-1); + m_Blood = SEPresenceIndicator::Invalid; INVALIDATE_PROPERTY(m_pH); - m_Protein = CDM::enumPresenceIndicator::value(-1); + m_Protein = SEPresenceIndicator::Invalid; INVALIDATE_PROPERTY(m_Urobilinogen); - m_Nitrite = CDM::enumPresenceIndicator::value(-1); - m_LeukocyteEsterase = CDM::enumPresenceIndicator::value(-1); + m_Nitrite = SEPresenceIndicator::Invalid; + m_LeukocyteEsterase = SEPresenceIndicator::Invalid; SAFE_DELETE(m_Microscopic); } -//------------------------------------------------------------------------------- -bool SEUrinalysis::Load(const CDM::UrinalysisData& in) -{ - SEPatientAssessment::Load(in); - return true; -} -//------------------------------------------------------------------------------- -CDM::UrinalysisData* SEUrinalysis::Unload() -{ - CDM::UrinalysisData* data = new CDM::UrinalysisData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEUrinalysis::Unload(CDM::UrinalysisData& data) -{ - SEPatientAssessment::Unload(data); - if (HasColorResult()) - data.Color(m_Color); - if (HasAppearanceResult()) - data.Appearance(m_Appearance); - if (HasGlucoseResult()) - data.Glucose(m_Glucose); - if (HasKetoneResult()) - data.Ketone(m_Ketone); - if (HasBilirubinResult()) - data.Bilirubin(std::unique_ptr(m_Bilirubin->Unload())); - if (HasSpecificGravityResult()) - data.SpecificGravity(std::unique_ptr(m_SpecificGravity->Unload())); - if (HasBloodResult()) - data.Blood(m_Blood); - if (HasPHResult()) - data.pH(std::unique_ptr(m_pH->Unload())); - if (HasProteinResult()) - data.Protein(m_Protein); - if (HasUrobilinogenResult()) - data.Urobilinogen(std::unique_ptr(m_Urobilinogen->Unload())); - if (HasNitriteResult()) - data.Nitrite(m_Nitrite); - if (HasLeukocyteEsteraseResult()) - data.LeukocyteEsterase(m_LeukocyteEsterase); - if (HasMicroscopicResult()) - data.Microscopic(std::unique_ptr(m_Microscopic->Unload())); -} //------------------------------------------------------------------------------- bool SEUrinalysis::HasColorResult() const { - return m_Color != CDM::enumUrineColor::value(-1); + return m_Color != SEUrineColor::Invalid; } -CDM::enumUrineColor::value SEUrinalysis::GetColorResult() const +SEUrineColor SEUrinalysis::GetColorResult() const { return m_Color; } -void SEUrinalysis::SetColorResult(CDM::enumUrineColor::value color) +void SEUrinalysis::SetColorResult(SEUrineColor color) { m_Color = color; } void SEUrinalysis::InvalidateColorResult() { - m_Color = CDM::enumUrineColor::value(-1); + m_Color = SEUrineColor::Invalid; } //------------------------------------------------------------------------------- bool SEUrinalysis::HasAppearanceResult() const { - return m_Appearance != CDM::enumClarityIndicator::value(-1); + return m_Appearance != SEClarityIndicator::Invalid; } -CDM::enumClarityIndicator::value SEUrinalysis::GetAppearanceResult() const +SEClarityIndicator SEUrinalysis::GetAppearanceResult() const { return m_Appearance; } -void SEUrinalysis::SetAppearanceResult(CDM::enumClarityIndicator::value c) +void SEUrinalysis::SetAppearanceResult(SEClarityIndicator c) { m_Appearance = c; } void SEUrinalysis::InvalidateAppearanceResult() { - m_Appearance = CDM::enumClarityIndicator::value(-1); + m_Appearance = SEClarityIndicator::Invalid; } //------------------------------------------------------------------------------- bool SEUrinalysis::HasGlucoseResult() const { - return m_Glucose != CDM::enumPresenceIndicator::value(-1); + return m_Glucose != SEPresenceIndicator::Invalid; } -CDM::enumPresenceIndicator::value SEUrinalysis::GetGlucoseResult() const +SEPresenceIndicator SEUrinalysis::GetGlucoseResult() const { return m_Glucose; } -void SEUrinalysis::SetGlucoseResult(CDM::enumPresenceIndicator::value p) +void SEUrinalysis::SetGlucoseResult(SEPresenceIndicator p) { m_Glucose = p; } void SEUrinalysis::InvalidateGlucoseResult() { - m_Glucose = CDM::enumPresenceIndicator::value(-1); + m_Glucose = SEPresenceIndicator::Invalid; } //------------------------------------------------------------------------------- bool SEUrinalysis::HasKetoneResult() const { - return m_Ketone != CDM::enumPresenceIndicator::value(-1); + return m_Ketone != SEPresenceIndicator::Invalid; } -CDM::enumPresenceIndicator::value SEUrinalysis::GetKetoneResult() const +SEPresenceIndicator SEUrinalysis::GetKetoneResult() const { return m_Ketone; } -void SEUrinalysis::SetKetoneResult(CDM::enumPresenceIndicator::value p) +void SEUrinalysis::SetKetoneResult(SEPresenceIndicator p) { m_Ketone = p; } void SEUrinalysis::InvalidateKetoneResult() { - m_Ketone = CDM::enumPresenceIndicator::value(-1); + m_Ketone = SEPresenceIndicator::Invalid; } //------------------------------------------------------------------------------- bool SEUrinalysis::HasBilirubinResult() const @@ -214,19 +173,19 @@ SEScalar& SEUrinalysis::GetSpecificGravityResult() //------------------------------------------------------------------------------- bool SEUrinalysis::HasBloodResult() const { - return m_Blood != CDM::enumPresenceIndicator::value(-1); + return m_Blood != SEPresenceIndicator::Invalid; } -CDM::enumPresenceIndicator::value SEUrinalysis::GetBloodResult() const +SEPresenceIndicator SEUrinalysis::GetBloodResult() const { return m_Blood; } -void SEUrinalysis::SetBloodResult(CDM::enumPresenceIndicator::value p) +void SEUrinalysis::SetBloodResult(SEPresenceIndicator p) { m_Blood = p; } void SEUrinalysis::InvalidateBloodResult() { - m_Blood = CDM::enumPresenceIndicator::value(-1); + m_Blood = SEPresenceIndicator::Invalid; } //------------------------------------------------------------------------------- bool SEUrinalysis::HasPHResult() const @@ -242,19 +201,19 @@ SEScalar& SEUrinalysis::GetPHResult() //------------------------------------------------------------------------------- bool SEUrinalysis::HasProteinResult() const { - return m_Protein != CDM::enumPresenceIndicator::value(-1); + return m_Protein != SEPresenceIndicator::Invalid; } -CDM::enumPresenceIndicator::value SEUrinalysis::GetProteinResult() const +SEPresenceIndicator SEUrinalysis::GetProteinResult() const { return m_Protein; } -void SEUrinalysis::SetProteinResult(CDM::enumPresenceIndicator::value p) +void SEUrinalysis::SetProteinResult(SEPresenceIndicator p) { m_Protein = p; } void SEUrinalysis::InvalidateProteinResult() { - m_Protein = CDM::enumPresenceIndicator::value(-1); + m_Protein = SEPresenceIndicator::Invalid; } //------------------------------------------------------------------------------- bool SEUrinalysis::HasUrobilinogenResult() const @@ -270,36 +229,36 @@ SEScalarMassPerVolume& SEUrinalysis::GetUrobilinogenResult() //------------------------------------------------------------------------------- bool SEUrinalysis::HasNitriteResult() const { - return m_Nitrite != CDM::enumPresenceIndicator::value(-1); + return m_Nitrite != SEPresenceIndicator::Invalid; } -CDM::enumPresenceIndicator::value SEUrinalysis::GetNitriteResult() const +SEPresenceIndicator SEUrinalysis::GetNitriteResult() const { return m_Nitrite; } -void SEUrinalysis::SetNitriteResult(CDM::enumPresenceIndicator::value p) +void SEUrinalysis::SetNitriteResult(SEPresenceIndicator p) { m_Nitrite = p; } void SEUrinalysis::InvalidateNitriteResult() { - m_Nitrite = CDM::enumPresenceIndicator::value(-1); + m_Nitrite = SEPresenceIndicator::Invalid; } //------------------------------------------------------------------------------- bool SEUrinalysis::HasLeukocyteEsteraseResult() const { - return m_LeukocyteEsterase != CDM::enumPresenceIndicator::value(-1); + return m_LeukocyteEsterase != SEPresenceIndicator::Invalid; } -CDM::enumPresenceIndicator::value SEUrinalysis::GetLeukocyteEsteraseResult() const +SEPresenceIndicator SEUrinalysis::GetLeukocyteEsteraseResult() const { return m_LeukocyteEsterase; } -void SEUrinalysis::SetLeukocyteEsteraseResult(CDM::enumPresenceIndicator::value p) +void SEUrinalysis::SetLeukocyteEsteraseResult(SEPresenceIndicator p) { m_LeukocyteEsterase = p; } void SEUrinalysis::InvalidateLeukocyteEsteraseResult() { - m_LeukocyteEsterase = CDM::enumPresenceIndicator::value(-1); + m_LeukocyteEsterase = SEPresenceIndicator::Invalid; } //------------------------------------------------------------------------------- bool SEUrinalysis::HasMicroscopicResult() const diff --git a/projects/biogears/libBiogears/src/cdm/patient/assessments/SEUrinalysisMicroscopic.cpp b/projects/biogears/libBiogears/src/cdm/patient/assessments/SEUrinalysisMicroscopic.cpp index 050736eab..891f243bc 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/assessments/SEUrinalysisMicroscopic.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/assessments/SEUrinalysisMicroscopic.cpp @@ -12,89 +12,56 @@ specific language governing permissions and limitations under the License. #include #include +#include "io/cdm/PatientAssessments.h" namespace biogears { SEUrinalysisMicroscopic::SEUrinalysisMicroscopic() { - m_ObservationType = CDM::enumMicroscopicObservationType::value(-1); + m_ObservationType = SEMicroscopicObservationType::Invalid; m_RedBloodCells = nullptr; m_WhiteBloodCells = nullptr; - m_EpithelialCells = CDM::enumMicroscopicObservationAmount::value(-1); + m_EpithelialCells = SEMicroscopicObservationAmount::Invalid; m_Casts = nullptr; - m_Crystals = CDM::enumMicroscopicObservationAmount::value(-1); - m_Bacteria = CDM::enumMicroscopicObservationAmount::value(-1); - m_Trichomonads = CDM::enumMicroscopicObservationAmount::value(-1); - m_Yeast = CDM::enumMicroscopicObservationAmount::value(-1); + m_Crystals = SEMicroscopicObservationAmount::Invalid; + m_Bacteria = SEMicroscopicObservationAmount::Invalid; + m_Trichomonads = SEMicroscopicObservationAmount::Invalid; + m_Yeast = SEMicroscopicObservationAmount::Invalid; } //------------------------------------------------------------------------------- SEUrinalysisMicroscopic::~SEUrinalysisMicroscopic() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEUrinalysisMicroscopic::Clear() +void SEUrinalysisMicroscopic::Invalidate() { - SEPatientAssessment::Clear(); - m_ObservationType = CDM::enumMicroscopicObservationType::value(-1); + SEPatientAssessment::Invalidate(); + m_ObservationType = SEMicroscopicObservationType::Invalid; SAFE_DELETE(m_RedBloodCells); SAFE_DELETE(m_WhiteBloodCells); - m_EpithelialCells = CDM::enumMicroscopicObservationAmount::value(-1); + m_EpithelialCells = SEMicroscopicObservationAmount::Invalid; SAFE_DELETE(m_Casts); - m_Crystals = CDM::enumMicroscopicObservationAmount::value(-1); - m_Bacteria = CDM::enumMicroscopicObservationAmount::value(-1); - m_Trichomonads = CDM::enumMicroscopicObservationAmount::value(-1); - m_Yeast = CDM::enumMicroscopicObservationAmount::value(-1); + m_Crystals = SEMicroscopicObservationAmount::Invalid; + m_Bacteria = SEMicroscopicObservationAmount::Invalid; + m_Trichomonads = SEMicroscopicObservationAmount::Invalid; + m_Yeast = SEMicroscopicObservationAmount::Invalid; } //------------------------------------------------------------------------------- void SEUrinalysisMicroscopic::Reset() { SEPatientAssessment::Reset(); - m_ObservationType = CDM::enumMicroscopicObservationType::value(-1); + m_ObservationType = SEMicroscopicObservationType::Invalid; INVALIDATE_PROPERTY(m_RedBloodCells); INVALIDATE_PROPERTY(m_WhiteBloodCells); - m_EpithelialCells = CDM::enumMicroscopicObservationAmount::value(-1); + m_EpithelialCells = SEMicroscopicObservationAmount::Invalid; INVALIDATE_PROPERTY(m_Casts); - m_Crystals = CDM::enumMicroscopicObservationAmount::value(-1); - m_Bacteria = CDM::enumMicroscopicObservationAmount::value(-1); - m_Trichomonads = CDM::enumMicroscopicObservationAmount::value(-1); - m_Yeast = CDM::enumMicroscopicObservationAmount::value(-1); -} -//------------------------------------------------------------------------------- -bool SEUrinalysisMicroscopic::Load(const CDM::UrinalysisMicroscopicData& in) -{ - SEPatientAssessment::Load(in); - return true; -} -//------------------------------------------------------------------------------- -CDM::UrinalysisMicroscopicData* SEUrinalysisMicroscopic::Unload() -{ - CDM::UrinalysisMicroscopicData* data = new CDM::UrinalysisMicroscopicData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEUrinalysisMicroscopic::Unload(CDM::UrinalysisMicroscopicData& data) -{ - if (HasObservationType()) - data.ObservationType(m_ObservationType); - if (HasRedBloodCellsResult()) - data.RedBloodCells(std::unique_ptr(m_RedBloodCells->Unload())); - if (HasWhiteBloodCellsResult()) - data.WhiteBloodCells(std::unique_ptr(m_WhiteBloodCells->Unload())); - if (HasEpithelialCellsResult()) - data.EpithelialCells(m_EpithelialCells); - if (HasCastsResult()) - data.Casts(std::unique_ptr(m_Casts->Unload())); - if (HasCrystalsResult()) - data.Crystals(m_Crystals); - if (HasBacteriaResult()) - data.Bacteria(m_Bacteria); - if (HasTrichomonadsResult()) - data.Trichomonads(m_Trichomonads); - if (HasYeastResult()) - data.Yeast(m_Yeast); + m_Crystals = SEMicroscopicObservationAmount::Invalid; + m_Bacteria = SEMicroscopicObservationAmount::Invalid; + m_Trichomonads = SEMicroscopicObservationAmount::Invalid; + m_Yeast = SEMicroscopicObservationAmount::Invalid; } + //------------------------------------------------------------------------------- bool SEUrinalysisMicroscopic::HasRedBloodCellsResult() const { @@ -109,19 +76,19 @@ SEScalarAmount& SEUrinalysisMicroscopic::GetRedBloodCellsResult() //------------------------------------------------------------------------------- bool SEUrinalysisMicroscopic::HasObservationType() const { - return m_ObservationType != CDM::enumMicroscopicObservationType::value(-1); + return m_ObservationType != SEMicroscopicObservationType::Invalid; } -CDM::enumMicroscopicObservationType::value SEUrinalysisMicroscopic::GetObservationType() const +SEMicroscopicObservationType SEUrinalysisMicroscopic::GetObservationType() const { return m_ObservationType; } -void SEUrinalysisMicroscopic::SetObservationType(CDM::enumMicroscopicObservationType::value c) +void SEUrinalysisMicroscopic::SetObservationType(SEMicroscopicObservationType c) { m_ObservationType = c; } void SEUrinalysisMicroscopic::InvalidateObservationType() { - m_ObservationType = CDM::enumMicroscopicObservationType::value(-1); + m_ObservationType = SEMicroscopicObservationType::Invalid; } //------------------------------------------------------------------------------- bool SEUrinalysisMicroscopic::HasWhiteBloodCellsResult() const @@ -137,19 +104,19 @@ SEScalarAmount& SEUrinalysisMicroscopic::GetWhiteBloodCellsResult() //------------------------------------------------------------------------------- bool SEUrinalysisMicroscopic::HasEpithelialCellsResult() const { - return m_EpithelialCells != CDM::enumMicroscopicObservationAmount::value(-1); + return m_EpithelialCells != SEMicroscopicObservationAmount::Invalid; } -CDM::enumMicroscopicObservationAmount::value SEUrinalysisMicroscopic::GetEpithelialCellsResult() const +SEMicroscopicObservationAmount SEUrinalysisMicroscopic::GetEpithelialCellsResult() const { return m_EpithelialCells; } -void SEUrinalysisMicroscopic::SetEpithelialCellsResult(CDM::enumMicroscopicObservationAmount::value c) +void SEUrinalysisMicroscopic::SetEpithelialCellsResult(SEMicroscopicObservationAmount c) { m_EpithelialCells = c; } void SEUrinalysisMicroscopic::InvalidateEpithelialCellsResult() { - m_EpithelialCells = CDM::enumMicroscopicObservationAmount::value(-1); + m_EpithelialCells = SEMicroscopicObservationAmount::Invalid; } //------------------------------------------------------------------------------- bool SEUrinalysisMicroscopic::HasCastsResult() const @@ -165,70 +132,70 @@ SEScalarAmount& SEUrinalysisMicroscopic::GetCastsResult() //------------------------------------------------------------------------------- bool SEUrinalysisMicroscopic::HasCrystalsResult() const { - return m_Crystals != CDM::enumMicroscopicObservationAmount::value(-1); + return m_Crystals != SEMicroscopicObservationAmount::Invalid; } -CDM::enumMicroscopicObservationAmount::value SEUrinalysisMicroscopic::GetCrystalsResult() const +SEMicroscopicObservationAmount SEUrinalysisMicroscopic::GetCrystalsResult() const { return m_Crystals; } -void SEUrinalysisMicroscopic::SetCrystalsResult(CDM::enumMicroscopicObservationAmount::value c) +void SEUrinalysisMicroscopic::SetCrystalsResult(SEMicroscopicObservationAmount c) { m_Crystals = c; } void SEUrinalysisMicroscopic::InvalidateCrystalsResult() { - m_Crystals = CDM::enumMicroscopicObservationAmount::value(-1); + m_Crystals = SEMicroscopicObservationAmount::Invalid; } //------------------------------------------------------------------------------- bool SEUrinalysisMicroscopic::HasBacteriaResult() const { - return m_Bacteria != CDM::enumMicroscopicObservationAmount::value(-1); + return m_Bacteria != SEMicroscopicObservationAmount::Invalid; } -CDM::enumMicroscopicObservationAmount::value SEUrinalysisMicroscopic::GetBacteriaResult() const +SEMicroscopicObservationAmount SEUrinalysisMicroscopic::GetBacteriaResult() const { return m_Bacteria; } -void SEUrinalysisMicroscopic::SetBacteriaResult(CDM::enumMicroscopicObservationAmount::value c) +void SEUrinalysisMicroscopic::SetBacteriaResult(SEMicroscopicObservationAmount c) { m_Bacteria = c; } void SEUrinalysisMicroscopic::InvalidateBacteriaResult() { - m_Bacteria = CDM::enumMicroscopicObservationAmount::value(-1); + m_Bacteria = SEMicroscopicObservationAmount::Invalid; } //------------------------------------------------------------------------------- bool SEUrinalysisMicroscopic::HasTrichomonadsResult() const { - return m_Trichomonads != CDM::enumMicroscopicObservationAmount::value(-1); + return m_Trichomonads != SEMicroscopicObservationAmount::Invalid; } -CDM::enumMicroscopicObservationAmount::value SEUrinalysisMicroscopic::GetTrichomonadsResult() const +SEMicroscopicObservationAmount SEUrinalysisMicroscopic::GetTrichomonadsResult() const { return m_Trichomonads; } -void SEUrinalysisMicroscopic::SetTrichomonadsResult(CDM::enumMicroscopicObservationAmount::value c) +void SEUrinalysisMicroscopic::SetTrichomonadsResult(SEMicroscopicObservationAmount c) { m_Trichomonads = c; } void SEUrinalysisMicroscopic::InvalidateTrichomonadsResult() { - m_Trichomonads = CDM::enumMicroscopicObservationAmount::value(-1); + m_Trichomonads = SEMicroscopicObservationAmount::Invalid; } //------------------------------------------------------------------------------- bool SEUrinalysisMicroscopic::HasYeastResult() const { - return m_Yeast != CDM::enumMicroscopicObservationAmount::value(-1); + return m_Yeast != SEMicroscopicObservationAmount::Invalid; } -CDM::enumMicroscopicObservationAmount::value SEUrinalysisMicroscopic::GetYeastResult() const +SEMicroscopicObservationAmount SEUrinalysisMicroscopic::GetYeastResult() const { return m_Yeast; } -void SEUrinalysisMicroscopic::SetYeastResult(CDM::enumMicroscopicObservationAmount::value c) +void SEUrinalysisMicroscopic::SetYeastResult(SEMicroscopicObservationAmount c) { m_Yeast = c; } void SEUrinalysisMicroscopic::InvalidateYeastResult() { - m_Yeast = CDM::enumMicroscopicObservationAmount::value(-1); + m_Yeast = SEMicroscopicObservationAmount::Invalid; } //------------------------------------------------------------------------------- bool SEUrinalysisMicroscopic::operator==(SEUrinalysisMicroscopic const& rhs) const diff --git a/projects/biogears/libBiogears/src/cdm/patient/conditions/SEChronicAnemia.cpp b/projects/biogears/libBiogears/src/cdm/patient/conditions/SEChronicAnemia.cpp index 6cdfcc375..acfc7aad6 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/conditions/SEChronicAnemia.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/conditions/SEChronicAnemia.cpp @@ -12,6 +12,7 @@ specific language governing permissions and limitations under the License. #include #include +#include "io/cdm/PatientConditions.h" namespace biogears { SEChronicAnemia::SEChronicAnemia() @@ -22,12 +23,12 @@ SEChronicAnemia::SEChronicAnemia() //------------------------------------------------------------------------------- SEChronicAnemia::~SEChronicAnemia() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEChronicAnemia::Clear() +void SEChronicAnemia::Invalidate() { - SEPatientCondition::Clear(); + SEPatientCondition::Invalidate(); SAFE_DELETE(m_ReductionFactor); } //------------------------------------------------------------------------------- @@ -36,27 +37,6 @@ bool SEChronicAnemia::IsValid() const return SEPatientCondition::IsValid() && HasReductionFactor(); } //------------------------------------------------------------------------------- -bool SEChronicAnemia::Load(const CDM::ChronicAnemiaData& in) -{ - SEPatientCondition::Load(in); - GetReductionFactor().Load(in.ReductionFactor()); - return true; -} -//------------------------------------------------------------------------------- -CDM::ChronicAnemiaData* SEChronicAnemia::Unload() const -{ - CDM::ChronicAnemiaData* data(new CDM::ChronicAnemiaData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEChronicAnemia::Unload(CDM::ChronicAnemiaData& data) const -{ - SEPatientCondition::Unload(data); - if (m_ReductionFactor != nullptr) - data.ReductionFactor(std::unique_ptr(m_ReductionFactor->Unload())); -} -//------------------------------------------------------------------------------- bool SEChronicAnemia::HasReductionFactor() const { return m_ReductionFactor == nullptr ? false : m_ReductionFactor->IsValid(); diff --git a/projects/biogears/libBiogears/src/cdm/patient/conditions/SEChronicHeartFailure.cpp b/projects/biogears/libBiogears/src/cdm/patient/conditions/SEChronicHeartFailure.cpp index 3f40e814a..e15af8cd2 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/conditions/SEChronicHeartFailure.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/conditions/SEChronicHeartFailure.cpp @@ -10,6 +10,7 @@ CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientConditions.h" namespace biogears { SEChronicHeartFailure::SEChronicHeartFailure() @@ -19,35 +20,17 @@ SEChronicHeartFailure::SEChronicHeartFailure() //------------------------------------------------------------------------------- SEChronicHeartFailure::~SEChronicHeartFailure() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEChronicHeartFailure::Clear() +void SEChronicHeartFailure::Invalidate() { - SEPatientCondition::Clear(); + SEPatientCondition::Invalidate(); } //------------------------------------------------------------------------------- bool SEChronicHeartFailure::IsValid() const { return SEPatientCondition::IsValid(); } -//------------------------------------------------------------------------------- -bool SEChronicHeartFailure::Load(const CDM::ChronicHeartFailureData& in) -{ - SEPatientCondition::Load(in); - return true; -} -//------------------------------------------------------------------------------- -CDM::ChronicHeartFailureData* SEChronicHeartFailure::Unload() const -{ - CDM::ChronicHeartFailureData* data(new CDM::ChronicHeartFailureData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEChronicHeartFailure::Unload(CDM::ChronicHeartFailureData& data) const -{ - SEPatientCondition::Unload(data); -} } \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/cdm/patient/conditions/SEChronicObstructivePulmonaryDisease.cpp b/projects/biogears/libBiogears/src/cdm/patient/conditions/SEChronicObstructivePulmonaryDisease.cpp index 9940d0c80..c0ce8a3e7 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/conditions/SEChronicObstructivePulmonaryDisease.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/conditions/SEChronicObstructivePulmonaryDisease.cpp @@ -12,6 +12,7 @@ specific language governing permissions and limitations under the License. #include #include +#include "io/cdm/PatientConditions.h" namespace biogears { SEChronicObstructivePulmonaryDisease::SEChronicObstructivePulmonaryDisease() @@ -23,12 +24,12 @@ SEChronicObstructivePulmonaryDisease::SEChronicObstructivePulmonaryDisease() //----------------------------------------------------------------------------- SEChronicObstructivePulmonaryDisease::~SEChronicObstructivePulmonaryDisease() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SEChronicObstructivePulmonaryDisease::Clear() +void SEChronicObstructivePulmonaryDisease::Invalidate() { - SEPatientCondition::Clear(); + SEPatientCondition::Invalidate(); SAFE_DELETE(m_BronchitisSeverity); SAFE_DELETE(m_EmphysemaSeverity); } @@ -37,30 +38,7 @@ bool SEChronicObstructivePulmonaryDisease::IsValid() const { return SEPatientCondition::IsValid() && HasBronchitisSeverity() && HasEmphysemaSeverity(); } -//----------------------------------------------------------------------------- -bool SEChronicObstructivePulmonaryDisease::Load(const CDM::ChronicObstructivePulmonaryDiseaseData& in) -{ - SEPatientCondition::Load(in); - GetBronchitisSeverity().Load(in.BronchitisSeverity()); - GetEmphysemaSeverity().Load(in.EmphysemaSeverity()); - return true; -} -//----------------------------------------------------------------------------- -CDM::ChronicObstructivePulmonaryDiseaseData* SEChronicObstructivePulmonaryDisease::Unload() const -{ - CDM::ChronicObstructivePulmonaryDiseaseData* data(new CDM::ChronicObstructivePulmonaryDiseaseData()); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEChronicObstructivePulmonaryDisease::Unload(CDM::ChronicObstructivePulmonaryDiseaseData& data) const -{ - SEPatientCondition::Unload(data); - if (m_BronchitisSeverity != nullptr) - data.BronchitisSeverity(std::unique_ptr(m_BronchitisSeverity->Unload())); - if (m_EmphysemaSeverity != nullptr) - data.EmphysemaSeverity(std::unique_ptr(m_EmphysemaSeverity->Unload())); -} + //----------------------------------------------------------------------------- bool SEChronicObstructivePulmonaryDisease::HasBronchitisSeverity() const { diff --git a/projects/biogears/libBiogears/src/cdm/patient/conditions/SEChronicPericardialEffusion.cpp b/projects/biogears/libBiogears/src/cdm/patient/conditions/SEChronicPericardialEffusion.cpp index 372655129..f8e06ed80 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/conditions/SEChronicPericardialEffusion.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/conditions/SEChronicPericardialEffusion.cpp @@ -12,6 +12,7 @@ specific language governing permissions and limitations under the License. #include #include +#include "io/cdm/PatientConditions.h" namespace biogears { SEChronicPericardialEffusion::SEChronicPericardialEffusion() @@ -22,12 +23,12 @@ SEChronicPericardialEffusion::SEChronicPericardialEffusion() //----------------------------------------------------------------------------- SEChronicPericardialEffusion::~SEChronicPericardialEffusion() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SEChronicPericardialEffusion::Clear() +void SEChronicPericardialEffusion::Invalidate() { - SEPatientCondition::Clear(); + SEPatientCondition::Invalidate(); SAFE_DELETE(m_AccumulatedVolume); } //----------------------------------------------------------------------------- @@ -36,27 +37,6 @@ bool SEChronicPericardialEffusion::IsValid() const return SEPatientCondition::IsValid() && HasAccumulatedVolume(); } //----------------------------------------------------------------------------- -bool SEChronicPericardialEffusion::Load(const CDM::ChronicPericardialEffusionData& in) -{ - SEPatientCondition::Load(in); - GetAccumulatedVolume().Load(in.AccumulatedVolume()); - return true; -} -//----------------------------------------------------------------------------- -CDM::ChronicPericardialEffusionData* SEChronicPericardialEffusion::Unload() const -{ - CDM::ChronicPericardialEffusionData* data(new CDM::ChronicPericardialEffusionData()); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEChronicPericardialEffusion::Unload(CDM::ChronicPericardialEffusionData& data) const -{ - SEPatientCondition::Unload(data); - if (m_AccumulatedVolume != nullptr) - data.AccumulatedVolume(std::unique_ptr(m_AccumulatedVolume->Unload())); -} -//----------------------------------------------------------------------------- bool SEChronicPericardialEffusion::HasAccumulatedVolume() const { return m_AccumulatedVolume == nullptr ? false : m_AccumulatedVolume->IsValid(); diff --git a/projects/biogears/libBiogears/src/cdm/patient/conditions/SEChronicRenalStenosis.cpp b/projects/biogears/libBiogears/src/cdm/patient/conditions/SEChronicRenalStenosis.cpp index e27e06cb2..403a7f489 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/conditions/SEChronicRenalStenosis.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/conditions/SEChronicRenalStenosis.cpp @@ -12,6 +12,7 @@ specific language governing permissions and limitations under the License. #include #include +#include "io/cdm/PatientConditions.h" namespace biogears { SEChronicRenalStenosis::SEChronicRenalStenosis() @@ -23,12 +24,12 @@ SEChronicRenalStenosis::SEChronicRenalStenosis() //------------------------------------------------------------------------------- SEChronicRenalStenosis::~SEChronicRenalStenosis() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEChronicRenalStenosis::Clear() +void SEChronicRenalStenosis::Invalidate() { - SEPatientCondition::Clear(); + SEPatientCondition::Invalidate(); SAFE_DELETE(m_LeftKidneySeverity); SAFE_DELETE(m_RightKidneySeverity); } @@ -38,32 +39,6 @@ bool SEChronicRenalStenosis::IsValid() const return SEPatientCondition::IsValid() && (HasLeftKidneySeverity() || HasRightKidneySeverity()); } //------------------------------------------------------------------------------- -bool SEChronicRenalStenosis::Load(const CDM::ChronicRenalStenosisData& in) -{ - SEPatientCondition::Load(in); - if (in.LeftKidneySeverity().present()) - GetLeftKidneySeverity().Load(in.LeftKidneySeverity().get()); - if (in.RightKidneySeverity().present()) - GetRightKidneySeverity().Load(in.RightKidneySeverity().get()); - return true; -} -//------------------------------------------------------------------------------- -CDM::ChronicRenalStenosisData* SEChronicRenalStenosis::Unload() const -{ - CDM::ChronicRenalStenosisData* data(new CDM::ChronicRenalStenosisData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEChronicRenalStenosis::Unload(CDM::ChronicRenalStenosisData& data) const -{ - SEPatientCondition::Unload(data); - if (HasLeftKidneySeverity()) - data.LeftKidneySeverity(std::unique_ptr(m_LeftKidneySeverity->Unload())); - if (HasRightKidneySeverity()) - data.RightKidneySeverity(std::unique_ptr(m_RightKidneySeverity->Unload())); -} -//------------------------------------------------------------------------------- bool SEChronicRenalStenosis::HasLeftKidneySeverity() const { return m_LeftKidneySeverity == nullptr ? false : m_LeftKidneySeverity->IsValid(); diff --git a/projects/biogears/libBiogears/src/cdm/patient/conditions/SEChronicVentricularSystolicDysfunction.cpp b/projects/biogears/libBiogears/src/cdm/patient/conditions/SEChronicVentricularSystolicDysfunction.cpp index 3a9698e90..22c420c8e 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/conditions/SEChronicVentricularSystolicDysfunction.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/conditions/SEChronicVentricularSystolicDysfunction.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientConditions.h" namespace biogears { SEChronicVentricularSystolicDysfunction::SEChronicVentricularSystolicDysfunction() @@ -20,12 +21,12 @@ SEChronicVentricularSystolicDysfunction::SEChronicVentricularSystolicDysfunction //----------------------------------------------------------------------------- SEChronicVentricularSystolicDysfunction::~SEChronicVentricularSystolicDysfunction() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SEChronicVentricularSystolicDysfunction::Clear() +void SEChronicVentricularSystolicDysfunction::Invalidate() { - SEChronicHeartFailure::Clear(); + SEChronicHeartFailure::Invalidate(); } //----------------------------------------------------------------------------- bool SEChronicVentricularSystolicDysfunction::IsValid() const @@ -33,24 +34,6 @@ bool SEChronicVentricularSystolicDysfunction::IsValid() const return SEChronicHeartFailure::IsValid(); } //----------------------------------------------------------------------------- -bool SEChronicVentricularSystolicDysfunction::Load(const CDM::ChronicVentricularSystolicDysfunctionData& in) -{ - SEChronicHeartFailure::Load(in); - return true; -} -//----------------------------------------------------------------------------- -CDM::ChronicVentricularSystolicDysfunctionData* SEChronicVentricularSystolicDysfunction::Unload() const -{ - CDM::ChronicVentricularSystolicDysfunctionData* data(new CDM::ChronicVentricularSystolicDysfunctionData()); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEChronicVentricularSystolicDysfunction::Unload(CDM::ChronicVentricularSystolicDysfunctionData& data) const -{ - SEChronicHeartFailure::Unload(data); -} -//----------------------------------------------------------------------------- void SEChronicVentricularSystolicDysfunction::ToString(std::ostream& str) const { str << "Patient Condition : Ventricular Systolic Dysfunction Heart Failure"; diff --git a/projects/biogears/libBiogears/src/cdm/patient/conditions/SEDehydration.cpp b/projects/biogears/libBiogears/src/cdm/patient/conditions/SEDehydration.cpp index 26f3fcb80..b397ac0d1 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/conditions/SEDehydration.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/conditions/SEDehydration.cpp @@ -12,6 +12,7 @@ specific language governing permissions and limitations under the License. #include #include +#include "io/cdm/PatientConditions.h" namespace biogears { SEDehydration::SEDehydration() @@ -22,12 +23,12 @@ SEDehydration::SEDehydration() //----------------------------------------------------------------------------- SEDehydration::~SEDehydration() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SEDehydration::Clear() +void SEDehydration::Invalidate() { - SEPatientCondition::Clear(); + SEPatientCondition::Invalidate(); SAFE_DELETE(m_DehydrationFraction); } //----------------------------------------------------------------------------- @@ -36,27 +37,6 @@ bool SEDehydration::IsValid() const return SEPatientCondition::IsValid() && HasDehydrationFraction(); } //----------------------------------------------------------------------------- -bool SEDehydration::Load(const CDM::DehydrationData& in) -{ - SEPatientCondition::Load(in); - GetDehydrationFraction().Load(in.DehydrationFraction()); - return true; -} -//----------------------------------------------------------------------------- -CDM::DehydrationData* SEDehydration::Unload() const -{ - CDM::DehydrationData* data(new CDM::DehydrationData()); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEDehydration::Unload(CDM::DehydrationData& data) const -{ - SEPatientCondition::Unload(data); - if (m_DehydrationFraction != nullptr) - data.DehydrationFraction(std::unique_ptr(m_DehydrationFraction->Unload())); -} -//----------------------------------------------------------------------------- bool SEDehydration::HasDehydrationFraction() const { return m_DehydrationFraction == nullptr ? false : m_DehydrationFraction->IsValid(); diff --git a/projects/biogears/libBiogears/src/cdm/patient/conditions/SEDiabetesType1.cpp b/projects/biogears/libBiogears/src/cdm/patient/conditions/SEDiabetesType1.cpp index 9ddd28de8..f6e688ee2 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/conditions/SEDiabetesType1.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/conditions/SEDiabetesType1.cpp @@ -12,6 +12,7 @@ specific language governing permissions and limitations under the License. #include #include +#include "io/cdm/PatientConditions.h" namespace biogears { SEDiabetesType1::SEDiabetesType1() @@ -22,12 +23,12 @@ SEDiabetesType1::SEDiabetesType1() //----------------------------------------------------------------------------- SEDiabetesType1::~SEDiabetesType1() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SEDiabetesType1::Clear() +void SEDiabetesType1::Invalidate() { - SEPatientCondition::Clear(); + SEPatientCondition::Invalidate(); SAFE_DELETE(m_InsulinProductionSeverity); } //----------------------------------------------------------------------------- @@ -35,27 +36,7 @@ bool SEDiabetesType1::IsValid() const { return SEPatientCondition::IsValid() && HasInsulinProductionSeverity(); } -//----------------------------------------------------------------------------- -bool SEDiabetesType1::Load(const CDM::DiabetesType1Data& in) -{ - SEPatientCondition::Load(in); - GetInsulinProductionSeverity().Load(in.InsulinProductionSeverity()); - return true; -} -//----------------------------------------------------------------------------- -CDM::DiabetesType1Data* SEDiabetesType1::Unload() const -{ - CDM::DiabetesType1Data* data(new CDM::DiabetesType1Data()); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEDiabetesType1::Unload(CDM::DiabetesType1Data& data) const -{ - SEPatientCondition::Unload(data); - if (m_InsulinProductionSeverity != nullptr) - data.InsulinProductionSeverity(std::unique_ptr(m_InsulinProductionSeverity->Unload())); -} + //----------------------------------------------------------------------------- bool SEDiabetesType1::HasInsulinProductionSeverity() const { diff --git a/projects/biogears/libBiogears/src/cdm/patient/conditions/SEDiabetesType2.cpp b/projects/biogears/libBiogears/src/cdm/patient/conditions/SEDiabetesType2.cpp index edcb3e00b..43834f95e 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/conditions/SEDiabetesType2.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/conditions/SEDiabetesType2.cpp @@ -12,6 +12,7 @@ specific language governing permissions and limitations under the License. #include #include +#include "io/cdm/PatientConditions.h" namespace biogears { SEDiabetesType2::SEDiabetesType2() @@ -23,12 +24,12 @@ SEDiabetesType2::SEDiabetesType2() //----------------------------------------------------------------------------- SEDiabetesType2::~SEDiabetesType2() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SEDiabetesType2::Clear() +void SEDiabetesType2::Invalidate() { - SEPatientCondition::Clear(); + SEPatientCondition::Invalidate(); SAFE_DELETE(m_InsulinProductionSeverity); SAFE_DELETE(m_InsulinResistanceSeverity); } @@ -37,30 +38,7 @@ bool SEDiabetesType2::IsValid() const { return SEPatientCondition::IsValid() && HasInsulinProductionSeverity() && HasInsulinResistanceSeverity(); } -//----------------------------------------------------------------------------- -bool SEDiabetesType2::Load(const CDM::DiabetesType2Data& in) -{ - SEPatientCondition::Load(in); - GetInsulinProductionSeverity().Load(in.InsulinProductionSeverity()); - GetInsulinResistanceSeverity().Load(in.InsulinResistanceSeverity()); - return true; -} -//----------------------------------------------------------------------------- -CDM::DiabetesType2Data* SEDiabetesType2::Unload() const -{ - CDM::DiabetesType2Data* data(new CDM::DiabetesType2Data()); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEDiabetesType2::Unload(CDM::DiabetesType2Data& data) const -{ - SEPatientCondition::Unload(data); - if (m_InsulinProductionSeverity != nullptr) - data.InsulinProductionSeverity(std::unique_ptr(m_InsulinProductionSeverity->Unload())); - if (m_InsulinResistanceSeverity != nullptr) - data.InsulinResistanceSeverity(std::unique_ptr(m_InsulinResistanceSeverity->Unload())); -} + //----------------------------------------------------------------------------- bool SEDiabetesType2::HasInsulinProductionSeverity() const { diff --git a/projects/biogears/libBiogears/src/cdm/patient/conditions/SEImpairedAlveolarExchange.cpp b/projects/biogears/libBiogears/src/cdm/patient/conditions/SEImpairedAlveolarExchange.cpp index 594549e7f..982d3660b 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/conditions/SEImpairedAlveolarExchange.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/conditions/SEImpairedAlveolarExchange.cpp @@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License. #include #include +#include "io/cdm/PatientConditions.h" namespace biogears { SEImpairedAlveolarExchange::SEImpairedAlveolarExchange() @@ -24,10 +25,10 @@ SEImpairedAlveolarExchange::SEImpairedAlveolarExchange() //----------------------------------------------------------------------------- SEImpairedAlveolarExchange::~SEImpairedAlveolarExchange() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SEImpairedAlveolarExchange::Clear() +void SEImpairedAlveolarExchange::Invalidate() { SAFE_DELETE(m_ImpairedSurfaceArea); SAFE_DELETE(m_ImpairedFraction); @@ -37,30 +38,7 @@ bool SEImpairedAlveolarExchange::IsValid() const { return HasImpairedFraction() || HasImpairedSurfaceArea(); } -//----------------------------------------------------------------------------- -bool SEImpairedAlveolarExchange::Load(const CDM::ImpairedAlveolarExchangeData& in) -{ - if (in.ImpairedSurfaceArea().present()) - GetImpairedSurfaceArea().Load(in.ImpairedSurfaceArea().get()); - if (in.ImpairedFraction().present()) - GetImpairedFraction().Load(in.ImpairedFraction().get()); - return true; -} -//----------------------------------------------------------------------------- -CDM::ImpairedAlveolarExchangeData* SEImpairedAlveolarExchange::Unload() const -//----------------------------------------------------------------------------- -{ - CDM::ImpairedAlveolarExchangeData* data = new CDM::ImpairedAlveolarExchangeData(); - Unload(*data); - return data; -} -void SEImpairedAlveolarExchange::Unload(CDM::ImpairedAlveolarExchangeData& data) const -{ - if (HasImpairedSurfaceArea()) - data.ImpairedSurfaceArea(std::unique_ptr(m_ImpairedSurfaceArea->Unload())); - if (HasImpairedFraction()) - data.ImpairedFraction(std::unique_ptr(m_ImpairedFraction->Unload())); -} + //----------------------------------------------------------------------------- bool SEImpairedAlveolarExchange::HasImpairedSurfaceArea() const { diff --git a/projects/biogears/libBiogears/src/cdm/patient/conditions/SELobarPneumonia.cpp b/projects/biogears/libBiogears/src/cdm/patient/conditions/SELobarPneumonia.cpp index 9fb0e9fa7..343b6568a 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/conditions/SELobarPneumonia.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/conditions/SELobarPneumonia.cpp @@ -12,6 +12,7 @@ specific language governing permissions and limitations under the License. #include #include +#include "io/cdm/PatientConditions.h" namespace biogears { SELobarPneumonia::SELobarPneumonia() @@ -24,12 +25,12 @@ SELobarPneumonia::SELobarPneumonia() //----------------------------------------------------------------------------- SELobarPneumonia::~SELobarPneumonia() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SELobarPneumonia::Clear() +void SELobarPneumonia::Invalidate() { - SEPatientCondition::Clear(); + SEPatientCondition::Invalidate(); SAFE_DELETE(m_Severity); SAFE_DELETE(m_LeftLungAffected); SAFE_DELETE(m_RightLungAffected); @@ -39,33 +40,7 @@ bool SELobarPneumonia::IsValid() const { return SEPatientCondition::IsValid() && HasSeverity() && HasLeftLungAffected() && HasRightLungAffected(); } -//----------------------------------------------------------------------------- -bool SELobarPneumonia::Load(const CDM::LobarPneumoniaData& in) -{ - SEPatientCondition::Load(in); - GetSeverity().Load(in.Severity()); - GetLeftLungAffected().Load(in.LeftLungAffected()); - GetRightLungAffected().Load(in.RightLungAffected()); - return true; -} -//----------------------------------------------------------------------------- -CDM::LobarPneumoniaData* SELobarPneumonia::Unload() const -{ - CDM::LobarPneumoniaData* data(new CDM::LobarPneumoniaData()); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SELobarPneumonia::Unload(CDM::LobarPneumoniaData& data) const -{ - SEPatientCondition::Unload(data); - if (m_Severity != nullptr) - data.Severity(std::unique_ptr(m_Severity->Unload())); - if (m_LeftLungAffected != nullptr) - data.LeftLungAffected(std::unique_ptr(m_LeftLungAffected->Unload())); - if (m_RightLungAffected != nullptr) - data.RightLungAffected(std::unique_ptr(m_RightLungAffected->Unload())); -} + //----------------------------------------------------------------------------- bool SELobarPneumonia::HasSeverity() const { diff --git a/projects/biogears/libBiogears/src/cdm/patient/conditions/SEPatientCondition.cpp b/projects/biogears/libBiogears/src/cdm/patient/conditions/SEPatientCondition.cpp index d897f2337..66476cadb 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/conditions/SEPatientCondition.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/conditions/SEPatientCondition.cpp @@ -10,6 +10,7 @@ CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientConditions.h" namespace biogears { SEPatientCondition::SEPatientCondition() @@ -19,27 +20,17 @@ SEPatientCondition::SEPatientCondition() //------------------------------------------------------------------------------- SEPatientCondition::~SEPatientCondition() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEPatientCondition::Clear() +void SEPatientCondition::Invalidate() { - SECondition::Clear(); + SECondition::Invalidate(); } //------------------------------------------------------------------------------- bool SEPatientCondition::IsValid() const { return SECondition::IsValid(); } -//------------------------------------------------------------------------------- -bool SEPatientCondition::Load(const CDM::PatientConditionData& in) -{ - SECondition::Load(in); - return true; -} -//------------------------------------------------------------------------------- -void SEPatientCondition::Unload(CDM::PatientConditionData& data) const -{ - SECondition::Unload(data); -} + } \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/cdm/patient/conditions/SEStarvation.cpp b/projects/biogears/libBiogears/src/cdm/patient/conditions/SEStarvation.cpp index 8eac9217c..03a5c5c9f 100644 --- a/projects/biogears/libBiogears/src/cdm/patient/conditions/SEStarvation.cpp +++ b/projects/biogears/libBiogears/src/cdm/patient/conditions/SEStarvation.cpp @@ -14,6 +14,8 @@ specific language governing permissions and limitations under the License. #include #include +#include "io/cdm/PatientConditions.h" + namespace biogears { SEStarvation::SEStarvation() : SEPatientCondition() @@ -23,12 +25,12 @@ SEStarvation::SEStarvation() //----------------------------------------------------------------------------- SEStarvation::~SEStarvation() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SEStarvation::Clear() +void SEStarvation::Invalidate() { - SEPatientCondition::Clear(); + SEPatientCondition::Invalidate(); SAFE_DELETE(m_TimeSinceMeal); } //----------------------------------------------------------------------------- @@ -36,27 +38,8 @@ bool SEStarvation::IsValid() const { return SEPatientCondition::IsValid() && HasTimeSinceMeal(); } -//----------------------------------------------------------------------------- -bool SEStarvation::Load(const CDM::StarvationData& in) -{ - SEPatientCondition::Load(in); - GetTimeSinceMeal().Load(in.TimeSinceMeal()); - return true; -} -//----------------------------------------------------------------------------- -CDM::StarvationData* SEStarvation::Unload() const -{ - CDM::StarvationData* data(new CDM::StarvationData()); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEStarvation::Unload(CDM::StarvationData& data) const -{ - SEPatientCondition::Unload(data); - if (m_TimeSinceMeal != nullptr) - data.TimeSinceMeal(std::unique_ptr(m_TimeSinceMeal->Unload())); -} + + //----------------------------------------------------------------------------- bool SEStarvation::HasTimeSinceMeal() const { diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEDecimalFormat.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEDecimalFormat.cpp index 1370499f8..ab3ef78fa 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEDecimalFormat.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEDecimalFormat.cpp @@ -15,6 +15,8 @@ specific language governing permissions and limitations under the License. #include #include //Project Includes +#include "io/cdm/Property.h" + #include namespace std { @@ -46,42 +48,6 @@ void SEDecimalFormat::Set(const SEDecimalFormat& f) m_Notation = f.m_Notation; } -bool SEDecimalFormat::Load(const CDM::DecimalFormatData& in) -{ - Reset(); - if (in.DecimalFormat().present()) { - if (in.DecimalFormat().get() == CDM::enumDecimalFormat::Default) - m_Notation = DecimalNotation::Default; - if (in.DecimalFormat().get() == CDM::enumDecimalFormat::FixedMantissa) - m_Notation = DecimalNotation::Fixed; - else if (in.DecimalFormat().get() == CDM::enumDecimalFormat::SignificantDigits) - m_Notation = DecimalNotation::Scientific; - } - if (in.Precision().present()) - m_Precision = in.Precision().get(); - return true; -} -CDM::DecimalFormatData* SEDecimalFormat::Unload() -{ - CDM::DecimalFormatData* to = new CDM::DecimalFormatData(); - Unload(*to); - return to; -} -void SEDecimalFormat::Unload(CDM::DecimalFormatData& data) const -{ - data.Precision(static_cast(m_Precision)); - switch (m_Notation) { - case DecimalNotation::Default: - case DecimalNotation::Fixed: { - data.DecimalFormat(CDM::enumDecimalFormat::FixedMantissa); - break; - } - case DecimalNotation::Scientific: { - data.DecimalFormat(CDM::enumDecimalFormat::SignificantDigits); - break; - } - } -} void SEDecimalFormat::SetPrecision(std::streamsize p) { @@ -105,12 +71,6 @@ void SEDecimalFormat::SetStream(std::ofstream& s) { switch (m_Notation) { case DecimalNotation::Default: - s -#ifndef ANDROID - << std::defaultfloat -#endif - << std::setprecision(m_Precision); - break; case DecimalNotation::Fixed: s << std::fixed << std::setprecision(m_Precision); break; diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEFunction.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEFunction.cpp index a6c7cb134..5eb24c70e 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEFunction.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEFunction.cpp @@ -11,8 +11,11 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Property.h" + #include //Utils + namespace biogears { static std::stringstream err; @@ -23,10 +26,10 @@ SEFunction::SEFunction() SEFunction::~SEFunction() { - Clear(); + Invalidate(); } -void SEFunction::Clear() +void SEFunction::Invalidate() { m_Dependent.clear(); m_Independent.clear(); @@ -41,41 +44,6 @@ bool SEFunction::IsValid() const return true; } -void SEFunction::Invalidate() -{ - Clear(); -} - -bool SEFunction::Load(const CDM::FunctionData& in) -{ - Clear(); - for (unsigned int i = 0; i < in.Dependent().DoubleList().size(); i++) - m_Dependent.push_back(in.Dependent().DoubleList()[i]); - for (unsigned int i = 0; i < in.Independent().DoubleList().size(); i++) - m_Independent.push_back(in.Independent().DoubleList()[i]); - return IsValid(); -} - -CDM::FunctionData* SEFunction::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::FunctionData* data(new CDM::FunctionData()); - Unload(*data); - return data; -} - -void SEFunction::Unload(CDM::FunctionData& data) const -{ - data.Dependent(std::unique_ptr(new CDM::DoubleArray())); - data.Dependent().DoubleList(std::unique_ptr(new CDM::DoubleList())); - data.Independent(std::unique_ptr(new CDM::DoubleArray())); - data.Independent().DoubleList(std::unique_ptr(new CDM::DoubleList())); - for (unsigned int i = 0; i < m_Dependent.size(); i++) { - data.Dependent().DoubleList().push_back(m_Dependent[i]); - data.Independent().DoubleList().push_back(m_Independent[i]); - } -} unsigned int SEFunction::Length() { diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEFunctionElectricPotentialVsTime.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEFunctionElectricPotentialVsTime.cpp index 132bde1a8..d9da537f8 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEFunctionElectricPotentialVsTime.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEFunctionElectricPotentialVsTime.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Property.h" + #include #include #include @@ -26,40 +28,17 @@ SEFunctionElectricPotentialVsTime::SEFunctionElectricPotentialVsTime() SEFunctionElectricPotentialVsTime::~SEFunctionElectricPotentialVsTime() { - Clear(); + Invalidate(); } -void SEFunctionElectricPotentialVsTime::Clear() +void SEFunctionElectricPotentialVsTime::Invalidate() { - SEFunction::Clear(); + SEFunction::Invalidate(); m_TimeUnit = nullptr; m_ElectricPotentialUnit = nullptr; } -bool SEFunctionElectricPotentialVsTime::Load(const CDM::FunctionElectricPotentialVsTimeData& in) -{ - if (!SEFunction::Load(in)) - return false; - m_TimeUnit = &TimeUnit::GetCompoundUnit(in.IndependentUnit().get()); - m_ElectricPotentialUnit = &ElectricPotentialUnit::GetCompoundUnit(in.DependentUnit().get()); - return IsValid(); -} - -CDM::FunctionElectricPotentialVsTimeData* SEFunctionElectricPotentialVsTime::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::FunctionElectricPotentialVsTimeData* data(new CDM::FunctionElectricPotentialVsTimeData()); - Unload(*data); - return data; -} -void SEFunctionElectricPotentialVsTime::Unload(CDM::FunctionElectricPotentialVsTimeData& data) const -{ - SEFunction::Unload(data); - data.IndependentUnit(m_TimeUnit->GetString()); - data.DependentUnit(m_ElectricPotentialUnit->GetString()); -} double SEFunctionElectricPotentialVsTime::GetTimeValue(unsigned int index, const TimeUnit& unit) { diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEFunctionVolumeVsTime.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEFunctionVolumeVsTime.cpp index 11b0bf68b..73ed08083 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEFunctionVolumeVsTime.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEFunctionVolumeVsTime.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Property.h" + #include #include @@ -24,41 +26,16 @@ SEFunctionVolumeVsTime::SEFunctionVolumeVsTime() SEFunctionVolumeVsTime::~SEFunctionVolumeVsTime() { - Clear(); + Invalidate(); } -void SEFunctionVolumeVsTime::Clear() +void SEFunctionVolumeVsTime::Invalidate() { - SEFunction::Clear(); + SEFunction::Invalidate(); m_TimeUnit = nullptr; m_VolumeUnit = nullptr; } -bool SEFunctionVolumeVsTime::Load(const CDM::FunctionVolumeVsTimeData& in) -{ - if (!SEFunction::Load(in)) - return false; - m_TimeUnit = &TimeUnit::GetCompoundUnit(in.IndependentUnit().get()); - m_VolumeUnit = &VolumeUnit::GetCompoundUnit(in.DependentUnit().get()); - return IsValid(); -} - -CDM::FunctionVolumeVsTimeData* SEFunctionVolumeVsTime::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::FunctionVolumeVsTimeData* data(new CDM::FunctionVolumeVsTimeData()); - Unload(*data); - return data; -} - -void SEFunctionVolumeVsTime::Unload(CDM::FunctionVolumeVsTimeData& data) const -{ - SEFunction::Unload(data); - data.IndependentUnit(m_TimeUnit->GetString()); - data.DependentUnit(m_VolumeUnit->GetString()); -} - double SEFunctionVolumeVsTime::GetTimeValue(unsigned int index, const TimeUnit& unit) { if (m_TimeUnit == nullptr) @@ -101,12 +78,21 @@ void SEFunctionVolumeVsTime::SetVolumeUnit(const VolumeUnit& unit) m_VolumeUnit = &unit; } //------------------------------------------------------------------------------- +//! +//! operator==(const SEFunctionVlumeVsTime&( +//! \param SEunctionVolumeVsTime -- RHS of equlaity operator +//! \returns bool -- True if both sides are Invalid else True only if booth sides are valid and all terms are equal. + bool SEFunctionVolumeVsTime::operator==(const SEFunctionVolumeVsTime& rhs) const { - bool equivilant = (m_TimeUnit && rhs.m_TimeUnit) ? m_TimeUnit->operator==(*rhs.m_TimeUnit) : m_TimeUnit == rhs.m_TimeUnit; - equivilant &= (m_VolumeUnit && rhs.m_VolumeUnit) ? m_VolumeUnit->operator==(*rhs.m_VolumeUnit) : m_VolumeUnit == rhs.m_VolumeUnit; - equivilant &= SEFunction::operator==(rhs); - return equivilant; + bool equivilant = rhs.IsValid() || IsValid(); + if (equivilant) { + equivilant = (m_TimeUnit && rhs.m_TimeUnit) ? m_TimeUnit->operator==(*rhs.m_TimeUnit) : m_TimeUnit == rhs.m_TimeUnit; + equivilant &= (m_VolumeUnit && rhs.m_VolumeUnit) ? m_VolumeUnit->operator==(*rhs.m_VolumeUnit) : m_VolumeUnit == rhs.m_VolumeUnit; + equivilant &= SEFunction::operator==(rhs); + return equivilant; + } + return !equivilant; } //------------------------------------------------------------------------------- bool SEFunctionVolumeVsTime::operator!=(const SEFunctionVolumeVsTime& rhs) const diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEGenericScalar.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEGenericScalar.cpp index 5b5c7e811..946b9ba04 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEGenericScalar.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEGenericScalar.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Property.h" + namespace biogears { //------------------------------------------------------------------------------- SEGenericScalar::SEGenericScalar(Logger* logger) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEHistogram.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEHistogram.cpp index a2dfe89bf..8c6cbc328 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEHistogram.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEHistogram.cpp @@ -13,126 +13,112 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/Property.h" + #include //Utils namespace biogears { static std::stringstream err; +SEHistogram::SEHistogram(SEHistogram const& obj) + : m_Dependent(obj.m_Dependent) + , m_Independent(obj.m_Independent) +{ +} +//------------------------------------------------------------------------------- SEHistogram::SEHistogram() : SEProperty() { } - +//------------------------------------------------------------------------------- SEHistogram::~SEHistogram() { - Clear(); + Invalidate(); } - -void SEHistogram::Clear() +//------------------------------------------------------------------------------- +void SEHistogram::Invalidate() { m_Dependent.clear(); m_Independent.clear(); } - +//------------------------------------------------------------------------------- bool SEHistogram::IsValid() const { if (m_Dependent.size() == 0 || m_Independent.size() == 0) { - std::cerr << "Histogram: No data provided." << std::endl; //todo make properties have a logger + std::cerr << "Histogram: No data provided." << std::endl; // todo make properties have a logger return false; } if (m_Dependent.size() + 1 != m_Independent.size()) { - std::cerr << "Histogram: Size mismatch between boundaries and bins." << std::endl; //todo make properties have a logger + std::cerr << "Histogram: Size mismatch between boundaries and bins." << std::endl; // todo make properties have a logger return false; } return true; } -void SEHistogram::Invalidate() -{ - Clear(); -} - -bool SEHistogram::Load(const CDM::HistogramData& in) -{ - Clear(); - for (unsigned int i = 0; i < in.Dependent().DoubleList().size(); i++) - m_Dependent.push_back(in.Dependent().DoubleList()[i]); - for (unsigned int i = 0; i < in.Independent().DoubleList().size(); i++) - m_Independent.push_back(in.Independent().DoubleList()[i]); - return IsValid(); -} - -CDM::HistogramData* SEHistogram::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::HistogramData* data(new CDM::HistogramData()); - Unload(*data); - return data; -} - -void SEHistogram::Unload(CDM::HistogramData& data) const -{ - data.Dependent(std::unique_ptr(new CDM::DoubleList())); - data.Dependent().DoubleList(std::unique_ptr(new CDM::DoubleList())); - data.Independent(std::unique_ptr(new CDM::DoubleList())); - data.Independent().DoubleList(std::unique_ptr(new CDM::DoubleList())); - for (unsigned int i = 0; i < m_Dependent.size(); i++) - data.Dependent().DoubleList().push_back(m_Dependent[i]); - for (unsigned int i = 0; i < m_Independent.size(); i++) - data.Independent().DoubleList().push_back(m_Independent[i]); -} - +//------------------------------------------------------------------------------- unsigned int SEHistogram::NumberOfBins() const { if (IsValid()) return static_cast(m_Dependent.size()); return 0; } - +//------------------------------------------------------------------------------- unsigned int SEHistogram::NumberOfBoundaries() const { if (IsValid()) return static_cast(m_Independent.size()); return 0; } - +//------------------------------------------------------------------------------- double SEHistogram::GetDependentValue(unsigned int index) const { if (index >= m_Dependent.size()) throw CommonDataModelException("Dependent index out of bounds"); return m_Dependent[index]; } - +//------------------------------------------------------------------------------- std::vector& SEHistogram::GetDependent() { return m_Dependent; } +//------------------------------------------------------------------------------- const std::vector& SEHistogram::GetDependent() const { return m_Dependent; } - +//------------------------------------------------------------------------------- double SEHistogram::GetIndependentValue(unsigned int index) const { if (index >= m_Independent.size()) throw CommonDataModelException("Independent index out of bounds"); return m_Independent[index]; } - +//------------------------------------------------------------------------------- std::vector& SEHistogram::GetIndependent() { return m_Independent; } +//------------------------------------------------------------------------------- const std::vector& SEHistogram::GetIndependent() const { return m_Independent; } //------------------------------------------------------------------------------- +SEHistogram& SEHistogram::operator=(const SEHistogram& rhs) +{ + + if (this != &rhs) { + m_Dependent = rhs.m_Dependent; + m_Independent = rhs.m_Independent; + } + + return *this; +} +//------------------------------------------------------------------------------- bool SEHistogram::operator==(const SEHistogram& obj) const { return m_Independent == obj.m_Independent - && m_Dependent == obj.m_Dependent; + && m_Dependent == obj.m_Dependent; } //------------------------------------------------------------------------------- bool SEHistogram::operator!=(const SEHistogram& obj) const diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEHistogramFractionVsLength.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEHistogramFractionVsLength.cpp index eec121ac5..d91c187ae 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEHistogramFractionVsLength.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEHistogramFractionVsLength.cpp @@ -10,14 +10,23 @@ CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **************************************************************************************/ #include -//Standard Includes -#include +// Standard Includes #include -//Project Includes +#include +// Project Includes + +#include "io/cdm/Property.h" + #include #include namespace biogears { +SEHistogramFractionVsLength::SEHistogramFractionVsLength(SEHistogramFractionVsLength const& obj) + : SEHistogram(obj) + , m_LengthUnit(obj.m_LengthUnit) +{ + +} SEHistogramFractionVsLength::SEHistogramFractionVsLength() : SEHistogram() , m_LengthUnit(nullptr) @@ -26,12 +35,12 @@ SEHistogramFractionVsLength::SEHistogramFractionVsLength() SEHistogramFractionVsLength::~SEHistogramFractionVsLength() { - Clear(); + Invalidate(); } -void SEHistogramFractionVsLength::Clear() +void SEHistogramFractionVsLength::Invalidate() { - SEHistogram::Clear(); + SEHistogram::Invalidate(); m_LengthUnit = nullptr; } @@ -48,29 +57,6 @@ bool SEHistogramFractionVsLength::IsVaild() const return true; } -bool SEHistogramFractionVsLength::Load(const CDM::HistogramFractionVsLengthData& in) -{ - if (!SEHistogram::Load(in)) - return false; - m_LengthUnit = &LengthUnit::GetCompoundUnit(in.IndependentUnit().get()); - return IsValid(); -} - -CDM::HistogramFractionVsLengthData* SEHistogramFractionVsLength::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::HistogramFractionVsLengthData* data(new CDM::HistogramFractionVsLengthData()); - Unload(*data); - return data; -} - -void SEHistogramFractionVsLength::Unload(CDM::HistogramFractionVsLengthData& data) const -{ - SEHistogram::Unload(data); - data.IndependentUnit(m_LengthUnit->GetString()); -} - double SEHistogramFractionVsLength::GetLengthValue(unsigned int index, const LengthUnit& unit) const { if (m_LengthUnit == nullptr) @@ -111,6 +97,16 @@ const std::vector& SEHistogramFractionVsLength::GetFraction() const return m_Dependent; } //------------------------------------------------------------------------------- +SEHistogramFractionVsLength& SEHistogramFractionVsLength::operator=(const SEHistogramFractionVsLength& rhs) +{ + if (this != &rhs) { + m_LengthUnit = rhs.m_LengthUnit; + SEHistogram::operator=(rhs); + } + + return *this; +} +//------------------------------------------------------------------------------- bool SEHistogramFractionVsLength::operator==(const SEHistogramFractionVsLength& rhs) const { bool equivilant = (m_LengthUnit && rhs.m_LengthUnit) ? m_LengthUnit->operator==(*rhs.m_LengthUnit) : m_LengthUnit == rhs.m_LengthUnit; diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEProperty.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEProperty.cpp index 6085e33b4..439843f16 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEProperty.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEProperty.cpp @@ -12,27 +12,14 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/Property.h" + namespace biogears { SEProperty::SEProperty() { - Clear(); } SEProperty::~SEProperty() -{ - Clear(); -} - -void SEProperty::Clear() -{ -} - -bool SEProperty::Load(const CDM::PropertyData& in) -{ - return true; -} - -void SEProperty::Unload(CDM::PropertyData& data) const { } } \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalar.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalar.cpp index 57c5482b9..e710160cc 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalar.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalar.cpp @@ -17,7 +17,7 @@ specific language governing permissions and limitations under the License. #include #include -#include +#include "io/cdm/Property.h" namespace biogears { double SEScalar::NaN = std::numeric_limits::quiet_NaN(); @@ -51,61 +51,41 @@ SEScalar::SEScalar() , m_readOnly(false) , m_value(1.0) { - Clear(); + Invalidate(); } - //------------------------------------------------------------------------------- -SEScalar::~SEScalar() +SEScalar::SEScalar(SEScalar const& obj) +: SEProperty( obj) + , m_readOnly(obj.m_readOnly) + , m_value(obj.m_value) { - Clear(); -} -//------------------------------------------------------------------------------- -void SEScalar::Clear() -{ - SEProperty::Clear(); - m_readOnly = false; - Invalidate(); } - //------------------------------------------------------------------------------- -void SEScalar::Load(const CDM::ScalarData& in, std::default_random_engine *rd) +SEScalar::SEScalar(SEScalar&& obj) +: SEProperty() + , m_readOnly(std::exchange(obj.m_readOnly, false)) + , m_value(std::exchange(obj.m_value, 1.0)) { - Clear(); - SEProperty::Load(in); - if (in.deviation().present() && rd) { - auto nd = std::normal_distribution(in.value(), in.deviation().get()); - SetValue( nd(*rd) ); - } else { - SetValue(in.value()); - } - if (in.unit().present()) { - std::string u = in.unit().get(); - if (!("unitless" == u || "" == u || u.empty())) { - throw CommonDataModelException("CDM::Scalar API is intended to be unitless, You are trying to load a ScalarData with a unit defined"); - } - } - m_readOnly = in.readOnly(); } - //------------------------------------------------------------------------------- -CDM::ScalarData* SEScalar::Unload() const +SEScalar::~SEScalar() { - if (!IsValid()) { - return nullptr; - } - CDM::ScalarData* data(new CDM::ScalarData()); - Unload(*data); - return data; } //------------------------------------------------------------------------------- -void SEScalar::Unload(CDM::ScalarData& data) const +void SEScalar::Invalidate() { - SEProperty::Unload(data); - data.value(m_value); - data.readOnly(m_readOnly); + if (m_readOnly) { +#if defined(BIOGEARS_THROW_READONLY_EXCEPTIONS) + throw CommonDataModelException("Scalar is marked read-only"); +#else + return; +#endif + } + m_readOnly = false; + m_value = NaN; } //------------------------------------------------------------------------------- @@ -130,7 +110,7 @@ void SEScalar::Copy(const SEScalar& s) { if (m_readOnly) { #if defined(BIOGEARS_THROW_READONLY_EXCEPTIONS) - throw CommonDataModelException("Scalar: " + s.ToString() + "is marked read-only"); + throw CommonDataModelException("Scalar: " + s.ToString() + "is marked read-only"); #else return; #endif @@ -138,18 +118,7 @@ void SEScalar::Copy(const SEScalar& s) m_value = s.m_value; } -//------------------------------------------------------------------------------- -void SEScalar::Invalidate() -{ - if (m_readOnly) { -#if defined(BIOGEARS_THROW_READONLY_EXCEPTIONS) - throw CommonDataModelException("Scalar is marked read-only"); -#else - return; -#endif - } - m_value = NaN; -} + //------------------------------------------------------------------------------- bool SEScalar::IsValid() const @@ -294,11 +263,11 @@ double SEScalar::DivideValue(double d) //------------------------------------------------------------------------------- bool SEScalar::Equals(const SEScalar& to) const { - if (std::isnan(m_value) && std::isnan(to.m_value)) //This Violates C++ Spec + if (std::isnan(m_value) && std::isnan(to.m_value)) // This Violates C++ Spec return true; if (std::isnan(m_value) || std::isnan(to.m_value)) return false; - if (std::isinf(m_value) && std::isinf(to.m_value)) //This implies -> -inf == +inf + if (std::isinf(m_value) && std::isinf(to.m_value)) // This implies -> -inf == +inf return true; if (std::isinf(m_value) || std::isinf(to.m_value)) return false; @@ -308,13 +277,13 @@ bool SEScalar::Equals(const SEScalar& to) const //------------------------------------------------------------------------------- std::string SEScalar::ToString() const { - #ifndef ANDROID +#ifndef ANDROID return std::to_string(m_value); - #else +#else std::stringstream ss; ss << m_value; return ss.str(); - #endif +#endif } //------------------------------------------------------------------------------- @@ -337,12 +306,25 @@ SEScalar& SEScalar::operator=(const SEScalar& rhs) { if (this == &rhs) return *this; - + auto temp = SEScalar(rhs); + SEProperty::operator=(temp); this->m_value = rhs.m_value; this->m_readOnly = rhs.m_readOnly; return *this; } + +//------------------------------------------------------------------------------- +SEScalar& SEScalar::operator=(SEScalar&& rhs) +{ + if (this == &rhs) + return *this; + auto temp = SEScalar(std::move(rhs)); + SEProperty::operator=(std::move(temp)); + std::swap(m_value, temp.m_value); + std::swap(m_readOnly, temp.m_readOnly); + return *this; +} //------------------------------------------------------------------------------- bool SEScalar::operator<(const SEScalar& rhs) const { diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalar0To1.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalar0To1.cpp index d8b056448..7a9303e8c 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalar0To1.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalar0To1.cpp @@ -12,6 +12,8 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/Property.h" + namespace biogears { SEScalar0To1::SEScalar0To1() : SEScalar() @@ -21,36 +23,7 @@ SEScalar0To1::SEScalar0To1() SEScalar0To1::~SEScalar0To1() { } -//------------------------------------------------------------------------------- -void SEScalar0To1::Load(const CDM::ScalarData& in, std::default_random_engine *rd) -{ - Clear(); - SEProperty::Load(in); - - if (in.deviation().present() && rd) { - auto nd = std::normal_distribution(in.value(), in.deviation().get()); - SetValue( std::clamp(nd(*rd), 0.0, 1.0)); - } else { - SetValue(in.value()); - } - if (in.unit().present()) { - std::string u = in.unit().get(); - if (!("unitless" == u || "" == u || u.empty())) { - throw CommonDataModelException("CDM::Scalar API is intended to be unitless, You are trying to load a ScalarData with a unit defined"); - } - } - m_readOnly = in.readOnly(); -} -//------------------------------------------------------------------------------- -CDM::Scalar0To1Data* SEScalar0To1::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::Scalar0To1Data* data(new CDM::Scalar0To1Data()); - SEScalar::Unload(*data); - return data; -} //------------------------------------------------------------------------------- void SEScalar0To1::SetValue(double d) { diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarAmount.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarAmount.cpp index c93242926..2121e71d4 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarAmount.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarAmount.cpp @@ -11,21 +11,14 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const AmountUnit AmountUnit::mol("mol"); const AmountUnit AmountUnit::pmol("pmol"); -template class SEScalarQuantity; - -//----------------------------------------------------------------------------- -SEScalarAmount::SEScalarAmount() - : SEScalarQuantity() -{ -} -//----------------------------------------------------------------------------- -SEScalarAmount::~SEScalarAmount() { - -} +template class BIOGEARS_API SEScalarQuantity; //----------------------------------------------------------------------------- AmountUnit::AmountUnit(const char* u) : AmountUnit(std::string{ u }) @@ -40,15 +33,7 @@ AmountUnit::AmountUnit(const std::string& u) AmountUnit::~AmountUnit() { } -//----------------------------------------------------------------------------- -CDM::ScalarAmountData* SEScalarAmount::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarAmountData* data(new CDM::ScalarAmountData()); - SEScalarQuantity::Unload(*data); - return data; -} + //----------------------------------------------------------------------------- bool AmountUnit::IsValidUnit(const char* unit) { diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarAmountPerMass.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarAmountPerMass.cpp index ff319bf93..0c7fe6421 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarAmountPerMass.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarAmountPerMass.cpp @@ -9,15 +9,20 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **************************************************************************************/ +#include +#include + #include +#include "io/cdm/Property.h" + namespace biogears { +template class BIOGEARS_API SEScalarQuantity; + AmountPerMassUnit AmountPerMassUnit::ct_Per_g("ct/g"); AmountPerMassUnit AmountPerMassUnit::ct_Per_ug("ct/ug"); -template class SEScalarQuantity; - //----------------------------------------------------------------------------- AmountPerMassUnit::AmountPerMassUnit(const char* u) : AmountPerMassUnit(std::string { u }) @@ -32,24 +37,6 @@ AmountPerMassUnit::AmountPerMassUnit(const std::string& u) AmountPerMassUnit::~AmountPerMassUnit(){ } //----------------------------------------------------------------------------- -SEScalarAmountPerMass::SEScalarAmountPerMass() - : SEScalarQuantity() -{ -} -//----------------------------------------------------------------------------- -SEScalarAmountPerMass::~SEScalarAmountPerMass() -{ -} -//----------------------------------------------------------------------------- -CDM::ScalarAmountPerMassData* SEScalarAmountPerMass::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarAmountPerMassData* data(new CDM::ScalarAmountPerMassData()); - SEScalarQuantity::Unload(*data); - return data; -} -//----------------------------------------------------------------------------- bool AmountPerMassUnit::IsValidUnit(const char* unit) { return IsValidUnit(std::string { unit }); diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarAmountPerTime.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarAmountPerTime.cpp index 8b8c9c994..d2deb627b 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarAmountPerTime.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarAmountPerTime.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { AmountPerTimeUnit AmountPerTimeUnit::mol_Per_day("mol/day"); @@ -20,7 +23,7 @@ AmountPerTimeUnit AmountPerTimeUnit::mmol_Per_min("mmol/min"); AmountPerTimeUnit AmountPerTimeUnit::pmol_Per_min("pmol/min"); AmountPerTimeUnit AmountPerTimeUnit::umol_Per_min("umol/min"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; ; AmountPerTimeUnit::AmountPerTimeUnit(const char* u) @@ -37,23 +40,6 @@ AmountPerTimeUnit::~AmountPerTimeUnit() { } //------------------------------------------------------------------------------- -SEScalarAmountPerTime::SEScalarAmountPerTime() -{ -} -//------------------------------------------------------------------------------- -SEScalarAmountPerTime::~SEScalarAmountPerTime() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarAmountPerTimeData* SEScalarAmountPerTime::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarAmountPerTimeData* data(new CDM::ScalarAmountPerTimeData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool AmountPerTimeUnit::IsValidUnit(const char* unit) { if (strcmp(mol_Per_day.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarAmountPerVolume.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarAmountPerVolume.cpp index 859d82629..d26d3b236 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarAmountPerVolume.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarAmountPerVolume.cpp @@ -10,6 +10,9 @@ CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { AmountPerVolumeUnit AmountPerVolumeUnit::mol_Per_L("mol/L"); @@ -19,7 +22,7 @@ AmountPerVolumeUnit AmountPerVolumeUnit::mmol_Per_mL("mmol/mL"); AmountPerVolumeUnit AmountPerVolumeUnit::ct_Per_L("ct/L"); AmountPerVolumeUnit AmountPerVolumeUnit::ct_Per_uL("ct/uL"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; AmountPerVolumeUnit::AmountPerVolumeUnit(const char* u) : AmountPerVolumeUnit(std::string { u }) @@ -35,23 +38,6 @@ AmountPerVolumeUnit::~AmountPerVolumeUnit() { } //------------------------------------------------------------------------------- -SEScalarAmountPerVolume::SEScalarAmountPerVolume() -{ -} -//------------------------------------------------------------------------------- -SEScalarAmountPerVolume::~SEScalarAmountPerVolume() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarAmountPerVolumeData* SEScalarAmountPerVolume::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarAmountPerVolumeData* data(new CDM::ScalarAmountPerVolumeData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool AmountPerVolumeUnit::IsValidUnit(const char* unit) { if (strcmp(mol_Per_L.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarArea.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarArea.cpp index 33a73246e..cb08d3834 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarArea.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarArea.cpp @@ -11,12 +11,15 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const AreaUnit AreaUnit::cm2("cm^2"); const AreaUnit AreaUnit::m2("m^2"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; AreaUnit::AreaUnit(const char* u) : AreaUnit(std::string { u }) @@ -28,24 +31,8 @@ AreaUnit::AreaUnit(const std::string& u) { } //----------------------------------------------------------------------------- -AreaUnit::~AreaUnit(){ -} -//----------------------------------------------------------------------------- -SEScalarArea::SEScalarArea() -{ -} -//----------------------------------------------------------------------------- -SEScalarArea::~SEScalarArea() -{ -} -//----------------------------------------------------------------------------- -CDM::ScalarAreaData* SEScalarArea::Unload() const +AreaUnit::~AreaUnit() { - if (!IsValid()) - return nullptr; - CDM::ScalarAreaData* data(new CDM::ScalarAreaData()); - SEScalarQuantity::Unload(*data); - return data; } //----------------------------------------------------------------------------- bool AreaUnit::IsValidUnit(const char* unit) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarAreaPerTimePressure.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarAreaPerTimePressure.cpp index 0d829c5ba..a9df87b64 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarAreaPerTimePressure.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarAreaPerTimePressure.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const AreaPerTimePressureUnit AreaPerTimePressureUnit::m2_Per_s_mmHg("m^2/s mmHg"); @@ -18,7 +21,7 @@ const AreaPerTimePressureUnit AreaPerTimePressureUnit::cm2_Per_s_mmHg("cm^2/s mm const AreaPerTimePressureUnit AreaPerTimePressureUnit::m2_Per_min_mmHg("m^2/min mmHg"); const AreaPerTimePressureUnit AreaPerTimePressureUnit::cm2_Per_min_mmHg("cm^2/min mmHg"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; //----------------------------------------------------------------------------- AreaPerTimePressureUnit::AreaPerTimePressureUnit(const char* u) @@ -35,23 +38,6 @@ AreaPerTimePressureUnit::~AreaPerTimePressureUnit() { } //----------------------------------------------------------------------------- -SEScalarAreaPerTimePressure::SEScalarAreaPerTimePressure() -{ -} -//----------------------------------------------------------------------------- -SEScalarAreaPerTimePressure::~SEScalarAreaPerTimePressure() -{ -} -//----------------------------------------------------------------------------- -CDM::ScalarAreaPerTimePressureData* SEScalarAreaPerTimePressure::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarAreaPerTimePressureData* data(new CDM::ScalarAreaPerTimePressureData()); - SEScalarQuantity::Unload(*data); - return data; -} -//----------------------------------------------------------------------------- bool AreaPerTimePressureUnit::IsValidUnit(const char* unit) { if (strcmp(m2_Per_s_mmHg.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarElectricCapacitance.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarElectricCapacitance.cpp index 3044c3fdd..c038d3473 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarElectricCapacitance.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarElectricCapacitance.cpp @@ -11,11 +11,14 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const ElectricCapacitanceUnit ElectricCapacitanceUnit::F("F"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; ElectricCapacitanceUnit::ElectricCapacitanceUnit(const char* u) : ElectricCapacitanceUnit(std::string { u }) @@ -31,21 +34,6 @@ ElectricCapacitanceUnit::~ElectricCapacitanceUnit() { } //----------------------------------------------------------------------------- -SEScalarElectricCapacitance::SEScalarElectricCapacitance(){ -} -//----------------------------------------------------------------------------- -SEScalarElectricCapacitance::~SEScalarElectricCapacitance(){ -} -//----------------------------------------------------------------------------- -CDM::ScalarElectricCapacitanceData* SEScalarElectricCapacitance::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarElectricCapacitanceData* data(new CDM::ScalarElectricCapacitanceData()); - SEScalarQuantity::Unload(*data); - return data; -} -//----------------------------------------------------------------------------- bool ElectricCapacitanceUnit::IsValidUnit(const char* unit) { if (strcmp(F.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarElectricCharge.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarElectricCharge.cpp index 0d4eb5e91..9d6a7e79b 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarElectricCharge.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarElectricCharge.cpp @@ -11,11 +11,14 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const ElectricChargeUnit ElectricChargeUnit::C("C"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; ElectricChargeUnit::ElectricChargeUnit(const char* u) : ElectricChargeUnit(std::string(u)) @@ -27,30 +30,13 @@ ElectricChargeUnit::ElectricChargeUnit(const std::string& u) { } //----------------------------------------------------------------------------- -ElectricChargeUnit::~ElectricChargeUnit(){ - -} -//----------------------------------------------------------------------------- -SEScalarElectricCharge::SEScalarElectricCharge(){ - -} -//----------------------------------------------------------------------------- -SEScalarElectricCharge::~SEScalarElectricCharge(){ - -} -//----------------------------------------------------------------------------- -CDM::ScalarElectricChargeData* SEScalarElectricCharge::Unload() const +ElectricChargeUnit::~ElectricChargeUnit() { - if (!IsValid()) - return nullptr; - CDM::ScalarElectricChargeData* data(new CDM::ScalarElectricChargeData()); - SEScalarQuantity::Unload(*data); - return data; } //----------------------------------------------------------------------------- bool ElectricChargeUnit::IsValidUnit(const char* unit) { - if (strcmp(C.GetString(),unit) == 0) + if (strcmp(C.GetString(), unit) == 0) return true; return false; } @@ -62,7 +48,7 @@ bool ElectricChargeUnit::IsValidUnit(const std::string& unit) //----------------------------------------------------------------------------- const ElectricChargeUnit& ElectricChargeUnit::GetCompoundUnit(const char* unit) { - if (strcmp(C.GetString(),unit) == 0) + if (strcmp(C.GetString(), unit) == 0) return C; std::stringstream err; err << unit << " is not a valid ElectricCharge unit"; diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarElectricCurrent.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarElectricCurrent.cpp index fd19e8aec..c1bc9a710 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarElectricCurrent.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarElectricCurrent.cpp @@ -11,11 +11,14 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const ElectricCurrentUnit ElectricCurrentUnit::A("A"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; ElectricCurrentUnit::ElectricCurrentUnit(const char* u) : ElectricCurrentUnit(std::string { u }) @@ -31,23 +34,6 @@ ElectricCurrentUnit::~ElectricCurrentUnit() { } //----------------------------------------------------------------------------- -SEScalarElectricCurrent::SEScalarElectricCurrent() -{ -} -//----------------------------------------------------------------------------- -SEScalarElectricCurrent::~SEScalarElectricCurrent() -{ -} -//----------------------------------------------------------------------------- -CDM::ScalarElectricCurrentData* SEScalarElectricCurrent::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarElectricCurrentData* data(new CDM::ScalarElectricCurrentData()); - SEScalarQuantity::Unload(*data); - return data; -} -//----------------------------------------------------------------------------- bool ElectricCurrentUnit::IsValidUnit(const char* unit) { if (strcmp(A.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarElectricInductance.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarElectricInductance.cpp index bd51584cf..3435610f3 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarElectricInductance.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarElectricInductance.cpp @@ -11,12 +11,14 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include +#include "io/cdm/Property.h" namespace biogears { const ElectricInductanceUnit ElectricInductanceUnit::H("H"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; ElectricInductanceUnit::ElectricInductanceUnit(const char* u) : ElectricInductanceUnit(std::string { u }) { @@ -31,23 +33,6 @@ ElectricInductanceUnit ::~ElectricInductanceUnit() { } //----------------------------------------------------------------------------- -SEScalarElectricInductance::SEScalarElectricInductance() -{ -} -//----------------------------------------------------------------------------- -SEScalarElectricInductance::~SEScalarElectricInductance() -{ -} -//----------------------------------------------------------------------------- -CDM::ScalarElectricInductanceData* SEScalarElectricInductance::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarElectricInductanceData* data(new CDM::ScalarElectricInductanceData()); - SEScalarQuantity::Unload(*data); - return data; -} -//----------------------------------------------------------------------------- bool ElectricInductanceUnit::IsValidUnit(const char* unit) { if (strcmp(H.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarElectricPotential.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarElectricPotential.cpp index d0634dee7..0587eacb6 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarElectricPotential.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarElectricPotential.cpp @@ -11,12 +11,15 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const ElectricPotentialUnit ElectricPotentialUnit::V("V"); const ElectricPotentialUnit ElectricPotentialUnit::mV("mV"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; ElectricPotentialUnit::ElectricPotentialUnit(const char* u) : ElectricPotentialUnit(std::string { u }) @@ -27,25 +30,10 @@ ElectricPotentialUnit::ElectricPotentialUnit(const std::string& u) : CCompoundUnit(u) { } -//----------------------------------------------------------------------------- -ElectricPotentialUnit::~ElectricPotentialUnit() -{ -} +ElectricPotentialUnit::~ElectricPotentialUnit() { -//----------------------------------------------------------------------------- -SEScalarElectricPotential::~SEScalarElectricPotential() -{ } -//----------------------------------------------------------------------------- -CDM::ScalarElectricPotentialData* SEScalarElectricPotential::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarElectricPotentialData* data(new CDM::ScalarElectricPotentialData()); - SEScalarQuantity::Unload(*data); - return data; -} -//----------------------------------------------------------------------------- + //----------------------------------------------------------------------------- bool ElectricPotentialUnit::IsValidUnit(const char* unit) { if (strcmp(V.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarElectricResistance.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarElectricResistance.cpp index 7f5e85e25..5a7d24710 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarElectricResistance.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarElectricResistance.cpp @@ -11,11 +11,14 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const ElectricResistanceUnit ElectricResistanceUnit::Ohm("ohm"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; ElectricResistanceUnit::ElectricResistanceUnit(const char* u) : ElectricResistanceUnit(std::string { u }) @@ -31,23 +34,6 @@ ElectricResistanceUnit::~ElectricResistanceUnit() { } //------------------------------------------------------------------------------- -SEScalarElectricResistance::SEScalarElectricResistance() -{ -} -//------------------------------------------------------------------------------- -SEScalarElectricResistance::~SEScalarElectricResistance() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarElectricResistanceData* SEScalarElectricResistance::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarElectricResistanceData* data(new CDM::ScalarElectricResistanceData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool ElectricResistanceUnit::IsValidUnit(const char* unit) { if (strcmp(Ohm.GetString(), unit) == 0) @@ -83,15 +69,4 @@ bool ElectricResistanceUnit::operator!=(const ElectricResistanceUnit& obj) const { return !(*this == obj); } -//------------------------------------------------------------------------------- - -bool SEScalarElectricResistance::operator==(const SEScalarElectricResistance& obj) const -{ - return SEScalarQuantity::operator==(obj); -} -//------------------------------------------------------------------------------- -bool SEScalarElectricResistance::operator!=(const SEScalarElectricResistance& obj) const -{ - return !(*this == obj); -} } \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarEnergy.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarEnergy.cpp index 936ab09b2..9cdb4175c 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarEnergy.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarEnergy.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const EnergyUnit EnergyUnit::J("J"); @@ -18,7 +21,7 @@ const EnergyUnit EnergyUnit::mJ("mJ"); const EnergyUnit EnergyUnit::kJ("kJ"); const EnergyUnit EnergyUnit::kcal("kcal"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; EnergyUnit::EnergyUnit(const char* u) : EnergyUnit(std::string { u }) @@ -34,24 +37,6 @@ EnergyUnit::~EnergyUnit() { } //------------------------------------------------------------------------------- -SEScalarEnergy::SEScalarEnergy() -{ -} -//------------------------------------------------------------------------------- -SEScalarEnergy::~SEScalarEnergy() -{ -} - -//------------------------------------------------------------------------------- -CDM::ScalarEnergyData* SEScalarEnergy::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarEnergyData* data(new CDM::ScalarEnergyData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool EnergyUnit::IsValidUnit(const char* unit) { if (strcmp(J.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarEnergyPerAmount.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarEnergyPerAmount.cpp index cee2f37e9..beca9aad9 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarEnergyPerAmount.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarEnergyPerAmount.cpp @@ -11,12 +11,15 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const EnergyPerAmountUnit EnergyPerAmountUnit::kcal_Per_mol("kcal/mol"); const EnergyPerAmountUnit EnergyPerAmountUnit::kJ_Per_mol("kJ/mol"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; EnergyPerAmountUnit::EnergyPerAmountUnit(const char* u) : EnergyPerAmountUnit(std::string { u }) @@ -32,23 +35,6 @@ EnergyPerAmountUnit::~EnergyPerAmountUnit() { } //----------------------------------------------------------------------------- -SEScalarEnergyPerAmount::SEScalarEnergyPerAmount() -{ -} -//----------------------------------------------------------------------------- -SEScalarEnergyPerAmount::~SEScalarEnergyPerAmount() -{ -} -//----------------------------------------------------------------------------- -CDM::ScalarEnergyPerAmountData* SEScalarEnergyPerAmount::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarEnergyPerAmountData* data(new CDM::ScalarEnergyPerAmountData()); - SEScalarQuantity::Unload(*data); - return data; -} -//----------------------------------------------------------------------------- bool EnergyPerAmountUnit::IsValidUnit(const char* unit) { if (strcmp(kcal_Per_mol.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarEnergyPerMass.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarEnergyPerMass.cpp index 13f437ee0..00867e050 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarEnergyPerMass.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarEnergyPerMass.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const EnergyPerMassUnit EnergyPerMassUnit::J_Per_kg("J/kg"); @@ -18,7 +21,7 @@ const EnergyPerMassUnit EnergyPerMassUnit::kJ_Per_kg("kJ/kg"); const EnergyPerMassUnit EnergyPerMassUnit::mJ_Per_kg("mJ/kg"); const EnergyPerMassUnit EnergyPerMassUnit::kcal_Per_kg("kcal/kg"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; EnergyPerMassUnit::EnergyPerMassUnit(const char* u) : EnergyPerMassUnit(std::string { u }) @@ -33,23 +36,6 @@ EnergyPerMassUnit::~EnergyPerMassUnit() { } //----------------------------------------------------------------------------- -SEScalarEnergyPerMass::SEScalarEnergyPerMass() -{ -} -//----------------------------------------------------------------------------- -SEScalarEnergyPerMass::~SEScalarEnergyPerMass() -{ -} -//----------------------------------------------------------------------------- -CDM::ScalarEnergyPerMassData* SEScalarEnergyPerMass::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarEnergyPerMassData* data(new CDM::ScalarEnergyPerMassData()); - SEScalarQuantity::Unload(*data); - return data; -} -//----------------------------------------------------------------------------- bool EnergyPerMassUnit::IsValidUnit(const char* unit) { if (strcmp(J_Per_kg.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarFlowCompliance.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarFlowCompliance.cpp index 92dfb535a..421e24b82 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarFlowCompliance.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarFlowCompliance.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const FlowComplianceUnit FlowComplianceUnit::L_Per_cmH2O("L/cmH2O"); @@ -18,7 +21,7 @@ const FlowComplianceUnit FlowComplianceUnit::mL_Per_mmHg("mL/mmHg"); const FlowComplianceUnit FlowComplianceUnit::mL_Per_cmH2O("mL/cmH2O"); const FlowComplianceUnit FlowComplianceUnit::m3_Per_Pa("m^3/Pa"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; FlowComplianceUnit::FlowComplianceUnit(const char* u) : FlowComplianceUnit(std::string { u }) @@ -34,23 +37,6 @@ FlowComplianceUnit::~FlowComplianceUnit() { } //----------------------------------------------------------------------------- -SEScalarFlowCompliance::SEScalarFlowCompliance() -{ -} -//----------------------------------------------------------------------------- -SEScalarFlowCompliance::~SEScalarFlowCompliance() -{ -} -//----------------------------------------------------------------------------- -CDM::ScalarFlowComplianceData* SEScalarFlowCompliance::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarFlowComplianceData* data(new CDM::ScalarFlowComplianceData()); - SEScalarQuantity::Unload(*data); - return data; -} -//----------------------------------------------------------------------------- bool FlowComplianceUnit::IsValidUnit(const char* unit) { if (strcmp(L_Per_cmH2O.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarFlowElastance.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarFlowElastance.cpp index f646a60d5..0ae4146ee 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarFlowElastance.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarFlowElastance.cpp @@ -11,13 +11,16 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const FlowElastanceUnit FlowElastanceUnit::cmH2O_Per_L("cmH2O/L"); const FlowElastanceUnit FlowElastanceUnit::mmHg_Per_mL("mmHg/mL"); const FlowElastanceUnit FlowElastanceUnit::Pa_Per_m3("Pa/m^3"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; FlowElastanceUnit::FlowElastanceUnit(const char* u) : FlowElastanceUnit(std::string { u }) @@ -33,23 +36,6 @@ FlowElastanceUnit::~FlowElastanceUnit() { } //----------------------------------------------------------------------------- -SEScalarFlowElastance::SEScalarFlowElastance() -{ -} -//----------------------------------------------------------------------------- -SEScalarFlowElastance::~SEScalarFlowElastance() -{ -} -//----------------------------------------------------------------------------- -CDM::ScalarFlowElastanceData* SEScalarFlowElastance::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarFlowElastanceData* data(new CDM::ScalarFlowElastanceData()); - SEScalarQuantity::Unload(*data); - return data; -} -//----------------------------------------------------------------------------- bool FlowElastanceUnit::IsValidUnit(const char* unit) { if (strcmp(cmH2O_Per_L.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarFlowInertance.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarFlowInertance.cpp index 9a8bb373e..3563f2815 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarFlowInertance.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarFlowInertance.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const FlowInertanceUnit FlowInertanceUnit::mmHg_s2_Per_mL("mmHg s^2/mL"); @@ -19,7 +22,7 @@ const FlowInertanceUnit FlowInertanceUnit::cmH2O_s2_Per_mL("cmH2O s^2/mL"); const FlowInertanceUnit FlowInertanceUnit::cmH2O_s2_Per_L("cmH2O s^2/L"); const FlowInertanceUnit FlowInertanceUnit::Pa_s2_Per_m3("Pa s^2/m^3"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; FlowInertanceUnit::FlowInertanceUnit(const char* u) : FlowInertanceUnit(std::string { u }) @@ -35,23 +38,6 @@ FlowInertanceUnit::~FlowInertanceUnit() { } //----------------------------------------------------------------------------- -SEScalarFlowInertance::SEScalarFlowInertance() -{ -} -//----------------------------------------------------------------------------- -SEScalarFlowInertance::~SEScalarFlowInertance() -{ -} -//----------------------------------------------------------------------------- -CDM::ScalarFlowInertanceData* SEScalarFlowInertance::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarFlowInertanceData* data(new CDM::ScalarFlowInertanceData()); - SEScalarQuantity::Unload(*data); - return data; -} -//----------------------------------------------------------------------------- bool FlowInertanceUnit::IsValidUnit(const char* unit) { if (strcmp(mmHg_s2_Per_mL.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarFlowResistance.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarFlowResistance.cpp index 80b47ca3a..6d4652226 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarFlowResistance.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarFlowResistance.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const FlowResistanceUnit FlowResistanceUnit::cmH2O_s_Per_L("cmH2O s/L"); @@ -19,7 +22,7 @@ const FlowResistanceUnit FlowResistanceUnit::mmHg_min_Per_mL("mmHg min/mL"); const FlowResistanceUnit FlowResistanceUnit::mmHg_min_Per_L("mmHg min/L"); const FlowResistanceUnit FlowResistanceUnit::Pa_s_Per_m3("Pa s/m^3"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; FlowResistanceUnit::FlowResistanceUnit(const char* u) : FlowResistanceUnit(std::string { u }) @@ -35,23 +38,6 @@ FlowResistanceUnit::~FlowResistanceUnit() { } //----------------------------------------------------------------------------- -SEScalarFlowResistance::SEScalarFlowResistance() -{ -} -//----------------------------------------------------------------------------- -SEScalarFlowResistance::~SEScalarFlowResistance() -{ -} -//----------------------------------------------------------------------------- -CDM::ScalarFlowResistanceData* SEScalarFlowResistance::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarFlowResistanceData* data(new CDM::ScalarFlowResistanceData()); - SEScalarQuantity::Unload(*data); - return data; -} -//----------------------------------------------------------------------------- bool FlowResistanceUnit::IsValidUnit(const char* unit) { if (strcmp(cmH2O_s_Per_L.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarForce.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarForce.cpp index b5415b5b4..4e3368267 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarForce.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarForce.cpp @@ -11,13 +11,16 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const ForceUnit ForceUnit::N("N"); const ForceUnit ForceUnit::lbf("lbf"); const ForceUnit ForceUnit::dyn("dyn"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; ForceUnit::ForceUnit(const char* u) : ForceUnit(std::string { u }) @@ -33,23 +36,6 @@ ForceUnit::~ForceUnit() { } //----------------------------------------------------------------------------- -SEScalarForce::SEScalarForce() -{ -} -//----------------------------------------------------------------------------- -SEScalarForce::~SEScalarForce() -{ -} -//----------------------------------------------------------------------------- -CDM::ScalarForceData* SEScalarForce::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarForceData* data(new CDM::ScalarForceData()); - SEScalarQuantity::Unload(*data); - return data; -} -//----------------------------------------------------------------------------- bool ForceUnit::IsValidUnit(const char* unit) { if (strcmp(N.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarFraction.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarFraction.cpp index 033ee0597..d30f4d240 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarFraction.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarFraction.cpp @@ -12,10 +12,17 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/Property.h" + namespace biogears { -SEScalarFraction::SEScalarFraction( double value, bool readOnly) +SEScalarFraction::SEScalarFraction(double value, bool readOnly) : SEScalar(value, readOnly) { +} +SEScalarFraction::SEScalarFraction(SEScalarFraction const& obj) + : SEScalar(obj.m_value, obj.m_readOnly) +{ + } //------------------------------------------------------------------------------- SEScalarFraction::SEScalarFraction() @@ -23,19 +30,12 @@ SEScalarFraction::SEScalarFraction() { } //------------------------------------------------------------------------------- -SEScalarFraction::~SEScalarFraction() { -} -//------------------------------------------------------------------------------- -CDM::ScalarFractionData* SEScalarFraction::Unload() const +SEScalarFraction::~SEScalarFraction() { - if (!IsValid()) - return nullptr; - CDM::ScalarFractionData* data(new CDM::ScalarFractionData()); - SEScalar::Unload(*data); - return data; } + //------------------------------------------------------------------------------- -//double SEScalarFraction::GetValue() const { +// double SEScalarFraction::GetValue() const { // return SEScalar::GetValue(); //} //------------------------------------------------------------------------------- @@ -44,7 +44,7 @@ double SEScalarFraction::GetValue(const NoUnit& unitless) const return SEScalar::GetValue(); } //------------------------------------------------------------------------------- -//void SEScalarFraction::SetValue(double d) +// void SEScalarFraction::SetValue(double d) //{ // SEScalar::SetValue(d); //} @@ -56,7 +56,7 @@ void SEScalarFraction::SetValue(double d, const NoUnit& unitless) //------------------------------------------------------------------------------- bool SEScalarFraction::operator==(const SEScalarFraction& obj) const { - return m_value == obj.m_value; + return m_value == obj.m_value; } //------------------------------------------------------------------------------- bool SEScalarFraction::operator!=(const SEScalarFraction& obj) const diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarFrequency.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarFrequency.cpp index 67e911a90..7ac6641e4 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarFrequency.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarFrequency.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const FrequencyUnit FrequencyUnit::Per_min("1/min"); @@ -18,7 +21,7 @@ const FrequencyUnit FrequencyUnit::Per_s("1/s"); const FrequencyUnit FrequencyUnit::Hz("Hz"); const FrequencyUnit FrequencyUnit::Per_hr("1/hr"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; FrequencyUnit::FrequencyUnit(const char* u) : FrequencyUnit(std::string { u }) @@ -34,23 +37,6 @@ FrequencyUnit::~FrequencyUnit() { } //----------------------------------------------------------------------------- -SEScalarFrequency::SEScalarFrequency() -{ -} -//----------------------------------------------------------------------------- -SEScalarFrequency::~SEScalarFrequency() -{ -} -//----------------------------------------------------------------------------- -CDM::ScalarFrequencyData* SEScalarFrequency::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarFrequencyData* data(new CDM::ScalarFrequencyData()); - SEScalarQuantity::Unload(*data); - return data; -} -//----------------------------------------------------------------------------- bool FrequencyUnit::IsValidUnit(const char* unit) { if (strcmp(Per_min.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatCapacitance.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatCapacitance.cpp index cb8213ffd..6e8244331 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatCapacitance.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatCapacitance.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const HeatCapacitanceUnit HeatCapacitanceUnit::J_Per_K("J/K"); @@ -18,7 +21,7 @@ const HeatCapacitanceUnit HeatCapacitanceUnit::kJ_Per_K("kJ/K"); const HeatCapacitanceUnit HeatCapacitanceUnit::kcal_Per_K("kcal/K"); const HeatCapacitanceUnit HeatCapacitanceUnit::kcal_Per_C("kcal/degC"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; HeatCapacitanceUnit::HeatCapacitanceUnit(const char* u) : HeatCapacitanceUnit(std::string { u }) @@ -34,23 +37,6 @@ HeatCapacitanceUnit::~HeatCapacitanceUnit() { } //------------------------------------------------------------------------------- -SEScalarHeatCapacitance::SEScalarHeatCapacitance() -{ -} -//------------------------------------------------------------------------------- -SEScalarHeatCapacitance::~SEScalarHeatCapacitance() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarHeatCapacitanceData* SEScalarHeatCapacitance::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarHeatCapacitanceData* data(new CDM::ScalarHeatCapacitanceData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool HeatCapacitanceUnit::IsValidUnit(const char* unit) { if (strcmp(J_Per_K.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatCapacitancePerAmount.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatCapacitancePerAmount.cpp index 2dc6d9568..1ae0da866 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatCapacitancePerAmount.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatCapacitancePerAmount.cpp @@ -11,11 +11,14 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const HeatCapacitancePerAmountUnit HeatCapacitancePerAmountUnit::J_Per_K_mol("J/K mol"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; HeatCapacitancePerAmountUnit::HeatCapacitancePerAmountUnit(const char* u) : HeatCapacitancePerAmountUnit(std::string { u }) @@ -31,23 +34,6 @@ HeatCapacitancePerAmountUnit::~HeatCapacitancePerAmountUnit() { } //------------------------------------------------------------------------------- -SEScalarHeatCapacitancePerAmount::SEScalarHeatCapacitancePerAmount() -{ -} -//------------------------------------------------------------------------------- -SEScalarHeatCapacitancePerAmount::~SEScalarHeatCapacitancePerAmount() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarHeatCapacitancePerAmountData* SEScalarHeatCapacitancePerAmount::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarHeatCapacitancePerAmountData* data(new CDM::ScalarHeatCapacitancePerAmountData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool HeatCapacitancePerAmountUnit::IsValidUnit(const char* unit) { if (strcmp(J_Per_K_mol.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatCapacitancePerMass.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatCapacitancePerMass.cpp index d3632707d..cca22ef53 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatCapacitancePerMass.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatCapacitancePerMass.cpp @@ -11,13 +11,17 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" + namespace biogears { const HeatCapacitancePerMassUnit HeatCapacitancePerMassUnit::J_Per_K_kg("J/K kg"); const HeatCapacitancePerMassUnit HeatCapacitancePerMassUnit::kJ_Per_K_kg("kJ/K kg"); const HeatCapacitancePerMassUnit HeatCapacitancePerMassUnit::kcal_Per_K_kg("kcal/K kg"); const HeatCapacitancePerMassUnit HeatCapacitancePerMassUnit::kcal_Per_C_kg("kcal/degC kg"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; HeatCapacitancePerMassUnit::HeatCapacitancePerMassUnit(const char* u) : HeatCapacitancePerMassUnit(std::string { u }) @@ -33,23 +37,6 @@ HeatCapacitancePerMassUnit::~HeatCapacitancePerMassUnit() { } //------------------------------------------------------------------------------- -SEScalarHeatCapacitancePerMass::SEScalarHeatCapacitancePerMass() -{ -} -//------------------------------------------------------------------------------- -SEScalarHeatCapacitancePerMass::~SEScalarHeatCapacitancePerMass() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarHeatCapacitancePerMassData* SEScalarHeatCapacitancePerMass::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarHeatCapacitancePerMassData* data(new CDM::ScalarHeatCapacitancePerMassData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool HeatCapacitancePerMassUnit::IsValidUnit(const char* unit) { if (strcmp(J_Per_K_kg.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatConductance.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatConductance.cpp index cb911d71e..82aab348b 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatConductance.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatConductance.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const HeatConductanceUnit HeatConductanceUnit::W_Per_K("W/K"); @@ -18,7 +21,7 @@ const HeatConductanceUnit HeatConductanceUnit::W_Per_C("W/degC"); const HeatConductanceUnit HeatConductanceUnit::kcal_Per_K_s("kcal/K s"); const HeatConductanceUnit HeatConductanceUnit::kcal_Per_C_s("kcal/degC s"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; HeatConductanceUnit::HeatConductanceUnit(const char* u) : HeatConductanceUnit(std::string { u }) @@ -34,23 +37,6 @@ HeatConductanceUnit::~HeatConductanceUnit() { } //------------------------------------------------------------------------------- -SEScalarHeatConductance::SEScalarHeatConductance() -{ -} -//------------------------------------------------------------------------------- -SEScalarHeatConductance::~SEScalarHeatConductance() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarHeatConductanceData* SEScalarHeatConductance::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarHeatConductanceData* data(new CDM::ScalarHeatConductanceData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool HeatConductanceUnit::IsValidUnit(const char* unit) { if (strcmp(W_Per_K.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatConductancePerArea.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatConductancePerArea.cpp index 350cf1743..f58d5eb23 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatConductancePerArea.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatConductancePerArea.cpp @@ -11,13 +11,16 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const HeatConductancePerAreaUnit HeatConductancePerAreaUnit::W_Per_m2_K("W/m^2 K"); const HeatConductancePerAreaUnit HeatConductancePerAreaUnit::W_Per_m2_C("W/m^2 degC"); const HeatConductancePerAreaUnit HeatConductancePerAreaUnit::BTU_Per_hr_ft2_C("BTU/hr ft^2 degC"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; HeatConductancePerAreaUnit::HeatConductancePerAreaUnit(const char* u) : HeatConductancePerAreaUnit(std::string { u }) @@ -33,23 +36,6 @@ HeatConductancePerAreaUnit::~HeatConductancePerAreaUnit() { } //------------------------------------------------------------------------------- -SEScalarHeatConductancePerArea::SEScalarHeatConductancePerArea() -{ -} -//------------------------------------------------------------------------------- -SEScalarHeatConductancePerArea::~SEScalarHeatConductancePerArea() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarHeatConductancePerAreaData* SEScalarHeatConductancePerArea::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarHeatConductancePerAreaData* data(new CDM::ScalarHeatConductancePerAreaData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool HeatConductancePerAreaUnit::IsValidUnit(const char* unit) { if (strcmp(W_Per_m2_K.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatInductance.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatInductance.cpp index 6f2e0c0cc..692f78559 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatInductance.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatInductance.cpp @@ -11,11 +11,14 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const HeatInductanceUnit HeatInductanceUnit::K_s_Per_W("K s/W"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; HeatInductanceUnit::HeatInductanceUnit(const char* u) : HeatInductanceUnit(std::string { u }) @@ -31,23 +34,6 @@ HeatInductanceUnit::~HeatInductanceUnit() { } //------------------------------------------------------------------------------- -SEScalarHeatInductance::SEScalarHeatInductance() -{ -} -//------------------------------------------------------------------------------ -SEScalarHeatInductance::~SEScalarHeatInductance() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarHeatInductanceData* SEScalarHeatInductance::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarHeatInductanceData* data(new CDM::ScalarHeatInductanceData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool HeatInductanceUnit::IsValidUnit(const char* unit) { if (strcmp(K_s_Per_W.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatResistance.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatResistance.cpp index 32848c41a..c0b422f46 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatResistance.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatResistance.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const HeatResistanceUnit HeatResistanceUnit::K_Per_W("K/W"); @@ -18,7 +21,7 @@ const HeatResistanceUnit HeatResistanceUnit::C_Per_W("degC/W"); const HeatResistanceUnit HeatResistanceUnit::K_s_Per_kcal("K s/kcal"); const HeatResistanceUnit HeatResistanceUnit::C_s_Per_kcal("degC s/kcal"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; HeatResistanceUnit::HeatResistanceUnit(const char* u) : HeatResistanceUnit(std::string { u }) @@ -34,23 +37,6 @@ HeatResistanceUnit::~HeatResistanceUnit() { } //------------------------------------------------------------------------------- -SEScalarHeatResistance::SEScalarHeatResistance() -{ -} -//------------------------------------------------------------------------------- -SEScalarHeatResistance::~SEScalarHeatResistance() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarHeatResistanceData* SEScalarHeatResistance::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarHeatResistanceData* data(new CDM::ScalarHeatResistanceData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool HeatResistanceUnit::IsValidUnit(const char* unit) { if (strcmp(K_Per_W.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatResistanceArea.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatResistanceArea.cpp index 30c31f1d8..18de833e2 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatResistanceArea.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarHeatResistanceArea.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include +#include "io/cdm/Property.h" namespace biogears { const HeatResistanceAreaUnit HeatResistanceAreaUnit::rsi("rsi"); @@ -18,7 +20,7 @@ const HeatResistanceAreaUnit HeatResistanceAreaUnit::clo("clo"); const HeatResistanceAreaUnit HeatResistanceAreaUnit::rValue("rValue"); const HeatResistanceAreaUnit HeatResistanceAreaUnit::tog("tog"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; HeatResistanceAreaUnit::HeatResistanceAreaUnit(const char* u) : HeatResistanceAreaUnit(std::string { u }) @@ -33,24 +35,6 @@ HeatResistanceAreaUnit::HeatResistanceAreaUnit(const std::string& u) HeatResistanceAreaUnit::~HeatResistanceAreaUnit(){ } //------------------------------------------------------------------------------- -SEScalarHeatResistanceArea::SEScalarHeatResistanceArea() -{ -} -//------------------------------------------------------------------------------- -SEScalarHeatResistanceArea::~SEScalarHeatResistanceArea() -{ -} - -//------------------------------------------------------------------------------- -CDM::ScalarHeatResistanceAreaData* SEScalarHeatResistanceArea::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarHeatResistanceAreaData* data(new CDM::ScalarHeatResistanceAreaData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool HeatResistanceAreaUnit::IsValidUnit(const char* unit) { if (strcmp(rsi.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarInversePressure.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarInversePressure.cpp index 792fa86a4..d87f50fbc 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarInversePressure.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarInversePressure.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const InversePressureUnit InversePressureUnit::Inverse_Pa("1/Pa"); @@ -18,7 +21,7 @@ const InversePressureUnit InversePressureUnit::Inverse_mmHg("1/mmHg"); const InversePressureUnit InversePressureUnit::Inverse_cmH2O("1/cmH2O"); const InversePressureUnit InversePressureUnit::Inverse_atm("1/atm"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; InversePressureUnit::InversePressureUnit(const char* u) : InversePressureUnit(std::string { u }) @@ -33,23 +36,6 @@ InversePressureUnit::~InversePressureUnit() { } //------------------------------------------------------------------------------- -SEScalarInversePressure::SEScalarInversePressure() -{ -} -//------------------------------------------------------------------------------- -SEScalarInversePressure::~SEScalarInversePressure() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarInversePressureData* SEScalarInversePressure::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarInversePressureData* data(new CDM::ScalarInversePressureData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool InversePressureUnit::IsValidUnit(const char* unit) { if (strcmp(Inverse_Pa.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarInverseVolume.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarInverseVolume.cpp index 118f9e9ae..2260b31a6 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarInverseVolume.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarInverseVolume.cpp @@ -11,12 +11,15 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const InverseVolumeUnit InverseVolumeUnit::Inverse_L("1/L"); const InverseVolumeUnit InverseVolumeUnit::Inverse_mL("1/mL"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; InverseVolumeUnit::InverseVolumeUnit(const char* u) : InverseVolumeUnit(std::string { u }) @@ -32,23 +35,6 @@ InverseVolumeUnit::~InverseVolumeUnit() { } //------------------------------------------------------------------------------- -SEScalarInverseVolume::SEScalarInverseVolume() -{ -} -//------------------------------------------------------------------------------- -SEScalarInverseVolume::~SEScalarInverseVolume() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarInverseVolumeData* SEScalarInverseVolume::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarInverseVolumeData* data(new CDM::ScalarInverseVolumeData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool InverseVolumeUnit::IsValidUnit(const char* unit) { if (strcmp(Inverse_L.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarLength.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarLength.cpp index 6c20cb91d..b356a46f9 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarLength.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarLength.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const LengthUnit LengthUnit::m("m"); @@ -20,7 +23,7 @@ const LengthUnit LengthUnit::um("um"); const LengthUnit LengthUnit::inch("in"); const LengthUnit LengthUnit::ft("ft"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; LengthUnit::LengthUnit(const char* u) : LengthUnit(std::string { u }) @@ -36,23 +39,6 @@ LengthUnit::~LengthUnit() { } //------------------------------------------------------------------------------- -SEScalarLength::SEScalarLength() -{ -} -//------------------------------------------------------------------------------- -SEScalarLength::~SEScalarLength() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarLengthData* SEScalarLength::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarLengthData* data(new CDM::ScalarLengthData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool LengthUnit::IsValidUnit(const char* unit) { if (strcmp(m.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarLengthPerTime.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarLengthPerTime.cpp index d4b9e2a2b..a9a6607b4 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarLengthPerTime.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarLengthPerTime.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const LengthPerTimeUnit LengthPerTimeUnit::m_Per_s("m/s"); @@ -20,7 +23,7 @@ const LengthPerTimeUnit LengthPerTimeUnit::cm_Per_min("cm/min"); const LengthPerTimeUnit LengthPerTimeUnit::ft_Per_s("ft/s"); const LengthPerTimeUnit LengthPerTimeUnit::ft_Per_min("ft/min"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; LengthPerTimeUnit::LengthPerTimeUnit(const char* u) : CCompoundUnit(u) @@ -36,23 +39,6 @@ LengthPerTimeUnit::~LengthPerTimeUnit() { } //------------------------------------------------------------------------------- -SEScalarLengthPerTime::SEScalarLengthPerTime() -{ -} -//------------------------------------------------------------------------------- -SEScalarLengthPerTime::~SEScalarLengthPerTime() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarLengthPerTimeData* SEScalarLengthPerTime::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarLengthPerTimeData* data(new CDM::ScalarLengthPerTimeData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool LengthPerTimeUnit::IsValidUnit(const char* unit) { if (strcmp(m_Per_s.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarLengthPerTimePressure.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarLengthPerTimePressure.cpp index 41f1899e3..fffdf4539 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarLengthPerTimePressure.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarLengthPerTimePressure.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const LengthPerTimePressureUnit LengthPerTimePressureUnit::m_Per_s_mmHg("m/s mmHg"); @@ -18,7 +21,7 @@ const LengthPerTimePressureUnit LengthPerTimePressureUnit::cm_Per_s_mmHg("cm/s m const LengthPerTimePressureUnit LengthPerTimePressureUnit::m_Per_min_mmHg("m/min mmHg"); const LengthPerTimePressureUnit LengthPerTimePressureUnit::cm_Per_min_mmHg("cm/min mmHg"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; LengthPerTimePressureUnit::LengthPerTimePressureUnit(const char* u) : LengthPerTimePressureUnit(std::string { u }) @@ -34,23 +37,6 @@ LengthPerTimePressureUnit::~LengthPerTimePressureUnit() { } //------------------------------------------------------------------------------- -SEScalarLengthPerTimePressure::SEScalarLengthPerTimePressure() -{ -} -//------------------------------------------------------------------------------- -SEScalarLengthPerTimePressure::~SEScalarLengthPerTimePressure() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarLengthPerTimePressureData* SEScalarLengthPerTimePressure::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarLengthPerTimePressureData* data(new CDM::ScalarLengthPerTimePressureData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool LengthPerTimePressureUnit::IsValidUnit(const char* unit) { if (strcmp(m_Per_s_mmHg.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarMass.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarMass.cpp index 267182e12..345555f16 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarMass.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarMass.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const MassUnit MassUnit::g("g"); @@ -19,7 +22,7 @@ const MassUnit MassUnit::mg("mg"); const MassUnit MassUnit::kg("kg"); const MassUnit MassUnit::lb("lb"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; MassUnit::MassUnit(const char* u) : MassUnit(std::string { u }) @@ -35,29 +38,6 @@ MassUnit::~MassUnit() { } //------------------------------------------------------------------------------- -SEScalarMass::SEScalarMass() -{ -} -//------------------------------------------------------------------------------- -SEScalarMass::SEScalarMass(double value, MassUnit const& unit) - : SEScalarQuantity(value,unit) -{ - -} -//------------------------------------------------------------------------------- -SEScalarMass::~SEScalarMass() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarMassData* SEScalarMass::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarMassData* data(new CDM::ScalarMassData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool MassUnit::IsValidUnit(const char* unit) { if (strcmp(g.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarMassPerAmount.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarMassPerAmount.cpp index e5b746f96..b7d103f7b 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarMassPerAmount.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarMassPerAmount.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const MassPerAmountUnit MassPerAmountUnit::g_Per_ct("g/ct"); @@ -25,7 +28,7 @@ const MassPerAmountUnit MassPerAmountUnit::ug_Per_mol("ug/mol"); const MassPerAmountUnit MassPerAmountUnit::ug_Per_ct("ug/ct"); const MassPerAmountUnit MassPerAmountUnit::pg_Per_ct("pg/ct"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; MassPerAmountUnit::MassPerAmountUnit(const char* u) : MassPerAmountUnit(std::string { u }) @@ -41,23 +44,6 @@ MassPerAmountUnit::~MassPerAmountUnit() { } //------------------------------------------------------------------------------- -SEScalarMassPerAmount::SEScalarMassPerAmount() -{ -} -//------------------------------------------------------------------------------- -SEScalarMassPerAmount::~SEScalarMassPerAmount() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarMassPerAmountData* SEScalarMassPerAmount::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarMassPerAmountData* data(new CDM::ScalarMassPerAmountData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool MassPerAmountUnit::IsValidUnit(const char* unit) { if (strcmp(g_Per_ct.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarMassPerAreaTime.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarMassPerAreaTime.cpp index 56af39cad..2c9007eff 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarMassPerAreaTime.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarMassPerAreaTime.cpp @@ -11,11 +11,14 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const MassPerAreaTimeUnit MassPerAreaTimeUnit::g_Per_cm2_s("g/cm^2 s"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; MassPerAreaTimeUnit::MassPerAreaTimeUnit(const char* u) : MassPerAreaTimeUnit(std::string { u }) @@ -30,23 +33,7 @@ MassPerAreaTimeUnit::MassPerAreaTimeUnit(const std::string& u) MassPerAreaTimeUnit::~MassPerAreaTimeUnit() { } -//------------------------------------------------------------------------------- -SEScalarMassPerAreaTime::SEScalarMassPerAreaTime() -{ -} -//------------------------------------------------------------------------------- -SEScalarMassPerAreaTime::~SEScalarMassPerAreaTime() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarMassPerAreaTimeData* SEScalarMassPerAreaTime::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarMassPerAreaTimeData* data(new CDM::ScalarMassPerAreaTimeData()); - SEScalarQuantity::Unload(*data); - return data; -} + //------------------------------------------------------------------------------- bool MassPerAreaTimeUnit::IsValidUnit(const char* unit) { diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarMassPerMass.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarMassPerMass.cpp index e2666ea22..c56e7a78b 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarMassPerMass.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarMassPerMass.cpp @@ -11,12 +11,15 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const MassPerMassUnit MassPerMassUnit::ug_Per_kg("ug/kg"); const MassPerMassUnit MassPerMassUnit::mg_Per_g("mg/g"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; MassPerMassUnit::MassPerMassUnit(const char* u) : MassPerMassUnit(std::string { u }) @@ -30,22 +33,6 @@ MassPerMassUnit::MassPerMassUnit(const std::string& u) //------------------------------------------------------------------------------- MassPerMassUnit::~MassPerMassUnit() { -} //------------------------------------------------------------------------------- -SEScalarMassPerMass::SEScalarMassPerMass() -{ -} -//------------------------------------------------------------------------------- -SEScalarMassPerMass::~SEScalarMassPerMass() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarMassPerMassData* SEScalarMassPerMass::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarMassPerMassData* data(new CDM::ScalarMassPerMassData()); - SEScalarQuantity::Unload(*data); - return data; } //------------------------------------------------------------------------------- bool MassPerMassUnit::IsValidUnit(const char* unit) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarMassPerTime.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarMassPerTime.cpp index 5bf23f06e..3a3089a67 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarMassPerTime.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarMassPerTime.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const MassPerTimeUnit MassPerTimeUnit::g_Per_s("g/s"); @@ -22,7 +25,7 @@ const MassPerTimeUnit MassPerTimeUnit::ug_Per_s("ug/s"); const MassPerTimeUnit MassPerTimeUnit::kg_Per_s("kg/s"); const MassPerTimeUnit MassPerTimeUnit::ug_Per_min("ug/min"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; MassPerTimeUnit::MassPerTimeUnit(const char* u) : MassPerTimeUnit(std::string { u }) @@ -38,23 +41,6 @@ MassPerTimeUnit::~MassPerTimeUnit() { } //------------------------------------------------------------------------------- -SEScalarMassPerTime::SEScalarMassPerTime() -{ -} -//------------------------------------------------------------------------------- -SEScalarMassPerTime::~SEScalarMassPerTime() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarMassPerTimeData* SEScalarMassPerTime::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarMassPerTimeData* data(new CDM::ScalarMassPerTimeData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool MassPerTimeUnit::IsValidUnit(const char* unit) { if (strcmp(g_Per_s.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarMassPerVolume.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarMassPerVolume.cpp index 13915ffbe..86fa2b667 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarMassPerVolume.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarMassPerVolume.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { @@ -29,7 +32,7 @@ const MassPerVolumeUnit MassPerVolumeUnit::mg_Per_dL("mg/dL"); const MassPerVolumeUnit MassPerVolumeUnit::kg_Per_mL("kg/mL"); const MassPerVolumeUnit MassPerVolumeUnit::kg_Per_L("kg/L"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; MassPerVolumeUnit::MassPerVolumeUnit(const char* u) : MassPerVolumeUnit(std::string { u }) @@ -44,15 +47,7 @@ MassPerVolumeUnit::MassPerVolumeUnit(const std::string& u) MassPerVolumeUnit::~MassPerVolumeUnit() { } -//------------------------------------------------------------------------------- -CDM::ScalarMassPerVolumeData* SEScalarMassPerVolume::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarMassPerVolumeData* data(new CDM::ScalarMassPerVolumeData()); - SEScalarQuantity::Unload(*data); - return data; -} + //------------------------------------------------------------------------------- bool MassPerVolumeUnit::IsValidUnit(const char* unit) { @@ -132,24 +127,6 @@ const MassPerVolumeUnit& MassPerVolumeUnit::GetCompoundUnit(const std::string& u return GetCompoundUnit(unit.c_str()); } //------------------------------------------------------------------------------- -SEScalarMassPerVolume::SEScalarMassPerVolume() -{ -} -//------------------------------------------------------------------------------- -SEScalarMassPerVolume::SEScalarMassPerVolume(const SEScalarMassPerVolume& obj) - : SEScalarQuantity(obj) -{ -} -//------------------------------------------------------------------------------- -SEScalarMassPerVolume::SEScalarMassPerVolume(double v, const MassPerVolumeUnit& u) - : SEScalarQuantity(v, u) -{ -} -//------------------------------------------------------------------------------- -SEScalarMassPerVolume::~SEScalarMassPerVolume() -{ -} -//------------------------------------------------------------------------------- bool MassPerVolumeUnit::operator==(const MassPerVolumeUnit& obj) const { return CCompoundUnit::operator==(obj); diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarNeg1To1.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarNeg1To1.cpp index 535b11453..c002001b0 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarNeg1To1.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarNeg1To1.cpp @@ -11,25 +11,25 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { SEScalarNeg1To1::SEScalarNeg1To1() : SEScalar() { } -//------------------------------------------------------------------------------- -SEScalarNeg1To1::~SEScalarNeg1To1() +SEScalarNeg1To1::SEScalarNeg1To1(SEScalarNeg1To1 const& obj) + : SEScalar(obj.m_value, obj.m_readOnly) { + } //------------------------------------------------------------------------------- -CDM::ScalarNeg1To1Data* SEScalarNeg1To1::Unload() const +SEScalarNeg1To1::~SEScalarNeg1To1() { - if (!IsValid()) - return nullptr; - CDM::ScalarNeg1To1Data* data(new CDM::ScalarNeg1To1Data()); - SEScalar::Unload(*data); - return data; } + //------------------------------------------------------------------------------- double SEScalarNeg1To1::GetValue(const NoUnit& unitless) const { diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarOsmolality.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarOsmolality.cpp index 6277c24bb..1c4b2f886 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarOsmolality.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarOsmolality.cpp @@ -11,12 +11,15 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const OsmolalityUnit OsmolalityUnit::Osm_Per_kg("Osm/kg"); const OsmolalityUnit OsmolalityUnit::mOsm_Per_kg("mOsm/kg"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; OsmolalityUnit::OsmolalityUnit(const char* u) : OsmolalityUnit(std::string { u }) @@ -31,23 +34,7 @@ OsmolalityUnit::OsmolalityUnit(const std::string& u) OsmolalityUnit::~OsmolalityUnit() { } -//------------------------------------------------------------------------------- -SEScalarOsmolality::SEScalarOsmolality() -{ -} -//------------------------------------------------------------------------------- -SEScalarOsmolality::~SEScalarOsmolality() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarOsmolalityData* SEScalarOsmolality::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarOsmolalityData* data(new CDM::ScalarOsmolalityData()); - SEScalarQuantity::Unload(*data); - return data; -} + //------------------------------------------------------------------------------- bool OsmolalityUnit::IsValidUnit(const char* unit) { diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarOsmolarity.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarOsmolarity.cpp index e0a3c577b..e21729600 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarOsmolarity.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarOsmolarity.cpp @@ -11,12 +11,15 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const OsmolarityUnit OsmolarityUnit::Osm_Per_L("Osm/L"); const OsmolarityUnit OsmolarityUnit::mOsm_Per_L("mOsm/L"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; OsmolarityUnit::OsmolarityUnit(const char* u) : OsmolarityUnit(std::string { u }) @@ -31,21 +34,6 @@ OsmolarityUnit::OsmolarityUnit(const std::string& u) OsmolarityUnit::~OsmolarityUnit() { } -//------------------------------------------------------------------------------- - SEScalarOsmolarity::SEScalarOsmolarity(){ - } - //------------------------------------------------------------------------------- - SEScalarOsmolarity::~SEScalarOsmolarity(){ - } -//------------------------------------------------------------------------------- -CDM::ScalarOsmolarityData* SEScalarOsmolarity::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarOsmolarityData* data(new CDM::ScalarOsmolarityData()); - SEScalarQuantity::Unload(*data); - return data; -} //------------------------------------------------------------------------------- bool OsmolarityUnit::IsValidUnit(const char* unit) { diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarPower.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarPower.cpp index f44fe8187..1d34932b7 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarPower.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarPower.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const PowerUnit PowerUnit::W("W"); @@ -20,7 +23,7 @@ const PowerUnit PowerUnit::kcal_Per_day("kcal/day"); const PowerUnit PowerUnit::J_Per_s("J/s"); const PowerUnit PowerUnit::BTU_Per_hr("BTU/hr"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; PowerUnit::PowerUnit(const char* u) : PowerUnit(std::string { u }) @@ -36,23 +39,6 @@ PowerUnit::~PowerUnit() { } //------------------------------------------------------------------------------- -SEScalarPower::SEScalarPower() -{ -} -//------------------------------------------------------------------------------- -SEScalarPower::~SEScalarPower() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarPowerData* SEScalarPower::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarPowerData* data(new CDM::ScalarPowerData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool PowerUnit::IsValidUnit(const char* unit) { if (strcmp(W.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarPowerPerAreaTemperatureToTheFourth.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarPowerPerAreaTemperatureToTheFourth.cpp index c91106af4..83336bc2a 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarPowerPerAreaTemperatureToTheFourth.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarPowerPerAreaTemperatureToTheFourth.cpp @@ -11,11 +11,14 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const PowerPerAreaTemperatureToTheFourthUnit PowerPerAreaTemperatureToTheFourthUnit::W_Per_m2_K4("W/ m^2 K^4"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; PowerPerAreaTemperatureToTheFourthUnit::PowerPerAreaTemperatureToTheFourthUnit(const char* u) : PowerPerAreaTemperatureToTheFourthUnit(std::string { u }) @@ -31,23 +34,6 @@ PowerPerAreaTemperatureToTheFourthUnit::~PowerPerAreaTemperatureToTheFourthUnit( { } //------------------------------------------------------------------------------- -SEScalarPowerPerAreaTemperatureToTheFourth::SEScalarPowerPerAreaTemperatureToTheFourth() -{ -} -//------------------------------------------------------------------------------- -SEScalarPowerPerAreaTemperatureToTheFourth::~SEScalarPowerPerAreaTemperatureToTheFourth() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarPowerPerAreaTemperatureToTheFourthData* SEScalarPowerPerAreaTemperatureToTheFourth::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarPowerPerAreaTemperatureToTheFourthData* data(new CDM::ScalarPowerPerAreaTemperatureToTheFourthData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool PowerPerAreaTemperatureToTheFourthUnit::IsValidUnit(const char* unit) { if (strcmp(W_Per_m2_K4.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarPressure.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarPressure.cpp index 46049ddec..d4c9885a1 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarPressure.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarPressure.cpp @@ -11,7 +11,10 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include +#include "io/cdm/Property.h" + namespace biogears { const PressureUnit PressureUnit::Pa("Pa"); const PressureUnit PressureUnit::mmHg("mmHg"); @@ -19,7 +22,7 @@ const PressureUnit PressureUnit::cmH2O("cmH2O"); const PressureUnit PressureUnit::psi("psi"); const PressureUnit PressureUnit::atm("atm"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; PressureUnit::PressureUnit(const char* u) : PressureUnit(std::string { u }) @@ -35,23 +38,6 @@ PressureUnit::~PressureUnit() { } //------------------------------------------------------------------------------- -SEScalarPressure::SEScalarPressure() -{ -} -//------------------------------------------------------------------------------- -SEScalarPressure::~SEScalarPressure() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarPressureData* SEScalarPressure::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarPressureData* data(new CDM::ScalarPressureData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool PressureUnit::IsValidUnit(const char* unit) { if (strcmp(Pa.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarPressurePerVolume.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarPressurePerVolume.cpp index d180466c9..1329296eb 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarPressurePerVolume.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarPressurePerVolume.cpp @@ -11,12 +11,15 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const PressurePerVolumeUnit PressurePerVolumeUnit::mmHg_Per_mL("mmHg/mL"); const PressurePerVolumeUnit PressurePerVolumeUnit::cmH2O_Per_mL("cmH2O/mL"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; PressurePerVolumeUnit::PressurePerVolumeUnit(const char* u) : PressurePerVolumeUnit(std::string { u }) @@ -32,23 +35,6 @@ PressurePerVolumeUnit::~PressurePerVolumeUnit() { } //------------------------------------------------------------------------------- -SEScalarPressurePerVolume::SEScalarPressurePerVolume() -{ -} -//------------------------------------------------------------------------------- -SEScalarPressurePerVolume::~SEScalarPressurePerVolume(){ - -} -//------------------------------------------------------------------------------- -CDM::ScalarPressurePerVolumeData* SEScalarPressurePerVolume::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarPressurePerVolumeData* data(new CDM::ScalarPressurePerVolumeData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool PressurePerVolumeUnit::IsValidUnit(const char* unit) { if (strcmp(mmHg_Per_mL.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarPressureTimePerArea.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarPressureTimePerArea.cpp index a948e76f1..8fd8496e7 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarPressureTimePerArea.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarPressureTimePerArea.cpp @@ -11,12 +11,15 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const PressureTimePerAreaUnit PressureTimePerAreaUnit::mmHg_Per_mL_m2("mmHg/mL m^2"); const PressureTimePerAreaUnit PressureTimePerAreaUnit::cmH2O_Per_mL_m2("cmH2O/mL m^2"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; PressureTimePerAreaUnit::~PressureTimePerAreaUnit(){ @@ -32,23 +35,6 @@ PressureTimePerAreaUnit::PressureTimePerAreaUnit(const std::string& u) { } //------------------------------------------------------------------------------- -SEScalarPressureTimePerArea::SEScalarPressureTimePerArea() -{ -} -//------------------------------------------------------------------------------- -SEScalarPressureTimePerArea::~SEScalarPressureTimePerArea() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarPressureTimePerAreaData* SEScalarPressureTimePerArea::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarPressureTimePerAreaData* data(new CDM::ScalarPressureTimePerAreaData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool PressureTimePerAreaUnit::IsValidUnit(const char* unit) { if (strcmp(mmHg_Per_mL_m2.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarPressureTimePerVolumeArea.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarPressureTimePerVolumeArea.cpp index 542480ca3..9a8e5276f 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarPressureTimePerVolumeArea.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarPressureTimePerVolumeArea.cpp @@ -11,13 +11,16 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const PressureTimePerVolumeAreaUnit PressureTimePerVolumeAreaUnit::mmHg_min_Per_mL_m2("mmHg min/mL m^2"); const PressureTimePerVolumeAreaUnit PressureTimePerVolumeAreaUnit::mmHg_s_Per_mL_m2("mmHg s/mL m^2"); const PressureTimePerVolumeAreaUnit PressureTimePerVolumeAreaUnit::dyn_s_Per_cm5_m2("dyn s/cm^5 m^2"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; PressureTimePerVolumeAreaUnit::PressureTimePerVolumeAreaUnit(const char* u) : PressureTimePerVolumeAreaUnit(std::string { u }) @@ -32,23 +35,7 @@ PressureTimePerVolumeAreaUnit::PressureTimePerVolumeAreaUnit(const std::string& PressureTimePerVolumeAreaUnit::~PressureTimePerVolumeAreaUnit() { } -//------------------------------------------------------------------------------- -SEScalarPressureTimePerVolumeArea::SEScalarPressureTimePerVolumeArea() -{ -} -//------------------------------------------------------------------------------- -SEScalarPressureTimePerVolumeArea::~SEScalarPressureTimePerVolumeArea() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarPressureTimePerVolumeAreaData* SEScalarPressureTimePerVolumeArea::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarPressureTimePerVolumeAreaData* data(new CDM::ScalarPressureTimePerVolumeAreaData()); - SEScalarQuantity::Unload(*data); - return data; -} + //------------------------------------------------------------------------------- bool PressureTimePerVolumeAreaUnit::IsValidUnit(const char* unit) { diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarTemperature.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarTemperature.cpp index f4442e89d..3d3145256 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarTemperature.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarTemperature.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const TemperatureUnit TemperatureUnit::F("degF"); @@ -18,7 +21,7 @@ const TemperatureUnit TemperatureUnit::C("degC"); const TemperatureUnit TemperatureUnit::K("K"); const TemperatureUnit TemperatureUnit::R("degR"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; TemperatureUnit::TemperatureUnit(const char* u) : TemperatureUnit(std::string{ u }) @@ -32,15 +35,7 @@ TemperatureUnit::TemperatureUnit(const std::string& u) : CCompoundUnit(u) { } -//------------------------------------------------------------------------------- -CDM::ScalarTemperatureData* SEScalarTemperature::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarTemperatureData* data(new CDM::ScalarTemperatureData()); - SEScalarQuantity::Unload(*data); - return data; -} + //------------------------------------------------------------------------------- bool TemperatureUnit::IsValidUnit(const char* unit) { @@ -80,17 +75,6 @@ const TemperatureUnit& TemperatureUnit::GetCompoundUnit(const std::string& unit) return GetCompoundUnit(unit.c_str()); } //------------------------------------------------------------------------------- -double SEScalarTemperature::GetValue(const TemperatureUnit& unit) const -{ - if (std::isnan(m_value)) - throw CommonDataModelException("Value is NaN"); - if (std::isinf(m_value)) - return m_value; - if (m_unit == &unit) - return m_value; - return Convert(m_value, *m_unit, unit); -} -//------------------------------------------------------------------------------- bool TemperatureUnit::operator==(const TemperatureUnit& obj) const { return CCompoundUnit::operator==(obj); @@ -101,9 +85,4 @@ bool TemperatureUnit::operator!=(const TemperatureUnit& obj) const return !(*this == obj); } //------------------------------------------------------------------------------- -SEScalarTemperature::SEScalarTemperature() -:SEScalarQuantity() -{} -SEScalarTemperature::~SEScalarTemperature(){} -//------------------------------------------------------------------------------- } diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarTime.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarTime.cpp index 3545bfb1f..650d051da 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarTime.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarTime.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { #pragma push_macro("Time") @@ -22,7 +25,7 @@ const TimeUnit TimeUnit::day("day"); const TimeUnit TimeUnit::yr("yr"); #pragma pop_macro("Time") -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; TimeUnit::TimeUnit(const char* u) : TimeUnit(std::string { u }) @@ -38,23 +41,6 @@ TimeUnit::~TimeUnit() { } //------------------------------------------------------------------------------- -SEScalarTime::SEScalarTime() -{ -} -//------------------------------------------------------------------------------- -SEScalarTime::~SEScalarTime() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarTimeData* SEScalarTime::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarTimeData* data(new CDM::ScalarTimeData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool TimeUnit::IsValidUnit(const char* unit) { if (strcmp(s.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarTimeMassPerVolume.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarTimeMassPerVolume.cpp index 2522a53fb..f9c89f14a 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarTimeMassPerVolume.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarTimeMassPerVolume.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const TimeMassPerVolumeUnit TimeMassPerVolumeUnit::s_g_Per_L("s g/L"); @@ -20,7 +23,7 @@ const TimeMassPerVolumeUnit TimeMassPerVolumeUnit::s_ug_Per_mL("s ug/mL"); const TimeMassPerVolumeUnit TimeMassPerVolumeUnit::min_ug_Per_mL("min ug/mL"); const TimeMassPerVolumeUnit TimeMassPerVolumeUnit::hr_ug_Per_mL("hr ug/mL"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; TimeMassPerVolumeUnit::TimeMassPerVolumeUnit(const char* u) : TimeMassPerVolumeUnit(std::string { u }) @@ -36,23 +39,6 @@ TimeMassPerVolumeUnit::~TimeMassPerVolumeUnit() { } //------------------------------------------------------------------------------- -SEScalarTimeMassPerVolume::SEScalarTimeMassPerVolume() -{ -} -//------------------------------------------------------------------------------- -SEScalarTimeMassPerVolume::~SEScalarTimeMassPerVolume() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarTimeMassPerVolumeData* SEScalarTimeMassPerVolume::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarTimeMassPerVolumeData* data(new CDM::ScalarTimeMassPerVolumeData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool TimeMassPerVolumeUnit::IsValidUnit(const char* unit) { if (strcmp(s_g_Per_L.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarVolume.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarVolume.cpp index 37a6ef788..0f743e138 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarVolume.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarVolume.cpp @@ -1,5 +1,5 @@ -/************************************************************************************** -Copyright 2015 Applied Research Associates, Inc. +; /************************************************************************************** + Copyright 2015 Applied Research Associates, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const VolumeUnit VolumeUnit::L("L"); @@ -19,7 +22,7 @@ const VolumeUnit VolumeUnit::mL("mL"); const VolumeUnit VolumeUnit::uL("uL"); const VolumeUnit VolumeUnit::m3("m^3"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; VolumeUnit::VolumeUnit(const char* u) : VolumeUnit(std::string { u }) @@ -35,23 +38,6 @@ VolumeUnit::~VolumeUnit() { } //------------------------------------------------------------------------------- -SEScalarVolume::SEScalarVolume() -{ -} -//------------------------------------------------------------------------------- -SEScalarVolume::~SEScalarVolume() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarVolumeData* SEScalarVolume::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarVolumeData* data(new CDM::ScalarVolumeData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool VolumeUnit::IsValidUnit(const char* unit) { if (strcmp(L.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarVolumePerPressure.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarVolumePerPressure.cpp index 00a986551..b7e14f46f 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarVolumePerPressure.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarVolumePerPressure.cpp @@ -11,12 +11,15 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const VolumePerPressureUnit VolumePerPressureUnit::L_Per_Pa("L/Pa"); const VolumePerPressureUnit VolumePerPressureUnit::L_Per_cmH2O("L/cmH2O"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; VolumePerPressureUnit::VolumePerPressureUnit(const char* u) : VolumePerPressureUnit(std::string { u }) @@ -32,25 +35,6 @@ VolumePerPressureUnit::~VolumePerPressureUnit() { } //------------------------------------------------------------------------------- -SEScalarVolumePerPressure::SEScalarVolumePerPressure() -{ - -} -//------------------------------------------------------------------------------- -SEScalarVolumePerPressure::~SEScalarVolumePerPressure() -{ - -} -//------------------------------------------------------------------------------- -CDM::ScalarVolumePerPressureData* SEScalarVolumePerPressure::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarVolumePerPressureData* data(new CDM::ScalarVolumePerPressureData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool VolumePerPressureUnit::IsValidUnit(const char* unit) { if (strcmp(L_Per_Pa.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarVolumePerTime.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarVolumePerTime.cpp index b02a99056..f6690b063 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarVolumePerTime.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarVolumePerTime.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const VolumePerTimeUnit VolumePerTimeUnit::L_Per_s("L/s"); @@ -22,7 +25,7 @@ const VolumePerTimeUnit VolumePerTimeUnit::m3_Per_s("m^3/s"); const VolumePerTimeUnit VolumePerTimeUnit::mL_Per_min("mL/min"); const VolumePerTimeUnit VolumePerTimeUnit::mL_Per_hr("mL/hr"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; VolumePerTimeUnit::VolumePerTimeUnit(const char* u) : VolumePerTimeUnit(std::string { u }) @@ -38,23 +41,6 @@ VolumePerTimeUnit::~VolumePerTimeUnit() { } //------------------------------------------------------------------------------- -SEScalarVolumePerTime::SEScalarVolumePerTime() -{ -} -//------------------------------------------------------------------------------- -SEScalarVolumePerTime::~SEScalarVolumePerTime() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarVolumePerTimeData* SEScalarVolumePerTime::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarVolumePerTimeData* data(new CDM::ScalarVolumePerTimeData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool VolumePerTimeUnit::IsValidUnit(const char* unit) { if (strcmp(L_Per_s.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarVolumePerTimeArea.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarVolumePerTimeArea.cpp index 093731598..c97fdd58f 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarVolumePerTimeArea.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarVolumePerTimeArea.cpp @@ -11,13 +11,16 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const VolumePerTimeAreaUnit VolumePerTimeAreaUnit::mL_Per_min_m2("mL/min m^2"); const VolumePerTimeAreaUnit VolumePerTimeAreaUnit::mL_Per_s_m2("mL/s m^2"); const VolumePerTimeAreaUnit VolumePerTimeAreaUnit::L_Per_min_m2("L/min m^2"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; VolumePerTimeAreaUnit::VolumePerTimeAreaUnit(const char* u) : VolumePerTimeAreaUnit(std::string { u }) @@ -33,25 +36,6 @@ VolumePerTimeAreaUnit::~VolumePerTimeAreaUnit() { } //------------------------------------------------------------------------------- -SEScalarVolumePerTimeArea::SEScalarVolumePerTimeArea() -{ - -} -//------------------------------------------------------------------------------- -SEScalarVolumePerTimeArea::~SEScalarVolumePerTimeArea() -{ - -} -//------------------------------------------------------------------------------- -CDM::ScalarVolumePerTimeAreaData* SEScalarVolumePerTimeArea::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarVolumePerTimeAreaData* data(new CDM::ScalarVolumePerTimeAreaData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool VolumePerTimeAreaUnit::IsValidUnit(const char* unit) { if (strcmp(mL_Per_min_m2.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarVolumePerTimeMass.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarVolumePerTimeMass.cpp index 73f176730..e57b95c14 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarVolumePerTimeMass.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarVolumePerTimeMass.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const VolumePerTimeMassUnit VolumePerTimeMassUnit::L_Per_s_g("L/s g"); @@ -19,7 +22,7 @@ const VolumePerTimeMassUnit VolumePerTimeMassUnit::mL_Per_min_kg("mL/min kg"); const VolumePerTimeMassUnit VolumePerTimeMassUnit::mL_Per_s_kg("mL/s kg"); const VolumePerTimeMassUnit VolumePerTimeMassUnit::uL_Per_min_kg("uL/min kg"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; VolumePerTimeMassUnit::VolumePerTimeMassUnit(const char* u) : VolumePerTimeMassUnit(std::string { u }) @@ -35,25 +38,6 @@ VolumePerTimeMassUnit::VolumePerTimeMassUnit(const std::string& u) { } //------------------------------------------------------------------------------- -SEScalarVolumePerTimeMass::SEScalarVolumePerTimeMass() -{ - -} -//------------------------------------------------------------------------------- -SEScalarVolumePerTimeMass::~SEScalarVolumePerTimeMass() -{ - -} -//------------------------------------------------------------------------------- -CDM::ScalarVolumePerTimeMassData* SEScalarVolumePerTimeMass::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarVolumePerTimeMassData* data(new CDM::ScalarVolumePerTimeMassData()); - SEScalarQuantity::Unload(*data); - return data; -} -//------------------------------------------------------------------------------- bool VolumePerTimeMassUnit::IsValidUnit(const char* unit) { if (strcmp(L_Per_s_g.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarVolumePerTimePressure.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarVolumePerTimePressure.cpp index eef134f1c..6d0ecdce4 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarVolumePerTimePressure.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarVolumePerTimePressure.cpp @@ -10,6 +10,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { @@ -18,7 +21,7 @@ namespace biogears const VolumePerTimePressureUnit VolumePerTimePressureUnit::L_Per_min_mmHg("L/min mmHg"); const VolumePerTimePressureUnit VolumePerTimePressureUnit::mL_Per_min_mmHg("mL/min mmHg"); - template class SEScalarQuantity; + template class BIOGEARS_API SEScalarQuantity; VolumePerTimePressureUnit::~VolumePerTimePressureUnit() { @@ -35,23 +38,6 @@ namespace biogears { } //------------------------------------------------------------------------------- - SEScalarVolumePerTimePressure::SEScalarVolumePerTimePressure() - { - } - //------------------------------------------------------------------------------- - SEScalarVolumePerTimePressure::~SEScalarVolumePerTimePressure() - { - } - //------------------------------------------------------------------------------- - CDM::ScalarVolumePerTimePressureData* SEScalarVolumePerTimePressure::Unload() const - { - if (!IsValid()) - return nullptr; - CDM::ScalarVolumePerTimePressureData* data(new CDM::ScalarVolumePerTimePressureData()); - SEScalarQuantity::Unload(*data); - return data; - } - //------------------------------------------------------------------------------- bool VolumePerTimePressureUnit::IsValidUnit(const char* unit) { if (strcmp(L_Per_s_mmHg.GetString(), unit) == 0) diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEScalarVolumePerTimePressureArea.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEScalarVolumePerTimePressureArea.cpp index 36c3f6f85..f3be0f8bc 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEScalarVolumePerTimePressureArea.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEScalarVolumePerTimePressureArea.cpp @@ -11,12 +11,15 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Property.h" namespace biogears { const VolumePerTimePressureAreaUnit VolumePerTimePressureAreaUnit::mL_Per_min_mmHg_m2("mL/min mmHg m^2"); const VolumePerTimePressureAreaUnit VolumePerTimePressureAreaUnit::mL_Per_s_mmHg_m2("mL/s mmHg m^2"); -template class SEScalarQuantity; +template class BIOGEARS_API SEScalarQuantity; VolumePerTimePressureAreaUnit::VolumePerTimePressureAreaUnit(const char* u) : VolumePerTimePressureAreaUnit(std::string { u }) { @@ -29,23 +32,7 @@ VolumePerTimePressureAreaUnit::VolumePerTimePressureAreaUnit(const std::string& //------------------------------------------------------------------------------- VolumePerTimePressureAreaUnit::~VolumePerTimePressureAreaUnit(){ } -//------------------------------------------------------------------------------- -SEScalarVolumePerTimePressureArea::SEScalarVolumePerTimePressureArea() -{ -} -//------------------------------------------------------------------------------- -SEScalarVolumePerTimePressureArea::~SEScalarVolumePerTimePressureArea() -{ -} -//------------------------------------------------------------------------------- -CDM::ScalarVolumePerTimePressureAreaData* SEScalarVolumePerTimePressureArea::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::ScalarVolumePerTimePressureAreaData* data(new CDM::ScalarVolumePerTimePressureAreaData()); - SEScalarQuantity::Unload(*data); - return data; -} + //------------------------------------------------------------------------------- bool VolumePerTimePressureAreaUnit::IsValidUnit(const char* unit) { diff --git a/projects/biogears/libBiogears/src/cdm/properties/SEUnitScalar.cpp b/projects/biogears/libBiogears/src/cdm/properties/SEUnitScalar.cpp index 7378fbed8..ae53747f1 100644 --- a/projects/biogears/libBiogears/src/cdm/properties/SEUnitScalar.cpp +++ b/projects/biogears/libBiogears/src/cdm/properties/SEUnitScalar.cpp @@ -12,6 +12,8 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/Property.h" + namespace biogears { SEUnitScalar::SEUnitScalar(bool ro) : SEScalar(NaN,ro) @@ -20,7 +22,7 @@ SEUnitScalar::SEUnitScalar(bool ro) //------------------------------------------------------------------------------ SEUnitScalar::SEUnitScalar(const SEUnitScalar& obj) - : SEScalar(obj) + : SEScalar(obj.m_value, obj.m_readOnly) { } //------------------------------------------------------------------------------ diff --git a/projects/biogears/libBiogears/src/cdm/scenario/SEAction.cpp b/projects/biogears/libBiogears/src/cdm/scenario/SEAction.cpp index f453f38c2..115112ced 100644 --- a/projects/biogears/libBiogears/src/cdm/scenario/SEAction.cpp +++ b/projects/biogears/libBiogears/src/cdm/scenario/SEAction.cpp @@ -11,6 +11,14 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Actions.h" +#include "io/cdm/AnesthesiaActions.h" +#include "io/cdm/EnvironmentActions.h" +#include "io/cdm/EnvironmentConditions.h" +#include "io/cdm/InhalerActions.h" +#include "io/cdm/PatientActions.h" +#include "io/cdm/PatientAssessments.h" + #include #include #include @@ -76,484 +84,22 @@ template class vector; } namespace biogears { -SEAction::SEAction() - : Loggable() +SEAction::SEAction(Logger* logger) + : Loggable(logger) { m_Comment = ""; } //----------------------------------------------------------------------------- SEAction::~SEAction() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SEAction::Clear() +void SEAction::Invalidate() { m_Comment = ""; } //----------------------------------------------------------------------------- -SEAction* SEAction::newFromBind(const CDM::ActionData& data, SESubstanceManager& substances, std::default_random_engine *rd) -{ - std::stringstream ss; - SESubstance* substance; - SESubstanceCompound* compound; - - CDM::ActionData* action = (CDM::ActionData*)&data; - CDM::AdvanceTimeData* advData = dynamic_cast(action); - if (advData != nullptr) { - SEAdvanceTime* a = new SEAdvanceTime(); - a->Load(*advData, rd); - return a; - } - - CDM::SerializeStateData* stData = dynamic_cast(action); - if (stData != nullptr) { - SESerializeState* a = new SESerializeState(); - a->Load(*stData, rd); - return a; - } - - if (dynamic_cast(action) != nullptr) { - if (dynamic_cast(action) != nullptr) { - SEEnvironmentChange* a = new SEEnvironmentChange(substances); - a->Load(*(CDM::EnvironmentChangeData*)action, rd); - return a; - } - if (dynamic_cast(action) != nullptr) { - SEThermalApplication* a = new SEThermalApplication(); - a->Load(*(CDM::ThermalApplicationData*)action, rd); - return a; - } - substances.GetLogger()->Error("Unsupported Environment Action Received", "SEScenario::Load"); - } - - if (dynamic_cast(action) != nullptr) { - if (dynamic_cast(action) != nullptr) { - SEPatientAssessmentRequest* a = new SEPatientAssessmentRequest(); - a->Load(*(CDM::PatientAssessmentRequestData*)action, rd); - return a; - } - - CDM::AcuteRespiratoryDistressData* ardsData = dynamic_cast(action); - if (ardsData != nullptr) { - SEAcuteRespiratoryDistress* ards = new SEAcuteRespiratoryDistress(); - ards->Load(*ardsData, rd); - return ards; - } - - CDM::AcuteStressData* aStressData = dynamic_cast(action); - if (aStressData != nullptr) { - SEAcuteStress* a = new SEAcuteStress(); - a->Load(*aStressData, rd); - return a; - } - - CDM::ExampleActionData* expAction = dynamic_cast(action); - if (expAction != nullptr) { - SEExampleAction* a = new SEExampleAction(); - a->Load(*expAction, rd); - return a; - } - - CDM::AirwayObstructionData* airObData = dynamic_cast(action); - if (airObData != nullptr) { - SEAirwayObstruction* a = new SEAirwayObstruction(); - a->Load(*airObData, rd); - return a; - } - - CDM::ApneaData* apneaData = dynamic_cast(action); - if (apneaData != nullptr) { - SEApnea* a = new SEApnea(); - a->Load(*apneaData, rd); - return a; - } - - CDM::BrainInjuryData* brainInjData = dynamic_cast(action); - if (brainInjData != nullptr) { - SEBrainInjury* a = new SEBrainInjury(); - a->Load(*brainInjData, rd); - return a; - } - - CDM::BurnWoundData* burnData = dynamic_cast(action); - if (burnData != nullptr) { - SEBurnWound* burn = new SEBurnWound(); - burn->Load(*burnData, rd); - return burn; - } - - CDM::BronchoconstrictionData* bconData = dynamic_cast(action); - if (bconData != nullptr) { - SEBronchoconstriction* a = new SEBronchoconstriction(); - a->Load(*bconData, rd); - return a; - } - - CDM::CardiacArrestData* carrestData = dynamic_cast(action); - if (carrestData != nullptr) { - SECardiacArrest* a = new SECardiacArrest(); - a->Load(*carrestData, rd); - return a; - } - - CDM::AsthmaAttackData* asthmaData = dynamic_cast(action); - if (asthmaData != nullptr) { - SEAsthmaAttack* a = new SEAsthmaAttack(); - a->Load(*asthmaData, rd); - return a; - } - - CDM::ChestCompressionData* cprData = dynamic_cast(action); - if (cprData != nullptr) { - CDM::ChestCompressionForceData* cprForce = dynamic_cast(cprData); - if (cprForce != nullptr) { - SEChestCompressionForce* a = new SEChestCompressionForce(); - a->Load(*cprForce, rd); - return a; - } - CDM::ChestCompressionForceScaleData* cprScale = dynamic_cast(cprData); - if (cprScale != nullptr) { - SEChestCompressionForceScale* a = new SEChestCompressionForceScale(); - a->Load(*cprScale, rd); - return a; - } - } - - CDM::ChestOcclusiveDressingData* codData = dynamic_cast(action); - if (codData != nullptr) { - SEChestOcclusiveDressing* a = new SEChestOcclusiveDressing(); - a->Load(*codData, rd); - return a; - } - - CDM::ConsciousRespirationData* conRespData = dynamic_cast(action); - if (conRespData != nullptr) { - SEConsciousRespiration* a = new SEConsciousRespiration(); - a->Load(*conRespData, substances, rd); - return a; - } - - CDM::ConsumeNutrientsData* consumeData = dynamic_cast(action); - if (consumeData != nullptr) { - SEConsumeNutrients* a = new SEConsumeNutrients(); - a->Load(*consumeData, rd); - return a; - } - CDM::EbolaData* ebolaData = dynamic_cast(action); - if (ebolaData != nullptr) { - SEEbola* ebola = new SEEbola(); - ebola->Load(*ebolaData, rd); - return ebola; - } - CDM::EscharotomyData* escharotomyData = dynamic_cast(action); - if (escharotomyData != nullptr) { - SEEscharotomy* escharotomy = new SEEscharotomy(); - escharotomy->Load(*escharotomyData, rd); - return escharotomy; - } - - CDM::ExerciseData* exerciseData = dynamic_cast(action); - if (exerciseData != nullptr) { - SEExercise* a = new SEExercise(); - a->Load(*exerciseData, rd); - return a; - } - - CDM::IntubationData* intub8Data = dynamic_cast(action); - if (intub8Data != nullptr) { - SEIntubation* a = new SEIntubation(); - a->Load(*intub8Data, rd); - return a; - } - - CDM::MechanicalVentilationData* mechVentData = dynamic_cast(action); - if (mechVentData != nullptr) { - SEMechanicalVentilation* a = new SEMechanicalVentilation(); - a->Load(*mechVentData, substances, rd); - return a; - } - - CDM::NeedleDecompressionData* needlData = dynamic_cast(action); - if (needlData != nullptr) { - SENeedleDecompression* a = new SENeedleDecompression(); - a->Load(*needlData, rd); - return a; - } - - CDM::OverrideData* overrideData = dynamic_cast(action); - if (overrideData != nullptr) { - SEOverride* a = new SEOverride(); - a->Load(*overrideData, rd); - return a; - } - - CDM::HemorrhageData* hemData = dynamic_cast(action); - if (hemData != nullptr) { - SEHemorrhage* a = new SEHemorrhage(); - a->Load(*hemData, rd); - return a; - } - - CDM::InfectionData* infData = dynamic_cast(action); - if (infData != nullptr) { - SEInfection* infect = new SEInfection(); - infect->Load(*infData, rd); - return infect; - } - - CDM::NasalCannulaData* nasalCannulaData = dynamic_cast(action); - if (nasalCannulaData != nullptr) { - SENasalCannula* a = new SENasalCannula(); - a->Load(*nasalCannulaData, rd); - return a; - } - - CDM::PainStimulusData* painData = dynamic_cast(action); - if (painData != nullptr) { - SEPainStimulus* a = new SEPainStimulus(); - a->Load(*painData, rd); - return a; - } - - CDM::PericardialEffusionData* pericData = dynamic_cast(action); - if (pericData != nullptr) { - SEPericardialEffusion* a = new SEPericardialEffusion(); - a->Load(*pericData, rd); - return a; - } - - CDM::PulmonaryShuntData* pulmData = dynamic_cast(action); - if (pulmData != nullptr) { - SEPulmonaryShunt* a = new SEPulmonaryShunt(); - a->Load(*pulmData, rd); - return a; - } - - CDM::TensionPneumothoraxData* pneumoData = dynamic_cast(action); - if (pneumoData != nullptr) { - SETensionPneumothorax* a = new SETensionPneumothorax(); - a->Load(*pneumoData, rd); - return a; - } - - CDM::RadiationAbsorbedDoseData* radabs = dynamic_cast(action); - if (radabs != nullptr) { - SERadiationAbsorbedDose* a = new SERadiationAbsorbedDose(); - a->Load(*radabs, rd); - return a; - } - - CDM::SubstanceBolusData* bolusData = dynamic_cast(action); - if (bolusData != nullptr) { - substance = substances.GetSubstance(bolusData->Substance()); - if (substance == nullptr) { - ss << "Unknown substance : " << bolusData->Substance(); - substances.GetLogger()->Fatal(ss.str(), "SEScenario::Load"); - } - SESubstanceBolus* a = new SESubstanceBolus(*substance); - a->Load(*bolusData, rd); - return a; - } - - CDM::SubstanceNasalDoseData* nasalData = dynamic_cast(action); - if (nasalData != nullptr) { - substance = substances.GetSubstance(nasalData->Substance()); - if (substance == nullptr) { - ss << "Unknown substance : " << nasalData->Substance(); - substances.GetLogger()->Fatal(ss.str(), "SEScenario::Load"); - } - SESubstanceNasalDose* nd = new SESubstanceNasalDose(*substance); - nd->Load(*nasalData, rd); - return nd; - } - - CDM::SubstanceOralDoseData* oralData = dynamic_cast(action); - if (oralData != nullptr) { - substance = substances.GetSubstance(oralData->Substance()); - if (substance == nullptr) { - ss << "Unknown substance : " << oralData->Substance(); - substances.GetLogger()->Fatal(ss.str(), "SEScenario::Load"); - } - SESubstanceOralDose* od = new SESubstanceOralDose(*substance); - od->Load(*oralData, rd); - return od; - } - - CDM::SleepData* sleep = dynamic_cast(action); - if (sleep != nullptr) { - SESleep* a = new SESleep(); - a->Load(*sleep, rd); - return a; - } - - CDM::SubstanceInfusionData* subInfuzData = dynamic_cast(action); - if (subInfuzData != nullptr) { - substance = substances.GetSubstance(subInfuzData->Substance()); - if (substance == nullptr) { - ss << "Unknown substance : " << subInfuzData->Substance(); - substances.GetLogger()->Fatal(ss.str(), "SEScenario::Load"); - } - SESubstanceInfusion* a = new SESubstanceInfusion(*substance); - a->Load(*subInfuzData, rd); - return a; - } - - CDM::SubstanceCompoundInfusionData* subCInfuzData = dynamic_cast(action); - if (subCInfuzData != nullptr) { - compound = substances.GetCompound(subCInfuzData->SubstanceCompound()); - if (compound == nullptr) { - ss << "Unknown substance : " << subCInfuzData->SubstanceCompound(); - substances.GetLogger()->Fatal(ss.str(), "SEScenario::Load"); - } - SESubstanceCompoundInfusion* a = new SESubstanceCompoundInfusion(*compound); - a->Load(*subCInfuzData, rd); - return a; - } - - CDM::TourniquetData* tourniquetData = dynamic_cast(action); - if (tourniquetData != nullptr) { - SETourniquet* tourniquet = new SETourniquet(); - tourniquet->Load(*tourniquetData, rd); - return tourniquet; - } - - CDM::UrinateData* urinateData = dynamic_cast(action); - if (urinateData != nullptr) { - SEUrinate* a = new SEUrinate(); - a->Load(*urinateData, rd); - return a; - } - substances.GetLogger()->Error("Unsupported Patient Action Received", "SEScenario::Load"); - } else if (dynamic_cast(action) != nullptr) { - - - auto anConfig = dynamic_cast(action); - if (anConfig != nullptr) { - SEAnesthesiaMachineConfiguration* a = new SEAnesthesiaMachineConfiguration(substances); - a->Load(*anConfig, rd); - return a; - } - - auto anO2WallLoss = dynamic_cast(action); - if (anO2WallLoss != nullptr) { - SEOxygenWallPortPressureLoss* a = new SEOxygenWallPortPressureLoss(); - a->Load(*anO2WallLoss, rd); - return a; - } - - auto anO2TankLoss = dynamic_cast(action); - if (anO2TankLoss != nullptr) { - SEOxygenTankPressureLoss* a = new SEOxygenTankPressureLoss(); - a->Load(*anO2TankLoss, rd); - return a; - } - - auto anExLeak = dynamic_cast(action); - if (anExLeak != nullptr) { - SEExpiratoryValveLeak* a = new SEExpiratoryValveLeak(); - a->Load(*anExLeak, rd); - return a; - } - - auto anExObs = dynamic_cast(action); - if (anExObs != nullptr) { - SEExpiratoryValveObstruction* a = new SEExpiratoryValveObstruction(); - a->Load(*anExObs, rd); - return a; - } - - auto anInLeak = dynamic_cast(action); - if (anInLeak != nullptr) { - SEInspiratoryValveLeak* a = new SEInspiratoryValveLeak(); - a->Load(*anInLeak, rd); - return a; - } - - auto anInObs = dynamic_cast(action); - if (anInObs != nullptr) { - SEInspiratoryValveObstruction* a = new SEInspiratoryValveObstruction(); - a->Load(*anInObs, rd); - return a; - } - - auto anMskLeak = dynamic_cast(action); - if (anMskLeak != nullptr) { - SEMaskLeak* a = new SEMaskLeak(); - a->Load(*anMskLeak, rd); - return a; - } - - auto anSodaFail = dynamic_cast(action); - if (anSodaFail != nullptr) { - SESodaLimeFailure* a = new SESodaLimeFailure(); - a->Load(*anSodaFail, rd); - return a; - } - - auto anTubLeak = dynamic_cast(action); - if (anTubLeak != nullptr) { - SETubeCuffLeak* a = new SETubeCuffLeak(); - a->Load(*anTubLeak, rd); - return a; - } - - auto anVapFail = dynamic_cast(action); - if (anVapFail != nullptr) { - SEVaporizerFailure* a = new SEVaporizerFailure(); - a->Load(*anVapFail, rd); - return a; - } - - auto anVentLoss = dynamic_cast(action); - if (anVentLoss != nullptr) { - SEVentilatorPressureLoss* a = new SEVentilatorPressureLoss(); - a->Load(*anVentLoss, rd); - return a; - } - - auto anYDisc = dynamic_cast(action); - if (anYDisc != nullptr) { - SEYPieceDisconnect* a = new SEYPieceDisconnect(); - a->Load(*anYDisc, rd); - return a; - } - substances.GetLogger()->Error("Unsupported Anesthesia Machine Action Received", "SEScenario::Load"); - } else if (dynamic_cast(action) != nullptr) { - CDM::InhalerConfigurationData* inhaleConfig = dynamic_cast(action); - if (inhaleConfig != nullptr) { - SEInhalerConfiguration* a = new SEInhalerConfiguration(substances); - a->Load(*inhaleConfig, rd); - return a; - } - } - - if (substances.GetLogger() != nullptr) - substances.GetLogger()->Error("Unsupported Action Received", "SEAction::newFromBind"); - return nullptr; -} -//----------------------------------------------------------------------------- -bool SEAction::Load(const CDM::ActionData& in) -{ - Clear(); - if (in.Comment().present()) - m_Comment = in.Comment().get(); - return true; -} -//----------------------------------------------------------------------------- -CDM::ActionData* SEAction::Unload() const -{ - CDM::ActionData* data = new CDM::ActionData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEAction::Unload(CDM::ActionData& data) const -{ - if (HasComment()) - data.Comment(m_Comment); -} -//----------------------------------------------------------------------------- const char* SEAction::GetComment() const { return m_Comment.c_str(); diff --git a/projects/biogears/libBiogears/src/cdm/scenario/SEActionManager.cpp b/projects/biogears/libBiogears/src/cdm/scenario/SEActionManager.cpp index 311c736c9..717452b31 100644 --- a/projects/biogears/libBiogears/src/cdm/scenario/SEActionManager.cpp +++ b/projects/biogears/libBiogears/src/cdm/scenario/SEActionManager.cpp @@ -10,8 +10,15 @@ CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **************************************************************************************/ -#include #include +#include + +#include "io/cdm/Scenario.h" +#include "io/cdm/Actions.h" +#include "io/cdm/PatientActions.h" +#include "io/cdm/EnvironmentActions.h" +#include "io/cdm/AnesthesiaActions.h" +#include "io/cdm/InhalerActions.h" namespace biogears { SEActionManager::SEActionManager(SESubstanceManager& substances) @@ -26,62 +33,34 @@ SEActionManager::SEActionManager(SESubstanceManager& substances) //------------------------------------------------------------------------------- SEActionManager::~SEActionManager() { - Clear(); -} -//------------------------------------------------------------------------------- -void SEActionManager::Clear() -{ - m_PatientActions.Clear(); - m_AnesthesiaMachineActions.Clear(); - m_EnvironmentActions.Clear(); - m_InhalerActions.Clear(); - m_ProcessedActions.clear(); + Invalidate(); } //------------------------------------------------------------------------------- -bool SEActionManager::ProcessAction(const CDM::ActionData& in, const PhysiologyEngine& engine) +void SEActionManager::Invalidate() { - const CDM::PatientActionData* pAction = dynamic_cast(&in); - if (pAction != nullptr) - return m_PatientActions.ProcessAction(*pAction, engine); - const CDM::EnvironmentActionData* eAction = dynamic_cast(&in); - if (eAction != nullptr) - return m_EnvironmentActions.ProcessAction(*eAction, engine); - const CDM::AnesthesiaMachineActionData* aAction = dynamic_cast(&in); - if (aAction != nullptr) - return m_AnesthesiaMachineActions.ProcessAction(*aAction, engine); - const CDM::InhalerActionData* iAction = dynamic_cast(&in); - if (iAction != nullptr) - return m_InhalerActions.ProcessAction(*iAction, engine); - Error("Unknown Action Type"); - return false; -} -//------------------------------------------------------------------------------- -void SEActionManager::Unload(std::vector& to) -{ - m_PatientActions.Unload(to); - m_AnesthesiaMachineActions.Unload(to); - m_EnvironmentActions.Unload(to); - m_InhalerActions.Unload(to); + m_PatientActions.Invalidate(); + m_AnesthesiaMachineActions.Invalidate(); + m_EnvironmentActions.Invalidate(); + m_InhalerActions.Invalidate(); } + //------------------------------------------------------------------------------- bool SEActionManager::ProcessAction(const SEAction& action, const PhysiologyEngine& engine) { // Store the action data. This is intended to be able to // Serialize out all the actions that the engine was asked to perform - CDM::ActionData* aData = action.Unload(); - m_ProcessedActions.push_back(action.Unload()); - - if (dynamic_cast(&action) != nullptr) - return m_PatientActions.ProcessAction(dynamic_cast(*aData), engine); + + if (auto aData = dynamic_cast(&action)) + return m_PatientActions.ProcessAction(*aData, engine); - if (dynamic_cast(&action) != nullptr) - return m_AnesthesiaMachineActions.ProcessAction(dynamic_cast(*aData), engine); + if (auto aData = dynamic_cast(&action)) + return m_AnesthesiaMachineActions.ProcessAction(*aData, engine); - if (dynamic_cast(&action) != nullptr) - return m_EnvironmentActions.ProcessAction(dynamic_cast(*aData), engine); + if (auto aData = dynamic_cast(&action)) + return m_EnvironmentActions.ProcessAction(*aData, engine); - if (dynamic_cast(&action) != nullptr) - return m_InhalerActions.ProcessAction(dynamic_cast(*aData), engine); + if (auto aData = dynamic_cast(&action)) + return m_InhalerActions.ProcessAction(*aData, engine); /// \error Unsupported Action Error("Unsupported Action"); diff --git a/projects/biogears/libBiogears/src/cdm/scenario/SEAdvanceTime.cpp b/projects/biogears/libBiogears/src/cdm/scenario/SEAdvanceTime.cpp index c94ab882c..aed2887e4 100644 --- a/projects/biogears/libBiogears/src/cdm/scenario/SEAdvanceTime.cpp +++ b/projects/biogears/libBiogears/src/cdm/scenario/SEAdvanceTime.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Actions.h" + #include #include @@ -23,13 +25,16 @@ SEAdvanceTime::SEAdvanceTime() //----------------------------------------------------------------------------- SEAdvanceTime::~SEAdvanceTime() { - Clear(); + Invalidate(); + SAFE_DELETE(m_Time); } //----------------------------------------------------------------------------- -void SEAdvanceTime::Clear() +void SEAdvanceTime::Invalidate() { - SEAction::Clear(); - SAFE_DELETE(m_Time); + SEAction::Invalidate(); + if (m_Time) { + m_Time->Invalidate(); + } } //----------------------------------------------------------------------------- bool SEAdvanceTime::IsValid() const @@ -37,27 +42,6 @@ bool SEAdvanceTime::IsValid() const return HasTime() && m_Time->IsValid(); } //----------------------------------------------------------------------------- -bool SEAdvanceTime::Load(const CDM::AdvanceTimeData& in, std::default_random_engine *rd) -{ - SEAction::Load(in); - GetTime().Load(in.Time(), rd); - return true; -} -//----------------------------------------------------------------------------- -CDM::AdvanceTimeData* SEAdvanceTime::Unload() const -{ - CDM::AdvanceTimeData* data = new CDM::AdvanceTimeData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEAdvanceTime::Unload(CDM::AdvanceTimeData& data) const -{ - SEAction::Unload(data); - if (HasTime()) - data.Time(std::unique_ptr(m_Time->Unload())); -} -//----------------------------------------------------------------------------- void SEAdvanceTime::ToString(std::ostream& str) const { if (HasComment()) diff --git a/projects/biogears/libBiogears/src/cdm/scenario/SEAnesthesiaMachineActionCollection.cpp b/projects/biogears/libBiogears/src/cdm/scenario/SEAnesthesiaMachineActionCollection.cpp index 030477e97..0f4aa827d 100644 --- a/projects/biogears/libBiogears/src/cdm/scenario/SEAnesthesiaMachineActionCollection.cpp +++ b/projects/biogears/libBiogears/src/cdm/scenario/SEAnesthesiaMachineActionCollection.cpp @@ -11,6 +11,10 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Actions.h" +#include "io/cdm/AnesthesiaActions.h" +#include "io/cdm/Scenario.h" + #include #include #include @@ -44,10 +48,10 @@ SEAnesthesiaMachineActionCollection::SEAnesthesiaMachineActionCollection(SESubst //------------------------------------------------------------------------------- SEAnesthesiaMachineActionCollection::~SEAnesthesiaMachineActionCollection() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEAnesthesiaMachineActionCollection::Clear() +void SEAnesthesiaMachineActionCollection::Invalidate() { // State RemoveConfiguration(); @@ -67,61 +71,26 @@ void SEAnesthesiaMachineActionCollection::Clear() RemoveYPieceDisconnect(); } //------------------------------------------------------------------------------- -void SEAnesthesiaMachineActionCollection::Unload(std::vector& to) -{ - if (HasConfiguration()) - to.push_back(GetConfiguration()->Unload()); - if (HasOxygenTankPressureLoss()) - to.push_back(GetOxygenTankPressureLoss()->Unload()); - if (HasOxygenWallPortPressureLoss()) - to.push_back(GetOxygenWallPortPressureLoss()->Unload()); - if (HasExpiratoryValveLeak()) - to.push_back(GetExpiratoryValveLeak()->Unload()); - if (HasExpiratoryValveObstruction()) - to.push_back(GetExpiratoryValveObstruction()->Unload()); - if (HasInspiratoryValveLeak()) - to.push_back(GetInspiratoryValveLeak()->Unload()); - if (HasInspiratoryValveObstruction()) - to.push_back(GetInspiratoryValveObstruction()->Unload()); - if (HasMaskLeak()) - to.push_back(GetMaskLeak()->Unload()); - if (HasSodaLimeFailure()) - to.push_back(GetSodaLimeFailure()->Unload()); - if (HasTubeCuffLeak()) - to.push_back(GetTubeCuffLeak()->Unload()); - if (HasVaporizerFailure()) - to.push_back(GetVaporizerFailure()->Unload()); - if (HasVentilatorPressureLoss()) - to.push_back(GetVentilatorPressureLoss()->Unload()); - if (HasYPieceDisconnect()) - to.push_back(GetYPieceDisconnect()->Unload()); -} + //------------------------------------------------------------------------------- bool SEAnesthesiaMachineActionCollection::ProcessAction(const SEAnesthesiaMachineAction& action, const PhysiologyEngine& engine) { - if (!IsValid(action)) - return false; - CDM::AnesthesiaMachineActionData* bind = action.Unload(); - bool b = ProcessAction(*bind, engine); - delete bind; - return b; -} -//------------------------------------------------------------------------------- -bool SEAnesthesiaMachineActionCollection::ProcessAction(const CDM::AnesthesiaMachineActionData& action, const PhysiologyEngine& engine) -{ - const CDM::AnesthesiaMachineConfigurationData* config = dynamic_cast(&action); - if (config != nullptr) { - if (m_Configuration == nullptr) + auto actionData = io::AnesthesiaActions::factory(&action); + if (auto config = dynamic_cast(&action)) { + if (m_Configuration == nullptr) { m_Configuration = new SEAnesthesiaMachineConfiguration(m_Substances); - m_Configuration->Load(*config); + } + auto configData = dynamic_cast(actionData.get()); + io::AnesthesiaActions::UnMarshall(*configData, *m_Configuration); return IsValid(*m_Configuration); } - const CDM::OxygenTankPressureLossData* O2Tank = dynamic_cast(&action); - if (O2Tank != nullptr) { - if (m_OxygenTankPressureLoss == nullptr) + if (auto O2Tank = dynamic_cast(&action)) { + if (m_OxygenTankPressureLoss == nullptr) { m_OxygenTankPressureLoss = new SEOxygenTankPressureLoss(); - m_OxygenTankPressureLoss->Load(*O2Tank); + } + auto O2TankData = dynamic_cast(actionData.get()); + io::AnesthesiaActions::UnMarshall(*O2TankData, *m_OxygenTankPressureLoss); if (!m_OxygenTankPressureLoss->IsActive()) { RemoveOxygenTankPressureLoss(); return true; @@ -129,11 +98,12 @@ bool SEAnesthesiaMachineActionCollection::ProcessAction(const CDM::AnesthesiaMac return IsValid(*m_OxygenTankPressureLoss); } - const CDM::OxygenWallPortPressureLossData* O2Wall = dynamic_cast(&action); - if (O2Wall != nullptr) { - if (m_OxygenWallPortPressureLoss == nullptr) + if (auto O2Wall = dynamic_cast(&action)) { + if (m_OxygenWallPortPressureLoss == nullptr) { m_OxygenWallPortPressureLoss = new SEOxygenWallPortPressureLoss(); - m_OxygenWallPortPressureLoss->Load(*O2Wall); + } + auto O2WallData = dynamic_cast(actionData.get()); + io::AnesthesiaActions::UnMarshall(*O2WallData, *m_OxygenWallPortPressureLoss); if (!m_OxygenWallPortPressureLoss->IsActive()) { RemoveOxygenWallPortPressureLoss(); return true; @@ -141,11 +111,12 @@ bool SEAnesthesiaMachineActionCollection::ProcessAction(const CDM::AnesthesiaMac return IsValid(*m_OxygenWallPortPressureLoss); } - const CDM::ExpiratoryValveLeakData* eLeak = dynamic_cast(&action); - if (eLeak != nullptr) { - if (m_ExpiratoryValveLeak == nullptr) + if (auto eLeak = dynamic_cast(&action)) { + if (m_ExpiratoryValveLeak == nullptr) { m_ExpiratoryValveLeak = new SEExpiratoryValveLeak(); - m_ExpiratoryValveLeak->Load(*eLeak); + } + auto eLeakData = dynamic_cast(actionData.get()); + io::AnesthesiaActions::UnMarshall(*eLeakData, *m_ExpiratoryValveLeak); if (!m_ExpiratoryValveLeak->IsActive()) { RemoveExpiratoryValveLeak(); return true; @@ -153,11 +124,13 @@ bool SEAnesthesiaMachineActionCollection::ProcessAction(const CDM::AnesthesiaMac return IsValid(*m_ExpiratoryValveLeak); } - const CDM::ExpiratoryValveObstructionData* eOb = dynamic_cast(&action); + const SEExpiratoryValveObstruction* eOb = dynamic_cast(&action); if (eOb != nullptr) { - if (m_ExpiratoryValveObstruction == nullptr) + if (m_ExpiratoryValveObstruction == nullptr) { m_ExpiratoryValveObstruction = new SEExpiratoryValveObstruction(); - m_ExpiratoryValveObstruction->Load(*eOb); + } + auto eObData = dynamic_cast(actionData.get()); + io::AnesthesiaActions::UnMarshall(*eObData, *m_ExpiratoryValveObstruction); if (!m_ExpiratoryValveObstruction->IsActive()) { RemoveExpiratoryValveObstruction(); return true; @@ -165,11 +138,12 @@ bool SEAnesthesiaMachineActionCollection::ProcessAction(const CDM::AnesthesiaMac return IsValid(*m_ExpiratoryValveObstruction); } - const CDM::InspiratoryValveLeakData* iLeak = dynamic_cast(&action); - if (iLeak != nullptr) { - if (m_InspiratoryValveLeak == nullptr) + if (auto iLeak = dynamic_cast(&action)) { + if (m_InspiratoryValveLeak == nullptr) { m_InspiratoryValveLeak = new SEInspiratoryValveLeak(); - m_InspiratoryValveLeak->Load(*iLeak); + } + auto iLeakData = dynamic_cast(actionData.get()); + io::AnesthesiaActions::UnMarshall(*iLeakData, *m_InspiratoryValveLeak); if (!m_InspiratoryValveLeak->IsActive()) { RemoveInspiratoryValveLeak(); return true; @@ -177,11 +151,12 @@ bool SEAnesthesiaMachineActionCollection::ProcessAction(const CDM::AnesthesiaMac return IsValid(*m_InspiratoryValveLeak); } - const CDM::InspiratoryValveObstructionData* iOb = dynamic_cast(&action); - if (iOb != nullptr) { - if (m_InspiratoryValveObstruction == nullptr) + if (auto iOb = dynamic_cast(&action)) { + if (m_InspiratoryValveObstruction == nullptr) { m_InspiratoryValveObstruction = new SEInspiratoryValveObstruction(); - m_InspiratoryValveObstruction->Load(*iOb); + } + auto iObData = dynamic_cast(actionData.get()); + io::AnesthesiaActions::UnMarshall(*iObData, *m_InspiratoryValveObstruction); if (!m_InspiratoryValveObstruction->IsActive()) { RemoveInspiratoryValveObstruction(); return true; @@ -189,11 +164,12 @@ bool SEAnesthesiaMachineActionCollection::ProcessAction(const CDM::AnesthesiaMac return IsValid(*m_InspiratoryValveObstruction); } - const CDM::MaskLeakData* mask = dynamic_cast(&action); - if (mask != nullptr) { - if (m_MaskLeak == nullptr) + if (auto mask = dynamic_cast(&action)) { + if (m_MaskLeak == nullptr) { m_MaskLeak = new SEMaskLeak(); - m_MaskLeak->Load(*mask); + } + auto maskData = dynamic_cast(actionData.get()); + io::AnesthesiaActions::UnMarshall(*maskData, *m_MaskLeak); if (!m_MaskLeak->IsActive()) { RemoveMaskLeak(); return true; @@ -201,11 +177,12 @@ bool SEAnesthesiaMachineActionCollection::ProcessAction(const CDM::AnesthesiaMac return IsValid(*m_MaskLeak); } - const CDM::SodaLimeFailureData* soda = dynamic_cast(&action); - if (soda != nullptr) { - if (m_SodaLimeFailure == nullptr) + if (auto soda = dynamic_cast(&action)) { + if (m_SodaLimeFailure == nullptr) { m_SodaLimeFailure = new SESodaLimeFailure(); - m_SodaLimeFailure->Load(*soda); + } + auto sodaData = dynamic_cast(actionData.get()); + io::AnesthesiaActions::UnMarshall(*sodaData, *m_SodaLimeFailure); if (!m_SodaLimeFailure->IsActive()) { RemoveSodaLimeFailure(); return true; @@ -213,11 +190,12 @@ bool SEAnesthesiaMachineActionCollection::ProcessAction(const CDM::AnesthesiaMac return IsValid(*m_SodaLimeFailure); } - const CDM::TubeCuffLeakData* tube = dynamic_cast(&action); - if (tube != nullptr) { - if (m_TubeCuffLeak == nullptr) + if (auto tube = dynamic_cast(&action)) { + if (m_TubeCuffLeak == nullptr) { m_TubeCuffLeak = new SETubeCuffLeak(); - m_TubeCuffLeak->Load(*tube); + } + auto tubeData = dynamic_cast(actionData.get()); + io::AnesthesiaActions::UnMarshall(*tubeData, *m_TubeCuffLeak); if (!m_TubeCuffLeak->IsActive()) { RemoveTubeCuffLeak(); return true; @@ -225,11 +203,12 @@ bool SEAnesthesiaMachineActionCollection::ProcessAction(const CDM::AnesthesiaMac return IsValid(*m_TubeCuffLeak); } - const CDM::VaporizerFailureData* vFail = dynamic_cast(&action); - if (vFail != nullptr) { - if (m_VaporizerFailure == nullptr) + if (auto vFail = dynamic_cast(&action)) { + if (m_VaporizerFailure == nullptr) { m_VaporizerFailure = new SEVaporizerFailure(); - m_VaporizerFailure->Load(*vFail); + } + auto vFailData = dynamic_cast(actionData.get()); + io::AnesthesiaActions::UnMarshall(*vFailData, *m_VaporizerFailure); if (!m_VaporizerFailure->IsActive()) { RemoveVaporizerFailure(); return true; @@ -237,11 +216,12 @@ bool SEAnesthesiaMachineActionCollection::ProcessAction(const CDM::AnesthesiaMac return IsValid(*m_VaporizerFailure); } - const CDM::VentilatorPressureLossData* vLoss = dynamic_cast(&action); - if (vLoss != nullptr) { - if (m_VentilatorPressureLoss == nullptr) + if (auto vLoss = dynamic_cast(&action)) { + if (m_VentilatorPressureLoss == nullptr) { m_VentilatorPressureLoss = new SEVentilatorPressureLoss(); - m_VentilatorPressureLoss->Load(*vLoss); + } + auto vLossData = dynamic_cast(actionData.get()); + io::AnesthesiaActions::UnMarshall(*vLossData, *m_VentilatorPressureLoss); if (!m_VentilatorPressureLoss->IsActive()) { RemoveVentilatorPressureLoss(); return true; @@ -249,11 +229,12 @@ bool SEAnesthesiaMachineActionCollection::ProcessAction(const CDM::AnesthesiaMac return IsValid(*m_VentilatorPressureLoss); } - const CDM::YPieceDisconnectData* Y = dynamic_cast(&action); - if (Y != nullptr) { - if (m_YPieceDisconnect == nullptr) + if (auto Y = dynamic_cast(&action)) { + if (m_YPieceDisconnect == nullptr) { m_YPieceDisconnect = new SEYPieceDisconnect(); - m_YPieceDisconnect->Load(*Y); + } + auto YData = dynamic_cast(actionData.get()); + io::AnesthesiaActions::UnMarshall(*YData, *m_YPieceDisconnect); if (!m_YPieceDisconnect->IsActive()) { RemoveYPieceDisconnect(); return true; @@ -294,7 +275,7 @@ bool SEAnesthesiaMachineActionCollection::HasOxygenTankPressureLoss() const return m_OxygenTankPressureLoss == nullptr ? false : true; } //------------------------------------------------------------------------------- -SEOxygenTankPressureLoss* SEAnesthesiaMachineActionCollection::GetOxygenTankPressureLoss() const +SEOxygenTankPressureLoss* SEAnesthesiaMachineActionCollection::GetOxygenTankPressureLoss() const { return m_OxygenTankPressureLoss; } @@ -304,12 +285,12 @@ void SEAnesthesiaMachineActionCollection::RemoveOxygenTankPressureLoss() SAFE_DELETE(m_OxygenTankPressureLoss); } //------------------------------------------------------------------------------- -bool SEAnesthesiaMachineActionCollection::HasOxygenWallPortPressureLoss() const +bool SEAnesthesiaMachineActionCollection::HasOxygenWallPortPressureLoss() const { return m_OxygenWallPortPressureLoss == nullptr ? false : true; } //------------------------------------------------------------------------------- -SEOxygenWallPortPressureLoss* SEAnesthesiaMachineActionCollection::GetOxygenWallPortPressureLoss() const +SEOxygenWallPortPressureLoss* SEAnesthesiaMachineActionCollection::GetOxygenWallPortPressureLoss() const { return m_OxygenWallPortPressureLoss; } diff --git a/projects/biogears/libBiogears/src/cdm/scenario/SECondition.cpp b/projects/biogears/libBiogears/src/cdm/scenario/SECondition.cpp index 8afb190e0..97852d782 100644 --- a/projects/biogears/libBiogears/src/cdm/scenario/SECondition.cpp +++ b/projects/biogears/libBiogears/src/cdm/scenario/SECondition.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Conditions.h" + #include #include #include @@ -39,117 +41,14 @@ SECondition::SECondition() //------------------------------------------------------------------------------- SECondition::~SECondition() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SECondition::Clear() +void SECondition::Invalidate() { m_Comment = ""; } //------------------------------------------------------------------------------- -SECondition* SECondition::newFromBind(const CDM::ConditionData& data, SESubstanceManager& substances) -{ - // Could speed up case by testing Patient Conditions vs another type - // But we only have 1 type at this time, and a few conditions to support - const CDM::ChronicAnemiaData* ccAnemiaData = dynamic_cast(&data); - if (ccAnemiaData != nullptr) { - SEChronicAnemia* cc = new SEChronicAnemia(); - cc->Load(*ccAnemiaData); - return cc; - } - const CDM::ChronicObstructivePulmonaryDiseaseData* ccopdData = dynamic_cast(&data); - if (ccopdData != nullptr) { - SEChronicObstructivePulmonaryDisease* cc = new SEChronicObstructivePulmonaryDisease(); - cc->Load(*ccopdData); - return cc; - } - const CDM::ChronicVentricularSystolicDysfunctionData* ccVentSysDysfuncData = dynamic_cast(&data); - if (ccVentSysDysfuncData != nullptr) { - SEChronicVentricularSystolicDysfunction* cc = new SEChronicVentricularSystolicDysfunction(); - cc->Load(*ccVentSysDysfuncData); - return cc; - } - const CDM::ChronicPericardialEffusionData* ccPericardialEffusionData = dynamic_cast(&data); - if (ccPericardialEffusionData != nullptr) { - SEChronicPericardialEffusion* cc = new SEChronicPericardialEffusion(); - cc->Load(*ccPericardialEffusionData); - return cc; - } - const CDM::ChronicRenalStenosisData* ccRenalStenosisData = dynamic_cast(&data); - if (ccRenalStenosisData != nullptr) { - SEChronicRenalStenosis* cc = new SEChronicRenalStenosis(); - cc->Load(*ccRenalStenosisData); - return cc; - } - const CDM::DehydrationData* ccDehydrationData = dynamic_cast(&data); - if (ccDehydrationData != nullptr) { - SEDehydration* cc = new SEDehydration(); - cc->Load(*ccDehydrationData); - return cc; - } - const CDM::DiabetesType1Data* ccDiabetesType1Data = dynamic_cast(&data); - if (ccDiabetesType1Data != nullptr) { - SEDiabetesType1* cc = new SEDiabetesType1(); - cc->Load(*ccDiabetesType1Data); - return cc; - } - const CDM::DiabetesType2Data* ccDiabetesType2Data = dynamic_cast(&data); - if (ccDiabetesType2Data != nullptr) { - SEDiabetesType2* cc = new SEDiabetesType2(); - cc->Load(*ccDiabetesType2Data); - return cc; - } - const CDM::StarvationData* ccStarvationData = dynamic_cast(&data); - if (ccStarvationData != nullptr) { - SEStarvation* cc = new SEStarvation(); - cc->Load(*ccStarvationData); - return cc; - } - const CDM::ImpairedAlveolarExchangeData* ccImpairedAlveolarExchangeData = dynamic_cast(&data); - if (ccImpairedAlveolarExchangeData != nullptr) { - SEImpairedAlveolarExchange* cc = new SEImpairedAlveolarExchange(); - cc->Load(*ccImpairedAlveolarExchangeData); - return cc; - } - const CDM::LobarPneumoniaData* ccLobarPneumoniaData = dynamic_cast(&data); - if (ccLobarPneumoniaData != nullptr) { - SELobarPneumonia* cc = new SELobarPneumonia(); - cc->Load(*ccLobarPneumoniaData); - return cc; - } - const CDM::InitialEnvironmentData* ccInitialEnvironmentData = dynamic_cast(&data); - if (ccInitialEnvironmentData != nullptr) { - SEInitialEnvironment* cc = new SEInitialEnvironment(substances); - cc->Load(*ccInitialEnvironmentData); - return cc; - } - - if (substances.GetLogger() != nullptr) - substances.GetLogger()->Error("Unsupported Condition Received", "SECondition::newFromBind"); - return nullptr; -} -//------------------------------------------------------------------------------- -bool SECondition::Load(const CDM::ConditionData& in) -{ - Clear(); - if (in.Comment().present()) - m_Comment = in.Comment().get(); - return true; -} -//------------------------------------------------------------------------------- -CDM::ConditionData* SECondition::Unload() const -{ - CDM::ConditionData* data = new CDM::ConditionData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SECondition::Unload(CDM::ConditionData& data) const -{ - if (HasComment()) - data.Comment(m_Comment); -} -//------------------------------------------------------------------------------- const char* SECondition::GetComment_cStr() const { return m_Comment.c_str(); diff --git a/projects/biogears/libBiogears/src/cdm/scenario/SEConditionManager.cpp b/projects/biogears/libBiogears/src/cdm/scenario/SEConditionManager.cpp index e56d7d7ec..3bfb1b649 100644 --- a/projects/biogears/libBiogears/src/cdm/scenario/SEConditionManager.cpp +++ b/projects/biogears/libBiogears/src/cdm/scenario/SEConditionManager.cpp @@ -11,6 +11,10 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Scenario.h" +#include "io/cdm/PatientConditions.h" +#include "io/cdm/EnvironmentConditions.h" + #include #include #include @@ -48,10 +52,10 @@ SEConditionManager::SEConditionManager(SESubstanceManager& substances) SEConditionManager::~SEConditionManager() { - Clear(); + Invalidate(); } -void SEConditionManager::Clear() +void SEConditionManager::Invalidate() { m_Anemia = nullptr; m_COPD = nullptr; @@ -68,58 +72,44 @@ void SEConditionManager::Clear() DELETE_VECTOR(m_Conditions); } -void SEConditionManager::Unload(std::vector& to) -{ - for (SECondition* c : m_Conditions) - to.push_back(c->Unload()); -} - -bool SEConditionManager::ProcessCondition(const SECondition& condition, const PhysiologyEngine& engine) -{ - //if (!IsValid(action)) - // return false; - CDM::ConditionData* bind = condition.Unload(); - bool b = ProcessCondition(*bind, engine); - delete bind; - return b; -} - -bool SEConditionManager::ProcessCondition(const CDM::ConditionData& condition, const PhysiologyEngine& engine) -{ - const CDM::ChronicAnemiaData* anemiaData = dynamic_cast(&condition); - if (anemiaData != nullptr) { +bool SEConditionManager::ProcessCondition(const SECondition& conditionSE, const PhysiologyEngine& engine) +{ + auto condition = io::Conditions::factory(&conditionSE); + + if (const CDM::ChronicAnemiaData* anemiaData = dynamic_cast(condition.get())) { if (HasChronicAnemia()) { Error("Cannot have multiple Anemia conditions"); return false; } m_Anemia = new SEChronicAnemia(); - m_Anemia->Load(*anemiaData); + io::PatientConditions::UnMarshall(*anemiaData, *m_Anemia); + m_Conditions.push_back(m_Anemia); return true; } - const CDM::ChronicObstructivePulmonaryDiseaseData* copdData = dynamic_cast(&condition); - if (copdData != nullptr) { + + if (const CDM::ChronicObstructivePulmonaryDiseaseData* copdData = dynamic_cast(condition.get())) { if (HasChronicObstructivePulmonaryDisease()) { Error("Cannot have multiple COPD conditions"); return false; } m_COPD = new SEChronicObstructivePulmonaryDisease(); - m_COPD->Load(*copdData); + io::PatientConditions::UnMarshall(*copdData, *m_COPD); m_Conditions.push_back(m_COPD); return true; } - const CDM::ChronicHeartFailureData* heartFailureData = dynamic_cast(&condition); - if (heartFailureData != nullptr) { + + if (const CDM::ChronicHeartFailureData* heartFailureData = dynamic_cast(condition.get())) { if (HasChronicHeartFailure()) { Error("Cannot have multiple Heart Failure conditions"); return false; } - const CDM::ChronicVentricularSystolicDysfunctionData* vsdData = dynamic_cast(&condition); + const CDM::ChronicVentricularSystolicDysfunctionData* vsdData = dynamic_cast(condition.get()); if (vsdData != nullptr) { m_HeartFailure = new SEChronicVentricularSystolicDysfunction(); - m_HeartFailure->Load(*vsdData); + io::PatientConditions::UnMarshall(*heartFailureData, *m_HeartFailure); m_Conditions.push_back(m_HeartFailure); return true; } @@ -127,110 +117,110 @@ bool SEConditionManager::ProcessCondition(const CDM::ConditionData& condition, c return false; } - const CDM::ChronicPericardialEffusionData* peData = dynamic_cast(&condition); - if (peData != nullptr) { + + if (const CDM::ChronicPericardialEffusionData* peData = dynamic_cast(condition.get())) { if (HasChronicPericardialEffusion()) { Error("Cannot have multiple Pericardial Effusion conditions"); return false; } m_PericardialEffusion = new SEChronicPericardialEffusion(); - m_PericardialEffusion->Load(*peData); + io::PatientConditions::UnMarshall(*peData, *m_PericardialEffusion); m_Conditions.push_back(m_PericardialEffusion); return true; } - const CDM::ChronicRenalStenosisData* renalStenosisData = dynamic_cast(&condition); - if (renalStenosisData != nullptr) { + + if (const CDM::ChronicRenalStenosisData* renalStenosisData = dynamic_cast(condition.get())) { if (HasChronicRenalStenosis()) { Error("Cannot have multiple Renal Stenosis conditions"); return false; } m_RenalStenosis = new SEChronicRenalStenosis(); - m_RenalStenosis->Load(*renalStenosisData); + io::PatientConditions::UnMarshall(*renalStenosisData, *m_RenalStenosis); m_Conditions.push_back(m_RenalStenosis); return true; } - const CDM::DehydrationData* dehydrationData = dynamic_cast(&condition); - if (dehydrationData != nullptr) { + const CDM::DehydrationData* dehydrationData = dynamic_cast(condition.get()); + if (const CDM::ChronicRenalStenosisData* renalStenosisData = dynamic_cast(condition.get())) { if (HasDehydration()) { Error("Cannot have multiple Dehydration conditions"); return false; } m_Dehydration = new SEDehydration(); - m_Dehydration->Load(*dehydrationData); + io::PatientConditions::UnMarshall(*dehydrationData, *m_Dehydration); m_Conditions.push_back(m_Dehydration); return true; } - const CDM::DiabetesType1Data* diabetes1Data = dynamic_cast(&condition); - if (diabetes1Data != nullptr) { + + if (const CDM::DiabetesType1Data* diabetes1Data = dynamic_cast(condition.get())) { if (HasDiabetesType1()) { Error("Cannot have multiple DiabetesType1 conditions"); return false; } m_DiabetesType1 = new SEDiabetesType1(); - m_DiabetesType1->Load(*diabetes1Data); + io::PatientConditions::UnMarshall(*diabetes1Data, *m_DiabetesType1); m_Conditions.push_back(m_DiabetesType1); return true; } - const CDM::DiabetesType2Data* diabetes2Data = dynamic_cast(&condition); - if (diabetes2Data != nullptr) { + + if (const CDM::DiabetesType2Data* diabetes2Data = dynamic_cast(condition.get())) { if (HasDiabetesType2()) { Error("Cannot have multiple DiabetesType2 conditions"); return false; } m_DiabetesType2 = new SEDiabetesType2(); - m_DiabetesType2->Load(*diabetes2Data); + io::PatientConditions::UnMarshall(*diabetes2Data, *m_DiabetesType2); m_Conditions.push_back(m_DiabetesType2); return true; } - const CDM::StarvationData* starvationData = dynamic_cast(&condition); - if (starvationData != nullptr) { + + if (const CDM::StarvationData* starvationData = dynamic_cast(condition.get())) { if (HasStarvation()) { Error("Cannot have multiple Starvation conditions"); return false; } m_Starvation = new SEStarvation(); - m_Starvation->Load(*starvationData); + io::PatientConditions::UnMarshall(*starvationData, *m_Starvation); m_Conditions.push_back(m_Starvation); return true; } - const CDM::ImpairedAlveolarExchangeData* impairedAlvioliData = dynamic_cast(&condition); - if (impairedAlvioliData != nullptr) { + + if (const CDM::ImpairedAlveolarExchangeData* impairedAlvioliData = dynamic_cast(condition.get())) { if (HasImpairedAlveolarExchange()) { Error("Cannot have multiple Impaired Alveolar Exchange conditions"); return false; } m_ImpairedAlveolarExchange = new SEImpairedAlveolarExchange(); - m_ImpairedAlveolarExchange->Load(*impairedAlvioliData); + io::PatientConditions::UnMarshall(*impairedAlvioliData, *m_ImpairedAlveolarExchange); m_Conditions.push_back(m_ImpairedAlveolarExchange); return true; } - const CDM::LobarPneumoniaData* pneumoniaData = dynamic_cast(&condition); - if (pneumoniaData != nullptr) { + + if (const CDM::LobarPneumoniaData* pneumoniaData = dynamic_cast(condition.get())) { if (HasLobarPneumonia()) { Error("Cannot have multiple Lobar Pneumonia conditions"); return false; } m_LobarPneumonia = new SELobarPneumonia(); - m_LobarPneumonia->Load(*pneumoniaData); + io::PatientConditions::UnMarshall(*pneumoniaData, *m_LobarPneumonia); m_Conditions.push_back(m_LobarPneumonia); return true; } - const CDM::InitialEnvironmentData* environmentData = dynamic_cast(&condition); - if (environmentData != nullptr) { + + if (const CDM::InitialEnvironmentData* environmentData = dynamic_cast(condition.get())) { if (HasInitialEnvironment()) { Error("Cannot have multiple Initial Environment conditions"); return false; } m_InitialEnvironment = new SEInitialEnvironment(m_Substances); - m_InitialEnvironment->Load(*environmentData); + io::EnvironmentConditions::UnMarshall(*environmentData, *m_InitialEnvironment); m_Conditions.push_back(m_InitialEnvironment); return true; } diff --git a/projects/biogears/libBiogears/src/cdm/scenario/SEEnvironmentActionCollection.cpp b/projects/biogears/libBiogears/src/cdm/scenario/SEEnvironmentActionCollection.cpp index 0a62c5757..8277ef032 100644 --- a/projects/biogears/libBiogears/src/cdm/scenario/SEEnvironmentActionCollection.cpp +++ b/projects/biogears/libBiogears/src/cdm/scenario/SEEnvironmentActionCollection.cpp @@ -11,6 +11,10 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Environment.h" +#include "io/cdm/EnvironmentActions.h" +#include "io/cdm/Scenario.h" + #include #include #include @@ -26,48 +30,33 @@ SEEnvironmentActionCollection::SEEnvironmentActionCollection(SESubstanceManager& SEEnvironmentActionCollection::~SEEnvironmentActionCollection() { - Clear(); + Invalidate(); } -void SEEnvironmentActionCollection::Clear() +void SEEnvironmentActionCollection::Invalidate() { RemoveChange(); RemoveThermalApplication(); } -void SEEnvironmentActionCollection::Unload(std::vector& to) -{ - if (HasChange()) - to.push_back(GetChange()->Unload()); - if (HasThermalApplication()) - to.push_back(GetThermalApplication()->Unload()); -} - bool SEEnvironmentActionCollection::ProcessAction(const SEEnvironmentAction& action, const PhysiologyEngine& engine) { - if (!IsValid(action)) - return false; - CDM::EnvironmentActionData* bind = action.Unload(); - bool b = ProcessAction(*bind, engine); - delete bind; - return b; -} - -bool SEEnvironmentActionCollection::ProcessAction(const CDM::EnvironmentActionData& action, const PhysiologyEngine& engine) -{ - const CDM::EnvironmentChangeData* change = dynamic_cast(&action); - if (change != nullptr) { - if (m_Change == nullptr) + auto actionData = io::EnvironmentActions::factory(&action); + if (auto change = dynamic_cast(&action)) { + if (m_Change == nullptr) { m_Change = new SEEnvironmentChange(m_Substances); - m_Change->Load(*change); + } + auto changeData = dynamic_cast(actionData.get()); + io::EnvironmentActions::UnMarshall(*changeData, *m_Change); return IsValid(*m_Change); } - const CDM::ThermalApplicationData* thermal = dynamic_cast(&action); - if (thermal != nullptr) { - if (m_ThermalApplication == nullptr) + if (auto thermal = dynamic_cast(&action)) { + if (m_ThermalApplication == nullptr) { m_ThermalApplication = new SEThermalApplication(); - m_ThermalApplication->Load(*thermal); + } + auto changeData = dynamic_cast(actionData.get()); + io::EnvironmentActions::UnMarshall(*changeData, *m_ThermalApplication); if (!m_ThermalApplication->IsActive()) { RemoveThermalApplication(); return true; @@ -83,7 +72,7 @@ bool SEEnvironmentActionCollection::ProcessAction(const CDM::EnvironmentActionDa bool SEEnvironmentActionCollection::IsValid(const SEEnvironmentAction& action) { if (!action.IsValid()) { - Error("Invalid Inhaler Environment Action"); + Error("Invalid Environment Action"); return false; } return true; diff --git a/projects/biogears/libBiogears/src/cdm/scenario/SEInhalerActionCollection.cpp b/projects/biogears/libBiogears/src/cdm/scenario/SEInhalerActionCollection.cpp index a1513b8e9..5dc402c69 100644 --- a/projects/biogears/libBiogears/src/cdm/scenario/SEInhalerActionCollection.cpp +++ b/projects/biogears/libBiogears/src/cdm/scenario/SEInhalerActionCollection.cpp @@ -12,6 +12,9 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/Scenario.h" +#include "io/cdm/InhalerActions.h" + namespace biogears { SEInhalerActionCollection::SEInhalerActionCollection(SESubstanceManager& substances) : Loggable(substances.GetLogger()) @@ -22,38 +25,22 @@ SEInhalerActionCollection::SEInhalerActionCollection(SESubstanceManager& substan SEInhalerActionCollection::~SEInhalerActionCollection() { - Clear(); + Invalidate(); } -void SEInhalerActionCollection::Clear() +void SEInhalerActionCollection::Invalidate() { // State RemoveConfiguration(); } -void SEInhalerActionCollection::Unload(std::vector& to) -{ - if (HasConfiguration()) - to.push_back(GetConfiguration()->Unload()); -} - bool SEInhalerActionCollection::ProcessAction(const SEInhalerAction& action, const PhysiologyEngine& engine) { - if (!IsValid(action)) - return false; - CDM::InhalerActionData* bind = action.Unload(); - bool b = ProcessAction(*bind, engine); - delete bind; - return b; -} -bool SEInhalerActionCollection::ProcessAction(const CDM::InhalerActionData& action, const PhysiologyEngine& engine) -{ - const CDM::InhalerConfigurationData* config = dynamic_cast(&action); - if (config != nullptr) { + if (auto config = dynamic_cast(&action)) { if (m_Configuration == nullptr) m_Configuration = new SEInhalerConfiguration(m_Substances); - m_Configuration->Load(*config); + io::InhalerActions::UnMarshall(*(CDM::InhalerConfigurationData*)(io::InhalerActions::factory(config).get()), *m_Configuration); return IsValid(*m_Configuration); } diff --git a/projects/biogears/libBiogears/src/cdm/scenario/SEPatientActionCollection.cpp b/projects/biogears/libBiogears/src/cdm/scenario/SEPatientActionCollection.cpp index 4bf1857ea..8959a754e 100644 --- a/projects/biogears/libBiogears/src/cdm/scenario/SEPatientActionCollection.cpp +++ b/projects/biogears/libBiogears/src/cdm/scenario/SEPatientActionCollection.cpp @@ -11,16 +11,24 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientActions.h" +#include "io/cdm/Property.h" +#include "io/cdm/Scenario.h" +#include "io/cdm/Substance.h" + +#include #include #include #include -#include + +#include #include #include namespace std { template class map; +template class map; template class map; template class map; template class map; @@ -84,9 +92,8 @@ bool MapIteratorWrapper::operator!=(MapIteratorWrapper const return _iterator != rhs._iterator; } - template -auto MapIteratorWrapper::operator()() const -> PairWrapper +auto MapIteratorWrapper::operator()() const -> PairWrapper { return PairWrapper(_iterator.operator->()); } @@ -94,7 +101,7 @@ auto MapIteratorWrapper::operator()() const -> PairWrapper< template auto MapIteratorWrapper::operator*() const -> PairWrapper { - //Prefix Operator + // Prefix Operator return PairWrapper(_iterator.operator->()); } @@ -102,7 +109,7 @@ auto MapIteratorWrapper::operator*() const -> PairWrapper auto MapIteratorWrapper::operator++() -> MapIteratorWrapper& { - //Prefix Operator ~ + // Prefix Operator ~ ++_iterator; return *this; } @@ -110,7 +117,7 @@ auto MapIteratorWrapper::operator++() -> MapIteratorWrapper& template auto MapIteratorWrapper::operator++(int) -> MapIteratorWrapper { - //Postfix Operator + // Postfix Operator MapIteratorWrapper temp { this->_iterator }; ++_iterator; return temp; @@ -191,14 +198,14 @@ auto VectorIteratorWrapper::operator*() -> ValueType const& template auto VectorIteratorWrapper::operator++() -> VectorIteratorWrapper& { - //Prefix Operator + // Prefix Operator ++_iterator; return { _iterator }; } template auto VectorIteratorWrapper::operator++(int) -> VectorIteratorWrapper { - //Postfix Operator + // Postfix Operator VectorIteratorWrapper temp { _iterator }; ++_iterator; return temp; @@ -227,8 +234,9 @@ auto VectorWrapper::end() const -> VectorIteratorWrapper return { _vector.end() }; } -//Template Specializations +// Template Specializations template class PairWrapper; +template class PairWrapper; template class PairWrapper; template class PairWrapper; template class PairWrapper; @@ -239,6 +247,7 @@ template class PairWrapper; template class PairWrapper; template class MapIteratorWrapper; +template class MapIteratorWrapper; template class MapIteratorWrapper; template class MapIteratorWrapper; template class MapIteratorWrapper; @@ -249,6 +258,7 @@ template class MapIteratorWrapper; template class MapIteratorWrapper; template class MapWrapper; +template class MapWrapper; template class MapWrapper; template class MapWrapper; template class MapWrapper; @@ -257,7 +267,7 @@ template class MapWrapper; template class MapWrapper; template class MapWrapper; template class MapWrapper; -} //namespace biogears +} // namespace biogears namespace biogears { SEPatientActionCollection::SEPatientActionCollection(SESubstanceManager& substances) @@ -275,12 +285,15 @@ SEPatientActionCollection::SEPatientActionCollection(SESubstanceManager& substan m_BurnWound = nullptr; m_CardiacArrest = nullptr; m_ChestCompression = nullptr; + m_LeftChestTube = nullptr; + m_RightChestTube = nullptr; m_ConsciousRespiration = nullptr; m_ConsumeNutrients = nullptr; m_LeftChestOcclusiveDressing = nullptr; m_RightChestOcclusiveDressing = nullptr; m_Exercise = nullptr; m_Ebola = nullptr; + m_Fracture = nullptr; m_Infection = nullptr; m_Intubation = nullptr; m_MechanicalVentilation = nullptr; @@ -301,10 +314,10 @@ SEPatientActionCollection::SEPatientActionCollection(SESubstanceManager& substan //------------------------------------------------------------------------------- SEPatientActionCollection::~SEPatientActionCollection() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEPatientActionCollection::Clear() +void SEPatientActionCollection::Invalidate() { RemoveAcuteRespiratoryDistress(); RemoveAcuteStress(); @@ -316,11 +329,15 @@ void SEPatientActionCollection::Clear() RemoveBronchoconstriction(); RemoveBurnWound(); RemoveChestCompression(); + RemoveLeftChestTube(); + RemoveRightChestTube(); RemoveCardiacArrest(); RemoveConsciousRespiration(); RemoveConsumeNutrients(); RemoveLeftChestOcclusiveDressing(); RemoveRightChestOcclusiveDressing(); + RemoveLeftChestTube(); + RemoveRightChestTube(); RemoveExercise(); RemoveEbola(); RemoveInfection(); @@ -340,168 +357,20 @@ void SEPatientActionCollection::Clear() RemoveUrinate(); RemoveOverride(); - DELETE_MAP_SECOND(m_Escharotomies); - DELETE_MAP_SECOND(m_Hemorrhages); - DELETE_MAP_SECOND(m_PainStimuli); - DELETE_MAP_SECOND(m_SubstanceBolus); - DELETE_MAP_SECOND(m_SubstanceInfusions); - DELETE_MAP_SECOND(m_SubstanceOralDoses); - DELETE_MAP_SECOND(m_SubstanceCompoundInfusions); - DELETE_MAP_SECOND(m_Tourniquets); -} -//------------------------------------------------------------------------------- -void SEPatientActionCollection::Unload(std::vector& to) -{ - if (HasAcuteRespiratoryDistress()) { - to.push_back(GetAcuteRespiratoryDistress()->Unload()); - } - if (HasAcuteStress()) { - to.push_back(GetAcuteStress()->Unload()); - } - if (HasExampleAction()) { - to.push_back(GetExampleAction()->Unload()); - } - if (HasAirwayObstruction()) { - to.push_back(GetAirwayObstruction()->Unload()); - } - if (HasApnea()) { - to.push_back(GetApnea()->Unload()); - } - if (HasAsthmaAttack()) { - to.push_back(GetAsthmaAttack()->Unload()); - } - if (HasBrainInjury()) { - to.push_back(GetBrainInjury()->Unload()); - } - if (HasBronchoconstriction()) { - to.push_back(GetBronchoconstriction()->Unload()); - } - if (HasBurnWound()) { - to.push_back(GetBurnWound()->Unload()); - } - if (HasCardiacArrest()) { - to.push_back(GetCardiacArrest()->Unload()); - } - if (HasChestCompressionForce()) { - to.push_back(GetChestCompressionForce()->Unload()); - } - if (HasChestCompressionForceScale()) { - to.push_back(GetChestCompressionForceScale()->Unload()); - } - if (HasLeftChestOcclusiveDressing()) { - to.push_back(GetLeftChestOcclusiveDressing()->Unload()); - } - if (HasRightChestOcclusiveDressing()) { - to.push_back(GetRightChestOcclusiveDressing()->Unload()); - } - if (HasConsciousRespiration()) { - to.push_back(GetConsciousRespiration()->Unload()); - } - if (HasConsumeNutrients()) { - to.push_back(GetConsumeNutrients()->Unload()); - } - if (HasEscharotomy()) { - for (auto itr : GetEscharotomies()) { - to.push_back(itr.second->Unload()); - } - } - if (HasEbola()) { - to.push_back(GetEbola()->Unload()); - } - if (HasExercise()) { - to.push_back(GetExercise()->Unload()); - } - if (HasHemorrhage()) { - for (auto itr : GetHemorrhages()) { - to.push_back(itr.second->Unload()); - } - } - if (HasInfection()) { - to.push_back(GetInfection()->Unload()); - } - if (HasIntubation()) { - to.push_back(GetIntubation()->Unload()); - } - if (HasMechanicalVentilation()) { - to.push_back(GetMechanicalVentilation()->Unload()); - } - if (HasNasalCannula()) { - to.push_back(GetNasalCannula()->Unload()); - } - if (HasLeftNeedleDecompression()) { - to.push_back(GetLeftNeedleDecompression()->Unload()); - } - if (HasRightNeedleDecompression()) { - to.push_back(GetRightNeedleDecompression()->Unload()); - } - if (HasPainStimulus()) { - for (auto itr : GetPainStimuli()) { - to.push_back(itr.second->Unload()); - } - } - if (HasPericardialEffusion()) { - to.push_back(GetPericardialEffusion()->Unload()); - } - if (HasPulmonaryShunt()) { - to.push_back(GetPulmonaryShunt()->Unload()); - } - if (HasRadiationAbsorbedDose()) { - to.push_back(GetRadiationAbsorbedDose()->Unload()); - } - if (HasSleepState()) { - to.push_back(GetSleepState()->Unload()); - } - if (HasLeftClosedTensionPneumothorax()) { - to.push_back(GetLeftClosedTensionPneumothorax()->Unload()); - } - if (HasLeftOpenTensionPneumothorax()) { - to.push_back(GetLeftOpenTensionPneumothorax()->Unload()); - } - if (HasRightClosedTensionPneumothorax()) { - to.push_back(GetRightClosedTensionPneumothorax()->Unload()); - } - if (HasRightOpenTensionPneumothorax()) { - to.push_back(GetRightOpenTensionPneumothorax()->Unload()); - } - for (auto itr : GetSubstanceBoluses()) { - to.push_back(itr.second->Unload()); - } - for (auto itr : GetSubstanceInfusions()) { - to.push_back(itr.second->Unload()); - } - for (auto itr : GetSubstanceOralDoses()) { - to.push_back(itr.second->Unload()); - } - for (auto itr : GetSubstanceCompoundInfusions()) { - to.push_back(itr.second->Unload()); - } - if (HasTourniquet()) { - for (auto itr : GetTourniquets()) { - to.push_back(itr.second->Unload()); - } - } - if (HasUrinate()) { - to.push_back(GetUrinate()->Unload()); - } - if (HasOverride()) { - to.push_back((GetOverride()->Unload())); - } + DELETE_MAP_OF_POINTERS(m_Escharotomies); + DELETE_MAP_OF_POINTERS(m_Hemorrhages); + DELETE_MAP_OF_POINTERS(m_PainStimuli); + DELETE_MAP_OF_POINTERS(m_SubstanceBolus); + DELETE_MAP_OF_POINTERS(m_SubstanceInfusions); + DELETE_MAP_OF_POINTERS(m_SubstanceOralDoses); + DELETE_MAP_OF_POINTERS(m_SubstanceCompoundInfusions); + DELETE_MAP_OF_POINTERS(m_Tourniquets); + DELETE_MAP_OF_POINTERS(m_Amputations); } //------------------------------------------------------------------------------- bool SEPatientActionCollection::ProcessAction(const SEPatientAction& action, const PhysiologyEngine& engine) { - if (!IsValid(action)) { - return false; - } - CDM::PatientActionData* bind = action.Unload(); - bool b = ProcessAction(*bind, engine); - delete bind; - return b; -} -//------------------------------------------------------------------------------- -bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& action, const PhysiologyEngine& engine) -{ - const CDM::PatientAssessmentRequestData* patientAssessment = dynamic_cast(&action); + auto patientAssessment = dynamic_cast(&action); if (patientAssessment != nullptr) { // TODO just add this to a list? // Not doing anything with this, assessment actions @@ -522,12 +391,13 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti // with that compartment. // SO, we make our own copy and manage that copy (i.e. by updating a single action) - const CDM::AcuteRespiratoryDistressData* ards = dynamic_cast(&action); + auto ards = dynamic_cast(&action); if (ards != nullptr) { if (m_AcuteRespiratoryDistress == nullptr) { m_AcuteRespiratoryDistress = new SEAcuteRespiratoryDistress(); } - m_AcuteRespiratoryDistress->Load(*ards); + CDM_PATIENT_ACTION_COPY(AcuteRespiratoryDistress, *ards, *m_AcuteRespiratoryDistress); + if (!m_AcuteRespiratoryDistress->IsActive()) { RemoveAcuteRespiratoryDistress(); return true; @@ -535,12 +405,12 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti return IsValid(*m_AcuteRespiratoryDistress); } - const CDM::AcuteStressData* aStress = dynamic_cast(&action); + auto aStress = dynamic_cast(&action); if (aStress != nullptr) { if (m_AcuteStress == nullptr) { m_AcuteStress = new SEAcuteStress(); } - m_AcuteStress->Load(*aStress); + CDM_PATIENT_ACTION_COPY(AcuteStress, *aStress, *m_AcuteStress) if (!m_AcuteStress->IsActive()) { RemoveAcuteStress(); return true; @@ -548,12 +418,12 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti return IsValid(*m_AcuteStress); } - const CDM::ExampleActionData* expAction = dynamic_cast(&action); + auto expAction = dynamic_cast(&action); if (expAction != nullptr) { if (m_ExampleAction == nullptr) { m_ExampleAction = new SEExampleAction(); } - m_ExampleAction->Load(*expAction); + CDM_PATIENT_ACTION_COPY(ExampleAction, *expAction, *m_ExampleAction) if (!m_ExampleAction->IsActive()) { RemoveExampleAction(); return true; @@ -561,25 +431,59 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti return IsValid(*m_ExampleAction); } - const CDM::AirwayObstructionData* airwayObst = dynamic_cast(&action); + auto airwayObst = dynamic_cast(&action); if (airwayObst != nullptr) { if (m_AirwayObstruction == nullptr) { m_AirwayObstruction = new SEAirwayObstruction(); } - m_AirwayObstruction->Load(*airwayObst); + CDM_PATIENT_ACTION_COPY(AirwayObstruction, *airwayObst, *m_AirwayObstruction) if (!m_AirwayObstruction->IsActive()) { RemoveAirwayObstruction(); return true; } return IsValid(*m_AirwayObstruction); } + auto ampData = dynamic_cast(&action); + if (ampData != nullptr) { + auto ampItr = m_Amputations.find(ampData->GetCompartment()); + bool validCmpt = false; + std::stringstream warn; + SEAmputation* amputation = std::make_unique().release(); + if (ampItr != m_Amputations.end()) { - const CDM::ApneaData* apnea = dynamic_cast(&action); + amputation = m_Amputations[ampData->GetCompartment()]; + CDM_PATIENT_ACTION_COPY(Amputation, *ampData, *amputation) + validCmpt = true; + } else { + CDM_PATIENT_ACTION_COPY(Amputation, *ampData, *amputation) + if (amputation->IsValid()) { + m_Amputations[ampData->GetCompartment()] = amputation; + ampItr = m_Amputations.find(ampData->GetCompartment()); + validCmpt = true; + } else { + amputation->Invalidate(); + warn << "\t Invalid amputation location: Valid options are LeftArm, LeftLeg, RightArm, RightLeg" << std::endl; + } + } + if (validCmpt) { + auto Amputation = ampItr->second; + CDM_PATIENT_ACTION_COPY(Amputation, *ampData, *Amputation) + if (!Amputation->IsActive()) { + RemoveAmputation(Amputation->GetCompartment()); + return true; + } + return IsValid(*Amputation); + } else { + Warning(warn); + return false; + } + } + auto apnea = dynamic_cast(&action); if (apnea != nullptr) { if (m_Apnea == nullptr) { m_Apnea = new SEApnea(); } - m_Apnea->Load(*apnea); + CDM_PATIENT_ACTION_COPY(Apnea, *apnea, *m_Apnea) if (!m_Apnea->IsActive()) { RemoveApnea(); return true; @@ -587,12 +491,12 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti return IsValid(*m_Apnea); } - const CDM::AsthmaAttackData* asthmaattack = dynamic_cast(&action); + auto asthmaattack = dynamic_cast(&action); if (asthmaattack != nullptr) { if (m_AsthmaAttack == nullptr) { m_AsthmaAttack = new SEAsthmaAttack(); } - m_AsthmaAttack->Load(*asthmaattack); + CDM_PATIENT_ACTION_COPY(AsthmaAttack, *asthmaattack, *m_AsthmaAttack) if (!m_AsthmaAttack->IsActive()) { RemoveAsthmaAttack(); return true; @@ -600,12 +504,12 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti return IsValid(*m_AsthmaAttack); } - const CDM::BrainInjuryData* brainInjury = dynamic_cast(&action); + auto brainInjury = dynamic_cast(&action); if (brainInjury != nullptr) { if (m_BrainInjury == nullptr) { m_BrainInjury = new SEBrainInjury(); } - m_BrainInjury->Load(*brainInjury); + CDM_PATIENT_ACTION_COPY(BrainInjury, *brainInjury, *m_BrainInjury) if (!m_BrainInjury->IsActive()) { RemoveBrainInjury(); return true; @@ -613,12 +517,12 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti return IsValid(*m_BrainInjury); } - const CDM::BronchoconstrictionData* bronchoconstr = dynamic_cast(&action); + auto bronchoconstr = dynamic_cast(&action); if (bronchoconstr != nullptr) { if (m_Bronchoconstriction == nullptr) { m_Bronchoconstriction = new SEBronchoconstriction(); } - m_Bronchoconstriction->Load(*bronchoconstr); + CDM_PATIENT_ACTION_COPY(Bronchoconstriction, *bronchoconstr, *m_Bronchoconstriction) if (!m_Bronchoconstriction->IsActive()) { RemoveBronchoconstriction(); return true; @@ -626,14 +530,13 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti return IsValid(*m_Bronchoconstriction); } - const CDM::BurnWoundData* burn = dynamic_cast(&action); + auto burn = dynamic_cast(&action); if (burn != nullptr) { if (m_BurnWound == nullptr) { m_BurnWound = new SEBurnWound(); } - - m_BurnWound->Load(*burn); + CDM_PATIENT_ACTION_COPY(BurnWound, *burn, *m_BurnWound) if (m_BurnWound->GetTimeOfBurn() == 0.0) { m_BurnWound->SetTimeOfBurn(engine.GetSimulationTime(TimeUnit::s)); } @@ -644,24 +547,24 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti return IsValid(*m_BurnWound); } - const CDM::CardiacArrestData* cardiacarrest = dynamic_cast(&action); + auto cardiacarrest = dynamic_cast(&action); if (cardiacarrest != nullptr) { - if (m_CardiacArrest == nullptr && cardiacarrest->State() == CDM::enumOnOff::Off) { - return true; //Ignore :CardiacArrest::Off request when no :CardiacArrest Event exist. + if (m_CardiacArrest == nullptr && cardiacarrest->IsActive()) { + return true; // Ignore :CardiacArrest::Off request when no :CardiacArrest Event exist. } if (m_CardiacArrest == nullptr) { m_CardiacArrest = new SECardiacArrest(); } - m_CardiacArrest->Load(*cardiacarrest); + CDM_PATIENT_ACTION_COPY(CardiacArrest, *cardiacarrest, *m_CardiacArrest) return IsValid(*m_CardiacArrest); } - const CDM::ChestCompressionData* chestcomp = dynamic_cast(&action); + auto chestcomp = dynamic_cast(&action); if (chestcomp != nullptr) { - const CDM::ChestCompressionForceData* cprForce = dynamic_cast(chestcomp); + auto cprForce = dynamic_cast(chestcomp); if (cprForce != nullptr) { if (HasChestCompressionForceScale()) { RemoveChestCompression(); @@ -669,14 +572,14 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti if (m_ChestCompression == nullptr) { m_ChestCompression = new SEChestCompressionForce(); } - ((SEChestCompressionForce*)m_ChestCompression)->Load(*cprForce); + CDM_PATIENT_ACTION_COPY(ChestCompressionForce, *cprForce, *((SEChestCompressionForce*)m_ChestCompression)) if (!m_ChestCompression->IsActive()) { RemoveChestCompression(); return true; } return IsValid(*m_ChestCompression); } - const CDM::ChestCompressionForceScaleData* cprScale = dynamic_cast(chestcomp); + auto cprScale = dynamic_cast(chestcomp); if (cprScale != nullptr) { if (HasChestCompressionForce()) { RemoveChestCompression(); @@ -684,7 +587,7 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti if (m_ChestCompression == nullptr) { m_ChestCompression = new SEChestCompressionForceScale(); } - ((SEChestCompressionForceScale*)m_ChestCompression)->Load(*cprScale); + CDM_PATIENT_ACTION_COPY(ChestCompressionForce, *cprForce, *((SEChestCompressionForceScale*)m_ChestCompression)) if (!m_ChestCompression->IsActive()) { RemoveChestCompression(); return true; @@ -695,23 +598,23 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti return false; } - const CDM::ChestOcclusiveDressingData* chestOccl = dynamic_cast(&action); + auto chestOccl = dynamic_cast(&action); if (chestOccl != nullptr) { - if (chestOccl->Side() == CDM::enumSide::Left) { + if (chestOccl->GetSide() == SESide::Left) { if (m_LeftChestOcclusiveDressing == nullptr) { m_LeftChestOcclusiveDressing = new SEChestOcclusiveDressing(); } - m_LeftChestOcclusiveDressing->Load(*chestOccl); + CDM_PATIENT_ACTION_COPY(ChestOcclusiveDressing, *chestOccl, *m_LeftChestOcclusiveDressing) if (!m_LeftChestOcclusiveDressing->IsActive()) { RemoveLeftChestOcclusiveDressing(); return true; } return IsValid(*m_LeftChestOcclusiveDressing); - } else if (chestOccl->Side() == CDM::enumSide::Right) { + } else if (chestOccl->GetSide() == SESide::Right) { if (m_RightChestOcclusiveDressing == nullptr) { m_RightChestOcclusiveDressing = new SEChestOcclusiveDressing(); } - m_RightChestOcclusiveDressing->Load(*chestOccl); + CDM_PATIENT_ACTION_COPY(ChestOcclusiveDressing, *chestOccl, *m_RightChestOcclusiveDressing) if (!m_RightChestOcclusiveDressing->IsActive()) { RemoveRightChestOcclusiveDressing(); return true; @@ -720,12 +623,37 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti } } - const CDM::ConsciousRespirationData* conResp = dynamic_cast(&action); + auto chestTu = dynamic_cast(&action); + if (chestTu != nullptr) { + if (chestTu->GetSide() == SESide::Left) { + if (m_LeftChestTube == nullptr) { + m_LeftChestTube = new SEChestTube(); + } + CDM_PATIENT_ACTION_COPY(ChestTube, *chestTu, *m_LeftChestTube) + if (!m_LeftChestTube->IsActive()) { + RemoveLeftChestTube(); + return true; + } + return IsValid(*m_LeftChestTube); + } else if (chestTu->GetSide() == SESide::Right) { + if (m_RightChestTube == nullptr) { + m_RightChestTube = new SEChestTube(); + } + CDM_PATIENT_ACTION_COPY(ChestTube, *chestTu, *m_RightChestTube) + if (!m_RightChestTube->IsActive()) { + RemoveRightChestTube(); + return true; + } + return IsValid(*m_RightChestTube); + } + } + + auto conResp = dynamic_cast(&action); if (conResp != nullptr) { if (m_ConsciousRespiration == nullptr) { m_ConsciousRespiration = new SEConsciousRespiration(); } - m_ConsciousRespiration->Load(*conResp, m_Substances); + CDM_PATIENT_ACTION_COPY(ConsciousRespiration, *conResp, *m_ConsciousRespiration) if (!m_ConsciousRespiration->IsActive()) { RemoveConsciousRespiration(); return true; @@ -733,12 +661,12 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti return IsValid(*m_ConsciousRespiration); } - const CDM::ConsumeNutrientsData* consume = dynamic_cast(&action); + auto consume = dynamic_cast(&action); if (consume != nullptr) { if (m_ConsumeNutrients == nullptr) { m_ConsumeNutrients = new SEConsumeNutrients(); } - m_ConsumeNutrients->Load(*consume); + CDM_PATIENT_ACTION_COPY(ConsumeNutrients, *consume, *m_ConsumeNutrients) if (!m_ConsumeNutrients->IsActive()) { RemoveConsumeNutrients(); return true; @@ -746,24 +674,24 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti return IsValid(*m_ConsumeNutrients); } - const CDM::EscharotomyData* eschData = dynamic_cast(&action); + auto eschData = dynamic_cast(&action); if (eschData != nullptr) { - auto eItr = m_Escharotomies.find(eschData->Location()); + auto eItr = m_Escharotomies.find(eschData->GetLocation()); SEEscharotomy* escharotomy = std::make_unique().release(); if (eItr != m_Escharotomies.end()) { - escharotomy = m_Escharotomies[eschData->Location()]; - escharotomy->Load(*eschData); + escharotomy = m_Escharotomies[eschData->GetLocation()]; + CDM_PATIENT_ACTION_COPY(Escharotomy, *eschData, *escharotomy) } else { - escharotomy->Load(*eschData); + CDM_PATIENT_ACTION_COPY(Escharotomy, *eschData, *escharotomy) if (escharotomy->IsValid()) { - m_Escharotomies[eschData->Location()] = escharotomy; - eItr = m_Escharotomies.find(eschData->Location()); + m_Escharotomies[eschData->GetLocation()] = escharotomy; + eItr = m_Escharotomies.find(eschData->GetLocation()); } else { - escharotomy->Clear(); + escharotomy->Invalidate(); } } auto escharotomy2 = eItr->second; - escharotomy2->Load(*eschData); + CDM_PATIENT_ACTION_COPY(Escharotomy, *eschData, *escharotomy2) if (!escharotomy2->IsActive()) { RemoveEscharotomy(escharotomy2->GetLocation()); return true; @@ -771,12 +699,12 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti return IsValid(*escharotomy2); } - const CDM::EbolaData* ebola = dynamic_cast(&action); + auto ebola = dynamic_cast(&action); if (ebola != nullptr) { if (m_Ebola == nullptr) { m_Ebola = new SEEbola(); } - m_Ebola->Load(*ebola); + CDM_PATIENT_ACTION_COPY(Ebola, *ebola, *m_Ebola) if (!m_Ebola->IsActive()) { RemoveEbola(); return true; @@ -784,12 +712,12 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti return IsValid(*m_Ebola); } - const CDM::ExerciseData* exercise = dynamic_cast(&action); + auto exercise = dynamic_cast(&action); if (exercise != nullptr) { if (m_Exercise == nullptr) { m_Exercise = new SEExercise(); } - m_Exercise->Load(*exercise); + CDM_PATIENT_ACTION_COPY(Exercise, *exercise, *m_Exercise) if (!m_Exercise->IsActive()) { RemoveExercise(); return true; @@ -797,14 +725,28 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti return IsValid(*m_Exercise); } - const CDM::HemorrhageData* hem = dynamic_cast(&action); + auto fract = dynamic_cast(&action); + if (fract != nullptr) { + if (m_Fracture == nullptr) { + m_Fracture = new SEFracture(); + } + CDM_PATIENT_ACTION_COPY(Fracture, *fract, *m_Fracture) + if (!m_Fracture->IsActive()) { + m_Logger->Warning("Healing broken bone."); + RemoveFracture(); + return true; + } + return IsValid(*m_Fracture); + } + + auto hem = dynamic_cast(&action); if (hem != nullptr) { - SEHemorrhage* myHem = m_Hemorrhages[hem->Compartment()]; + SEHemorrhage* myHem = m_Hemorrhages[hem->GetCompartment()]; if (myHem == nullptr) { myHem = new SEHemorrhage(); - m_Hemorrhages[hem->Compartment()] = myHem; + m_Hemorrhages[hem->GetCompartment()] = myHem; } - myHem->Load(*hem); + CDM_PATIENT_ACTION_COPY(Hemorrhage, *hem, *myHem) if (!myHem->IsActive()) { RemoveHemorrhage(myHem->GetCompartment()); @@ -812,13 +754,13 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti } return IsValid(*myHem); } - - const CDM::InfectionData* infect = dynamic_cast(&action); + + auto infect = dynamic_cast(&action); if (infect != nullptr) { if (m_Infection == nullptr) { m_Infection = new SEInfection(); } - m_Infection->Load(*infect); + CDM_PATIENT_ACTION_COPY(Infection, *infect, *m_Infection) if (!m_Infection->IsActive()) { m_Logger->Warning("Manual Eliminaton of Infection currently not supported."); return false; @@ -826,12 +768,12 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti return IsValid(*m_Infection); } - const CDM::IntubationData* intubation = dynamic_cast(&action); + auto intubation = dynamic_cast(&action); if (intubation != nullptr) { if (m_Intubation == nullptr) { m_Intubation = new SEIntubation(); } - m_Intubation->Load(*intubation); + CDM_PATIENT_ACTION_COPY(Intubation, *intubation, *m_Intubation) if (!m_Intubation->IsActive()) { Info("Turning off Intubation"); RemoveIntubation(); @@ -840,12 +782,12 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti return IsValid(*m_Intubation); } - const CDM::MechanicalVentilationData* mvData = dynamic_cast(&action); + auto mvData = dynamic_cast(&action); if (mvData != nullptr) { if (m_MechanicalVentilation == nullptr) { m_MechanicalVentilation = new SEMechanicalVentilation(); } - m_MechanicalVentilation->Load(*mvData, m_Substances); + CDM_PATIENT_ACTION_COPY(MechanicalVentilation, *mvData, *m_MechanicalVentilation) if (!m_MechanicalVentilation->IsActive()) { RemoveMechanicalVentilation(); return true; @@ -853,12 +795,12 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti return IsValid(*m_MechanicalVentilation); } - const CDM::NasalCannulaData* nCannula = dynamic_cast(&action); + auto nCannula = dynamic_cast(&action); if (nCannula != nullptr) { if (m_NasalCannula == nullptr) { m_NasalCannula = new SENasalCannula(); } - m_NasalCannula->Load(*nCannula); + CDM_PATIENT_ACTION_COPY(NasalCannula, *nCannula, *m_NasalCannula) if (!m_NasalCannula->IsActive()) { RemoveNasalCannula(); return true; @@ -866,23 +808,23 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti return IsValid(*m_NasalCannula); } - const CDM::NeedleDecompressionData* needleDecomp = dynamic_cast(&action); + auto needleDecomp = dynamic_cast(&action); if (needleDecomp != nullptr) { - if (needleDecomp->Side() == CDM::enumSide::Left) { + if (needleDecomp->GetSide() == SESide::Left) { if (m_LeftNeedleDecompression == nullptr) { m_LeftNeedleDecompression = new SENeedleDecompression(); } - m_LeftNeedleDecompression->Load(*needleDecomp); + CDM_PATIENT_ACTION_COPY(NeedleDecompression, *needleDecomp, *m_LeftNeedleDecompression) if (!m_LeftNeedleDecompression->IsActive()) { RemoveLeftNeedleDecompression(); return true; } return IsValid(*m_LeftNeedleDecompression); - } else if (needleDecomp->Side() == CDM::enumSide::Right) { + } else if (needleDecomp->GetSide() == SESide::Right) { if (m_RightNeedleDecompression == nullptr) { m_RightNeedleDecompression = new SENeedleDecompression(); } - m_RightNeedleDecompression->Load(*needleDecomp); + CDM_PATIENT_ACTION_COPY(NeedleDecompression, *needleDecomp, *m_RightNeedleDecompression) if (!m_RightNeedleDecompression->IsActive()) { RemoveRightNeedleDecompression(); return true; @@ -893,14 +835,14 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti } } - const CDM::PainStimulusData* pain = dynamic_cast(&action); + auto pain = dynamic_cast(&action); if (pain != nullptr) { - SEPainStimulus* mypain = m_PainStimuli[pain->Location()]; + SEPainStimulus* mypain = m_PainStimuli[pain->GetLocation()]; if (mypain == nullptr) { mypain = new SEPainStimulus(); - m_PainStimuli[pain->Location()] = mypain; + m_PainStimuli[pain->GetLocation()] = mypain; } - mypain->Load(*pain); + CDM_PATIENT_ACTION_COPY(PainStimulus, *pain, *mypain) if (!mypain->IsActive()) { RemovePainStimulus(mypain->GetLocation()); @@ -909,12 +851,12 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti return IsValid(*mypain); } - const CDM::PericardialEffusionData* pericardialEff = dynamic_cast(&action); + auto pericardialEff = dynamic_cast(&action); if (pericardialEff != nullptr) { if (m_PericardialEffusion == nullptr) { m_PericardialEffusion = new SEPericardialEffusion(); } - m_PericardialEffusion->Load(*pericardialEff); + CDM_PATIENT_ACTION_COPY(PericardialEffusion, *pericardialEff, *m_PericardialEffusion) if (!m_PericardialEffusion->IsActive()) { RemovePericardialEffusion(); return true; @@ -922,12 +864,12 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti return IsValid(*m_PericardialEffusion); } - const CDM::PulmonaryShuntData* pulmonaryShunt = dynamic_cast(&action); + auto pulmonaryShunt = dynamic_cast(&action); if (pulmonaryShunt != nullptr) { if (m_PulmonaryShunt == nullptr) { m_PulmonaryShunt = new SEPulmonaryShunt(); } - m_PulmonaryShunt->Load(*pulmonaryShunt); + CDM_PATIENT_ACTION_COPY(PulmonaryShunt, *pulmonaryShunt, *m_PulmonaryShunt) if (!m_PulmonaryShunt->IsActive()) { RemovePulmonaryShunt(); return true; @@ -935,11 +877,11 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti return IsValid(*m_PulmonaryShunt); } - const CDM::RadiationAbsorbedDoseData* radabs = dynamic_cast(&action); + auto radabs = dynamic_cast(&action); if (radabs != nullptr) { if (m_RadiationAbsorbedDose == nullptr) m_RadiationAbsorbedDose = new SERadiationAbsorbedDose(); - m_RadiationAbsorbedDose->Load(*radabs); + CDM_PATIENT_ACTION_COPY(RadiationAbsorbedDose, *radabs, *m_RadiationAbsorbedDose) if (!m_RadiationAbsorbedDose->IsActive()) { RemoveRadiationAbsorbedDose(); return true; @@ -947,11 +889,11 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti return IsValid(*m_RadiationAbsorbedDose); } - const CDM::SleepData* sleep = dynamic_cast(&action); + auto sleep = dynamic_cast(&action); if (sleep != nullptr) { if (m_Sleep == nullptr) m_Sleep = new SESleep(); - m_Sleep->Load(*sleep); + CDM_PATIENT_ACTION_COPY(Sleep, *sleep, *m_Sleep) if (!m_Sleep->IsActive()) { RemoveSleepState(); return true; @@ -959,48 +901,48 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti return IsValid(*m_Sleep); } - const CDM::SubstanceAdministrationData* admin = dynamic_cast(&action); + auto admin = dynamic_cast(&action); if (admin != nullptr) { return AdministerSubstance(*admin); } - const CDM::TensionPneumothoraxData* pneumo = dynamic_cast(&action); + auto pneumo = dynamic_cast(&action); if (pneumo != nullptr) { - if (pneumo->Side() == CDM::enumSide::Left && pneumo->Type() == CDM::enumPneumothoraxType::Open) { + if (pneumo->GetSide() == SESide::Left && pneumo->GetType() == SEPneumothoraxType::Open) { if (m_LeftOpenTensionPneumothorax == nullptr) { m_LeftOpenTensionPneumothorax = new SETensionPneumothorax(); } - m_LeftOpenTensionPneumothorax->Load(*pneumo); + CDM_PATIENT_ACTION_COPY(TensionPneumothorax, *pneumo, *m_LeftOpenTensionPneumothorax) if (!m_LeftOpenTensionPneumothorax->IsActive()) { RemoveLeftClosedTensionPneumothorax(); return true; } return IsValid(*m_LeftOpenTensionPneumothorax); - } else if (pneumo->Side() == CDM::enumSide::Left && pneumo->Type() == CDM::enumPneumothoraxType::Closed) { + } else if (pneumo->GetSide() == SESide::Left && pneumo->GetType() == SEPneumothoraxType::Closed) { if (m_LeftClosedTensionPneumothorax == nullptr) { m_LeftClosedTensionPneumothorax = new SETensionPneumothorax(); } - m_LeftClosedTensionPneumothorax->Load(*pneumo); + CDM_PATIENT_ACTION_COPY(TensionPneumothorax, *pneumo, *m_LeftClosedTensionPneumothorax) if (!m_LeftClosedTensionPneumothorax->IsActive()) { RemoveLeftOpenTensionPneumothorax(); return true; } return IsValid(*m_LeftClosedTensionPneumothorax); - } else if (pneumo->Side() == CDM::enumSide::Right && pneumo->Type() == CDM::enumPneumothoraxType::Open) { + } else if (pneumo->GetSide() == SESide::Right && pneumo->GetType() == SEPneumothoraxType::Open) { if (m_RightOpenTensionPneumothorax == nullptr) { m_RightOpenTensionPneumothorax = new SETensionPneumothorax(); } - m_RightOpenTensionPneumothorax->Load(*pneumo); + CDM_PATIENT_ACTION_COPY(TensionPneumothorax, *pneumo, *m_RightOpenTensionPneumothorax) if (!m_RightOpenTensionPneumothorax->IsActive()) { RemoveRightOpenTensionPneumothorax(); return true; } return IsValid(*m_RightOpenTensionPneumothorax); - } else if (pneumo->Side() == CDM::enumSide::Right && pneumo->Type() == CDM::enumPneumothoraxType::Closed) { + } else if (pneumo->GetSide() == SESide::Right && pneumo->GetType() == SEPneumothoraxType::Closed) { if (m_RightClosedTensionPneumothorax == nullptr) { m_RightClosedTensionPneumothorax = new SETensionPneumothorax(); } - m_RightClosedTensionPneumothorax->Load(*pneumo); + CDM_PATIENT_ACTION_COPY(TensionPneumothorax, *pneumo, *m_RightClosedTensionPneumothorax) if (!m_RightClosedTensionPneumothorax->IsActive()) { RemoveRightClosedTensionPneumothorax(); return true; @@ -1010,28 +952,28 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti return false; // Duno what this is... } - const CDM::TourniquetData* tournData = dynamic_cast(&action); + auto tournData = dynamic_cast(&action); if (tournData != nullptr) { - auto tItr = m_Tourniquets.find(tournData->Compartment()); + auto tItr = m_Tourniquets.find(tournData->GetCompartment()); bool matchingHem = false; bool validCmpt = false; std::stringstream warn; - if (m_Hemorrhages.find(tournData->Compartment()) != m_Hemorrhages.end()) { + if (m_Hemorrhages.find(tournData->GetCompartment()) != m_Hemorrhages.end()) { matchingHem = true; SETourniquet* tourniquet = std::make_unique().release(); if (tItr != m_Tourniquets.end()) { - tourniquet = m_Tourniquets[tournData->Compartment()]; - tourniquet->Load(*tournData); + tourniquet = m_Tourniquets[tournData->GetCompartment()]; + CDM_PATIENT_ACTION_COPY(Tourniquet, *tournData, *tourniquet) validCmpt = true; } else { - tourniquet->Load(*tournData); + CDM_PATIENT_ACTION_COPY(Tourniquet, *tournData, *tourniquet) if (tourniquet->IsValid()) { - m_Tourniquets[tournData->Compartment()] = tourniquet; - tItr = m_Tourniquets.find(tournData->Compartment()); + m_Tourniquets[tournData->GetCompartment()] = tourniquet; + tItr = m_Tourniquets.find(tournData->GetCompartment()); validCmpt = true; } else { - tourniquet->Clear(); + tourniquet->Invalidate(); warn << "\t Invalid tourniquet location: Valid options are LeftArm, LeftLeg, RightArm, RightLeg" << std::endl; } } @@ -1039,25 +981,25 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti warn << "\n\t Tourniquet cannot be applied to a compartment without a hemorrhage" << std::endl; } if (matchingHem && validCmpt) { - auto turniquet = tItr->second; - turniquet->Load(*tournData); - if (!turniquet->IsActive()) { - RemoveTourniquet(turniquet->GetCompartment()); + auto Tourniquet = tItr->second; + CDM_PATIENT_ACTION_COPY(Tourniquet, *tournData, *Tourniquet) + if (!Tourniquet->IsActive()) { + RemoveTourniquet(Tourniquet->GetCompartment()); return true; } - return IsValid(*turniquet); + return IsValid(*Tourniquet); } else { Warning(warn); return false; } } - const CDM::UrinateData* urinate = dynamic_cast(&action); + auto urinate = dynamic_cast(&action); if (urinate != nullptr) { if (m_Urinate == nullptr) { m_Urinate = new SEUrinate(); } - m_Urinate->Load(*urinate); + CDM_PATIENT_ACTION_COPY(Urinate, *urinate, *m_Urinate) if (!m_Urinate->IsActive()) { RemoveUrinate(); return true; @@ -1065,12 +1007,12 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti return IsValid(*m_Urinate); } - const CDM::OverrideData* orData = dynamic_cast(&action); + auto orData = dynamic_cast(&action); if (orData != nullptr) { if (m_OverrideAction == nullptr) { m_OverrideAction = new SEOverride(); } - m_OverrideAction->Load(*orData); + CDM_PATIENT_ACTION_COPY(Override, *orData, *m_OverrideAction) if (!m_OverrideAction->IsActive()) { RemoveOverride(); return true; @@ -1153,6 +1095,32 @@ void SEPatientActionCollection::RemoveAirwayObstruction() SAFE_DELETE(m_AirwayObstruction); } //------------------------------------------------------------------------------- +bool SEPatientActionCollection::HasAmputation() const +{ + return m_Amputations.empty() ? false : true; +} +//------------------------------------------------------------------------------- +const std::map& SEPatientActionCollection::GetAmputations() const +{ + return m_Amputations; +} +const MapWrapper SEPatientActionCollection::GetAmputationWrapper() const +{ + return MapWrapper(const_cast(this)->m_Amputations); +} +//------------------------------------------------------------------------------- +void SEPatientActionCollection::RemoveAmputation(const char* cmpt) +{ + RemoveAmputation(std::string { cmpt }); +} +//------------------------------------------------------------------------------- +void SEPatientActionCollection::RemoveAmputation(const std::string& cmpt) +{ + SEAmputation* h = m_Amputations[cmpt]; + m_Amputations.erase(cmpt); + SAFE_DELETE(h); +} +//------------------------------------------------------------------------------- bool SEPatientActionCollection::HasApnea() const { return m_Apnea == nullptr ? false : true; @@ -1308,6 +1276,41 @@ void SEPatientActionCollection::RemoveRightChestOcclusiveDressing() SAFE_DELETE(m_RightChestOcclusiveDressing); } //------------------------------------------------------------------------------- +bool SEPatientActionCollection::HasChestTube() const +{ + return m_LeftChestTube != nullptr || m_RightChestTube != nullptr ? true : false; +} +//------------------------------------------------------------------------------- +bool SEPatientActionCollection::HasLeftChestTube() const +{ + return m_LeftChestTube != nullptr ? true : false; +} +//------------------------------------------------------------------------------- +SEChestTube* SEPatientActionCollection::GetLeftChestTube() const +{ + return m_LeftChestTube; +} +//------------------------------------------------------------------------------- +void SEPatientActionCollection::RemoveLeftChestTube() +{ + SAFE_DELETE(m_LeftChestTube); +} +//------------------------------------------------------------------------------- +bool SEPatientActionCollection::HasRightChestTube() const +{ + return m_RightChestTube != nullptr ? true : false; +} +//------------------------------------------------------------------------------- +SEChestTube* SEPatientActionCollection::GetRightChestTube() const +{ + return m_RightChestTube; +} +//------------------------------------------------------------------------------- +void SEPatientActionCollection::RemoveRightChestTube() +{ + SAFE_DELETE(m_RightChestTube); +} +//------------------------------------------------------------------------------- bool SEPatientActionCollection::HasConsciousRespiration() const { return m_ConsciousRespiration == nullptr ? false : m_ConsciousRespiration->IsValid(); @@ -1395,6 +1398,21 @@ void SEPatientActionCollection::RemoveExercise() SAFE_DELETE(m_Exercise); } //------------------------------------------------------------------------------- +bool SEPatientActionCollection::HasFracture() const +{ + return m_Fracture == nullptr ? false : true; +} +//------------------------------------------------------------------------------- +SEFracture* SEPatientActionCollection::GetFracture() const +{ + return m_Fracture; +} +//------------------------------------------------------------------------------- +void SEPatientActionCollection::RemoveFracture() +{ + SAFE_DELETE(m_Fracture); +} +//------------------------------------------------------------------------------- bool SEPatientActionCollection::HasHemorrhage() const { return m_Hemorrhages.empty() ? false : true; @@ -1660,7 +1678,7 @@ bool SEPatientActionCollection::HasTensionPneumothorax() const //------------------------------------------------------------------------------- bool SEPatientActionCollection::HasLeftOpenTensionPneumothorax() const { - return m_LeftOpenTensionPneumothorax == nullptr ? false : true; //m_LeftOpenTensionPneumothorax->IsValid();//TODO + return m_LeftOpenTensionPneumothorax == nullptr ? false : true; // m_LeftOpenTensionPneumothorax->IsValid();//TODO } //------------------------------------------------------------------------------- SETensionPneumothorax* SEPatientActionCollection::GetLeftOpenTensionPneumothorax() const @@ -1675,7 +1693,7 @@ void SEPatientActionCollection::RemoveLeftOpenTensionPneumothorax() //------------------------------------------------------------------------------- bool SEPatientActionCollection::HasLeftClosedTensionPneumothorax() const { - return m_LeftClosedTensionPneumothorax == nullptr ? false : true; //m_LeftClosedTensionPneumothorax->IsValid();//TODO + return m_LeftClosedTensionPneumothorax == nullptr ? false : true; // m_LeftClosedTensionPneumothorax->IsValid();//TODO } //------------------------------------------------------------------------------- SETensionPneumothorax* SEPatientActionCollection::GetLeftClosedTensionPneumothorax() const @@ -1690,7 +1708,7 @@ void SEPatientActionCollection::RemoveLeftClosedTensionPneumothorax() //------------------------------------------------------------------------------- bool SEPatientActionCollection::HasRightOpenTensionPneumothorax() const { - return m_RightOpenTensionPneumothorax == nullptr ? false : true; //m_RightOpenTensionPneumothorax->IsValid();//TODO + return m_RightOpenTensionPneumothorax == nullptr ? false : true; // m_RightOpenTensionPneumothorax->IsValid();//TODO } //------------------------------------------------------------------------------- SETensionPneumothorax* SEPatientActionCollection::GetRightOpenTensionPneumothorax() const @@ -1705,7 +1723,7 @@ void SEPatientActionCollection::RemoveRightOpenTensionPneumothorax() //------------------------------------------------------------------------------- bool SEPatientActionCollection::HasRightClosedTensionPneumothorax() const { - return m_RightClosedTensionPneumothorax == nullptr ? false : true; //m_RightClosedTensionPneumothorax->IsValid();//TODO + return m_RightClosedTensionPneumothorax == nullptr ? false : true; // m_RightClosedTensionPneumothorax->IsValid();//TODO } //------------------------------------------------------------------------------- SETensionPneumothorax* SEPatientActionCollection::GetRightClosedTensionPneumothorax() const @@ -1804,23 +1822,18 @@ void SEPatientActionCollection::RemoveSubstanceCompoundInfusion(const SESubstanc SAFE_DELETE(sci); } //------------------------------------------------------------------------------- -bool SEPatientActionCollection::AdministerSubstance(const CDM::SubstanceAdministrationData& subAdmin) +bool SEPatientActionCollection::AdministerSubstance(const SESubstanceAdministration& subAdmin) { - const CDM::SubstanceBolusData* bolus = dynamic_cast(&subAdmin); + auto bolus = dynamic_cast(&subAdmin); if (bolus != nullptr) { - SESubstance* sub = m_Substances.GetSubstance(bolus->Substance()); - if (sub == nullptr) { - m_ss << "Unknown substance : " << bolus->Substance(); - Error(m_ss); - return false; - } + SESubstance* sub = &bolus->GetSubstance(); SESubstanceBolus* myBolus = m_SubstanceBolus[sub]; if (myBolus == nullptr) { myBolus = new SESubstanceBolus(*sub); m_SubstanceBolus[sub] = myBolus; m_Substances.AddActiveSubstance(*sub); } - myBolus->Load(*bolus); + CDM_PATIENT_ACTION_COPY(SubstanceBolus, *bolus, *myBolus) if (!myBolus->IsActive()) { RemoveSubstanceBolus(*sub); return true; @@ -1828,21 +1841,16 @@ bool SEPatientActionCollection::AdministerSubstance(const CDM::SubstanceAdminist return IsValid(*myBolus); } - const CDM::SubstanceInfusionData* subInfusion = dynamic_cast(&subAdmin); + auto subInfusion = dynamic_cast(&subAdmin); if (subInfusion != nullptr) { - SESubstance* sub = m_Substances.GetSubstance(subInfusion->Substance()); - if (sub == nullptr) { - m_ss << "Unknown substance : " << subInfusion->Substance(); - Error(m_ss); - return false; - } + SESubstance* sub = &subInfusion->GetSubstance(); SESubstanceInfusion* mySubInfuse = m_SubstanceInfusions[sub]; if (mySubInfuse == nullptr) { mySubInfuse = new SESubstanceInfusion(*sub); m_SubstanceInfusions[sub] = mySubInfuse; m_Substances.AddActiveSubstance(*sub); } - mySubInfuse->Load(*subInfusion); + CDM_PATIENT_ACTION_COPY(SubstanceInfusion, *subInfusion, *mySubInfuse) if (!mySubInfuse->IsActive()) { RemoveSubstanceInfusion(*sub); return true; @@ -1850,21 +1858,16 @@ bool SEPatientActionCollection::AdministerSubstance(const CDM::SubstanceAdminist return IsValid(*mySubInfuse); } - const CDM::SubstanceNasalDoseData* NasalDose = dynamic_cast(&subAdmin); + auto NasalDose = dynamic_cast(&subAdmin); if (NasalDose != nullptr) { - SESubstance* sub = m_Substances.GetSubstance(NasalDose->Substance()); - if (sub == nullptr) { - m_ss << "Unknown substance : " << NasalDose->Substance(); - Error(m_ss); - return false; - } + SESubstance* sub = &NasalDose->GetSubstance(); SESubstanceNasalDose* myNasalDose = m_SubstanceNasalDoses[sub]; if (myNasalDose == nullptr) { myNasalDose = new SESubstanceNasalDose(*sub); m_SubstanceNasalDoses[sub] = myNasalDose; m_Substances.AddActiveSubstance(*sub); } - myNasalDose->Load(*NasalDose); + CDM_PATIENT_ACTION_COPY(SubstanceNasalDose, *NasalDose, *myNasalDose) if (!myNasalDose->IsActive()) { RemoveSubstanceNasalDose(*sub); return true; @@ -1872,21 +1875,16 @@ bool SEPatientActionCollection::AdministerSubstance(const CDM::SubstanceAdminist return IsValid(*myNasalDose); } - const CDM::SubstanceOralDoseData* oralDose = dynamic_cast(&subAdmin); + auto oralDose = dynamic_cast(&subAdmin); if (oralDose != nullptr) { - SESubstance* sub = m_Substances.GetSubstance(oralDose->Substance()); - if (sub == nullptr) { - m_ss << "Unknown substance : " << oralDose->Substance(); - Error(m_ss); - return false; - } + SESubstance* sub = &oralDose->GetSubstance(); SESubstanceOralDose* myOralDose = m_SubstanceOralDoses[sub]; if (myOralDose == nullptr) { myOralDose = new SESubstanceOralDose(*sub); m_SubstanceOralDoses[sub] = myOralDose; m_Substances.AddActiveSubstance(*sub); } - myOralDose->Load(*oralDose); + CDM_PATIENT_ACTION_COPY(SubstanceOralDose, *oralDose, *myOralDose) if (!myOralDose->IsActive()) { RemoveSubstanceOralDose(*sub); return true; @@ -1894,14 +1892,9 @@ bool SEPatientActionCollection::AdministerSubstance(const CDM::SubstanceAdminist return IsValid(*myOralDose); } - const CDM::SubstanceCompoundInfusionData* cSubInfusion = dynamic_cast(&subAdmin); + auto cSubInfusion = dynamic_cast(&subAdmin); if (cSubInfusion != nullptr) { - SESubstanceCompound* cmpd = m_Substances.GetCompound(cSubInfusion->SubstanceCompound()); - if (cmpd == nullptr) { - m_ss << "Unknown compound : " << cSubInfusion->SubstanceCompound(); - Error(m_ss); - return false; - } + SESubstanceCompound* cmpd = &cSubInfusion->GetSubstanceCompound(); SESubstanceCompoundInfusion* mySubCompInfuse = m_SubstanceCompoundInfusions[cmpd]; if (mySubCompInfuse == nullptr) { mySubCompInfuse = new SESubstanceCompoundInfusion(*cmpd); @@ -1913,7 +1906,7 @@ bool SEPatientActionCollection::AdministerSubstance(const CDM::SubstanceAdminist m_Substances.AddActiveSubstance(scc.GetSubstance()); } } - mySubCompInfuse->Load(*cSubInfusion); + CDM_PATIENT_ACTION_COPY(SubstanceCompoundInfusion, *cSubInfusion, *mySubCompInfuse) if (!mySubCompInfuse->IsActive()) { RemoveSubstanceCompoundInfusion(*cmpd); return true; @@ -1922,6 +1915,7 @@ bool SEPatientActionCollection::AdministerSubstance(const CDM::SubstanceAdminist } return false; } + //------------------------------------------------------------------------------- bool SEPatientActionCollection::HasTourniquet() const { diff --git a/projects/biogears/libBiogears/src/cdm/scenario/SEScenario.cpp b/projects/biogears/libBiogears/src/cdm/scenario/SEScenario.cpp index 1a8e8e7cf..637025e93 100644 --- a/projects/biogears/libBiogears/src/cdm/scenario/SEScenario.cpp +++ b/projects/biogears/libBiogears/src/cdm/scenario/SEScenario.cpp @@ -11,6 +11,10 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Actions.h" +#include "io/cdm/PatientActions.h" +#include "io/cdm/Scenario.h" + #include #include #include @@ -30,155 +34,29 @@ SEScenario::SEScenario(SESubstanceManager& subMgr) { m_InitialParameters = nullptr; m_AutoSerialization = nullptr; - SEScenario::Clear(); + SEScenario::Invalidate(); } //----------------------------------------------------------------------------- SEScenario::~SEScenario() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SEScenario::Clear() +void SEScenario::Invalidate() { m_Name = ""; m_Description = ""; m_EngineStateFile = ""; SAFE_DELETE(m_InitialParameters); SAFE_DELETE(m_AutoSerialization); - DELETE_VECTOR(m_Actions); - m_DataRequestMgr.Clear(); + DELETE_CONTAINER_OF_POINTERS(m_Actions); + m_DataRequestMgr.Invalidate(); } //----------------------------------------------------------------------------- -bool SEScenario::Load(const CDM::ScenarioData& in) +bool SEScenario::Load(char const* scenarioFile) { - Clear(); - - auto loadActions = [](SEScenario& scenario, CDM::ActionListData const* actionList) { - std::unique_ptr seed; - std::random_device random_device; - std::unique_ptr default_random_engine; - - if (actionList->RandomSeed().present() && actionList->RandomSeed().get().seed().size() != 0) { - auto seeds = actionList->RandomSeed().get().seed(); - seed = std::make_unique(seeds.begin(), seeds.end()); - default_random_engine = std::make_unique(*seed); - - std::stringstream ss; - ss << "Using seed={"; - for (auto& seed : actionList->RandomSeed().get().seed() ) { - ss << seed << ", " ; - } - ss.seekp(-2, ss.cur); - ss << "}" << std::endl; - scenario.m_Logger->Warning(ss.str()); - } else { - seed.reset(new std::seed_seq { random_device(), random_device(), random_device(), random_device(), random_device() }); - default_random_engine = std::make_unique(*seed); - } - - for (auto& action : actionList->Action()) { - auto new_action = SEAction::newFromBind(action, scenario.m_SubMgr, default_random_engine.get()); - if (new_action != nullptr) { - scenario.m_Actions.push_back(new_action); - } - } - }; - - if (in.Name().present()) - m_Name = in.Name().get(); - if (in.Description().present()) - m_Description = in.Description().get(); - if (in.EngineStateFile().present()) - SetEngineStateFile(in.EngineStateFile().get()); - else if (in.InitialParameters().present()) { - GetInitialParameters().Load(in.InitialParameters().get()); - } else { - Error("No State or Initial Parameters provided"); - return false; - } - if (in.AutoSerialization().present()) - GetAutoSerialization().Load(in.AutoSerialization().get()); - if (in.DataRequests().present()) - m_DataRequestMgr.Load(in.DataRequests().get(), m_SubMgr); - if (in.Actions().ActionFile().present()) { - biogears::filesystem::path actionFile = in.Actions().ActionFile().get(); - auto weak_io = GetLogger()->GetIoManager(); - auto iom = weak_io.lock(); - m_ActionFile = actionFile.ToString(); - if (actionFile.exists()) { - auto sData = Serializer::ReadFile(actionFile.ToString(), GetLogger()); - if (auto actionList = dynamic_cast(sData.get())) { - // We are ignoring recursive ActionListData where an ActionListData has an ActionFile reference - loadActions(*this, actionList); - } else { - m_Logger->Error(asprintf("Unable to load %s. File is not formated properly.", actionFile.ToString().c_str()), "SEScenario"); - } - } else { - m_Logger->Error(asprintf("Can not find %s", actionFile.ToString().c_str()), "SEScenario"); - } - } else { - loadActions(*this, &in.Actions()); - } - - return IsValid(); -} -//----------------------------------------------------------------------------- -bool SEScenario::Load(const CDM::ActionListData& in) -{ - m_Actions.clear(); - bool loadSuccess = true; - for (unsigned int i = 0; i < in.Action().size(); i++) { - SEAction* a = SEAction::newFromBind(in.Action()[i], m_SubMgr); - if (a != nullptr) { - m_Actions.push_back(a); - loadSuccess &= a->IsValid(); - } - } - return IsValid(); -} -//----------------------------------------------------------------------------- -CDM::ScenarioData* SEScenario::Unload() const -{ - CDM::ScenarioData* data = new CDM::ScenarioData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEScenario::Unload(CDM::ScenarioData& data) const -{ - data.Name(m_Name); - data.Description(m_Description); - if (HasEngineStateFile()) - data.EngineStateFile(m_EngineStateFile); - else if (HasInitialParameters()) { - data.InitialParameters(std::unique_ptr(m_InitialParameters->Unload())); - } - if (HasAutoSerialization()) { - data.AutoSerialization(std::unique_ptr(m_AutoSerialization->Unload())); - } - data.DataRequests(std::unique_ptr(m_DataRequestMgr.Unload())); - data.Actions(std::make_unique()); - if (m_Actions.empty() && m_ActionFile.size()) { - ::xml_schema::string item = m_ActionFile; - data.Actions().ActionFile().set(item); - - m_Logger->Warning("The ActionFile property has a value so no Actions will be unloaded."); - m_Logger->Debug("Use UnLoad (CDM::ActionFileListData) to populate an ActionFile Object."); - } else { - for (SEAction* a : m_Actions) - data.Actions().Action().push_back(std::unique_ptr(a->Unload())); - } -} -//----------------------------------------------------------------------------- -void SEScenario::Unload(CDM::ActionListData& data) const -{ - for (SEAction* a : m_Actions) - data.Action().push_back(std::unique_ptr(a->Unload())); -} -//----------------------------------------------------------------------------- -bool SEScenario::Load(const char* scenarioFile) -{ - return Load(std::string { scenarioFile }); + return Load(std::string(scenarioFile)); + } //----------------------------------------------------------------------------- bool SEScenario::Load(const std::string& scenarioFile) @@ -205,7 +83,8 @@ bool SEScenario::Load(const std::string& scenarioFile) Error(ss); return false; } - return Load(*pData); + io::Scenario::UnMarshall(*pData, *this); + return true; } //----------------------------------------------------------------------------- bool SEScenario::IsValid() const @@ -400,9 +279,9 @@ void SEScenario::RemoveAutoSerialization() //----------------------------------------------------------------------------- void SEScenario::AddAction(const SEAction& a) { - CDM::ActionData* bind = a.Unload(); - m_Actions.push_back(SEAction::newFromBind(*bind, m_SubMgr)); - delete bind; + + auto bind = io::Actions::factory(&a); + m_Actions.push_back(io::Actions::factory(bind.get(), m_SubMgr).release()); } //----------------------------------------------------------------------------- bool SEScenario::AddActionAfter(const SEAction& ref, const SEAction& after) @@ -410,9 +289,8 @@ bool SEScenario::AddActionAfter(const SEAction& ref, const SEAction& after) bool success = false; auto refItr = std::find(m_Actions.begin(), m_Actions.end(), &ref); if (refItr != m_Actions.end()) { - CDM::ActionData* bind = after.Unload(); - m_Actions.insert(refItr, SEAction::newFromBind(*bind, m_SubMgr)); - delete bind; + auto bind = io::Actions::factory(&after); + m_Actions.insert(refItr, io::Actions::factory(bind.get(), m_SubMgr).release()); success = true; } return success; @@ -428,6 +306,7 @@ const std::vector& SEScenario::GetActions() const return m_Actions; } //----------------------------------------------------------------------------- + bool SEScenario::operator==(SEScenario const& rhs) const { if (this == &rhs) @@ -448,7 +327,7 @@ bool SEScenario::operator==(SEScenario const& rhs) const // if dynamic cast fails else proceed for a faster runtimes. This pattern // is all over Biogears so we need to investigate teh cost. That said we only // do equality comparisons in unittest really - if (m_Actions.size() == rhs.m_Actions.size()) { + if (equivilant && m_Actions.size() == rhs.m_Actions.size()) { for (auto idx = 0; idx < m_Actions.size(); ++idx) { if (0 == strcmp(m_Actions[idx]->classname(), rhs.m_Actions[idx]->classname())) { equivilant &= 0 == strcmp(m_Actions[idx]->ToString(), rhs.m_Actions[idx]->ToString()); @@ -459,6 +338,7 @@ bool SEScenario::operator==(SEScenario const& rhs) const } return equivilant; } + bool SEScenario::operator!=(SEScenario const& rhs) const { return !(*this == rhs); diff --git a/projects/biogears/libBiogears/src/cdm/scenario/SEScenarioAutoSerialization.cpp b/projects/biogears/libBiogears/src/cdm/scenario/SEScenarioAutoSerialization.cpp index 8fb04a5f7..f5e25e53f 100644 --- a/projects/biogears/libBiogears/src/cdm/scenario/SEScenarioAutoSerialization.cpp +++ b/projects/biogears/libBiogears/src/cdm/scenario/SEScenarioAutoSerialization.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Scenario.h" + #include #include @@ -20,24 +22,24 @@ SEScenarioAutoSerialization::SEScenarioAutoSerialization(Logger* logger) : Loggable(logger) { m_Period = nullptr; - m_PeriodTimeStamps = (CDM::enumOnOff::value)-1; - m_AfterActions = (CDM::enumOnOff::value)-1; - m_ReloadState = (CDM::enumOnOff::value)-1; + m_PeriodTimeStamps = SEOnOff::Invalid; + m_AfterActions = SEOnOff::Invalid; + m_ReloadState = SEOnOff::Invalid; m_Directory = ""; m_FileName = ""; } //----------------------------------------------------------------------------- SEScenarioAutoSerialization::~SEScenarioAutoSerialization() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SEScenarioAutoSerialization::Clear() +void SEScenarioAutoSerialization::Invalidate() { SAFE_DELETE(m_Period); - m_PeriodTimeStamps = (CDM::enumOnOff::value)-1; - m_AfterActions = (CDM::enumOnOff::value)-1; - m_AfterActions = (CDM::enumOnOff::value)-1; + m_PeriodTimeStamps = SEOnOff::Invalid; + m_AfterActions = SEOnOff::Invalid; + m_AfterActions = SEOnOff::Invalid; m_Directory = ""; m_FileName = ""; } @@ -61,41 +63,6 @@ bool SEScenarioAutoSerialization::IsValid() const return true; } //----------------------------------------------------------------------------- -bool SEScenarioAutoSerialization::Load(const CDM::ScenarioAutoSerializationData& in) -{ - Clear(); - GetPeriod().Load(in.Period()); - SetPeriodTimeStamps(in.PeriodTimeStamps()); - SetAfterActions(in.AfterActions()); - SetReloadState(in.ReloadState()); - SetDirectory(in.Directory()); - SetFileName(in.FileName()); - return true; -} -//----------------------------------------------------------------------------- -CDM::ScenarioAutoSerializationData* SEScenarioAutoSerialization::Unload() const -{ - CDM::ScenarioAutoSerializationData* data(new CDM::ScenarioAutoSerializationData()); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEScenarioAutoSerialization::Unload(CDM::ScenarioAutoSerializationData& data) const -{ - if (HasPeriod()) - data.Period(std::unique_ptr(m_Period->Unload())); - if (HasPeriodTimeStamps()) - data.PeriodTimeStamps(m_PeriodTimeStamps); - if (HasAfterActions()) - data.AfterActions(m_AfterActions); - if (HasReloadState()) - data.ReloadState(m_ReloadState); - if (HasDirectory()) - data.Directory(m_Directory); - if (HasFileName()) - data.FileName(m_FileName); -} -//----------------------------------------------------------------------------- bool SEScenarioAutoSerialization::HasPeriod() const { return m_Period == nullptr ? false : m_Period->IsValid(); @@ -115,64 +82,64 @@ double SEScenarioAutoSerialization::GetPeriod(const TimeUnit& unit) const return m_Period->GetValue(unit); } //----------------------------------------------------------------------------- -CDM::enumOnOff::value SEScenarioAutoSerialization::GetPeriodTimeStamps() const +SEOnOff SEScenarioAutoSerialization::GetPeriodTimeStamps() const { return m_PeriodTimeStamps; } //----------------------------------------------------------------------------- -void SEScenarioAutoSerialization::SetPeriodTimeStamps(CDM::enumOnOff::value v) +void SEScenarioAutoSerialization::SetPeriodTimeStamps(SEOnOff v) { m_PeriodTimeStamps = v; } //----------------------------------------------------------------------------- bool SEScenarioAutoSerialization::HasPeriodTimeStamps() const { - return m_PeriodTimeStamps == ((CDM::enumOnOff::value)-1) ? false : true; + return m_PeriodTimeStamps == (SEOnOff::Invalid) ? false : true; } //----------------------------------------------------------------------------- void SEScenarioAutoSerialization::InvalidatePeriodTimeStamps() { - m_PeriodTimeStamps = (CDM::enumOnOff::value)-1; + m_PeriodTimeStamps = SEOnOff::Invalid; } //----------------------------------------------------------------------------- -CDM::enumOnOff::value SEScenarioAutoSerialization::GetAfterActions() const +SEOnOff SEScenarioAutoSerialization::GetAfterActions() const { return m_AfterActions; } //----------------------------------------------------------------------------- -void SEScenarioAutoSerialization::SetAfterActions(CDM::enumOnOff::value v) +void SEScenarioAutoSerialization::SetAfterActions(SEOnOff v) { m_AfterActions = v; } //----------------------------------------------------------------------------- bool SEScenarioAutoSerialization::HasAfterActions() const { - return m_AfterActions == ((CDM::enumOnOff::value)-1) ? false : true; + return m_AfterActions == (SEOnOff::Invalid) ? false : true; } //----------------------------------------------------------------------------- void SEScenarioAutoSerialization::InvalidateAfterActions() { - m_AfterActions = (CDM::enumOnOff::value)-1; + m_AfterActions = SEOnOff::Invalid; } //----------------------------------------------------------------------------- -CDM::enumOnOff::value SEScenarioAutoSerialization::GetReloadState() const +SEOnOff SEScenarioAutoSerialization::GetReloadState() const { return m_ReloadState; } //----------------------------------------------------------------------------- -void SEScenarioAutoSerialization::SetReloadState(CDM::enumOnOff::value v) +void SEScenarioAutoSerialization::SetReloadState(SEOnOff v) { m_ReloadState = v; } //----------------------------------------------------------------------------- bool SEScenarioAutoSerialization::HasReloadState() const { - return m_ReloadState == ((CDM::enumOnOff::value)-1) ? false : true; + return m_ReloadState == (SEOnOff::Invalid) ? false : true; } //----------------------------------------------------------------------------- void SEScenarioAutoSerialization::InvalidateReloadState() { - m_ReloadState = (CDM::enumOnOff::value)-1; + m_ReloadState = SEOnOff::Invalid; } //----------------------------------------------------------------------------- const char* SEScenarioAutoSerialization::GetDirectory() const diff --git a/projects/biogears/libBiogears/src/cdm/scenario/SEScenarioExec.cpp b/projects/biogears/libBiogears/src/cdm/scenario/SEScenarioExec.cpp index edd1b7fcf..7f929a9ee 100644 --- a/projects/biogears/libBiogears/src/cdm/scenario/SEScenarioExec.cpp +++ b/projects/biogears/libBiogears/src/cdm/scenario/SEScenarioExec.cpp @@ -11,6 +11,10 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/biogears/BioGears.h" +#include "io/cdm/DataRequests.h" +#include "io/cdm/Scenario.h" + #include #include @@ -26,12 +30,15 @@ specific language governing permissions and limitations under the License. #include #include #include +#include #include #include #include #include #include + +#pragma warning(disable : 4661) namespace biogears { SEScenarioExec::SEScenarioExec(PhysiologyEngine& engine) : Loggable(engine.GetLogger()) @@ -56,10 +63,13 @@ bool SEScenarioExec::Execute(SEScenario const& scenario, const char* resultsFile //----------------------------------------------------------------------------- bool SEScenarioExec::Execute(SEScenario const& scenario, const std::string& resultsFile, SEScenarioCustomExec* cExec) { - auto scenarioData = std::unique_ptr(scenario.Unload()); + auto scenarioData = std::make_unique(); + io::Scenario::Marshall(scenario, *scenarioData); auto memory_safe_scenario = std::make_unique(m_Engine.GetSubstanceManager()); - if (!memory_safe_scenario->Load(*scenarioData)) { + try { + io::Scenario::UnMarshall(*scenarioData, *memory_safe_scenario); + } catch (CommonDataModelException /* ex*/) { return false; } try { @@ -76,26 +86,28 @@ bool SEScenarioExec::Execute(SEScenario const& scenario, const std::string& resu // When we know the physiolgoy engine is good to go and not try to cashe state. memory_safe_scenario = std::make_unique(m_Engine.GetSubstanceManager()); - if (!memory_safe_scenario->Load(*scenarioData)) { + try { + io::Scenario::UnMarshall(*scenarioData, *memory_safe_scenario); + } catch (CommonDataModelException /* ex*/) { return false; } - // WE ARE OVERWRITING ANY DATA REQUESTS IN THE STATE WITH WHATS IN THE SCENARIO!!! // Make a copy of the data requests, not this clears out data requests from the engine - CDM::DataRequestManagerData* drData = memory_safe_scenario->GetDataRequestManager().Unload(); - m_Engine.GetEngineTrack()->GetDataRequestManager().Load(*drData, m_Engine.GetSubstanceManager()); - delete drData; + auto drData = std::make_unique(); + io::DataRequests::Marshall(memory_safe_scenario->GetDataRequestManager(), *drData); + io::DataRequests::UnMarshall(*drData, m_Engine.GetSubstanceManager(), m_Engine.GetEngineTrack()->GetDataRequestManager()); + // if (!m_Engine.GetEngineTrack()->GetDataRequestManager().HasResultsFilename()) m_Engine.GetEngineTrack()->GetDataRequestManager().SetResultsFilename(resultsFile); } else if (scenarioData->InitialParameters().present()) { - m_Engine.GetEngineTrack()->GetDataRequestManager().Load(scenarioData->DataRequests().get(), m_Engine.GetSubstanceManager()); + io::DataRequests::UnMarshall(scenarioData->DataRequests().get(), m_Engine.GetSubstanceManager(), m_Engine.GetEngineTrack()->GetDataRequestManager()); // if (!m_Engine.GetEngineTrack()->GetDataRequestManager().HasResultsFilename()) m_Engine.GetEngineTrack()->GetDataRequestManager().SetResultsFilename(resultsFile); auto& params = memory_safe_scenario->GetInitialParameters(); - m_Engine.SetTrackStabilizationFlag(params.TrackingStabilization() == CDM::enumOnOff::On); + m_Engine.SetTrackStabilizationFlag(params.TrackingStabilization()); // Do we have any conditions std::vector conditions; @@ -186,10 +198,11 @@ bool SEScenarioExec::Execute(const std::string& scenarioFile, const std::string& } SEScenario scenario(m_Engine.GetSubstanceManager()); - if (!scenario.Load(*scenarioData)) { + try { + io::Scenario::UnMarshall(*scenarioData, scenario); + } catch (CommonDataModelException /* ex*/) { return false; } - bool success = Execute(scenario, rFile, cExec); return success; } catch (CommonDataModelException& ex) { @@ -274,13 +287,14 @@ bool SEScenarioExec::ProcessActions(SEScenario& scenario) serializationTime_s = 0; serializationFileName.str(""); serializationFileName << serializationFileNameBase; - if (scenario.GetAutoSerialization().GetPeriodTimeStamps() == CDM::enumOnOff::On) + if (scenario.GetAutoSerialization().GetPeriodTimeStamps() == SEOnOff::On) serializationFileName << "@" << m_Engine.GetSimulationTime(TimeUnit::s); serializationFileName << ".xml"; m_Engine.SaveStateToFile(serializationFileName.str()); - if (scenario.GetAutoSerialization().GetReloadState() == CDM::enumOnOff::On) { - m_Engine.LoadState(*m_Engine.GetStateData()); - m_Engine.SaveStateToFile(serializationFileName.str() + ".Reloaded.xml"); + if (scenario.GetAutoSerialization().GetReloadState() == SEOnOff::On) { + { + CDM_BIOGEARS_COPY(BioGearsState, dynamic_cast(m_Engine), dynamic_cast(m_Engine)) + } m_Engine.SaveStateToFile(serializationFileName.str() + ".Reloaded.xml"); } } } @@ -289,8 +303,8 @@ bool SEScenarioExec::ProcessActions(SEScenario& scenario) serializationFileName.str(""); serializationFileName << serializationFileNameBase << "-" << actionName << "-@" << m_Engine.GetSimulationTime(TimeUnit::s) << ".xml"; m_Engine.SaveStateToFile(serializationFileName.str()); - if (scenario.GetAutoSerialization().GetReloadState() == CDM::enumOnOff::On) { - m_Engine.LoadState(*m_Engine.GetStateData()); + if (scenario.GetAutoSerialization().GetReloadState() == SEOnOff::On) { + CDM_BIOGEARS_COPY(BioGearsState, dynamic_cast(m_Engine), dynamic_cast(m_Engine)) m_Engine.SaveStateToFile(serializationFileName.str() + ".Reloaded.xml"); } } @@ -311,7 +325,7 @@ bool SEScenarioExec::ProcessActions(SEScenario& scenario) profiler.Reset("Status"); Info(m_ss); } - if (m_Engine.GetPatient().IsEventActive(CDM::enumPatientEvent::IrreversibleState)) + if (m_Engine.GetPatient().IsEventActive(SEPatientEventType::IrreversibleState)) return false; // Patient is for all intents and purposes dead, or out at least out of its methodology bounds, quit running } continue; @@ -322,7 +336,7 @@ bool SEScenarioExec::ProcessActions(SEScenario& scenario) break; } - if (scenario.GetAutoSerialization().IsValid() && scenario.GetAutoSerialization().GetAfterActions() == CDM::enumOnOff::On) { // If we are testing force serialization after any action with this + if (scenario.GetAutoSerialization().IsValid() && scenario.GetAutoSerialization().GetAfterActions() == SEOnOff::On) { // If we are testing force serialization after any action with this // Pull out the action type/name for file naming m_ss << *a; size_t start = m_ss.str().find(": ") + 2; @@ -333,18 +347,18 @@ bool SEScenarioExec::ProcessActions(SEScenario& scenario) serializationFileName.str(""); serializationFileName << serializationFileNameBase << "-" << actionName << "-@" << m_Engine.GetSimulationTime(TimeUnit::s) << ".xml"; m_Engine.SaveStateToFile(serializationFileName.str()); - if (scenario.GetAutoSerialization().GetReloadState() == CDM::enumOnOff::On) { - m_Engine.LoadState(*m_Engine.GetStateData()); + if (scenario.GetAutoSerialization().GetReloadState() == SEOnOff::On) { + CDM_BIOGEARS_COPY(BioGearsState, dynamic_cast(m_Engine), dynamic_cast(m_Engine)) m_Engine.SaveStateToFile(serializationFileName.str() + ".Reloaded.xml"); } serializeAction = true; // Serialize after the next time step } - if (m_Engine.GetPatient().IsEventActive(CDM::enumPatientEvent::IrreversibleState)) + if (m_Engine.GetPatient().IsEventActive(SEPatientEventType::IrreversibleState)) return false; // Patient is for all intents and purposes dead, or out at least out of its methodology bounds, quit running } m_ss << "It took " << profiler.GetElapsedTime_s("Total") << "s to run this simulation"; - profiler.Clear(); + profiler.Invalidate(); Info(m_ss); return !err; diff --git a/projects/biogears/libBiogears/src/cdm/scenario/SEScenarioInitialParameters.cpp b/projects/biogears/libBiogears/src/cdm/scenario/SEScenarioInitialParameters.cpp index 6635da0e2..cf4f7dc9c 100644 --- a/projects/biogears/libBiogears/src/cdm/scenario/SEScenarioInitialParameters.cpp +++ b/projects/biogears/libBiogears/src/cdm/scenario/SEScenarioInitialParameters.cpp @@ -11,6 +11,10 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Scenario.h" +#include "io/cdm/EngineConfiguration.h" +#include "io/cdm/Patient.h" + #include #include #include @@ -27,16 +31,16 @@ SEScenarioInitialParameters::SEScenarioInitialParameters(SESubstanceManager& sub { m_Configuration = nullptr; m_Patient = nullptr; - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- SEScenarioInitialParameters::~SEScenarioInitialParameters() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SEScenarioInitialParameters::Clear() +void SEScenarioInitialParameters::Invalidate() { m_PatientFile = ""; m_DoTrackStabilization = false; @@ -45,54 +49,6 @@ void SEScenarioInitialParameters::Clear() DELETE_VECTOR(m_Conditions); } //----------------------------------------------------------------------------- -bool SEScenarioInitialParameters::Load(const CDM::ScenarioInitialParametersData& in) -{ - Clear(); - - if (in.Configuration().present()) - GetConfiguration().Load(in.Configuration().get()); - - if (in.PatientFile().present()) - m_PatientFile = in.PatientFile().get(); - else if (in.Patient().present()) - GetPatient().Load(in.Patient().get()); - else { - Error("No patient provided"); - return false; - } - - for (unsigned int i = 0; i < in.Condition().size(); i++) { - SECondition* c = SECondition::newFromBind(in.Condition()[i], m_SubMgr); - if (c != nullptr) - m_Conditions.push_back(c); - } - - if (in.TrackStabilization().present()) { - m_DoTrackStabilization = in.TrackStabilization().get(); - } - return IsValid(); -} -//----------------------------------------------------------------------------- -CDM::ScenarioInitialParametersData* SEScenarioInitialParameters::Unload() const -{ - CDM::ScenarioInitialParametersData* data = new CDM::ScenarioInitialParametersData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEScenarioInitialParameters::Unload(CDM::ScenarioInitialParametersData& data) const -{ - if (HasPatientFile()) - data.PatientFile(m_PatientFile); - else if (HasPatient()) - data.Patient(std::unique_ptr(m_Patient->Unload())); - for (SECondition* c : m_Conditions) - data.Condition().push_back(std::unique_ptr(c->Unload())); - if (HasConfiguration()) - data.Configuration(std::unique_ptr(m_Configuration->Unload())); - data.TrackStabilization((m_DoTrackStabilization) ? CDM::enumOnOff::On : CDM::enumOnOff::Off); -} -//----------------------------------------------------------------------------- bool SEScenarioInitialParameters::IsValid() const { if (HasPatientFile() || HasPatient()) @@ -119,7 +75,7 @@ const PhysiologyEngineConfiguration* SEScenarioInitialParameters::GetConfigurati //----------------------------------------------------------------------------- void SEScenarioInitialParameters::SetConfiguration(const PhysiologyEngineConfiguration& config) { - CDM_COPY((&config), (&GetConfiguration())); + CDM_BIOGEARS_CONFIGURATION_COPY(PhysiologyEngineConfiguration, config, GetConfiguration()); } //----------------------------------------------------------------------------- void SEScenarioInitialParameters::InvalidateConfiguration() @@ -169,7 +125,7 @@ const SEPatient* SEScenarioInitialParameters::GetPatient() const //----------------------------------------------------------------------------- void SEScenarioInitialParameters::SetPatient(const SEPatient& patient) { - CDM_COPY((&patient), (&GetPatient())); + CDM_PATIENT_COPY(Patient, patient, GetPatient()); } //----------------------------------------------------------------------------- bool SEScenarioInitialParameters::HasPatient() const @@ -184,9 +140,11 @@ void SEScenarioInitialParameters::InvalidatePatient() //----------------------------------------------------------------------------- void SEScenarioInitialParameters::AddCondition(const SECondition& c) { - CDM::ConditionData* bind = c.Unload(); - m_Conditions.push_back(SECondition::newFromBind(*bind, m_SubMgr)); - delete bind; + + auto conditionData = io::Conditions::factory(&c); + auto conditionCopy = io::Conditions::factory(conditionData.get(), m_SubMgr).release(); + m_Conditions.push_back(conditionCopy); + } //----------------------------------------------------------------------------- const std::vector& SEScenarioInitialParameters::GetConditions() const @@ -206,6 +164,7 @@ void SEScenarioInitialParameters::SetTrackStabilization(bool flag) m_DoTrackStabilization = flag; } //----------------------------------------------------------------------------- + bool SEScenarioInitialParameters::operator==(SEScenarioInitialParameters const& rhs) const { if (this == &rhs) @@ -224,8 +183,9 @@ bool SEScenarioInitialParameters::operator==(SEScenarioInitialParameters const& equivilant = false; } - ;return equivilant; + return equivilant; } + bool SEScenarioInitialParameters::operator!=(SEScenarioInitialParameters const& rhs) const { return !(*this == rhs); diff --git a/projects/biogears/libBiogears/src/cdm/scenario/SESerializeState.cpp b/projects/biogears/libBiogears/src/cdm/scenario/SESerializeState.cpp index bb7d02605..5a9fc6d8e 100644 --- a/projects/biogears/libBiogears/src/cdm/scenario/SESerializeState.cpp +++ b/projects/biogears/libBiogears/src/cdm/scenario/SESerializeState.cpp @@ -13,24 +13,27 @@ specific language governing permissions and limitations under the License. #include #include +#include "io/cdm/Actions.h" +#include "io/cdm/Scenario.h" + namespace biogears { SESerializeState::SESerializeState() : SEAction() { m_Filename = ""; - m_Type = (CDM::enumSerializationType::value)-1; + m_Type = SESerializationType::Invalid; } //----------------------------------------------------------------------------- SESerializeState::~SESerializeState() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SESerializeState::Clear() +void SESerializeState::Invalidate() { - SEAction::Clear(); + SEAction::Invalidate(); m_Filename = ""; - m_Type = (CDM::enumSerializationType::value)-1; + m_Type = SESerializationType::Invalid; } //----------------------------------------------------------------------------- bool SESerializeState::IsValid() const @@ -38,30 +41,6 @@ bool SESerializeState::IsValid() const return HasFilename() && HasType(); } //----------------------------------------------------------------------------- -bool SESerializeState::Load(const CDM::SerializeStateData& in, std::default_random_engine *rd) -{ - - SEAction::Load(in); - SetType(in.Type()); - SetFilename(in.Filename()); - return true; -} -//----------------------------------------------------------------------------- -CDM::SerializeStateData* SESerializeState::Unload() const -{ - CDM::SerializeStateData* data = new CDM::SerializeStateData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SESerializeState::Unload(CDM::SerializeStateData& data) const -{ - SEAction::Unload(data); - data.Filename(m_Filename); - if (HasType()) - data.Type(m_Type); -} -//----------------------------------------------------------------------------- void SESerializeState::ToString(std::ostream& str) const { if (HasComment()) @@ -70,24 +49,24 @@ void SESerializeState::ToString(std::ostream& str) const str << "Filename : " << m_Filename; } //----------------------------------------------------------------------------- -CDM::enumSerializationType::value SESerializeState::GetType() const +SESerializationType SESerializeState::GetType() const { return m_Type; } //----------------------------------------------------------------------------- -void SESerializeState::SetType(CDM::enumSerializationType::value Type) +void SESerializeState::SetType(SESerializationType Type) { m_Type = Type; } //----------------------------------------------------------------------------- bool SESerializeState::HasType() const { - return m_Type == ((CDM::enumSerializationType::value)-1) ? false : true; + return m_Type == SESerializationType::Invalid ? false : true; } //----------------------------------------------------------------------------- void SESerializeState::InvalidateType() { - m_Type = (CDM::enumSerializationType::value)-1; + m_Type = SESerializationType::Invalid; } //----------------------------------------------------------------------------- bool SESerializeState::HasFilename() const @@ -99,7 +78,7 @@ std::string SESerializeState::GetFilename() const { return m_Filename; } - //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- const char* SESerializeState::GetFilename_cStr() const { return m_Filename.c_str(); @@ -126,11 +105,11 @@ bool SESerializeState::operator==(SESerializeState const& rhs) const return true; return m_Filename == rhs.m_Filename - && m_Type == m_Type; + && m_Type == rhs.m_Type; } bool SESerializeState::operator!=(SESerializeState const& rhs) const { return !(*this == rhs); } //----------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/projects/biogears/libBiogears/src/cdm/scenario/requests/SECompartmentDataRequest.cpp b/projects/biogears/libBiogears/src/cdm/scenario/requests/SECompartmentDataRequest.cpp index a13ed1c09..db43996aa 100644 --- a/projects/biogears/libBiogears/src/cdm/scenario/requests/SECompartmentDataRequest.cpp +++ b/projects/biogears/libBiogears/src/cdm/scenario/requests/SECompartmentDataRequest.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/DataRequests.h" + #include namespace biogears { @@ -22,12 +24,12 @@ SECompartmentDataRequest::SECompartmentDataRequest(const SEDecimalFormat* dfault //------------------------------------------------------------------------------- SECompartmentDataRequest::~SECompartmentDataRequest() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SECompartmentDataRequest::Clear() +void SECompartmentDataRequest::Invalidate() { - SEDataRequest::Clear(); + SEDataRequest::Invalidate(); m_Compartment = ""; } //------------------------------------------------------------------------------- @@ -39,18 +41,7 @@ size_t SECompartmentDataRequest::HashCode() const return m_Hash; } //------------------------------------------------------------------------------- -bool SECompartmentDataRequest::Load(const CDM::CompartmentDataRequestData& in) -{ - SEDataRequest::Load(in); - SetCompartment(in.Compartment()); - return true; -} -//------------------------------------------------------------------------------- -void SECompartmentDataRequest::Unload(CDM::CompartmentDataRequestData& data) const -{ - SEDataRequest::Unload(data); - data.Compartment(m_Compartment); -} + //------------------------------------------------------------------------------- const char* SECompartmentDataRequest::GetCompartment() const { diff --git a/projects/biogears/libBiogears/src/cdm/scenario/requests/SECompartmentSubstanceDataRequest.cpp b/projects/biogears/libBiogears/src/cdm/scenario/requests/SECompartmentSubstanceDataRequest.cpp index bebdacfc1..1bcfb7669 100644 --- a/projects/biogears/libBiogears/src/cdm/scenario/requests/SECompartmentSubstanceDataRequest.cpp +++ b/projects/biogears/libBiogears/src/cdm/scenario/requests/SECompartmentSubstanceDataRequest.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/DataRequests.h" + +#include #include #include #include @@ -24,12 +27,12 @@ SECompartmentSubstanceDataRequest::SECompartmentSubstanceDataRequest(const SEDec //----------------------------------------------------------------------------- SECompartmentSubstanceDataRequest::~SECompartmentSubstanceDataRequest() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SECompartmentSubstanceDataRequest::Clear() +void SECompartmentSubstanceDataRequest::Invalidate() { - SECompartmentDataRequest::Clear(); + SECompartmentDataRequest::Invalidate(); m_Substance = nullptr; } //----------------------------------------------------------------------------- @@ -45,20 +48,7 @@ size_t SECompartmentSubstanceDataRequest::HashCode() const return m_Hash; } //----------------------------------------------------------------------------- -bool SECompartmentSubstanceDataRequest::Load(const CDM::CompartmentSubstanceDataRequestData& in, const SESubstanceManager& substances) -{ - SECompartmentDataRequest::Load(in); - if (in.Substance().present()) - SetSubstance(substances.GetSubstance(in.Substance().get())); - return true; -} -//----------------------------------------------------------------------------- -void SECompartmentSubstanceDataRequest::Unload(CDM::CompartmentSubstanceDataRequestData& data) const -{ - SECompartmentDataRequest::Unload(data); - if (HasSubstance()) - data.Substance(m_Substance->GetName()); -} + //----------------------------------------------------------------------------- SESubstance* SECompartmentSubstanceDataRequest::GetSubstance() const { @@ -111,6 +101,7 @@ void SECompartmentSubstanceDataRequest::Set(const std::string& cmpt, SESubstance m_Hash = 0; } //------------------------------------------------------------------------------- +#pragma warning(disable : 4661) bool SECompartmentSubstanceDataRequest ::operator==(SECompartmentSubstanceDataRequest const& rhs) const { if (this == &rhs) diff --git a/projects/biogears/libBiogears/src/cdm/scenario/requests/SEDataRequest.cpp b/projects/biogears/libBiogears/src/cdm/scenario/requests/SEDataRequest.cpp index 04619fe49..9b27cb6fe 100644 --- a/projects/biogears/libBiogears/src/cdm/scenario/requests/SEDataRequest.cpp +++ b/projects/biogears/libBiogears/src/cdm/scenario/requests/SEDataRequest.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/DataRequests.h" + #include #include @@ -26,42 +28,16 @@ SEDataRequest::SEDataRequest(const SEDecimalFormat* dfault) //------------------------------------------------------------------------------- SEDataRequest::~SEDataRequest() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEDataRequest::Clear() +void SEDataRequest::Invalidate() { m_Name = ""; m_RequestedUnit = ""; m_Unit = nullptr; } -//------------------------------------------------------------------------------- -bool SEDataRequest::Load(const CDM::DataRequestData& in) -{ - SEDecimalFormat::Load(in); - m_Name = in.Name(); - if (in.Unit().present()) - m_RequestedUnit = in.Unit().get(); - return true; -} -//------------------------------------------------------------------------------- -CDM::DataRequestData* SEDataRequest::Unload() const -{ - CDM::DataRequestData* data = new CDM::DataRequestData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEDataRequest::Unload(CDM::DataRequestData& data) const -{ - SEDecimalFormat::Unload(data); - data.Name(m_Name); - if (HasUnit()) - data.Unit(m_Unit->GetString()); - else if (HasRequestedUnit()) - data.Unit(m_RequestedUnit); -} //------------------------------------------------------------------------------- std::string SEDataRequest::GetName() const { diff --git a/projects/biogears/libBiogears/src/cdm/scenario/requests/SEDataRequestManager.cpp b/projects/biogears/libBiogears/src/cdm/scenario/requests/SEDataRequestManager.cpp index 6b70f5773..af7390979 100644 --- a/projects/biogears/libBiogears/src/cdm/scenario/requests/SEDataRequestManager.cpp +++ b/projects/biogears/libBiogears/src/cdm/scenario/requests/SEDataRequestManager.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/DataRequests.h" + #include #include #include @@ -30,7 +32,7 @@ SEDataRequestManager::SEDataRequestManager(Logger* logger) //----------------------------------------------------------------------------- SEDataRequestManager::~SEDataRequestManager() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- const char* SEDataRequestManager::GetResultsFilename_cStr() const @@ -75,7 +77,7 @@ void SEDataRequestManager::SetWorkingDir(const std::string& name) //----------------------------------------------------------------------------- std::string SEDataRequestManager::GetResovedFilePath() const { return m_WorkingDir + m_ResultsFile; } //----------------------------------------------------------------------------- -void SEDataRequestManager::Clear() +void SEDataRequestManager::Invalidate() { m_SamplesPerSecond = 1.0; // Sample every time step DELETE_VECTOR(m_Requests); @@ -83,82 +85,6 @@ void SEDataRequestManager::Clear() SAFE_DELETE(m_OverrideDecimalFormatting); } //----------------------------------------------------------------------------- -bool SEDataRequestManager::Load(const CDM::DataRequestManagerData& in, SESubstanceManager& subMgr) -{ - Clear(); - if (in.Filename().present()) - m_ResultsFile = in.Filename().get(); - if (in.SamplesPerSecond().present()) - m_SamplesPerSecond = in.SamplesPerSecond().get(); - if (in.DefaultDecimalFormatting().present()) - GetDefaultDecimalFormatting().Load(in.DefaultDecimalFormatting().get()); - if (in.OverrideDecimalFormatting().present()) - GetOverrideDecimalFormatting().Load(in.OverrideDecimalFormatting().get()); - - if (in.DataRequestFile().present()) { - biogears::filesystem::path dataRequestFile = in.DataRequestFile().get(); - auto weak_io = subMgr.GetLogger()->GetIoManager(); - auto iom = weak_io.lock(); - - if (dataRequestFile.exists()) { - auto sData = Serializer::ReadFile(dataRequestFile.ToString(), subMgr.GetLogger()); - if (auto requestList = dynamic_cast(sData.get())) { - // We are ignoring recursive ActionListData where an ActionListData has an ActionFile reference - if (requestList->DataRequestFile().present()) { - throw CommonDataModelException("DatarequestFiles may not contain and instead must be a list of "); - } - for (auto& request : requestList->DataRequest()) { - SEDataRequest* dr = newFromBind(request, subMgr, m_DefaultDecimalFormatting); - if (dr != nullptr && !DuplicateRequest(dr)) { - if (HasOverrideDecimalFormatting()) - ((SEDecimalFormat*)dr)->Set(*m_OverrideDecimalFormatting); - m_Requests.push_back(dr); - } - } - } - } else { - throw CommonDataModelException("Can not find " + dataRequestFile.ToString()); - } - - } else { - for (unsigned int i = 0; i < in.DataRequest().size(); i++) { - SEDataRequest* dr = newFromBind(in.DataRequest()[i], subMgr, m_DefaultDecimalFormatting); - if (dr != nullptr && !DuplicateRequest(dr)) { - if (HasOverrideDecimalFormatting()) - ((SEDecimalFormat*)dr)->Set(*m_OverrideDecimalFormatting); - m_Requests.push_back(dr); - } - } - } - return true; -} -//----------------------------------------------------------------------------- -CDM::DataRequestManagerData* SEDataRequestManager::Unload() const -{ - CDM::DataRequestManagerData* data = new CDM::DataRequestManagerData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEDataRequestManager::Unload(CDM::DataRequestManagerData& data) const -{ - data.SamplesPerSecond(m_SamplesPerSecond); - if (HasResultsFilename()) { - data.Filename(m_ResultsFile); - } - if (HasDefaultDecimalFormatting()) { - data.DefaultDecimalFormatting(std::unique_ptr(m_DefaultDecimalFormatting->Unload())); - } - if (HasOverrideDecimalFormatting()) { - data.OverrideDecimalFormatting(std::unique_ptr(m_OverrideDecimalFormatting->Unload())); - } - for (auto& dr : m_Requests) { - auto ptr = dr->Unload(); - auto uptr = std::unique_ptr(ptr); - data.DataRequest().push_back(std::move(uptr)); - } -} -//----------------------------------------------------------------------------- bool SEDataRequestManager::HasDefaultDecimalFormatting() const { return m_DefaultDecimalFormatting != nullptr; @@ -193,6 +119,11 @@ void SEDataRequestManager::RemoveOverrideDecimalFormatting() SAFE_DELETE(m_OverrideDecimalFormatting); } //----------------------------------------------------------------------------- +void SEDataRequestManager::CreateDataRequest(std::unique_ptr request) +{ + m_Requests.push_back(request.release()); +} +//----------------------------------------------------------------------------- SEEnvironmentDataRequest& SEDataRequestManager::CreateEnvironmentDataRequest(const SEDecimalFormat* dfault) { SEEnvironmentDataRequest* dr = new SEEnvironmentDataRequest(dfault); @@ -267,80 +198,7 @@ bool SEDataRequestManager::DuplicateRequest(SEDataRequest* request) } return duplicate; } -//----------------------------------------------------------------------------- -void SEDataRequestManager::CreateFromBind(const CDM::DataRequestData& input, SESubstanceManager& subMgr) -{ - SEDataRequest* dr = newFromBind(input, subMgr, m_DefaultDecimalFormatting); - if (dr != nullptr && !DuplicateRequest(dr)) { - if (HasOverrideDecimalFormatting()) { - ((SEDecimalFormat*)dr)->Set(*m_OverrideDecimalFormatting); - } - m_Requests.push_back(dr); - } -} -//----------------------------------------------------------------------------- -SEDataRequest* SEDataRequestManager::newFromBind(const CDM::DataRequestData& data, SESubstanceManager& substances, const SEDecimalFormat* dfault) -{ - const CDM::DataRequestData* drData = &data; - const CDM::PhysiologyDataRequestData* physSysData = dynamic_cast(drData); - if (physSysData != nullptr) { - SEPhysiologyDataRequest* sys = new SEPhysiologyDataRequest(dfault); - sys->Load(*physSysData); - return sys; - } - const CDM::GasCompartmentDataRequestData* gasData = dynamic_cast(drData); - if (gasData != nullptr) { - SEGasCompartmentDataRequest* Comp = new SEGasCompartmentDataRequest(dfault); - Comp->Load(*gasData, substances); - return Comp; - } - const CDM::LiquidCompartmentDataRequestData* liquidData = dynamic_cast(drData); - if (liquidData != nullptr) { - SELiquidCompartmentDataRequest* Comp = new SELiquidCompartmentDataRequest(dfault); - Comp->Load(*liquidData, substances); - return Comp; - } - const CDM::ThermalCompartmentDataRequestData* thermData = dynamic_cast(drData); - if (thermData != nullptr) { - SEThermalCompartmentDataRequest* Comp = new SEThermalCompartmentDataRequest(dfault); - Comp->Load(*thermData); - return Comp; - } - const CDM::TissueCompartmentDataRequestData* tissueData = dynamic_cast(drData); - if (tissueData != nullptr) { - SETissueCompartmentDataRequest* Comp = new SETissueCompartmentDataRequest(dfault); - Comp->Load(*tissueData); - return Comp; - } - const CDM::PatientDataRequestData* patData = dynamic_cast(drData); - if (patData != nullptr) { - SEPatientDataRequest* sys = new SEPatientDataRequest(dfault); - sys->Load(*patData); - return sys; - } - const CDM::SubstanceDataRequestData* subData = dynamic_cast(drData); - if (subData != nullptr) { - SESubstanceDataRequest* sub = new SESubstanceDataRequest(dfault); - sub->Load(*subData, substances); - return sub; - } - const CDM::EnvironmentDataRequestData* envData = dynamic_cast(drData); - if (envData != nullptr) { - SEEnvironmentDataRequest* env = new SEEnvironmentDataRequest(dfault); - env->Load(*envData); - return env; - } - const CDM::EquipmentDataRequestData* equipSysData = dynamic_cast(drData); - if (equipSysData != nullptr) { - SEEquipmentDataRequest* sys = new SEEquipmentDataRequest(dfault); - sys->Load(*equipSysData); - return sys; - } - if (substances.GetLogger() != nullptr) - substances.GetLogger()->Error("Unsupported DataRequest Received", "SEDataRequest::newFromBind"); - return nullptr; -} //----------------------------------------------------------------------------- bool SEDataRequestManager::HasResultsFilename() const { diff --git a/projects/biogears/libBiogears/src/cdm/scenario/requests/SEEnvironmentDataRequest.cpp b/projects/biogears/libBiogears/src/cdm/scenario/requests/SEEnvironmentDataRequest.cpp index 4684c7d93..5dd7624ba 100644 --- a/projects/biogears/libBiogears/src/cdm/scenario/requests/SEEnvironmentDataRequest.cpp +++ b/projects/biogears/libBiogears/src/cdm/scenario/requests/SEEnvironmentDataRequest.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/DataRequests.h" + #include namespace biogears { @@ -21,30 +23,12 @@ SEEnvironmentDataRequest::SEEnvironmentDataRequest(const SEDecimalFormat* dfault SEEnvironmentDataRequest::~SEEnvironmentDataRequest() { - Clear(); -} - -void SEEnvironmentDataRequest::Clear() -{ - SEDataRequest::Clear(); -} - -bool SEEnvironmentDataRequest::Load(const CDM::EnvironmentDataRequestData& in) -{ - SEDataRequest::Load(in); - return true; -} - -CDM::EnvironmentDataRequestData* SEEnvironmentDataRequest::Unload() const -{ - CDM::EnvironmentDataRequestData* data = new CDM::EnvironmentDataRequestData(); - Unload(*data); - return data; + Invalidate(); } -void SEEnvironmentDataRequest::Unload(CDM::EnvironmentDataRequestData& data) const +void SEEnvironmentDataRequest::Invalidate() { - SEDataRequest::Unload(data); + SEDataRequest::Invalidate(); } size_t SEEnvironmentDataRequest::HashCode() const diff --git a/projects/biogears/libBiogears/src/cdm/scenario/requests/SEEquipmentDataRequest.cpp b/projects/biogears/libBiogears/src/cdm/scenario/requests/SEEquipmentDataRequest.cpp index fe7f62c7f..286c4b3e8 100644 --- a/projects/biogears/libBiogears/src/cdm/scenario/requests/SEEquipmentDataRequest.cpp +++ b/projects/biogears/libBiogears/src/cdm/scenario/requests/SEEquipmentDataRequest.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/DataRequests.h" + #include namespace biogears { @@ -22,35 +24,15 @@ SEEquipmentDataRequest::SEEquipmentDataRequest(const SEDecimalFormat* dfault) //----------------------------------------------------------------------------- SEEquipmentDataRequest::~SEEquipmentDataRequest() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SEEquipmentDataRequest::Clear() +void SEEquipmentDataRequest::Invalidate() { - SEDataRequest::Clear(); + SEDataRequest::Invalidate(); m_Type = ""; } -//----------------------------------------------------------------------------- -bool SEEquipmentDataRequest::Load(const CDM::EquipmentDataRequestData& in) -{ - SEDataRequest::Load(in); - SetType(in.Type()); - return true; -} -//----------------------------------------------------------------------------- -CDM::EquipmentDataRequestData* SEEquipmentDataRequest::Unload() const -{ - CDM::EquipmentDataRequestData* data = new CDM::EquipmentDataRequestData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEEquipmentDataRequest::Unload(CDM::EquipmentDataRequestData& data) const -{ - SEDataRequest::Unload(data); - if (HasType()) - data.Type(m_Type); -} + //----------------------------------------------------------------------------- bool SEEquipmentDataRequest::HasType() const { diff --git a/projects/biogears/libBiogears/src/cdm/scenario/requests/SEGasCompartmentDataRequest.cpp b/projects/biogears/libBiogears/src/cdm/scenario/requests/SEGasCompartmentDataRequest.cpp index 153772a9e..fae1834f6 100644 --- a/projects/biogears/libBiogears/src/cdm/scenario/requests/SEGasCompartmentDataRequest.cpp +++ b/projects/biogears/libBiogears/src/cdm/scenario/requests/SEGasCompartmentDataRequest.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/DataRequests.h" + #include #include #include @@ -23,26 +25,9 @@ SEGasCompartmentDataRequest::SEGasCompartmentDataRequest(const SEDecimalFormat* //------------------------------------------------------------------------------- SEGasCompartmentDataRequest::~SEGasCompartmentDataRequest() { - Clear(); -} -//------------------------------------------------------------------------------- -bool SEGasCompartmentDataRequest::Load(const CDM::GasCompartmentDataRequestData& in, const SESubstanceManager& substances) -{ - SECompartmentSubstanceDataRequest::Load(in, substances); - return true; -} -//------------------------------------------------------------------------------- -CDM::GasCompartmentDataRequestData* SEGasCompartmentDataRequest::Unload() const -{ - CDM::GasCompartmentDataRequestData* data = new CDM::GasCompartmentDataRequestData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEGasCompartmentDataRequest::Unload(CDM::GasCompartmentDataRequestData& data) const -{ - SECompartmentSubstanceDataRequest::Unload(data); + Invalidate(); } + //------------------------------------------------------------------------------- bool SEGasCompartmentDataRequest ::operator==(SEGasCompartmentDataRequest const& rhs) const { diff --git a/projects/biogears/libBiogears/src/cdm/scenario/requests/SELiquidCompartmentDataRequest.cpp b/projects/biogears/libBiogears/src/cdm/scenario/requests/SELiquidCompartmentDataRequest.cpp index 82b419a26..7beba359c 100644 --- a/projects/biogears/libBiogears/src/cdm/scenario/requests/SELiquidCompartmentDataRequest.cpp +++ b/projects/biogears/libBiogears/src/cdm/scenario/requests/SELiquidCompartmentDataRequest.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/DataRequests.h" + #include #include #include @@ -23,25 +25,7 @@ SELiquidCompartmentDataRequest::SELiquidCompartmentDataRequest(const SEDecimalFo //------------------------------------------------------------------------------- SELiquidCompartmentDataRequest::~SELiquidCompartmentDataRequest() { - Clear(); -} -//------------------------------------------------------------------------------- -bool SELiquidCompartmentDataRequest::Load(const CDM::LiquidCompartmentDataRequestData& in, const SESubstanceManager& substances) -{ - SECompartmentSubstanceDataRequest::Load(in, substances); - return true; -} -//------------------------------------------------------------------------------- -CDM::LiquidCompartmentDataRequestData* SELiquidCompartmentDataRequest::Unload() const -{ - CDM::LiquidCompartmentDataRequestData* data = new CDM::LiquidCompartmentDataRequestData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SELiquidCompartmentDataRequest::Unload(CDM::LiquidCompartmentDataRequestData& data) const -{ - SECompartmentSubstanceDataRequest::Unload(data); + Invalidate(); } //------------------------------------------------------------------------------- bool SELiquidCompartmentDataRequest ::operator==(SELiquidCompartmentDataRequest const& rhs) const diff --git a/projects/biogears/libBiogears/src/cdm/scenario/requests/SEPatientDataRequest.cpp b/projects/biogears/libBiogears/src/cdm/scenario/requests/SEPatientDataRequest.cpp index fe04105a8..f03989511 100644 --- a/projects/biogears/libBiogears/src/cdm/scenario/requests/SEPatientDataRequest.cpp +++ b/projects/biogears/libBiogears/src/cdm/scenario/requests/SEPatientDataRequest.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/DataRequests.h" + namespace biogears { SEPatientDataRequest::SEPatientDataRequest(const SEDecimalFormat* dfault) : SEDataRequest(dfault) @@ -19,31 +21,14 @@ SEPatientDataRequest::SEPatientDataRequest(const SEDecimalFormat* dfault) SEPatientDataRequest::~SEPatientDataRequest() { - Clear(); + Invalidate(); } -void SEPatientDataRequest::Clear() +void SEPatientDataRequest::Invalidate() { - SEDataRequest::Clear(); + SEDataRequest::Invalidate(); } -bool SEPatientDataRequest::Load(const CDM::PatientDataRequestData& in) -{ - SEDataRequest::Load(in); - return true; -} - -CDM::PatientDataRequestData* SEPatientDataRequest::Unload() const -{ - CDM::PatientDataRequestData* data = new CDM::PatientDataRequestData(); - Unload(*data); - return data; -} - -void SEPatientDataRequest::Unload(CDM::PatientDataRequestData& data) const -{ - SEDataRequest::Unload(data); -} size_t SEPatientDataRequest::HashCode() const { diff --git a/projects/biogears/libBiogears/src/cdm/scenario/requests/SEPhysiologyDataRequest.cpp b/projects/biogears/libBiogears/src/cdm/scenario/requests/SEPhysiologyDataRequest.cpp index b5b21aa05..b6af44609 100644 --- a/projects/biogears/libBiogears/src/cdm/scenario/requests/SEPhysiologyDataRequest.cpp +++ b/projects/biogears/libBiogears/src/cdm/scenario/requests/SEPhysiologyDataRequest.cpp @@ -12,6 +12,8 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/DataRequests.h" + namespace biogears { SEPhysiologyDataRequest::SEPhysiologyDataRequest(const SEDecimalFormat* dfault) : SEDataRequest(dfault) @@ -20,31 +22,14 @@ SEPhysiologyDataRequest::SEPhysiologyDataRequest(const SEDecimalFormat* dfault) SEPhysiologyDataRequest::~SEPhysiologyDataRequest() { - Clear(); + Invalidate(); } -void SEPhysiologyDataRequest::Clear() +void SEPhysiologyDataRequest::Invalidate() { - SEDataRequest::Clear(); + SEDataRequest::Invalidate(); } -bool SEPhysiologyDataRequest::Load(const CDM::PhysiologyDataRequestData& in) -{ - SEDataRequest::Load(in); - return true; -} - -CDM::PhysiologyDataRequestData* SEPhysiologyDataRequest::Unload() const -{ - CDM::PhysiologyDataRequestData* data = new CDM::PhysiologyDataRequestData(); - Unload(*data); - return data; -} - -void SEPhysiologyDataRequest::Unload(CDM::PhysiologyDataRequestData& data) const -{ - SEDataRequest::Unload(data); -} size_t SEPhysiologyDataRequest::HashCode() const { diff --git a/projects/biogears/libBiogears/src/cdm/scenario/requests/SESubstanceDataRequest.cpp b/projects/biogears/libBiogears/src/cdm/scenario/requests/SESubstanceDataRequest.cpp index 2fda2004b..cb301ea72 100644 --- a/projects/biogears/libBiogears/src/cdm/scenario/requests/SESubstanceDataRequest.cpp +++ b/projects/biogears/libBiogears/src/cdm/scenario/requests/SESubstanceDataRequest.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/DataRequests.h" + #include #include #include @@ -25,12 +27,12 @@ SESubstanceDataRequest::SESubstanceDataRequest(const SEDecimalFormat* dfault) //----------------------------------------------------------------------------- SESubstanceDataRequest::~SESubstanceDataRequest() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SESubstanceDataRequest::Clear() +void SESubstanceDataRequest::Invalidate() { - SEDataRequest::Clear(); + SEDataRequest::Invalidate(); m_Compartment = ""; m_Substance = nullptr; } @@ -47,30 +49,7 @@ size_t SESubstanceDataRequest::HashCode() const return m_Hash; } //----------------------------------------------------------------------------- -bool SESubstanceDataRequest::Load(const CDM::SubstanceDataRequestData& in, const SESubstanceManager& substances) -{ - SEDataRequest::Load(in); - if (in.Compartment().present()) - SetCompartment(in.Compartment().get()); - SetSubstance(substances.GetSubstance(in.Substance())); - return true; -} -//----------------------------------------------------------------------------- -CDM::SubstanceDataRequestData* SESubstanceDataRequest::Unload() const -{ - CDM::SubstanceDataRequestData* data = new CDM::SubstanceDataRequestData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SESubstanceDataRequest::Unload(CDM::SubstanceDataRequestData& data) const -{ - SEDataRequest::Unload(data); - if (HasCompartment()) - data.Compartment(m_Compartment); - if (HasSubstance()) - data.Substance(m_Substance->GetName()); -} + //----------------------------------------------------------------------------- const char* SESubstanceDataRequest::GetCompartment() const { diff --git a/projects/biogears/libBiogears/src/cdm/scenario/requests/SEThermalCompartmentDataRequest.cpp b/projects/biogears/libBiogears/src/cdm/scenario/requests/SEThermalCompartmentDataRequest.cpp index 4c7f195ff..e7f5e60ed 100644 --- a/projects/biogears/libBiogears/src/cdm/scenario/requests/SEThermalCompartmentDataRequest.cpp +++ b/projects/biogears/libBiogears/src/cdm/scenario/requests/SEThermalCompartmentDataRequest.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/DataRequests.h" + #include #include @@ -22,26 +24,9 @@ SEThermalCompartmentDataRequest::SEThermalCompartmentDataRequest(const SEDecimal SEThermalCompartmentDataRequest::~SEThermalCompartmentDataRequest() { - Clear(); + Invalidate(); } -bool SEThermalCompartmentDataRequest::Load(const CDM::ThermalCompartmentDataRequestData& in) -{ - SECompartmentDataRequest::Load(in); - return true; -} - -CDM::ThermalCompartmentDataRequestData* SEThermalCompartmentDataRequest::Unload() const -{ - CDM::ThermalCompartmentDataRequestData* data = new CDM::ThermalCompartmentDataRequestData(); - Unload(*data); - return data; -} - -void SEThermalCompartmentDataRequest::Unload(CDM::ThermalCompartmentDataRequestData& data) const -{ - SECompartmentDataRequest::Unload(data); -} //------------------------------------------------------------------------------- bool SEThermalCompartmentDataRequest ::operator==(SEThermalCompartmentDataRequest const& rhs) const { diff --git a/projects/biogears/libBiogears/src/cdm/scenario/requests/SETissueCompartmentDataRequest.cpp b/projects/biogears/libBiogears/src/cdm/scenario/requests/SETissueCompartmentDataRequest.cpp index 2fc538f79..ca4ee16c7 100644 --- a/projects/biogears/libBiogears/src/cdm/scenario/requests/SETissueCompartmentDataRequest.cpp +++ b/projects/biogears/libBiogears/src/cdm/scenario/requests/SETissueCompartmentDataRequest.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/DataRequests.h" + #include #include @@ -22,12 +24,12 @@ SETissueCompartmentDataRequest::SETissueCompartmentDataRequest(const SEDecimalFo //------------------------------------------------------------------------------- SETissueCompartmentDataRequest::~SETissueCompartmentDataRequest() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SETissueCompartmentDataRequest::Clear() +void SETissueCompartmentDataRequest::Invalidate() { - SECompartmentDataRequest::Clear(); + SECompartmentDataRequest::Invalidate(); } //------------------------------------------------------------------------------- size_t SETissueCompartmentDataRequest::HashCode() @@ -36,24 +38,6 @@ size_t SETissueCompartmentDataRequest::HashCode() return h; } //------------------------------------------------------------------------------- -bool SETissueCompartmentDataRequest::Load(const CDM::TissueCompartmentDataRequestData& in) -{ - SECompartmentDataRequest::Load(in); - return true; -} -//------------------------------------------------------------------------------- -CDM::TissueCompartmentDataRequestData* SETissueCompartmentDataRequest::Unload() const -{ - CDM::TissueCompartmentDataRequestData* data = new CDM::TissueCompartmentDataRequestData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SETissueCompartmentDataRequest::Unload(CDM::TissueCompartmentDataRequestData& data) const -{ - SECompartmentDataRequest::Unload(data); -} -//------------------------------------------------------------------------------- bool SETissueCompartmentDataRequest ::operator==(SETissueCompartmentDataRequest const& rhs) const { if (this == &rhs) diff --git a/projects/biogears/libBiogears/src/cdm/substance/SESubstance.cpp b/projects/biogears/libBiogears/src/cdm/substance/SESubstance.cpp index 70791adc5..29ee7195b 100644 --- a/projects/biogears/libBiogears/src/cdm/substance/SESubstance.cpp +++ b/projects/biogears/libBiogears/src/cdm/substance/SESubstance.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Substance.h" + #include #include #include @@ -31,79 +33,220 @@ specific language governing permissions and limitations under the License. #include namespace biogears { -SESubstance::SESubstance(Logger* logger) - : Loggable(logger) -{ - m_Name = ""; - m_State = (CDM::enumSubstanceState::value)-1; - m_Classification = (CDM::enumSubstanceClass::value)-1; - m_Density = nullptr; - m_MolarMass = nullptr; - m_MaximumDiffusionFlux = nullptr; - m_MichaelisCoefficient = nullptr; - m_MembraneResistance = nullptr; +SESubstanceDefinition::SESubstanceDefinition(SESubstanceDefinition const& obj) + : Name(obj.Name) + , Classification(obj.Classification) + , State(obj.State) + , Density(obj.Density) + , MolarMass(obj.MolarMass) + , MaximumDiffusionFlux(obj.MaximumDiffusionFlux) + , MichaelisCoefficient(obj.MichaelisCoefficient) + , MembraneResistance(obj.MembraneResistance) + , AreaUnderCurve(obj.AreaUnderCurve) + , AlveolarTransfer(obj.AlveolarTransfer) + , DiffusingCapacity(obj.DiffusingCapacity) + , RelativeDiffusionCoefficient(obj.RelativeDiffusionCoefficient) + , SolubilityCoefficient(obj.SolubilityCoefficient) + , ClearanceDefinition(obj.ClearanceDefinition) + , Aerosolization(obj.Aerosolization) + , Pharmacokinetics(obj.Pharmacokinetics) + , Pharmacodynamics(obj.Pharmacodynamics) +{}; +//----------------------------------------------------------------------------- +SESubstanceDefinition::SESubstanceDefinition(SESubstanceDefinition&& obj) + : Name(std::exchange(obj.Name, "")) + , Classification(std::exchange(obj.Classification, SESubstanceClass::Invalid)) + , State(std::exchange(obj.State, SESubstanceState::Invalid)) + , Density(std::move(obj.Density)) + , MolarMass(std::move(obj.MolarMass)) + , MaximumDiffusionFlux(std::move(obj.MaximumDiffusionFlux)) + , MichaelisCoefficient(std::move(obj.MichaelisCoefficient)) + , MembraneResistance(std::move(obj.MembraneResistance)) + , AreaUnderCurve(std::move(obj.AreaUnderCurve)) + , AlveolarTransfer(std::move(obj.AlveolarTransfer)) + , DiffusingCapacity(std::move(obj.DiffusingCapacity)) + , RelativeDiffusionCoefficient(std::move(obj.RelativeDiffusionCoefficient)) + , SolubilityCoefficient(std::move(obj.SolubilityCoefficient)) + , ClearanceDefinition(std::move(obj.ClearanceDefinition)) + , Aerosolization(std::move(obj.Aerosolization)) + , Pharmacokinetics(std::move(obj.Pharmacokinetics)) + , Pharmacodynamics(std::move(obj.Pharmacodynamics)) +{ +} +//----------------------------------------------------------------------------- +SESubstanceDefinition ::~SESubstanceDefinition() +{ +} +//----------------------------------------------------------------------------- +SESubstanceDefinition::SESubstanceDefinition(Logger* logger) + : ClearanceDefinition() + , Aerosolization(logger) + , Pharmacokinetics(logger) + , Pharmacodynamics(logger) + , Name("") + , Classification(SESubstanceClass::Invalid) + , State(SESubstanceState::Invalid) + , Density() + , MolarMass() + , MaximumDiffusionFlux() + , MichaelisCoefficient() + , MembraneResistance() + , AreaUnderCurve() + , AlveolarTransfer() + , DiffusingCapacity() + , RelativeDiffusionCoefficient() + , SolubilityCoefficient() {}; +//----------------------------------------------------------------------------- +SESubstanceDefinition::SESubstanceDefinition(SESubstanceClearanceDefinition definition, Logger* logger) + : ClearanceDefinition(definition) + , Aerosolization(logger) + , Pharmacokinetics(logger) + , Pharmacodynamics(logger) + , Name() + , Classification() + , State() + , Density() + , MolarMass() + , MaximumDiffusionFlux() + , MichaelisCoefficient() + , MembraneResistance() + , AreaUnderCurve() + , AlveolarTransfer() + , DiffusingCapacity() + , RelativeDiffusionCoefficient() + , SolubilityCoefficient() {}; +//------------------------------------------------------------------------------- - m_Aerosolization = nullptr; - m_AreaUnderCurve = nullptr; - m_BloodConcentration = nullptr; - m_EffectSiteConcentration = nullptr; - m_MassInBody = nullptr; - m_MassInBlood = nullptr; - m_MassInTissue = nullptr; - m_PlasmaConcentration = nullptr; - m_SystemicMassCleared = nullptr; - m_TissueConcentration = nullptr; +SESubstanceDefinition& SESubstanceDefinition::operator=(SESubstanceDefinition const& rhs) +{ + if (this != &rhs) { + + Name = rhs.Name; + Classification = rhs.Classification; + State = rhs.State; + Density = rhs.Density; + MolarMass = rhs.MolarMass; + MaximumDiffusionFlux = rhs.MaximumDiffusionFlux; + MichaelisCoefficient = rhs.MichaelisCoefficient; + MembraneResistance = rhs.MembraneResistance; + AreaUnderCurve = rhs.AreaUnderCurve; + AlveolarTransfer = rhs.AlveolarTransfer; + DiffusingCapacity = rhs.DiffusingCapacity; + RelativeDiffusionCoefficient = rhs.RelativeDiffusionCoefficient; + SolubilityCoefficient = rhs.SolubilityCoefficient; + ClearanceDefinition = rhs.ClearanceDefinition; + Aerosolization = rhs.Aerosolization; + Pharmacokinetics = rhs.Pharmacokinetics; + Pharmacodynamics = rhs.Pharmacodynamics; + } + return *this; +} +SESubstanceDefinition& SESubstanceDefinition::operator=(SESubstanceDefinition&& rhs) +{ + if (this != &rhs) { + Name = rhs.Name; + Classification = rhs.Classification; + State = rhs.State; + Density = rhs.Density; + MolarMass = rhs.MolarMass; + MaximumDiffusionFlux = rhs.MaximumDiffusionFlux; + MichaelisCoefficient = rhs.MichaelisCoefficient; + MembraneResistance = rhs.MembraneResistance; + AreaUnderCurve = rhs.AreaUnderCurve; + AlveolarTransfer = rhs.AlveolarTransfer; + DiffusingCapacity = rhs.DiffusingCapacity; + RelativeDiffusionCoefficient = rhs.RelativeDiffusionCoefficient; + SolubilityCoefficient = rhs.SolubilityCoefficient; + ClearanceDefinition = rhs.ClearanceDefinition; + Aerosolization = rhs.Aerosolization; + Pharmacokinetics = rhs.Pharmacokinetics; + Pharmacodynamics = rhs.Pharmacodynamics; + } + return *this; +} +//------------------------------------------------------------------------------- - m_AlveolarTransfer = nullptr; - m_DiffusingCapacity = nullptr; - m_EndTidalFraction = nullptr; - m_EndTidalPressure = nullptr; - m_SolubilityCoefficient = nullptr; - m_RelativeDiffusionCoefficient = nullptr; +bool SESubstanceDefinition::operator==(SESubstanceDefinition const& rhs) const +{ + if (this == &rhs) + return true; - m_Clearance = nullptr; - m_Pharmacokinetics = nullptr; - m_Pharmacodynamics = nullptr; + return Name == rhs.Name + && Classification == rhs.Classification + && State == rhs.State +#if defined(BIOGEARS_RIGOROUS_EQUIVILANCE_CHECKS) && !defined(BIOGEARS_LINIENT_SESUBSTANCE_DEFINITION_CHECKS) + && Density == rhs.Density + && MolarMass == rhs.MolarMass + && MaximumDiffusionFlux == rhs.MaximumDiffusionFlux + && MichaelisCoefficient == rhs.MichaelisCoefficient + && MembraneResistance == rhs.MembraneResistance + && AreaUnderCurve == rhs.AreaUnderCurve + && AlveolarTransfer == rhs.AlveolarTransfer + && DiffusingCapacity == rhs.DiffusingCapacity + && RelativeDiffusionCoefficient == rhs.RelativeDiffusionCoefficient + && SolubilityCoefficient == rhs.SolubilityCoefficient + && ClearanceDefinition == rhs.ClearanceDefinition + && Aerosolization == rhs.Aerosolization + && Pharmacokinetics == rhs.Pharmacokinetics + && Pharmacodynamics == rhs.Pharmacodynamics) +#endif + ; +} +bool SESubstanceDefinition::operator!=(SESubstanceDefinition const& rhs) const +{ + return !(*this == rhs); +} +//----------------------------------------------------------------------------- +SESubstance::SESubstance(Logger* logger) + : Loggable(logger) + , m_def(logger) + , m_Clearance(logger) + , m_BloodConcentration() + , m_EffectSiteConcentration() + , m_MassInBody() + , m_MassInBlood() + , m_MassInTissue() + , m_PlasmaConcentration() + , m_SystemicMassCleared() + , m_TissueConcentration() + , m_EndTidalFraction() + , m_EndTidalPressure() +{ +} +//----------------------------------------------------------------------------- +SESubstance::SESubstance(SESubstanceDefinition definition) + : Loggable(definition.Aerosolization.GetLogger()) + , m_def(definition) + , m_Clearance(definition.ClearanceDefinition, definition.Aerosolization.GetLogger()) + , m_BloodConcentration() + , m_EffectSiteConcentration() + , m_MassInBody() + , m_MassInBlood() + , m_MassInTissue() + , m_PlasmaConcentration() + , m_SystemicMassCleared() + , m_TissueConcentration() + , m_EndTidalFraction() + , m_EndTidalPressure() +{ } //----------------------------------------------------------------------------- SESubstance::~SESubstance() { - Clear(); } //----------------------------------------------------------------------------- -void SESubstance::Clear() +void SESubstance::Invalidate() { - m_Name = ""; - m_State = (CDM::enumSubstanceState::value)-1; - m_Classification = (CDM::enumSubstanceClass::value)-1; - SAFE_DELETE(m_Density); - SAFE_DELETE(m_MolarMass); - - SAFE_DELETE(m_MaximumDiffusionFlux); - SAFE_DELETE(m_MichaelisCoefficient); - SAFE_DELETE(m_MembraneResistance); - SAFE_DELETE(m_AreaUnderCurve); - SAFE_DELETE(m_BloodConcentration); - SAFE_DELETE(m_EffectSiteConcentration); - SAFE_DELETE(m_MassInBody); - SAFE_DELETE(m_MassInBlood); - SAFE_DELETE(m_MassInTissue); - SAFE_DELETE(m_PlasmaConcentration); - SAFE_DELETE(m_SystemicMassCleared); - SAFE_DELETE(m_TissueConcentration); - - SAFE_DELETE(m_AlveolarTransfer); - SAFE_DELETE(m_DiffusingCapacity); - SAFE_DELETE(m_EndTidalFraction); - SAFE_DELETE(m_EndTidalPressure); - SAFE_DELETE(m_SolubilityCoefficient); - SAFE_DELETE(m_RelativeDiffusionCoefficient); - - SAFE_DELETE(m_Aerosolization); - SAFE_DELETE(m_Clearance); - SAFE_DELETE(m_Pharmacokinetics); - SAFE_DELETE(m_Pharmacodynamics); + m_BloodConcentration.Invalidate(); + m_EffectSiteConcentration.Invalidate(); + m_MassInBody.Invalidate(); + m_MassInBlood.Invalidate(); + m_MassInTissue.Invalidate(); + m_PlasmaConcentration.Invalidate(); + m_SystemicMassCleared.Invalidate(); + m_TissueConcentration.Invalidate(); + } //----------------------------------------------------------------------------- const SEScalar* SESubstance::GetScalar(const char* name) @@ -173,681 +316,463 @@ const SEScalar* SESubstance::GetScalar(const std::string& name) return nullptr; } //----------------------------------------------------------------------------- -bool SESubstance::Load(const CDM::SubstanceData& in) -{ - Clear(); - m_Name = in.Name(); - - if (in.State().present()) - m_State = in.State().get(); - if (in.Classification().present()) - m_Classification = in.Classification().get(); - if (in.Density().present()) - GetDensity().Load(in.Density().get()); - if (in.MolarMass().present()) - GetMolarMass().Load(in.MolarMass().get()); - - if (in.MaximumDiffusionFlux().present()) - GetMaximumDiffusionFlux().Load(in.MaximumDiffusionFlux().get()); - if (in.MichaelisCoefficient().present()) - GetMichaelisCoefficient().Load(in.MichaelisCoefficient().get()); - if (in.MembraneResistance().present()) - GetMembraneResistance().Load(in.MembraneResistance().get()); - if (in.AreaUnderCurve().present()) - GetAreaUnderCurve().Load(in.AreaUnderCurve().get()); - if (in.BloodConcentration().present()) - GetBloodConcentration().Load(in.BloodConcentration().get()); - if (in.EffectSiteConcentration().present()) - GetEffectSiteConcentration().Load(in.EffectSiteConcentration().get()); - if (in.MassInBody().present()) - GetMassInBody().Load(in.MassInBody().get()); - if (in.MassInBlood().present()) - GetMassInBlood().Load(in.MassInBlood().get()); - if (in.MassInTissue().present()) - GetMassInTissue().Load(in.MassInTissue().get()); - if (in.PlasmaConcentration().present()) - GetPlasmaConcentration().Load(in.PlasmaConcentration().get()); - if (in.SystemicMassCleared().present()) - GetSystemicMassCleared().Load(in.SystemicMassCleared().get()); - if (in.TissueConcentration().present()) - GetTissueConcentration().Load(in.TissueConcentration().get()); - - if (in.AlveolarTransfer().present()) - GetAlveolarTransfer().Load(in.AlveolarTransfer().get()); - if (in.DiffusingCapacity().present()) - GetDiffusingCapacity().Load(in.DiffusingCapacity().get()); - if (in.EndTidalFraction().present()) - GetEndTidalFraction().Load(in.EndTidalFraction().get()); - if (in.EndTidalPressure().present()) - GetEndTidalPressure().Load(in.EndTidalPressure().get()); - if (in.RelativeDiffusionCoefficient().present()) - GetRelativeDiffusionCoefficient().Load(in.RelativeDiffusionCoefficient().get()); - if (in.SolubilityCoefficient().present()) - GetSolubilityCoefficient().Load(in.SolubilityCoefficient().get()); - - if (in.Aerosolization().present()) - GetAerosolization().Load(in.Aerosolization().get()); - if (in.Clearance().present()) - GetClearance().Load(in.Clearance().get()); - if (in.Pharmacokinetics().present()) - GetPK().Load(in.Pharmacokinetics().get()); - if (in.Pharmacodynamics().present()) - GetPD().Load(in.Pharmacodynamics().get()); - - if (HasClearance() && HasPK() && GetPK().HasPhysicochemicals() && GetClearance().HasFractionUnboundInPlasma() && !GetClearance().GetFractionUnboundInPlasma().Equals(GetPK().GetPhysicochemicals().GetFractionUnboundInPlasma())) { - Fatal("Multiple FractionUnboundInPlasma values specified, but not the same. These must match at this time."); - } - - return true; -} -//----------------------------------------------------------------------------- -CDM::SubstanceData* SESubstance::Unload() const -{ - CDM::SubstanceData* data = new CDM::SubstanceData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SESubstance::Unload(CDM::SubstanceData& data) const -{ - if (HasName()) { - data.Name(m_Name); - } else { - data.Name("Unknown Substance"); - } - if (HasState()) - data.State(m_State); - if (HasClassification()) - data.Classification(m_Classification); - if (HasDensity()) - data.Density(std::unique_ptr(m_Density->Unload())); - if (HasMolarMass()) - data.MolarMass(std::unique_ptr(m_MolarMass->Unload())); - - if (HasMaximumDiffusionFlux()) - data.MaximumDiffusionFlux(std::unique_ptr(m_MaximumDiffusionFlux->Unload())); - if (HasMichaelisCoefficient()) - data.MichaelisCoefficient(std::unique_ptr(m_MichaelisCoefficient->Unload())); - if (HasMembraneResistance()) - data.MembraneResistance(std::unique_ptr(m_MembraneResistance->Unload())); - if (HasAreaUnderCurve()) - data.AreaUnderCurve(std::unique_ptr(m_AreaUnderCurve->Unload())); - if (HasBloodConcentration()) - data.BloodConcentration(std::unique_ptr(m_BloodConcentration->Unload())); - if (HasEffectSiteConcentration()) - data.EffectSiteConcentration(std::unique_ptr(m_EffectSiteConcentration->Unload())); - if (HasMassInBody()) - data.MassInBody(std::unique_ptr(m_MassInBody->Unload())); - if (HasMassInBlood()) - data.MassInBlood(std::unique_ptr(m_MassInBlood->Unload())); - if (HasMassInTissue()) - data.MassInTissue(std::unique_ptr(m_MassInTissue->Unload())); - if (HasPlasmaConcentration()) - data.PlasmaConcentration(std::unique_ptr(m_PlasmaConcentration->Unload())); - if (HasSystemicMassCleared()) - data.SystemicMassCleared(std::unique_ptr(m_SystemicMassCleared->Unload())); - if (HasTissueConcentration()) - data.TissueConcentration(std::unique_ptr(m_TissueConcentration->Unload())); - - if (HasAlveolarTransfer()) - data.AlveolarTransfer(std::unique_ptr(m_AlveolarTransfer->Unload())); - if (HasDiffusingCapacity()) - data.DiffusingCapacity(std::unique_ptr(m_DiffusingCapacity->Unload())); - if (HasEndTidalFraction()) - data.EndTidalFraction(std::unique_ptr(m_EndTidalFraction->Unload())); - if (HasEndTidalPressure()) - data.EndTidalPressure(std::unique_ptr(m_EndTidalPressure->Unload())); - if (HasSolubilityCoefficient()) - data.SolubilityCoefficient(std::unique_ptr(m_SolubilityCoefficient->Unload())); - if (HasRelativeDiffusionCoefficient()) - data.RelativeDiffusionCoefficient(std::unique_ptr(m_RelativeDiffusionCoefficient->Unload())); - - if (HasAerosolization()) - data.Aerosolization(std::unique_ptr(m_Aerosolization->Unload())); - if (HasClearance()) - data.Clearance(std::unique_ptr(m_Clearance->Unload())); - if (HasPK()) - data.Pharmacokinetics(std::unique_ptr(m_Pharmacokinetics->Unload())); - if (HasPD()) - data.Pharmacodynamics(std::unique_ptr(m_Pharmacodynamics->Unload())); -}; -//----------------------------------------------------------------------------- std::string SESubstance::GetName() const { - return m_Name; + return m_def.Name; } //----------------------------------------------------------------------------- const char* SESubstance::GetName_cStr() const { - return m_Name.c_str(); + return m_def.Name.c_str(); } //----------------------------------------------------------------------------- void SESubstance::SetName(const char* name) { - m_Name = name; + m_def.Name = name; } //----------------------------------------------------------------------------- void SESubstance::SetName(const std::string& name) { - m_Name = name; + m_def.Name = name; } //----------------------------------------------------------------------------- bool SESubstance::HasName() const { - return m_Name.empty() ? false : true; + return m_def.Name.empty() ? false : true; } //----------------------------------------------------------------------------- void SESubstance::InvalidateName() { - m_Name = ""; + m_def.Name = ""; } //----------------------------------------------------------------------------- -CDM::enumSubstanceState::value SESubstance::GetState() const +SESubstanceState SESubstance::GetState() const { - return m_State; + return m_def.State; } //----------------------------------------------------------------------------- -void SESubstance::SetState(CDM::enumSubstanceState::value state) +void SESubstance::SetState(SESubstanceState state) { - m_State = state; + m_def.State = state; } //----------------------------------------------------------------------------- bool SESubstance::HasState() const { - return m_State == ((CDM::enumSubstanceState::value)-1) ? false : true; + return m_def.State == SESubstanceState::Invalid; } //----------------------------------------------------------------------------- void SESubstance::InvalidateState() { - m_State = (CDM::enumSubstanceState::value)-1; + m_def.State = SESubstanceState::Invalid; } //----------------------------------------------------------------------------- -CDM::enumSubstanceClass::value SESubstance::GetClassification() const +SESubstanceClass SESubstance::GetClassification() const { - return m_Classification; + return m_def.Classification; } //----------------------------------------------------------------------------- -void SESubstance::SetClassification(CDM::enumSubstanceClass::value subClass) +void SESubstance::SetClassification(SESubstanceClass subClass) { - m_Classification = subClass; + m_def.Classification = subClass; } //----------------------------------------------------------------------------- bool SESubstance::HasClassification() const { - return m_Classification == ((CDM::enumSubstanceClass::value)-1) ? false : true; + return m_def.Classification != SESubstanceClass::Invalid; } //----------------------------------------------------------------------------- void SESubstance::InvalidateClassification() { - m_Classification = (CDM::enumSubstanceClass::value)-1; + m_def.Classification = SESubstanceClass::Invalid; } //----------------------------------------------------------------------------- bool SESubstance::HasDensity() const { - return (m_Density == nullptr) ? false : m_Density->IsValid(); + return m_def.Density.IsValid(); } //----------------------------------------------------------------------------- SEScalarMassPerVolume& SESubstance::GetDensity() { - if (m_Density == nullptr) - m_Density = new SEScalarMassPerVolume(); - return *m_Density; + return m_def.Density; } //----------------------------------------------------------------------------- double SESubstance::GetDensity(const MassPerVolumeUnit& unit) const { - if (m_Density == nullptr) - return SEScalar::dNaN(); - return m_Density->GetValue(unit); + return m_def.Density.GetValue(unit); } //----------------------------------------------------------------------------- bool SESubstance::HasMolarMass() const { - return (m_MolarMass == nullptr) ? false : m_MolarMass->IsValid(); + return m_def.MolarMass.IsValid(); } //----------------------------------------------------------------------------- SEScalarMassPerAmount& SESubstance::GetMolarMass() { - if (m_MolarMass == nullptr) - m_MolarMass = new SEScalarMassPerAmount(); - return *m_MolarMass; + return m_def.MolarMass; } //----------------------------------------------------------------------------- double SESubstance::GetMolarMass(const MassPerAmountUnit& unit) const { - if (m_MolarMass == nullptr) - return SEScalar::dNaN(); - return m_MolarMass->GetValue(unit); + + return m_def.MolarMass.GetValue(unit); } //----------------------------------------------------------------------------- bool SESubstance::HasMaximumDiffusionFlux() const { - return (m_MaximumDiffusionFlux == nullptr) ? false : m_MaximumDiffusionFlux->IsValid(); + return m_def.MaximumDiffusionFlux.IsValid(); } //----------------------------------------------------------------------------- SEScalarMassPerAreaTime& SESubstance::GetMaximumDiffusionFlux() { - if (m_MaximumDiffusionFlux == nullptr) - m_MaximumDiffusionFlux = new SEScalarMassPerAreaTime(); - return *m_MaximumDiffusionFlux; + + return m_def.MaximumDiffusionFlux; } //----------------------------------------------------------------------------- double SESubstance::GetMaximumDiffusionFlux(const MassPerAreaTimeUnit& unit) const { - if (m_MaximumDiffusionFlux == nullptr) - return SEScalar::dNaN(); - return m_MaximumDiffusionFlux->GetValue(unit); + + return m_def.MaximumDiffusionFlux.GetValue(unit); } //----------------------------------------------------------------------------- bool SESubstance::HasMichaelisCoefficient() const { - return (m_MichaelisCoefficient == nullptr) ? false : m_MichaelisCoefficient->IsValid(); + return m_def.MichaelisCoefficient.IsValid(); } //----------------------------------------------------------------------------- SEScalar& SESubstance::GetMichaelisCoefficient() { - if (m_MichaelisCoefficient == nullptr) - m_MichaelisCoefficient = new SEScalar(); - return *m_MichaelisCoefficient; + + return m_def.MichaelisCoefficient; } //----------------------------------------------------------------------------- double SESubstance::GetMichaelisCoefficient() const { - if (m_MichaelisCoefficient == nullptr) - return SEScalar::dNaN(); - return m_MichaelisCoefficient->GetValue(); + + return m_def.MichaelisCoefficient.GetValue(); } //----------------------------------------------------------------------------- bool SESubstance::HasMembraneResistance() const { - return (m_MembraneResistance == nullptr) ? false : m_MembraneResistance->IsValid(); + return m_def.MembraneResistance.IsValid(); } //----------------------------------------------------------------------------- SEScalarElectricResistance& SESubstance::GetMembraneResistance() { - if (m_MembraneResistance == nullptr) - m_MembraneResistance = new SEScalarElectricResistance(); - return *m_MembraneResistance; + + return m_def.MembraneResistance; } //----------------------------------------------------------------------------- double SESubstance::GetMembraneResistance(const ElectricResistanceUnit& unit) const { - if (m_MembraneResistance == nullptr) - return SEScalarElectricResistance::dNaN(); - return m_MembraneResistance->GetValue(unit); + + return m_def.MembraneResistance.GetValue(unit); } //----------------------------------------------------------------------------- bool SESubstance::HasAerosolization() const { - return (m_Aerosolization != nullptr && m_Aerosolization->IsValid()); + return (m_def.Aerosolization.IsValid()); } //----------------------------------------------------------------------------- SESubstanceAerosolization& SESubstance::GetAerosolization() { - if (m_Aerosolization == nullptr) - m_Aerosolization = new SESubstanceAerosolization(GetLogger()); - return *m_Aerosolization; + return m_def.Aerosolization; } //----------------------------------------------------------------------------- const SESubstanceAerosolization* SESubstance::GetAerosolization() const { - return m_Aerosolization; + return &m_def.Aerosolization; } //----------------------------------------------------------------------------- void SESubstance::RemoveAerosolization() { - SAFE_DELETE(m_Aerosolization); + m_def.Aerosolization.Invalidate(); } //----------------------------------------------------------------------------- bool SESubstance::HasAreaUnderCurve() const { - return (m_AreaUnderCurve == nullptr) ? false : m_AreaUnderCurve->IsValid(); + return m_def.AreaUnderCurve.IsValid(); } //----------------------------------------------------------------------------- SEScalarTimeMassPerVolume& SESubstance::GetAreaUnderCurve() { - if (m_AreaUnderCurve == nullptr) - m_AreaUnderCurve = new SEScalarTimeMassPerVolume(); - return *m_AreaUnderCurve; + return m_def.AreaUnderCurve; } //----------------------------------------------------------------------------- double SESubstance::GetAreaUnderCurve(const TimeMassPerVolumeUnit& unit) const { - if (m_AreaUnderCurve == nullptr) - return SEScalar::dNaN(); - return m_AreaUnderCurve->GetValue(unit); + return m_def.AreaUnderCurve.GetValue(unit); } //----------------------------------------------------------------------------- bool SESubstance::HasBloodConcentration() const { - return (m_BloodConcentration == nullptr) ? false : m_BloodConcentration->IsValid(); + return m_BloodConcentration.IsValid(); } //----------------------------------------------------------------------------- SEScalarMassPerVolume& SESubstance::GetBloodConcentration() { - if (m_BloodConcentration == nullptr) - m_BloodConcentration = new SEScalarMassPerVolume(); - return *m_BloodConcentration; + return m_BloodConcentration; } //----------------------------------------------------------------------------- double SESubstance::GetBloodConcentration(const MassPerVolumeUnit& unit) const { - if (m_BloodConcentration == nullptr) - return SEScalar::dNaN(); - return m_BloodConcentration->GetValue(unit); + return m_BloodConcentration.GetValue(unit); } //----------------------------------------------------------------------------- bool SESubstance::HasEffectSiteConcentration() const { - return (m_EffectSiteConcentration == nullptr) ? false : m_EffectSiteConcentration->IsValid(); + return m_EffectSiteConcentration.IsValid(); } //----------------------------------------------------------------------------- SEScalarMassPerVolume& SESubstance::GetEffectSiteConcentration() { - if (m_EffectSiteConcentration == nullptr) - m_EffectSiteConcentration = new SEScalarMassPerVolume(); - return *m_EffectSiteConcentration; + + return m_EffectSiteConcentration; } //----------------------------------------------------------------------------- double SESubstance::GetEffectSiteConcentration(const MassPerVolumeUnit& unit) const { - if (m_EffectSiteConcentration == nullptr) - return SEScalar::dNaN(); - return m_EffectSiteConcentration->GetValue(unit); + + return m_EffectSiteConcentration.GetValue(unit); } //----------------------------------------------------------------------------- bool SESubstance::HasMassInBody() const { - return (m_MassInBody == nullptr) ? false : m_MassInBody->IsValid(); + return m_MassInBody.IsValid(); } //----------------------------------------------------------------------------- SEScalarMass& SESubstance::GetMassInBody() { - if (m_MassInBody == nullptr) - m_MassInBody = new SEScalarMass(); - return *m_MassInBody; + return m_MassInBody; } //----------------------------------------------------------------------------- double SESubstance::GetMassInBody(const MassUnit& unit) const { - if (m_MassInBody == nullptr) - return SEScalar::dNaN(); - return m_MassInBody->GetValue(unit); + return m_MassInBody.GetValue(unit); } //----------------------------------------------------------------------------- bool SESubstance::HasMassInBlood() const { - return (m_MassInBlood == nullptr) ? false : m_MassInBlood->IsValid(); + return m_MassInBlood.IsValid(); } //----------------------------------------------------------------------------- SEScalarMass& SESubstance::GetMassInBlood() { - if (m_MassInBlood == nullptr) - m_MassInBlood = new SEScalarMass(); - return *m_MassInBlood; + return m_MassInBlood; } //----------------------------------------------------------------------------- double SESubstance::GetMassInBlood(const MassUnit& unit) const { - if (m_MassInBlood == nullptr) - return SEScalar::dNaN(); - return m_MassInBlood->GetValue(unit); + return m_MassInBlood.GetValue(unit); } //----------------------------------------------------------------------------- bool SESubstance::HasMassInTissue() const { - return (m_MassInTissue == nullptr) ? false : m_MassInTissue->IsValid(); + return m_MassInTissue.IsValid(); } //----------------------------------------------------------------------------- SEScalarMass& SESubstance::GetMassInTissue() { - if (m_MassInTissue == nullptr) - m_MassInTissue = new SEScalarMass(); - return *m_MassInTissue; + return m_MassInTissue; } //----------------------------------------------------------------------------- double SESubstance::GetMassInTissue(const MassUnit& unit) const { - if (m_MassInTissue == nullptr) - return SEScalar::dNaN(); - return m_MassInTissue->GetValue(unit); + return m_MassInTissue.GetValue(unit); } //----------------------------------------------------------------------------- bool SESubstance::HasPlasmaConcentration() const { - return (m_PlasmaConcentration == nullptr) ? false : m_PlasmaConcentration->IsValid(); + return m_PlasmaConcentration.IsValid(); } //----------------------------------------------------------------------------- SEScalarMassPerVolume& SESubstance::GetPlasmaConcentration() { - if (m_PlasmaConcentration == nullptr) - m_PlasmaConcentration = new SEScalarMassPerVolume(); - return *m_PlasmaConcentration; + return m_PlasmaConcentration; } //----------------------------------------------------------------------------- double SESubstance::GetPlasmaConcentration(const MassPerVolumeUnit& unit) const { - if (m_PlasmaConcentration == nullptr) - return SEScalar::dNaN(); - return m_PlasmaConcentration->GetValue(unit); + return m_PlasmaConcentration.GetValue(unit); } //----------------------------------------------------------------------------- bool SESubstance::HasSystemicMassCleared() const { - return (m_SystemicMassCleared == nullptr) ? false : m_SystemicMassCleared->IsValid(); + return m_SystemicMassCleared.IsValid(); } //----------------------------------------------------------------------------- SEScalarMass& SESubstance::GetSystemicMassCleared() { - if (m_SystemicMassCleared == nullptr) - m_SystemicMassCleared = new SEScalarMass(); - return *m_SystemicMassCleared; + return m_SystemicMassCleared; } //----------------------------------------------------------------------------- double SESubstance::GetSystemicMassCleared(const MassUnit& unit) const { - if (m_SystemicMassCleared == nullptr) - return SEScalar::dNaN(); - return m_SystemicMassCleared->GetValue(unit); + return m_SystemicMassCleared.GetValue(unit); } //----------------------------------------------------------------------------- bool SESubstance::HasTissueConcentration() const { - return (m_TissueConcentration == nullptr) ? false : m_TissueConcentration->IsValid(); + return m_TissueConcentration.IsValid(); } //----------------------------------------------------------------------------- SEScalarMassPerVolume& SESubstance::GetTissueConcentration() { - if (m_TissueConcentration == nullptr) - m_TissueConcentration = new SEScalarMassPerVolume(); - return *m_TissueConcentration; + return m_TissueConcentration; } //----------------------------------------------------------------------------- double SESubstance::GetTissueConcentration(const MassPerVolumeUnit& unit) const { - if (m_TissueConcentration == nullptr) - return SEScalar::dNaN(); - return m_TissueConcentration->GetValue(unit); + return m_TissueConcentration.GetValue(unit); } //----------------------------------------------------------------------------- bool SESubstance::HasAlveolarTransfer() const { - return m_AlveolarTransfer == nullptr ? false : m_AlveolarTransfer->IsValid(); + return m_def.AlveolarTransfer.IsValid(); } //----------------------------------------------------------------------------- SEScalarVolumePerTime& SESubstance::GetAlveolarTransfer() { - if (m_AlveolarTransfer == nullptr) - m_AlveolarTransfer = new SEScalarVolumePerTime(); - return *m_AlveolarTransfer; + return m_def.AlveolarTransfer; } //----------------------------------------------------------------------------- double SESubstance::GetAlveolarTransfer(const VolumePerTimeUnit& unit) const { - if (m_AlveolarTransfer == nullptr) - return SEScalar::dNaN(); - return m_AlveolarTransfer->GetValue(unit); + return m_def.AlveolarTransfer.GetValue(unit); } //----------------------------------------------------------------------------- bool SESubstance::HasDiffusingCapacity() const { - return m_DiffusingCapacity == nullptr ? false : m_DiffusingCapacity->IsValid(); + return m_def.DiffusingCapacity.IsValid(); } //----------------------------------------------------------------------------- SEScalarVolumePerTimePressure& SESubstance::GetDiffusingCapacity() { - if (m_DiffusingCapacity == nullptr) - m_DiffusingCapacity = new SEScalarVolumePerTimePressure(); - return *m_DiffusingCapacity; + return m_def.DiffusingCapacity; } //----------------------------------------------------------------------------- double SESubstance::GetDiffusingCapacity(const VolumePerTimePressureUnit& unit) const { - if (m_DiffusingCapacity == nullptr) - return SEScalar::dNaN(); - return m_DiffusingCapacity->GetValue(unit); + return m_def.DiffusingCapacity.GetValue(unit); } //----------------------------------------------------------------------------- bool SESubstance::HasEndTidalFraction() const { - return (m_EndTidalFraction == nullptr) ? false : m_EndTidalFraction->IsValid(); + return m_EndTidalFraction.IsValid(); } //----------------------------------------------------------------------------- SEScalarFraction& SESubstance::GetEndTidalFraction() { - if (m_EndTidalFraction == nullptr) - m_EndTidalFraction = new SEScalarFraction(); - return *m_EndTidalFraction; + return m_EndTidalFraction; } //----------------------------------------------------------------------------- double SESubstance::GetEndTidalFraction() const { - if (m_EndTidalFraction == nullptr) - return SEScalar::dNaN(); - return m_EndTidalFraction->GetValue(); + return m_EndTidalFraction.GetValue(); } //----------------------------------------------------------------------------- bool SESubstance::HasEndTidalPressure() const { - return (m_EndTidalPressure == nullptr) ? false : m_EndTidalPressure->IsValid(); + return m_EndTidalPressure.IsValid(); } //----------------------------------------------------------------------------- SEScalarPressure& SESubstance::GetEndTidalPressure() { - if (m_EndTidalPressure == nullptr) - m_EndTidalPressure = new SEScalarPressure(); - return *m_EndTidalPressure; + return m_EndTidalPressure; } //----------------------------------------------------------------------------- double SESubstance::GetEndTidalPressure(const PressureUnit& unit) const { - if (m_EndTidalPressure == nullptr) - return SEScalar::dNaN(); - return m_EndTidalPressure->GetValue(unit); + return m_EndTidalPressure.GetValue(unit); } //----------------------------------------------------------------------------- bool SESubstance::HasRelativeDiffusionCoefficient() const { - return (m_RelativeDiffusionCoefficient == nullptr) ? false : m_RelativeDiffusionCoefficient->IsValid(); + return m_def.RelativeDiffusionCoefficient.IsValid(); } //----------------------------------------------------------------------------- SEScalar& SESubstance::GetRelativeDiffusionCoefficient() { - if (m_RelativeDiffusionCoefficient == nullptr) - m_RelativeDiffusionCoefficient = new SEScalar(); - return *m_RelativeDiffusionCoefficient; + return m_def.RelativeDiffusionCoefficient; } //----------------------------------------------------------------------------- double SESubstance::GetRelativeDiffusionCoefficient() const { - if (m_RelativeDiffusionCoefficient == nullptr) - return SEScalar::dNaN(); - return m_RelativeDiffusionCoefficient->GetValue(); + return m_def.RelativeDiffusionCoefficient.GetValue(); } //----------------------------------------------------------------------------- bool SESubstance::HasSolubilityCoefficient() const { - return (m_SolubilityCoefficient == nullptr) ? false : m_SolubilityCoefficient->IsValid(); + return m_def.SolubilityCoefficient.IsValid(); } //----------------------------------------------------------------------------- SEScalarInversePressure& SESubstance::GetSolubilityCoefficient() { - if (m_SolubilityCoefficient == nullptr) - m_SolubilityCoefficient = new SEScalarInversePressure(); - return *m_SolubilityCoefficient; + return m_def.SolubilityCoefficient; } //----------------------------------------------------------------------------- double SESubstance::GetSolubilityCoefficient(const InversePressureUnit& unit) const { - if (m_SolubilityCoefficient == nullptr) - return SEScalar::dNaN(); - return m_SolubilityCoefficient->GetValue(unit); + return m_def.SolubilityCoefficient.GetValue(unit); } //----------------------------------------------------------------------------- bool SESubstance::HasClearance() const { - return (m_Clearance != nullptr && m_Clearance->IsValid()); + return m_Clearance.IsValid(); } //----------------------------------------------------------------------------- SESubstanceClearance& SESubstance::GetClearance() { - if (m_Clearance == nullptr) - m_Clearance = new SESubstanceClearance(GetLogger()); - return *m_Clearance; + return m_Clearance; } //----------------------------------------------------------------------------- const SESubstanceClearance* SESubstance::GetClearance() const { - return m_Clearance; + return &m_Clearance; } //----------------------------------------------------------------------------- void SESubstance::RemoveClearance() { - SAFE_DELETE(m_Clearance); + m_Clearance.Invalidate(); } //----------------------------------------------------------------------------- bool SESubstance::HasPK() const { - return (m_Pharmacokinetics != nullptr && m_Pharmacokinetics->IsValid()); + return (m_def.Pharmacokinetics.IsValid()); } //----------------------------------------------------------------------------- SESubstancePharmacokinetics& SESubstance::GetPK() { - if (m_Pharmacokinetics == nullptr) - m_Pharmacokinetics = new SESubstancePharmacokinetics(GetLogger()); - return *m_Pharmacokinetics; + return m_def.Pharmacokinetics; } //----------------------------------------------------------------------------- const SESubstancePharmacokinetics* SESubstance::GetPK() const { - return m_Pharmacokinetics; + return &m_def.Pharmacokinetics; } //----------------------------------------------------------------------------- void SESubstance::RemovePK() { - SAFE_DELETE(m_Pharmacokinetics); + m_def.Pharmacokinetics.Invalidate(); } //----------------------------------------------------------------------------- bool SESubstance::HasPD() const { - return (m_Pharmacodynamics != nullptr && m_Pharmacodynamics->IsValid()); + return (m_def.Pharmacodynamics.IsValid()); } //----------------------------------------------------------------------------- SESubstancePharmacodynamics& SESubstance::GetPD() { - if (m_Pharmacodynamics == nullptr) - m_Pharmacodynamics = new SESubstancePharmacodynamics(GetLogger()); - return *m_Pharmacodynamics; + return m_def.Pharmacodynamics; } //----------------------------------------------------------------------------- const SESubstancePharmacodynamics* SESubstance::GetPD() const { - return m_Pharmacodynamics; + return &m_def.Pharmacodynamics; } //----------------------------------------------------------------------------- void SESubstance::RemovePD() { - SAFE_DELETE(m_Pharmacodynamics); + m_def.Pharmacodynamics.Invalidate(); } //------------------------------------------------------------------------------- bool SESubstance::operator==(const SESubstance& rhs) const @@ -856,44 +781,34 @@ bool SESubstance::operator==(const SESubstance& rhs) const if (this == &rhs) return true; - bool equivilant =m_Name == rhs.m_Name - ;equivilant&= m_Classification == rhs.m_Classification - ;equivilant&= m_State == rhs.m_State - - ;equivilant&= ((m_Density && rhs.m_Density) ? m_Density->operator==(*rhs.m_Density) : m_Density == rhs.m_Density) - ;equivilant&= ((m_MolarMass && rhs.m_MolarMass) ? m_MolarMass->operator==(*rhs.m_MolarMass) : m_MolarMass == rhs.m_MolarMass) - - ;equivilant&= ((m_MaximumDiffusionFlux && rhs.m_MaximumDiffusionFlux) ? m_MaximumDiffusionFlux->operator==(*rhs.m_MaximumDiffusionFlux) : m_MaximumDiffusionFlux == rhs.m_MaximumDiffusionFlux) - ;equivilant&= ((m_MichaelisCoefficient && rhs.m_MichaelisCoefficient) ? m_MichaelisCoefficient->operator==(*rhs.m_MichaelisCoefficient) : m_MichaelisCoefficient == rhs.m_MichaelisCoefficient) - ;equivilant&= ((m_MembraneResistance && rhs.m_MembraneResistance) ? m_MembraneResistance->operator==(*rhs.m_MembraneResistance) : m_MembraneResistance == rhs.m_MembraneResistance) - - ;equivilant&= ((m_Aerosolization && rhs.m_Aerosolization) ? m_Aerosolization->operator==(*rhs.m_Aerosolization) : m_Aerosolization == rhs.m_Aerosolization) - ;equivilant&= ((m_AreaUnderCurve && rhs.m_AreaUnderCurve) ? m_AreaUnderCurve->operator==(*rhs.m_AreaUnderCurve) : m_AreaUnderCurve == rhs.m_AreaUnderCurve) - ;equivilant&= ((m_BloodConcentration && rhs.m_BloodConcentration) ? m_BloodConcentration->operator==(*rhs.m_BloodConcentration) : m_BloodConcentration == rhs.m_BloodConcentration) - ;equivilant&= ((m_EffectSiteConcentration && rhs.m_EffectSiteConcentration) ? m_EffectSiteConcentration->operator==(*rhs.m_EffectSiteConcentration) : m_EffectSiteConcentration == rhs.m_EffectSiteConcentration) - ;equivilant&= ((m_MassInBody && rhs.m_MassInBody) ? m_MassInBody->operator==(*rhs.m_MassInBody) : m_MassInBody == rhs.m_MassInBody) - ;equivilant&= ((m_MassInBlood && rhs.m_MassInBlood) ? m_MassInBlood->operator==(*rhs.m_MassInBlood) : m_MassInBlood == rhs.m_MassInBlood) - ;equivilant&= ((m_MassInTissue && rhs.m_MassInTissue) ? m_MassInTissue->operator==(*rhs.m_MassInTissue) : m_MassInTissue == rhs.m_MassInTissue) - ;equivilant&= ((m_PlasmaConcentration && rhs.m_PlasmaConcentration) ? m_PlasmaConcentration->operator==(*rhs.m_PlasmaConcentration) : m_PlasmaConcentration == rhs.m_PlasmaConcentration) - ;equivilant&= ((m_SystemicMassCleared && rhs.m_SystemicMassCleared) ? m_SystemicMassCleared->operator==(*rhs.m_SystemicMassCleared) : m_SystemicMassCleared == rhs.m_SystemicMassCleared) - ;equivilant&= ((m_TissueConcentration && rhs.m_TissueConcentration) ? m_TissueConcentration->operator==(*rhs.m_TissueConcentration) : m_TissueConcentration == rhs.m_TissueConcentration) - - ;equivilant&= ((m_AlveolarTransfer && rhs.m_AlveolarTransfer) ? m_AlveolarTransfer->operator==(*rhs.m_AlveolarTransfer) : m_AlveolarTransfer == rhs.m_AlveolarTransfer) - ;equivilant&= ((m_DiffusingCapacity && rhs.m_DiffusingCapacity) ? m_DiffusingCapacity->operator==(*rhs.m_DiffusingCapacity) : m_DiffusingCapacity == rhs.m_DiffusingCapacity) - ;equivilant&= ((m_EndTidalFraction && rhs.m_EndTidalFraction) ? m_EndTidalFraction->operator==(*rhs.m_EndTidalFraction) : m_EndTidalFraction == rhs.m_EndTidalFraction) - ;equivilant&= ((m_EndTidalPressure && rhs.m_EndTidalPressure) ? m_EndTidalPressure->operator==(*rhs.m_EndTidalPressure) : m_EndTidalPressure == rhs.m_EndTidalPressure) - ;equivilant&= ((m_RelativeDiffusionCoefficient && rhs.m_RelativeDiffusionCoefficient) ? m_RelativeDiffusionCoefficient->operator==(*rhs.m_RelativeDiffusionCoefficient) : m_RelativeDiffusionCoefficient == rhs.m_RelativeDiffusionCoefficient) - ;equivilant&= ((m_SolubilityCoefficient && rhs.m_SolubilityCoefficient) ? m_SolubilityCoefficient->operator==(*rhs.m_SolubilityCoefficient) : m_SolubilityCoefficient == rhs.m_SolubilityCoefficient) - - ;equivilant&= ((m_Clearance && rhs.m_Clearance) ? m_Clearance->operator==(*rhs.m_Clearance) : m_Clearance == rhs.m_Clearance) - ;equivilant&= ((m_Pharmacokinetics && rhs.m_Pharmacokinetics) ? m_Pharmacokinetics->operator==(*rhs.m_Pharmacokinetics) : m_Pharmacokinetics == rhs.m_Pharmacokinetics) - ;equivilant&= ((m_Pharmacodynamics && rhs.m_Pharmacodynamics) ? m_Pharmacodynamics->operator==(*rhs.m_Pharmacodynamics) : m_Pharmacodynamics == rhs.m_Pharmacodynamics) - ; + bool equivilant = m_def == rhs.m_def; +#if defined(BIOGEARS_RIGOROUS_EQUIVILANCE_CHECKS) && !defined(BIOGEARS_LINIENT_SESUBSTANCE_CHECKS) + equivilant &= m_MassInBody == rhs.m_MassInBody; + equivilant &= m_MassInBlood == rhs.m_MassInBlood; + equivilant &= m_MassInTissue == rhs.m_MassInTissue; + equivilant &= m_EndTidalFraction == rhs.m_EndTidalFraction; + equivilant &= m_EndTidalPressure == rhs.m_EndTidalPressure; + equivilant &= m_Clearance == rhs.m_Clearance; +#endif return equivilant; } -//------------------------------------------------------------------------------- bool SESubstance::operator!=(const SESubstance& rhs) const { return !(*this == rhs); } +//------------------------------------------------------------------------------- +bool SESubstance::operator==(SESubstanceDefinition const& rhs) const +{ + return this->m_def == rhs; +} +bool SESubstance::operator!=(SESubstanceDefinition const& rhs) const +{ + return !(*this == rhs); +} +//------------------------------------------------------------------------------ +SESubstanceDefinition const& SESubstance::GetDefinition() const +{ + // TODO: Refactor PTRs in all member components to simplify true Copies + return m_def; +} } diff --git a/projects/biogears/libBiogears/src/cdm/substance/SESubstanceAerosolization.cpp b/projects/biogears/libBiogears/src/cdm/substance/SESubstanceAerosolization.cpp index 044e2107b..24e83c791 100644 --- a/projects/biogears/libBiogears/src/cdm/substance/SESubstanceAerosolization.cpp +++ b/projects/biogears/libBiogears/src/cdm/substance/SESubstanceAerosolization.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Substance.h" + #include #include #include @@ -18,24 +20,33 @@ specific language governing permissions and limitations under the License. #include namespace biogears { +SESubstanceAerosolization::SESubstanceAerosolization(SESubstanceAerosolization const& obj) + : Loggable(obj.GetLogger()) + , m_BronchioleModifier(obj.m_BronchioleModifier) + , m_InflammationCoefficient(obj.m_InflammationCoefficient) + , m_ParticulateSizeDistribution(obj.m_ParticulateSizeDistribution) + +{ +} + SESubstanceAerosolization::SESubstanceAerosolization(Logger* logger) : Loggable(logger) + , m_BronchioleModifier() + , m_InflammationCoefficient() + , m_ParticulateSizeDistribution() { - m_BronchioleModifier = nullptr; - m_InflammationCoefficient = nullptr; - m_ParticulateSizeDistribution = nullptr; } //----------------------------------------------------------------------------- SESubstanceAerosolization::~SESubstanceAerosolization() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SESubstanceAerosolization::Clear() +void SESubstanceAerosolization::Invalidate() { - SAFE_DELETE(m_BronchioleModifier); - SAFE_DELETE(m_InflammationCoefficient); - SAFE_DELETE(m_ParticulateSizeDistribution); + (m_BronchioleModifier.Invalidate()); + (m_InflammationCoefficient.Invalidate()); + (m_ParticulateSizeDistribution.Invalidate()); } //----------------------------------------------------------------------------- bool SESubstanceAerosolization::IsValid() const @@ -62,99 +73,62 @@ const SEScalar* SESubstanceAerosolization::GetScalar(const std::string& name) return &GetInflammationCoefficient(); return nullptr; } -//----------------------------------------------------------------------------- -bool SESubstanceAerosolization::Load(const CDM::SubstanceAerosolizationData& in) -{ - Clear(); - GetBronchioleModifier().Load(in.BronchioleModifier()); - GetInflammationCoefficient().Load(in.InflammationCoefficient()); - GetParticulateSizeDistribution().Load(in.ParticulateSizeDistribution()); - return true; -} -//----------------------------------------------------------------------------- -CDM::SubstanceAerosolizationData* SESubstanceAerosolization::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::SubstanceAerosolizationData* data = new CDM::SubstanceAerosolizationData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SESubstanceAerosolization::Unload(CDM::SubstanceAerosolizationData& data) const -{ - if (HasBronchioleModifier()) - data.BronchioleModifier(std::unique_ptr(m_BronchioleModifier->Unload())); - if (HasInflammationCoefficient()) - data.InflammationCoefficient(std::unique_ptr(m_InflammationCoefficient->Unload())); - if (HasParticulateSizeDistribution()) - data.ParticulateSizeDistribution(std::unique_ptr(m_ParticulateSizeDistribution->Unload())); -}; + //----------------------------------------------------------------------------- bool SESubstanceAerosolization::HasBronchioleModifier() const { - return (m_BronchioleModifier == nullptr) ? false : m_BronchioleModifier->IsValid(); + return m_BronchioleModifier.IsValid(); } //----------------------------------------------------------------------------- SEScalarNeg1To1& SESubstanceAerosolization::GetBronchioleModifier() { - if (m_BronchioleModifier == nullptr) - m_BronchioleModifier = new SEScalarNeg1To1(); - return *m_BronchioleModifier; + return m_BronchioleModifier; } //----------------------------------------------------------------------------- double SESubstanceAerosolization::GetBronchioleModifier() const { - if (m_BronchioleModifier == nullptr) - return SEScalar::dNaN(); - return m_BronchioleModifier->GetValue(); + return m_BronchioleModifier.GetValue(); } //----------------------------------------------------------------------------- bool SESubstanceAerosolization::HasInflammationCoefficient() const { - return (m_InflammationCoefficient == nullptr) ? false : m_InflammationCoefficient->IsValid(); + return m_InflammationCoefficient.IsValid(); } //----------------------------------------------------------------------------- SEScalar0To1& SESubstanceAerosolization::GetInflammationCoefficient() { - if (m_InflammationCoefficient == nullptr) - m_InflammationCoefficient = new SEScalar0To1(); - return *m_InflammationCoefficient; + return m_InflammationCoefficient; } //----------------------------------------------------------------------------- double SESubstanceAerosolization::GetInflammationCoefficient() const { - if (m_InflammationCoefficient == nullptr) - return SEScalar::dNaN(); - return m_InflammationCoefficient->GetValue(); + return m_InflammationCoefficient.GetValue(); } //----------------------------------------------------------------------------- bool SESubstanceAerosolization::HasParticulateSizeDistribution() const { - return (m_ParticulateSizeDistribution == nullptr) ? false : m_ParticulateSizeDistribution->IsValid(); + return m_ParticulateSizeDistribution.IsValid(); } //----------------------------------------------------------------------------- SEHistogramFractionVsLength& SESubstanceAerosolization::GetParticulateSizeDistribution() { - if (m_ParticulateSizeDistribution == nullptr) - m_ParticulateSizeDistribution = new SEHistogramFractionVsLength(); - return *m_ParticulateSizeDistribution; + return m_ParticulateSizeDistribution; } //----------------------------------------------------------------------------- -const SEHistogramFractionVsLength* SESubstanceAerosolization::GetParticulateSizeDistribution() const +const SEHistogramFractionVsLength SESubstanceAerosolization::GetParticulateSizeDistribution() const { return m_ParticulateSizeDistribution; } //------------------------------------------------------------------------------- -bool SESubstanceAerosolization::operator==( const SESubstanceAerosolization& rhs) const +bool SESubstanceAerosolization::operator==(const SESubstanceAerosolization& rhs) const { - bool equivilant = (m_BronchioleModifier && rhs.m_BronchioleModifier) ? m_BronchioleModifier->operator==(*rhs.m_BronchioleModifier) : m_BronchioleModifier == rhs.m_BronchioleModifier; - equivilant &= (m_InflammationCoefficient && rhs.m_InflammationCoefficient) ? m_InflammationCoefficient->operator==(*rhs.m_InflammationCoefficient) : m_InflammationCoefficient == rhs.m_InflammationCoefficient; - equivilant &= (m_ParticulateSizeDistribution && rhs.m_ParticulateSizeDistribution) ? m_ParticulateSizeDistribution->operator==(*rhs.m_ParticulateSizeDistribution) : m_ParticulateSizeDistribution == rhs.m_ParticulateSizeDistribution; + bool equivilant = m_BronchioleModifier == rhs.m_BronchioleModifier; + equivilant &= m_InflammationCoefficient == rhs.m_InflammationCoefficient; + equivilant &= m_ParticulateSizeDistribution == rhs.m_ParticulateSizeDistribution; return equivilant; } //------------------------------------------------------------------------------- -bool SESubstanceAerosolization::operator!=( const SESubstanceAerosolization& rhs) const +bool SESubstanceAerosolization::operator!=(const SESubstanceAerosolization& rhs) const { return !(*this == rhs); } diff --git a/projects/biogears/libBiogears/src/cdm/substance/SESubstanceClearance.cpp b/projects/biogears/libBiogears/src/cdm/substance/SESubstanceClearance.cpp index 119ca21e7..3a82e3179 100644 --- a/projects/biogears/libBiogears/src/cdm/substance/SESubstanceClearance.cpp +++ b/projects/biogears/libBiogears/src/cdm/substance/SESubstanceClearance.cpp @@ -11,6 +11,11 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include +#include + +#include "io/cdm/Substance.h" + #include #include #include @@ -21,97 +26,154 @@ specific language governing permissions and limitations under the License. namespace biogears { SESubstanceClearance::SESubstanceClearance(Logger* logger) : Loggable(logger) -{ - m_hasSystemic = false; - m_hasCellular = false; - m_CellDeathRate = nullptr; - m_CellBirthRate = nullptr; - m_ChargeInBlood = (CDM::enumCharge::value)-1; - m_FractionExcretedInFeces = nullptr; - m_FractionExcretedInUrine = nullptr; - m_FractionMetabolizedInGut = nullptr; - m_FractionUnboundInPlasma = nullptr; - m_GlomerularFilterability = nullptr; - m_IntrinsicClearance = nullptr; - m_RenalDynamic = (RenalDynamic)-1; - m_RenalClearance = nullptr; - m_RenalReabsorptionRatio = nullptr; - m_RenalTransportMaximum = nullptr; - m_RenalFiltrationRate = nullptr; - m_RenalReabsorptionRate = nullptr; - m_RenalExcretionRate = nullptr; - m_SystemicClearance = nullptr; + , m_def() + , m_FractionExcretedInFeces() + , m_FractionExcretedInUrine() + , m_FractionMetabolizedInGut() + , m_FractionUnboundInPlasma() +{ + m_def.HasSystemic = false; + m_def.HasCellular = false; + + m_def.ChargeInBlood = SECharge::Invalid; + m_def.RenalDynamic = RenalDynamicsType::Invalid; +} +SESubstanceClearance::SESubstanceClearance(SESubstanceClearanceDefinition definition, Logger* logger) + : Loggable(logger) + , m_def(definition) + , m_FractionExcretedInFeces() + , m_FractionExcretedInUrine() + , m_FractionMetabolizedInGut() + , m_FractionUnboundInPlasma() +{ + m_def.HasSystemic = false; + m_def.HasCellular = false; + + m_def.ChargeInBlood = SECharge::Invalid; + m_def.RenalDynamic = RenalDynamicsType::Invalid; } //----------------------------------------------------------------------------- SESubstanceClearance::~SESubstanceClearance() { - Clear(); + Invalidate(); +} +SESubstanceClearance::SESubstanceClearance(SESubstanceClearance const& obj) + : m_def(obj.m_def) + , m_FractionExcretedInFeces(obj.m_FractionExcretedInFeces) + , m_FractionExcretedInUrine(obj.m_FractionExcretedInUrine) + , m_FractionMetabolizedInGut(obj.m_FractionMetabolizedInGut) + , m_FractionUnboundInPlasma(obj.m_FractionUnboundInPlasma) +{ +} +SESubstanceClearance::SESubstanceClearance(SESubstanceClearance&& obj) + : m_def(std::move(obj.m_def)) + , m_FractionExcretedInFeces(std::move(obj.m_FractionExcretedInFeces)) + , m_FractionExcretedInUrine(std::move(obj.m_FractionExcretedInUrine)) + , m_FractionMetabolizedInGut(std::move(obj.m_FractionMetabolizedInGut)) + , m_FractionUnboundInPlasma(std::move(obj.m_FractionUnboundInPlasma)) +{ +} + +SESubstanceClearance& SESubstanceClearance::operator=(SESubstanceClearance const& rhs) +{ + if (this == &rhs) + return *this; + + SESubstanceClearance temp(rhs); // use the copy constructor + std::swap(m_def, temp.m_def); + std::swap(m_FractionExcretedInFeces, temp.m_FractionExcretedInFeces); + std::swap(m_FractionExcretedInUrine, temp.m_FractionExcretedInUrine); + std::swap(m_FractionMetabolizedInGut, temp.m_FractionMetabolizedInGut); + std::swap(m_FractionUnboundInPlasma, temp.m_FractionUnboundInPlasma); + + return *this; +} +SESubstanceClearance& SESubstanceClearance::operator=(SESubstanceClearance&& rhs) +{ + if (this == &rhs) + return *this; + + SESubstanceClearance temp(std::move(rhs)); // use the move constructor + std::swap(m_def, temp.m_def); + std::swap(m_FractionExcretedInFeces, temp.m_FractionExcretedInFeces); + std::swap(m_FractionExcretedInUrine, temp.m_FractionExcretedInUrine); + std::swap(m_FractionMetabolizedInGut, temp.m_FractionMetabolizedInGut); + std::swap(m_FractionUnboundInPlasma, temp.m_FractionUnboundInPlasma); + + return *this; } //----------------------------------------------------------------------------- -void SESubstanceClearance::Clear() +void SESubstanceClearance::Invalidate() { - m_hasSystemic = false; - m_hasCellular = false; - SAFE_DELETE(m_CellDeathRate); - SAFE_DELETE(m_CellBirthRate); - m_ChargeInBlood = (CDM::enumCharge::value)-1; - SAFE_DELETE(m_FractionExcretedInFeces); - SAFE_DELETE(m_FractionExcretedInUrine); - SAFE_DELETE(m_FractionMetabolizedInGut); - SAFE_DELETE(m_FractionUnboundInPlasma); - SAFE_DELETE(m_GlomerularFilterability); - SAFE_DELETE(m_IntrinsicClearance); - m_RenalDynamic = (RenalDynamic)-1; - SAFE_DELETE(m_RenalClearance); - SAFE_DELETE(m_RenalReabsorptionRatio); - SAFE_DELETE(m_RenalTransportMaximum); - SAFE_DELETE(m_RenalFiltrationRate); - SAFE_DELETE(m_RenalReabsorptionRate); - SAFE_DELETE(m_RenalExcretionRate); - SAFE_DELETE(m_SystemicClearance); + m_def.HasSystemic = false; + m_def.HasCellular = false; + + m_def.ChargeInBlood = SECharge::Invalid; + m_FractionExcretedInFeces.Invalidate(); + m_FractionExcretedInUrine.Invalidate(); + m_FractionMetabolizedInGut.Invalidate(); + m_FractionUnboundInPlasma.Invalidate(); + m_def.GlomerularFilterability.Invalidate(); + m_def.IntrinsicClearance.Invalidate(); + m_def.RenalDynamic = RenalDynamicsType::Invalid; + m_def.RenalClearance.Invalidate(); + m_def.RenalReabsorptionRatio.Invalidate(); + m_def.RenalTransportMaximum.Invalidate(); + m_def.RenalFiltrationRate.Invalidate(); + m_def.RenalReabsorptionRate.Invalidate(); + m_def.RenalExcretionRate.Invalidate(); + m_def.SystemicClearance.Invalidate(); } //----------------------------------------------------------------------------- bool SESubstanceClearance::IsValid() const { if (HasSystemic()) { - if (!HasFractionExcretedInFeces()) - return false; - if (!HasFractionUnboundInPlasma()) - return false; - if (!HasIntrinsicClearance()) - return false; - if (!HasRenalClearance()) - return false; - if (!HasSystemicClearance()) - return false; + return HasFractionExcretedInFeces() + && HasFractionUnboundInPlasma() + && HasIntrinsicClearance() + && HasRenalClearance() + && HasSystemicClearance(); } if (HasRenalDynamic()) { - if (GetRenalDynamic() == RenalDynamic::Regulation) { - if (!HasChargeInBlood()) - return false; - if (!HasFractionUnboundInPlasma()) - return false; - if (!HasRenalReabsorptionRatio()) - return false; - if (!HasRenalTransportMaximum()) - return false; - } else if (GetRenalDynamic() == RenalDynamic::Clearance) { - if (!HasRenalClearance()) - return false; + if (GetRenalDynamic() == RenalDynamicsType::Regulation) { + return HasChargeInBlood() + && HasFractionUnboundInPlasma() + && HasRenalReabsorptionRatio() + && HasRenalTransportMaximum(); + } else if (GetRenalDynamic() == RenalDynamicsType::Clearance) { + return HasRenalClearance(); } else return false; } if (HasCellular()) { - if (!HasCellBirthRate()) - return false; - if (!HasCellDeathRate()) - return false; + return HasCellBirthRate() + && HasCellDeathRate(); } return true; } //----------------------------------------------------------------------------- +bool SESubstanceClearance::HasSystemic() const +{ + return m_def.HasSystemic; +} +//----------------------------------------------------------------------------- +void SESubstanceClearance::SetSystemic(bool b) +{ + m_def.HasSystemic = b; +} +//----------------------------------------------------------------------------- +bool SESubstanceClearance::HasCellular() const +{ + return m_def.HasCellular; +} +//----------------------------------------------------------------------------- +void SESubstanceClearance::SetCellular(bool b) +{ + m_def.HasCellular = b; +} +//----------------------------------------------------------------------------- const SEScalar* SESubstanceClearance::GetScalar(const char* name) { return GetScalar(std::string { name }); @@ -152,497 +214,345 @@ const SEScalar* SESubstanceClearance::GetScalar(const std::string& name) return nullptr; } -//----------------------------------------------------------------------------- -bool SESubstanceClearance::Load(const CDM::SubstanceClearanceData& in) -{ - Clear(); - // Make sure dups match - if (in.Systemic().present() && in.RenalDynamics().present()) { - if (in.RenalDynamics()->Clearance().present() && in.Systemic().get().RenalClearance().value() != in.RenalDynamics()->Clearance().get().value()) { - Warning("Multiple Renal Clearances specified, but not the same. RenalDynamics will override Systemic."); - } - } - if (in.Systemic().present() && in.RenalDynamics().present()) { - if (in.RenalDynamics()->Regulation().present() && in.Systemic().get().FractionUnboundInPlasma().value() != in.RenalDynamics()->Regulation().get().FractionUnboundInPlasma().value()) { - Warning("Multiple FractionUnboundInPlasma values specified, but not the same. RenalDynamics will override Systemic."); - } - } - - if (in.Systemic().present()) { - SetSystemic(true); - GetFractionExcretedInFeces().Load(in.Systemic()->FractionExcretedInFeces()); - if (in.Systemic()->FractionExcretedInUrine().present()) { - GetFractionExcretedInUrine().Load(in.Systemic()->FractionExcretedInUrine()->value()); - } - if (in.Systemic()->FractionMetabolizedInGut().present()) { - GetFractionMetabolizedInGut().Load(in.Systemic()->FractionMetabolizedInGut()->value()); - } - GetFractionUnboundInPlasma().Load(in.Systemic()->FractionUnboundInPlasma()); - GetIntrinsicClearance().Load(in.Systemic()->IntrinsicClearance()); - GetRenalClearance().Load(in.Systemic()->RenalClearance()); - GetSystemicClearance().Load(in.Systemic()->SystemicClearance()); - } - - if (in.RenalDynamics().present()) { - if (in.RenalDynamics()->Regulation().present()) { - m_RenalDynamic = RenalDynamic::Regulation; - SetChargeInBlood(in.RenalDynamics()->Regulation()->ChargeInBlood()); - GetFractionUnboundInPlasma().Load(in.RenalDynamics()->Regulation()->FractionUnboundInPlasma()); - GetRenalReabsorptionRatio().Load(in.RenalDynamics()->Regulation()->ReabsorptionRatio()); - GetRenalTransportMaximum().Load(in.RenalDynamics()->Regulation()->TransportMaximum()); - } else if (in.RenalDynamics()->Clearance().present()) { - m_RenalDynamic = RenalDynamic::Clearance; - GetRenalClearance().Load(in.RenalDynamics()->Clearance().get()); - } - - if (in.RenalDynamics()->FiltrationRate().present()) - GetRenalFiltrationRate().Load(in.RenalDynamics()->FiltrationRate().get()); - if (in.RenalDynamics()->GlomerularFilterability().present()) - GetGlomerularFilterability().Load(in.RenalDynamics()->GlomerularFilterability().get()); - if (in.RenalDynamics()->ReabsorptionRate().present()) - GetRenalReabsorptionRate().Load(in.RenalDynamics()->ReabsorptionRate().get()); - if (in.RenalDynamics()->ExcretionRate().present()) - GetRenalExcretionRate().Load(in.RenalDynamics()->ExcretionRate().get()); - } - - if (in.CellRegulation().present()) { - SetCellular(true); - GetCellBirthRate().Load(in.CellRegulation()->CellBirthRate()); - GetCellDeathRate().Load(in.CellRegulation()->CellDeathRate()); - } - - return true; -} -//----------------------------------------------------------------------------- -CDM::SubstanceClearanceData* SESubstanceClearance::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::SubstanceClearanceData* data = new CDM::SubstanceClearanceData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SESubstanceClearance::Unload(CDM::SubstanceClearanceData& data) const -{ - if (HasSystemic()) { - CDM::Systemic* sys(new CDM::Systemic()); - data.Systemic(std::unique_ptr(sys)); - - if (HasFractionExcretedInFeces()) - sys->FractionExcretedInFeces(std::unique_ptr(m_FractionExcretedInFeces->Unload())); - if (HasFractionExcretedInUrine()) - sys->FractionExcretedInUrine(std::unique_ptr(m_FractionExcretedInUrine->Unload())); - if (HasFractionMetabolizedInGut()) - sys->FractionMetabolizedInGut(std::unique_ptr(m_FractionMetabolizedInGut->Unload())); - if (HasFractionUnboundInPlasma()) - sys->FractionUnboundInPlasma(std::unique_ptr(m_FractionUnboundInPlasma->Unload())); - if (HasRenalClearance()) - sys->RenalClearance(std::unique_ptr(m_RenalClearance->Unload())); - if (HasIntrinsicClearance()) - sys->IntrinsicClearance(std::unique_ptr(m_IntrinsicClearance->Unload())); - if (HasSystemicClearance()) - sys->SystemicClearance(std::unique_ptr(m_SystemicClearance->Unload())); - } - - if (HasRenalDynamic()) { - CDM::RenalDynamics* rd(new CDM::RenalDynamics()); - data.RenalDynamics(std::unique_ptr(rd)); - - if (m_RenalDynamic == RenalDynamic::Clearance && HasRenalClearance()) - rd->Clearance(std::unique_ptr(m_RenalClearance->Unload())); - else if (m_RenalDynamic == RenalDynamic::Regulation) { - CDM::Regulation* rdr(new CDM::Regulation()); - rd->Regulation(std::unique_ptr(rdr)); - - if (HasChargeInBlood()) - rdr->ChargeInBlood(m_ChargeInBlood); - if (HasFractionUnboundInPlasma()) - rdr->FractionUnboundInPlasma(std::unique_ptr(m_FractionUnboundInPlasma->Unload())); - if (HasRenalReabsorptionRatio()) - rdr->ReabsorptionRatio(std::unique_ptr(m_RenalReabsorptionRatio->Unload())); - if (HasRenalTransportMaximum()) - rdr->TransportMaximum(std::unique_ptr(m_RenalTransportMaximum->Unload())); - } - if (HasGlomerularFilterability()) - rd->GlomerularFilterability(std::unique_ptr(m_GlomerularFilterability->Unload())); - if (HasRenalFiltrationRate()) - rd->FiltrationRate(std::unique_ptr(m_RenalFiltrationRate->Unload())); - if (HasRenalReabsorptionRate()) - rd->ReabsorptionRate(std::unique_ptr(m_RenalReabsorptionRate->Unload())); - if (HasRenalExcretionRate()) - rd->ExcretionRate(std::unique_ptr(m_RenalExcretionRate->Unload())); - } - - if (HasCellular()) { - CDM::CellRegulation* cell(new CDM::CellRegulation()); - data.CellRegulation(std::unique_ptr(cell)); - - if (HasCellBirthRate()) - cell->CellBirthRate(std::unique_ptr(m_CellBirthRate->Unload())); - if (HasCellDeathRate()) - cell->CellDeathRate(std::unique_ptr(m_CellDeathRate->Unload())); - } -}; //----------------------------------------------------------------------------- bool SESubstanceClearance::HasCellBirthRate() const { - return (m_CellBirthRate == nullptr) ? false : m_CellBirthRate->IsValid(); + return m_def.CellBirthRate.IsValid(); } //----------------------------------------------------------------------------- SEScalarFrequency& SESubstanceClearance::GetCellBirthRate() { - if (m_CellBirthRate == nullptr) - m_hasCellular = true; - m_CellBirthRate = new SEScalarFrequency(); - return *m_CellBirthRate; + return m_def.CellBirthRate; } //----------------------------------------------------------------------------- double SESubstanceClearance::GetCellBirthRate(const FrequencyUnit& unit) const { - if (m_CellBirthRate == nullptr) - return SEScalar::dNaN(); - return m_CellBirthRate->GetValue(unit); + return m_def.CellBirthRate.GetValue(unit); } //----------------------------------------------------------------------------- bool SESubstanceClearance::HasCellDeathRate() const { - return (m_CellDeathRate == nullptr) ? false : m_CellDeathRate->IsValid(); + return m_def.CellDeathRate.IsValid(); } //----------------------------------------------------------------------------- SEScalarFrequency& SESubstanceClearance::GetCellDeathRate() { - if (m_CellDeathRate == nullptr) - m_hasCellular = true; - m_CellDeathRate = new SEScalarFrequency(); - return *m_CellDeathRate; + m_def.HasCellular = true; + return m_def.CellDeathRate; } //----------------------------------------------------------------------------- double SESubstanceClearance::GetCellDeathRate(const FrequencyUnit& unit) const { - if (m_CellDeathRate == nullptr) - return SEScalar::dNaN(); - return m_CellDeathRate->GetValue(unit); + return m_def.CellDeathRate.GetValue(unit); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -CDM::enumCharge::value SESubstanceClearance::GetChargeInBlood() const +SECharge SESubstanceClearance::GetChargeInBlood() const { - return m_ChargeInBlood; + return m_def.ChargeInBlood; } //----------------------------------------------------------------------------- -void SESubstanceClearance::SetChargeInBlood(CDM::enumCharge::value c) +void SESubstanceClearance::SetChargeInBlood(SECharge c) { - m_ChargeInBlood = c; + m_def.ChargeInBlood = c; } //----------------------------------------------------------------------------- bool SESubstanceClearance::HasChargeInBlood() const { - return m_ChargeInBlood == ((CDM::enumCharge::value)-1) ? false : true; + return m_def.ChargeInBlood == SECharge::Invalid ? false : true; } //----------------------------------------------------------------------------- void SESubstanceClearance::InvalidateChargeInBlood() { - m_ChargeInBlood = (CDM::enumCharge::value)-1; + m_def.ChargeInBlood = (SECharge)-1; } //----------------------------------------------------------------------------- bool SESubstanceClearance::HasFractionExcretedInFeces() const { - return (m_FractionExcretedInFeces == nullptr) ? false : m_FractionExcretedInFeces->IsValid(); + return m_FractionExcretedInFeces.IsValid(); } //----------------------------------------------------------------------------- SEScalarFraction& SESubstanceClearance::GetFractionExcretedInFeces() { - if (m_FractionExcretedInFeces == nullptr) - m_FractionExcretedInFeces = new SEScalarFraction(); - return *m_FractionExcretedInFeces; + return m_FractionExcretedInFeces; } //----------------------------------------------------------------------------- double SESubstanceClearance::GetFractionExcretedInFeces() const { - if (m_FractionExcretedInFeces == nullptr) - return SEScalar::dNaN(); - return m_FractionExcretedInFeces->GetValue(); + return m_FractionExcretedInFeces.GetValue(); } //----------------------------------------------------------------------------- bool SESubstanceClearance::HasFractionExcretedInUrine() const { - return (m_FractionExcretedInUrine == nullptr) ? false : m_FractionExcretedInUrine->IsValid(); + return m_FractionExcretedInUrine.IsValid(); } //----------------------------------------------------------------------------- SEScalarFraction& SESubstanceClearance::GetFractionExcretedInUrine() { - if (m_FractionExcretedInUrine == nullptr) - m_FractionExcretedInUrine = new SEScalarFraction(); - return *m_FractionExcretedInUrine; + return m_FractionExcretedInUrine; } //----------------------------------------------------------------------------- double SESubstanceClearance::GetFractionExcretedInUrine() const { - if (m_FractionExcretedInUrine == nullptr) - return SEScalar::dNaN(); - return m_FractionExcretedInUrine->GetValue(); + + return m_FractionExcretedInUrine.GetValue(); } //----------------------------------------------------------------------------- bool SESubstanceClearance::HasFractionMetabolizedInGut() const { - return (m_FractionMetabolizedInGut == nullptr) ? false : m_FractionMetabolizedInGut->IsValid(); + return m_FractionMetabolizedInGut.IsValid(); } //----------------------------------------------------------------------------- SEScalarFraction& SESubstanceClearance::GetFractionMetabolizedInGut() { - if (m_FractionMetabolizedInGut == nullptr) - m_FractionMetabolizedInGut = new SEScalarFraction(); - return *m_FractionMetabolizedInGut; + return m_FractionMetabolizedInGut; } //----------------------------------------------------------------------------- double SESubstanceClearance::GetFractionMetabolizedInGut() const { - if (m_FractionMetabolizedInGut == nullptr) - return SEScalar::dNaN(); - return m_FractionMetabolizedInGut->GetValue(); + + return m_FractionMetabolizedInGut.GetValue(); } //----------------------------------------------------------------------------- bool SESubstanceClearance::HasFractionUnboundInPlasma() const { - return (m_FractionUnboundInPlasma == nullptr) ? false : m_FractionUnboundInPlasma->IsValid(); + return m_FractionUnboundInPlasma.IsValid(); } //----------------------------------------------------------------------------- SEScalarFraction& SESubstanceClearance::GetFractionUnboundInPlasma() { - if (m_FractionUnboundInPlasma == nullptr) - m_FractionUnboundInPlasma = new SEScalarFraction(); - return *m_FractionUnboundInPlasma; + + return m_FractionUnboundInPlasma; } //----------------------------------------------------------------------------- double SESubstanceClearance::GetFractionUnboundInPlasma() const { - if (m_FractionUnboundInPlasma == nullptr) - return SEScalar::dNaN(); - return m_FractionUnboundInPlasma->GetValue(); + return m_FractionUnboundInPlasma.GetValue(); } //----------------------------------------------------------------------------- bool SESubstanceClearance::HasIntrinsicClearance() const { - return (m_IntrinsicClearance == nullptr) ? false : m_IntrinsicClearance->IsValid(); + return m_def.IntrinsicClearance.IsValid(); } //----------------------------------------------------------------------------- SEScalarVolumePerTimeMass& SESubstanceClearance::GetIntrinsicClearance() { - if (m_IntrinsicClearance == nullptr) - m_IntrinsicClearance = new SEScalarVolumePerTimeMass(); - return *m_IntrinsicClearance; + return m_def.IntrinsicClearance; } //----------------------------------------------------------------------------- double SESubstanceClearance::GetIntrinsicClearance(const VolumePerTimeMassUnit& unit) const { - if (m_IntrinsicClearance == nullptr) - return SEScalar::dNaN(); - return m_IntrinsicClearance->GetValue(unit); + + return m_def.IntrinsicClearance.GetValue(unit); } //----------------------------------------------------------------------------- -RenalDynamic SESubstanceClearance::GetRenalDynamic() const +RenalDynamicsType SESubstanceClearance::GetRenalDynamic() const { - return m_RenalDynamic; + return m_def.RenalDynamic; } //----------------------------------------------------------------------------- -void SESubstanceClearance::SetRenalDynamic(RenalDynamic d) +void SESubstanceClearance::SetRenalDynamic(RenalDynamicsType d) { - m_RenalDynamic = d; + m_def.RenalDynamic = d; } //----------------------------------------------------------------------------- bool SESubstanceClearance::HasRenalDynamic() const { - return m_RenalDynamic == ((RenalDynamic)-1) ? false : true; + return m_def.RenalDynamic == ((RenalDynamicsType)-1) ? false : true; } //----------------------------------------------------------------------------- void SESubstanceClearance::InvalidateRenalDynamic() { - m_RenalDynamic = (RenalDynamic)-1; + m_def.RenalDynamic = (RenalDynamicsType)-1; } //----------------------------------------------------------------------------- bool SESubstanceClearance::HasRenalClearance() const { - return (m_RenalClearance == nullptr) ? false : m_RenalClearance->IsValid(); + return m_def.RenalClearance.IsValid(); } //----------------------------------------------------------------------------- SEScalarVolumePerTimeMass& SESubstanceClearance::GetRenalClearance() { - if (m_RenalClearance == nullptr) - m_RenalClearance = new SEScalarVolumePerTimeMass(); - return *m_RenalClearance; + return m_def.RenalClearance; } //----------------------------------------------------------------------------- double SESubstanceClearance::GetRenalClearance(const VolumePerTimeMassUnit& unit) const { - if (m_RenalClearance == nullptr) - return SEScalar::dNaN(); - return m_RenalClearance->GetValue(unit); + return m_def.RenalClearance.GetValue(unit); } //----------------------------------------------------------------------------- bool SESubstanceClearance::HasRenalReabsorptionRatio() const { - return (m_RenalReabsorptionRatio == nullptr) ? false : m_RenalReabsorptionRatio->IsValid(); + return m_def.RenalReabsorptionRatio.IsValid(); } //----------------------------------------------------------------------------- SEScalar& SESubstanceClearance::GetRenalReabsorptionRatio() { - if (m_RenalReabsorptionRatio == nullptr) - m_RenalReabsorptionRatio = new SEScalar(); - return *m_RenalReabsorptionRatio; + return m_def.RenalReabsorptionRatio; } //----------------------------------------------------------------------------- double SESubstanceClearance::GetRenalReabsorptionRatio() const { - if (m_RenalReabsorptionRatio == nullptr) - return SEScalar::dNaN(); - return m_RenalReabsorptionRatio->GetValue(); + + return m_def.RenalReabsorptionRatio.GetValue(); } //----------------------------------------------------------------------------- bool SESubstanceClearance::HasRenalTransportMaximum() const { - return (m_RenalTransportMaximum == nullptr) ? false : m_RenalTransportMaximum->IsValid(); + return m_def.RenalTransportMaximum.IsValid(); } //----------------------------------------------------------------------------- SEScalarMassPerTime& SESubstanceClearance::GetRenalTransportMaximum() { - if (m_RenalTransportMaximum == nullptr) - m_RenalTransportMaximum = new SEScalarMassPerTime(); - return *m_RenalTransportMaximum; + return m_def.RenalTransportMaximum; } //----------------------------------------------------------------------------- double SESubstanceClearance::GetRenalTransportMaximum(const MassPerTimeUnit& unit) const { - if (m_RenalTransportMaximum == nullptr) - return SEScalar::dNaN(); - return m_RenalTransportMaximum->GetValue(unit); + + return m_def.RenalTransportMaximum.GetValue(unit); } //----------------------------------------------------------------------------- bool SESubstanceClearance::HasRenalFiltrationRate() const { - return (m_RenalFiltrationRate == nullptr) ? false : m_RenalFiltrationRate->IsValid(); + return m_def.RenalFiltrationRate.IsValid(); } //----------------------------------------------------------------------------- SEScalarMassPerTime& SESubstanceClearance::GetRenalFiltrationRate() { - if (m_RenalFiltrationRate == nullptr) - m_RenalFiltrationRate = new SEScalarMassPerTime(); - return *m_RenalFiltrationRate; + return m_def.RenalFiltrationRate; } //----------------------------------------------------------------------------- double SESubstanceClearance::GetRenalFiltrationRate(const MassPerTimeUnit& unit) const { - if (m_RenalFiltrationRate == nullptr) - return SEScalar::dNaN(); - return m_RenalFiltrationRate->GetValue(unit); + + return m_def.RenalFiltrationRate.GetValue(unit); } //----------------------------------------------------------------------------- bool SESubstanceClearance::HasRenalReabsorptionRate() const { - return (m_RenalReabsorptionRate == nullptr) ? false : m_RenalReabsorptionRate->IsValid(); + return m_def.RenalReabsorptionRate.IsValid(); } //----------------------------------------------------------------------------- SEScalarMassPerTime& SESubstanceClearance::GetRenalReabsorptionRate() { - if (m_RenalReabsorptionRate == nullptr) - m_RenalReabsorptionRate = new SEScalarMassPerTime(); - return *m_RenalReabsorptionRate; + return m_def.RenalReabsorptionRate; } //----------------------------------------------------------------------------- double SESubstanceClearance::GetRenalReabsorptionRate(const MassPerTimeUnit& unit) const { - if (m_RenalReabsorptionRate == nullptr) - return SEScalar::dNaN(); - return m_RenalReabsorptionRate->GetValue(unit); + + return m_def.RenalReabsorptionRate.GetValue(unit); } //----------------------------------------------------------------------------- bool SESubstanceClearance::HasRenalExcretionRate() const { - return (m_RenalExcretionRate == nullptr) ? false : m_RenalExcretionRate->IsValid(); + return m_def.RenalExcretionRate.IsValid(); } //----------------------------------------------------------------------------- SEScalarMassPerTime& SESubstanceClearance::GetRenalExcretionRate() { - if (m_RenalExcretionRate == nullptr) - m_RenalExcretionRate = new SEScalarMassPerTime(); - return *m_RenalExcretionRate; + return m_def.RenalExcretionRate; } //----------------------------------------------------------------------------- double SESubstanceClearance::GetRenalExcretionRate(const MassPerTimeUnit& unit) const { - if (m_RenalExcretionRate == nullptr) - return SEScalar::dNaN(); - return m_RenalExcretionRate->GetValue(unit); + + return m_def.RenalExcretionRate.GetValue(unit); } //----------------------------------------------------------------------------- bool SESubstanceClearance::HasGlomerularFilterability() const { - return (m_GlomerularFilterability == nullptr) ? false : m_GlomerularFilterability->IsValid(); + return m_def.GlomerularFilterability.IsValid(); } //----------------------------------------------------------------------------- SEScalar& SESubstanceClearance::GetGlomerularFilterability() { - if (m_GlomerularFilterability == nullptr) - m_GlomerularFilterability = new SEScalar(); - return *m_GlomerularFilterability; + return m_def.GlomerularFilterability; } //----------------------------------------------------------------------------- double SESubstanceClearance::GetGlomerularFilterability() const { - if (m_GlomerularFilterability == nullptr) - return SEScalar::dNaN(); - return m_GlomerularFilterability->GetValue(); + + return m_def.GlomerularFilterability.GetValue(); } //----------------------------------------------------------------------------- bool SESubstanceClearance::HasSystemicClearance() const { - return (m_SystemicClearance == nullptr) ? false : m_SystemicClearance->IsValid(); + return m_def.SystemicClearance.IsValid(); } //----------------------------------------------------------------------------- SEScalarVolumePerTimeMass& SESubstanceClearance::GetSystemicClearance() { - if (m_SystemicClearance == nullptr) - m_SystemicClearance = new SEScalarVolumePerTimeMass(); - return *m_SystemicClearance; + + return m_def.SystemicClearance; } //----------------------------------------------------------------------------- double SESubstanceClearance::GetSystemicClearance(const VolumePerTimeMassUnit& unit) const { - if (m_SystemicClearance == nullptr) - return SEScalar::dNaN(); - return m_SystemicClearance->GetValue(unit); + + return m_def.SystemicClearance.GetValue(unit); } //------------------------------------------------------------------------------- -bool SESubstanceClearance::operator==( const SESubstanceClearance& rhs) const -{ - bool equivilant = m_hasSystemic == rhs.m_hasSystemic; - equivilant &= m_hasCellular == rhs.m_hasCellular; - equivilant &= (m_CellBirthRate && rhs.m_CellBirthRate) ? m_CellBirthRate->operator==(*rhs.m_CellBirthRate) : m_CellBirthRate == rhs.m_CellBirthRate; - equivilant &= (m_CellDeathRate && rhs.m_CellDeathRate) ? m_CellDeathRate->operator==(*rhs.m_CellDeathRate) : m_CellDeathRate == rhs.m_CellDeathRate; - - equivilant &= m_ChargeInBlood == rhs.m_ChargeInBlood; - - equivilant &= (m_FractionExcretedInFeces && rhs.m_FractionExcretedInFeces) ? m_FractionExcretedInFeces->operator==(*rhs.m_FractionExcretedInFeces) : m_FractionExcretedInFeces == rhs.m_FractionExcretedInFeces; - equivilant &= (m_FractionExcretedInUrine && rhs.m_FractionExcretedInUrine) ? m_FractionExcretedInUrine->operator==(*rhs.m_FractionExcretedInUrine) : m_FractionExcretedInUrine == rhs.m_FractionExcretedInUrine; - equivilant &= (m_FractionMetabolizedInGut && rhs.m_FractionMetabolizedInGut) ? m_FractionMetabolizedInGut->operator==(*rhs.m_FractionMetabolizedInGut) : m_FractionMetabolizedInGut == rhs.m_FractionMetabolizedInGut; - equivilant &= (m_FractionUnboundInPlasma && rhs.m_FractionUnboundInPlasma) ? m_FractionUnboundInPlasma->operator==(*rhs.m_FractionUnboundInPlasma) : m_FractionUnboundInPlasma == rhs.m_FractionUnboundInPlasma; - equivilant &= (m_IntrinsicClearance && rhs.m_IntrinsicClearance) ? m_IntrinsicClearance->operator==(*rhs.m_IntrinsicClearance) : m_IntrinsicClearance == rhs.m_IntrinsicClearance; - equivilant &= m_RenalDynamic == rhs.m_RenalDynamic; - equivilant &= (m_RenalClearance && rhs.m_RenalClearance) ? m_RenalClearance->operator==(*rhs.m_RenalClearance) : m_RenalClearance == rhs.m_RenalClearance; - equivilant &= (m_RenalReabsorptionRatio && rhs.m_RenalReabsorptionRatio) ? m_RenalReabsorptionRatio->operator==(*rhs.m_RenalReabsorptionRatio) : m_RenalReabsorptionRatio == rhs.m_RenalReabsorptionRatio; - equivilant &= (m_RenalTransportMaximum && rhs.m_RenalTransportMaximum) ? m_RenalTransportMaximum->operator==(*rhs.m_RenalTransportMaximum) : m_RenalTransportMaximum == rhs.m_RenalTransportMaximum; - equivilant &= (m_RenalFiltrationRate && rhs.m_RenalFiltrationRate) ? m_RenalFiltrationRate->operator==(*rhs.m_RenalFiltrationRate) : m_RenalFiltrationRate == rhs.m_RenalFiltrationRate; - equivilant &= (m_RenalReabsorptionRate && rhs.m_RenalReabsorptionRate) ? m_RenalReabsorptionRate->operator==(*rhs.m_RenalReabsorptionRate) : m_RenalReabsorptionRate == rhs.m_RenalReabsorptionRate; - equivilant &= (m_RenalExcretionRate && rhs.m_RenalExcretionRate) ? m_RenalExcretionRate->operator==(*rhs.m_RenalExcretionRate) : m_RenalExcretionRate == rhs.m_RenalExcretionRate; - equivilant &= (m_GlomerularFilterability && rhs.m_GlomerularFilterability) ? m_GlomerularFilterability->operator==(*rhs.m_GlomerularFilterability) : m_GlomerularFilterability == rhs.m_GlomerularFilterability; - equivilant &= (m_SystemicClearance && rhs.m_SystemicClearance) ? m_SystemicClearance->operator==(*rhs.m_SystemicClearance) : m_SystemicClearance == rhs.m_SystemicClearance; +bool SESubstanceClearance::operator==(const SESubstanceClearance& rhs) const +{ + bool equivilant = m_def.HasSystemic == rhs.m_def.HasSystemic; + equivilant &= m_def.HasCellular == rhs.m_def.HasCellular; + equivilant &= m_def.CellBirthRate == rhs.m_def.CellBirthRate; + equivilant &= m_def.CellDeathRate == rhs.m_def.CellDeathRate; + + equivilant &= m_def.ChargeInBlood == rhs.m_def.ChargeInBlood; + + equivilant &= m_FractionExcretedInFeces == rhs.m_FractionExcretedInFeces; + equivilant &= m_FractionExcretedInUrine == rhs.m_FractionExcretedInUrine; + equivilant &= m_FractionMetabolizedInGut == rhs.m_FractionMetabolizedInGut; + equivilant &= m_FractionUnboundInPlasma == rhs.m_FractionUnboundInPlasma; + equivilant &= m_def.IntrinsicClearance == rhs.m_def.IntrinsicClearance; + equivilant &= m_def.RenalDynamic == rhs.m_def.RenalDynamic; + equivilant &= m_def.RenalClearance == rhs.m_def.RenalClearance; + equivilant &= m_def.RenalReabsorptionRatio == rhs.m_def.RenalReabsorptionRatio; + equivilant &= m_def.RenalTransportMaximum == rhs.m_def.RenalTransportMaximum; + equivilant &= m_def.RenalFiltrationRate == rhs.m_def.RenalFiltrationRate; + equivilant &= m_def.RenalReabsorptionRate == rhs.m_def.RenalReabsorptionRate; + equivilant &= m_def.RenalExcretionRate == rhs.m_def.RenalExcretionRate; + equivilant &= m_def.GlomerularFilterability == rhs.m_def.GlomerularFilterability; + equivilant &= m_def.SystemicClearance == rhs.m_def.SystemicClearance; return equivilant; } +bool SESubstanceClearance::operator!=(const SESubstanceClearance& rhs) const +{ + return !(*this == rhs); +} +//------------------------------------------------------------------------------- //------------------------------------------------------------------------------- -bool SESubstanceClearance::operator!=( const SESubstanceClearance& rhs) const +bool SESubstanceClearanceDefinition::operator==(SESubstanceClearanceDefinition const& rhs) const +{ + if (this == &rhs) + return true; + + return (HasCellular == rhs.HasCellular + && HasCellular == rhs.HasCellular + && CellBirthRate == rhs.CellBirthRate + && CellDeathRate == rhs.CellDeathRate + + && ChargeInBlood == rhs.ChargeInBlood + + && IntrinsicClearance == rhs.IntrinsicClearance + && RenalDynamic == rhs.RenalDynamic + && RenalClearance == rhs.RenalClearance + && RenalReabsorptionRatio == rhs.RenalReabsorptionRatio + && RenalTransportMaximum == rhs.RenalTransportMaximum + && RenalFiltrationRate == rhs.RenalFiltrationRate + && RenalReabsorptionRate == rhs.RenalReabsorptionRate + && RenalExcretionRate == rhs.RenalExcretionRate + && GlomerularFilterability == rhs.GlomerularFilterability + && SystemicClearance == rhs.SystemicClearance); +} +bool SESubstanceClearanceDefinition::operator!=(SESubstanceClearanceDefinition const& rhs) const { return !(*this == rhs); } +//------------------------------------------------------------------------------- } diff --git a/projects/biogears/libBiogears/src/cdm/substance/SESubstanceCompound.cpp b/projects/biogears/libBiogears/src/cdm/substance/SESubstanceCompound.cpp index 1a1f5bba6..869ffc35a 100644 --- a/projects/biogears/libBiogears/src/cdm/substance/SESubstanceCompound.cpp +++ b/projects/biogears/libBiogears/src/cdm/substance/SESubstanceCompound.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Substance.h" + #include #include #include @@ -19,7 +21,7 @@ namespace biogears { SESubstanceCompound::SESubstanceCompound(const std::string& name, Logger* logger) : Loggable(logger) , m_Name(name) - , m_Classification((CDM::enumSubstanceClass::value)-1) + , m_Classification(SESubstanceClass::Invalid) { } SESubstanceCompound::SESubstanceCompound(const char* name, Logger* logger) @@ -33,7 +35,7 @@ SESubstanceCompound::SESubstanceCompound(Logger* logger) //----------------------------------------------------------------------------- SESubstanceCompound::~SESubstanceCompound() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- std::unique_ptr SESubstanceCompound::make_unique(const std::string& name, Logger* logger) @@ -41,61 +43,12 @@ std::unique_ptr SESubstanceCompound::make_unique(const std: return std::make_unique(name, logger); } //----------------------------------------------------------------------------- -void SESubstanceCompound::Clear() +void SESubstanceCompound::Invalidate() { m_Name = ""; - m_Classification = (CDM::enumSubstanceClass::value)-1; + m_Classification = (SESubstanceClass)-1; } -//----------------------------------------------------------------------------- -bool SESubstanceCompound::Load(const CDM::SubstanceCompoundData& in, const SESubstanceManager& subMgr) -{ - Clear(); - m_Name = in.Name(); - if (in.Classification().present()) - m_Classification = in.Classification().get(); - if (in.BloodRHFactor().present()) - m_RhFactor = in.BloodRHFactor().get(); - - std::string err; - SESubstance* substance = nullptr; - CDM::SubstanceConcentrationData* ccData; - for (unsigned int i = 0; i < in.Component().size(); i++) { - ccData = (CDM::SubstanceConcentrationData*)&in.Component().at(i); - substance = subMgr.GetSubstance(ccData->Name()); - if (substance == nullptr) { - /// \error Could not load find substance compound component for specified substance - err = "Could not load find substance compound component : "; - err += ccData->Name(); - Error(err, "SESubstanceCompound::Load"); - return false; - } - m_Components.emplace_back(*substance); - m_Components.back().Load(*ccData); - } - return true; -} -//----------------------------------------------------------------------------- -CDM::SubstanceCompoundData* SESubstanceCompound::Unload() const -{ - CDM::SubstanceCompoundData* data = new CDM::SubstanceCompoundData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SESubstanceCompound::Unload(CDM::SubstanceCompoundData& data) const -{ - if (HasName()) - data.Name(m_Name); - if (HasClassification()) - data.Classification(m_Classification); - if (HasRhFactor()) - data.BloodRHFactor(m_RhFactor); - - for (auto& component : m_Components) { - data.Component().push_back(*component.Unload()); - } -}; //----------------------------------------------------------------------------- std::string SESubstanceCompound::GetName() const { @@ -127,24 +80,24 @@ void SESubstanceCompound::InvalidateName() m_Name = ""; } //----------------------------------------------------------------------------- -CDM::enumSubstanceClass::value SESubstanceCompound::GetClassification() const +SESubstanceClass SESubstanceCompound::GetClassification() const { return m_Classification; } //----------------------------------------------------------------------------- -void SESubstanceCompound::SetClassification(CDM::enumSubstanceClass::value subClass) +void SESubstanceCompound::SetClassification(SESubstanceClass subClass) { m_Classification = subClass; } //----------------------------------------------------------------------------- bool SESubstanceCompound::HasClassification() const { - return m_Classification == ((CDM::enumSubstanceClass::value)-1) ? false : true; + return m_Classification == SESubstanceClass::Invalid ? false : true; } //----------------------------------------------------------------------------- void SESubstanceCompound::InvalidateClassification() { - m_Classification = (CDM::enumSubstanceClass::value)-1; + m_Classification = (SESubstanceClass)-1; } //----------------------------------------------------------------------------- bool SESubstanceCompound::GetRhFactor() const @@ -170,7 +123,7 @@ bool SESubstanceCompound::HasComponent() const bool SESubstanceCompound::HasComponent(const SESubstance& substance) const { for (auto const& q : m_Components) { - if (&substance == &q.GetSubstance()) { + if (substance == q.GetSubstance()) { return true; } } @@ -191,21 +144,39 @@ const std::vector SESubstanceCompound::GetComponents() return cCompounds; } //----------------------------------------------------------------------------- -SESubstanceConcentration& SESubstanceCompound::GetComponent(SESubstance& substance) +SESubstanceConcentration& SESubstanceCompound::GetComponent(SESubstance const& substance) +{ + for (auto& sq : m_Components) { + if (substance == sq.GetSubstance()) + return sq; + } + m_Components.emplace_back(substance.GetDefinition(), 0, MassPerVolumeUnit::ug_Per_mL); + return m_Components.back(); +} +//----------------------------------------------------------------------------- +SESubstanceConcentration SESubstanceCompound::GetComponent(SESubstance const& substance) const +{ + for (auto& sq : m_Components) { + if (substance == sq.GetSubstance()) + return sq; + } + throw CommonDataModelException(); +} +//----------------------------------------------------------------------------- +SESubstanceConcentration& SESubstanceCompound::GetComponent(SESubstanceDefinition const& substance) { for (auto& sq : m_Components) { - if (&substance == &sq.GetSubstance()) + if (substance == sq.GetSubstance()) return sq; } - // auto concentration = SESubstanceConcentration { substance, 0, MassPerVolumeUnit::ug_Per_mL }; m_Components.emplace_back(substance, 0, MassPerVolumeUnit::ug_Per_mL); return m_Components.back(); } //----------------------------------------------------------------------------- -const SESubstanceConcentration SESubstanceCompound::GetComponent(SESubstance& substance) const +SESubstanceConcentration SESubstanceCompound::GetComponent(SESubstanceDefinition const& substance) const { for (auto& sq : m_Components) { - if (&substance == &sq.GetSubstance()) + if (substance == sq.GetSubstance()) return sq; } throw CommonDataModelException(); @@ -215,7 +186,7 @@ void SESubstanceCompound::RemoveComponent(const SESubstance& substance) { unsigned int i = 0; for (auto& sq : m_Components) { - if (&substance == &sq.GetSubstance()) { + if (substance == sq.GetSubstance()) { m_Components.erase(m_Components.begin() + i); } i++; diff --git a/projects/biogears/libBiogears/src/cdm/substance/SESubstanceConcentration.cpp b/projects/biogears/libBiogears/src/cdm/substance/SESubstanceConcentration.cpp index f0f14fcd5..bbcbda7d7 100644 --- a/projects/biogears/libBiogears/src/cdm/substance/SESubstanceConcentration.cpp +++ b/projects/biogears/libBiogears/src/cdm/substance/SESubstanceConcentration.cpp @@ -11,65 +11,51 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Substance.h" + #include #include #include namespace biogears { -SESubstanceConcentration::SESubstanceConcentration(SESubstance const& substance) - : Loggable(substance.GetLogger()) - , m_Substance(&substance) +SESubstanceConcentration::SESubstanceConcentration(SESubstanceDefinition substance) + : Loggable(substance.Aerosolization.GetLogger()) + , m_Substance(substance) { - } //------------------------------------------------------------------------------- -SESubstanceConcentration::SESubstanceConcentration(SESubstance const& substance, SEScalarMassPerVolume const& concentration) - : Loggable(substance.GetLogger()) - , m_Substance(&substance) +SESubstanceConcentration::SESubstanceConcentration(SESubstanceDefinition substance, SEScalarMassPerVolume const& concentration) + : Loggable(substance.Aerosolization.GetLogger()) + , m_Substance(substance) , m_Concentration(concentration) { } //------------------------------------------------------------------------------- -SESubstanceConcentration::SESubstanceConcentration(SESubstance const& substance, double concentration, const MassPerVolumeUnit& unit) - : Loggable(substance.GetLogger()) - , m_Substance(&substance) +SESubstanceConcentration::SESubstanceConcentration(SESubstanceDefinition substance, double concentration, const MassPerVolumeUnit& unit) + : Loggable(substance.Aerosolization.GetLogger()) + , m_Substance(substance) , m_Concentration(concentration, unit) { } //------------------------------------------------------------------------------- SESubstanceConcentration::~SESubstanceConcentration() { - Clear(); -} -//------------------------------------------------------------------------------- -void SESubstanceConcentration::Clear() -{ - m_Concentration.Clear(); -} -//------------------------------------------------------------------------------- -bool SESubstanceConcentration::Load(const CDM::SubstanceConcentrationData& in) -{ - Clear(); - GetConcentration().Load(in.Concentration()); - return true; } //------------------------------------------------------------------------------- -CDM::SubstanceConcentrationData* SESubstanceConcentration::Unload() const +void SESubstanceConcentration::Invalidate() { - CDM::SubstanceConcentrationData* data = new CDM::SubstanceConcentrationData(); - Unload(*data); - return data; + m_Concentration.Invalidate(); } + //------------------------------------------------------------------------------- -void SESubstanceConcentration::Unload(CDM::SubstanceConcentrationData& data) const +bool SESubstanceConcentration::HasConcentration() const { - data.Name(m_Substance->GetName()); - data.Concentration(*m_Concentration.Unload()); + return m_Concentration.IsValid(); } //------------------------------------------------------------------------------- -bool SESubstanceConcentration::HasConcentration() const +SEScalarMassPerVolume SESubstanceConcentration::GetConcentration() const { - return m_Concentration.IsValid(); + return m_Concentration; } //------------------------------------------------------------------------------- SEScalarMassPerVolume& SESubstanceConcentration::GetConcentration() @@ -82,10 +68,11 @@ double SESubstanceConcentration::GetConcentration(const MassPerVolumeUnit& unit) return m_Concentration.GetValue(unit); } //------------------------------------------------------------------------------- -SESubstance& SESubstanceConcentration::GetSubstance() const +SESubstanceDefinition const& SESubstanceConcentration::GetSubstance() const { - return const_cast(*m_Substance); + return m_Substance; } + //------------------------------------------------------------------------------- bool SESubstanceConcentration::operator==(SESubstanceConcentration const& rhs) const { diff --git a/projects/biogears/libBiogears/src/cdm/substance/SESubstanceFraction.cpp b/projects/biogears/libBiogears/src/cdm/substance/SESubstanceFraction.cpp index 6e6e05e22..6f98f35d5 100644 --- a/projects/biogears/libBiogears/src/cdm/substance/SESubstanceFraction.cpp +++ b/projects/biogears/libBiogears/src/cdm/substance/SESubstanceFraction.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Substance.h" + #include #include #include @@ -30,34 +32,14 @@ SESubstanceFraction::SESubstanceFraction(SESubstance const& substance, SEScalarF //------------------------------------------------------------------------------- SESubstanceFraction::~SESubstanceFraction() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SESubstanceFraction::Clear() +void SESubstanceFraction::Invalidate() { SAFE_DELETE(m_FractionAmount); } //------------------------------------------------------------------------------- -bool SESubstanceFraction::Load(const CDM::SubstanceFractionData& in) -{ - GetFractionAmount().Load(in.FractionAmount()); - return true; -} -//------------------------------------------------------------------------------- -CDM::SubstanceFractionData* SESubstanceFraction::Unload() const -{ - CDM::SubstanceFractionData* data = new CDM::SubstanceFractionData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SESubstanceFraction::Unload(CDM::SubstanceFractionData& data) const -{ - data.Name(m_Substance.GetName()); - if (HasFractionAmount()) - data.FractionAmount(std::unique_ptr(m_FractionAmount->Unload())); -} -//------------------------------------------------------------------------------- bool SESubstanceFraction::HasFractionAmount() const { return m_FractionAmount == nullptr ? false : m_FractionAmount->IsValid(); diff --git a/projects/biogears/libBiogears/src/cdm/substance/SESubstanceManager.cpp b/projects/biogears/libBiogears/src/cdm/substance/SESubstanceManager.cpp index fb021a4de..33ebd27a1 100644 --- a/projects/biogears/libBiogears/src/cdm/substance/SESubstanceManager.cpp +++ b/projects/biogears/libBiogears/src/cdm/substance/SESubstanceManager.cpp @@ -11,6 +11,10 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include + +#include "io/cdm/Substance.h" + #include #include #include @@ -34,52 +38,69 @@ namespace biogears { SESubstanceManager::SESubstanceManager(Logger* logger) : Loggable(logger) { - Clear(); } //----------------------------------------------------------------------------- SESubstanceManager::~SESubstanceManager() { - Clear(); + m_ActiveSubstances.clear(); + m_ActiveCompounds.clear(); + m_ActiveGases.clear(); + m_ActiveLiquids.clear(); + + m_OriginalCompoundData.clear(); + m_OriginalSubstanceData.clear(); + + DELETE_CONTAINER_OF_POINTERS(m_Substances); + DELETE_CONTAINER_OF_POINTERS(m_Compounds); } //----------------------------------------------------------------------------- -void SESubstanceManager::Clear() +void SESubstanceManager::Invalidate() { - DELETE_VECTOR(m_Substances); - DELETE_VECTOR(m_Compounds); m_ActiveSubstances.clear(); m_ActiveCompounds.clear(); m_ActiveGases.clear(); m_ActiveLiquids.clear(); - DELETE_MAP_SECOND(m_OriginalCompoundData); - DELETE_MAP_SECOND(m_OriginalSubstanceData); + m_OriginalCompoundData.clear(); + m_OriginalSubstanceData.clear(); + DELETE_CONTAINER_OF_POINTERS(m_Substances); + DELETE_CONTAINER_OF_POINTERS(m_Compounds); } //----------------------------------------------------------------------------- + void SESubstanceManager::Reset() { m_ActiveCompounds.clear(); m_ActiveSubstances.clear(); m_ActiveGases.clear(); m_ActiveLiquids.clear(); - for (auto itr : m_OriginalSubstanceData) - itr.first->Load(*itr.second); - for (auto itr : m_OriginalCompoundData) - itr.first->Load(*itr.second, *this); + for (auto& [key, definition]: m_OriginalSubstanceData) { + key->Invalidate(); + key->m_def = definition; + } + for (auto& [key, definition]: m_OriginalCompoundData) { + *key = definition; + } } //----------------------------------------------------------------------------- + /** * TRANSFERS OWNERSHIP TO THE MANAGER */ void SESubstanceManager::AddSubstance(SESubstance& substance) { - SESubstance* s; - for (unsigned int i = 0; i < m_Substances.size(); i++) { - s = m_Substances.at(i); - if (s == &substance) - return; - } m_Substances.push_back(&substance); } +SESubstance* SESubstanceManager::AddSubstance(SESubstanceDefinition const& definition) +{ + auto existingSubstance = std::find_if(m_Substances.begin(), m_Substances.end(), [&definition](auto substance) { return substance->m_def == definition; }); + if (existingSubstance == m_Substances.end()) { + auto newSubstance = std::make_unique(definition).release(); + m_Substances.push_back(newSubstance); + return newSubstance; + } + return *existingSubstance; +} //----------------------------------------------------------------------------- SESubstance* SESubstanceManager::GetSubstance(const char* name) const { @@ -88,13 +109,14 @@ SESubstance* SESubstanceManager::GetSubstance(const char* name) const //----------------------------------------------------------------------------- SESubstance* SESubstanceManager::GetSubstance(const std::string& name) const { - SESubstance* s; - for (unsigned int i = 0; i < m_Substances.size(); i++) { - s = m_Substances.at(i); - if (name.compare(s->GetName()) == 0) - return s; - } - return nullptr; + auto existingSubstance = std::find_if(m_Substances.begin(), m_Substances.end(), [&name](auto substance) { return substance->m_def.Name == name; }); + return (existingSubstance == m_Substances.end()) ? nullptr : *existingSubstance; +} +//----------------------------------------------------------------------------- +SESubstance* SESubstanceManager::GetSubstance(const SESubstanceDefinition& definition) const +{ + auto existingSubstance = std::find_if(m_Substances.begin(), m_Substances.end(), [&definition](auto substance) { return substance->m_def == definition; }); + return (existingSubstance == m_Substances.end()) ? nullptr : *existingSubstance; } //----------------------------------------------------------------------------- const std::vector& SESubstanceManager::GetSubstances() const @@ -104,16 +126,10 @@ const std::vector& SESubstanceManager::GetSubstances() const //----------------------------------------------------------------------------- bool SESubstanceManager::IsActive(const SESubstance& substance) const { - SESubstance* sub; - for (unsigned int iSubstance = 0; iSubstance < m_ActiveSubstances.size(); iSubstance++) { - sub = m_ActiveSubstances.at(iSubstance); - if (sub == &substance) - return true; - } - return false; + return m_ActiveSubstances.contains(const_cast(&substance)); } //----------------------------------------------------------------------------- -const std::vector& SESubstanceManager::GetActiveSubstances() const +const std::unordered_set& SESubstanceManager::GetActiveSubstances() const { return m_ActiveSubstances; } @@ -122,53 +138,56 @@ void SESubstanceManager::AddActiveSubstance(SESubstance& substance) { if (IsActive(substance)) return; - if (substance.GetState() == CDM::enumSubstanceState::Gas) { - m_ActiveGases.push_back(&substance); + if (substance.GetState() == SESubstanceState::Gas) { + m_ActiveGases.insert(&substance); } - if (substance.GetState() == CDM::enumSubstanceState::Liquid) { - m_ActiveLiquids.push_back(&substance); + if (substance.GetState() == SESubstanceState::Liquid) { + m_ActiveLiquids.insert(&substance); } if (substance.HasPK()) { - m_ActiveDrugs.push_back(&substance); + m_ActiveDrugs.insert(&substance); } - m_ActiveSubstances.push_back(&substance); + m_ActiveSubstances.insert(&substance); } //----------------------------------------------------------------------------- -void SESubstanceManager::RemoveActiveSubstance(const SESubstance& substance) +SESubstance* SESubstanceManager::AddActiveSubstance(SESubstanceDefinition const& definition) { - SESubstance* sub; - for (unsigned int iSubstance = 0; iSubstance < m_ActiveSubstances.size(); iSubstance++) { - sub = m_ActiveSubstances.at(iSubstance); - if (sub == &substance) { - m_ActiveSubstances.erase(m_ActiveSubstances.begin() + iSubstance); - break; - } + + auto existingSubstance = std::find_if(m_Substances.begin(), m_Substances.end(), [&definition](auto substance) { return substance->m_def == definition; }); + SESubstance* activeSubstance = nullptr; + if (existingSubstance == m_Substances.end()) { + activeSubstance = std::make_unique(definition).release(); + m_Substances.push_back(activeSubstance); + } else { + activeSubstance = *existingSubstance; } - for (unsigned int iSubstance = 0; iSubstance < m_ActiveGases.size(); iSubstance++) { - sub = m_ActiveGases.at(iSubstance); - if (sub == &substance) { - m_ActiveGases.erase(m_ActiveGases.begin() + iSubstance); - break; - } + + if (IsActive(*activeSubstance)) + return activeSubstance; + + if (activeSubstance->GetState() == SESubstanceState::Gas) { + m_ActiveGases.insert(activeSubstance); } - for (unsigned int iSubstance = 0; iSubstance < m_ActiveLiquids.size(); iSubstance++) { - sub = m_ActiveLiquids.at(iSubstance); - if (sub == &substance) { - m_ActiveLiquids.erase(m_ActiveLiquids.begin() + iSubstance); - break; - } + if (activeSubstance->GetState() == SESubstanceState::Liquid) { + m_ActiveLiquids.insert(activeSubstance); } - - for (unsigned int iSubstance = 0; iSubstance < m_ActiveDrugs.size(); iSubstance++) { - sub = m_ActiveDrugs.at(iSubstance); - if (sub == &substance) { - m_ActiveDrugs.erase(m_ActiveDrugs.begin() + iSubstance); - break; - } + if (activeSubstance->HasPK()) { + m_ActiveDrugs.insert(activeSubstance); } + m_ActiveSubstances.insert(activeSubstance); + + return activeSubstance; } //----------------------------------------------------------------------------- -void SESubstanceManager::RemoveActiveSubstances(const std::vector& substances) +void SESubstanceManager::RemoveActiveSubstance(const SESubstance& substance) +{ + std::erase_if(m_ActiveSubstances, [&substance](auto lhs) { return *lhs == substance; }); + std::erase_if(m_ActiveGases, [&substance](auto lhs) { return *lhs == substance; }); + std::erase_if(m_ActiveLiquids, [&substance](auto lhs) { return *lhs == substance; }); + std::erase_if(m_ActiveSubstances, [&substance](auto lhs) { return *lhs == substance; }); +} +//----------------------------------------------------------------------------- +void SESubstanceManager::RemoveActiveSubstances(const std::unordered_set& substances) { for (SESubstance* sub : substances) RemoveActiveSubstance(*sub); @@ -176,34 +195,28 @@ void SESubstanceManager::RemoveActiveSubstances(const std::vector& //----------------------------------------------------------------------------- void SESubstanceManager::RemoveActiveSubstances() { - std::vector copy(m_ActiveSubstances); + std::unordered_set copy(m_ActiveSubstances); for (SESubstance* sub : copy) RemoveActiveSubstance(*sub); } //----------------------------------------------------------------------------- -const std::vector& SESubstanceManager::GetActiveGases() const +const std::unordered_set& SESubstanceManager::GetActiveGases() const { return m_ActiveGases; } //----------------------------------------------------------------------------- -const std::vector& SESubstanceManager::GetActiveLiquids() const +const std::unordered_set& SESubstanceManager::GetActiveLiquids() const { return m_ActiveLiquids; } //----------------------------------------------------------------------------- -const std::vector& SESubstanceManager::GetActiveDrugs() const +const std::unordered_set& SESubstanceManager::GetActiveDrugs() const { return m_ActiveDrugs; } //----------------------------------------------------------------------------- void SESubstanceManager::AddCompound(SESubstanceCompound& compound) { - SESubstanceCompound* c; - for (unsigned int i = 0; i < m_Compounds.size(); i++) { - c = m_Compounds.at(i); - if (c == &compound) - return; - } m_Compounds.push_back(&compound); } //----------------------------------------------------------------------------- @@ -214,11 +227,9 @@ SESubstanceCompound* SESubstanceManager::GetCompound(const char* name) const //----------------------------------------------------------------------------- SESubstanceCompound* SESubstanceManager::GetCompound(const std::string& name) const { - SESubstanceCompound* c; - for (unsigned int i = 0; i < m_Compounds.size(); i++) { - c = m_Compounds.at(i); - if (name.compare(c->GetName()) == 0) - return c; + for (auto compound : m_Compounds) { + if (name == compound->GetName()) + return compound; } return nullptr; } @@ -230,44 +241,25 @@ const std::vector& SESubstanceManager::GetCompounds() cons //----------------------------------------------------------------------------- bool SESubstanceManager::IsActive(const SESubstanceCompound& compound) const { - SESubstanceCompound* c; - for (unsigned int i = 0; i < m_ActiveCompounds.size(); i++) { - c = m_ActiveCompounds.at(i); - if (c == &compound) - return true; - } - return false; + return m_ActiveCompounds.contains(const_cast(&compound)); } //----------------------------------------------------------------------------- -const std::vector& SESubstanceManager::GetActiveCompounds() const +const std::unordered_set& SESubstanceManager::GetActiveCompounds() const { return m_ActiveCompounds; } //----------------------------------------------------------------------------- void SESubstanceManager::AddActiveCompound(SESubstanceCompound& compound) { - SESubstanceCompound* c; - for (unsigned int i = 0; i < m_ActiveCompounds.size(); i++) { - c = m_ActiveCompounds.at(i); - if (c == &compound) - return; - } - m_ActiveCompounds.push_back(&compound); + m_ActiveCompounds.insert(&compound); } //----------------------------------------------------------------------------- void SESubstanceManager::RemoveActiveCompound(SESubstanceCompound& compound) { - unsigned int i = 0; - for (SESubstanceCompound* c : m_ActiveCompounds) { - if (c == &compound) { - m_ActiveCompounds.erase(m_ActiveCompounds.begin() + i); - break; - } - i++; - } + std::erase_if(m_ActiveCompounds, [&compound](auto lhs) { return *lhs == compound; }); } //----------------------------------------------------------------------------- -void SESubstanceManager::RemoveActiveCompounds(const std::vector& compounds) +void SESubstanceManager::RemoveActiveCompounds(const std::unordered_set& compounds) { for (SESubstanceCompound* c : compounds) RemoveActiveCompound(*c); @@ -298,7 +290,7 @@ SESubstance* SESubstanceManager::ReadSubstanceFile(const std::string& xmlFile) subData = dynamic_cast(obj); if (subData != nullptr) { sub = new SESubstance(GetLogger()); - sub->Load(*subData); + io::Substance::UnMarshall(*subData, *sub); return sub; } ss.str(""); @@ -311,18 +303,19 @@ SESubstance* SESubstanceManager::ReadSubstanceFile(const std::string& xmlFile) bool SESubstanceManager::LoadSubstanceDirectory() { bool succeeded = true; - Clear(); + Invalidate(); std::stringstream ss; auto io = m_Logger->GetIoManager().lock(); std::map> definitions; + std::map> compoundDefinitions; std::string path_string; for (auto& filepath : io->FindAllSubstanceFiles()) { path_string = filepath; #ifdef _DEBUG - //Debugs(asprintf("Reading substance file : %s", path_string.c_str())); + // Debugs(asprintf("Reading substance file : %s", path_string.c_str())); #endif definitions[filepath.basename()] = Serializer::ReadFile(path_string, GetLogger()); } @@ -344,32 +337,32 @@ bool SESubstanceManager::LoadSubstanceDirectory() } } #endif - for (auto& pair : definitions) { - - auto subData = dynamic_cast(pair.second.get()); - if (subData != nullptr) { - auto sub = new SESubstance(GetLogger()); - sub->Load(*subData); - AddSubstance(*sub); - m_OriginalSubstanceData[sub] = subData; - pair.second.release(); + for (auto& [key, objectData] : definitions) { + if (auto subData = dynamic_cast(objectData.get())) { + auto sub = std::make_unique(GetLogger()); + io::Substance::UnMarshall(*subData, *sub); + m_OriginalSubstanceData[sub.get()] = sub->GetDefinition(); + AddSubstance(*sub.release()); continue; } - auto compoundData = dynamic_cast(pair.second.get()); - if (compoundData != nullptr) { - // Differ processing compounds, until after all substances are known - // To prevent first pass errors. - auto compound = new SESubstanceCompound(GetLogger()); - m_OriginalCompoundData[compound] = compoundData; - AddCompound(*compound); - pair.second.release(); + if (auto compoundData = dynamic_cast(objectData.get())) { + compoundDefinitions[key] = std::unique_ptr(dynamic_cast(objectData.release())); continue; } Error("Unknown Type"); succeeded = false; } - for (auto itr : m_OriginalCompoundData) - itr.first->Load((const CDM::SubstanceCompoundData&)*itr.second, *this); + + for (auto& pair : compoundDefinitions) { + + // Differ processing compounds, until after all substances are known + // To prevent first pass errors. + auto compound = std::make_unique(GetLogger()); + io::Substance::UnMarshall(*pair.second, *this, *compound); + m_OriginalCompoundData[compound.get()] = *compound; + AddCompound(*compound.release()); + continue; + } if (!succeeded) { ss << "Unable to read some substances definitions" << std::ends; @@ -384,17 +377,14 @@ bool SESubstanceManager::operator==(SESubstanceManager const& rhs) const if (this == &rhs) return true; - //NOTE: This equality operator needs improvment - // We need to seperate SubstanceData from the SubstanceMGR - // We can then hash substance data and compare the hash - // Additionally we can likely only support SubstanceMgr comparrision by memory address and Data Definitions - + // NOTE: This equality operator needs improvment + // We need to seperate SubstanceData from the SubstanceMGR + // We can then hash substance data and compare the hash + // Additionally we can likely only support SubstanceMgr comparrision by memory address and Data Definitions - //TODO: Iterate over substances and call operator== on the data element. This just checks - // If the pointers are equal which is hardly true - return ( - - m_Substances == rhs.m_Substances + // TODO: Iterate over substances and call operator== on the data element. This just checks + // If the pointers are equal which is hardly true + return (m_Substances == rhs.m_Substances && m_ActiveSubstances == rhs.m_ActiveSubstances && m_ActiveGases == rhs.m_ActiveGases && m_ActiveLiquids == rhs.m_ActiveLiquids diff --git a/projects/biogears/libBiogears/src/cdm/substance/SESubstancePharmacodynamics.cpp b/projects/biogears/libBiogears/src/cdm/substance/SESubstancePharmacodynamics.cpp index dbfaafdc7..4a69ee8c1 100644 --- a/projects/biogears/libBiogears/src/cdm/substance/SESubstancePharmacodynamics.cpp +++ b/projects/biogears/libBiogears/src/cdm/substance/SESubstancePharmacodynamics.cpp @@ -9,11 +9,16 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **************************************************************************************/ +#include + +#include +#include + +#include "io/cdm/Substance.h" #include #include #include -#include #include #include @@ -24,35 +29,213 @@ namespace biogears { SESubstancePharmacodynamics::SESubstancePharmacodynamics(Logger* logger) : Loggable(logger) + , m_Modifiers() + , m_AntibacterialEffect(new SEScalarFrequency()) + , m_Bronchodilation(new SEPharmacodynamicModifier()) + , m_DiastolicPressureModifier(new SEPharmacodynamicModifier()) + , m_EMaxShapeParameter(new SEScalar()) + , m_FeverModifier(new SEPharmacodynamicModifier()) + , m_HeartRateModifier(new SEPharmacodynamicModifier()) + , m_HemorrhageModifier(new SEPharmacodynamicModifier()) + , m_NeuromuscularBlock(new SEPharmacodynamicModifier()) + , m_PainModifier(new SEPharmacodynamicModifier()) + , m_PupilReactivityModifier(new SEPharmacodynamicModifier()) + , m_PupilSizeModifier(new SEPharmacodynamicModifier()) + , m_RespirationRateModifier(new SEPharmacodynamicModifier()) + , m_Sedation(new SEPharmacodynamicModifier()) + , m_SystolicPressureModifier(new SEPharmacodynamicModifier()) + , m_TidalVolumeModifier(new SEPharmacodynamicModifier()) + , m_TubularPermeabilityModifier(new SEPharmacodynamicModifier()) + , m_CentralNervousModifier(new SEPharmacodynamicModifier()) + , m_EffectSiteRateConstant(new SEScalarFrequency()) { - m_AntibacterialEffect = nullptr; - m_Bronchodilation = nullptr; - m_DiastolicPressureModifier = nullptr; - m_EMaxShapeParameter = nullptr; - m_FeverModifier = nullptr; - m_HeartRateModifier = nullptr; - m_HemorrhageModifier = nullptr; - m_NeuromuscularBlock = nullptr; - m_PainModifier = nullptr; - m_PupilReactivityModifier = nullptr; - m_PupilSizeModifier = nullptr; - m_RespirationRateModifier = nullptr; - m_Sedation = nullptr; - m_SystolicPressureModifier = nullptr; - m_TidalVolumeModifier = nullptr; - m_TubularPermeabilityModifier = nullptr; - m_CentralNervousModifier = nullptr; - m_EffectSiteRateConstant = nullptr; + m_Modifiers.clear(); + m_Modifiers["Bronchodilation"] = m_Bronchodilation; + m_Modifiers["CentralNervous"] = m_CentralNervousModifier; + m_Modifiers["DiastolicPressure"] = m_DiastolicPressureModifier; + m_Modifiers["Fever"] = m_FeverModifier; + m_Modifiers["HeartRate"] = m_HeartRateModifier; + m_Modifiers["Hemorrhage"] = m_HemorrhageModifier; + m_Modifiers["NeuromuscularBlock"] = m_NeuromuscularBlock; + m_Modifiers["Pain"] = m_PainModifier; + m_Modifiers["PupilReactivity"] = m_PupilReactivityModifier; + m_Modifiers["PupilSize"] = m_PupilSizeModifier; + m_Modifiers["RespirationRate"] = m_RespirationRateModifier; + m_Modifiers["Sedation"] = m_Sedation; + m_Modifiers["SystolicPressure"] = m_SystolicPressureModifier; + m_Modifiers["TidalVolume"] = m_TidalVolumeModifier; + m_Modifiers["TubularPermeability"] = m_TubularPermeabilityModifier; } //----------------------------------------------------------------------------- -SESubstancePharmacodynamics::~SESubstancePharmacodynamics() +SESubstancePharmacodynamics::SESubstancePharmacodynamics(SESubstancePharmacodynamics const& obj) + : Loggable(obj.GetLogger()) + , m_Modifiers() + , m_AntibacterialEffect(new SEScalarFrequency(*obj.m_AntibacterialEffect)) + , m_Bronchodilation(new SEPharmacodynamicModifier(*obj.m_Bronchodilation)) + , m_DiastolicPressureModifier(new SEPharmacodynamicModifier(*obj.m_DiastolicPressureModifier)) + , m_EMaxShapeParameter(new SEScalar(*obj.m_EMaxShapeParameter)) + , m_FeverModifier(new SEPharmacodynamicModifier(*obj.m_FeverModifier)) + , m_HeartRateModifier(new SEPharmacodynamicModifier(*obj.m_HeartRateModifier)) + , m_HemorrhageModifier(new SEPharmacodynamicModifier(*obj.m_HemorrhageModifier)) + , m_NeuromuscularBlock(new SEPharmacodynamicModifier(*obj.m_NeuromuscularBlock)) + , m_PainModifier(new SEPharmacodynamicModifier(*obj.m_PainModifier)) + , m_PupilReactivityModifier(new SEPharmacodynamicModifier(*obj.m_PupilReactivityModifier)) + , m_PupilSizeModifier(new SEPharmacodynamicModifier(*obj.m_PupilSizeModifier)) + , m_RespirationRateModifier(new SEPharmacodynamicModifier(*obj.m_RespirationRateModifier)) + , m_Sedation(new SEPharmacodynamicModifier(*obj.m_Sedation)) + , m_SystolicPressureModifier(new SEPharmacodynamicModifier(*obj.m_SystolicPressureModifier)) + , m_TidalVolumeModifier(new SEPharmacodynamicModifier(*obj.m_TidalVolumeModifier)) + , m_TubularPermeabilityModifier(new SEPharmacodynamicModifier(*obj.m_TubularPermeabilityModifier)) + , m_CentralNervousModifier(new SEPharmacodynamicModifier(*obj.m_CentralNervousModifier)) + , m_EffectSiteRateConstant(new SEScalarFrequency(*obj.m_EffectSiteRateConstant)) { - Clear(); + m_Modifiers.clear(); + m_Modifiers["Bronchodilation"] = m_Bronchodilation; + m_Modifiers["CentralNervous"] = m_CentralNervousModifier; + m_Modifiers["DiastolicPressure"] = m_DiastolicPressureModifier; + m_Modifiers["Fever"] = m_FeverModifier; + m_Modifiers["HeartRate"] = m_HeartRateModifier; + m_Modifiers["Hemorrhage"] = m_HemorrhageModifier; + m_Modifiers["NeuromuscularBlock"] = m_NeuromuscularBlock; + m_Modifiers["Pain"] = m_PainModifier; + m_Modifiers["PupilReactivity"] = m_PupilReactivityModifier; + m_Modifiers["PupilSize"] = m_PupilSizeModifier; + m_Modifiers["RespirationRate"] = m_RespirationRateModifier; + m_Modifiers["Sedation"] = m_Sedation; + m_Modifiers["SystolicPressure"] = m_SystolicPressureModifier; + m_Modifiers["TidalVolume"] = m_TidalVolumeModifier; + m_Modifiers["TubularPermeability"] = m_TubularPermeabilityModifier; } //----------------------------------------------------------------------------- -void SESubstancePharmacodynamics::Clear() +SESubstancePharmacodynamics::SESubstancePharmacodynamics(SESubstancePharmacodynamics&& obj) + : Loggable(obj.GetLogger()) + , m_Modifiers(std ::exchange(obj.m_Modifiers, decltype(m_Modifiers)())) + , m_AntibacterialEffect(std::exchange(obj.m_AntibacterialEffect, nullptr)) + , m_Bronchodilation(std::exchange(obj.m_Bronchodilation, nullptr)) + , m_DiastolicPressureModifier(std::exchange(obj.m_DiastolicPressureModifier, nullptr)) + , m_EMaxShapeParameter(std::exchange(obj.m_EMaxShapeParameter, nullptr)) + , m_FeverModifier(std::exchange(obj.m_FeverModifier, nullptr)) + , m_HeartRateModifier(std::exchange(obj.m_HeartRateModifier, nullptr)) + , m_HemorrhageModifier(std::exchange(obj.m_HemorrhageModifier, nullptr)) + , m_NeuromuscularBlock(std::exchange(obj.m_NeuromuscularBlock, nullptr)) + , m_PainModifier(std::exchange(obj.m_PainModifier, nullptr)) + , m_PupilReactivityModifier(std::exchange(obj.m_PupilReactivityModifier, nullptr)) + , m_PupilSizeModifier(std::exchange(obj.m_PupilSizeModifier, nullptr)) + , m_RespirationRateModifier(std::exchange(obj.m_RespirationRateModifier, nullptr)) + , m_Sedation(std::exchange(obj.m_Sedation, nullptr)) + , m_SystolicPressureModifier(std::exchange(obj.m_SystolicPressureModifier, nullptr)) + , m_TidalVolumeModifier(std::exchange(obj.m_TidalVolumeModifier, nullptr)) + , m_TubularPermeabilityModifier(std::exchange(obj.m_TubularPermeabilityModifier, nullptr)) + , m_CentralNervousModifier(std::exchange(obj.m_CentralNervousModifier, nullptr)) + , m_EffectSiteRateConstant(std::exchange(obj.m_EffectSiteRateConstant, nullptr)) { m_Modifiers.clear(); + m_Modifiers["Bronchodilation"] = m_Bronchodilation; + m_Modifiers["CentralNervous"] = m_CentralNervousModifier; + m_Modifiers["DiastolicPressure"] = m_DiastolicPressureModifier; + m_Modifiers["Fever"] = m_FeverModifier; + m_Modifiers["HeartRate"] = m_HeartRateModifier; + m_Modifiers["Hemorrhage"] = m_HemorrhageModifier; + m_Modifiers["NeuromuscularBlock"] = m_NeuromuscularBlock; + m_Modifiers["Pain"] = m_PainModifier; + m_Modifiers["PupilReactivity"] = m_PupilReactivityModifier; + m_Modifiers["PupilSize"] = m_PupilSizeModifier; + m_Modifiers["RespirationRate"] = m_RespirationRateModifier; + m_Modifiers["Sedation"] = m_Sedation; + m_Modifiers["SystolicPressure"] = m_SystolicPressureModifier; + m_Modifiers["TidalVolume"] = m_TidalVolumeModifier; + m_Modifiers["TubularPermeability"] = m_TubularPermeabilityModifier; +} +//----------------------------------------------------------------------------- +SESubstancePharmacodynamics& SESubstancePharmacodynamics::operator=(SESubstancePharmacodynamics const& rhs) +{ + if (this == &rhs) + return *this; + + GetAntibacterialEffect() = *rhs.m_AntibacterialEffect; + GetBronchodilation() = *rhs.m_Bronchodilation; + GetDiastolicPressureModifier() = *rhs.m_DiastolicPressureModifier; + GetEMaxShapeParameter() = *rhs.m_EMaxShapeParameter; + GetFeverModifier() = *rhs.m_FeverModifier; + GetHeartRateModifier() = *rhs.m_HeartRateModifier; + GetHemorrhageModifier() = *rhs.m_HemorrhageModifier; + GetNeuromuscularBlock() = *rhs.m_NeuromuscularBlock; + GetPainModifier() = *rhs.m_PainModifier; + GetPupilReactivityModifier() = *rhs.m_PupilReactivityModifier; + GetPupilSizeModifier() = *rhs.m_PupilSizeModifier; + GetRespirationRateModifier() = *rhs.m_RespirationRateModifier; + GetSedation() = *rhs.m_Sedation; + GetSystolicPressureModifier() = *rhs.m_SystolicPressureModifier; + GetTidalVolumeModifier() = *rhs.m_TidalVolumeModifier; + GetTubularPermeabilityModifier() = *rhs.m_TubularPermeabilityModifier; + GetCentralNervousModifier() = *rhs.m_CentralNervousModifier; + + m_Modifiers.clear(); + m_Modifiers["Bronchodilation"] = m_Bronchodilation; + m_Modifiers["CentralNervous"] = m_CentralNervousModifier; + m_Modifiers["DiastolicPressure"] = m_DiastolicPressureModifier; + m_Modifiers["Fever"] = m_FeverModifier; + m_Modifiers["HeartRate"] = m_HeartRateModifier; + m_Modifiers["Hemorrhage"] = m_HemorrhageModifier; + m_Modifiers["NeuromuscularBlock"] = m_NeuromuscularBlock; + m_Modifiers["Pain"] = m_PainModifier; + m_Modifiers["PupilReactivity"] = m_PupilReactivityModifier; + m_Modifiers["PupilSize"] = m_PupilSizeModifier; + m_Modifiers["RespirationRate"] = m_RespirationRateModifier; + m_Modifiers["Sedation"] = m_Sedation; + m_Modifiers["SystolicPressure"] = m_SystolicPressureModifier; + m_Modifiers["TidalVolume"] = m_TidalVolumeModifier; + m_Modifiers["TubularPermeability"] = m_TubularPermeabilityModifier; + + return *this; +} +SESubstancePharmacodynamics& SESubstancePharmacodynamics::operator=(SESubstancePharmacodynamics&& rhs) +{ + if (this == &rhs) + return *this; + + m_Modifiers = std::move(rhs.m_Modifiers); + GetAntibacterialEffect() = std::move(*rhs.m_AntibacterialEffect); + GetBronchodilation() = std::move(*rhs.m_Bronchodilation); + GetDiastolicPressureModifier() = std::move(*rhs.m_DiastolicPressureModifier); + GetEMaxShapeParameter() = std::move(*rhs.m_EMaxShapeParameter); + GetFeverModifier() = std::move(*rhs.m_FeverModifier); + GetHeartRateModifier() = std::move(*rhs.m_HeartRateModifier); + GetHemorrhageModifier() = std::move(*rhs.m_HemorrhageModifier); + GetNeuromuscularBlock() = std::move(*rhs.m_NeuromuscularBlock); + GetPainModifier() = std::move(*rhs.m_PainModifier); + GetPupilReactivityModifier() = std::move(*rhs.m_PupilReactivityModifier); + GetPupilSizeModifier() = std::move(*rhs.m_PupilSizeModifier); + GetRespirationRateModifier() = std::move(*rhs.m_RespirationRateModifier); + GetSedation() = std::move(*rhs.m_Sedation); + GetSystolicPressureModifier() = std::move(*rhs.m_SystolicPressureModifier); + GetTidalVolumeModifier() = std::move(*rhs.m_TidalVolumeModifier); + GetTubularPermeabilityModifier() = std::move(*rhs.m_TubularPermeabilityModifier); + GetCentralNervousModifier() = std::move(*rhs.m_CentralNervousModifier); + GetEffectSiteRateConstant() = std::move(*rhs.m_EffectSiteRateConstant); + + m_Modifiers.clear(); + m_Modifiers["Bronchodilation"] = m_Bronchodilation; + m_Modifiers["CentralNervous"] = m_CentralNervousModifier; + m_Modifiers["DiastolicPressure"] = m_DiastolicPressureModifier; + m_Modifiers["Fever"] = m_FeverModifier; + m_Modifiers["HeartRate"] = m_HeartRateModifier; + m_Modifiers["Hemorrhage"] = m_HemorrhageModifier; + m_Modifiers["NeuromuscularBlock"] = m_NeuromuscularBlock; + m_Modifiers["Pain"] = m_PainModifier; + m_Modifiers["PupilReactivity"] = m_PupilReactivityModifier; + m_Modifiers["PupilSize"] = m_PupilSizeModifier; + m_Modifiers["RespirationRate"] = m_RespirationRateModifier; + m_Modifiers["Sedation"] = m_Sedation; + m_Modifiers["SystolicPressure"] = m_SystolicPressureModifier; + m_Modifiers["TidalVolume"] = m_TidalVolumeModifier; + m_Modifiers["TubularPermeability"] = m_TubularPermeabilityModifier; + return *this; +} +//----------------------------------------------------------------------------- +SESubstancePharmacodynamics::~SESubstancePharmacodynamics() +{ + m_Modifiers.clear(); // NO LEAK JUST A DIFFERENT WAY TO REFERENCE THE BELOW. SAFE_DELETE(m_AntibacterialEffect); SAFE_DELETE(m_Bronchodilation); SAFE_DELETE(m_DiastolicPressureModifier); @@ -73,6 +256,64 @@ void SESubstancePharmacodynamics::Clear() SAFE_DELETE(m_EffectSiteRateConstant); } //----------------------------------------------------------------------------- +void SESubstancePharmacodynamics::Invalidate() +{ + if (m_AntibacterialEffect) { + m_AntibacterialEffect->Invalidate(); + } + if (m_Bronchodilation) { + m_Bronchodilation->Invalidate(); + } + if (m_DiastolicPressureModifier) { + m_DiastolicPressureModifier->Invalidate(); + } + if (m_EMaxShapeParameter) { + m_EMaxShapeParameter->Invalidate(); + } + if (m_FeverModifier) { + m_FeverModifier->Invalidate(); + } + if (m_HeartRateModifier) { + m_HeartRateModifier->Invalidate(); + } + if (m_HemorrhageModifier) { + m_HemorrhageModifier->Invalidate(); + } + if (m_NeuromuscularBlock) { + m_NeuromuscularBlock->Invalidate(); + } + if (m_PainModifier) { + m_PainModifier->Invalidate(); + } + if (m_PupilReactivityModifier) { + m_PupilReactivityModifier->Invalidate(); + } + if (m_PupilSizeModifier) { + m_PupilSizeModifier->Invalidate(); + } + if (m_RespirationRateModifier) { + m_RespirationRateModifier->Invalidate(); + } + if (m_Sedation) { + m_Sedation->Invalidate(); + } + if (m_SystolicPressureModifier) { + m_SystolicPressureModifier->Invalidate(); + } + if (m_TidalVolumeModifier) { + m_TidalVolumeModifier->Invalidate(); + } + if (m_TubularPermeabilityModifier) { + m_TubularPermeabilityModifier->Invalidate(); + } + if (m_CentralNervousModifier) { + m_CentralNervousModifier->Invalidate(); + } + if (m_EffectSiteRateConstant) { + m_EffectSiteRateConstant->Invalidate(); + } +} +//----------------------------------------------------------------------------- bool SESubstancePharmacodynamics::IsValid() const { if (!HasAntibacterialEffect()) @@ -163,97 +404,6 @@ const SEScalar* SESubstancePharmacodynamics::GetScalar(const std::string& name) return nullptr; } //----------------------------------------------------------------------------- -bool SESubstancePharmacodynamics::Load(const CDM::SubstancePharmacodynamicsData& in) -{ - GetBronchodilation().Load(in.Bronchodilation()); - GetDiastolicPressureModifier().Load(in.DiastolicPressureModifier()); - GetEMaxShapeParameter().Load(in.EMaxShapeParameter()); - GetFeverModifier().Load(in.FeverModifier()); - GetHeartRateModifier().Load(in.HeartRateModifier()); - GetHemorrhageModifier().Load(in.HemorrhageModifier()); - GetNeuromuscularBlock().Load(in.NeuromuscularBlock()); - GetPainModifier().Load(in.PainModifier()); - GetPupilReactivityModifier().Load(in.PupilReactivityModifier()); - GetPupilSizeModifier().Load(in.PupilSizeModifier()); - GetRespirationRateModifier().Load(in.RespirationRateModifier()); - GetSedation().Load(in.Sedation()); - GetSystolicPressureModifier().Load(in.SystolicPressureModifier()); - GetTidalVolumeModifier().Load(in.TidalVolumeModifier()); - GetTubularPermeabilityModifier().Load(in.TubularPermeabilityModifier()); - GetCentralNervousModifier().Load(in.CentralNervousModifier()); - GetAntibacterialEffect().Load(in.AntibacterialEffect()); - GetEffectSiteRateConstant().Load(in.EffectSiteRateConstant()); - - // Set up map (Antibiotic effect not added to modifier list because it is implemented different from other modifiers) - m_Modifiers.clear(); - m_Modifiers["Bronchodilation"] = m_Bronchodilation; - m_Modifiers["CentralNervous"] = m_CentralNervousModifier; - m_Modifiers["DiastolicPressure"] = m_DiastolicPressureModifier; - m_Modifiers["Fever"] = m_FeverModifier; - m_Modifiers["HeartRate"] = m_HeartRateModifier; - m_Modifiers["Hemorrhage"] = m_HemorrhageModifier; - m_Modifiers["NeuromuscularBlock"] = m_NeuromuscularBlock; - m_Modifiers["Pain"] = m_PainModifier; - m_Modifiers["PupilReactivity"] = m_PupilReactivityModifier; - m_Modifiers["PupilSize"] = m_PupilSizeModifier; - m_Modifiers["RespirationRate"] = m_RespirationRateModifier; - m_Modifiers["Sedation"] = m_Sedation; - m_Modifiers["SystolicPressure"] = m_SystolicPressureModifier; - m_Modifiers["TidalVolume"] = m_TidalVolumeModifier; - m_Modifiers["TubularPermeability"] = m_TubularPermeabilityModifier; - - return true; -} -//----------------------------------------------------------------------------- -CDM::SubstancePharmacodynamicsData* SESubstancePharmacodynamics::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::SubstancePharmacodynamicsData* data = new CDM::SubstancePharmacodynamicsData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SESubstancePharmacodynamics::Unload(CDM::SubstancePharmacodynamicsData& data) const -{ - if (HasBronchodilation()) - data.Bronchodilation(std::unique_ptr(m_Bronchodilation->Unload())); - if (HasDiastolicPressureModifier()) - data.DiastolicPressureModifier(std::unique_ptr(m_DiastolicPressureModifier->Unload())); - if (HasEMaxShapeParameter()) - data.EMaxShapeParameter(std::unique_ptr(m_EMaxShapeParameter->Unload())); - if (HasFeverModifier()) - data.FeverModifier(std::unique_ptr(m_FeverModifier->Unload())); - if (HasHeartRateModifier()) - data.HeartRateModifier(std::unique_ptr(m_HeartRateModifier->Unload())); - if (HasHemorrhageModifier()) - data.HemorrhageModifier(std::unique_ptr(m_HemorrhageModifier->Unload())); - if (HasNeuromuscularBlock()) - data.NeuromuscularBlock(std::unique_ptr(m_NeuromuscularBlock->Unload())); - if (HasPainModifier()) - data.PainModifier(std::unique_ptr(m_PainModifier->Unload())); - if (HasPupilReactivityModifier()) - data.PupilReactivityModifier(std::unique_ptr(m_PupilReactivityModifier->Unload())); - if (HasPupilSizeModifier()) - data.PupilSizeModifier(std::unique_ptr(m_PupilReactivityModifier->Unload())); - if (HasRespirationRateModifier()) - data.RespirationRateModifier(std::unique_ptr(m_RespirationRateModifier->Unload())); - if (HasSedation()) - data.Sedation(std::unique_ptr(m_Sedation->Unload())); - if (HasSystolicPressureModifier()) - data.SystolicPressureModifier(std::unique_ptr(m_SystolicPressureModifier->Unload())); - if (HasTidalVolumeModifier()) - data.TidalVolumeModifier(std::unique_ptr(m_TidalVolumeModifier->Unload())); - if (HasTubularPermeabilityModifier()) - data.TubularPermeabilityModifier(std::unique_ptr(m_TubularPermeabilityModifier->Unload())); - if (HasCentralNervousModifier()) - data.CentralNervousModifier(std::unique_ptr(m_CentralNervousModifier->Unload())); - if (HasAntibacterialEffect()) - data.AntibacterialEffect(std::unique_ptr(m_AntibacterialEffect->Unload())); - if (HasEffectSiteRateConstant()) - data.EffectSiteRateConstant(std::unique_ptr(m_EffectSiteRateConstant->Unload())); -} -//----------------------------------------------------------------------------- bool SESubstancePharmacodynamics::HasAntibacterialEffect() const { return (m_AntibacterialEffect == nullptr) ? false : m_AntibacterialEffect->IsValid(); @@ -291,9 +441,9 @@ SEPharmacodynamicModifier& SESubstancePharmacodynamics::GetBronchodilation() return *m_Bronchodilation; } //----------------------------------------------------------------------------- -const SEPharmacodynamicModifier* SESubstancePharmacodynamics::GetBronchodilation() const +SEPharmacodynamicModifier const& SESubstancePharmacodynamics::GetBronchodilation() const { - return m_Bronchodilation; + return *m_Bronchodilation; } //----------------------------------------------------------------------------- bool SESubstancePharmacodynamics::HasDiastolicPressureModifier() const @@ -310,9 +460,9 @@ SEPharmacodynamicModifier& SESubstancePharmacodynamics::GetDiastolicPressureModi return *m_DiastolicPressureModifier; } //----------------------------------------------------------------------------- -const SEPharmacodynamicModifier* SESubstancePharmacodynamics::GetDiastolicPressureModifier() const +SEPharmacodynamicModifier const& SESubstancePharmacodynamics::GetDiastolicPressureModifier() const { - return m_DiastolicPressureModifier; + return *m_DiastolicPressureModifier; } //----------------------------------------------------------------------------- bool SESubstancePharmacodynamics::HasEMaxShapeParameter() const @@ -352,9 +502,9 @@ SEPharmacodynamicModifier& SESubstancePharmacodynamics::GetFeverModifier() return *m_FeverModifier; } //----------------------------------------------------------------------------- -const SEPharmacodynamicModifier* SESubstancePharmacodynamics::GetFeverModifier() const +SEPharmacodynamicModifier const& SESubstancePharmacodynamics::GetFeverModifier() const { - return m_FeverModifier; + return *m_FeverModifier; } //----------------------------------------------------------------------------- bool SESubstancePharmacodynamics::HasHeartRateModifier() const @@ -371,9 +521,9 @@ SEPharmacodynamicModifier& SESubstancePharmacodynamics::GetHeartRateModifier() return *m_HeartRateModifier; } //----------------------------------------------------------------------------- -const SEPharmacodynamicModifier* SESubstancePharmacodynamics::GetHeartRateModifier() const +SEPharmacodynamicModifier const& SESubstancePharmacodynamics::GetHeartRateModifier() const { - return m_HeartRateModifier; + return *m_HeartRateModifier; } //----------------------------------------------------------------------------- bool SESubstancePharmacodynamics::HasHemorrhageModifier() const @@ -390,9 +540,9 @@ SEPharmacodynamicModifier& SESubstancePharmacodynamics::GetHemorrhageModifier() return *m_HemorrhageModifier; } //----------------------------------------------------------------------------- -const SEPharmacodynamicModifier* SESubstancePharmacodynamics::GetHemorrhageModifier() const +SEPharmacodynamicModifier const& SESubstancePharmacodynamics::GetHemorrhageModifier() const { - return m_HemorrhageModifier; + return *m_HemorrhageModifier; } //----------------------------------------------------------------------------- bool SESubstancePharmacodynamics::HasNeuromuscularBlock() const @@ -409,9 +559,9 @@ SEPharmacodynamicModifier& SESubstancePharmacodynamics::GetNeuromuscularBlock() return *m_NeuromuscularBlock; } //----------------------------------------------------------------------------- -const SEPharmacodynamicModifier* SESubstancePharmacodynamics::GetNeuromuscularBlock() const +SEPharmacodynamicModifier const& SESubstancePharmacodynamics::GetNeuromuscularBlock() const { - return m_NeuromuscularBlock; + return *m_NeuromuscularBlock; } //----------------------------------------------------------------------------- bool SESubstancePharmacodynamics::HasPainModifier() const @@ -428,9 +578,9 @@ SEPharmacodynamicModifier& SESubstancePharmacodynamics::GetPainModifier() return *m_PainModifier; } //----------------------------------------------------------------------------- -const SEPharmacodynamicModifier* SESubstancePharmacodynamics::GetPainModifier() const +SEPharmacodynamicModifier const& SESubstancePharmacodynamics::GetPainModifier() const { - return m_PainModifier; + return *m_PainModifier; } //----------------------------------------------------------------------------- bool SESubstancePharmacodynamics::HasPupilReactivityModifier() const @@ -447,9 +597,9 @@ SEPharmacodynamicModifier& SESubstancePharmacodynamics::GetPupilReactivityModifi return *m_PupilReactivityModifier; } //----------------------------------------------------------------------------- -const SEPharmacodynamicModifier* SESubstancePharmacodynamics::GetPupilReactivityModifier() const +SEPharmacodynamicModifier const& SESubstancePharmacodynamics::GetPupilReactivityModifier() const { - return m_PupilReactivityModifier; + return *m_PupilReactivityModifier; } //----------------------------------------------------------------------------- bool SESubstancePharmacodynamics::HasPupilSizeModifier() const @@ -466,9 +616,9 @@ SEPharmacodynamicModifier& SESubstancePharmacodynamics::GetPupilSizeModifier() return *m_PupilSizeModifier; } //----------------------------------------------------------------------------- -const SEPharmacodynamicModifier* SESubstancePharmacodynamics::GetPupilSizeModifier() const +SEPharmacodynamicModifier const& SESubstancePharmacodynamics::GetPupilSizeModifier() const { - return m_PupilSizeModifier; + return *m_PupilSizeModifier; } //----------------------------------------------------------------------------- bool SESubstancePharmacodynamics::HasRespirationRateModifier() const @@ -485,9 +635,9 @@ SEPharmacodynamicModifier& SESubstancePharmacodynamics::GetRespirationRateModifi return *m_RespirationRateModifier; } //----------------------------------------------------------------------------- -const SEPharmacodynamicModifier* SESubstancePharmacodynamics::GetRespirationRateModifier() const +SEPharmacodynamicModifier const& SESubstancePharmacodynamics::GetRespirationRateModifier() const { - return m_RespirationRateModifier; + return *m_RespirationRateModifier; } //----------------------------------------------------------------------------- bool SESubstancePharmacodynamics::HasSedation() const @@ -504,9 +654,9 @@ SEPharmacodynamicModifier& SESubstancePharmacodynamics::GetSedation() return *m_Sedation; } //----------------------------------------------------------------------------- -const SEPharmacodynamicModifier* SESubstancePharmacodynamics::GetSedation() const +SEPharmacodynamicModifier const& SESubstancePharmacodynamics::GetSedation() const { - return m_Sedation; + return *m_Sedation; } //----------------------------------------------------------------------------- bool SESubstancePharmacodynamics::HasSystolicPressureModifier() const @@ -523,9 +673,9 @@ SEPharmacodynamicModifier& SESubstancePharmacodynamics::GetSystolicPressureModif return *m_SystolicPressureModifier; } //----------------------------------------------------------------------------- -const SEPharmacodynamicModifier* SESubstancePharmacodynamics::GetSystolicPressureModifier() const +SEPharmacodynamicModifier const& SESubstancePharmacodynamics::GetSystolicPressureModifier() const { - return m_SystolicPressureModifier; + return *m_SystolicPressureModifier; } //----------------------------------------------------------------------------- bool SESubstancePharmacodynamics::HasTidalVolumeModifier() const @@ -542,9 +692,9 @@ SEPharmacodynamicModifier& SESubstancePharmacodynamics::GetTidalVolumeModifier() return *m_TidalVolumeModifier; } //----------------------------------------------------------------------------- -const SEPharmacodynamicModifier* SESubstancePharmacodynamics::GetTidalVolumeModifier() const +SEPharmacodynamicModifier const& SESubstancePharmacodynamics::GetTidalVolumeModifier() const { - return m_TidalVolumeModifier; + return *m_TidalVolumeModifier; } //----------------------------------------------------------------------------- bool SESubstancePharmacodynamics::HasTubularPermeabilityModifier() const @@ -559,9 +709,9 @@ SEPharmacodynamicModifier& SESubstancePharmacodynamics::GetTubularPermeabilityMo return *m_TubularPermeabilityModifier; } //----------------------------------------------------------------------------- -const SEPharmacodynamicModifier* SESubstancePharmacodynamics::GetTubularPermeabilityModifier() const +SEPharmacodynamicModifier const& SESubstancePharmacodynamics::GetTubularPermeabilityModifier() const { - return m_TubularPermeabilityModifier; + return *m_TubularPermeabilityModifier; } //----------------------------------------------------------------------------- bool SESubstancePharmacodynamics::HasCentralNervousModifier() const @@ -578,9 +728,9 @@ SEPharmacodynamicModifier& SESubstancePharmacodynamics::GetCentralNervousModifie return *m_CentralNervousModifier; } //----------------------------------------------------------------------------- -const SEPharmacodynamicModifier* SESubstancePharmacodynamics::GetCentralNervousModifier() const +SEPharmacodynamicModifier const& SESubstancePharmacodynamics::GetCentralNervousModifier() const { - return m_CentralNervousModifier; + return *m_CentralNervousModifier; } //----------------------------------------------------------------------------- bool SESubstancePharmacodynamics::HasEffectSiteRateConstant() const @@ -608,30 +758,69 @@ std::map SESubstancePharmacodynamics::G { return m_Modifiers; } - +//----------------------------------------------------------------------------- +SEPharmacodynamicModifier::SEPharmacodynamicModifier() + : m_EC50(std::make_unique().release()) + , m_EMax(std::make_unique().release()) +{ +} +//----------------------------------------------------------------------------- SEPharmacodynamicModifier::SEPharmacodynamicModifier(SEScalarMassPerVolume const& ec50, SEScalarFraction const& max) - : m_EC50(nullptr) - , m_EMax(nullptr) + : m_EC50(std::make_unique(ec50).release()) + , m_EMax(std::make_unique(max).release()) { - GetEMax() = max; - GetEC50() = ec50; } -SEPharmacodynamicModifier::SEPharmacodynamicModifier() - : m_EC50(nullptr) - , m_EMax(nullptr) +//----------------------------------------------------------------------------- +SEPharmacodynamicModifier::SEPharmacodynamicModifier(SEPharmacodynamicModifier const& obj) + : m_EC50(std::make_unique(*obj.m_EC50).release()) + , m_EMax(std::make_unique(*obj.m_EMax).release()) { } //----------------------------------------------------------------------------- -SEPharmacodynamicModifier::~SEPharmacodynamicModifier() +SEPharmacodynamicModifier::SEPharmacodynamicModifier(SEPharmacodynamicModifier&& obj) + : m_EC50(std::exchange(obj.m_EC50, std::make_unique().release())) + , m_EMax(std::exchange(obj.m_EMax, std::make_unique().release())) +{ +} +//----------------------------------------------------------------------------- + +SEPharmacodynamicModifier& SEPharmacodynamicModifier::operator=(SEPharmacodynamicModifier const& rhs) +{ + if (this != &rhs) { + auto temp = SEPharmacodynamicModifier(std::move(rhs)); + GetEC50() = std::move(temp.GetEC50()); + GetEMax() = std::move(temp.GetEMax()); + } + return *this; +} +//----------------------------------------------------------------------------- +SEPharmacodynamicModifier& SEPharmacodynamicModifier::operator=(SEPharmacodynamicModifier&& rhs) { - Clear(); + if (this != &rhs) { + auto temp = SEPharmacodynamicModifier(std::move(rhs)); + GetEC50() = std::move(rhs.GetEC50()); + GetEMax() = std::move(rhs.GetEMax()); + } + return *this; } + //----------------------------------------------------------------------------- -void SEPharmacodynamicModifier::Clear() +SEPharmacodynamicModifier::~SEPharmacodynamicModifier() { SAFE_DELETE(m_EMax); SAFE_DELETE(m_EC50); } +//----------------------------------------------------------------------------- +void SEPharmacodynamicModifier::Invalidate() +{ + if (m_EMax) { + m_EMax->Invalidate(); + } + if (m_EC50) { + m_EC50->Invalidate(); + } +} + //----------------------------------------------------------------------------- bool SEPharmacodynamicModifier::IsValid() const { @@ -653,36 +842,11 @@ const SEScalar* SEPharmacodynamicModifier::GetScalar(const std::string& name) } return nullptr; } -//----------------------------------------------------------------------------- -bool SEPharmacodynamicModifier::Load(const CDM::PharmacodynamicModifierData& in) -{ - GetEMax().Load(in.EMax()); - GetEC50().Load(in.EC50()); - - return true; -} -//----------------------------------------------------------------------------- -CDM::PharmacodynamicModifierData* SEPharmacodynamicModifier::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::PharmacodynamicModifierData* data = new CDM::PharmacodynamicModifierData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEPharmacodynamicModifier::Unload(CDM::PharmacodynamicModifierData& data) const -{ - if (HasEMax()) - data.EMax(std::unique_ptr(m_EMax->Unload())); - if (HasEC50()) - data.EC50(std::unique_ptr(m_EC50->Unload())); -} //----------------------------------------------------------------------------- bool SEPharmacodynamicModifier::HasEMax() const { - return (m_EMax == nullptr) ? false : m_EMax->IsValid(); + return m_EMax ? m_EMax->IsValid() : false; } //----------------------------------------------------------------------------- SEScalarFraction& SEPharmacodynamicModifier::GetEMax() @@ -700,10 +864,11 @@ double SEPharmacodynamicModifier::GetEMax() const } return m_EMax->GetValue(); } + //----------------------------------------------------------------------------- bool SEPharmacodynamicModifier::HasEC50() const { - return (m_EC50 == nullptr) ? false : m_EC50->IsValid(); + return m_EC50 ? m_EC50->IsValid() : false; } //----------------------------------------------------------------------------- SEScalarMassPerVolume& SEPharmacodynamicModifier::GetEC50() diff --git a/projects/biogears/libBiogears/src/cdm/substance/SESubstancePharmacokinetics.cpp b/projects/biogears/libBiogears/src/cdm/substance/SESubstancePharmacokinetics.cpp index 20d013ada..fcbce36b0 100644 --- a/projects/biogears/libBiogears/src/cdm/substance/SESubstancePharmacokinetics.cpp +++ b/projects/biogears/libBiogears/src/cdm/substance/SESubstancePharmacokinetics.cpp @@ -9,33 +9,55 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **************************************************************************************/ +#include + +#include "io/cdm/Substance.h" #include -#include namespace std { template class map; } namespace biogears { - +SESubstancePharmacokinetics::SESubstancePharmacokinetics(SESubstancePharmacokinetics const& obj) + : Loggable(obj.GetLogger()) + , m_Physicochemicals(std::make_unique(*obj.m_Physicochemicals).release()) +{ + for (auto& [key, value] : obj.m_TissueKinetics) { + m_TissueKinetics[key] = std::make_unique(*value).release(); + } +} SESubstancePharmacokinetics::SESubstancePharmacokinetics(Logger* logger) : Loggable(logger) + , m_Physicochemicals(std::make_unique(logger).release()) + , m_TissueKinetics() { - m_Physicochemicals = nullptr; } //----------------------------------------------------------------------------- SESubstancePharmacokinetics::~SESubstancePharmacokinetics() { - Clear(); + SAFE_DELETE(m_Physicochemicals) + for (auto& [key, value] : m_TissueKinetics) { + delete value; + value = nullptr; + } } //----------------------------------------------------------------------------- -void SESubstancePharmacokinetics::Clear() + +void SESubstancePharmacokinetics::Invalidate() { - SAFE_DELETE(m_Physicochemicals); - DELETE_MAP_SECOND(m_TissueKinetics); + if (m_Physicochemicals) { + m_Physicochemicals->Invalidate(); + } + + for (auto& [key, value] : m_TissueKinetics) { + delete value; + value = nullptr; + } m_TissueKinetics.clear(); } + //----------------------------------------------------------------------------- bool SESubstancePharmacokinetics::IsValid() const { @@ -59,44 +81,6 @@ const SEScalar* SESubstancePharmacokinetics::GetScalar(const std::string& name) return nullptr; } //----------------------------------------------------------------------------- -bool SESubstancePharmacokinetics::Load(const CDM::SubstancePharmacokineticsData& in) -{ - Clear(); - - if (in.Physicochemicals().present()) - GetPhysicochemicals().Load(in.Physicochemicals().get()); - - SESubstanceTissuePharmacokinetics* fx; - const CDM::SubstanceTissuePharmacokineticsData* fxData; - for (unsigned int i = 0; i < in.TissueKinetics().size(); i++) { - fxData = &in.TissueKinetics().at(i); - fx = new SESubstanceTissuePharmacokinetics(fxData->Name(), GetLogger()); - fx->Load(*fxData); - m_TissueKinetics[fx->GetName()] = (fx); - } - - return true; -} -//----------------------------------------------------------------------------- -CDM::SubstancePharmacokineticsData* SESubstancePharmacokinetics::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::SubstancePharmacokineticsData* data = new CDM::SubstancePharmacokineticsData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SESubstancePharmacokinetics::Unload(CDM::SubstancePharmacokineticsData& data) const -{ - if (HasPhysicochemicals()) - data.Physicochemicals(std::unique_ptr(m_Physicochemicals->Unload())); - - for (auto itr : m_TissueKinetics) { - data.TissueKinetics().push_back(std::unique_ptr(itr.second->Unload())); - } -}; -//----------------------------------------------------------------------------- bool SESubstancePharmacokinetics::HasPhysicochemicals() const { return m_Physicochemicals == nullptr ? false : m_Physicochemicals->IsValid(); @@ -170,13 +154,29 @@ void SESubstancePharmacokinetics::RemoveTissueKinetics(const std::string& name) m_TissueKinetics.erase(name); } //----------------------------------------------------------------------------- +SESubstancePharmacokinetics& SESubstancePharmacokinetics::operator=(SESubstancePharmacokinetics const& rhs) +{ + if (this != &rhs) { + return *this; + } + + GetPhysicochemicals() = *rhs.GetPhysicochemicals(); + for (auto& [key, value] : rhs.m_TissueKinetics) { + + auto tissueKinetic = std::make_unique(*value); + m_TissueKinetics[key] = tissueKinetic.release(); + } + + return *this; +} +//----------------------------------------------------------------------------- bool SESubstancePharmacokinetics::operator==(const SESubstancePharmacokinetics& rhs) const { bool equivilant = (m_Physicochemicals && rhs.m_Physicochemicals) ? m_Physicochemicals->operator==(*rhs.m_Physicochemicals) : m_Physicochemicals == rhs.m_Physicochemicals; equivilant &= m_TissueKinetics.size() == rhs.m_TissueKinetics.size(); if (equivilant) { for (auto& pair : m_TissueKinetics) { - //auto lh = m_TissueKinetics.find(pair.first); + // auto lh = m_TissueKinetics.find(pair.first); auto rh = rhs.m_TissueKinetics.find(pair.first); if (rh != rhs.m_TissueKinetics.end()) { equivilant &= (pair.second && rh->second) ? *pair.second == *rh->second : pair.second == rh->second; diff --git a/projects/biogears/libBiogears/src/cdm/substance/SESubstancePhysicochemical.cpp b/projects/biogears/libBiogears/src/cdm/substance/SESubstancePhysicochemical.cpp index 97df26f88..0058472d0 100644 --- a/projects/biogears/libBiogears/src/cdm/substance/SESubstancePhysicochemical.cpp +++ b/projects/biogears/libBiogears/src/cdm/substance/SESubstancePhysicochemical.cpp @@ -9,41 +9,69 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **************************************************************************************/ +#include + +#include "io/cdm/Substance.h" #include -#include #include namespace biogears { +SESubstancePhysicochemical::SESubstancePhysicochemical(SESubstancePhysicochemical const& obj) + : Loggable(obj.GetLogger()) + , m_BindingProtein(obj.m_BindingProtein) + , m_BloodPlasmaRatio(new SEScalar(*obj.m_BloodPlasmaRatio)) + , m_FractionUnboundInPlasma(new SEScalarFraction(*obj.m_FractionUnboundInPlasma)) + , m_IonicState(obj.m_IonicState) + , m_LogP(new SEScalar(*obj.m_LogP)) + , m_HydrogenBondCount(new SEScalar(*obj.m_HydrogenBondCount)) + , m_PolarSurfaceArea(new SEScalar(*obj.m_PolarSurfaceArea)) +{ + for (auto adcPtr : obj.m_AcidDissociationConstants) { + m_AcidDissociationConstants.push_back(new SEScalar(*adcPtr)); + } +} SESubstancePhysicochemical::SESubstancePhysicochemical(Logger* logger) : Loggable(logger) + , m_AcidDissociationConstants() + , m_BindingProtein(decltype(m_BindingProtein)::Invalid) + , m_BloodPlasmaRatio(std::make_unique().release()) + , m_FractionUnboundInPlasma(std::make_unique().release()) + , m_IonicState(decltype(m_IonicState)::Invalid) + , m_LogP(std::make_unique().release()) + , m_HydrogenBondCount(std::make_unique().release()) + , m_PolarSurfaceArea(std::make_unique().release()) { - m_AcidDissociationConstants.clear(); - m_BindingProtein = (CDM::enumSubstanceBindingProtein::value)-1; - m_BloodPlasmaRatio = nullptr; - m_FractionUnboundInPlasma = nullptr; - m_IonicState = (CDM::enumSubstanceIonicState::value)-1; - m_LogP = nullptr; - m_HydrogenBondCount = nullptr; - m_PolarSurfaceArea = nullptr; } //----------------------------------------------------------------------------- SESubstancePhysicochemical::~SESubstancePhysicochemical() { - Clear(); -} -//----------------------------------------------------------------------------- -void SESubstancePhysicochemical::Clear() -{ - m_AcidDissociationConstants.clear(); - m_BindingProtein = (CDM::enumSubstanceBindingProtein::value)-1; + Invalidate(); + DELETE_CONTAINER_OF_POINTERS( m_AcidDissociationConstants); + //m_BindingProtein = SESubstanceBindingProtein::Invalid; SAFE_DELETE(m_BloodPlasmaRatio); SAFE_DELETE(m_FractionUnboundInPlasma); - m_IonicState = (CDM::enumSubstanceIonicState::value)-1; + //m_IonicState = SESubstanceIonicState::Invalid; SAFE_DELETE(m_LogP); SAFE_DELETE(m_HydrogenBondCount); SAFE_DELETE(m_PolarSurfaceArea); } +//----------------------------------------------------------------------------- +void SESubstancePhysicochemical::Invalidate() +{ + for (auto& ptr : m_AcidDissociationConstants) { + SAFE_DELETE(ptr); + } + m_AcidDissociationConstants.clear(); + + m_BindingProtein = (SESubstanceBindingProtein)-1; + m_BloodPlasmaRatio->Invalidate(); + m_FractionUnboundInPlasma->Invalidate(); + m_IonicState = (SESubstanceIonicState)-1; + m_LogP->Invalidate(); + m_HydrogenBondCount->Invalidate(); + m_PolarSurfaceArea->Invalidate(); +} //----------------------------------------------------------------------------- bool SESubstancePhysicochemical::IsValid() const { @@ -64,7 +92,7 @@ bool SESubstancePhysicochemical::IsValid() const //----------------------------------------------------------------------------- const SEScalar* SESubstancePhysicochemical::GetScalar(const char* name) { - return GetScalar(std::string{ name }); + return GetScalar(std::string { name }); } //----------------------------------------------------------------------------- const SEScalar* SESubstancePhysicochemical::GetScalar(const std::string& name) @@ -87,57 +115,6 @@ const SEScalar* SESubstancePhysicochemical::GetScalar(const std::string& name) return nullptr; } //----------------------------------------------------------------------------- -bool SESubstancePhysicochemical::Load(const CDM::SubstancePhysicochemicalData& in) -{ - Clear(); - - for (auto pKa : in.AcidDissociationConstant()) { - SEScalar* pKScalar = new SEScalar(); - pKScalar->Load(pKa); - m_AcidDissociationConstants.push_back(pKScalar); - } - m_BindingProtein = in.BindingProtein(); - GetBloodPlasmaRatio().Load(in.BloodPlasmaRatio()); - GetFractionUnboundInPlasma().Load(in.FractionUnboundInPlasma()); - SetIonicState(in.IonicState()); - GetLogP().Load(in.LogP()); - if (in.HydrogenBondCount().present()) - GetHydrogenBondCount().Load(in.HydrogenBondCount().get()); - if (in.PolarSurfaceArea().present()) - GetPolarSurfaceArea().Load(in.PolarSurfaceArea().get()); - return true; -} -//----------------------------------------------------------------------------- -CDM::SubstancePhysicochemicalData* SESubstancePhysicochemical::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::SubstancePhysicochemicalData* data = new CDM::SubstancePhysicochemicalData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SESubstancePhysicochemical::Unload(CDM::SubstancePhysicochemicalData& data) const -{ - for (auto pKa : m_AcidDissociationConstants) { - data.AcidDissociationConstant().push_back(std::unique_ptr(pKa->Unload())); - } - if (HasBindingProtein()) - data.BindingProtein(m_BindingProtein); - if (HasBloodPlasmaRatio()) - data.BloodPlasmaRatio(std::unique_ptr(m_BloodPlasmaRatio->Unload())); - if (HasFractionUnboundInPlasma()) - data.FractionUnboundInPlasma(std::unique_ptr(m_FractionUnboundInPlasma->Unload())); - if (HasIonicState()) - data.IonicState(m_IonicState); - if (HasLogP()) - data.LogP(std::unique_ptr(m_LogP->Unload())); - if (HasHydrogenBondCount()) - data.HydrogenBondCount(std::unique_ptr(m_HydrogenBondCount->Unload())); - if (HasPolarSurfaceArea()) - data.PolarSurfaceArea(std::unique_ptr(m_PolarSurfaceArea->Unload())); -}; -//----------------------------------------------------------------------------- bool SESubstancePhysicochemical::HasPrimaryPKA() const { return (!m_AcidDissociationConstants.empty()); @@ -171,26 +148,26 @@ SEScalar& SESubstancePhysicochemical::GetSecondaryPKA() } double SESubstancePhysicochemical::GetSecondaryPKA() const { - if (m_AcidDissociationConstants.size()<2) + if (m_AcidDissociationConstants.size() < 2) return SEScalar::dNaN(); return m_AcidDissociationConstants[1]->GetValue(); } ////----------------------------------------------------------------------------- -CDM::enumSubstanceBindingProtein::value SESubstancePhysicochemical::GetBindingProtein() const +SESubstanceBindingProtein SESubstancePhysicochemical::GetBindingProtein() const { return m_BindingProtein; } -void SESubstancePhysicochemical::SetBindingProtein(CDM::enumSubstanceBindingProtein::value protein) +void SESubstancePhysicochemical::SetBindingProtein(SESubstanceBindingProtein protein) { m_BindingProtein = protein; } bool SESubstancePhysicochemical::HasBindingProtein() const { - return m_BindingProtein == ((CDM::enumSubstanceBindingProtein::value)-1) ? false : true; + return m_BindingProtein == SESubstanceBindingProtein::Invalid ? false : true; } void SESubstancePhysicochemical::InvalidateBindingProtein() { - m_BindingProtein = (CDM::enumSubstanceBindingProtein::value)-1; + m_BindingProtein = (SESubstanceBindingProtein)-1; } //----------------------------------------------------------------------------- bool SESubstancePhysicochemical::HasBloodPlasmaRatio() const @@ -227,21 +204,21 @@ double SESubstancePhysicochemical::GetFractionUnboundInPlasma() const return m_FractionUnboundInPlasma->GetValue(); } //----------------------------------------------------------------------------- -CDM::enumSubstanceIonicState::value SESubstancePhysicochemical::GetIonicState() const +SESubstanceIonicState SESubstancePhysicochemical::GetIonicState() const { return m_IonicState; } -void SESubstancePhysicochemical::SetIonicState(CDM::enumSubstanceIonicState::value state) +void SESubstancePhysicochemical::SetIonicState(SESubstanceIonicState state) { m_IonicState = state; } bool SESubstancePhysicochemical::HasIonicState() const { - return m_IonicState == ((CDM::enumSubstanceIonicState::value)-1) ? false : true; + return m_IonicState == SESubstanceIonicState::Invalid ? false : true; } void SESubstancePhysicochemical::InvalidateIonicState() { - m_IonicState = (CDM::enumSubstanceIonicState::value)-1; + m_IonicState = (SESubstanceIonicState)-1; } //----------------------------------------------------------------------------- bool SESubstancePhysicochemical::HasLogP() const @@ -295,12 +272,25 @@ double SESubstancePhysicochemical::GetPolarSurfaceArea() const return SEScalar::dNaN(); return m_PolarSurfaceArea->GetValue(); } - //------------------------------------------------------------------------------- -bool SESubstancePhysicochemical::operator==( const SESubstancePhysicochemical& rhs) const +SESubstancePhysicochemical& SESubstancePhysicochemical::operator=(const SESubstancePhysicochemical& rhs) +{ + if (this != &rhs) { + m_BindingProtein = rhs.GetBindingProtein(); + GetBloodPlasmaRatio() = rhs.GetBloodPlasmaRatio(); + GetFractionUnboundInPlasma() = rhs.GetFractionUnboundInPlasma(); + m_IonicState = rhs.GetIonicState(); + GetLogP() = rhs.GetLogP(); + GetHydrogenBondCount() = rhs.GetHydrogenBondCount(); + GetPolarSurfaceArea() = rhs.GetPolarSurfaceArea(); + } + return *this; +} +//------------------------------------------------------------------------------- +bool SESubstancePhysicochemical::operator==(const SESubstancePhysicochemical& rhs) const { -bool equivilant = m_BindingProtein == rhs.m_BindingProtein; + bool equivilant = m_BindingProtein == rhs.m_BindingProtein; equivilant &= m_IonicState == rhs.m_IonicState; equivilant &= (m_BloodPlasmaRatio && rhs.m_BloodPlasmaRatio) ? m_BloodPlasmaRatio->operator==(*rhs.m_BloodPlasmaRatio) : m_BloodPlasmaRatio == rhs.m_BloodPlasmaRatio; equivilant &= (m_FractionUnboundInPlasma && rhs.m_FractionUnboundInPlasma) ? m_FractionUnboundInPlasma->operator==(*rhs.m_FractionUnboundInPlasma) : m_FractionUnboundInPlasma == rhs.m_FractionUnboundInPlasma; @@ -308,17 +298,17 @@ bool equivilant = m_BindingProtein == rhs.m_BindingProtein; equivilant &= (m_HydrogenBondCount && rhs.m_HydrogenBondCount) ? m_HydrogenBondCount->operator==(*rhs.m_HydrogenBondCount) : m_HydrogenBondCount == rhs.m_HydrogenBondCount; equivilant &= (m_PolarSurfaceArea && rhs.m_PolarSurfaceArea) ? m_PolarSurfaceArea->operator==(*rhs.m_PolarSurfaceArea) : m_PolarSurfaceArea == rhs.m_PolarSurfaceArea; equivilant &= m_AcidDissociationConstants.size() == rhs.m_AcidDissociationConstants.size(); - if(equivilant){ - for ( auto i = 0; i< m_AcidDissociationConstants.size(); ++i){ - equivilant &= (m_AcidDissociationConstants[i] && rhs.m_AcidDissociationConstants[i]) - ? m_AcidDissociationConstants[i]->operator==(*rhs.m_AcidDissociationConstants[i]) - : m_AcidDissociationConstants[i] == rhs.m_AcidDissociationConstants[i]; + if (equivilant) { + for (auto i = 0; i < m_AcidDissociationConstants.size(); ++i) { + equivilant &= (m_AcidDissociationConstants[i] && rhs.m_AcidDissociationConstants[i]) + ? m_AcidDissociationConstants[i]->operator==(*rhs.m_AcidDissociationConstants[i]) + : m_AcidDissociationConstants[i] == rhs.m_AcidDissociationConstants[i]; } } return equivilant; } //------------------------------------------------------------------------------- -bool SESubstancePhysicochemical::operator!=( const SESubstancePhysicochemical& rhs) const +bool SESubstancePhysicochemical::operator!=(const SESubstancePhysicochemical& rhs) const { return !(*this == rhs); } diff --git a/projects/biogears/libBiogears/src/cdm/substance/SESubstancePhysicochemicals.cpp b/projects/biogears/libBiogears/src/cdm/substance/SESubstancePhysicochemicals.cpp deleted file mode 100644 index 5c21f317c..000000000 --- a/projects/biogears/libBiogears/src/cdm/substance/SESubstancePhysicochemicals.cpp +++ /dev/null @@ -1,330 +0,0 @@ -/************************************************************************************** -Copyright 2015 Applied Research Associates, Inc. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the License -at: -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software distributed under -the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -CONDITIONS OF ANY KIND, either express or implied. See the License for the -specific language governing permissions and limitations under the License. -**************************************************************************************/ - -#include -#include -#include - -namespace biogears { -SESubstancePhysicochemicals::SESubstancePhysicochemicals(Logger* logger) - : Loggable(logger) -{ - m_AcidDissociationConstants.clear(); - m_BindingProtein = (CDM::enumSubstanceBindingProtein::value)-1; - m_BloodPlasmaRatio = nullptr; - m_FractionUnboundInPlasma = nullptr; - m_IonicState = (CDM::enumSubstanceIonicState::value)-1; - m_LogP = nullptr; - m_HydrogenBondCount = nullptr; - m_PolarSurfaceArea = nullptr; -} -//----------------------------------------------------------------------------- -SESubstancePhysicochemicals::~SESubstancePhysicochemicals() -{ - Clear(); -} -//----------------------------------------------------------------------------- -void SESubstancePhysicochemicals::Clear() -{ - m_AcidDissociationConstants.clear(); - m_BindingProtein = (CDM::enumSubstanceBindingProtein::value)-1; - SAFE_DELETE(m_BloodPlasmaRatio); - SAFE_DELETE(m_FractionUnboundInPlasma); - m_IonicState = (CDM::enumSubstanceIonicState::value)-1; - SAFE_DELETE(m_LogP); - SAFE_DELETE(m_HydrogenBondCount); - SAFE_DELETE(m_PolarSurfaceArea); -} -//----------------------------------------------------------------------------- -bool SESubstancePhysicochemicals::IsValid() const -{ - if (!HasPrimaryPKA()) - return false; - if (!HasBindingProtein()) - return false; - if (!HasBloodPlasmaRatio()) - return false; - if (!HasFractionUnboundInPlasma()) - return false; - if (!HasIonicState()) - return false; - if (!HasLogP()) - return false; - return true; -} -//----------------------------------------------------------------------------- -const SEScalar* SESubstancePhysicochemicals::GetScalar(const char* name) -{ - return GetScalar(std::string{ name }); -} -//----------------------------------------------------------------------------- -const SEScalar* SESubstancePhysicochemicals::GetScalar(const std::string& name) -{ - if (name.compare("PrimaryPKA") == 0) - return &GetPrimaryPKA(); - if (name.compare("SecondaryPKA") == 0) - return &GetSecondaryPKA(); - if (name.compare("BloodPlasmaRatio") == 0) - return &GetBloodPlasmaRatio(); - if (name.compare("FractionUnboundInPlasma") == 0) - return &GetFractionUnboundInPlasma(); - if (name.compare("LogP") == 0) - return &GetLogP(); - if (name.compare("HydrogenBondCount") == 0) - return &GetHydrogenBondCount(); - if (name.compare("PolarSurfaceArea") == 0) - return &GetPolarSurfaceArea(); - - return nullptr; -} -//----------------------------------------------------------------------------- -bool SESubstancePhysicochemicals::Load(const CDM::SubstancePhysicochemicalData& in) -{ - Clear(); - - for (auto pKa : in.AcidDissociationConstant()) { - SEScalar* pKScalar = new SEScalar(); - pKScalar->Load(pKa); - m_AcidDissociationConstants.push_back(pKScalar); - } - m_BindingProtein = in.BindingProtein(); - GetBloodPlasmaRatio().Load(in.BloodPlasmaRatio()); - GetFractionUnboundInPlasma().Load(in.FractionUnboundInPlasma()); - SetIonicState(in.IonicState()); - GetLogP().Load(in.LogP()); - if (in.HydrogenBondCount().present()) - GetHydrogenBondCount().Load(in.HydrogenBondCount().get()); - if (in.PolarSurfaceArea().present()) - GetPolarSurfaceArea().Load(in.PolarSurfaceArea().get()); - return true; -} -//----------------------------------------------------------------------------- -CDM::SubstancePhysicochemicalData* SESubstancePhysicochemicals::Unload() const -{ - if (!IsValid()) - return nullptr; - CDM::SubstancePhysicochemicalData* data = new CDM::SubstancePhysicochemicalData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SESubstancePhysicochemicals::Unload(CDM::SubstancePhysicochemicalData& data) const -{ - for (auto pKa : m_AcidDissociationConstants) { - data.AcidDissociationConstant().push_back(std::unique_ptr(pKa->Unload())); - } - if (HasBindingProtein()) - data.BindingProtein(m_BindingProtein); - if (HasBloodPlasmaRatio()) - data.BloodPlasmaRatio(std::unique_ptr(m_BloodPlasmaRatio->Unload())); - if (HasFractionUnboundInPlasma()) - data.FractionUnboundInPlasma(std::unique_ptr(m_FractionUnboundInPlasma->Unload())); - if (HasIonicState()) - data.IonicState(m_IonicState); - if (HasLogP()) - data.LogP(std::unique_ptr(m_LogP->Unload())); - if (HasHydrogenBondCount()) - data.HydrogenBondCount(std::unique_ptr(m_HydrogenBondCount->Unload())); - if (HasPolarSurfaceArea()) - data.PolarSurfaceArea(std::unique_ptr(m_PolarSurfaceArea->Unload())); -}; -//----------------------------------------------------------------------------- -bool SESubstancePhysicochemicals::HasPrimaryPKA() const -{ - return (!m_AcidDissociationConstants.empty()); -} -SEScalar& SESubstancePhysicochemicals::GetPrimaryPKA() -{ - if (m_AcidDissociationConstants.empty()) { - SEScalar* pKA1 = new SEScalar(); - m_AcidDissociationConstants.push_back(pKA1); - } - return *m_AcidDissociationConstants[0]; -} -double SESubstancePhysicochemicals::GetPrimaryPKA() const -{ - if (m_AcidDissociationConstants.empty()) - return SEScalar::dNaN(); - return m_AcidDissociationConstants[0]->GetValue(); -} -//----------------------------------------------------------------------------- -bool SESubstancePhysicochemicals::HasSecondaryPKA() const -{ - return m_AcidDissociationConstants.size() < 2 ? false : true; -} -SEScalar& SESubstancePhysicochemicals::GetSecondaryPKA() -{ - if (m_AcidDissociationConstants.size() < 2) { - SEScalar* pKA2 = new SEScalar(); - m_AcidDissociationConstants.push_back(pKA2); - } - return *m_AcidDissociationConstants[1]; -} -double SESubstancePhysicochemicals::GetSecondaryPKA() const -{ - if (m_AcidDissociationConstants.size()<2) - return SEScalar::dNaN(); - return m_AcidDissociationConstants[1]->GetValue(); -} -////----------------------------------------------------------------------------- -CDM::enumSubstanceBindingProtein::value SESubstancePhysicochemicals::GetBindingProtein() const -{ - return m_BindingProtein; -} -void SESubstancePhysicochemicals::SetBindingProtein(CDM::enumSubstanceBindingProtein::value protein) -{ - m_BindingProtein = protein; -} -bool SESubstancePhysicochemicals::HasBindingProtein() const -{ - return m_BindingProtein == ((CDM::enumSubstanceBindingProtein::value)-1) ? false : true; -} -void SESubstancePhysicochemicals::InvalidateBindingProtein() -{ - m_BindingProtein = (CDM::enumSubstanceBindingProtein::value)-1; -} -//----------------------------------------------------------------------------- -bool SESubstancePhysicochemicals::HasBloodPlasmaRatio() const -{ - return (m_BloodPlasmaRatio == nullptr) ? false : m_BloodPlasmaRatio->IsValid(); -} -SEScalar& SESubstancePhysicochemicals::GetBloodPlasmaRatio() -{ - if (m_BloodPlasmaRatio == nullptr) - m_BloodPlasmaRatio = new SEScalar(); - return *m_BloodPlasmaRatio; -} -double SESubstancePhysicochemicals::GetBloodPlasmaRatio() const -{ - if (m_BloodPlasmaRatio == nullptr) - return SEScalar::dNaN(); - return m_BloodPlasmaRatio->GetValue(); -} -//----------------------------------------------------------------------------- -bool SESubstancePhysicochemicals::HasFractionUnboundInPlasma() const -{ - return (m_FractionUnboundInPlasma == nullptr) ? false : m_FractionUnboundInPlasma->IsValid(); -} -SEScalarFraction& SESubstancePhysicochemicals::GetFractionUnboundInPlasma() -{ - if (m_FractionUnboundInPlasma == nullptr) - m_FractionUnboundInPlasma = new SEScalarFraction(); - return *m_FractionUnboundInPlasma; -} -double SESubstancePhysicochemicals::GetFractionUnboundInPlasma() const -{ - if (m_FractionUnboundInPlasma == nullptr) - return SEScalar::dNaN(); - return m_FractionUnboundInPlasma->GetValue(); -} -//----------------------------------------------------------------------------- -CDM::enumSubstanceIonicState::value SESubstancePhysicochemicals::GetIonicState() const -{ - return m_IonicState; -} -void SESubstancePhysicochemicals::SetIonicState(CDM::enumSubstanceIonicState::value state) -{ - m_IonicState = state; -} -bool SESubstancePhysicochemicals::HasIonicState() const -{ - return m_IonicState == ((CDM::enumSubstanceIonicState::value)-1) ? false : true; -} -void SESubstancePhysicochemicals::InvalidateIonicState() -{ - m_IonicState = (CDM::enumSubstanceIonicState::value)-1; -} -//----------------------------------------------------------------------------- -bool SESubstancePhysicochemicals::HasLogP() const -{ - return (m_LogP == nullptr) ? false : m_LogP->IsValid(); -} -SEScalar& SESubstancePhysicochemicals::GetLogP() -{ - if (m_LogP == nullptr) - m_LogP = new SEScalar(); - return *m_LogP; -} -double SESubstancePhysicochemicals::GetLogP() const -{ - if (m_LogP == nullptr) - return SEScalar::dNaN(); - return m_LogP->GetValue(); -} - -//----------------------------------------------------------------------------- -bool SESubstancePhysicochemicals::HasHydrogenBondCount() const -{ - return (m_HydrogenBondCount == nullptr) ? false : m_HydrogenBondCount->IsValid(); -} -SEScalar& SESubstancePhysicochemicals::GetHydrogenBondCount() -{ - if (m_HydrogenBondCount == nullptr) - m_HydrogenBondCount = new SEScalar(); - return *m_HydrogenBondCount; -} -double SESubstancePhysicochemicals::GetHydrogenBondCount() const -{ - if (m_HydrogenBondCount == nullptr) - return SEScalar::dNaN(); - return m_HydrogenBondCount->GetValue(); -} -//----------------------------------------------------------------------------- -bool SESubstancePhysicochemicals::HasPolarSurfaceArea() const -{ - return (m_PolarSurfaceArea == nullptr) ? false : m_PolarSurfaceArea->IsValid(); -} -SEScalar& SESubstancePhysicochemicals::GetPolarSurfaceArea() -{ - if (m_PolarSurfaceArea == nullptr) - m_PolarSurfaceArea = new SEScalar(); - return *m_PolarSurfaceArea; -} -double SESubstancePhysicochemicals::GetPolarSurfaceArea() const -{ - if (m_PolarSurfaceArea == nullptr) - return SEScalar::dNaN(); - return m_PolarSurfaceArea->GetValue(); -} - -//------------------------------------------------------------------------------- -bool SESubstancePhysicochemicals::operator==( const SESubstancePhysicochemicals& rhs) const -{ - /* - std::vector m_AcidDissociationConstants; - - -}; - */ -bool equivilant = m_BindingProtein == rhs.m_BindingProtein; - equivilant &= m_IonicState == rhs.m_IonicState; - equivilant &= (m_BloodPlasmaRatio && rhs.m_BloodPlasmaRatio) ? m_BloodPlasmaRatio->operator==(*rhs.m_BloodPlasmaRatio) : m_BloodPlasmaRatio == rhs.m_BloodPlasmaRatio; - equivilant &= (m_FractionUnboundInPlasma && rhs.m_FractionUnboundInPlasma) ? m_FractionUnboundInPlasma->operator==(*rhs.m_FractionUnboundInPlasma) : m_FractionUnboundInPlasma == rhs.m_FractionUnboundInPlasma; - equivilant &= (m_LogP && rhs.m_LogP) ? m_LogP->operator==(*rhs.m_LogP) : m_LogP == rhs.m_LogP; - equivilant &= (m_HydrogenBondCount && rhs.m_HydrogenBondCount) ? m_HydrogenBondCount->operator==(*rhs.m_HydrogenBondCount) : m_HydrogenBondCount == rhs.m_HydrogenBondCount; - equivilant &= (m_PolarSurfaceArea && rhs.m_PolarSurfaceArea) ? m_PolarSurfaceArea->operator==(*rhs.m_PolarSurfaceArea) : m_PolarSurfaceArea == rhs.m_PolarSurfaceArea; - equivilant &= m_AcidDissociationConstants.size() == rhs.m_AcidDissociationConstants.size(); - if(equivilant){ - for ( auto i = 0; i< m_AcidDissociationConstants.size(); ++i){ - equivilant &= (m_AcidDissociationConstants[i] && rhs.m_AcidDissociationConstants[i]) - ? m_AcidDissociationConstants[i]->operator==(*rhs.m_AcidDissociationConstants[i]) - : m_AcidDissociationConstants[i] == rhs.m_AcidDissociationConstants[i]; - } - } - return equivilant; -} -//------------------------------------------------------------------------------- -bool SESubstancePhysicochemicals::operator!=( const SESubstancePhysicochemicals& rhs) const -{ - return !(*this == rhs); -} -} \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/cdm/substance/SESubstanceTissuePharmacokinetics.cpp b/projects/biogears/libBiogears/src/cdm/substance/SESubstanceTissuePharmacokinetics.cpp index 379d1f704..86f7c1a93 100644 --- a/projects/biogears/libBiogears/src/cdm/substance/SESubstanceTissuePharmacokinetics.cpp +++ b/projects/biogears/libBiogears/src/cdm/substance/SESubstanceTissuePharmacokinetics.cpp @@ -10,56 +10,43 @@ CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **************************************************************************************/ - #include +#include "io/cdm/Substance.h" + #include #include namespace biogears { +SESubstanceTissuePharmacokinetics::SESubstanceTissuePharmacokinetics(SESubstanceTissuePharmacokinetics const& obj) + : Loggable(obj.GetLogger()) + , m_Name(obj.GetName()) + , m_PartitionCoefficient(std::make_unique(*obj.m_PartitionCoefficient).release()) +{ +} SESubstanceTissuePharmacokinetics::SESubstanceTissuePharmacokinetics(const std::string& name, Logger* logger) : Loggable(logger) , m_Name(name) + , m_PartitionCoefficient(std::make_unique().release()) { - m_PartitionCoefficient = nullptr; } //----------------------------------------------------------------------------- + SESubstanceTissuePharmacokinetics::~SESubstanceTissuePharmacokinetics() { - Clear(); -} -//----------------------------------------------------------------------------- -void SESubstanceTissuePharmacokinetics::Clear() -{ - ; + Invalidate(); SAFE_DELETE(m_PartitionCoefficient) } //----------------------------------------------------------------------------- -bool SESubstanceTissuePharmacokinetics::Load(const CDM::SubstanceTissuePharmacokineticsData& in) +void SESubstanceTissuePharmacokinetics::Invalidate() { - Clear(); - if (in.PartitionCoefficient().present()) - GetPartitionCoefficient().Load(in.PartitionCoefficient().get()); - return true; -} -//----------------------------------------------------------------------------- -CDM::SubstanceTissuePharmacokineticsData* SESubstanceTissuePharmacokinetics::Unload() const -{ - CDM::SubstanceTissuePharmacokineticsData* data = new CDM::SubstanceTissuePharmacokineticsData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SESubstanceTissuePharmacokinetics::Unload(CDM::SubstanceTissuePharmacokineticsData& data) const -{ - data.Name(m_Name); - if (m_PartitionCoefficient != nullptr) - data.PartitionCoefficient(std::unique_ptr(m_PartitionCoefficient->Unload())); + m_PartitionCoefficient->Invalidate(); } + //----------------------------------------------------------------------------- const SEScalar* SESubstanceTissuePharmacokinetics::GetScalar(const char* name) { - return GetScalar(std::string{ name }); + return GetScalar(std::string { name }); } //----------------------------------------------------------------------------- const SEScalar* SESubstanceTissuePharmacokinetics::GetScalar(const std::string& name) @@ -100,14 +87,14 @@ double SESubstanceTissuePharmacokinetics::GetPartitionCoefficient() const } //----------------------------------------------------------------------------- //------------------------------------------------------------------------------- -bool SESubstanceTissuePharmacokinetics::operator==( const SESubstanceTissuePharmacokinetics& rhs) const +bool SESubstanceTissuePharmacokinetics::operator==(const SESubstanceTissuePharmacokinetics& rhs) const { bool equivilant = m_Name == rhs.m_Name; equivilant &= (m_PartitionCoefficient && rhs.m_PartitionCoefficient) ? m_PartitionCoefficient->operator==(*rhs.m_PartitionCoefficient) : m_PartitionCoefficient == rhs.m_PartitionCoefficient; return equivilant; } //------------------------------------------------------------------------------- -bool SESubstanceTissuePharmacokinetics::operator!=( const SESubstanceTissuePharmacokinetics& rhs) const +bool SESubstanceTissuePharmacokinetics::operator!=(const SESubstanceTissuePharmacokinetics& rhs) const { return !(*this == rhs); } diff --git a/projects/biogears/libBiogears/src/cdm/substance/SESubstanceTransport.cpp b/projects/biogears/libBiogears/src/cdm/substance/SESubstanceTransport.cpp index ec44c23cd..508b95d79 100644 --- a/projects/biogears/libBiogears/src/cdm/substance/SESubstanceTransport.cpp +++ b/projects/biogears/libBiogears/src/cdm/substance/SESubstanceTransport.cpp @@ -12,26 +12,28 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/Substance.h" + namespace biogears { -template class SESubstanceTransportAmount; -template class SESubstanceTransportAmount; +template class BIOGEARS_API SESubstanceTransportAmount; +template class BIOGEARS_API SESubstanceTransportAmount; -template class SESubstanceTransportVertex; -template class SESubstanceTransportVertex; +template class BIOGEARS_API SESubstanceTransportVertex; +template class BIOGEARS_API SESubstanceTransportVertex; -template class SESubstanceTransportEdge; -template class SESubstanceTransportEdge; +template class BIOGEARS_API SESubstanceTransportEdge; +template class BIOGEARS_API SESubstanceTransportEdge; -template class SESubstanceTransportGraph; -template class SESubstanceTransportGraph; +template class BIOGEARS_API SESubstanceTransportGraph; +template class BIOGEARS_API SESubstanceTransportGraph; -template class SESubstanceTransporter; -template class SESubstanceTransporter; +template class BIOGEARS_API SESubstanceTransporter; +template class BIOGEARS_API SESubstanceTransporter; -template bool operator==(SESubstanceTransportVertex const& lhs, SESubstanceTransportVertex const& rhs); -template bool operator==(SESubstanceTransportVertex const& lhs, SESubstanceTransportVertex const& rhs); -template bool operator!=(SESubstanceTransportVertex const& lhs, SESubstanceTransportVertex const& rhs); -template bool operator!=(SESubstanceTransportVertex const& lhs, SESubstanceTransportVertex const& rhs); +template bool BIOGEARS_API operator==(SESubstanceTransportVertex const& lhs, SESubstanceTransportVertex const& rhs); +template bool BIOGEARS_API operator==(SESubstanceTransportVertex const& lhs, SESubstanceTransportVertex const& rhs); +template bool BIOGEARS_API operator!=(SESubstanceTransportVertex const& lhs, SESubstanceTransportVertex const& rhs); +template bool BIOGEARS_API operator!=(SESubstanceTransportVertex const& lhs, SESubstanceTransportVertex const& rhs); } diff --git a/projects/biogears/libBiogears/src/cdm/system/SESystem.cpp b/projects/biogears/libBiogears/src/cdm/system/SESystem.cpp index 903998b86..d3f478414 100644 --- a/projects/biogears/libBiogears/src/cdm/system/SESystem.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/SESystem.cpp @@ -10,7 +10,7 @@ CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **************************************************************************************/ #include - +#include "io/cdm/System.h" namespace biogears { SESystem::SESystem(Logger* logger) @@ -20,20 +20,10 @@ SESystem::SESystem(Logger* logger) //------------------------------------------------------------------------------- SESystem::~SESystem() { - Clear(); -} -//------------------------------------------------------------------------------- -void SESystem::Clear() -{ -} -//------------------------------------------------------------------------------- -bool SESystem::Load(const CDM::SystemData& in) -{ - Clear(); - return true; + Invalidate(); } //------------------------------------------------------------------------------- -void SESystem::Unload(CDM::SystemData& data) const +void SESystem::Invalidate() { } //------------------------------------------------------------------------------- diff --git a/projects/biogears/libBiogears/src/cdm/system/environment/SEActiveCooling.cpp b/projects/biogears/libBiogears/src/cdm/system/environment/SEActiveCooling.cpp index 1e67dcb68..7f05618a8 100644 --- a/projects/biogears/libBiogears/src/cdm/system/environment/SEActiveCooling.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/environment/SEActiveCooling.cpp @@ -28,10 +28,10 @@ SEActiveCooling::SEActiveCooling(Logger* logger) //----------------------------------------------------------------------------- SEActiveCooling::~SEActiveCooling() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SEActiveCooling::Clear() +void SEActiveCooling::Invalidate() { SAFE_DELETE(m_Power); SAFE_DELETE(m_SurfaceArea); @@ -40,7 +40,7 @@ void SEActiveCooling::Clear() //----------------------------------------------------------------------------- void SEActiveCooling::Reset() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- const SEScalar* SEActiveCooling::GetScalar(const char* name) @@ -59,33 +59,6 @@ const SEScalar* SEActiveCooling::GetScalar(const std::string& name) return nullptr; } //----------------------------------------------------------------------------- -bool SEActiveCooling::Load(const CDM::ActiveCoolingData& in, std::default_random_engine *rd) -{ - GetPower().Load(in.Power(), rd); - if (in.SurfaceArea().present()) - GetSurfaceArea().Load(in.SurfaceArea().get(), rd); - if (in.SurfaceAreaFraction().present()) - GetSurfaceAreaFraction().Load(in.SurfaceAreaFraction().get(), rd); - return true; -} -//----------------------------------------------------------------------------- -CDM::ActiveCoolingData* SEActiveCooling::Unload() const -{ - CDM::ActiveCoolingData* data = new CDM::ActiveCoolingData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEActiveCooling::Unload(CDM::ActiveCoolingData& data) const -{ - if (HasPower()) - data.Power(std::unique_ptr(m_Power->Unload())); - if (HasSurfaceArea()) - data.SurfaceArea(std::unique_ptr(m_SurfaceArea->Unload())); - if (HasSurfaceAreaFraction()) - data.SurfaceAreaFraction(std::unique_ptr(m_SurfaceAreaFraction->Unload())); -} -//----------------------------------------------------------------------------- bool SEActiveCooling::HasPower() const { return m_Power == nullptr ? false : m_Power->IsValid(); @@ -155,6 +128,13 @@ void SEActiveCooling::ToString(std::ostream& str) const str << std::flush; } //----------------------------------------------------------------------------- +bool SEActiveCooling::IsValid() const +{ + return m_Power + || m_SurfaceArea + || m_SurfaceAreaFraction; +} +//----------------------------------------------------------------------------- bool SEActiveCooling::operator==(SEActiveCooling const& rhs) const { if (this == &rhs) diff --git a/projects/biogears/libBiogears/src/cdm/system/environment/SEActiveHeating.cpp b/projects/biogears/libBiogears/src/cdm/system/environment/SEActiveHeating.cpp index b845a8de0..001044f26 100644 --- a/projects/biogears/libBiogears/src/cdm/system/environment/SEActiveHeating.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/environment/SEActiveHeating.cpp @@ -28,10 +28,10 @@ SEActiveHeating::SEActiveHeating(Logger* logger) //----------------------------------------------------------------------------- SEActiveHeating::~SEActiveHeating() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SEActiveHeating::Clear() +void SEActiveHeating::Invalidate() { SAFE_DELETE(m_Power); SAFE_DELETE(m_SurfaceArea); @@ -40,12 +40,12 @@ void SEActiveHeating::Clear() //----------------------------------------------------------------------------- void SEActiveHeating::Reset() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- const SEScalar* SEActiveHeating::GetScalar(const char* name) { - return GetScalar(std::string{ name }); + return GetScalar(std::string { name }); } //----------------------------------------------------------------------------- const SEScalar* SEActiveHeating::GetScalar(const std::string& name) @@ -59,32 +59,6 @@ const SEScalar* SEActiveHeating::GetScalar(const std::string& name) return nullptr; } //----------------------------------------------------------------------------- -bool SEActiveHeating::Load(const CDM::ActiveHeatingData& in, std::default_random_engine *rd) -{ - GetPower().Load(in.Power(), rd); - if (in.SurfaceArea().present()) - GetSurfaceArea().Load(in.SurfaceArea().get(), rd); - if (in.SurfaceAreaFraction().present()) - GetSurfaceAreaFraction().Load(in.SurfaceAreaFraction().get(), rd); - return true; -} -//----------------------------------------------------------------------------- -CDM::ActiveHeatingData* SEActiveHeating::Unload() const -{ - CDM::ActiveHeatingData* data = new CDM::ActiveHeatingData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEActiveHeating::Unload(CDM::ActiveHeatingData& data) const -{ - data.Power(std::unique_ptr(m_Power->Unload())); - if (HasSurfaceArea()) - data.SurfaceArea(std::unique_ptr(m_SurfaceArea->Unload())); - if (HasSurfaceAreaFraction()) - data.SurfaceAreaFraction(std::unique_ptr(m_SurfaceAreaFraction->Unload())); -} -//----------------------------------------------------------------------------- bool SEActiveHeating::HasPower() const { return m_Power == nullptr ? false : m_Power->IsValid(); @@ -154,6 +128,13 @@ void SEActiveHeating::ToString(std::ostream& str) const str << std::flush; } //----------------------------------------------------------------------------- +bool SEActiveHeating::IsValid() const +{ + return m_Power + || m_SurfaceArea + || m_SurfaceAreaFraction; +} +//----------------------------------------------------------------------------- bool SEActiveHeating::operator==(SEActiveHeating const& rhs) const { if (this == &rhs) diff --git a/projects/biogears/libBiogears/src/cdm/system/environment/SEAppliedTemperature.cpp b/projects/biogears/libBiogears/src/cdm/system/environment/SEAppliedTemperature.cpp index ddd037a85..2559ac9a3 100644 --- a/projects/biogears/libBiogears/src/cdm/system/environment/SEAppliedTemperature.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/environment/SEAppliedTemperature.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include #include #include #include @@ -24,20 +25,20 @@ SEAppliedTemperature::SEAppliedTemperature(Logger* logger) m_Temperature = nullptr; m_SurfaceArea = nullptr; m_SurfaceAreaFraction = nullptr; - m_State = CDM::enumOnOff::On; + m_State = SEOnOff::On; } //----------------------------------------------------------------------------- SEAppliedTemperature::~SEAppliedTemperature() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SEAppliedTemperature::Clear() +void SEAppliedTemperature::Invalidate() { SAFE_DELETE(m_Temperature); SAFE_DELETE(m_SurfaceArea); SAFE_DELETE(m_SurfaceAreaFraction); - m_State = CDM::enumOnOff::On; + m_State = SEOnOff::On; } //----------------------------------------------------------------------------- const SEScalar* SEAppliedTemperature::GetScalar(const char* name) @@ -56,38 +57,6 @@ const SEScalar* SEAppliedTemperature::GetScalar(const std::string& name) return nullptr; } //----------------------------------------------------------------------------- -bool SEAppliedTemperature::Load(const CDM::AppliedTemperatureData& in, std::default_random_engine *rd) -{ - Clear(); - if (in.State().present()) - m_State = in.State().get(); - if (in.Temperature().present()) - GetTemperature().Load(in.Temperature().get(), rd); - if (in.SurfaceArea().present()) - GetSurfaceArea().Load(in.SurfaceArea().get(), rd); - if (in.SurfaceAreaFraction().present()) - GetSurfaceAreaFraction().Load(in.SurfaceAreaFraction().get(), rd); - return true; -} -//----------------------------------------------------------------------------- -CDM::AppliedTemperatureData* SEAppliedTemperature::Unload() const -{ - CDM::AppliedTemperatureData* data = new CDM::AppliedTemperatureData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEAppliedTemperature::Unload(CDM::AppliedTemperatureData& data) const -{ - if (HasTemperature()) - data.Temperature(std::unique_ptr(m_Temperature->Unload())); - if (HasSurfaceArea()) - data.SurfaceArea(std::unique_ptr(m_SurfaceArea->Unload())); - if (HasSurfaceAreaFraction()) - data.SurfaceAreaFraction(std::unique_ptr(m_SurfaceAreaFraction->Unload())); - data.State(m_State); -} -//----------------------------------------------------------------------------- bool SEAppliedTemperature::HasTemperature() const { return m_Temperature == nullptr ? false : m_Temperature->IsValid(); @@ -145,12 +114,12 @@ double SEAppliedTemperature::GetSurfaceAreaFraction() const return m_SurfaceAreaFraction->GetValue(); } //----------------------------------------------------------------------------- -CDM::enumOnOff::value SEAppliedTemperature::GetState() const +SEOnOff SEAppliedTemperature::GetState() const { return m_State; } //----------------------------------------------------------------------------- -void SEAppliedTemperature::SetState(CDM::enumOnOff::value onOff) +void SEAppliedTemperature::SetState(SEOnOff onOff) { m_State = onOff; } @@ -168,6 +137,14 @@ void SEAppliedTemperature::ToString(std::ostream& str) const str << std::flush; } //----------------------------------------------------------------------------- +bool SEAppliedTemperature::IsValid() const +{ + return m_State != SEOnOff::Invalid + && (m_Temperature + || m_SurfaceArea + || m_SurfaceAreaFraction); +} +//----------------------------------------------------------------------------- bool SEAppliedTemperature::operator==(SEAppliedTemperature const& rhs) const { if (this == &rhs) @@ -177,7 +154,6 @@ bool SEAppliedTemperature::operator==(SEAppliedTemperature const& rhs) const && ((m_Temperature && rhs.m_Temperature) ? m_Temperature->operator==(*rhs.m_Temperature) : m_Temperature == rhs.m_Temperature) && ((m_SurfaceArea && rhs.m_SurfaceArea) ? m_SurfaceArea->operator==(*rhs.m_SurfaceArea) : m_SurfaceArea == rhs.m_SurfaceArea) && ((m_SurfaceAreaFraction && rhs.m_SurfaceAreaFraction) ? m_SurfaceAreaFraction->operator==(*rhs.m_SurfaceAreaFraction) : m_SurfaceAreaFraction == rhs.m_SurfaceAreaFraction); - } bool SEAppliedTemperature::operator!=(SEAppliedTemperature const& rhs) const { diff --git a/projects/biogears/libBiogears/src/cdm/system/environment/SEEnvironment.cpp b/projects/biogears/libBiogears/src/cdm/system/environment/SEEnvironment.cpp index 3eebfb874..c3bc1ea90 100644 --- a/projects/biogears/libBiogears/src/cdm/system/environment/SEEnvironment.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/environment/SEEnvironment.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Environment.h" + #include #include #include @@ -52,12 +54,12 @@ SEEnvironment::SEEnvironment(SESubstanceManager& substances) //------------------------------------------------------------------------------- SEEnvironment::~SEEnvironment() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEEnvironment::Clear() +void SEEnvironment::Invalidate() { - SESystem::Clear(); + SESystem::Invalidate(); m_Name = ""; SAFE_DELETE(m_Conditions); SAFE_DELETE(m_ConvectiveHeatLoss); @@ -113,47 +115,6 @@ const SEScalar* SEEnvironment::GetScalar(const std::string& name) return nullptr; } //------------------------------------------------------------------------------- -bool SEEnvironment::Load(const CDM::EnvironmentData& in) -{ - SESystem::Load(in); - if (in.Name().present()) { - m_Name = in.Name().get(); - } else { - m_Name = "Local Environment"; - } - if (in.Conditions().present()) { - GetConditions().Load(in.Conditions().get()); - } - - if (in.ConvectiveHeatLoss().present()) { - GetConvectiveHeatLoss().Load(in.ConvectiveHeatLoss().get()); - } - if (in.ConvectiveHeatTranferCoefficient().present()) { - GetConvectiveHeatTranferCoefficient().Load(in.ConvectiveHeatTranferCoefficient().get()); - } - if (in.EvaporativeHeatLoss().present()) { - GetEvaporativeHeatLoss().Load(in.EvaporativeHeatLoss().get()); - } - if (in.EvaporativeHeatTranferCoefficient().present()) { - GetEvaporativeHeatTranferCoefficient().Load(in.EvaporativeHeatTranferCoefficient().get()); - } - if (in.RadiativeHeatLoss().present()) { - GetRadiativeHeatLoss().Load(in.RadiativeHeatLoss().get()); - } - if (in.RadiativeHeatTranferCoefficient().present()) { - GetRadiativeHeatTranferCoefficient().Load(in.RadiativeHeatTranferCoefficient().get()); - } - if (in.RespirationHeatLoss().present()) { - GetRespirationHeatLoss().Load(in.RespirationHeatLoss().get()); - } - if (in.SkinHeatLoss().present()) { - GetSkinHeatLoss().Load(in.SkinHeatLoss().get()); - } - - StateChange(); - return true; -} -//------------------------------------------------------------------------------- bool SEEnvironment::Load(const char* patientFile) { return Load(std::string(patientFile)); @@ -183,55 +144,10 @@ bool SEEnvironment::Load(const std::string& given) Error(ss); return false; } - return Load(*pData); -} -//------------------------------------------------------------------------------- -CDM::EnvironmentData* SEEnvironment::Unload() const -{ - CDM::EnvironmentData* data = new CDM::EnvironmentData(); - Unload(*data); - return data; + io::Environment::UnMarshall(*pData, *this); + return true; } //------------------------------------------------------------------------------- -void SEEnvironment::Unload(CDM::EnvironmentData& data) const -{ - SESystem::Unload(data); - if (HasName()) { - data.Name(m_Name); - } else { - data.Name("Unknown Environment"); - } - - if (HasConditions()) { - data.Conditions(std::unique_ptr(m_Conditions->Unload())); - } - - if (m_ConvectiveHeatLoss != nullptr) { - data.ConvectiveHeatLoss(std::unique_ptr(m_ConvectiveHeatLoss->Unload())); - } - if (m_ConvectiveHeatTranferCoefficient != nullptr) { - data.ConvectiveHeatTranferCoefficient(std::unique_ptr(m_ConvectiveHeatTranferCoefficient->Unload())); - } - if (m_EvaporativeHeatLoss != nullptr) { - data.EvaporativeHeatLoss(std::unique_ptr(m_EvaporativeHeatLoss->Unload())); - } - if (m_EvaporativeHeatTranferCoefficient != nullptr) { - data.EvaporativeHeatTranferCoefficient(std::unique_ptr(m_EvaporativeHeatTranferCoefficient->Unload())); - } - if (m_RadiativeHeatLoss != nullptr) { - data.RadiativeHeatLoss(std::unique_ptr(m_RadiativeHeatLoss->Unload())); - } - if (m_RadiativeHeatTranferCoefficient != nullptr) { - data.RadiativeHeatTranferCoefficient(std::unique_ptr(m_RadiativeHeatTranferCoefficient->Unload())); - } - if (m_RespirationHeatLoss != nullptr) { - data.RespirationHeatLoss(std::unique_ptr(m_RespirationHeatLoss->Unload())); - } - if (m_SkinHeatLoss != nullptr) { - data.SkinHeatLoss(std::unique_ptr(m_SkinHeatLoss->Unload())); - } -}; -//------------------------------------------------------------------------------- bool SEEnvironment::ProcessChange(const SEInitialEnvironment& change) { // If we have data then we merge it, if a file was provided @@ -494,6 +410,20 @@ Tree SEEnvironment::GetPhysiologyRequestGraph() const return { "" }; } //----------------------------------------------------------------------------- +bool SEEnvironment::IsValid() const +{ + return !m_Name.empty() + && (m_ConvectiveHeatLoss + || m_ConvectiveHeatTranferCoefficient + || m_EvaporativeHeatLoss + || m_EvaporativeHeatTranferCoefficient + || m_RadiativeHeatLoss + || m_RadiativeHeatTranferCoefficient + || m_RespirationHeatLoss + || m_SkinHeatLoss + || m_Conditions); +} +//----------------------------------------------------------------------------- bool SEEnvironment::operator==(SEEnvironment const& rhs) const { if (this == &rhs) diff --git a/projects/biogears/libBiogears/src/cdm/system/environment/SEEnvironmentalConditions.cpp b/projects/biogears/libBiogears/src/cdm/system/environment/SEEnvironmentalConditions.cpp index 43a36e65c..1c66ca926 100644 --- a/projects/biogears/libBiogears/src/cdm/system/environment/SEEnvironmentalConditions.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/environment/SEEnvironmentalConditions.cpp @@ -1,3 +1,4 @@ + /************************************************************************************** Copyright 2015 Applied Research Associates, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use @@ -9,8 +10,7 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **************************************************************************************/ -#include - +#include "io/cdm/Environment.h" #include #include #include @@ -23,6 +23,7 @@ specific language governing permissions and limitations under the License. #include #include #include +#include #include #ifdef BIOGEARS_IO_PRESENT #include @@ -32,7 +33,7 @@ SEEnvironmentalConditions::SEEnvironmentalConditions(SESubstanceManager& substan : Loggable(substances.GetLogger()) , m_Substances(substances) { - m_SurroundingType = CDM::enumSurroundingType::value(-1); + m_SurroundingType = SESurroundingType::Invalid; m_AirDensity = nullptr; m_AirVelocity = nullptr; @@ -47,12 +48,12 @@ SEEnvironmentalConditions::SEEnvironmentalConditions(SESubstanceManager& substan //----------------------------------------------------------------------------- SEEnvironmentalConditions::~SEEnvironmentalConditions() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SEEnvironmentalConditions::Clear() +void SEEnvironmentalConditions::Invalidate() { - m_SurroundingType = CDM::enumSurroundingType::value(-1); + m_SurroundingType = SESurroundingType::Invalid; SAFE_DELETE(m_AirDensity); SAFE_DELETE(m_AirVelocity); SAFE_DELETE(m_AmbientTemperature); @@ -70,6 +71,22 @@ void SEEnvironmentalConditions::Clear() m_cAmbientAerosols.clear(); } //----------------------------------------------------------------------------- +bool SEEnvironmentalConditions::IsValid() const +{ + return (m_SurroundingType != SESurroundingType::Invalid) + && ( ! m_AmbientAerosols.empty() //Not Empty - Any Aerosol is a valid condition + || m_AmbientTemperature != nullptr + || m_AirDensity != nullptr + || m_AirVelocity != nullptr + || m_AmbientTemperature != nullptr + || m_AtmosphericPressure != nullptr + || m_ClothingResistance != nullptr + || m_Emissivity != nullptr + || m_MeanRadiantTemperature != nullptr + || m_RelativeHumidity != nullptr + || m_RespirationAmbientTemperature != nullptr); +} +//----------------------------------------------------------------------------- const SEScalar* SEEnvironmentalConditions::GetScalar(const char* name) { return GetScalar(std::string { name }); @@ -99,110 +116,6 @@ const SEScalar* SEEnvironmentalConditions::GetScalar(const std::string& name) return nullptr; } //----------------------------------------------------------------------------- -bool SEEnvironmentalConditions::Load(const CDM::EnvironmentalConditionsData& in) -{ - Clear(); - if (in.Name().present()) - m_Name = in.Name().get(); - if (in.SurroundingType().present()) - m_SurroundingType = in.SurroundingType().get(); - if (in.AirDensity().present()) - GetAirDensity().Load(in.AirDensity().get()); - if (in.AirVelocity().present()) - GetAirVelocity().Load(in.AirVelocity().get()); - if (in.AmbientTemperature().present()) - GetAmbientTemperature().Load(in.AmbientTemperature().get()); - if (in.AtmosphericPressure().present()) - GetAtmosphericPressure().Load(in.AtmosphericPressure().get()); - if (in.ClothingResistance().present()) - GetClothingResistance().Load(in.ClothingResistance().get()); - if (in.Emissivity().present()) - GetEmissivity().Load(in.Emissivity().get()); - if (in.MeanRadiantTemperature().present()) - GetMeanRadiantTemperature().Load(in.MeanRadiantTemperature().get()); - if (in.RelativeHumidity().present()) - GetRelativeHumidity().Load(in.RelativeHumidity().get()); - if (in.RespirationAmbientTemperature().present()) - GetRespirationAmbientTemperature().Load(in.RespirationAmbientTemperature().get()); - - SESubstance* sub; - for (const CDM::SubstanceFractionData& sfData : in.AmbientGas()) { - sub = m_Substances.GetSubstance(sfData.Name()); - if (sub == nullptr) { - Error("Substance not found : " + sfData.Name()); - return false; - } - if (sub->GetState() != CDM::enumSubstanceState::Gas) { - Error("Substance not gas : " + sfData.Name()); - return false; - } - SESubstanceFraction* sf = new SESubstanceFraction(*sub); - sf->Load(sfData); - m_AmbientGases.push_back(sf); - m_cAmbientGases.push_back(sf); - } - - for (const CDM::SubstanceConcentrationData& scData : in.AmbientAerosol()) { - sub = m_Substances.GetSubstance(scData.Name()); - if (sub == nullptr) { - Error("Substance not found : " + scData.Name()); - return false; - } - if (sub->GetState() != CDM::enumSubstanceState::Solid && sub->GetState() != CDM::enumSubstanceState::Liquid) { - Error("Substance not a liquid or solid : " + scData.Name()); - return false; - } - SESubstanceConcentration* sc = new SESubstanceConcentration(*sub); - sc->Load(scData); - m_AmbientAerosols.push_back(sc); - m_cAmbientAerosols.push_back(sc); - } - - return true; -} -//----------------------------------------------------------------------------- -CDM::EnvironmentalConditionsData* SEEnvironmentalConditions::Unload() const -{ - CDM::EnvironmentalConditionsData* data = new CDM::EnvironmentalConditionsData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEEnvironmentalConditions::Unload(CDM::EnvironmentalConditionsData& data) const -{ - if (HasName()) { - data.Name(m_Name); - } else { - data.Name("Local Environment Conditions"); - } - if (HasSurroundingType()) - data.SurroundingType(m_SurroundingType); - if (m_AirDensity != nullptr) - data.AirDensity(std::unique_ptr(m_AirDensity->Unload())); - if (m_AirVelocity != nullptr) - data.AirVelocity(std::unique_ptr(m_AirVelocity->Unload())); - if (m_AmbientTemperature != nullptr) - data.AmbientTemperature(std::unique_ptr(m_AmbientTemperature->Unload())); - if (m_AtmosphericPressure != nullptr) - data.AtmosphericPressure(std::unique_ptr(m_AtmosphericPressure->Unload())); - if (m_ClothingResistance != nullptr) - data.ClothingResistance(std::unique_ptr(m_ClothingResistance->Unload())); - if (m_Emissivity != nullptr) - data.Emissivity(std::unique_ptr(m_Emissivity->Unload())); - if (m_MeanRadiantTemperature != nullptr) - data.MeanRadiantTemperature(std::unique_ptr(m_MeanRadiantTemperature->Unload())); - if (m_RelativeHumidity != nullptr) - data.RelativeHumidity(std::unique_ptr(m_RelativeHumidity->Unload())); - if (m_RespirationAmbientTemperature != nullptr) - data.RespirationAmbientTemperature(std::unique_ptr(m_RespirationAmbientTemperature->Unload())); - - for (SESubstanceFraction* sf : m_AmbientGases) - data.AmbientGas().push_back(std::unique_ptr(sf->Unload())); - - for (SESubstanceConcentration* sc : m_AmbientAerosols) - data.AmbientAerosol().push_back(std::unique_ptr(sc->Unload())); -} -//----------------------------------------------------------------------------- void SEEnvironmentalConditions::Merge(const SEEnvironmentalConditions& from) { if (from.HasSurroundingType()) @@ -249,7 +162,7 @@ void SEEnvironmentalConditions::Merge(const SEEnvironmentalConditions& from) if (from.HasAmbientAerosol()) { for (SESubstanceConcentration* sc : from.m_AmbientAerosols) { - SESubstanceConcentration& mine = GetAmbientAerosol(sc->GetSubstance()); + auto& mine = GetAmbientAerosol(sc->GetSubstance()); mine.GetConcentration().Set(sc->GetConcentration()); } } @@ -284,9 +197,8 @@ bool SEEnvironmentalConditions::Load(const std::string& given) Error(ss); return false; } - if (!Load(*eData)) - return false; + io::Environment::UnMarshall(*eData, *this); return true; } //----------------------------------------------------------------------------- @@ -320,24 +232,24 @@ void SEEnvironmentalConditions::InvalidateName() m_Name = ""; } //----------------------------------------------------------------------------- -CDM::enumSurroundingType::value SEEnvironmentalConditions::GetSurroundingType() const +SESurroundingType SEEnvironmentalConditions::GetSurroundingType() const { return m_SurroundingType; } //----------------------------------------------------------------------------- -void SEEnvironmentalConditions::SetSurroundingType(CDM::enumSurroundingType::value state) +void SEEnvironmentalConditions::SetSurroundingType(SESurroundingType state) { m_SurroundingType = state; } //----------------------------------------------------------------------------- bool SEEnvironmentalConditions::HasSurroundingType() const { - return m_SurroundingType == ((CDM::enumSurroundingType::value)-1) ? false : true; + return m_SurroundingType == ((SESurroundingType)-1) ? false : true; } //----------------------------------------------------------------------------- void SEEnvironmentalConditions::InvalidateSurroundingType() { - m_SurroundingType = (CDM::enumSurroundingType::value)-1; + m_SurroundingType = (SESurroundingType)-1; } //----------------------------------------------------------------------------- bool SEEnvironmentalConditions::HasAirDensity() const @@ -516,10 +428,10 @@ bool SEEnvironmentalConditions::HasAmbientGas() const return m_AmbientGases.size() == 0 ? false : true; } //----------------------------------------------------------------------------- -bool SEEnvironmentalConditions::HasAmbientGas(const SESubstance& s) const +bool SEEnvironmentalConditions::HasAmbientGas(SESubstanceDefinition const& s) const { for (const SESubstanceFraction* sf : m_AmbientGases) { - if (&s == &sf->GetSubstance()) + if (s == sf->GetSubstance()) return true; } return false; @@ -535,10 +447,10 @@ const std::vector& SEEnvironmentalConditions::GetAmb return m_cAmbientGases; } //----------------------------------------------------------------------------- -SESubstanceFraction& SEEnvironmentalConditions::GetAmbientGas(SESubstance& s) +SESubstanceFraction& SEEnvironmentalConditions::GetAmbientGas(SESubstanceDefinition const& s) { for (SESubstanceFraction* sf : m_AmbientGases) { - if (&s == &sf->GetSubstance()) + if (s == sf->GetSubstance()) return *sf; } SESubstanceFraction* sf = new SESubstanceFraction(s); @@ -548,30 +460,30 @@ SESubstanceFraction& SEEnvironmentalConditions::GetAmbientGas(SESubstance& s) return *sf; } //----------------------------------------------------------------------------- -const SESubstanceFraction* SEEnvironmentalConditions::GetAmbientGas(const SESubstance& s) const +const SESubstanceFraction* SEEnvironmentalConditions::GetAmbientGas(SESubstanceDefinition const& s) const { const SESubstanceFraction* sf = nullptr; for (unsigned int i = 0; i < m_AmbientGases.size(); i++) { sf = m_AmbientGases[i]; - if (&s == &sf->GetSubstance()) + if (s == sf->GetSubstance()) return sf; } return sf; } //----------------------------------------------------------------------------- -void SEEnvironmentalConditions::AddAmbientGas(SESubstance const& substance, SEScalarFraction const& fraction) +void SEEnvironmentalConditions::AddAmbientGas(SESubstanceDefinition const& substance, SEScalarFraction const& fraction) { auto substanceFraction = new SESubstanceFraction(substance, fraction); m_AmbientGases.push_back(substanceFraction); m_cAmbientGases.push_back(substanceFraction); } //----------------------------------------------------------------------------- -void SEEnvironmentalConditions::RemoveAmbientGas(const SESubstance& s) +void SEEnvironmentalConditions::RemoveAmbientGas(SESubstanceDefinition const& s) { const SESubstanceFraction* sf; for (unsigned int i = 0; i < m_AmbientGases.size(); i++) { sf = m_AmbientGases[i]; - if (&s == &sf->GetSubstance()) { + if (s == sf->GetSubstance()) { m_AmbientGases.erase(m_AmbientGases.begin() + i); m_cAmbientGases.erase(m_cAmbientGases.begin() + i); delete sf; @@ -590,10 +502,10 @@ bool SEEnvironmentalConditions::HasAmbientAerosol() const return m_AmbientAerosols.size() == 0 ? false : true; } //----------------------------------------------------------------------------- -bool SEEnvironmentalConditions::HasAmbientAerosol(const SESubstance& substance) const +bool SEEnvironmentalConditions::HasAmbientAerosol(SESubstanceDefinition const& substance) const { for (const SESubstanceConcentration* sc : m_AmbientAerosols) { - if (&substance == &sc->GetSubstance()) + if (substance == sc->GetSubstance()) return true; } return false; @@ -609,10 +521,10 @@ const std::vector& SEEnvironmentalConditions::G return m_cAmbientAerosols; } //----------------------------------------------------------------------------- -SESubstanceConcentration& SEEnvironmentalConditions::GetAmbientAerosol(SESubstance& substance) +SESubstanceConcentration& SEEnvironmentalConditions::GetAmbientAerosol(SESubstanceDefinition const & substance) { for (SESubstanceConcentration* sc : m_AmbientAerosols) { - if (&substance == &sc->GetSubstance()) + if (substance == sc->GetSubstance()) return *sc; } SESubstanceConcentration* sc = new SESubstanceConcentration(substance); @@ -622,30 +534,30 @@ SESubstanceConcentration& SEEnvironmentalConditions::GetAmbientAerosol(SESubstan return *sc; } //----------------------------------------------------------------------------- -const SESubstanceConcentration* SEEnvironmentalConditions::GetAmbientAerosol(const SESubstance& substance) const +const SESubstanceConcentration* SEEnvironmentalConditions::GetAmbientAerosol(const SESubstanceDefinition& substance) const { const SESubstanceConcentration* sc = nullptr; for (unsigned int i = 0; i < m_AmbientAerosols.size(); i++) { sc = m_AmbientAerosols[i]; - if (&substance == &sc->GetSubstance()) + if (substance == sc->GetSubstance()) return sc; } return sc; } //----------------------------------------------------------------------------- -void SEEnvironmentalConditions::AddAmbientAerosol(const SESubstance& substance, SEScalarMassPerVolume const& concentration) +void SEEnvironmentalConditions::AddAmbientAerosol(SESubstanceDefinition const& substance, SEScalarMassPerVolume const& concentration) { auto substanceConcentration = new SESubstanceConcentration { substance, concentration }; m_AmbientAerosols.push_back(substanceConcentration); m_cAmbientAerosols.push_back(substanceConcentration); } //----------------------------------------------------------------------------- -void SEEnvironmentalConditions::RemoveAmbientAerosol(const SESubstance& substance) +void SEEnvironmentalConditions::RemoveAmbientAerosol(SESubstanceDefinition const& substance) { const SESubstanceConcentration* sc; for (unsigned int i = 0; i < m_AmbientAerosols.size(); i++) { sc = m_AmbientAerosols[i]; - if (&substance == &sc->GetSubstance()) { + if (substance == sc->GetSubstance()) { m_AmbientAerosols.erase(m_AmbientAerosols.begin() + i); m_cAmbientAerosols.erase(m_cAmbientAerosols.begin() + i); delete sc; @@ -664,8 +576,11 @@ bool SEEnvironmentalConditions::operator==(SEEnvironmentalConditions const& rhs) if (this == &rhs) return true; - bool equivilant = m_Name == rhs.m_Name - && ((m_AirDensity && rhs.m_AirDensity) ? m_AirDensity->operator==(*rhs.m_AirDensity) : m_AirDensity == rhs.m_AirDensity) + bool equivilant = m_Name == rhs.m_Name; + +#if defined(BIOGEARS_RIGOROUS_EQUIVILANCE_CHECKS) && !defined(BIOGEARS_LINIENT_ENVIRONMENT_CHECKS) + + equivilant &= ((m_AirDensity && rhs.m_AirDensity) ? m_AirDensity->operator==(*rhs.m_AirDensity) : m_AirDensity == rhs.m_AirDensity) && ((m_AirVelocity && rhs.m_AirVelocity) ? m_AirVelocity->operator==(*rhs.m_AirVelocity) : m_AirVelocity == rhs.m_AirVelocity) && ((m_AmbientTemperature && rhs.m_AmbientTemperature) ? m_AmbientTemperature->operator==(*rhs.m_AmbientTemperature) : m_AmbientTemperature == rhs.m_AmbientTemperature) && ((m_AtmosphericPressure && rhs.m_AtmosphericPressure) ? m_AtmosphericPressure->operator==(*rhs.m_AtmosphericPressure) : m_AtmosphericPressure == rhs.m_AtmosphericPressure) @@ -697,6 +612,7 @@ bool SEEnvironmentalConditions::operator==(SEEnvironmentalConditions const& rhs) } } } +#endif return equivilant; } bool SEEnvironmentalConditions::operator!=(SEEnvironmentalConditions const& rhs) const diff --git a/projects/biogears/libBiogears/src/cdm/system/environment/actions/SEEnvironmentAction.cpp b/projects/biogears/libBiogears/src/cdm/system/environment/actions/SEEnvironmentAction.cpp index aef8a4c1c..360fbd766 100644 --- a/projects/biogears/libBiogears/src/cdm/system/environment/actions/SEEnvironmentAction.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/environment/actions/SEEnvironmentAction.cpp @@ -11,42 +11,27 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Environment.h" +#include "io/cdm/EnvironmentActions.h" + namespace biogears { -SEEnvironmentAction::SEEnvironmentAction() - : SEAction() +SEEnvironmentAction::SEEnvironmentAction(Logger* logger) + : SEAction(logger) { } SEEnvironmentAction::~SEEnvironmentAction() { - Clear(); + Invalidate(); } -void SEEnvironmentAction::Clear() +void SEEnvironmentAction::Invalidate() { - SEAction::Clear(); + SEAction::Invalidate(); } bool SEEnvironmentAction::IsValid() const { return SEAction::IsValid(); } - -bool SEEnvironmentAction::Load(const CDM::EnvironmentActionData& in) -{ - SEAction::Load(in); - return true; -} - -CDM::EnvironmentActionData* SEEnvironmentAction::Unload() const -{ - CDM::EnvironmentActionData* data = new CDM::EnvironmentActionData(); - Unload(*data); - return data; -} - -void SEEnvironmentAction::Unload(CDM::EnvironmentActionData& data) const -{ - SEAction::Unload(data); -} } \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/cdm/system/environment/actions/SEEnvironmentChange.cpp b/projects/biogears/libBiogears/src/cdm/system/environment/actions/SEEnvironmentChange.cpp index 2b86f38f9..bb2e51549 100644 --- a/projects/biogears/libBiogears/src/cdm/system/environment/actions/SEEnvironmentChange.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/environment/actions/SEEnvironmentChange.cpp @@ -11,6 +11,10 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Environment.h" +#include "io/cdm/EnvironmentActions.h" + +#include #include #include #include @@ -22,10 +26,11 @@ specific language governing permissions and limitations under the License. #include #include #include +#include namespace biogears { SEEnvironmentChange::SEEnvironmentChange(SESubstanceManager& substances) - : SEEnvironmentAction() + : SEEnvironmentAction(substances.GetLogger()) , m_Substances(substances) { m_Conditions = nullptr; @@ -34,12 +39,12 @@ SEEnvironmentChange::SEEnvironmentChange(SESubstanceManager& substances) //----------------------------------------------------------------------------- SEEnvironmentChange::~SEEnvironmentChange() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SEEnvironmentChange::Clear() +void SEEnvironmentChange::Invalidate() { - SEEnvironmentAction::Clear(); + SEEnvironmentAction::Invalidate(); InvalidateConditionsFile(); SAFE_DELETE(m_Conditions); } @@ -48,43 +53,45 @@ bool SEEnvironmentChange::IsValid() const { return SEEnvironmentAction::IsValid() && (HasConditions() || HasConditionsFile()); } -//----------------------------------------------------------------------------- -bool SEEnvironmentChange::Load(const CDM::EnvironmentChangeData& in, std::default_random_engine *rd) -{ - SEEnvironmentAction::Load(in); - if (in.ConditionsFile().present()) - SetConditionsFile(in.ConditionsFile().get()); - else if (in.Conditions().present()) - GetConditions().Load(in.Conditions().get()); - return true; -} -//----------------------------------------------------------------------------- -CDM::EnvironmentChangeData* SEEnvironmentChange::Unload() const -{ - CDM::EnvironmentChangeData* data = new CDM::EnvironmentChangeData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEEnvironmentChange::Unload(CDM::EnvironmentChangeData& data) const -{ - SEEnvironmentAction::Unload(data); - if (HasConditions()) - data.Conditions(std::unique_ptr(m_Conditions->Unload())); - else if (HasConditionsFile()) - data.ConditionsFile(m_ConditionsFile); -} + //----------------------------------------------------------------------------- bool SEEnvironmentChange::HasConditions() const { - return m_Conditions != nullptr; + return m_Conditions != nullptr && m_Conditions->IsValid(); } //----------------------------------------------------------------------------- SEEnvironmentalConditions& SEEnvironmentChange::GetConditions() { - m_ConditionsFile = ""; - if (m_Conditions == nullptr) + + if (m_Conditions == nullptr) { m_Conditions = new SEEnvironmentalConditions(m_Substances); + if (!m_ConditionsFile.empty()) { + CDM::EnvironmentalConditionsData* ecData; + std::unique_ptr data; + + auto io = m_Substances.GetLogger()->GetIoManager().lock(); + auto possible_path = io->find_resource_file(m_ConditionsFile.c_str()); + if (possible_path.empty()) { +#ifdef BIOGEARS_IO_PRESENT + size_t content_size; + auto content = io->get_embedded_resource_file(m_ConditionsFile.c_str(), content_size); + data = Serializer::ReadBuffer((XMLByte*)content, content_size, m_Substances.GetLogger()); +#endif + } else { + data = Serializer::ReadFile(possible_path.c_str(), m_Substances.GetLogger()); + } + + ecData = dynamic_cast(data.get()); + if (ecData == nullptr) { + std::stringstream ss; + ss << "EnvironmentalConditions file could not be read : " << m_ConditionsFile << std::endl; + Error(ss); + } else { + m_ConditionsFile = ""; + io::Environment::UnMarshall(*ecData, *m_Conditions); + } + } + } return *m_Conditions; } //----------------------------------------------------------------------------- @@ -100,7 +107,7 @@ const char* SEEnvironmentChange::GetConditionsFile() const //----------------------------------------------------------------------------- void SEEnvironmentChange::SetConditionsFile(const char* fileName) { - SetConditionsFile(std::string{ fileName }); + SetConditionsFile(std::string { fileName }); } //----------------------------------------------------------------------------- void SEEnvironmentChange::SetConditionsFile(const std::string& fileName) @@ -154,7 +161,7 @@ void SEEnvironmentChange::ToString(std::ostream& str) const } if (m_Conditions->HasAmbientAerosol()) { for (SESubstanceConcentration* sc : m_Conditions->GetAmbientAerosols()) { - str << "\n\tSubstance : " << sc->GetSubstance().GetName() << " Concentration " << sc->GetConcentration(); + str << "\n\tSubstance : " << sc->GetSubstance().Name << " Concentration " << sc->GetConcentration(); } } } diff --git a/projects/biogears/libBiogears/src/cdm/system/environment/actions/SEThermalApplication.cpp b/projects/biogears/libBiogears/src/cdm/system/environment/actions/SEThermalApplication.cpp index 9d3517a23..a18c2b737 100644 --- a/projects/biogears/libBiogears/src/cdm/system/environment/actions/SEThermalApplication.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/environment/actions/SEThermalApplication.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Environment.h" +#include "io/cdm/EnvironmentActions.h" + #include #include #include @@ -20,8 +23,8 @@ specific language governing permissions and limitations under the License. #include namespace biogears { -SEThermalApplication::SEThermalApplication() - : SEEnvironmentAction() +SEThermalApplication::SEThermalApplication(Logger* logger) + : SEEnvironmentAction(logger) { m_AppendToPrevious = false; m_ActiveHeating = nullptr; @@ -31,12 +34,12 @@ SEThermalApplication::SEThermalApplication() //------------------------------------------------------------------------------- SEThermalApplication::~SEThermalApplication() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEThermalApplication::Clear() +void SEThermalApplication::Invalidate() { - SEEnvironmentAction::Clear(); + SEEnvironmentAction::Invalidate(); SAFE_DELETE(m_ActiveHeating); SAFE_DELETE(m_ActiveCooling); SAFE_DELETE(m_AppliedTemperature); @@ -53,80 +56,11 @@ bool SEThermalApplication::IsActive() const return true; if (HasActiveCooling() && m_ActiveCooling->GetPower().IsPositive()) return true; - if (HasAppliedTemperature() && m_AppliedTemperature->GetState() == CDM::enumOnOff::On) + if (HasAppliedTemperature() && m_AppliedTemperature->GetState() == SEOnOff::On) return true; return false; } -//------------------------------------------------------------------------------- -bool SEThermalApplication::Load(const CDM::ThermalApplicationData& in, std::default_random_engine *rd) -{ - // Set this before our super class tells us to Clear if the action wants us to keep our current data - CDM::ActiveHeatingData* ah = HasActiveHeating() ? GetActiveHeating().Unload() : nullptr; - CDM::ActiveCoolingData* ac = HasActiveCooling() ? GetActiveCooling().Unload() : nullptr; - CDM::AppliedTemperatureData* at = HasAppliedTemperature() ? GetAppliedTemperature().Unload() : nullptr; - - SEEnvironmentAction::Load(in); - - if (in.AppendToPrevious()) { - //NOTE: Appending does not merge with the previous action if it has overlapping components. - // If a ActiveHeating and ActiveCooling had previously applied and the incoming data had a - // all ActiveHeating with an AppliedTemperature component. Append would add the ApliedTemperature - // and overwrite the previous ActiveHeating with the inbound. While not appending would clear ActiveCooling. - if (ah) { - GetActiveHeating().Load(*ah, rd); - } - if (ac) { - GetActiveCooling().Load(*ac, rd); - } - if (at) { - GetAppliedTemperature().Load(*at); - } - } - if (in.ActiveHeating().present()) { - GetActiveHeating().Load(in.ActiveHeating().get(), rd); - } - if (in.ActiveCooling().present()) { - GetActiveCooling().Load(in.ActiveCooling().get(), rd); - } - if (in.AppliedTemperature().present()) { - GetAppliedTemperature().Load(in.AppliedTemperature().get(), rd); - } - - m_AppendToPrevious = in.AppendToPrevious(); - - SAFE_DELETE(ah); - SAFE_DELETE(ac); - SAFE_DELETE(at); - - return true; -} -//------------------------------------------------------------------------------- -CDM::ThermalApplicationData* SEThermalApplication::Unload() const -{ - CDM::ThermalApplicationData* data = new CDM::ThermalApplicationData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEThermalApplication::Unload(CDM::ThermalApplicationData& data) const -{ - SEEnvironmentAction::Unload(data); - if (HasActiveHeating()) { - data.ActiveHeating(std::unique_ptr(m_ActiveHeating->Unload())); - } - if (HasActiveCooling()) { - data.ActiveCooling(std::unique_ptr(m_ActiveCooling->Unload())); - } - if (HasAppliedTemperature()) { - data.AppliedTemperature(std::unique_ptr(m_AppliedTemperature->Unload())); - } - //NOTE: It might be better to always serialize thermal applications to false and allow users to set this in for - // Load commands. The problem is we use Load/UnLoad for cloning in BioGears so if keeping this state data for - // Serialization is bad then we need to patch all the ProcessAction functions which clone a AppliedTemperatureData and ensure - // it is retained after the clone through caching. - data.AppendToPrevious(m_AppendToPrevious); -} //------------------------------------------------------------------------------- bool SEThermalApplication::HasActiveHeating() const { diff --git a/projects/biogears/libBiogears/src/cdm/system/environment/conditions/SEEnvironmentCondition.cpp b/projects/biogears/libBiogears/src/cdm/system/environment/conditions/SEEnvironmentCondition.cpp index ca831159b..519a74ea5 100644 --- a/projects/biogears/libBiogears/src/cdm/system/environment/conditions/SEEnvironmentCondition.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/environment/conditions/SEEnvironmentCondition.cpp @@ -10,6 +10,10 @@ CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **************************************************************************************/ #include + +#include "io/cdm/Environment.h" +#include "io/cdm/EnvironmentConditions.h" + namespace biogears { SEEnvironmentCondition::SEEnvironmentCondition() : SECondition() @@ -18,34 +22,6 @@ namespace biogears { //----------------------------------------------------------------------------- SEEnvironmentCondition::~SEEnvironmentCondition() { - Clear(); - } - //----------------------------------------------------------------------------- - void SEEnvironmentCondition::Clear() - { - SECondition::Clear(); - } - //----------------------------------------------------------------------------- - bool SEEnvironmentCondition::IsValid() const - { - return SECondition::IsValid(); - } - //----------------------------------------------------------------------------- - bool SEEnvironmentCondition::Load(const CDM::EnvironmentConditionData& in) - { - SECondition::Load(in); - return true; - } - //----------------------------------------------------------------------------- - CDM::EnvironmentConditionData* SEEnvironmentCondition::Unload() const - { - CDM::EnvironmentConditionData* data = new CDM::EnvironmentConditionData(); - Unload(*data); - return data; - } - //----------------------------------------------------------------------------- - void SEEnvironmentCondition::Unload(CDM::EnvironmentConditionData& data) const - { - SECondition::Unload(data); + Invalidate(); } } \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/cdm/system/environment/conditions/SEInitialEnvironment.cpp b/projects/biogears/libBiogears/src/cdm/system/environment/conditions/SEInitialEnvironment.cpp index 80ab5ecee..a80577818 100644 --- a/projects/biogears/libBiogears/src/cdm/system/environment/conditions/SEInitialEnvironment.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/environment/conditions/SEInitialEnvironment.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Environment.h" +#include "io/cdm/EnvironmentConditions.h" + #include #include #include @@ -34,12 +37,12 @@ SEInitialEnvironment::SEInitialEnvironment(SESubstanceManager& substances) //----------------------------------------------------------------------------- SEInitialEnvironment::~SEInitialEnvironment() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SEInitialEnvironment::Clear() +void SEInitialEnvironment::Invalidate() { - SEEnvironmentCondition::Clear(); + SEEnvironmentCondition::Invalidate(); InvalidateConditionsFile(); SAFE_DELETE(m_Conditions); } @@ -48,32 +51,7 @@ bool SEInitialEnvironment::IsValid() const { return SEEnvironmentCondition::IsValid() && (HasConditions() || HasConditionsFile()); } -//----------------------------------------------------------------------------- -bool SEInitialEnvironment::Load(const CDM::InitialEnvironmentData& in) -{ - SEEnvironmentCondition::Load(in); - if (in.ConditionsFile().present()) - SetConditionsFile(in.ConditionsFile().get()); - if (in.Conditions().present()) - GetConditions().Load(in.Conditions().get()); - return true; -} -//----------------------------------------------------------------------------- -CDM::InitialEnvironmentData* SEInitialEnvironment::Unload() const -{ - CDM::InitialEnvironmentData* data = new CDM::InitialEnvironmentData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEInitialEnvironment::Unload(CDM::InitialEnvironmentData& data) const -{ - SEEnvironmentCondition::Unload(data); - if (HasConditions()) - data.Conditions(std::unique_ptr(m_Conditions->Unload())); - else if (HasConditionsFile()) - data.ConditionsFile(m_ConditionsFile); -} + //----------------------------------------------------------------------------- bool SEInitialEnvironment::HasConditions() const { @@ -159,7 +137,7 @@ void SEInitialEnvironment::ToString(std::ostream& str) const } if (m_Conditions->HasAmbientAerosol()) { for (SESubstanceConcentration* sc : m_Conditions->GetAmbientAerosols()) { - str << "\n\tSubstance : " << sc->GetSubstance().GetName() << " Concentration " << sc->GetConcentration(); + str << "\n\tSubstance : " << sc->GetSubstance().Name << " Concentration " << sc->GetConcentration(); } } } diff --git a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/SEAnesthesiaMachine.cpp b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/SEAnesthesiaMachine.cpp index 9cd37525a..3810e2297 100644 --- a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/SEAnesthesiaMachine.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/SEAnesthesiaMachine.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Anesthesia.h" +#include "io/cdm/AnesthesiaActions.h" + #include #include #include @@ -27,8 +30,8 @@ specific language governing permissions and limitations under the License. #include namespace std { -template class map; -template class map; +template class map; +template class map; } namespace biogears { @@ -36,13 +39,13 @@ SEAnesthesiaMachine::SEAnesthesiaMachine(SESubstanceManager& substances) : SESystem(substances.GetLogger()) , m_Substances(substances) { - m_Connection = (CDM::enumAnesthesiaMachineConnection::value)-1; + m_Connection = (SEAnesthesiaMachineConnection)-1; m_InletFlow = nullptr; m_InspiratoryExpiratoryRatio = nullptr; m_OxygenFraction = nullptr; - m_OxygenSource = (CDM::enumAnesthesiaMachineOxygenSource::value)-1; + m_OxygenSource = (SEAnesthesiaMachineOxygenSource)-1; m_PositiveEndExpiredPressure = nullptr; - m_PrimaryGas = (CDM::enumAnesthesiaMachinePrimaryGas::value)-1; + m_PrimaryGas = (SEAnesthesiaMachinePrimaryGas)-1; m_RespiratoryRate = nullptr; m_ReliefValvePressure = nullptr; m_VentilatorPressure = nullptr; @@ -55,23 +58,23 @@ SEAnesthesiaMachine::SEAnesthesiaMachine(SESubstanceManager& substances) //----------------------------------------------------------------------------- SEAnesthesiaMachine::~SEAnesthesiaMachine() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SEAnesthesiaMachine::Clear() +void SEAnesthesiaMachine::Invalidate() { - SESystem::Clear(); + SESystem::Invalidate(); m_EventHandler = nullptr; m_EventState.clear(); m_EventDuration_s.clear(); - m_Connection = (CDM::enumAnesthesiaMachineConnection::value)-1; + m_Connection = (SEAnesthesiaMachineConnection)-1; SAFE_DELETE(m_InletFlow); SAFE_DELETE(m_InspiratoryExpiratoryRatio); SAFE_DELETE(m_OxygenFraction); - m_OxygenSource = (CDM::enumAnesthesiaMachineOxygenSource::value)-1; + m_OxygenSource = (SEAnesthesiaMachineOxygenSource)-1; SAFE_DELETE(m_PositiveEndExpiredPressure); - m_PrimaryGas = (CDM::enumAnesthesiaMachinePrimaryGas::value)-1; + m_PrimaryGas = (SEAnesthesiaMachinePrimaryGas)-1; SAFE_DELETE(m_RespiratoryRate); SAFE_DELETE(m_ReliefValvePressure); SAFE_DELETE(m_VentilatorPressure); @@ -145,110 +148,12 @@ bool SEAnesthesiaMachine::Load(const std::string& file) Error(ss); return false; } - return Load(*pData); -} -//----------------------------------------------------------------------------- -bool SEAnesthesiaMachine::Load(const CDM::AnesthesiaMachineData& in) -{ - SESystem::Load(in); - - if (in.Connection().present()) - m_Connection = in.Connection().get(); - if (in.InletFlow().present()) - GetInletFlow().Load(in.InletFlow().get()); - if (in.InspiratoryExpiratoryRatio().present()) - GetInspiratoryExpiratoryRatio().Load(in.InspiratoryExpiratoryRatio().get()); - if (in.OxygenFraction().present()) - GetOxygenFraction().Load(in.OxygenFraction().get()); - - if (in.OxygenSource().present()) - SetOxygenSource(in.OxygenSource().get()); - if (in.PositiveEndExpiredPressure().present()) - GetPositiveEndExpiredPressure().Load(in.PositiveEndExpiredPressure().get()); - if (in.PrimaryGas().present()) - SetPrimaryGas(in.PrimaryGas().get()); - - if (in.RespiratoryRate().present()) - GetRespiratoryRate().Load(in.RespiratoryRate().get()); - if (in.ReliefValvePressure().present()) - GetReliefValvePressure().Load(in.ReliefValvePressure().get()); - if (in.VentilatorPressure().present()) - GetVentilatorPressure().Load(in.VentilatorPressure().get()); - if (in.LeftChamber().present()) - GetLeftChamber().Load(in.LeftChamber().get()); - if (in.RightChamber().present()) - GetRightChamber().Load(in.RightChamber().get()); - if (in.OxygenBottleOne().present()) - GetOxygenBottleOne().Load(in.OxygenBottleOne().get()); - if (in.OxygenBottleTwo().present()) - GetOxygenBottleTwo().Load(in.OxygenBottleTwo().get()); - - SEScalarTime time; - for (auto e : in.ActiveEvent()) { - time.Load(e.Duration()); - m_EventState[e.Event()] = true; - m_EventDuration_s[e.Event()] = time.GetValue(TimeUnit::s); - } - - StateChange(); + io::Anesthesia::UnMarshall(*pData, *this); return true; } -//----------------------------------------------------------------------------- -CDM::AnesthesiaMachineData* SEAnesthesiaMachine::Unload() const -{ - CDM::AnesthesiaMachineData* data = new CDM::AnesthesiaMachineData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEAnesthesiaMachine::Unload(CDM::AnesthesiaMachineData& data) const -{ - SESystem::Unload(data); - - if (HasConnection()) - data.Connection(m_Connection); - if (m_InletFlow != nullptr) - data.InletFlow(std::unique_ptr(m_InletFlow->Unload())); - if (m_InspiratoryExpiratoryRatio != nullptr) - data.InspiratoryExpiratoryRatio(std::unique_ptr(m_InspiratoryExpiratoryRatio->Unload())); - if (m_OxygenFraction != nullptr) - data.OxygenFraction(std::unique_ptr(m_OxygenFraction->Unload())); - if (HasOxygenSource()) - data.OxygenSource(m_OxygenSource); - if (m_PositiveEndExpiredPressure != nullptr) - data.PositiveEndExpiredPressure(std::unique_ptr(m_PositiveEndExpiredPressure->Unload())); - if (HasPrimaryGas()) - data.PrimaryGas(m_PrimaryGas); - if (m_RespiratoryRate != nullptr) - data.RespiratoryRate(std::unique_ptr(m_RespiratoryRate->Unload())); - if (m_ReliefValvePressure != nullptr) - data.ReliefValvePressure(std::unique_ptr(m_ReliefValvePressure->Unload())); - if (m_VentilatorPressure != nullptr) - data.VentilatorPressure(std::unique_ptr(m_VentilatorPressure->Unload())); - if (HasLeftChamber()) - data.LeftChamber(std::unique_ptr(m_LeftChamber->Unload())); - if (HasRightChamber()) - data.RightChamber(std::unique_ptr(m_RightChamber->Unload())); - if (HasOxygenBottleOne()) - data.OxygenBottleOne(std::unique_ptr(m_OxygenBottleOne->Unload())); - if (HasOxygenBottleTwo()) - data.OxygenBottleTwo(std::unique_ptr(m_OxygenBottleTwo->Unload())); - SEScalarTime time; - for (auto itr : m_EventState) { - auto it2 = m_EventDuration_s.find(itr.first); - if (it2 == m_EventDuration_s.end()) // This should not happen... - time.SetValue(0, TimeUnit::s); - else - time.SetValue(it2->second, TimeUnit::s); - CDM::ActiveAnesthesiaMachineEventData* eData = new CDM::ActiveAnesthesiaMachineEventData(); - eData->Event(itr.first); - eData->Duration(std::unique_ptr(time.Unload())); - data.ActiveEvent().push_back(std::unique_ptr(eData)); - } -} //----------------------------------------------------------------------------- const SEScalar* SEAnesthesiaMachine::GetScalar(const char* name) { @@ -289,7 +194,7 @@ const SEScalar* SEAnesthesiaMachine::GetScalar(const std::string& name) return nullptr; } //----------------------------------------------------------------------------- -void SEAnesthesiaMachine::SetEvent(CDM::enumAnesthesiaMachineEvent::value type, bool active, const SEScalarTime& time) +void SEAnesthesiaMachine::SetEvent(SEAnesthesiaMachineEvent type, bool active, const SEScalarTime& time) { bool b = false; // Default is off if (m_EventState.find(type) != m_EventState.end()) @@ -301,42 +206,43 @@ void SEAnesthesiaMachine::SetEvent(CDM::enumAnesthesiaMachineEvent::value type, m_ss << "[Event] " << time << ", "; if (active) { switch (type) { - case CDM::enumAnesthesiaMachineEvent::OxygenBottle1Exhausted: + case SEAnesthesiaMachineEvent::OxygenBottle1Exhausted: m_ss << "Oxygen Bottle 1 has been exhausted"; break; - case CDM::enumAnesthesiaMachineEvent::OxygenBottle2Exhausted: + case SEAnesthesiaMachineEvent::OxygenBottle2Exhausted: m_ss << "Oxygen Bottle 2 has been exhausted"; break; - case CDM::enumAnesthesiaMachineEvent::ReliefValveActive: + case SEAnesthesiaMachineEvent::ReliefValveActive: m_ss << "Relief valve active - pressure exceeded"; break; default: - m_ss << "Anesthesia Machine Event On : " << type; // TODO CDM::enumAnesthesiaMachineEvent::_xsd_enumAnesthesiaMachineEvent_literals_[type]; + m_ss << "Anesthesia Machine Event On : " << type; } } else { switch (type) { - case CDM::enumAnesthesiaMachineEvent::OxygenBottle1Exhausted: + case SEAnesthesiaMachineEvent::OxygenBottle1Exhausted: m_ss << "Oxygen Bottle 1 has been replenished"; break; - case CDM::enumAnesthesiaMachineEvent::OxygenBottle2Exhausted: + case SEAnesthesiaMachineEvent::OxygenBottle2Exhausted: m_ss << "Oxygen Bottle 2 has been replenished"; break; - case CDM::enumAnesthesiaMachineEvent::ReliefValveActive: + case SEAnesthesiaMachineEvent::ReliefValveActive: m_ss << "Relief valve inactive - pressure below setting"; break; default: - m_ss << "Anesthesia Machine Event Off : " << type; // TODO CDM::enumAnesthesiaMachineEvent::_xsd_enumAnesthesiaMachineEvent_literals_[type]; + m_ss << "Anesthesia Machine Event Off : " << type; } } Info(m_ss); } m_EventState[type] = active; m_EventDuration_s[type] = 0; + if (m_EventHandler != nullptr) m_EventHandler->HandleAnesthesiaMachineEvent(type, active, &time); } //----------------------------------------------------------------------------- -bool SEAnesthesiaMachine::IsEventActive(CDM::enumAnesthesiaMachineEvent::value type) const +bool SEAnesthesiaMachine::IsEventActive(SEAnesthesiaMachineEvent type) const { auto b = m_EventState.find(type); if (b == m_EventState.end()) @@ -344,7 +250,7 @@ bool SEAnesthesiaMachine::IsEventActive(CDM::enumAnesthesiaMachineEvent::value t return b->second; } //----------------------------------------------------------------------------- -double SEAnesthesiaMachine::GetEventDuration(CDM::enumAnesthesiaMachineEvent::value type, const TimeUnit& unit) const +double SEAnesthesiaMachine::GetEventDuration(SEAnesthesiaMachineEvent type, const TimeUnit& unit) const { auto i = m_EventDuration_s.find(type); if (i == m_EventDuration_s.end()) @@ -363,24 +269,24 @@ void SEAnesthesiaMachine::ForwardEvents(SEEventHandler* handler) m_EventHandler = handler; } //----------------------------------------------------------------------------- -void SEAnesthesiaMachine::SetConnection(CDM::enumAnesthesiaMachineConnection::value c) +void SEAnesthesiaMachine::SetConnection(SEAnesthesiaMachineConnection c) { m_Connection = c; } //----------------------------------------------------------------------------- bool SEAnesthesiaMachine::HasConnection() const { - return m_Connection == ((CDM::enumAnesthesiaMachineConnection::value)-1) ? false : true; + return m_Connection == ((SEAnesthesiaMachineConnection)-1) ? false : true; } //----------------------------------------------------------------------------- -CDM::enumAnesthesiaMachineConnection::value SEAnesthesiaMachine::GetConnection() const +SEAnesthesiaMachineConnection SEAnesthesiaMachine::GetConnection() const { return m_Connection; } //----------------------------------------------------------------------------- void SEAnesthesiaMachine::InvalidateConnection() { - m_Connection = (CDM::enumAnesthesiaMachineConnection::value)-1; + m_Connection = (SEAnesthesiaMachineConnection)-1; } //----------------------------------------------------------------------------- bool SEAnesthesiaMachine::HasInletFlow() const @@ -440,24 +346,24 @@ double SEAnesthesiaMachine::GetOxygenFraction() const return m_OxygenFraction->GetValue(); } //----------------------------------------------------------------------------- -CDM::enumAnesthesiaMachineOxygenSource::value SEAnesthesiaMachine::GetOxygenSource() const +SEAnesthesiaMachineOxygenSource SEAnesthesiaMachine::GetOxygenSource() const { return m_OxygenSource; } //----------------------------------------------------------------------------- -void SEAnesthesiaMachine::SetOxygenSource(CDM::enumAnesthesiaMachineOxygenSource::value src) +void SEAnesthesiaMachine::SetOxygenSource(SEAnesthesiaMachineOxygenSource src) { m_OxygenSource = src; } //----------------------------------------------------------------------------- bool SEAnesthesiaMachine::HasOxygenSource() const { - return m_OxygenSource == ((CDM::enumAnesthesiaMachineOxygenSource::value)-1) ? false : true; + return m_OxygenSource == ((SEAnesthesiaMachineOxygenSource)-1) ? false : true; } //----------------------------------------------------------------------------- void SEAnesthesiaMachine::InvalidateOxygenSource() { - m_OxygenSource = (CDM::enumAnesthesiaMachineOxygenSource::value)-1; + m_OxygenSource = (SEAnesthesiaMachineOxygenSource)-1; } //----------------------------------------------------------------------------- bool SEAnesthesiaMachine::HasPositiveEndExpiredPressure() const @@ -479,24 +385,24 @@ double SEAnesthesiaMachine::GetPositiveEndExpiredPressure(const PressureUnit& un return m_PositiveEndExpiredPressure->GetValue(unit); } //----------------------------------------------------------------------------- -CDM::enumAnesthesiaMachinePrimaryGas::value SEAnesthesiaMachine::GetPrimaryGas() const +SEAnesthesiaMachinePrimaryGas SEAnesthesiaMachine::GetPrimaryGas() const { return m_PrimaryGas; } //----------------------------------------------------------------------------- -void SEAnesthesiaMachine::SetPrimaryGas(CDM::enumAnesthesiaMachinePrimaryGas::value gas) +void SEAnesthesiaMachine::SetPrimaryGas(SEAnesthesiaMachinePrimaryGas gas) { m_PrimaryGas = gas; } //----------------------------------------------------------------------------- bool SEAnesthesiaMachine::HasPrimaryGas() const { - return m_PrimaryGas == ((CDM::enumAnesthesiaMachinePrimaryGas::value)-1) ? false : true; + return m_PrimaryGas == ((SEAnesthesiaMachinePrimaryGas)-1) ? false : true; } //----------------------------------------------------------------------------- void SEAnesthesiaMachine::InvalidatePrimaryGas() { - m_PrimaryGas = (CDM::enumAnesthesiaMachinePrimaryGas::value)-1; + m_PrimaryGas = (SEAnesthesiaMachinePrimaryGas)-1; } //----------------------------------------------------------------------------- bool SEAnesthesiaMachine::HasRespiratoryRate() const diff --git a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/SEAnesthesiaMachineChamber.cpp b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/SEAnesthesiaMachineChamber.cpp index 35a0a169c..b02c6bff2 100644 --- a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/SEAnesthesiaMachineChamber.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/SEAnesthesiaMachineChamber.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Anesthesia.h" +#include "io/cdm/AnesthesiaActions.h" + #include #include #include @@ -20,7 +23,7 @@ SEAnesthesiaMachineChamber::SEAnesthesiaMachineChamber(SESubstanceManager& subst : Loggable(substances.GetLogger()) , m_Substances(substances) { - m_State = (CDM::enumOnOff::value)-1; + m_State = SEOnOff::Invalid; m_SubstanceFraction = nullptr; m_Substance = nullptr; } @@ -28,56 +31,18 @@ SEAnesthesiaMachineChamber::SEAnesthesiaMachineChamber(SESubstanceManager& subst SEAnesthesiaMachineChamber::~SEAnesthesiaMachineChamber() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEAnesthesiaMachineChamber::Clear() +void SEAnesthesiaMachineChamber::Invalidate() { - m_State = (CDM::enumOnOff::value)-1; + m_State = SEOnOff::Invalid; SAFE_DELETE(m_SubstanceFraction); m_Substance = nullptr; } //------------------------------------------------------------------------------- -bool SEAnesthesiaMachineChamber::Load(const CDM::AnesthesiaMachineChamberData& in) -{ - if (in.State().present()) - SetState(in.State().get()); - if (in.SubstanceFraction().present()) - GetSubstanceFraction().Load(in.SubstanceFraction().get()); - if (in.Substance().present()) { - m_Substance = m_Substances.GetSubstance(in.Substance().get()); - if (m_Substance == nullptr) { - std::stringstream ss; - ss << "Do not have substance : " << in.Substance().get(); - Error(ss); - return false; - } - } - return true; -} -//------------------------------------------------------------------------------- - -CDM::AnesthesiaMachineChamberData* SEAnesthesiaMachineChamber::Unload() const -{ - CDM::AnesthesiaMachineChamberData* data = new CDM::AnesthesiaMachineChamberData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- - -void SEAnesthesiaMachineChamber::Unload(CDM::AnesthesiaMachineChamberData& data) const -{ - if (HasState()) - data.State(m_State); - if (m_SubstanceFraction != nullptr) - data.SubstanceFraction(std::unique_ptr(m_SubstanceFraction->Unload())); - if (HasSubstance()) - data.Substance(m_Substance->GetName()); -} -//------------------------------------------------------------------------------- - void SEAnesthesiaMachineChamber::Merge(const SEAnesthesiaMachineChamber& from) { if (from.HasState()) @@ -110,24 +75,24 @@ const SEScalar* SEAnesthesiaMachineChamber::GetScalar(const std::string& name) } //------------------------------------------------------------------------------- -CDM::enumOnOff::value SEAnesthesiaMachineChamber::GetState() const +SEOnOff SEAnesthesiaMachineChamber::GetState() const { return m_State; } //------------------------------------------------------------------------------- -void SEAnesthesiaMachineChamber::SetState(CDM::enumOnOff::value state) +void SEAnesthesiaMachineChamber::SetState(SEOnOff state) { m_State = state; } //------------------------------------------------------------------------------- bool SEAnesthesiaMachineChamber::HasState() const { - return m_State == ((CDM::enumOnOff::value)-1) ? false : true; + return m_State == (SEOnOff::Invalid) ? false : true; } //------------------------------------------------------------------------------- void SEAnesthesiaMachineChamber::InvalidateState() { - m_State = (CDM::enumOnOff::value)-1; + m_State = SEOnOff::Invalid; } //------------------------------------------------------------------------------- diff --git a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/SEAnesthesiaMachineOxygenBottle.cpp b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/SEAnesthesiaMachineOxygenBottle.cpp index 156e04190..156f4544e 100644 --- a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/SEAnesthesiaMachineOxygenBottle.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/SEAnesthesiaMachineOxygenBottle.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Anesthesia.h" +#include "io/cdm/AnesthesiaActions.h" + #include #include #include @@ -28,39 +31,16 @@ SEAnesthesiaMachineOxygenBottle::SEAnesthesiaMachineOxygenBottle(Logger* logger) SEAnesthesiaMachineOxygenBottle::~SEAnesthesiaMachineOxygenBottle() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEAnesthesiaMachineOxygenBottle::Clear() +void SEAnesthesiaMachineOxygenBottle::Invalidate() { SAFE_DELETE(m_Volume); } //------------------------------------------------------------------------------- -bool SEAnesthesiaMachineOxygenBottle::Load(const CDM::AnesthesiaMachineOxygenBottleData& in) -{ - if (in.Volume().present()) - GetVolume().Load(in.Volume().get()); - return true; -} -//------------------------------------------------------------------------------- - -CDM::AnesthesiaMachineOxygenBottleData* SEAnesthesiaMachineOxygenBottle::Unload() const -{ - CDM::AnesthesiaMachineOxygenBottleData* data = new CDM::AnesthesiaMachineOxygenBottleData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- - -void SEAnesthesiaMachineOxygenBottle::Unload(CDM::AnesthesiaMachineOxygenBottleData& data) const -{ - if (m_Volume != nullptr) - data.Volume(std::unique_ptr(m_Volume->Unload())); -} -//------------------------------------------------------------------------------- - void SEAnesthesiaMachineOxygenBottle::Merge(const SEAnesthesiaMachineOxygenBottle& from) { COPY_PROPERTY(Volume); diff --git a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEAnesthesiaMachineAction.cpp b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEAnesthesiaMachineAction.cpp index cc079d6aa..543d5ffc4 100644 --- a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEAnesthesiaMachineAction.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEAnesthesiaMachineAction.cpp @@ -12,6 +12,9 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/Anesthesia.h" +#include "io/cdm/AnesthesiaActions.h" + namespace biogears { SEAnesthesiaMachineAction::SEAnesthesiaMachineAction() : SEAction() @@ -20,12 +23,12 @@ SEAnesthesiaMachineAction::SEAnesthesiaMachineAction() SEAnesthesiaMachineAction::~SEAnesthesiaMachineAction() { - Clear(); + Invalidate(); } -void SEAnesthesiaMachineAction::Clear() +void SEAnesthesiaMachineAction::Invalidate() { - SEAction::Clear(); + SEAction::Invalidate(); } bool SEAnesthesiaMachineAction::IsValid() const @@ -33,21 +36,4 @@ bool SEAnesthesiaMachineAction::IsValid() const return SEAction::IsValid(); } -bool SEAnesthesiaMachineAction::Load(const CDM::AnesthesiaMachineActionData& in) -{ - SEAction::Load(in); - return true; -} - -CDM::AnesthesiaMachineActionData* SEAnesthesiaMachineAction::Unload() const -{ - CDM::AnesthesiaMachineActionData* data = new CDM::AnesthesiaMachineActionData(); - Unload(*data); - return data; -} - -void SEAnesthesiaMachineAction::Unload(CDM::AnesthesiaMachineActionData& data) const -{ - SEAction::Unload(data); -} } \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEAnesthesiaMachineConfiguration.cpp b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEAnesthesiaMachineConfiguration.cpp index 5a704be73..085829148 100644 --- a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEAnesthesiaMachineConfiguration.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEAnesthesiaMachineConfiguration.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Anesthesia.h" +#include "io/cdm/AnesthesiaActions.h" + #include #include #include @@ -33,12 +36,12 @@ SEAnesthesiaMachineConfiguration::SEAnesthesiaMachineConfiguration(SESubstanceMa //----------------------------------------------------------------------------- SEAnesthesiaMachineConfiguration::~SEAnesthesiaMachineConfiguration() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SEAnesthesiaMachineConfiguration::Clear() +void SEAnesthesiaMachineConfiguration::Invalidate() { - SEAnesthesiaMachineAction::Clear(); + SEAnesthesiaMachineAction::Invalidate(); InvalidateConfigurationFile(); SAFE_DELETE(m_Configuration); } @@ -47,32 +50,7 @@ bool SEAnesthesiaMachineConfiguration::IsValid() const { return SEAnesthesiaMachineAction::IsValid() && (HasConfiguration() || HasConfigurationFile()); } -//----------------------------------------------------------------------------- -bool SEAnesthesiaMachineConfiguration::Load(const CDM::AnesthesiaMachineConfigurationData& in, std::default_random_engine *rd) -{ - SEAnesthesiaMachineAction::Load(in); - if (in.ConfigurationFile().present()) - SetConfigurationFile(in.ConfigurationFile().get()); - if (in.Configuration().present()) - GetConfiguration().Load(in.Configuration().get()); - return true; -} -//----------------------------------------------------------------------------- -CDM::AnesthesiaMachineConfigurationData* SEAnesthesiaMachineConfiguration::Unload() const -{ - CDM::AnesthesiaMachineConfigurationData* data = new CDM::AnesthesiaMachineConfigurationData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEAnesthesiaMachineConfiguration::Unload(CDM::AnesthesiaMachineConfigurationData& data) const -{ - SEAnesthesiaMachineAction::Unload(data); - if (HasConfiguration()) - data.Configuration(std::unique_ptr(m_Configuration->Unload())); - else if (HasConfigurationFile()) - data.ConfigurationFile(m_ConfigurationFile); -} + //----------------------------------------------------------------------------- bool SEAnesthesiaMachineConfiguration::HasConfiguration() const { diff --git a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEExpiratoryValveLeak.cpp b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEExpiratoryValveLeak.cpp index f789e6884..4ea9b3ec2 100644 --- a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEExpiratoryValveLeak.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEExpiratoryValveLeak.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Anesthesia.h" +#include "io/cdm/AnesthesiaActions.h" + #include #include @@ -23,12 +26,12 @@ SEExpiratoryValveLeak::SEExpiratoryValveLeak() //------------------------------------------------------------------------------- SEExpiratoryValveLeak::~SEExpiratoryValveLeak() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEExpiratoryValveLeak::Clear() +void SEExpiratoryValveLeak::Invalidate() { - SEAnesthesiaMachineAction::Clear(); + SEAnesthesiaMachineAction::Invalidate(); SAFE_DELETE(m_Severity); } //------------------------------------------------------------------------------- @@ -42,27 +45,6 @@ bool SEExpiratoryValveLeak::IsActive() const return HasSeverity() ? !m_Severity->IsZero() : false; } //------------------------------------------------------------------------------- -bool SEExpiratoryValveLeak::Load(const CDM::ExpiratoryValveLeakData& in, std::default_random_engine *rd) -{ - SEAnesthesiaMachineAction::Load(in); - GetSeverity().Load(in.Severity(), rd); - return true; -} -//------------------------------------------------------------------------------- -CDM::ExpiratoryValveLeakData* SEExpiratoryValveLeak::Unload() const -{ - CDM::ExpiratoryValveLeakData* data = new CDM::ExpiratoryValveLeakData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEExpiratoryValveLeak::Unload(CDM::ExpiratoryValveLeakData& data) const -{ - SEAnesthesiaMachineAction::Unload(data); - if (m_Severity != nullptr) - data.Severity(std::unique_ptr(m_Severity->Unload())); -} -//------------------------------------------------------------------------------- bool SEExpiratoryValveLeak::HasSeverity() const { return m_Severity != nullptr; diff --git a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEExpiratoryValveObstruction.cpp b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEExpiratoryValveObstruction.cpp index 85b4870f2..917fbbdf8 100644 --- a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEExpiratoryValveObstruction.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEExpiratoryValveObstruction.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Anesthesia.h" +#include "io/cdm/AnesthesiaActions.h" + #include #include @@ -23,12 +26,12 @@ SEExpiratoryValveObstruction::SEExpiratoryValveObstruction() //------------------------------------------------------------------------------- SEExpiratoryValveObstruction::~SEExpiratoryValveObstruction() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEExpiratoryValveObstruction::Clear() +void SEExpiratoryValveObstruction::Invalidate() { - SEAnesthesiaMachineAction::Clear(); + SEAnesthesiaMachineAction::Invalidate(); SAFE_DELETE(m_Severity); } //------------------------------------------------------------------------------- @@ -42,27 +45,6 @@ bool SEExpiratoryValveObstruction::IsActive() const return HasSeverity() ? !m_Severity->IsZero() : false; } //------------------------------------------------------------------------------- -bool SEExpiratoryValveObstruction::Load(const CDM::ExpiratoryValveObstructionData& in, std::default_random_engine *rd) -{ - SEAnesthesiaMachineAction::Load(in); - GetSeverity().Load(in.Severity(), rd); - return true; -} -//------------------------------------------------------------------------------- -CDM::ExpiratoryValveObstructionData* SEExpiratoryValveObstruction::Unload() const -{ - CDM::ExpiratoryValveObstructionData* data = new CDM::ExpiratoryValveObstructionData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEExpiratoryValveObstruction::Unload(CDM::ExpiratoryValveObstructionData& data) const -{ - SEAnesthesiaMachineAction::Unload(data); - if (m_Severity != nullptr) - data.Severity(std::unique_ptr(m_Severity->Unload())); -} -//------------------------------------------------------------------------------- bool SEExpiratoryValveObstruction::HasSeverity() const { return m_Severity != nullptr; diff --git a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEInspiratoryValveLeak.cpp b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEInspiratoryValveLeak.cpp index e1ea35c71..a9f56cc45 100644 --- a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEInspiratoryValveLeak.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEInspiratoryValveLeak.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Anesthesia.h" +#include "io/cdm/AnesthesiaActions.h" + #include #include @@ -23,12 +26,12 @@ SEInspiratoryValveLeak::SEInspiratoryValveLeak() //------------------------------------------------------------------------------- SEInspiratoryValveLeak::~SEInspiratoryValveLeak() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEInspiratoryValveLeak::Clear() +void SEInspiratoryValveLeak::Invalidate() { - SEAnesthesiaMachineAction::Clear(); + SEAnesthesiaMachineAction::Invalidate(); SAFE_DELETE(m_Severity); } //------------------------------------------------------------------------------- @@ -42,27 +45,6 @@ bool SEInspiratoryValveLeak::IsActive() const return HasSeverity() ? !m_Severity->IsZero() : false; } //------------------------------------------------------------------------------- -bool SEInspiratoryValveLeak::Load(const CDM::InspiratoryValveLeakData& in, std::default_random_engine *rd) -{ - SEAnesthesiaMachineAction::Load(in); - GetSeverity().Load(in.Severity(), rd); - return true; -} -//------------------------------------------------------------------------------- -CDM::InspiratoryValveLeakData* SEInspiratoryValveLeak::Unload() const -{ - CDM::InspiratoryValveLeakData* data = new CDM::InspiratoryValveLeakData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEInspiratoryValveLeak::Unload(CDM::InspiratoryValveLeakData& data) const -{ - SEAnesthesiaMachineAction::Unload(data); - if (m_Severity != nullptr) - data.Severity(std::unique_ptr(m_Severity->Unload())); -} -//------------------------------------------------------------------------------- bool SEInspiratoryValveLeak::HasSeverity() const { return m_Severity != nullptr; diff --git a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEInspiratoryValveObstruction.cpp b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEInspiratoryValveObstruction.cpp index 23cf9d5b1..e5aa9d407 100644 --- a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEInspiratoryValveObstruction.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEInspiratoryValveObstruction.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Anesthesia.h" +#include "io/cdm/AnesthesiaActions.h" + #include #include @@ -23,12 +26,12 @@ SEInspiratoryValveObstruction::SEInspiratoryValveObstruction() //------------------------------------------------------------------------------- SEInspiratoryValveObstruction::~SEInspiratoryValveObstruction() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEInspiratoryValveObstruction::Clear() +void SEInspiratoryValveObstruction::Invalidate() { - SEAnesthesiaMachineAction::Clear(); + SEAnesthesiaMachineAction::Invalidate(); SAFE_DELETE(m_Severity); } //------------------------------------------------------------------------------- @@ -42,27 +45,6 @@ bool SEInspiratoryValveObstruction::IsActive() const return HasSeverity() ? !m_Severity->IsZero() : false; } //------------------------------------------------------------------------------- -bool SEInspiratoryValveObstruction::Load(const CDM::InspiratoryValveObstructionData& in, std::default_random_engine *rd) -{ - SEAnesthesiaMachineAction::Load(in); - GetSeverity().Load(in.Severity(), rd); - return true; -} -//------------------------------------------------------------------------------- -CDM::InspiratoryValveObstructionData* SEInspiratoryValveObstruction::Unload() const -{ - CDM::InspiratoryValveObstructionData* data = new CDM::InspiratoryValveObstructionData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEInspiratoryValveObstruction::Unload(CDM::InspiratoryValveObstructionData& data) const -{ - SEAnesthesiaMachineAction::Unload(data); - if (m_Severity != nullptr) - data.Severity(std::unique_ptr(m_Severity->Unload())); -} -//------------------------------------------------------------------------------- bool SEInspiratoryValveObstruction::HasSeverity() const { return m_Severity != nullptr; diff --git a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEMaskLeak.cpp b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEMaskLeak.cpp index da935b24c..27652d9ca 100644 --- a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEMaskLeak.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEMaskLeak.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Anesthesia.h" +#include "io/cdm/AnesthesiaActions.h" + #include #include @@ -23,12 +26,12 @@ SEMaskLeak::SEMaskLeak() //------------------------------------------------------------------------------- SEMaskLeak::~SEMaskLeak() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEMaskLeak::Clear() +void SEMaskLeak::Invalidate() { - SEAnesthesiaMachineAction::Clear(); + SEAnesthesiaMachineAction::Invalidate(); SAFE_DELETE(m_Severity); } //------------------------------------------------------------------------------- @@ -42,27 +45,6 @@ bool SEMaskLeak::IsActive() const return HasSeverity() ? !m_Severity->IsZero() : false; } //------------------------------------------------------------------------------- -bool SEMaskLeak::Load(const CDM::MaskLeakData& in, std::default_random_engine *rd) -{ - SEAnesthesiaMachineAction::Load(in); - GetSeverity().Load(in.Severity(), rd); - return true; -} -//------------------------------------------------------------------------------- -CDM::MaskLeakData* SEMaskLeak::Unload() const -{ - CDM::MaskLeakData* data = new CDM::MaskLeakData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEMaskLeak::Unload(CDM::MaskLeakData& data) const -{ - SEAnesthesiaMachineAction::Unload(data); - if (m_Severity != nullptr) - data.Severity(std::unique_ptr(m_Severity->Unload())); -} -//------------------------------------------------------------------------------- bool SEMaskLeak::HasSeverity() const { return m_Severity != nullptr; diff --git a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEOxygenTankPressureLoss.cpp b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEOxygenTankPressureLoss.cpp index b6e336a1d..a9db2b3e0 100644 --- a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEOxygenTankPressureLoss.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEOxygenTankPressureLoss.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Anesthesia.h" +#include "io/cdm/AnesthesiaActions.h" + #include #include @@ -18,18 +21,18 @@ namespace biogears { SEOxygenTankPressureLoss::SEOxygenTankPressureLoss() : SEAnesthesiaMachineAction() { - m_State = CDM::enumOnOff::Off; + m_State = SEOnOff::Off; } //------------------------------------------------------------------------------- SEOxygenTankPressureLoss::~SEOxygenTankPressureLoss() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEOxygenTankPressureLoss::Clear() +void SEOxygenTankPressureLoss::Invalidate() { - SEAnesthesiaMachineAction::Clear(); - m_State = (CDM::enumOnOff::value)-1; + SEAnesthesiaMachineAction::Invalidate(); + m_State = SEOnOff::Invalid; } //------------------------------------------------------------------------------- bool SEOxygenTankPressureLoss::IsValid() const @@ -39,32 +42,12 @@ bool SEOxygenTankPressureLoss::IsValid() const //------------------------------------------------------------------------------- bool SEOxygenTankPressureLoss::IsActive() const { - return m_State == CDM::enumOnOff::On; + return m_State == SEOnOff::On; } //------------------------------------------------------------------------------- void SEOxygenTankPressureLoss::SetActive(bool b) { - m_State = b ? CDM::enumOnOff::On : CDM::enumOnOff::Off; -} -//------------------------------------------------------------------------------- -bool SEOxygenTankPressureLoss::Load(const CDM::OxygenTankPressureLossData& in, std::default_random_engine *rd) -{ - SEAnesthesiaMachineAction::Load(in); - SetActive(in.State() == CDM::enumOnOff::On ? true : false); - return true; -} -//------------------------------------------------------------------------------- -CDM::OxygenTankPressureLossData* SEOxygenTankPressureLoss::Unload() const -{ - CDM::OxygenTankPressureLossData* data = new CDM::OxygenTankPressureLossData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEOxygenTankPressureLoss::Unload(CDM::OxygenTankPressureLossData& data) const -{ - SEAnesthesiaMachineAction::Unload(data); - data.State(IsActive() ? CDM::enumOnOff::On : CDM::enumOnOff::Off); + m_State = b ? SEOnOff::On : SEOnOff::Off; } //------------------------------------------------------------------------------- void SEOxygenTankPressureLoss::ToString(std::ostream& str) const diff --git a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEOxygenWallPortPressureLoss.cpp b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEOxygenWallPortPressureLoss.cpp index 76deaa488..e461155d9 100644 --- a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEOxygenWallPortPressureLoss.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEOxygenWallPortPressureLoss.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Anesthesia.h" +#include "io/cdm/AnesthesiaActions.h" + #include #include @@ -18,18 +21,18 @@ namespace biogears { SEOxygenWallPortPressureLoss::SEOxygenWallPortPressureLoss() : SEAnesthesiaMachineAction() { - m_State = CDM::enumOnOff::Off; + m_State = SEOnOff::Off; } //------------------------------------------------------------------------------- SEOxygenWallPortPressureLoss::~SEOxygenWallPortPressureLoss() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEOxygenWallPortPressureLoss::Clear() +void SEOxygenWallPortPressureLoss::Invalidate() { - SEAnesthesiaMachineAction::Clear(); - m_State = (CDM::enumOnOff::value)-1; + SEAnesthesiaMachineAction::Invalidate(); + m_State = SEOnOff::Invalid; } //------------------------------------------------------------------------------- bool SEOxygenWallPortPressureLoss::IsValid() const @@ -39,33 +42,14 @@ bool SEOxygenWallPortPressureLoss::IsValid() const //------------------------------------------------------------------------------- bool SEOxygenWallPortPressureLoss::IsActive() const { - return m_State == CDM::enumOnOff::On; + return m_State == SEOnOff::On; } //------------------------------------------------------------------------------- void SEOxygenWallPortPressureLoss::SetActive(bool b) { - m_State = b ? CDM::enumOnOff::On : CDM::enumOnOff::Off; -} -//------------------------------------------------------------------------------- -bool SEOxygenWallPortPressureLoss::Load(const CDM::OxygenWallPortPressureLossData& in, std::default_random_engine *rd) -{ - SEAnesthesiaMachineAction::Load(in); - SetActive(in.State() == CDM::enumOnOff::On ? true : false); - return true; -} -//------------------------------------------------------------------------------- -CDM::OxygenWallPortPressureLossData* SEOxygenWallPortPressureLoss::Unload() const -{ - CDM::OxygenWallPortPressureLossData* data = new CDM::OxygenWallPortPressureLossData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEOxygenWallPortPressureLoss::Unload(CDM::OxygenWallPortPressureLossData& data) const -{ - SEAnesthesiaMachineAction::Unload(data); - data.State(IsActive() ? CDM::enumOnOff::On : CDM::enumOnOff::Off); + m_State = b ? SEOnOff::On : SEOnOff::Off; } + //------------------------------------------------------------------------------- void SEOxygenWallPortPressureLoss::ToString(std::ostream& str) const { diff --git a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SESodaLimeFailure.cpp b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SESodaLimeFailure.cpp index 672100920..56b0f63ad 100644 --- a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SESodaLimeFailure.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SESodaLimeFailure.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Anesthesia.h" +#include "io/cdm/AnesthesiaActions.h" + #include #include @@ -23,12 +26,12 @@ SESodaLimeFailure::SESodaLimeFailure() //------------------------------------------------------------------------------- SESodaLimeFailure::~SESodaLimeFailure() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SESodaLimeFailure::Clear() +void SESodaLimeFailure::Invalidate() { - SEAnesthesiaMachineAction::Clear(); + SEAnesthesiaMachineAction::Invalidate(); SAFE_DELETE(m_Severity); } //------------------------------------------------------------------------------- @@ -41,27 +44,7 @@ bool SESodaLimeFailure::IsActive() const { return HasSeverity() ? !m_Severity->IsZero() : false; } -//------------------------------------------------------------------------------- -bool SESodaLimeFailure::Load(const CDM::SodaLimeFailureData& in, std::default_random_engine *rd) -{ - SEAnesthesiaMachineAction::Load(in); - GetSeverity().Load(in.Severity(), rd); - return true; -} -//------------------------------------------------------------------------------- -CDM::SodaLimeFailureData* SESodaLimeFailure::Unload() const -{ - CDM::SodaLimeFailureData* data = new CDM::SodaLimeFailureData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SESodaLimeFailure::Unload(CDM::SodaLimeFailureData& data) const -{ - SEAnesthesiaMachineAction::Unload(data); - if (m_Severity != nullptr) - data.Severity(std::unique_ptr(m_Severity->Unload())); -} + //------------------------------------------------------------------------------- bool SESodaLimeFailure::HasSeverity() const { diff --git a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SETubeCuffLeak.cpp b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SETubeCuffLeak.cpp index 7f1c26475..16da945f0 100644 --- a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SETubeCuffLeak.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SETubeCuffLeak.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Anesthesia.h" +#include "io/cdm/AnesthesiaActions.h" + #include #include @@ -23,12 +26,12 @@ SETubeCuffLeak::SETubeCuffLeak() //------------------------------------------------------------------------------- SETubeCuffLeak::~SETubeCuffLeak() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SETubeCuffLeak::Clear() +void SETubeCuffLeak::Invalidate() { - SEAnesthesiaMachineAction::Clear(); + SEAnesthesiaMachineAction::Invalidate(); SAFE_DELETE(m_Severity); } //------------------------------------------------------------------------------- @@ -41,27 +44,7 @@ bool SETubeCuffLeak::IsActive() const { return HasSeverity() ? !m_Severity->IsZero() : false; } -//------------------------------------------------------------------------------- -bool SETubeCuffLeak::Load(const CDM::TubeCuffLeakData& in, std::default_random_engine *rd) -{ - SEAnesthesiaMachineAction::Load(in); - GetSeverity().Load(in.Severity(), rd); - return true; -} -//------------------------------------------------------------------------------- -CDM::TubeCuffLeakData* SETubeCuffLeak::Unload() const -{ - CDM::TubeCuffLeakData* data = new CDM::TubeCuffLeakData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SETubeCuffLeak::Unload(CDM::TubeCuffLeakData& data) const -{ - SEAnesthesiaMachineAction::Unload(data); - if (m_Severity != nullptr) - data.Severity(std::unique_ptr(m_Severity->Unload())); -} + //------------------------------------------------------------------------------- bool SETubeCuffLeak::HasSeverity() const { diff --git a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEVaporizerFailure.cpp b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEVaporizerFailure.cpp index e2e05dcbc..976b7b7bc 100644 --- a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEVaporizerFailure.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEVaporizerFailure.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Anesthesia.h" +#include "io/cdm/AnesthesiaActions.h" + #include #include @@ -23,12 +26,12 @@ SEVaporizerFailure::SEVaporizerFailure() //------------------------------------------------------------------------------- SEVaporizerFailure::~SEVaporizerFailure() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEVaporizerFailure::Clear() +void SEVaporizerFailure::Invalidate() { - SEAnesthesiaMachineAction::Clear(); + SEAnesthesiaMachineAction::Invalidate(); SAFE_DELETE(m_Severity); } //------------------------------------------------------------------------------- @@ -41,27 +44,7 @@ bool SEVaporizerFailure::IsActive() const { return HasSeverity() ? !m_Severity->IsZero() : false; } -//------------------------------------------------------------------------------- -bool SEVaporizerFailure::Load(const CDM::VaporizerFailureData& in, std::default_random_engine *rd) -{ - SEAnesthesiaMachineAction::Load(in); - GetSeverity().Load(in.Severity(), rd); - return true; -} -//------------------------------------------------------------------------------- -CDM::VaporizerFailureData* SEVaporizerFailure::Unload() const -{ - CDM::VaporizerFailureData* data = new CDM::VaporizerFailureData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEVaporizerFailure::Unload(CDM::VaporizerFailureData& data) const -{ - SEAnesthesiaMachineAction::Unload(data); - if (m_Severity != nullptr) - data.Severity(std::unique_ptr(m_Severity->Unload())); -} + //------------------------------------------------------------------------------- bool SEVaporizerFailure::HasSeverity() const { diff --git a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEVentilatorPressureLoss.cpp b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEVentilatorPressureLoss.cpp index 630fd85d3..5875d1c26 100644 --- a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEVentilatorPressureLoss.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEVentilatorPressureLoss.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Anesthesia.h" +#include "io/cdm/AnesthesiaActions.h" + #include #include @@ -23,12 +26,12 @@ SEVentilatorPressureLoss::SEVentilatorPressureLoss() //------------------------------------------------------------------------------- SEVentilatorPressureLoss::~SEVentilatorPressureLoss() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEVentilatorPressureLoss::Clear() +void SEVentilatorPressureLoss::Invalidate() { - SEAnesthesiaMachineAction::Clear(); + SEAnesthesiaMachineAction::Invalidate(); SAFE_DELETE(m_Severity); } //------------------------------------------------------------------------------- @@ -41,27 +44,7 @@ bool SEVentilatorPressureLoss::IsActive() const { return HasSeverity() ? !m_Severity->IsZero() : false; } -//------------------------------------------------------------------------------- -bool SEVentilatorPressureLoss::Load(const CDM::VentilatorPressureLossData& in, std::default_random_engine *rd) -{ - SEAnesthesiaMachineAction::Load(in); - GetSeverity().Load(in.Severity(), rd); - return true; -} -//------------------------------------------------------------------------------- -CDM::VentilatorPressureLossData* SEVentilatorPressureLoss::Unload() const -{ - CDM::VentilatorPressureLossData* data = new CDM::VentilatorPressureLossData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEVentilatorPressureLoss::Unload(CDM::VentilatorPressureLossData& data) const -{ - SEAnesthesiaMachineAction::Unload(data); - if (m_Severity != nullptr) - data.Severity(std::unique_ptr(m_Severity->Unload())); -} + //------------------------------------------------------------------------------- bool SEVentilatorPressureLoss::HasSeverity() const { diff --git a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEYPieceDisconnect.cpp b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEYPieceDisconnect.cpp index d62afc90d..19ccbaff4 100644 --- a/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEYPieceDisconnect.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/equipment/Anesthesia/actions/SEYPieceDisconnect.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Anesthesia.h" +#include "io/cdm/AnesthesiaActions.h" + #include #include @@ -23,12 +26,12 @@ SEYPieceDisconnect::SEYPieceDisconnect() //------------------------------------------------------------------------------- SEYPieceDisconnect::~SEYPieceDisconnect() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEYPieceDisconnect::Clear() +void SEYPieceDisconnect::Invalidate() { - SEAnesthesiaMachineAction::Clear(); + SEAnesthesiaMachineAction::Invalidate(); SAFE_DELETE(m_Severity); } //------------------------------------------------------------------------------- @@ -41,27 +44,7 @@ bool SEYPieceDisconnect::IsActive() const { return HasSeverity() ? !m_Severity->IsZero() : false; } -//------------------------------------------------------------------------------- -bool SEYPieceDisconnect::Load(const CDM::YPieceDisconnectData& in, std::default_random_engine *rd) -{ - SEAnesthesiaMachineAction::Load(in); - GetSeverity().Load(in.Severity(), rd); - return true; -} -//------------------------------------------------------------------------------- -CDM::YPieceDisconnectData* SEYPieceDisconnect::Unload() const -{ - CDM::YPieceDisconnectData* data = new CDM::YPieceDisconnectData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEYPieceDisconnect::Unload(CDM::YPieceDisconnectData& data) const -{ - SEAnesthesiaMachineAction::Unload(data); - if (m_Severity != nullptr) - data.Severity(std::unique_ptr(m_Severity->Unload())); -} + //------------------------------------------------------------------------------- bool SEYPieceDisconnect::HasSeverity() const { diff --git a/projects/biogears/libBiogears/src/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGram.cpp b/projects/biogears/libBiogears/src/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGram.cpp index 33266d8bf..d29581c54 100644 --- a/projects/biogears/libBiogears/src/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGram.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGram.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/ElectroCardioGram.h" + #include #include #include @@ -36,11 +38,11 @@ SEElectroCardioGram::SEElectroCardioGram(Logger* logger) SEElectroCardioGram::~SEElectroCardioGram() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEElectroCardioGram::Clear() +void SEElectroCardioGram::Invalidate() { SAFE_DELETE(m_Lead1ElectricPotential); SAFE_DELETE(m_Lead2ElectricPotential); @@ -55,73 +57,7 @@ void SEElectroCardioGram::Clear() SAFE_DELETE(m_Lead11ElectricPotential); SAFE_DELETE(m_Lead12ElectricPotential); } -//------------------------------------------------------------------------------- - -bool SEElectroCardioGram::Load(const CDM::ElectroCardioGramData& in) -{ - if (in.Lead1ElectricPotential().present()) - GetLead1ElectricPotential().Load(in.Lead1ElectricPotential().get()); - if (in.Lead2ElectricPotential().present()) - GetLead2ElectricPotential().Load(in.Lead2ElectricPotential().get()); - if (in.Lead3ElectricPotential().present()) - GetLead3ElectricPotential().Load(in.Lead3ElectricPotential().get()); - if (in.Lead4ElectricPotential().present()) - GetLead4ElectricPotential().Load(in.Lead4ElectricPotential().get()); - if (in.Lead5ElectricPotential().present()) - GetLead5ElectricPotential().Load(in.Lead5ElectricPotential().get()); - if (in.Lead6ElectricPotential().present()) - GetLead6ElectricPotential().Load(in.Lead6ElectricPotential().get()); - if (in.Lead7ElectricPotential().present()) - GetLead7ElectricPotential().Load(in.Lead7ElectricPotential().get()); - if (in.Lead8ElectricPotential().present()) - GetLead8ElectricPotential().Load(in.Lead8ElectricPotential().get()); - if (in.Lead9ElectricPotential().present()) - GetLead9ElectricPotential().Load(in.Lead9ElectricPotential().get()); - if (in.Lead10ElectricPotential().present()) - GetLead10ElectricPotential().Load(in.Lead10ElectricPotential().get()); - if (in.Lead11ElectricPotential().present()) - GetLead11ElectricPotential().Load(in.Lead11ElectricPotential().get()); - if (in.Lead12ElectricPotential().present()) - GetLead12ElectricPotential().Load(in.Lead12ElectricPotential().get()); - return true; -} -//------------------------------------------------------------------------------- - -CDM::ElectroCardioGramData* SEElectroCardioGram::Unload() const -{ - CDM::ElectroCardioGramData* data = new CDM::ElectroCardioGramData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEElectroCardioGram::Unload(CDM::ElectroCardioGramData& data) const -{ - if (m_Lead1ElectricPotential != nullptr) - data.Lead1ElectricPotential(std::unique_ptr(m_Lead1ElectricPotential->Unload())); - if (m_Lead2ElectricPotential != nullptr) - data.Lead2ElectricPotential(std::unique_ptr(m_Lead2ElectricPotential->Unload())); - if (m_Lead3ElectricPotential != nullptr) - data.Lead3ElectricPotential(std::unique_ptr(m_Lead3ElectricPotential->Unload())); - if (m_Lead4ElectricPotential != nullptr) - data.Lead4ElectricPotential(std::unique_ptr(m_Lead4ElectricPotential->Unload())); - if (m_Lead5ElectricPotential != nullptr) - data.Lead5ElectricPotential(std::unique_ptr(m_Lead5ElectricPotential->Unload())); - if (m_Lead6ElectricPotential != nullptr) - data.Lead6ElectricPotential(std::unique_ptr(m_Lead6ElectricPotential->Unload())); - if (m_Lead7ElectricPotential != nullptr) - data.Lead7ElectricPotential(std::unique_ptr(m_Lead7ElectricPotential->Unload())); - if (m_Lead8ElectricPotential != nullptr) - data.Lead8ElectricPotential(std::unique_ptr(m_Lead8ElectricPotential->Unload())); - if (m_Lead9ElectricPotential != nullptr) - data.Lead9ElectricPotential(std::unique_ptr(m_Lead9ElectricPotential->Unload())); - if (m_Lead10ElectricPotential != nullptr) - data.Lead10ElectricPotential(std::unique_ptr(m_Lead10ElectricPotential->Unload())); - if (m_Lead11ElectricPotential != nullptr) - data.Lead11ElectricPotential(std::unique_ptr(m_Lead11ElectricPotential->Unload())); - if (m_Lead12ElectricPotential != nullptr) - data.Lead12ElectricPotential(std::unique_ptr(m_Lead12ElectricPotential->Unload())); -} //------------------------------------------------------------------------------- const SEScalar* SEElectroCardioGram::GetScalar(const char* name) { diff --git a/projects/biogears/libBiogears/src/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramInterpolationWaveform.cpp b/projects/biogears/libBiogears/src/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramInterpolationWaveform.cpp index 86e2ea5eb..181b21f2e 100644 --- a/projects/biogears/libBiogears/src/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramInterpolationWaveform.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramInterpolationWaveform.cpp @@ -9,81 +9,48 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **************************************************************************************/ +#include +#include + +#include "io/cdm/ElectroCardioGram.h" +#include +#include #include #include -#include -#include #include +#include namespace biogears { SEElectroCardioGramInterpolationWaveform::SEElectroCardioGramInterpolationWaveform(Logger* logger) : Loggable(logger) + , m_LeadNumber(0, logger) { m_TimeStep = nullptr; m_Data = nullptr; - m_Rhythm = (CDM::enumHeartRhythm::value)-1; - m_LeadNumber = 0; + m_Rhythm = SEHeartRhythm::Invalid; } //----------------------------------------------------------------------------- SEElectroCardioGramInterpolationWaveform::~SEElectroCardioGramInterpolationWaveform() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SEElectroCardioGramInterpolationWaveform::Clear() +void SEElectroCardioGramInterpolationWaveform::Invalidate() { m_LeadNumber = 0; - m_Rhythm = (CDM::enumHeartRhythm::value)-1; + m_Rhythm = SEHeartRhythm::Invalid; SAFE_DELETE(m_TimeStep); SAFE_DELETE(m_Data); m_ActiveIndicies.clear(); } + //----------------------------------------------------------------------------- -bool SEElectroCardioGramInterpolationWaveform::Load(const CDM::ElectroCardioGramInterpolationWaveformData& in) -{ - Clear(); - m_Rhythm = in.Rhythm(); - m_LeadNumber = in.Lead(); - GetData().Load(in.Data()); - if (in.TimeStep().present()) - GetTimeStep().Load(in.TimeStep().get()); - if (in.ActiveIndicies().present()) { - for (size_t i = 0; i < in.ActiveIndicies().get().IntegerList().size(); i++) - m_ActiveIndicies.push_back(in.ActiveIndicies().get().IntegerList()[i]); - } - return true; -} -//----------------------------------------------------------------------------- -CDM::ElectroCardioGramInterpolationWaveformData* SEElectroCardioGramInterpolationWaveform::Unload() const -{ - CDM::ElectroCardioGramInterpolationWaveformData* data(new CDM::ElectroCardioGramInterpolationWaveformData()); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEElectroCardioGramInterpolationWaveform::Unload(CDM::ElectroCardioGramInterpolationWaveformData& data) const -{ - if (HasRhythm()) - data.Rhythm(m_Rhythm); - if (HasLeadNumber()) - data.Lead(m_LeadNumber); - if (HasData()) { - data.Data(std::unique_ptr(m_Data->Unload())); - data.ActiveIndicies(std::unique_ptr(new CDM::IntegerArray())); - data.ActiveIndicies().get().IntegerList(std::unique_ptr(new CDM::IntegerList())); - for (int i : m_ActiveIndicies) - data.ActiveIndicies().get().IntegerList().push_back(i); - } - if (HasTimeStep()) - data.TimeStep(std::unique_ptr(m_TimeStep->Unload())); -} -//----------------------------------------------------------------------------- -CDM::ElectroCardioGramWaveformLeadNumberData SEElectroCardioGramInterpolationWaveform::GetLeadNumber() const +SEElectroCardioGramWaveformLeadNumber SEElectroCardioGramInterpolationWaveform::GetLeadNumber() const { return m_LeadNumber; } -void SEElectroCardioGramInterpolationWaveform::SetLeadNumber(CDM::ElectroCardioGramWaveformLeadNumberData n) +void SEElectroCardioGramInterpolationWaveform::SetLeadNumber(SEElectroCardioGramWaveformLeadNumber n) { m_LeadNumber = n; } @@ -96,21 +63,21 @@ void SEElectroCardioGramInterpolationWaveform::InvalidateLeadNumber() m_LeadNumber = 0; } //----------------------------------------------------------------------------- -CDM::enumHeartRhythm::value SEElectroCardioGramInterpolationWaveform::GetRhythm() const +SEHeartRhythm SEElectroCardioGramInterpolationWaveform::GetRhythm() const { return m_Rhythm; } -void SEElectroCardioGramInterpolationWaveform::SetRhythm(CDM::enumHeartRhythm::value rhythm) +void SEElectroCardioGramInterpolationWaveform::SetRhythm(SEHeartRhythm rhythm) { m_Rhythm = rhythm; } bool SEElectroCardioGramInterpolationWaveform::HasRhythm() const { - return m_Rhythm == ((CDM::enumHeartRhythm::value)-1) ? false : true; + return m_Rhythm == SEHeartRhythm::Invalid ? false : true; } void SEElectroCardioGramInterpolationWaveform::InvalidateRhythm() { - m_Rhythm = (CDM::enumHeartRhythm::value)-1; + m_Rhythm = SEHeartRhythm::Invalid; } //----------------------------------------------------------------------------- bool SEElectroCardioGramInterpolationWaveform::HasData() const diff --git a/projects/biogears/libBiogears/src/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramInterpolator.cpp b/projects/biogears/libBiogears/src/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramInterpolator.cpp index 1916c0406..5567b082f 100644 --- a/projects/biogears/libBiogears/src/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramInterpolator.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramInterpolator.cpp @@ -11,20 +11,26 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/ElectroCardioGram.h" +#include "io/cdm/Property.h" + #include #include #include #include #include +#include #include +#include + #ifdef BIOGEARS_IO_PRESENT #include #endif namespace std { -template class map; -template class map; -template class map>; +template class map; +template class map; +template class map>; } namespace biogears { @@ -35,10 +41,13 @@ SEElectroCardioGramInterpolator::SEElectroCardioGramInterpolator(Logger* logger) //------------------------------------------------------------------------------- SEElectroCardioGramInterpolator::~SEElectroCardioGramInterpolator() { - Clear(); + for (auto i : m_Waveforms) + for (auto j : i.second) + delete j.second; + m_Waveforms.clear(); } //------------------------------------------------------------------------------- -void SEElectroCardioGramInterpolator::Clear() +void SEElectroCardioGramInterpolator::Invalidate() { for (auto i : m_Waveforms) for (auto j : i.second) @@ -54,14 +63,14 @@ bool SEElectroCardioGramInterpolator::LoadWaveforms(const char* file, const SESc //------------------------------------------------------------------------------- bool SEElectroCardioGramInterpolator::LoadWaveforms(const std::string& given_path, const SEScalarTime* timeStep) { - Clear(); + Invalidate(); std::stringstream ss; if (given_path.empty()) { ss << "Waveform file not provided: " << given_path << std::endl; Error(ss); return false; } - Clear(); + Invalidate(); std::unique_ptr data; @@ -78,49 +87,25 @@ bool SEElectroCardioGramInterpolator::LoadWaveforms(const std::string& given_pat data = Serializer::ReadFile(possible_path, m_Logger); } - CDM::ElectroCardioGramInterpolatorData* pData = dynamic_cast(data.get()); - if (pData == nullptr) { + if (CDM::ElectroCardioGramInterpolatorData* pData = dynamic_cast(data.get())) { + try { + io::ElectroCardioGram::UnMarshall(*pData, *this); + } catch (CommonDataModelException ex) { + ss << "Unable to load waveform file: " << given_path << std::endl; + Error(ss); + return false; + } + } else { ss << "Waveform data file could not be read : " << given_path << std::endl; Error(ss); return false; } - if (!Load(*pData)) { - ss << "Unable to load waveform file: " << given_path << std::endl; - Error(ss); - return false; - } + if (timeStep != nullptr) Interpolate(*timeStep); return true; } -//------------------------------------------------------------------------------- -bool SEElectroCardioGramInterpolator::Load(const CDM::ElectroCardioGramInterpolatorData& in) -{ - Clear(); - for (auto& w : in.Waveform()) { - SEElectroCardioGramInterpolationWaveform* waveform = new SEElectroCardioGramInterpolationWaveform(GetLogger()); - if (!waveform->Load(w)) { - Error("Unable to load waveform"); - return false; - } else - m_Waveforms[waveform->GetLeadNumber()][waveform->GetRhythm()] = waveform; - } - return true; -} -//------------------------------------------------------------------------------- -CDM::ElectroCardioGramInterpolatorData* SEElectroCardioGramInterpolator::Unload() const -{ - CDM::ElectroCardioGramInterpolatorData* data(new CDM::ElectroCardioGramInterpolatorData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEElectroCardioGramInterpolator::Unload(CDM::ElectroCardioGramInterpolatorData& data) const -{ - for (auto i : m_Waveforms) - for (auto j : i.second) - data.Waveform().push_back(std::unique_ptr(j.second->Unload())); -} + //------------------------------------------------------------------------------- void SEElectroCardioGramInterpolator::Interpolate(const SEScalarTime& timeStep) { @@ -156,12 +141,16 @@ void SEElectroCardioGramInterpolator::Interpolate(SEElectroCardioGramInterpolati currentTime_s += timeStep_s; } SEFunctionElectricPotentialVsTime* iWaveForm = data.InterpolateToTime(iTime, TimeUnit::s); // creates the new waveform data - CDM_COPY(iWaveForm, (&data)); + + auto bind = CDM::FunctionElectricPotentialVsTimeData(); + io::Property::Marshall(*iWaveForm, bind); + io::Property::UnMarshall(bind, data); + delete iWaveForm; } } //------------------------------------------------------------------------------- -bool SEElectroCardioGramInterpolator::CanInterpolateLeadPotential(CDM::ElectroCardioGramWaveformLeadNumberData lead, CDM::enumHeartRhythm::value rhythm) const +bool SEElectroCardioGramInterpolator::CanInterpolateLeadPotential(biogears::SEElectroCardioGramWaveformLeadNumber lead, SEHeartRhythm rhythm) const { if (!HasWaveform(lead, rhythm)) return false; @@ -171,12 +160,12 @@ bool SEElectroCardioGramInterpolator::CanInterpolateLeadPotential(CDM::ElectroCa return l->second != nullptr; } //------------------------------------------------------------------------------- -void SEElectroCardioGramInterpolator::SetLeadElectricPotential(CDM::ElectroCardioGramWaveformLeadNumberData lead, SEScalarElectricPotential& ep) +void SEElectroCardioGramInterpolator::SetLeadElectricPotential(biogears::SEElectroCardioGramWaveformLeadNumber lead, SEScalarElectricPotential& ep) { m_Leads[lead] = &ep; } //------------------------------------------------------------------------------- -bool SEElectroCardioGramInterpolator::StartNewCycle(CDM::enumHeartRhythm::value rhythm) +bool SEElectroCardioGramInterpolator::StartNewCycle(SEHeartRhythm rhythm) { for (auto l2rw : m_Waveforms) { if (m_Leads.find(l2rw.first) == m_Leads.end() && !HasWaveform(l2rw.first, rhythm)) { @@ -229,7 +218,7 @@ void SEElectroCardioGramInterpolator::CalculateWaveformsElectricPotential() } } //------------------------------------------------------------------------------- -bool SEElectroCardioGramInterpolator::HasWaveform(CDM::ElectroCardioGramWaveformLeadNumberData lead, CDM::enumHeartRhythm::value rhythm) const +bool SEElectroCardioGramInterpolator::HasWaveform(biogears::SEElectroCardioGramWaveformLeadNumber lead, SEHeartRhythm rhythm) const { auto l = m_Waveforms.find(lead); if (l == m_Waveforms.end()) @@ -240,7 +229,7 @@ bool SEElectroCardioGramInterpolator::HasWaveform(CDM::ElectroCardioGramWaveform return w->second != nullptr; } //------------------------------------------------------------------------------- -SEElectroCardioGramInterpolationWaveform& SEElectroCardioGramInterpolator::GetWaveform(CDM::ElectroCardioGramWaveformLeadNumberData lead, CDM::enumHeartRhythm::value rhythm) +SEElectroCardioGramInterpolationWaveform& SEElectroCardioGramInterpolator::GetWaveform(biogears::SEElectroCardioGramWaveformLeadNumber lead, SEHeartRhythm rhythm) { SEElectroCardioGramInterpolationWaveform* w = m_Waveforms[lead][rhythm]; if (w == nullptr) { @@ -252,7 +241,7 @@ SEElectroCardioGramInterpolationWaveform& SEElectroCardioGramInterpolator::GetWa return *w; } //------------------------------------------------------------------------------- -const SEElectroCardioGramInterpolationWaveform* SEElectroCardioGramInterpolator::GetWaveform(CDM::ElectroCardioGramWaveformLeadNumberData lead, CDM::enumHeartRhythm::value rhythm) const +const SEElectroCardioGramInterpolationWaveform* SEElectroCardioGramInterpolator::GetWaveform(biogears::SEElectroCardioGramWaveformLeadNumber lead, SEHeartRhythm rhythm) const { auto l = m_Waveforms.find(lead); if (l == m_Waveforms.end()) @@ -263,7 +252,7 @@ const SEElectroCardioGramInterpolationWaveform* SEElectroCardioGramInterpolator: return w->second; } //------------------------------------------------------------------------------- -void SEElectroCardioGramInterpolator::RemoveWaveform(CDM::ElectroCardioGramWaveformLeadNumberData lead, CDM::enumHeartRhythm::value rhythm) +void SEElectroCardioGramInterpolator::RemoveWaveform(biogears::SEElectroCardioGramWaveformLeadNumber lead, SEHeartRhythm rhythm) { auto l = m_Waveforms.find(lead); if (l == m_Waveforms.end()) @@ -303,8 +292,7 @@ bool SEElectroCardioGramInterpolator::operator==(SEElectroCardioGramInterpolator : itr->second == rhs.m_Leads.at(itr->first); } } - } - catch (std::out_of_range ex) { + } catch (std::out_of_range ex) { return false; } return equivilant; diff --git a/projects/biogears/libBiogears/src/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramInterpolatorWaveform.cpp b/projects/biogears/libBiogears/src/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramInterpolatorWaveform.cpp deleted file mode 100644 index eb7dcdef3..000000000 --- a/projects/biogears/libBiogears/src/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramInterpolatorWaveform.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/************************************************************************************** -Copyright 2015 Applied Research Associates, Inc. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the License -at: -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software distributed under -the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -CONDITIONS OF ANY KIND, either express or implied. See the License for the -specific language governing permissions and limitations under the License. -**************************************************************************************/ - -#include -#include -#include -#include -#include - -namespace biogears { -SEElectroCardioGramInterpolatorWaveform::SEElectroCardioGramInterpolatorWaveform(Logger* logger) - : Loggable(logger) -{ - m_TimeStep = nullptr; - m_Data = nullptr; - m_Rhythm = (CDM::enumHeartRhythm::value)-1; - m_LeadNumber = 0; -} - -SEElectroCardioGramInterpolatorWaveform::~SEElectroCardioGramInterpolatorWaveform() -{ - Clear(); -} - -void SEElectroCardioGramInterpolatorWaveform::Clear() -{ - m_LeadNumber = 0; - m_Rhythm = (CDM::enumHeartRhythm::value)-1; - SAFE_DELETE(m_TimeStep); - SAFE_DELETE(m_Data); - m_ActiveIndicies.clear(); -} - -bool SEElectroCardioGramInterpolatorWaveform::Load(const CDM::ElectroCardioGramInterpolationWaveformData& in) -{ - Clear(); - m_Rhythm = in.Rhythm(); - m_LeadNumber = in.Lead(); - GetData().Load(in.Data()); - if (in.TimeStep().present()) - GetTimeStep().Load(in.TimeStep().get()); - if (in.ActiveIndicies().present()) { - for (size_t i = 0; i < in.ActiveIndicies().get().IntegerList().size(); i++) - m_ActiveIndicies.push_back(in.ActiveIndicies().get().IntegerList()[i]); - } - return true; -} - -CDM::ElectroCardioGramInterpolationWaveformData* SEElectroCardioGramInterpolatorWaveform::Unload() const -{ - CDM::ElectroCardioGramInterpolationWaveformData* data(new CDM::ElectroCardioGramInterpolationWaveformData()); - Unload(*data); - return data; -} - -void SEElectroCardioGramInterpolatorWaveform::Unload(CDM::ElectroCardioGramInterpolationWaveformData& data) const -{ - if (HasRhythm()) - data.Rhythm(m_Rhythm); - if (HasLeadNumber()) - data.Lead(m_LeadNumber); - if (HasData()) { - data.Data(std::unique_ptr(m_Data->Unload())); - data.ActiveIndicies(std::unique_ptr(new CDM::IntegerArray())); - data.ActiveIndicies().get().IntegerList(std::unique_ptr(new CDM::IntegerList())); - for (int i : m_ActiveIndicies) - data.ActiveIndicies().get().IntegerList().push_back(i); - } - if (HasTimeStep()) - data.TimeStep(std::unique_ptr(m_TimeStep->Unload())); -} - -CDM::ElectroCardioGramWaveformLeadNumberData SEElectroCardioGramInterpolatorWaveform::GetLeadNumber() const -{ - return m_LeadNumber; -} -void SEElectroCardioGramInterpolatorWaveform::SetLeadNumber(CDM::ElectroCardioGramWaveformLeadNumberData n) -{ - m_LeadNumber = n; -} -bool SEElectroCardioGramInterpolatorWaveform::HasLeadNumber() const -{ - return m_LeadNumber == 0 ? false : true; -} -void SEElectroCardioGramInterpolatorWaveform::InvalidateLeadNumber() -{ - m_LeadNumber = 0; -} - -CDM::enumHeartRhythm::value SEElectroCardioGramInterpolatorWaveform::GetRhythm() const -{ - return m_Rhythm; -} -void SEElectroCardioGramInterpolatorWaveform::SetRhythm(CDM::enumHeartRhythm::value rhythm) -{ - m_Rhythm = rhythm; -} -bool SEElectroCardioGramInterpolatorWaveform::HasRhythm() const -{ - return m_Rhythm == ((CDM::enumHeartRhythm::value)-1) ? false : true; -} -void SEElectroCardioGramInterpolatorWaveform::InvalidateRhythm() -{ - m_Rhythm = (CDM::enumHeartRhythm::value)-1; -} - -bool SEElectroCardioGramInterpolatorWaveform::HasData() const -{ - return m_Data == nullptr ? false : m_Data->IsValid(); -} -SEFunctionElectricPotentialVsTime& SEElectroCardioGramInterpolatorWaveform::GetData() -{ - if (m_Data == nullptr) - m_Data = new SEFunctionElectricPotentialVsTime(); - return *m_Data; -} -const SEFunctionElectricPotentialVsTime* SEElectroCardioGramInterpolatorWaveform::GetData() const -{ - return m_Data; -} - -bool SEElectroCardioGramInterpolatorWaveform::HasTimeStep() const -{ - return m_TimeStep == nullptr ? false : m_TimeStep->IsValid(); -} -SEScalarTime& SEElectroCardioGramInterpolatorWaveform::GetTimeStep() -{ - if (m_TimeStep == nullptr) - m_TimeStep = new SEScalarTime(); - return *m_TimeStep; -} -double SEElectroCardioGramInterpolatorWaveform::GetTimeStep(const TimeUnit& unit) const -{ - if (m_TimeStep == nullptr) - return SEScalar::dNaN(); - return m_TimeStep->GetValue(unit); -} -} \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramWaveformLeadNumber.cpp b/projects/biogears/libBiogears/src/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramWaveformLeadNumber.cpp index 685a6f926..0e42f6164 100644 --- a/projects/biogears/libBiogears/src/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramWaveformLeadNumber.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/equipment/ElectroCardioGram/SEElectroCardioGramWaveformLeadNumber.cpp @@ -1,4 +1,7 @@ #include + +#include "io/cdm/ElectroCardioGram.h" + #include namespace biogears { @@ -7,7 +10,7 @@ SEElectroCardioGramWaveformLeadNumber::SEElectroCardioGramWaveformLeadNumber(Log , m_value(1) { } -SEElectroCardioGramWaveformLeadNumber::SEElectroCardioGramWaveformLeadNumber(Logger*, int lead) +SEElectroCardioGramWaveformLeadNumber::SEElectroCardioGramWaveformLeadNumber(int lead, Logger*) : m_value(1) { SetValue(lead); @@ -17,25 +20,7 @@ SEElectroCardioGramWaveformLeadNumber::SEElectroCardioGramWaveformLeadNumber(Log SEElectroCardioGramWaveformLeadNumber::~SEElectroCardioGramWaveformLeadNumber() { } -//------------------------------------------------------------------------------- -bool SEElectroCardioGramWaveformLeadNumber::Load(const CDM::ElectroCardioGramWaveformLeadNumberData& in) -{ - m_value = static_cast(in); - return true; -} -//------------------------------------------------------------------------------- -CDM::ElectroCardioGramWaveformLeadNumberData* SEElectroCardioGramWaveformLeadNumber::Unload() const -{ - auto data = new CDM::ElectroCardioGramWaveformLeadNumberData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEElectroCardioGramWaveformLeadNumber::Unload(CDM::ElectroCardioGramWaveformLeadNumberData& data) const -{ - data = m_value; -} //------------------------------------------------------------------------------- int SEElectroCardioGramWaveformLeadNumber::GetValue() const { diff --git a/projects/biogears/libBiogears/src/cdm/system/equipment/Inhaler/SEInhaler.cpp b/projects/biogears/libBiogears/src/cdm/system/equipment/Inhaler/SEInhaler.cpp index 53d0cff91..5cec0468b 100644 --- a/projects/biogears/libBiogears/src/cdm/system/equipment/Inhaler/SEInhaler.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/equipment/Inhaler/SEInhaler.cpp @@ -11,7 +11,11 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Inhaler.h" +#include "io/cdm/InhalerActions.h" + #include +#include #include #include #include @@ -26,7 +30,7 @@ SEInhaler::SEInhaler(SESubstanceManager& substances) : SESystem(substances.GetLogger()) , m_Substances(substances) { - m_State = CDM::enumOnOff::value(-1); + m_State = SEOnOff(-1); m_MeteredDose = nullptr; m_NozzleLoss = nullptr; m_SpacerVolume = nullptr; @@ -36,62 +40,21 @@ SEInhaler::SEInhaler(SESubstanceManager& substances) SEInhaler::~SEInhaler() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEInhaler::Clear() +void SEInhaler::Invalidate() { - SESystem::Clear(); + SESystem::Invalidate(); - m_State = CDM::enumOnOff::value(-1); + m_State = SEOnOff(-1); SAFE_DELETE(m_MeteredDose); SAFE_DELETE(m_NozzleLoss); SAFE_DELETE(m_SpacerVolume); m_Substance = nullptr; } //------------------------------------------------------------------------------- - -bool SEInhaler::Load(const CDM::InhalerData& in) -{ - Clear(); - if (in.State().present()) - SetState(in.State().get()); - if (in.MeteredDose().present()) - GetMeteredDose().Load(in.MeteredDose().get()); - if (in.NozzleLoss().present()) - GetNozzleLoss().Load(in.NozzleLoss().get()); - if (in.SpacerVolume().present()) - GetSpacerVolume().Load(in.SpacerVolume().get()); - if (in.Substance().present()) - SetSubstance(m_Substances.GetSubstance(in.Substance().get())); - StateChange(); - return true; -} -//------------------------------------------------------------------------------- - -CDM::InhalerData* SEInhaler::Unload() const -{ - CDM::InhalerData* data = new CDM::InhalerData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- - -void SEInhaler::Unload(CDM::InhalerData& data) const -{ - if (HasState()) - data.State(m_State); - if (HasMeteredDose()) - data.MeteredDose(std::unique_ptr(m_MeteredDose->Unload())); - if (HasNozzleLoss()) - data.NozzleLoss(std::unique_ptr(m_NozzleLoss->Unload())); - if (HasSpacerVolume()) - data.SpacerVolume(std::unique_ptr(m_SpacerVolume->Unload())); - if (HasSubstance()) - data.Substance(m_Substance->GetName()); -} -//------------------------------------------------------------------------------- const SEScalar* SEInhaler::GetScalar(const char* name) { return GetScalar(std::string { name }); @@ -164,28 +127,30 @@ bool SEInhaler::Load(const std::string& file) Error(ss); return false; } - return Load(*pData); + + io::Inhaler::UnMarshall(*pData, *this); + return true; } //------------------------------------------------------------------------------- -CDM::enumOnOff::value SEInhaler::GetState() const +SEOnOff SEInhaler::GetState() const { return m_State; } //------------------------------------------------------------------------------- -void SEInhaler::SetState(CDM::enumOnOff::value state) +void SEInhaler::SetState(SEOnOff state) { m_State = state; } //------------------------------------------------------------------------------- bool SEInhaler::HasState() const { - return m_State == ((CDM::enumOnOff::value)-1) ? false : true; + return m_State == (SEOnOff::Invalid) ? false : true; } //------------------------------------------------------------------------------- void SEInhaler::InvalidateState() { - m_State = (CDM::enumOnOff::value)-1; + m_State = SEOnOff::Invalid; } //------------------------------------------------------------------------------- diff --git a/projects/biogears/libBiogears/src/cdm/system/equipment/Inhaler/actions/SEInhalerAction.cpp b/projects/biogears/libBiogears/src/cdm/system/equipment/Inhaler/actions/SEInhalerAction.cpp index 4456c4d73..0549e9755 100644 --- a/projects/biogears/libBiogears/src/cdm/system/equipment/Inhaler/actions/SEInhalerAction.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/equipment/Inhaler/actions/SEInhalerAction.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Inhaler.h" +#include "io/cdm/InhalerActions.h" + namespace biogears { SEInhalerAction::SEInhalerAction() : SEAction() @@ -19,34 +22,16 @@ SEInhalerAction::SEInhalerAction() SEInhalerAction::~SEInhalerAction() { - Clear(); + Invalidate(); } -void SEInhalerAction::Clear() +void SEInhalerAction::Invalidate() { - SEAction::Clear(); + SEAction::Invalidate(); } bool SEInhalerAction::IsValid() const { return SEAction::IsValid(); } - -bool SEInhalerAction::Load(const CDM::InhalerActionData& in) -{ - SEAction::Load(in); - return true; -} - -CDM::InhalerActionData* SEInhalerAction::Unload() const -{ - CDM::InhalerActionData* data = new CDM::InhalerActionData(); - Unload(*data); - return data; -} - -void SEInhalerAction::Unload(CDM::InhalerActionData& data) const -{ - SEAction::Unload(data); -} } \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/cdm/system/equipment/Inhaler/actions/SEInhalerConfiguration.cpp b/projects/biogears/libBiogears/src/cdm/system/equipment/Inhaler/actions/SEInhalerConfiguration.cpp index 1cf92a1a8..f1ca27438 100644 --- a/projects/biogears/libBiogears/src/cdm/system/equipment/Inhaler/actions/SEInhalerConfiguration.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/equipment/Inhaler/actions/SEInhalerConfiguration.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Inhaler.h" +#include "io/cdm/InhalerActions.h" + #include #include #include @@ -29,12 +32,12 @@ SEInhalerConfiguration::SEInhalerConfiguration(SESubstanceManager& substances) //----------------------------------------------------------------------------- SEInhalerConfiguration::~SEInhalerConfiguration() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SEInhalerConfiguration::Clear() +void SEInhalerConfiguration::Invalidate() { - SEInhalerAction::Clear(); + SEInhalerAction::Invalidate(); InvalidateConfigurationFile(); SAFE_DELETE(m_Configuration); } @@ -44,32 +47,6 @@ bool SEInhalerConfiguration::IsValid() const return SEInhalerAction::IsValid() && (HasConfiguration() || HasConfigurationFile()); } //----------------------------------------------------------------------------- -bool SEInhalerConfiguration::Load(const CDM::InhalerConfigurationData& in, std::default_random_engine *rd) -{ - SEInhalerAction::Load(in); - if (in.ConfigurationFile().present()) - SetConfigurationFile(in.ConfigurationFile().get()); - if (in.Configuration().present()) - GetConfiguration().Load(in.Configuration().get()); - return true; -} -//----------------------------------------------------------------------------- -CDM::InhalerConfigurationData* SEInhalerConfiguration::Unload() const -{ - CDM::InhalerConfigurationData* data = new CDM::InhalerConfigurationData(); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SEInhalerConfiguration::Unload(CDM::InhalerConfigurationData& data) const -{ - SEInhalerAction::Unload(data); - if (HasConfiguration()) - data.Configuration(std::unique_ptr(m_Configuration->Unload())); - else if (HasConfigurationFile()) - data.ConfigurationFile(m_ConfigurationFile); -} -//----------------------------------------------------------------------------- bool SEInhalerConfiguration::HasConfiguration() const { return m_Configuration != nullptr; @@ -100,7 +77,7 @@ std::string SEInhalerConfiguration::GetConfigurationFile() const //----------------------------------------------------------------------------- void SEInhalerConfiguration::SetConfigurationFile(const char* fileName) { - SetConfigurationFile(std::string{ fileName }); + SetConfigurationFile(std::string { fileName }); } //----------------------------------------------------------------------------- void SEInhalerConfiguration::SetConfigurationFile(const std::string& fileName) @@ -154,7 +131,6 @@ bool SEInhalerConfiguration::operator==(SEInhalerConfiguration const& rhs) const ? m_Configuration->operator==(*rhs.m_Configuration) : m_Configuration == rhs.m_Configuration) && m_Substances == rhs.m_Substances; - } //----------------------------------------------------------------------------- bool SEInhalerConfiguration::operator!=(SEInhalerConfiguration const& rhs) const diff --git a/projects/biogears/libBiogears/src/cdm/system/physiology/SEBloodChemistrySystem.cpp b/projects/biogears/libBiogears/src/cdm/system/physiology/SEBloodChemistrySystem.cpp index f77e92d98..3326a2dfc 100644 --- a/projects/biogears/libBiogears/src/cdm/system/physiology/SEBloodChemistrySystem.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/physiology/SEBloodChemistrySystem.cpp @@ -11,6 +11,11 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Physiology.h" +#include "io/cdm/Property.h" +#include "io/cdm/Substance.h" + +#include #include #include #include @@ -121,13 +126,13 @@ SEBloodChemistrySystem::SEBloodChemistrySystem(Logger* logger) SEBloodChemistrySystem::~SEBloodChemistrySystem() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEBloodChemistrySystem::Clear() +void SEBloodChemistrySystem::Invalidate() { - SESystem::Clear(); + SESystem::Invalidate(); SAFE_DELETE(m_ArterialBloodPH); SAFE_DELETE(m_ArterialBloodPHBaseline); @@ -301,257 +306,7 @@ const SEScalar* SEBloodChemistrySystem::GetScalar(const std::string& name) return nullptr; } -//------------------------------------------------------------------------------- - -bool SEBloodChemistrySystem::Load(const CDM::BloodChemistrySystemData& in) -{ - SESystem::Load(in); - - if (in.ArterialBloodPH().present()) { - GetArterialBloodPH().Load(in.ArterialBloodPH().get()); - } - if (in.ArterialBloodPHBaseline().present()) { - GetArterialBloodPHBaseline().Load(in.ArterialBloodPHBaseline().get()); - } - if (in.BloodDensity().present()) { - GetBloodDensity().Load(in.BloodDensity().get()); - } - if (in.BloodSpecificHeat().present()) { - GetBloodSpecificHeat().Load(in.BloodSpecificHeat().get()); - } - if (in.BloodUreaNitrogenConcentration().present()) { - GetBloodUreaNitrogenConcentration().Load(in.BloodUreaNitrogenConcentration().get()); - } - if (in.CarbonDioxideSaturation().present()) { - GetCarbonDioxideSaturation().Load(in.CarbonDioxideSaturation().get()); - } - if (in.CarbonMonoxideSaturation().present()) { - GetCarbonMonoxideSaturation().Load(in.CarbonMonoxideSaturation().get()); - } - if (in.Hematocrit().present()) { - GetHematocrit().Load(in.Hematocrit().get()); - } - if (in.HemoglobinContent().present()) { - GetHemoglobinContent().Load(in.HemoglobinContent().get()); - } - if (in.HemoglobinLostToUrine().present()) { - GetHemoglobinLostToUrine().Load(in.HemoglobinLostToUrine().get()); - } - if (in.LymphocyteCellCount().present()) { - GetLymphocyteCellCount().Load(in.LymphocyteCellCount().get()); - } - if (in.NeutrophilCellCount().present()) { - GetNeutrophilCellCount().Load(in.NeutrophilCellCount().get()); - } - if (in.OxygenSaturation().present()) { - GetOxygenSaturation().Load(in.OxygenSaturation().get()); - } - if (in.OxygenVenousSaturation().present()) { - GetOxygenVenousSaturation().Load(in.OxygenVenousSaturation().get()); - } - if (in.Phosphate().present()) { - GetPhosphate().Load(in.Phosphate().get()); - } - if (in.PlasmaVolume().present()) { - GetPlasmaVolume().Load(in.PlasmaVolume().get()); - } - if (in.PulseOximetry().present()) { - GetPulseOximetry().Load(in.PulseOximetry().get()); - } - if (in.RedBloodCellAcetylcholinesterase().present()) { - GetRedBloodCellAcetylcholinesterase().Load(in.RedBloodCellAcetylcholinesterase().get()); - } - if (in.RedBloodCellCount().present()) { - GetRedBloodCellCount().Load(in.RedBloodCellCount().get()); - } - if (in.RhTransfusionReactionVolume().present()) { - GetRhTransfusionReactionVolume().Load(in.RhTransfusionReactionVolume().get()); - } - if (in.ShuntFraction().present()) { - GetShuntFraction().Load(in.ShuntFraction().get()); - } - if (in.StrongIonDifference().present()) { - GetStrongIonDifference().Load(in.StrongIonDifference().get()); - } - if (in.TotalBilirubin().present()) { - GetTotalBilirubin().Load(in.TotalBilirubin().get()); - } - if (in.TotalProteinConcentration().present()) { - GetTotalProteinConcentration().Load(in.TotalProteinConcentration().get()); - } - if (in.VenousBloodPH().present()) { - GetVenousBloodPH().Load(in.VenousBloodPH().get()); - } - if (in.VolumeFractionNeutralPhospholipidInPlasma().present()) { - GetVolumeFractionNeutralPhospholipidInPlasma().Load(in.VolumeFractionNeutralPhospholipidInPlasma().get()); - } - if (in.VolumeFractionNeutralLipidInPlasma().present()) { - GetVolumeFractionNeutralLipidInPlasma().Load(in.VolumeFractionNeutralLipidInPlasma().get()); - } - if (in.WhiteBloodCellCount().present()) { - GetWhiteBloodCellCount().Load(in.WhiteBloodCellCount().get()); - } - if (in.ArterialCarbonDioxidePressure().present()) { - GetArterialCarbonDioxidePressure().Load(in.ArterialCarbonDioxidePressure().get()); - } - if (in.ArterialOxygenPressure().present()) { - GetArterialOxygenPressure().Load(in.ArterialOxygenPressure().get()); - } - if (in.PulmonaryArterialCarbonDioxidePressure().present()) { - GetPulmonaryArterialCarbonDioxidePressure().Load(in.PulmonaryArterialCarbonDioxidePressure().get()); - } - if (in.PulmonaryArterialOxygenPressure().present()) { - GetPulmonaryArterialOxygenPressure().Load(in.PulmonaryArterialOxygenPressure().get()); - } - if (in.PulmonaryVenousOxygenPressure().present()) { - GetPulmonaryVenousOxygenPressure().Load(in.PulmonaryVenousOxygenPressure().get()); - } - if (in.PulmonaryVenousCarbonDioxidePressure().present()) { - GetPulmonaryVenousCarbonDioxidePressure().Load(in.PulmonaryVenousCarbonDioxidePressure().get()); - } - if (in.VenousCarbonDioxidePressure().present()) { - GetVenousCarbonDioxidePressure().Load(in.VenousCarbonDioxidePressure().get()); - } - if (in.VenousOxygenPressure().present()) { - GetVenousOxygenPressure().Load(in.VenousOxygenPressure().get()); - } - if (in.ViralLoad().present()) { - GetViralLoad().Load(in.ViralLoad().get()); - } - if (in.InflammatoryResponse().present()) { - GetInflammatoryResponse().Load(in.InflammatoryResponse().get()); - } - return true; -} -//------------------------------------------------------------------------------- - -CDM::BloodChemistrySystemData* SEBloodChemistrySystem::Unload() const -{ - CDM::BloodChemistrySystemData* data = new CDM::BloodChemistrySystemData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- - -void SEBloodChemistrySystem::Unload(CDM::BloodChemistrySystemData& data) const -{ - SESystem::Unload(data); - if (m_ArterialBloodPH != nullptr) { - data.ArterialBloodPH(std::unique_ptr(m_ArterialBloodPH->Unload())); - } - if (m_ArterialBloodPHBaseline != nullptr) { - data.ArterialBloodPHBaseline(std::unique_ptr(m_ArterialBloodPHBaseline->Unload())); - } - if (m_BloodDensity != nullptr) { - data.BloodDensity(std::unique_ptr(m_BloodDensity->Unload())); - } - if (m_BloodSpecificHeat != nullptr) { - data.BloodSpecificHeat(std::unique_ptr(m_BloodSpecificHeat->Unload())); - } - if (m_BloodUreaNitrogenConcentration != nullptr) { - data.BloodUreaNitrogenConcentration(std::unique_ptr(m_BloodUreaNitrogenConcentration->Unload())); - } - if (m_CarbonDioxideSaturation != nullptr) { - data.CarbonDioxideSaturation(std::unique_ptr(m_CarbonDioxideSaturation->Unload())); - } - if (m_CarbonMonoxideSaturation != nullptr) { - data.CarbonMonoxideSaturation(std::unique_ptr(m_CarbonMonoxideSaturation->Unload())); - } - if (m_Hematocrit != nullptr) { - data.Hematocrit(std::unique_ptr(m_Hematocrit->Unload())); - } - if (m_HemoglobinContent != nullptr) { - data.HemoglobinContent(std::unique_ptr(m_HemoglobinContent->Unload())); - } - if (m_HemoglobinLostToUrine != nullptr) { - data.HemoglobinLostToUrine(std::unique_ptr(m_HemoglobinLostToUrine->Unload())); - } - if (m_LymphocyteCellCount != nullptr) { - data.LymphocyteCellCount(std::unique_ptr(m_LymphocyteCellCount->Unload())); - } - if (m_NeutrophilCellCount != nullptr) { - data.NeutrophilCellCount(std::unique_ptr(m_NeutrophilCellCount->Unload())); - } - if (m_OxygenSaturation != nullptr) { - data.OxygenSaturation(std::unique_ptr(m_OxygenSaturation->Unload())); - } - if (m_OxygenVenousSaturation != nullptr) { - data.OxygenVenousSaturation(std::unique_ptr(m_OxygenVenousSaturation->Unload())); - } - if (m_Phosphate != nullptr) { - data.Phosphate(std::unique_ptr(m_Phosphate->Unload())); - } - if (m_PlasmaVolume != nullptr) { - data.PlasmaVolume(std::unique_ptr(m_PlasmaVolume->Unload())); - } - if (m_PulseOximetry != nullptr) { - data.PulseOximetry(std::unique_ptr(m_PulseOximetry->Unload())); - } - if (m_RedBloodCellAcetylcholinesterase != nullptr) { - data.RedBloodCellAcetylcholinesterase(std::unique_ptr(m_RedBloodCellAcetylcholinesterase->Unload())); - } - if (m_RedBloodCellCount != nullptr) { - data.RedBloodCellCount(std::unique_ptr(m_RedBloodCellCount->Unload())); - } - if (m_RhTransfusionReactionVolume != nullptr) { - data.RhTransfusionReactionVolume(std::unique_ptr(m_RhTransfusionReactionVolume->Unload())); - } - if (m_ShuntFraction != nullptr) { - data.ShuntFraction(std::unique_ptr(m_ShuntFraction->Unload())); - } - if (m_StrongIonDifference != nullptr) { - data.StrongIonDifference(std::unique_ptr(m_StrongIonDifference->Unload())); - } - if (m_TotalBilirubin != nullptr) { - data.TotalBilirubin(std::unique_ptr(m_TotalBilirubin->Unload())); - } - if (m_TotalProteinConcentration != nullptr) { - data.TotalProteinConcentration(std::unique_ptr(m_TotalProteinConcentration->Unload())); - } - if (m_VolumeFractionNeutralPhospholipidInPlasma != nullptr) { - data.VolumeFractionNeutralPhospholipidInPlasma(std::unique_ptr(m_VolumeFractionNeutralPhospholipidInPlasma->Unload())); - } - if (m_VolumeFractionNeutralLipidInPlasma != nullptr) { - data.VolumeFractionNeutralLipidInPlasma(std::unique_ptr(m_VolumeFractionNeutralLipidInPlasma->Unload())); - } - if (m_WhiteBloodCellCount != nullptr) { - data.WhiteBloodCellCount(std::unique_ptr(m_WhiteBloodCellCount->Unload())); - } - if (m_ArterialCarbonDioxidePressure != nullptr) { - data.ArterialCarbonDioxidePressure(std::unique_ptr(m_ArterialCarbonDioxidePressure->Unload())); - } - if (m_ArterialOxygenPressure != nullptr) { - data.ArterialOxygenPressure(std::unique_ptr(m_ArterialOxygenPressure->Unload())); - } - if (m_PulmonaryArterialCarbonDioxidePressure != nullptr) { - data.PulmonaryArterialCarbonDioxidePressure(std::unique_ptr(m_PulmonaryArterialCarbonDioxidePressure->Unload())); - } - if (m_PulmonaryArterialOxygenPressure != nullptr) { - data.PulmonaryArterialOxygenPressure(std::unique_ptr(m_PulmonaryArterialOxygenPressure->Unload())); - } - if (m_PulmonaryVenousCarbonDioxidePressure != nullptr) { - data.PulmonaryVenousCarbonDioxidePressure(std::unique_ptr(m_PulmonaryVenousCarbonDioxidePressure->Unload())); - } - if (m_PulmonaryVenousOxygenPressure != nullptr) { - data.PulmonaryVenousOxygenPressure(std::unique_ptr(m_PulmonaryVenousOxygenPressure->Unload())); - } - if (m_VenousCarbonDioxidePressure != nullptr) { - data.VenousCarbonDioxidePressure(std::unique_ptr(m_VenousCarbonDioxidePressure->Unload())); - } - if (m_VenousBloodPH != nullptr) { - data.VenousBloodPH(std::unique_ptr(m_VenousBloodPH->Unload())); - } - if (m_VenousOxygenPressure != nullptr) { - data.VenousOxygenPressure(std::unique_ptr(m_VenousOxygenPressure->Unload())); - } - if (m_ViralLoad != nullptr) { - data.ViralLoad(std::unique_ptr(m_ViralLoad->Unload())); - } - if (m_InflammatoryResponse != nullptr) { - data.InflammatoryResponse(std::unique_ptr(m_InflammatoryResponse->Unload())); - } -} //------------------------------------------------------------------------------- bool SEBloodChemistrySystem::HasBloodDensity() const @@ -1426,45 +1181,45 @@ bool SEBloodChemistrySystem::operator==(SEBloodChemistrySystem const& rhs) const if (this == &rhs) return true; - bool equivilant = ((m_InflammatoryResponse && rhs.m_InflammatoryResponse) ? m_InflammatoryResponse->operator==(*rhs.m_InflammatoryResponse) : m_InflammatoryResponse == rhs.m_InflammatoryResponse) - ;equivilant &= ((m_ArterialBloodPH && rhs.m_ArterialBloodPH) ? m_ArterialBloodPH->operator==(*rhs.m_ArterialBloodPH) : m_ArterialBloodPH == rhs.m_ArterialBloodPH) - ;equivilant &= ((m_ArterialBloodPHBaseline && rhs.m_ArterialBloodPHBaseline) ? m_ArterialBloodPHBaseline->operator==(*rhs.m_ArterialBloodPHBaseline) : m_ArterialBloodPHBaseline == rhs.m_ArterialBloodPHBaseline) - ;equivilant &= ((m_VenousBloodPH && rhs.m_VenousBloodPH) ? m_VenousBloodPH->operator==(*rhs.m_VenousBloodPH) : m_VenousBloodPH == rhs.m_VenousBloodPH) - ;equivilant &= ((m_LymphocyteCellCount && rhs.m_LymphocyteCellCount) ? m_LymphocyteCellCount->operator==(*rhs.m_LymphocyteCellCount) : m_LymphocyteCellCount == rhs.m_LymphocyteCellCount) - ;equivilant &= ((m_NeutrophilCellCount && rhs.m_NeutrophilCellCount) ? m_NeutrophilCellCount->operator==(*rhs.m_NeutrophilCellCount) : m_NeutrophilCellCount == rhs.m_NeutrophilCellCount) - ;equivilant &= ((m_Phosphate && rhs.m_Phosphate) ? m_Phosphate->operator==(*rhs.m_Phosphate) : m_Phosphate == rhs.m_Phosphate) - ;equivilant &= ((m_RedBloodCellAcetylcholinesterase && rhs.m_RedBloodCellAcetylcholinesterase) ? m_RedBloodCellAcetylcholinesterase->operator==(*rhs.m_RedBloodCellAcetylcholinesterase) : m_RedBloodCellAcetylcholinesterase == rhs.m_RedBloodCellAcetylcholinesterase) - ;equivilant &= ((m_RedBloodCellCount && rhs.m_RedBloodCellCount) ? m_RedBloodCellCount->operator==(*rhs.m_RedBloodCellCount) : m_RedBloodCellCount == rhs.m_RedBloodCellCount) - ;equivilant &= ((m_StrongIonDifference && rhs.m_StrongIonDifference) ? m_StrongIonDifference->operator==(*rhs.m_StrongIonDifference) : m_StrongIonDifference == rhs.m_StrongIonDifference) - ;equivilant &= ((m_ViralLoad && rhs.m_ViralLoad) ? m_ViralLoad->operator==(*rhs.m_ViralLoad) : m_ViralLoad == rhs.m_ViralLoad) - ;equivilant &= ((m_WhiteBloodCellCount && rhs.m_WhiteBloodCellCount) ? m_WhiteBloodCellCount->operator==(*rhs.m_WhiteBloodCellCount) : m_WhiteBloodCellCount == rhs.m_WhiteBloodCellCount) - ;equivilant &= ((m_CarbonDioxideSaturation && rhs.m_CarbonDioxideSaturation) ? m_CarbonDioxideSaturation->operator==(*rhs.m_CarbonDioxideSaturation) : m_CarbonDioxideSaturation == rhs.m_CarbonDioxideSaturation) - ;equivilant &= ((m_CarbonMonoxideSaturation && rhs.m_CarbonMonoxideSaturation) ? m_CarbonMonoxideSaturation->operator==(*rhs.m_CarbonMonoxideSaturation) : m_CarbonMonoxideSaturation == rhs.m_CarbonMonoxideSaturation) - ;equivilant &= ((m_Hematocrit && rhs.m_Hematocrit) ? m_Hematocrit->operator==(*rhs.m_Hematocrit) : m_Hematocrit == rhs.m_Hematocrit) - ;equivilant &= ((m_OxygenSaturation && rhs.m_OxygenSaturation) ? m_OxygenSaturation->operator==(*rhs.m_OxygenSaturation) : m_OxygenSaturation == rhs.m_OxygenSaturation) - ;equivilant &= ((m_OxygenVenousSaturation && rhs.m_OxygenVenousSaturation) ? m_OxygenVenousSaturation->operator==(*rhs.m_OxygenVenousSaturation) : m_OxygenVenousSaturation == rhs.m_OxygenVenousSaturation) - ;equivilant &= ((m_PulseOximetry && rhs.m_PulseOximetry) ? m_PulseOximetry->operator==(*rhs.m_PulseOximetry) : m_PulseOximetry == rhs.m_PulseOximetry) - ;equivilant &= ((m_ShuntFraction && rhs.m_ShuntFraction) ? m_ShuntFraction->operator==(*rhs.m_ShuntFraction) : m_ShuntFraction == rhs.m_ShuntFraction) - ;equivilant &= ((m_VolumeFractionNeutralLipidInPlasma && rhs.m_VolumeFractionNeutralLipidInPlasma) ? m_VolumeFractionNeutralLipidInPlasma->operator==(*rhs.m_VolumeFractionNeutralLipidInPlasma) : m_VolumeFractionNeutralLipidInPlasma == rhs.m_VolumeFractionNeutralLipidInPlasma) - ;equivilant &= ((m_VolumeFractionNeutralPhospholipidInPlasma && rhs.m_VolumeFractionNeutralPhospholipidInPlasma) ? m_VolumeFractionNeutralPhospholipidInPlasma->operator==(*rhs.m_VolumeFractionNeutralPhospholipidInPlasma) : m_VolumeFractionNeutralPhospholipidInPlasma == rhs.m_VolumeFractionNeutralPhospholipidInPlasma) - ;equivilant &= ((m_BloodSpecificHeat && rhs.m_BloodSpecificHeat) ? m_BloodSpecificHeat->operator==(*rhs.m_BloodSpecificHeat) : m_BloodSpecificHeat == rhs.m_BloodSpecificHeat) - ;equivilant &= ((m_HemoglobinContent && rhs.m_HemoglobinContent) ? m_HemoglobinContent->operator==(*rhs.m_HemoglobinContent) : m_HemoglobinContent == rhs.m_HemoglobinContent) - ;equivilant &= ((m_HemoglobinLostToUrine && rhs.m_HemoglobinLostToUrine) ? m_HemoglobinLostToUrine->operator==(*rhs.m_HemoglobinLostToUrine) : m_HemoglobinLostToUrine == rhs.m_HemoglobinLostToUrine) - ;equivilant &= ((m_BloodDensity && rhs.m_BloodDensity) ? m_BloodDensity->operator==(*rhs.m_BloodDensity) : m_BloodDensity == rhs.m_BloodDensity) - ;equivilant &= ((m_BloodUreaNitrogenConcentration && rhs.m_BloodUreaNitrogenConcentration) ? m_BloodUreaNitrogenConcentration->operator==(*rhs.m_BloodUreaNitrogenConcentration) : m_BloodUreaNitrogenConcentration == rhs.m_BloodUreaNitrogenConcentration) - ;equivilant &= ((m_TotalBilirubin && rhs.m_TotalBilirubin) ? m_TotalBilirubin->operator==(*rhs.m_TotalBilirubin) : m_TotalBilirubin == rhs.m_TotalBilirubin) - ;equivilant &= ((m_TotalProteinConcentration && rhs.m_TotalProteinConcentration) ? m_TotalProteinConcentration->operator==(*rhs.m_TotalProteinConcentration) : m_TotalProteinConcentration == rhs.m_TotalProteinConcentration) - ;equivilant &= ((m_ArterialCarbonDioxidePressure && rhs.m_ArterialCarbonDioxidePressure) ? m_ArterialCarbonDioxidePressure->operator==(*rhs.m_ArterialCarbonDioxidePressure) : m_ArterialCarbonDioxidePressure == rhs.m_ArterialCarbonDioxidePressure) - ;equivilant &= ((m_ArterialOxygenPressure && rhs.m_ArterialOxygenPressure) ? m_ArterialOxygenPressure->operator==(*rhs.m_ArterialOxygenPressure) : m_ArterialOxygenPressure == rhs.m_ArterialOxygenPressure) - ;equivilant &= ((m_PulmonaryArterialCarbonDioxidePressure && rhs.m_PulmonaryArterialCarbonDioxidePressure) ? m_PulmonaryArterialCarbonDioxidePressure->operator==(*rhs.m_PulmonaryArterialCarbonDioxidePressure) : m_PulmonaryArterialCarbonDioxidePressure == rhs.m_PulmonaryArterialCarbonDioxidePressure) - ;equivilant &= ((m_PulmonaryArterialOxygenPressure && rhs.m_PulmonaryArterialOxygenPressure) ? m_PulmonaryArterialOxygenPressure->operator==(*rhs.m_PulmonaryArterialOxygenPressure) : m_PulmonaryArterialOxygenPressure == rhs.m_PulmonaryArterialOxygenPressure) - ;equivilant &= ((m_PulmonaryVenousCarbonDioxidePressure && rhs.m_PulmonaryVenousCarbonDioxidePressure) ? m_PulmonaryVenousCarbonDioxidePressure->operator==(*rhs.m_PulmonaryVenousCarbonDioxidePressure) : m_PulmonaryVenousCarbonDioxidePressure == rhs.m_PulmonaryVenousCarbonDioxidePressure) - ;equivilant &= ((m_PulmonaryVenousOxygenPressure && rhs.m_PulmonaryVenousOxygenPressure) ? m_PulmonaryVenousOxygenPressure->operator==(*rhs.m_PulmonaryVenousOxygenPressure) : m_PulmonaryVenousOxygenPressure == rhs.m_PulmonaryVenousOxygenPressure) - ;equivilant &= ((m_VenousCarbonDioxidePressure && rhs.m_VenousCarbonDioxidePressure) ? m_VenousCarbonDioxidePressure->operator==(*rhs.m_VenousCarbonDioxidePressure) : m_VenousCarbonDioxidePressure == rhs.m_VenousCarbonDioxidePressure) - ;equivilant &= ((m_VenousOxygenPressure && rhs.m_VenousOxygenPressure) ? m_VenousOxygenPressure->operator==(*rhs.m_VenousOxygenPressure) : m_VenousOxygenPressure == rhs.m_VenousOxygenPressure) - ;equivilant &= ((m_PlasmaVolume && rhs.m_PlasmaVolume) ? m_PlasmaVolume->operator==(*rhs.m_PlasmaVolume) : m_PlasmaVolume == rhs.m_PlasmaVolume) - ;equivilant &= ((m_RhTransfusionReactionVolume && rhs.m_RhTransfusionReactionVolume) ? m_RhTransfusionReactionVolume->operator==(*rhs.m_RhTransfusionReactionVolume) : m_RhTransfusionReactionVolume == rhs.m_RhTransfusionReactionVolume); - ; + bool equivilant = ((m_InflammatoryResponse && rhs.m_InflammatoryResponse) ? m_InflammatoryResponse->operator==(*rhs.m_InflammatoryResponse) : m_InflammatoryResponse == rhs.m_InflammatoryResponse); + equivilant &= ((m_ArterialBloodPH && rhs.m_ArterialBloodPH) ? m_ArterialBloodPH->operator==(*rhs.m_ArterialBloodPH) : m_ArterialBloodPH == rhs.m_ArterialBloodPH); + equivilant &= ((m_ArterialBloodPHBaseline && rhs.m_ArterialBloodPHBaseline) ? m_ArterialBloodPHBaseline->operator==(*rhs.m_ArterialBloodPHBaseline) : m_ArterialBloodPHBaseline == rhs.m_ArterialBloodPHBaseline); + equivilant &= ((m_VenousBloodPH && rhs.m_VenousBloodPH) ? m_VenousBloodPH->operator==(*rhs.m_VenousBloodPH) : m_VenousBloodPH == rhs.m_VenousBloodPH); + equivilant &= ((m_LymphocyteCellCount && rhs.m_LymphocyteCellCount) ? m_LymphocyteCellCount->operator==(*rhs.m_LymphocyteCellCount) : m_LymphocyteCellCount == rhs.m_LymphocyteCellCount); + equivilant &= ((m_NeutrophilCellCount && rhs.m_NeutrophilCellCount) ? m_NeutrophilCellCount->operator==(*rhs.m_NeutrophilCellCount) : m_NeutrophilCellCount == rhs.m_NeutrophilCellCount); + equivilant &= ((m_Phosphate && rhs.m_Phosphate) ? m_Phosphate->operator==(*rhs.m_Phosphate) : m_Phosphate == rhs.m_Phosphate); + equivilant &= ((m_RedBloodCellAcetylcholinesterase && rhs.m_RedBloodCellAcetylcholinesterase) ? m_RedBloodCellAcetylcholinesterase->operator==(*rhs.m_RedBloodCellAcetylcholinesterase) : m_RedBloodCellAcetylcholinesterase == rhs.m_RedBloodCellAcetylcholinesterase); + equivilant &= ((m_RedBloodCellCount && rhs.m_RedBloodCellCount) ? m_RedBloodCellCount->operator==(*rhs.m_RedBloodCellCount) : m_RedBloodCellCount == rhs.m_RedBloodCellCount); + equivilant &= ((m_StrongIonDifference && rhs.m_StrongIonDifference) ? m_StrongIonDifference->operator==(*rhs.m_StrongIonDifference) : m_StrongIonDifference == rhs.m_StrongIonDifference); + equivilant &= ((m_ViralLoad && rhs.m_ViralLoad) ? m_ViralLoad->operator==(*rhs.m_ViralLoad) : m_ViralLoad == rhs.m_ViralLoad); + equivilant &= ((m_WhiteBloodCellCount && rhs.m_WhiteBloodCellCount) ? m_WhiteBloodCellCount->operator==(*rhs.m_WhiteBloodCellCount) : m_WhiteBloodCellCount == rhs.m_WhiteBloodCellCount); + equivilant &= ((m_CarbonDioxideSaturation && rhs.m_CarbonDioxideSaturation) ? m_CarbonDioxideSaturation->operator==(*rhs.m_CarbonDioxideSaturation) : m_CarbonDioxideSaturation == rhs.m_CarbonDioxideSaturation); + equivilant &= ((m_CarbonMonoxideSaturation && rhs.m_CarbonMonoxideSaturation) ? m_CarbonMonoxideSaturation->operator==(*rhs.m_CarbonMonoxideSaturation) : m_CarbonMonoxideSaturation == rhs.m_CarbonMonoxideSaturation); + equivilant &= ((m_Hematocrit && rhs.m_Hematocrit) ? m_Hematocrit->operator==(*rhs.m_Hematocrit) : m_Hematocrit == rhs.m_Hematocrit); + equivilant &= ((m_OxygenSaturation && rhs.m_OxygenSaturation) ? m_OxygenSaturation->operator==(*rhs.m_OxygenSaturation) : m_OxygenSaturation == rhs.m_OxygenSaturation); + equivilant &= ((m_OxygenVenousSaturation && rhs.m_OxygenVenousSaturation) ? m_OxygenVenousSaturation->operator==(*rhs.m_OxygenVenousSaturation) : m_OxygenVenousSaturation == rhs.m_OxygenVenousSaturation); + equivilant &= ((m_PulseOximetry && rhs.m_PulseOximetry) ? m_PulseOximetry->operator==(*rhs.m_PulseOximetry) : m_PulseOximetry == rhs.m_PulseOximetry); + equivilant &= ((m_ShuntFraction && rhs.m_ShuntFraction) ? m_ShuntFraction->operator==(*rhs.m_ShuntFraction) : m_ShuntFraction == rhs.m_ShuntFraction); + equivilant &= ((m_VolumeFractionNeutralLipidInPlasma && rhs.m_VolumeFractionNeutralLipidInPlasma) ? m_VolumeFractionNeutralLipidInPlasma->operator==(*rhs.m_VolumeFractionNeutralLipidInPlasma) : m_VolumeFractionNeutralLipidInPlasma == rhs.m_VolumeFractionNeutralLipidInPlasma); + equivilant &= ((m_VolumeFractionNeutralPhospholipidInPlasma && rhs.m_VolumeFractionNeutralPhospholipidInPlasma) ? m_VolumeFractionNeutralPhospholipidInPlasma->operator==(*rhs.m_VolumeFractionNeutralPhospholipidInPlasma) : m_VolumeFractionNeutralPhospholipidInPlasma == rhs.m_VolumeFractionNeutralPhospholipidInPlasma); + equivilant &= ((m_BloodSpecificHeat && rhs.m_BloodSpecificHeat) ? m_BloodSpecificHeat->operator==(*rhs.m_BloodSpecificHeat) : m_BloodSpecificHeat == rhs.m_BloodSpecificHeat); + equivilant &= ((m_HemoglobinContent && rhs.m_HemoglobinContent) ? m_HemoglobinContent->operator==(*rhs.m_HemoglobinContent) : m_HemoglobinContent == rhs.m_HemoglobinContent); + equivilant &= ((m_HemoglobinLostToUrine && rhs.m_HemoglobinLostToUrine) ? m_HemoglobinLostToUrine->operator==(*rhs.m_HemoglobinLostToUrine) : m_HemoglobinLostToUrine == rhs.m_HemoglobinLostToUrine); + equivilant &= ((m_BloodDensity && rhs.m_BloodDensity) ? m_BloodDensity->operator==(*rhs.m_BloodDensity) : m_BloodDensity == rhs.m_BloodDensity); + equivilant &= ((m_BloodUreaNitrogenConcentration && rhs.m_BloodUreaNitrogenConcentration) ? m_BloodUreaNitrogenConcentration->operator==(*rhs.m_BloodUreaNitrogenConcentration) : m_BloodUreaNitrogenConcentration == rhs.m_BloodUreaNitrogenConcentration); + equivilant &= ((m_TotalBilirubin && rhs.m_TotalBilirubin) ? m_TotalBilirubin->operator==(*rhs.m_TotalBilirubin) : m_TotalBilirubin == rhs.m_TotalBilirubin); + equivilant &= ((m_TotalProteinConcentration && rhs.m_TotalProteinConcentration) ? m_TotalProteinConcentration->operator==(*rhs.m_TotalProteinConcentration) : m_TotalProteinConcentration == rhs.m_TotalProteinConcentration); + equivilant &= ((m_ArterialCarbonDioxidePressure && rhs.m_ArterialCarbonDioxidePressure) ? m_ArterialCarbonDioxidePressure->operator==(*rhs.m_ArterialCarbonDioxidePressure) : m_ArterialCarbonDioxidePressure == rhs.m_ArterialCarbonDioxidePressure); + equivilant &= ((m_ArterialOxygenPressure && rhs.m_ArterialOxygenPressure) ? m_ArterialOxygenPressure->operator==(*rhs.m_ArterialOxygenPressure) : m_ArterialOxygenPressure == rhs.m_ArterialOxygenPressure); + equivilant &= ((m_PulmonaryArterialCarbonDioxidePressure && rhs.m_PulmonaryArterialCarbonDioxidePressure) ? m_PulmonaryArterialCarbonDioxidePressure->operator==(*rhs.m_PulmonaryArterialCarbonDioxidePressure) : m_PulmonaryArterialCarbonDioxidePressure == rhs.m_PulmonaryArterialCarbonDioxidePressure); + equivilant &= ((m_PulmonaryArterialOxygenPressure && rhs.m_PulmonaryArterialOxygenPressure) ? m_PulmonaryArterialOxygenPressure->operator==(*rhs.m_PulmonaryArterialOxygenPressure) : m_PulmonaryArterialOxygenPressure == rhs.m_PulmonaryArterialOxygenPressure); + equivilant &= ((m_PulmonaryVenousCarbonDioxidePressure && rhs.m_PulmonaryVenousCarbonDioxidePressure) ? m_PulmonaryVenousCarbonDioxidePressure->operator==(*rhs.m_PulmonaryVenousCarbonDioxidePressure) : m_PulmonaryVenousCarbonDioxidePressure == rhs.m_PulmonaryVenousCarbonDioxidePressure); + equivilant &= ((m_PulmonaryVenousOxygenPressure && rhs.m_PulmonaryVenousOxygenPressure) ? m_PulmonaryVenousOxygenPressure->operator==(*rhs.m_PulmonaryVenousOxygenPressure) : m_PulmonaryVenousOxygenPressure == rhs.m_PulmonaryVenousOxygenPressure); + equivilant &= ((m_VenousCarbonDioxidePressure && rhs.m_VenousCarbonDioxidePressure) ? m_VenousCarbonDioxidePressure->operator==(*rhs.m_VenousCarbonDioxidePressure) : m_VenousCarbonDioxidePressure == rhs.m_VenousCarbonDioxidePressure); + equivilant &= ((m_VenousOxygenPressure && rhs.m_VenousOxygenPressure) ? m_VenousOxygenPressure->operator==(*rhs.m_VenousOxygenPressure) : m_VenousOxygenPressure == rhs.m_VenousOxygenPressure); + equivilant &= ((m_PlasmaVolume && rhs.m_PlasmaVolume) ? m_PlasmaVolume->operator==(*rhs.m_PlasmaVolume) : m_PlasmaVolume == rhs.m_PlasmaVolume); + equivilant &= ((m_RhTransfusionReactionVolume && rhs.m_RhTransfusionReactionVolume) ? m_RhTransfusionReactionVolume->operator==(*rhs.m_RhTransfusionReactionVolume) : m_RhTransfusionReactionVolume == rhs.m_RhTransfusionReactionVolume); + ; return equivilant; } bool SEBloodChemistrySystem::operator!=(SEBloodChemistrySystem const& rhs) const @@ -1477,7 +1232,7 @@ SEInflammatoryResponse::SEInflammatoryResponse() , m_LocalMacrophage(nullptr) , m_LocalNeutrophil(nullptr) , m_LocalBarrier(nullptr) - , m_ActiveTLR(CDM::enumOnOff::value(-1)) + , m_ActiveTLR(SEOnOff(-1)) , m_AutonomicResponseLevel(nullptr) , m_Catecholamines(nullptr) , m_ConstitutiveNOS(nullptr) @@ -1502,16 +1257,16 @@ SEInflammatoryResponse::SEInflammatoryResponse() //------------------------------------------------------------------------------- SEInflammatoryResponse::~SEInflammatoryResponse() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEInflammatoryResponse::Clear() +void SEInflammatoryResponse::Invalidate() { SAFE_DELETE(m_LocalPathogen); SAFE_DELETE(m_LocalMacrophage); SAFE_DELETE(m_LocalNeutrophil); SAFE_DELETE(m_LocalBarrier); - m_ActiveTLR = CDM::enumOnOff::value(-1); + m_ActiveTLR = SEOnOff(-1); SAFE_DELETE(m_AutonomicResponseLevel); SAFE_DELETE(m_Catecholamines); SAFE_DELETE(m_ConstitutiveNOS); @@ -1534,78 +1289,6 @@ void SEInflammatoryResponse::Clear() m_InflammationSources.clear(); } //------------------------------------------------------------------------------- -bool SEInflammatoryResponse::Load(const CDM::InflammatoryResponseData& in) -{ - GetLocalPathogen().Load(in.LocalPathogen()); - GetLocalMacrophage().Load(in.LocalMacrophage()); - GetLocalNeutrophil().Load(in.LocalNeutrophil()); - GetLocalBarrier().Load(in.LocalBarrier()); - SetActiveTLR(in.ActiveTLR()); - GetAutonomicResponseLevel().Load(in.AutonomicResponseLevel()); - GetCatecholamines().Load(in.Catecholamines()); - GetConstitutiveNOS().Load(in.ConstitutiveNOS()); - GetInducibleNOSPre().Load(in.InducibleNOSPre()); - GetInducibleNOS().Load(in.InducibleNOS()); - GetInflammationTime().Load(in.InflammationTime()); - GetInterleukin6().Load(in.Interleukin6()); - GetInterleukin10().Load(in.Interleukin10()); - GetInterleukin12().Load(in.Interleukin12()); - GetMacrophageResting().Load(in.MacrophageResting()); - GetMacrophageActive().Load(in.MacrophageActive()); - GetNeutrophilResting().Load(in.NeutrophilResting()); - GetNeutrophilActive().Load(in.NeutrophilActive()); - GetNitrate().Load(in.Nitrate()); - GetNitricOxide().Load(in.NitricOxide()); - GetBloodPathogen().Load(in.BloodPathogen()); - GetTissueIntegrity().Load(in.TissueIntegrity()); - GetTrauma().Load(in.Trauma()); - GetTumorNecrosisFactor().Load(in.TumorNecrosisFactor()); - - for (auto src : in.Source()) { - m_InflammationSources.push_back(src); - } - return true; -} -//------------------------------------------------------------------------------- -CDM::InflammatoryResponseData* SEInflammatoryResponse::Unload() const -{ - CDM::InflammatoryResponseData* data = new CDM::InflammatoryResponseData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEInflammatoryResponse::Unload(CDM::InflammatoryResponseData& data) const -{ - data.LocalPathogen(std::unique_ptr(m_LocalPathogen->Unload())); - data.LocalMacrophage(std::unique_ptr(m_LocalMacrophage->Unload())); - data.LocalNeutrophil(std::unique_ptr(m_LocalNeutrophil->Unload())); - data.LocalBarrier(std::unique_ptr(m_LocalBarrier->Unload())); - data.ActiveTLR(m_ActiveTLR); - data.AutonomicResponseLevel(std::unique_ptr(m_AutonomicResponseLevel->Unload())); - data.Catecholamines(std::unique_ptr(m_Catecholamines->Unload())); - data.ConstitutiveNOS(std::unique_ptr(m_ConstitutiveNOS->Unload())); - data.InducibleNOSPre(std::unique_ptr(m_InducibleNOSPre->Unload())); - data.InducibleNOS(std::unique_ptr(m_InducibleNOS->Unload())); - data.InflammationTime(std::unique_ptr(m_InflammationTime->Unload())); - data.Interleukin6(std::unique_ptr(m_Interleukin6->Unload())); - data.Interleukin10(std::unique_ptr(m_Interleukin10->Unload())); - data.Interleukin12(std::unique_ptr(m_Interleukin12->Unload())); - data.MacrophageResting(std::unique_ptr(m_MacrophageResting->Unload())); - data.MacrophageActive(std::unique_ptr(m_MacrophageActive->Unload())); - data.NeutrophilResting(std::unique_ptr(m_NeutrophilResting->Unload())); - data.NeutrophilActive(std::unique_ptr(m_NeutrophilActive->Unload())); - data.Nitrate(std::unique_ptr(m_Nitrate->Unload())); - data.NitricOxide(std::unique_ptr(m_NitricOxide->Unload())); - data.BloodPathogen(std::unique_ptr(m_BloodPathogen->Unload())); - data.TissueIntegrity(std::unique_ptr(m_TissueIntegrity->Unload())); - data.Trauma(std::unique_ptr(m_Trauma->Unload())); - data.TumorNecrosisFactor(std::unique_ptr(m_TumorNecrosisFactor->Unload())); - - for (auto src : m_InflammationSources) { - data.Source().push_back(src); - } -} -//------------------------------------------------------------------------------- void SEInflammatoryResponse::Initialize() { // Values from Chow2005Acute @@ -1613,7 +1296,7 @@ void SEInflammatoryResponse::Initialize() GetLocalMacrophage().SetValue(10.0); GetLocalNeutrophil().SetValue(0.0); GetLocalBarrier().SetValue(1.0); - SetActiveTLR(CDM::enumOnOff::Off); + SetActiveTLR(SEOnOff::Off); GetAutonomicResponseLevel().SetValue(0.0); GetBloodPathogen().SetValue(0.0); GetTrauma().SetValue(0.0); @@ -2243,14 +1926,14 @@ bool SEInflammatoryResponse::HasInflammationSources() const return !m_InflammationSources.empty(); } //------------------------------------------------------------------------------- -std::vector& SEInflammatoryResponse::GetInflammationSources() +std::vector& SEInflammatoryResponse::GetInflammationSources() { return m_InflammationSources; } //-------------------------------------------------------------------------------- -bool SEInflammatoryResponse::HasInflammationSource(CDM::enumInflammationSource::value src) +bool SEInflammatoryResponse::HasInflammationSource(SEInflammationSource src) { - std::vector::iterator srcLoc; + std::vector::iterator srcLoc; srcLoc = std::find(m_InflammationSources.begin(), m_InflammationSources.end(), src); return srcLoc == m_InflammationSources.end() ? false : true; } @@ -2289,31 +1972,31 @@ bool SEInflammatoryResponse::operator==(SEInflammatoryResponse const& rhs) const if (this == &rhs) return true; - bool equivilant = m_ActiveTLR == rhs.m_ActiveTLR - ;equivilant &= ((m_AutonomicResponseLevel && rhs.m_AutonomicResponseLevel) ? m_AutonomicResponseLevel->operator==(*rhs.m_AutonomicResponseLevel) : m_AutonomicResponseLevel == rhs.m_AutonomicResponseLevel) - ;equivilant &= ((m_BloodPathogen && rhs.m_BloodPathogen) ? m_BloodPathogen->operator==(*rhs.m_BloodPathogen) : m_BloodPathogen == rhs.m_BloodPathogen) - ;equivilant &= ((m_Catecholamines && rhs.m_Catecholamines) ? m_Catecholamines->operator==(*rhs.m_Catecholamines) : m_Catecholamines == rhs.m_Catecholamines) - ;equivilant &= ((m_ConstitutiveNOS && rhs.m_ConstitutiveNOS) ? m_ConstitutiveNOS->operator==(*rhs.m_ConstitutiveNOS) : m_ConstitutiveNOS == rhs.m_ConstitutiveNOS) - ;equivilant &= ((m_InducibleNOS && rhs.m_InducibleNOS) ? m_InducibleNOS->operator==(*rhs.m_InducibleNOS) : m_InducibleNOS == rhs.m_InducibleNOS) - ;equivilant &= ((m_InducibleNOSPre && rhs.m_InducibleNOSPre) ? m_InducibleNOSPre->operator==(*rhs.m_InducibleNOSPre) : m_InducibleNOSPre == rhs.m_InducibleNOSPre) - ;equivilant &= ((m_Interleukin10 && rhs.m_Interleukin10) ? m_Interleukin10->operator==(*rhs.m_Interleukin10) : m_Interleukin10 == rhs.m_Interleukin10) - ;equivilant &= ((m_Interleukin12 && rhs.m_Interleukin12) ? m_Interleukin12->operator==(*rhs.m_Interleukin12) : m_Interleukin12 == rhs.m_Interleukin12) - ;equivilant &= ((m_Interleukin6 && rhs.m_Interleukin6) ? m_Interleukin6->operator==(*rhs.m_Interleukin6) : m_Interleukin6 == rhs.m_Interleukin6) - ;equivilant &= ((m_LocalBarrier && rhs.m_LocalBarrier) ? m_LocalBarrier->operator==(*rhs.m_LocalBarrier) : m_LocalBarrier == rhs.m_LocalBarrier) - ;equivilant &= ((m_LocalMacrophage && rhs.m_LocalMacrophage) ? m_LocalMacrophage->operator==(*rhs.m_LocalMacrophage) : m_LocalMacrophage == rhs.m_LocalMacrophage) - ;equivilant &= ((m_LocalNeutrophil && rhs.m_LocalNeutrophil) ? m_LocalNeutrophil->operator==(*rhs.m_LocalNeutrophil) : m_LocalNeutrophil == rhs.m_LocalNeutrophil) - ;equivilant &= ((m_LocalPathogen && rhs.m_LocalPathogen) ? m_LocalPathogen->operator==(*rhs.m_LocalPathogen) : m_LocalPathogen == rhs.m_LocalPathogen) - ;equivilant &= ((m_MacrophageActive && rhs.m_MacrophageActive) ? m_MacrophageActive->operator==(*rhs.m_MacrophageActive) : m_MacrophageActive == rhs.m_MacrophageActive) - ;equivilant &= ((m_MacrophageResting && rhs.m_MacrophageResting) ? m_MacrophageResting->operator==(*rhs.m_MacrophageResting) : m_MacrophageResting == rhs.m_MacrophageResting) - ;equivilant &= ((m_NeutrophilActive && rhs.m_NeutrophilActive) ? m_NeutrophilActive->operator==(*rhs.m_NeutrophilActive) : m_NeutrophilActive == rhs.m_NeutrophilActive) - ;equivilant &= ((m_NeutrophilResting && rhs.m_NeutrophilResting) ? m_NeutrophilResting->operator==(*rhs.m_NeutrophilResting) : m_NeutrophilResting == rhs.m_NeutrophilResting) - ;equivilant &= ((m_Nitrate && rhs.m_Nitrate) ? m_Nitrate->operator==(*rhs.m_Nitrate) : m_Nitrate == rhs.m_Nitrate) - ;equivilant &= ((m_NitricOxide && rhs.m_NitricOxide) ? m_NitricOxide->operator==(*rhs.m_NitricOxide) : m_NitricOxide == rhs.m_NitricOxide) - ;equivilant &= ((m_Trauma && rhs.m_Trauma) ? m_Trauma->operator==(*rhs.m_Trauma) : m_Trauma == rhs.m_Trauma) - ;equivilant &= ((m_TumorNecrosisFactor && rhs.m_TumorNecrosisFactor) ? m_TumorNecrosisFactor->operator==(*rhs.m_TumorNecrosisFactor) : m_TumorNecrosisFactor == rhs.m_TumorNecrosisFactor) - ;equivilant &= ((m_TissueIntegrity && rhs.m_TissueIntegrity) ? m_TissueIntegrity->operator==(*rhs.m_TissueIntegrity) : m_TissueIntegrity == rhs.m_TissueIntegrity) - ;equivilant &= ((m_InflammationTime && rhs.m_InflammationTime) ? m_InflammationTime->operator==(*rhs.m_InflammationTime) : m_InflammationTime == rhs.m_InflammationTime) - ;equivilant &= m_InflammationSources == rhs.m_InflammationSources; + bool equivilant = m_ActiveTLR == rhs.m_ActiveTLR; + equivilant &= ((m_AutonomicResponseLevel && rhs.m_AutonomicResponseLevel) ? m_AutonomicResponseLevel->operator==(*rhs.m_AutonomicResponseLevel) : m_AutonomicResponseLevel == rhs.m_AutonomicResponseLevel); + equivilant &= ((m_BloodPathogen && rhs.m_BloodPathogen) ? m_BloodPathogen->operator==(*rhs.m_BloodPathogen) : m_BloodPathogen == rhs.m_BloodPathogen); + equivilant &= ((m_Catecholamines && rhs.m_Catecholamines) ? m_Catecholamines->operator==(*rhs.m_Catecholamines) : m_Catecholamines == rhs.m_Catecholamines); + equivilant &= ((m_ConstitutiveNOS && rhs.m_ConstitutiveNOS) ? m_ConstitutiveNOS->operator==(*rhs.m_ConstitutiveNOS) : m_ConstitutiveNOS == rhs.m_ConstitutiveNOS); + equivilant &= ((m_InducibleNOS && rhs.m_InducibleNOS) ? m_InducibleNOS->operator==(*rhs.m_InducibleNOS) : m_InducibleNOS == rhs.m_InducibleNOS); + equivilant &= ((m_InducibleNOSPre && rhs.m_InducibleNOSPre) ? m_InducibleNOSPre->operator==(*rhs.m_InducibleNOSPre) : m_InducibleNOSPre == rhs.m_InducibleNOSPre); + equivilant &= ((m_Interleukin10 && rhs.m_Interleukin10) ? m_Interleukin10->operator==(*rhs.m_Interleukin10) : m_Interleukin10 == rhs.m_Interleukin10); + equivilant &= ((m_Interleukin12 && rhs.m_Interleukin12) ? m_Interleukin12->operator==(*rhs.m_Interleukin12) : m_Interleukin12 == rhs.m_Interleukin12); + equivilant &= ((m_Interleukin6 && rhs.m_Interleukin6) ? m_Interleukin6->operator==(*rhs.m_Interleukin6) : m_Interleukin6 == rhs.m_Interleukin6); + equivilant &= ((m_LocalBarrier && rhs.m_LocalBarrier) ? m_LocalBarrier->operator==(*rhs.m_LocalBarrier) : m_LocalBarrier == rhs.m_LocalBarrier); + equivilant &= ((m_LocalMacrophage && rhs.m_LocalMacrophage) ? m_LocalMacrophage->operator==(*rhs.m_LocalMacrophage) : m_LocalMacrophage == rhs.m_LocalMacrophage); + equivilant &= ((m_LocalNeutrophil && rhs.m_LocalNeutrophil) ? m_LocalNeutrophil->operator==(*rhs.m_LocalNeutrophil) : m_LocalNeutrophil == rhs.m_LocalNeutrophil); + equivilant &= ((m_LocalPathogen && rhs.m_LocalPathogen) ? m_LocalPathogen->operator==(*rhs.m_LocalPathogen) : m_LocalPathogen == rhs.m_LocalPathogen); + equivilant &= ((m_MacrophageActive && rhs.m_MacrophageActive) ? m_MacrophageActive->operator==(*rhs.m_MacrophageActive) : m_MacrophageActive == rhs.m_MacrophageActive); + equivilant &= ((m_MacrophageResting && rhs.m_MacrophageResting) ? m_MacrophageResting->operator==(*rhs.m_MacrophageResting) : m_MacrophageResting == rhs.m_MacrophageResting); + equivilant &= ((m_NeutrophilActive && rhs.m_NeutrophilActive) ? m_NeutrophilActive->operator==(*rhs.m_NeutrophilActive) : m_NeutrophilActive == rhs.m_NeutrophilActive); + equivilant &= ((m_NeutrophilResting && rhs.m_NeutrophilResting) ? m_NeutrophilResting->operator==(*rhs.m_NeutrophilResting) : m_NeutrophilResting == rhs.m_NeutrophilResting); + equivilant &= ((m_Nitrate && rhs.m_Nitrate) ? m_Nitrate->operator==(*rhs.m_Nitrate) : m_Nitrate == rhs.m_Nitrate); + equivilant &= ((m_NitricOxide && rhs.m_NitricOxide) ? m_NitricOxide->operator==(*rhs.m_NitricOxide) : m_NitricOxide == rhs.m_NitricOxide); + equivilant &= ((m_Trauma && rhs.m_Trauma) ? m_Trauma->operator==(*rhs.m_Trauma) : m_Trauma == rhs.m_Trauma); + equivilant &= ((m_TumorNecrosisFactor && rhs.m_TumorNecrosisFactor) ? m_TumorNecrosisFactor->operator==(*rhs.m_TumorNecrosisFactor) : m_TumorNecrosisFactor == rhs.m_TumorNecrosisFactor); + equivilant &= ((m_TissueIntegrity && rhs.m_TissueIntegrity) ? m_TissueIntegrity->operator==(*rhs.m_TissueIntegrity) : m_TissueIntegrity == rhs.m_TissueIntegrity); + equivilant &= ((m_InflammationTime && rhs.m_InflammationTime) ? m_InflammationTime->operator==(*rhs.m_InflammationTime) : m_InflammationTime == rhs.m_InflammationTime); + equivilant &= m_InflammationSources == rhs.m_InflammationSources; ; return equivilant; } diff --git a/projects/biogears/libBiogears/src/cdm/system/physiology/SECardiovascularSystem.cpp b/projects/biogears/libBiogears/src/cdm/system/physiology/SECardiovascularSystem.cpp index 6f6705144..9cb8d28cb 100644 --- a/projects/biogears/libBiogears/src/cdm/system/physiology/SECardiovascularSystem.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/physiology/SECardiovascularSystem.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Physiology.h" + #include #include #include @@ -78,7 +80,7 @@ SECardiovascularSystem::SECardiovascularSystem(Logger* logger) m_ExtremityPressureRightLeg = nullptr; m_HeartEjectionFraction = nullptr; m_HeartRate = nullptr; - m_HeartRhythm = (CDM::enumHeartRhythm::value)-1; + m_HeartRhythm = (SEHeartRhythm)-1; m_HeartStrokeVolume = nullptr; m_IntracranialPressure = nullptr; m_MeanArterialPressure = nullptr; @@ -104,13 +106,13 @@ SECardiovascularSystem::SECardiovascularSystem(Logger* logger) SECardiovascularSystem::~SECardiovascularSystem() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SECardiovascularSystem::Clear() +void SECardiovascularSystem::Invalidate() { - SESystem::Clear(); + SESystem::Invalidate(); SAFE_DELETE(m_ArterialPressure); SAFE_DELETE(m_BloodVolume); @@ -126,7 +128,7 @@ void SECardiovascularSystem::Clear() SAFE_DELETE(m_ExtremityPressureRightLeg); SAFE_DELETE(m_HeartEjectionFraction); SAFE_DELETE(m_HeartRate); - m_HeartRhythm = (CDM::enumHeartRhythm::value)-1; + m_HeartRhythm = (SEHeartRhythm)-1; SAFE_DELETE(m_HeartStrokeVolume); SAFE_DELETE(m_IntracranialPressure); SAFE_DELETE(m_MeanArterialPressure); @@ -228,170 +230,6 @@ const SEScalar* SECardiovascularSystem::GetScalar(const std::string& name) } //------------------------------------------------------------------------------- -bool SECardiovascularSystem::Load(const CDM::CardiovascularSystemData& in) -{ - SESystem::Load(in); - - if (in.ArterialPressure().present()) - GetArterialPressure().Load(in.ArterialPressure().get()); - if (in.BloodVolume().present()) - GetBloodVolume().Load(in.BloodVolume().get()); - if (in.CardiacIndex().present()) - GetCardiacIndex().Load(in.CardiacIndex().get()); - if (in.CardiacOutput().present()) - GetCardiacOutput().Load(in.CardiacOutput().get()); - if (in.CentralVenousPressure().present()) - GetCentralVenousPressure().Load(in.CentralVenousPressure().get()); - if (in.CerebralBloodFlow().present()) - GetCerebralBloodFlow().Load(in.CerebralBloodFlow().get()); - if (in.CerebralPerfusionPressure().present()) - GetCerebralPerfusionPressure().Load(in.CerebralPerfusionPressure().get()); - if (in.DiastolicArterialPressure().present()) - GetDiastolicArterialPressure().Load(in.DiastolicArterialPressure().get()); - if (in.ExtremityPressureLeftArm().present()) - GetExtremityPressureLeftArm().Load(in.ExtremityPressureLeftArm().get()); - if (in.ExtremityPressureLeftLeg().present()) - GetExtremityPressureLeftLeg().Load(in.ExtremityPressureLeftLeg().get()); - if (in.ExtremityPressureRightArm().present()) - GetExtremityPressureRightArm().Load(in.ExtremityPressureRightArm().get()); - if (in.ExtremityPressureRightLeg().present()) - GetExtremityPressureRightLeg().Load(in.ExtremityPressureRightLeg().get()); - if (in.HeartEjectionFraction().present()) - GetHeartEjectionFraction().Load(in.HeartEjectionFraction().get()); - if (in.HeartRate().present()) - GetHeartRate().Load(in.HeartRate().get()); - if (in.HeartRhythm().present()) - SetHeartRhythm(in.HeartRhythm().get()); - if (in.HeartStrokeVolume().present()) - GetHeartStrokeVolume().Load(in.HeartStrokeVolume().get()); - if (in.IntracranialPressure().present()) - GetIntracranialPressure().Load(in.IntracranialPressure().get()); - if (in.MeanArterialPressure().present()) - GetMeanArterialPressure().Load(in.MeanArterialPressure().get()); - if (in.MeanArterialCarbonDioxidePartialPressure().present()) - GetMeanArterialCarbonDioxidePartialPressure().Load(in.MeanArterialCarbonDioxidePartialPressure().get()); - if (in.MeanArterialCarbonDioxidePartialPressureDelta().present()) - GetMeanArterialCarbonDioxidePartialPressureDelta().Load(in.MeanArterialCarbonDioxidePartialPressureDelta().get()); - if (in.MeanCentralVenousPressure().present()) - GetMeanCentralVenousPressure().Load(in.MeanCentralVenousPressure().get()); - if (in.MeanSkinFlow().present()) - GetMeanSkinFlow().Load(in.MeanSkinFlow().get()); - if (in.PulmonaryArterialPressure().present()) - GetPulmonaryArterialPressure().Load(in.PulmonaryArterialPressure().get()); - if (in.PulmonaryCapillariesWedgePressure().present()) - GetPulmonaryCapillariesWedgePressure().Load(in.PulmonaryCapillariesWedgePressure().get()); - if (in.PulmonaryDiastolicArterialPressure().present()) - GetPulmonaryDiastolicArterialPressure().Load(in.PulmonaryDiastolicArterialPressure().get()); - if (in.PulmonaryMeanArterialPressure().present()) - GetPulmonaryMeanArterialPressure().Load(in.PulmonaryMeanArterialPressure().get()); - if (in.PulmonaryMeanCapillaryFlow().present()) - GetPulmonaryMeanCapillaryFlow().Load(in.PulmonaryMeanCapillaryFlow().get()); - if (in.PulmonaryMeanShuntFlow().present()) - GetPulmonaryMeanShuntFlow().Load(in.PulmonaryMeanShuntFlow().get()); - if (in.PulmonarySystolicArterialPressure().present()) - GetPulmonarySystolicArterialPressure().Load(in.PulmonarySystolicArterialPressure().get()); - if (in.PulmonaryVascularResistance().present()) - GetPulmonaryVascularResistance().Load(in.PulmonaryVascularResistance().get()); - if (in.PulmonaryVascularResistanceIndex().present()) - GetPulmonaryVascularResistanceIndex().Load(in.PulmonaryVascularResistanceIndex().get()); - if (in.PulsePressure().present()) - GetPulsePressure().Load(in.PulsePressure().get()); - if (in.SystemicVascularResistance().present()) - GetSystemicVascularResistance().Load(in.SystemicVascularResistance().get()); - if (in.SystolicArterialPressure().present()) - GetSystolicArterialPressure().Load(in.SystolicArterialPressure().get()); - if (in.TotalBloodVolumeLost().present()) - GetTotalBloodVolumeLost().Load(in.TotalBloodVolumeLost().get()); - - return true; -} -//------------------------------------------------------------------------------- - -CDM::CardiovascularSystemData* SECardiovascularSystem::Unload() const -{ - CDM::CardiovascularSystemData* data = new CDM::CardiovascularSystemData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- - -void SECardiovascularSystem::Unload(CDM::CardiovascularSystemData& data) const -{ - SESystem::Unload(data); - - if (m_ArterialPressure != nullptr) - data.ArterialPressure(std::unique_ptr(m_ArterialPressure->Unload())); - if (m_BloodVolume != nullptr) - data.BloodVolume(std::unique_ptr(m_BloodVolume->Unload())); - if (m_CardiacIndex != nullptr) - data.CardiacIndex(std::unique_ptr(m_CardiacIndex->Unload())); - if (m_CardiacOutput != nullptr) - data.CardiacOutput(std::unique_ptr(m_CardiacOutput->Unload())); - if (m_CentralVenousPressure != nullptr) - data.CentralVenousPressure(std::unique_ptr(m_CentralVenousPressure->Unload())); - if (m_CerebralBloodFlow != nullptr) - data.CerebralBloodFlow(std::unique_ptr(m_CerebralBloodFlow->Unload())); - if (m_CerebralPerfusionPressure != nullptr) - data.CerebralPerfusionPressure(std::unique_ptr(m_CerebralPerfusionPressure->Unload())); - if (m_DiastolicArterialPressure != nullptr) - data.DiastolicArterialPressure(std::unique_ptr(m_DiastolicArterialPressure->Unload())); - if (m_ExtremityPressureLeftArm != nullptr) - data.ExtremityPressureLeftArm(std::unique_ptr(m_ExtremityPressureLeftArm->Unload())); - if (m_ExtremityPressureLeftLeg != nullptr) - data.ExtremityPressureLeftLeg(std::unique_ptr(m_ExtremityPressureLeftLeg->Unload())); - if (m_ExtremityPressureRightArm != nullptr) - data.ExtremityPressureRightArm(std::unique_ptr(m_ExtremityPressureRightArm->Unload())); - if (m_ExtremityPressureRightLeg != nullptr) - data.ExtremityPressureRightLeg(std::unique_ptr(m_ExtremityPressureRightLeg->Unload())); - if (m_HeartEjectionFraction != nullptr) - data.HeartEjectionFraction(std::unique_ptr(m_HeartEjectionFraction->Unload())); - if (m_HeartRate != nullptr) - data.HeartRate(std::unique_ptr(m_HeartRate->Unload())); - if (HasHeartRhythm()) - data.HeartRhythm(m_HeartRhythm); - if (m_HeartStrokeVolume != nullptr) - data.HeartStrokeVolume(std::unique_ptr(m_HeartStrokeVolume->Unload())); - if (m_IntracranialPressure != nullptr) - data.IntracranialPressure(std::unique_ptr(m_IntracranialPressure->Unload())); - if (m_MeanArterialPressure != nullptr) - data.MeanArterialPressure(std::unique_ptr(m_MeanArterialPressure->Unload())); - if (m_MeanArterialCarbonDioxidePartialPressure != nullptr) - data.MeanArterialCarbonDioxidePartialPressure(std::unique_ptr(m_MeanArterialCarbonDioxidePartialPressure->Unload())); - if (m_MeanArterialCarbonDioxidePartialPressureDelta != nullptr) - data.MeanArterialCarbonDioxidePartialPressureDelta(std::unique_ptr(m_MeanArterialCarbonDioxidePartialPressureDelta->Unload())); - if (m_MeanCentralVenousPressure != nullptr) - data.MeanCentralVenousPressure(std::unique_ptr(m_MeanCentralVenousPressure->Unload())); - if (m_MeanSkinFlow != nullptr) - data.MeanSkinFlow(std::unique_ptr(m_MeanSkinFlow->Unload())); - if (m_PulmonaryArterialPressure != nullptr) - data.PulmonaryArterialPressure(std::unique_ptr(m_PulmonaryArterialPressure->Unload())); - if (m_PulmonaryCapillariesWedgePressure != nullptr) - data.PulmonaryCapillariesWedgePressure(std::unique_ptr(m_PulmonaryCapillariesWedgePressure->Unload())); - if (m_PulmonaryDiastolicArterialPressure != nullptr) - data.PulmonaryDiastolicArterialPressure(std::unique_ptr(m_PulmonaryDiastolicArterialPressure->Unload())); - if (m_PulmonaryMeanArterialPressure != nullptr) - data.PulmonaryMeanArterialPressure(std::unique_ptr(m_PulmonaryMeanArterialPressure->Unload())); - if (m_PulmonaryMeanCapillaryFlow != nullptr) - data.PulmonaryMeanCapillaryFlow(std::unique_ptr(m_PulmonaryMeanCapillaryFlow->Unload())); - if (m_PulmonaryMeanShuntFlow != nullptr) - data.PulmonaryMeanShuntFlow(std::unique_ptr(m_PulmonaryMeanShuntFlow->Unload())); - if (m_PulmonarySystolicArterialPressure != nullptr) - data.PulmonarySystolicArterialPressure(std::unique_ptr(m_PulmonarySystolicArterialPressure->Unload())); - if (m_PulmonaryVascularResistance != nullptr) - data.PulmonaryVascularResistance(std::unique_ptr(m_PulmonaryVascularResistance->Unload())); - if (m_PulmonaryVascularResistanceIndex != nullptr) - data.PulmonaryVascularResistanceIndex(std::unique_ptr(m_PulmonaryVascularResistanceIndex->Unload())); - if (m_PulsePressure != nullptr) - data.PulsePressure(std::unique_ptr(m_PulsePressure->Unload())); - if (m_SystemicVascularResistance != nullptr) - data.SystemicVascularResistance(std::unique_ptr(m_SystemicVascularResistance->Unload())); - if (m_SystolicArterialPressure != nullptr) - data.SystolicArterialPressure(std::unique_ptr(m_SystolicArterialPressure->Unload())); - if (m_TotalBloodVolumeLost != nullptr) - data.TotalBloodVolumeLost(std::unique_ptr(m_TotalBloodVolumeLost->Unload())); -} -//------------------------------------------------------------------------------- - bool SECardiovascularSystem::HasArterialPressure() const { return m_ArterialPressure == nullptr ? false : m_ArterialPressure->IsValid(); @@ -667,24 +505,24 @@ double SECardiovascularSystem::GetHeartRate(const FrequencyUnit& unit) const } //------------------------------------------------------------------------------- -CDM::enumHeartRhythm::value SECardiovascularSystem::GetHeartRhythm() const +SEHeartRhythm SECardiovascularSystem::GetHeartRhythm() const { return m_HeartRhythm; } //------------------------------------------------------------------------------- -void SECardiovascularSystem::SetHeartRhythm(CDM::enumHeartRhythm::value rhythm) +void SECardiovascularSystem::SetHeartRhythm(SEHeartRhythm rhythm) { m_HeartRhythm = rhythm; } //------------------------------------------------------------------------------- bool SECardiovascularSystem::HasHeartRhythm() const { - return m_HeartRhythm == ((CDM::enumHeartRhythm::value)-1) ? false : true; + return m_HeartRhythm == ((SEHeartRhythm)-1) ? false : true; } //------------------------------------------------------------------------------- void SECardiovascularSystem::InvalidateHeartRhythm() { - m_HeartRhythm = (CDM::enumHeartRhythm::value)-1; + m_HeartRhythm = (SEHeartRhythm)-1; } //------------------------------------------------------------------------------- diff --git a/projects/biogears/libBiogears/src/cdm/system/physiology/SEDrugSystem.cpp b/projects/biogears/libBiogears/src/cdm/system/physiology/SEDrugSystem.cpp index 7569e93a4..62264dee6 100644 --- a/projects/biogears/libBiogears/src/cdm/system/physiology/SEDrugSystem.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/physiology/SEDrugSystem.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Physiology.h" + #include #include #include @@ -63,13 +65,13 @@ SEDrugSystem::SEDrugSystem(Logger* logger) SEDrugSystem::~SEDrugSystem() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEDrugSystem::Clear() +void SEDrugSystem::Invalidate() { - SESystem::Clear(); + SESystem::Invalidate(); SAFE_DELETE(m_AntibioticActivity); SAFE_DELETE(m_BronchodilationLevel); @@ -87,43 +89,6 @@ void SEDrugSystem::Clear() SAFE_DELETE(m_CentralNervousResponse); } //------------------------------------------------------------------------------- - -bool SEDrugSystem::Load(const CDM::DrugSystemData& in) -{ - SESystem::Load(in); - - if (in.AntibioticActivity().present()) - GetAntibioticActivity().Load(in.AntibioticActivity().get()); - if (in.BronchodilationLevel().present()) - GetBronchodilationLevel().Load(in.BronchodilationLevel().get()); - if (in.FeverChange().present()) - GetFeverChange().Load(in.FeverChange().get()); - if (in.HeartRateChange().present()) - GetHeartRateChange().Load(in.HeartRateChange().get()); - if (in.HemorrhageChange().present()) - GetHemorrhageChange().Load(in.HemorrhageChange().get()); - if (in.MeanBloodPressureChange().present()) - GetMeanBloodPressureChange().Load(in.MeanBloodPressureChange().get()); - if (in.NeuromuscularBlockLevel().present()) - GetNeuromuscularBlockLevel().Load(in.NeuromuscularBlockLevel().get()); - if (in.PainToleranceChange().present()) - GetPainToleranceChange().Load(in.PainToleranceChange().get()); - if (in.PulsePressureChange().present()) - GetPulsePressureChange().Load(in.PulsePressureChange().get()); - if (in.RespirationRateChange().present()) - GetRespirationRateChange().Load(in.RespirationRateChange().get()); - if (in.SedationLevel().present()) - GetSedationLevel().Load(in.SedationLevel().get()); - if (in.TidalVolumeChange().present()) - GetTidalVolumeChange().Load(in.TidalVolumeChange().get()); - if (in.TubularPermeabilityChange().present()) - GetTubularPermeabilityChange().Load(in.TubularPermeabilityChange().get()); - if (in.CentralNervousResponse().present()) - GetCentralNervousResponse().Load(in.CentralNervousResponse().get()); - - return true; -} -//------------------------------------------------------------------------------- const SEScalar* SEDrugSystem::GetScalar(const char* name) { return GetScalar(std::string { name }); @@ -164,49 +129,6 @@ const SEScalar* SEDrugSystem::GetScalar(const std::string& name) } //------------------------------------------------------------------------------- -CDM::DrugSystemData* SEDrugSystem::Unload() const -{ - CDM::DrugSystemData* data = new CDM::DrugSystemData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- - -void SEDrugSystem::Unload(CDM::DrugSystemData& data) const -{ - SESystem::Unload(data); - - if (m_AntibioticActivity != nullptr) - data.AntibioticActivity(std::unique_ptr(m_AntibioticActivity->Unload())); - if (m_BronchodilationLevel != nullptr) - data.BronchodilationLevel(std::unique_ptr(m_BronchodilationLevel->Unload())); - if (m_FeverChange != nullptr) - data.FeverChange(std::unique_ptr(m_FeverChange->Unload())); - if (m_HeartRateChange != nullptr) - data.HeartRateChange(std::unique_ptr(m_HeartRateChange->Unload())); - if (m_HemorrhageChange != nullptr) - data.HemorrhageChange(std::unique_ptr(m_HemorrhageChange->Unload())); - if (m_MeanBloodPressureChange != nullptr) - data.MeanBloodPressureChange(std::unique_ptr(m_MeanBloodPressureChange->Unload())); - if (m_NeuromuscularBlockLevel != nullptr) - data.NeuromuscularBlockLevel(std::unique_ptr(m_NeuromuscularBlockLevel->Unload())); - if (m_PainToleranceChange != nullptr) - data.PainToleranceChange(std::unique_ptr(m_PainToleranceChange->Unload())); - if (m_PulsePressureChange != nullptr) - data.PulsePressureChange(std::unique_ptr(m_PulsePressureChange->Unload())); - if (m_RespirationRateChange != nullptr) - data.RespirationRateChange(std::unique_ptr(m_RespirationRateChange->Unload())); - if (m_SedationLevel != nullptr) - data.SedationLevel(std::unique_ptr(m_SedationLevel->Unload())); - if (m_TidalVolumeChange != nullptr) - data.TidalVolumeChange(std::unique_ptr(m_TidalVolumeChange->Unload())); - if (m_TubularPermeabilityChange != nullptr) - data.TubularPermeabilityChange(std::unique_ptr(m_TubularPermeabilityChange->Unload())); - if (m_CentralNervousResponse != nullptr) - data.CentralNervousResponse(std::unique_ptr(m_CentralNervousResponse->Unload())); -} -//------------------------------------------------------------------------------- - bool SEDrugSystem::HasAntibioticActivity() const { return m_AntibioticActivity == nullptr ? false : m_AntibioticActivity->IsValid(); @@ -506,21 +428,25 @@ bool SEDrugSystem::operator==(SEDrugSystem const& rhs) const if (this == &rhs) return true; - return ((m_AntibioticActivity && rhs.m_AntibioticActivity) ? m_AntibioticActivity->operator==(*rhs.m_AntibioticActivity) : m_AntibioticActivity == rhs.m_AntibioticActivity) - && ((m_BronchodilationLevel && rhs.m_BronchodilationLevel) ? m_BronchodilationLevel->operator==(*rhs.m_BronchodilationLevel) : m_BronchodilationLevel == rhs.m_BronchodilationLevel) - && ((m_FeverChange && rhs.m_FeverChange) ? m_FeverChange->operator==(*rhs.m_FeverChange) : m_FeverChange == rhs.m_FeverChange) - && ((m_HeartRateChange && rhs.m_HeartRateChange) ? m_HeartRateChange->operator==(*rhs.m_HeartRateChange) : m_HeartRateChange == rhs.m_HeartRateChange) - && ((m_HemorrhageChange && rhs.m_HemorrhageChange) ? m_HemorrhageChange->operator==(*rhs.m_HemorrhageChange) : m_HemorrhageChange == rhs.m_HemorrhageChange) - && ((m_MeanBloodPressureChange && rhs.m_MeanBloodPressureChange) ? m_MeanBloodPressureChange->operator==(*rhs.m_MeanBloodPressureChange) : m_MeanBloodPressureChange == rhs.m_MeanBloodPressureChange) - && ((m_NeuromuscularBlockLevel && rhs.m_NeuromuscularBlockLevel) ? m_NeuromuscularBlockLevel->operator==(*rhs.m_NeuromuscularBlockLevel) : m_NeuromuscularBlockLevel == rhs.m_NeuromuscularBlockLevel) - && ((m_PainToleranceChange && rhs.m_PainToleranceChange) ? m_PainToleranceChange->operator==(*rhs.m_PainToleranceChange) : m_PainToleranceChange == rhs.m_PainToleranceChange) - && ((m_PulsePressureChange && rhs.m_PulsePressureChange) ? m_PulsePressureChange->operator==(*rhs.m_PulsePressureChange) : m_PulsePressureChange == rhs.m_PulsePressureChange) - && ((m_RespirationRateChange && rhs.m_RespirationRateChange) ? m_RespirationRateChange->operator==(*rhs.m_RespirationRateChange) : m_RespirationRateChange == rhs.m_RespirationRateChange) - && ((m_SedationLevel && rhs.m_SedationLevel) ? m_SedationLevel->operator==(*rhs.m_SedationLevel) : m_SedationLevel == rhs.m_SedationLevel) - && ((m_TidalVolumeChange && rhs.m_TidalVolumeChange) ? m_TidalVolumeChange->operator==(*rhs.m_TidalVolumeChange) : m_TidalVolumeChange == rhs.m_TidalVolumeChange) - && ((m_TubularPermeabilityChange && rhs.m_TubularPermeabilityChange) ? m_TubularPermeabilityChange->operator==(*rhs.m_TubularPermeabilityChange) : m_TubularPermeabilityChange == rhs.m_TubularPermeabilityChange) - && ((m_CentralNervousResponse && rhs.m_CentralNervousResponse) ? m_CentralNervousResponse->operator==(*rhs.m_CentralNervousResponse) : m_CentralNervousResponse == rhs.m_CentralNervousResponse) - ; + bool result = true; + ; + result &= ((m_AntibioticActivity && rhs.m_AntibioticActivity) ? m_AntibioticActivity->operator==(*rhs.m_AntibioticActivity) : m_AntibioticActivity == rhs.m_AntibioticActivity); + ; + result &= ((m_BronchodilationLevel && rhs.m_BronchodilationLevel) ? m_BronchodilationLevel->operator==(*rhs.m_BronchodilationLevel) : m_BronchodilationLevel == rhs.m_BronchodilationLevel); + result &= ((m_FeverChange && rhs.m_FeverChange) ? m_FeverChange->operator==(*rhs.m_FeverChange) : m_FeverChange == rhs.m_FeverChange); + result &= ((m_HeartRateChange && rhs.m_HeartRateChange) ? m_HeartRateChange->operator==(*rhs.m_HeartRateChange) : m_HeartRateChange == rhs.m_HeartRateChange); + result &= ((m_HemorrhageChange && rhs.m_HemorrhageChange) ? m_HemorrhageChange->operator==(*rhs.m_HemorrhageChange) : m_HemorrhageChange == rhs.m_HemorrhageChange); + result &= ((m_MeanBloodPressureChange && rhs.m_MeanBloodPressureChange) ? m_MeanBloodPressureChange->operator==(*rhs.m_MeanBloodPressureChange) : m_MeanBloodPressureChange == rhs.m_MeanBloodPressureChange); + result &= ((m_NeuromuscularBlockLevel && rhs.m_NeuromuscularBlockLevel) ? m_NeuromuscularBlockLevel->operator==(*rhs.m_NeuromuscularBlockLevel) : m_NeuromuscularBlockLevel == rhs.m_NeuromuscularBlockLevel); + result &= ((m_PainToleranceChange && rhs.m_PainToleranceChange) ? m_PainToleranceChange->operator==(*rhs.m_PainToleranceChange) : m_PainToleranceChange == rhs.m_PainToleranceChange); + result &= ((m_PulsePressureChange && rhs.m_PulsePressureChange) ? m_PulsePressureChange->operator==(*rhs.m_PulsePressureChange) : m_PulsePressureChange == rhs.m_PulsePressureChange); + result &= ((m_RespirationRateChange && rhs.m_RespirationRateChange) ? m_RespirationRateChange->operator==(*rhs.m_RespirationRateChange) : m_RespirationRateChange == rhs.m_RespirationRateChange); + result &= ((m_SedationLevel && rhs.m_SedationLevel) ? m_SedationLevel->operator==(*rhs.m_SedationLevel) : m_SedationLevel == rhs.m_SedationLevel); + result &= ((m_TidalVolumeChange && rhs.m_TidalVolumeChange) ? m_TidalVolumeChange->operator==(*rhs.m_TidalVolumeChange) : m_TidalVolumeChange == rhs.m_TidalVolumeChange); + result &= ((m_TubularPermeabilityChange && rhs.m_TubularPermeabilityChange) ? m_TubularPermeabilityChange->operator==(*rhs.m_TubularPermeabilityChange) : m_TubularPermeabilityChange == rhs.m_TubularPermeabilityChange); + result &= ((m_CentralNervousResponse && rhs.m_CentralNervousResponse) ? m_CentralNervousResponse->operator==(*rhs.m_CentralNervousResponse) : m_CentralNervousResponse == rhs.m_CentralNervousResponse); + + return result; } bool SEDrugSystem::operator!=(SEDrugSystem const& rhs) const { diff --git a/projects/biogears/libBiogears/src/cdm/system/physiology/SEEndocrineSystem.cpp b/projects/biogears/libBiogears/src/cdm/system/physiology/SEEndocrineSystem.cpp index 75e690025..749355729 100644 --- a/projects/biogears/libBiogears/src/cdm/system/physiology/SEEndocrineSystem.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/physiology/SEEndocrineSystem.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Physiology.h" + #include #include #include @@ -29,13 +31,13 @@ SEEndocrineSystem::SEEndocrineSystem(Logger* logger) SEEndocrineSystem::~SEEndocrineSystem() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEEndocrineSystem::Clear() +void SEEndocrineSystem::Invalidate() { - SESystem::Clear(); + SESystem::Invalidate(); SAFE_DELETE(m_InsulinSynthesisRate); SAFE_DELETE(m_GlucagonSynthesisRate); } @@ -55,35 +57,6 @@ const SEScalar* SEEndocrineSystem::GetScalar(const std::string& name) } //------------------------------------------------------------------------------- -bool SEEndocrineSystem::Load(const CDM::EndocrineSystemData& in) -{ - SESystem::Load(in); - if (in.InsulinSynthesisRate().present()) - GetInsulinSynthesisRate().Load(in.InsulinSynthesisRate().get()); - if (in.GlucagonSynthesisRate().present()) - GetGlucagonSynthesisRate().Load(in.GlucagonSynthesisRate().get()); - return true; -} -//------------------------------------------------------------------------------- - -CDM::EndocrineSystemData* SEEndocrineSystem::Unload() const -{ - CDM::EndocrineSystemData* data = new CDM::EndocrineSystemData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- - -void SEEndocrineSystem::Unload(CDM::EndocrineSystemData& data) const -{ - if (m_InsulinSynthesisRate != nullptr) - data.InsulinSynthesisRate(std::unique_ptr(m_InsulinSynthesisRate->Unload())); - if (m_GlucagonSynthesisRate != nullptr) - data.GlucagonSynthesisRate(std::unique_ptr(m_GlucagonSynthesisRate->Unload())); - SESystem::Unload(data); -} -//------------------------------------------------------------------------------- - bool SEEndocrineSystem::HasInsulinSynthesisRate() const { return m_InsulinSynthesisRate == nullptr ? false : m_InsulinSynthesisRate->IsValid(); diff --git a/projects/biogears/libBiogears/src/cdm/system/physiology/SEEnergySystem.cpp b/projects/biogears/libBiogears/src/cdm/system/physiology/SEEnergySystem.cpp index 60d7dc247..c006d62f3 100644 --- a/projects/biogears/libBiogears/src/cdm/system/physiology/SEEnergySystem.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/physiology/SEEnergySystem.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Physiology.h" + #include #include #include @@ -77,13 +79,13 @@ SEEnergySystem::SEEnergySystem(Logger* logger) SEEnergySystem::~SEEnergySystem() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEEnergySystem::Clear() +void SEEnergySystem::Invalidate() { - SESystem::Clear(); + SESystem::Invalidate(); SAFE_DELETE(m_AchievedExerciseLevel); SAFE_DELETE(m_ChlorideLostToSweat); @@ -163,118 +165,6 @@ const SEScalar* SEEnergySystem::GetScalar(const std::string& name) } //------------------------------------------------------------------------------- -bool SEEnergySystem::Load(const CDM::EnergySystemData& in) -{ - SESystem::Load(in); - - if (in.AchievedExerciseLevel().present()) - GetAchievedExerciseLevel().Load(in.AchievedExerciseLevel().get()); - if (in.ChlorideLostToSweat().present()) - GetChlorideLostToSweat().Load(in.ChlorideLostToSweat().get()); - if (in.CoreTemperature().present()) - GetCoreTemperature().Load(in.CoreTemperature().get()); - if (in.CreatinineProductionRate().present()) - GetCreatinineProductionRate().Load(in.CreatinineProductionRate().get()); - if (in.EnergyDeficit().present()) - GetEnergyDeficit().Load(in.EnergyDeficit().get()); - if (in.ExerciseEnergyDemand().present()) - GetExerciseEnergyDemand().Load(in.ExerciseEnergyDemand().get()); - if (in.ExerciseMeanArterialPressureDelta().present()) - GetExerciseMeanArterialPressureDelta().Load(in.ExerciseMeanArterialPressureDelta().get()); - if (in.FatigueLevel().present()) - GetFatigueLevel().Load(in.FatigueLevel().get()); - if (in.LactateProductionRate().present()) - GetLactateProductionRate().Load(in.LactateProductionRate().get()); - if (in.PotassiumLostToSweat().present()) - GetPotassiumLostToSweat().Load(in.PotassiumLostToSweat().get()); - if (in.SkinTemperature().present()) - GetSkinTemperature().Load(in.SkinTemperature().get()); - if (in.SkinTemperatureTorso().present()) - GetSkinTemperatureTorso().Load(in.SkinTemperatureTorso().get()); - if (in.SkinTemperatureHead().present()) - GetSkinTemperatureHead().Load(in.SkinTemperatureHead().get()); - if (in.SkinTemperatureLeftArm().present()) - GetSkinTemperatureLeftArm().Load(in.SkinTemperatureLeftArm().get()); - if (in.SkinTemperatureRightArm().present()) - GetSkinTemperatureRightArm().Load(in.SkinTemperatureRightArm().get()); - if (in.SkinTemperatureLeftLeg().present()) - GetSkinTemperatureLeftLeg().Load(in.SkinTemperatureLeftLeg().get()); - if (in.SkinTemperatureRightLeg().present()) - GetSkinTemperatureRightLeg().Load(in.SkinTemperatureRightLeg().get()); - if (in.BurnSkinTemperature().present()) - GetBurnSkinTemperature().Load(in.BurnSkinTemperature().get()); - if (in.SodiumLostToSweat().present()) - GetSodiumLostToSweat().Load(in.SodiumLostToSweat().get()); - if (in.SweatRate().present()) - GetSweatRate().Load(in.SweatRate().get()); - if (in.TotalMetabolicRate().present()) - GetTotalMetabolicRate().Load(in.TotalMetabolicRate().get()); - if (in.TotalWorkRateLevel().present()) - GetTotalWorkRateLevel().Load(in.TotalWorkRateLevel().get()); - - return true; -} -//------------------------------------------------------------------------------- - -CDM::EnergySystemData* SEEnergySystem::Unload() const -{ - CDM::EnergySystemData* data(new CDM::EnergySystemData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- - -void SEEnergySystem::Unload(CDM::EnergySystemData& data) const -{ - SESystem::Unload(data); - - if (m_AchievedExerciseLevel != nullptr) - data.AchievedExerciseLevel(std::unique_ptr(m_AchievedExerciseLevel->Unload())); - if (m_ChlorideLostToSweat != nullptr) - data.ChlorideLostToSweat(std::unique_ptr(m_ChlorideLostToSweat->Unload())); - if (m_CoreTemperature != nullptr) - data.CoreTemperature(std::unique_ptr(m_CoreTemperature->Unload())); - if (m_CreatinineProductionRate != nullptr) - data.CreatinineProductionRate(std::unique_ptr(m_CreatinineProductionRate->Unload())); - if (m_EnergyDeficit != nullptr) - data.EnergyDeficit(std::unique_ptr(m_EnergyDeficit->Unload())); - if (m_ExerciseEnergyDemand != nullptr) - data.ExerciseEnergyDemand(std::unique_ptr(m_ExerciseEnergyDemand->Unload())); - if (m_ExerciseMeanArterialPressureDelta != nullptr) - data.ExerciseMeanArterialPressureDelta(std::unique_ptr(m_ExerciseMeanArterialPressureDelta->Unload())); - if (m_FatigueLevel != nullptr) - data.FatigueLevel(std::unique_ptr(m_FatigueLevel->Unload())); - if (m_LactateProductionRate != nullptr) - data.LactateProductionRate(std::unique_ptr(m_LactateProductionRate->Unload())); - if (m_PotassiumLostToSweat != nullptr) - data.PotassiumLostToSweat(std::unique_ptr(m_PotassiumLostToSweat->Unload())); - if (m_SkinTemperature != nullptr) - data.SkinTemperature(std::unique_ptr(m_SkinTemperature->Unload())); - if (m_SkinTemperatureTorso != nullptr) - data.SkinTemperatureTorso(std::unique_ptr(m_SkinTemperatureTorso->Unload())); - if (m_SkinTemperatureHead != nullptr) - data.SkinTemperatureHead(std::unique_ptr(m_SkinTemperatureHead->Unload())); - if (m_SkinTemperatureLeftArm != nullptr) - data.SkinTemperatureLeftArm(std::unique_ptr(m_SkinTemperatureLeftArm->Unload())); - if (m_SkinTemperatureRightArm != nullptr) - data.SkinTemperatureRightArm(std::unique_ptr(m_SkinTemperatureRightArm->Unload())); - if (m_SkinTemperatureLeftLeg != nullptr) - data.SkinTemperatureLeftLeg(std::unique_ptr(m_SkinTemperatureLeftLeg->Unload())); - if (m_SkinTemperatureRightLeg != nullptr) - data.SkinTemperatureRightLeg(std::unique_ptr(m_SkinTemperatureRightLeg->Unload())); - if (m_BurnSkinTemperature != nullptr) - data.BurnSkinTemperature(std::unique_ptr(m_BurnSkinTemperature->Unload())); - if (m_SodiumLostToSweat != nullptr) - data.SodiumLostToSweat(std::unique_ptr(m_SodiumLostToSweat->Unload())); - if (m_SweatRate != nullptr) - data.SweatRate(std::unique_ptr(m_SweatRate->Unload())); - if (m_TotalMetabolicRate != nullptr) - data.TotalMetabolicRate(std::unique_ptr(m_TotalMetabolicRate->Unload())); - if (m_TotalWorkRateLevel != nullptr) - data.TotalWorkRateLevel(std::unique_ptr(m_TotalWorkRateLevel->Unload())); -} -//------------------------------------------------------------------------------- - bool SEEnergySystem::HasAchievedExerciseLevel() const { return m_AchievedExerciseLevel == nullptr ? false : m_AchievedExerciseLevel->IsValid(); diff --git a/projects/biogears/libBiogears/src/cdm/system/physiology/SEGastrointestinalSystem.cpp b/projects/biogears/libBiogears/src/cdm/system/physiology/SEGastrointestinalSystem.cpp index 8db1b8557..6f330e20c 100644 --- a/projects/biogears/libBiogears/src/cdm/system/physiology/SEGastrointestinalSystem.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/physiology/SEGastrointestinalSystem.cpp @@ -12,12 +12,12 @@ specific language governing permissions and limitations under the License. #include #include +#include #include #include #include #include #include -#include namespace std { template class map; @@ -42,12 +42,12 @@ SEGastrointestinalSystem::SEGastrointestinalSystem(Logger* logger) //------------------------------------------------------------------------------- SEGastrointestinalSystem::~SEGastrointestinalSystem() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEGastrointestinalSystem::Clear() +void SEGastrointestinalSystem::Invalidate() { - SESystem::Clear(); + SESystem::Invalidate(); SAFE_DELETE(m_ChymeAbsorptionRate); SAFE_DELETE(m_StomachContents); } @@ -72,37 +72,6 @@ const SEScalar* SEGastrointestinalSystem::GetScalar(const std::string& name) return nullptr; } //------------------------------------------------------------------------------- -bool SEGastrointestinalSystem::Load(const CDM::GastrointestinalSystemData& in) -{ - SESystem::Load(in); - if (in.ChymeAbsorptionRate().present()) - GetChymeAbsorptionRate().Load(in.ChymeAbsorptionRate().get()); - if (in.StomachContents().present()) - GetStomachContents().Load(in.StomachContents().get()); - - return true; -} -//------------------------------------------------------------------------------- -CDM::GastrointestinalSystemData* SEGastrointestinalSystem::Unload() const -{ - CDM::GastrointestinalSystemData* data = new CDM::GastrointestinalSystemData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEGastrointestinalSystem::Unload(CDM::GastrointestinalSystemData& data) const -{ - SESystem::Unload(data); - if (m_ChymeAbsorptionRate != nullptr) - data.ChymeAbsorptionRate(std::unique_ptr(m_ChymeAbsorptionRate->Unload())); - if (m_StomachContents != nullptr) - data.StomachContents(std::unique_ptr(m_StomachContents->Unload())); - for (auto itr : m_DrugTransitStates) { - if (itr.second != nullptr) - data.DrugTransitStates().push_back(std::unique_ptr(itr.second->Unload())); - } -} -//------------------------------------------------------------------------------- bool SEGastrointestinalSystem::HasChymeAbsorptionRate() const { return m_ChymeAbsorptionRate == nullptr ? false : m_ChymeAbsorptionRate->IsValid(); @@ -200,10 +169,10 @@ SEDrugTransitState::SEDrugTransitState(const SESubstance& sub) //------------------------------------------------------------------------------- SEDrugTransitState::~SEDrugTransitState() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEDrugTransitState::Clear() +void SEDrugTransitState::Invalidate() { m_LumenSolidMasses.clear(); m_LumenDissolvedMasses.clear(); @@ -212,58 +181,11 @@ void SEDrugTransitState::Clear() SAFE_DELETE(m_TotalMassMetabolized); } //------------------------------------------------------------------------------- -bool SEDrugTransitState::Load(const CDM::DrugTransitStateData& in) -{ - m_LumenDissolvedMasses.clear(); - for (auto disMass : in.LumenDissolvedMasses()) { - SEScalarMass dMass; - dMass.Load(disMass); - m_LumenDissolvedMasses.push_back(dMass); - } - m_LumenSolidMasses.clear(); - for (auto solMass : in.LumenSolidMasses()) { - SEScalarMass sMass; - sMass.Load(solMass); - m_LumenSolidMasses.push_back(sMass); - } - m_EnterocyteMasses.clear(); - for (auto entMass : in.EnterocyteMasses()) { - SEScalarMass eMass; - eMass.Load(entMass); - m_EnterocyteMasses.push_back(eMass); - } - GetTotalMassExcreted().Load(in.MassExcreted()); - GetTotalMassMetabolized().Load(in.MassMetabolized()); - return true; -} -CDM::DrugTransitStateData* SEDrugTransitState::Unload() const -{ - CDM::DrugTransitStateData* data = new CDM::DrugTransitStateData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEDrugTransitState::Unload(CDM::DrugTransitStateData& data) const -{ - for (auto tdMass : m_LumenDissolvedMasses) { - data.LumenDissolvedMasses().push_back(std::unique_ptr(tdMass.Unload())); - } - for (auto tsMass : m_LumenSolidMasses) { - data.LumenSolidMasses().push_back(std::unique_ptr(tsMass.Unload())); - } - for (auto eMass : m_EnterocyteMasses) { - data.EnterocyteMasses().push_back(std::unique_ptr(eMass.Unload())); - } - data.MassMetabolized(std::unique_ptr(m_TotalMassMetabolized->Unload())); - data.MassExcreted(std::unique_ptr(m_TotalMassExcreted->Unload())); - data.Substance(m_Substance->GetName()); -} -//------------------------------------------------------------------------------- -bool SEDrugTransitState::Initialize(SEScalarMass& dose, CDM::enumOralAdministration::value route) +bool SEDrugTransitState::Initialize(SEScalarMass& dose, SEOralAdministrationType route) { std::vector zeroMassVec(m_NumTransitMasses); // All zeros, correct number of elements bool trSolSet = SetLumenSolidMasses(zeroMassVec, MassUnit::ug); - if (route == CDM::enumOralAdministration::Gastrointestinal) { + if (route == SEOralAdministrationType::Gastrointestinal) { m_LumenSolidMasses[0].Set(dose); // If pill swallowed, put all the mass as solid in to stomach at initialization } // If route is transmucosal, we leave everything at 0 because we assume that no drug has been dissolved in saliva and swallowed at first time step diff --git a/projects/biogears/libBiogears/src/cdm/system/physiology/SEHepaticSystem.cpp b/projects/biogears/libBiogears/src/cdm/system/physiology/SEHepaticSystem.cpp index 9f3a429ff..fe6c61729 100644 --- a/projects/biogears/libBiogears/src/cdm/system/physiology/SEHepaticSystem.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/physiology/SEHepaticSystem.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Physiology.h" #include #include #include @@ -30,13 +31,13 @@ SEHepaticSystem::SEHepaticSystem(Logger* logger) SEHepaticSystem::~SEHepaticSystem() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SEHepaticSystem::Clear() +void SEHepaticSystem::Invalidate() { - SESystem::Clear(); + SESystem::Invalidate(); SAFE_DELETE(m_KetoneProductionRate); SAFE_DELETE(m_HepaticGluconeogenesisRate); @@ -57,36 +58,6 @@ const SEScalar* SEHepaticSystem::GetScalar(const std::string& name) } //------------------------------------------------------------------------------- -bool SEHepaticSystem::Load(const CDM::HepaticSystemData& in) -{ - SESystem::Load(in); - - if (in.KetoneProductionRate().present()) - GetKetoneProductionRate().Load(in.KetoneProductionRate().get()); - if (in.HepaticGluconeogenesisRate().present()) - GetHepaticGluconeogenesisRate().Load(in.HepaticGluconeogenesisRate().get()); - - return true; -} -//------------------------------------------------------------------------------- -CDM::HepaticSystemData* SEHepaticSystem::Unload() const -{ - CDM::HepaticSystemData* data = new CDM::HepaticSystemData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SEHepaticSystem::Unload(CDM::HepaticSystemData& data) const -{ - SESystem::Unload(data); - - if (m_KetoneProductionRate != nullptr) - data.KetoneProductionRate(std::unique_ptr(m_KetoneProductionRate->Unload())); - if (m_HepaticGluconeogenesisRate != nullptr) - data.HepaticGluconeogenesisRate(std::unique_ptr(m_HepaticGluconeogenesisRate->Unload())); -} -//------------------------------------------------------------------------------- - bool SEHepaticSystem::HasKetoneProductionRate() const { return m_KetoneProductionRate == nullptr ? false : m_KetoneProductionRate->IsValid(); diff --git a/projects/biogears/libBiogears/src/cdm/system/physiology/SENervousSystem.cpp b/projects/biogears/libBiogears/src/cdm/system/physiology/SENervousSystem.cpp index 8398d8d4d..4e473b640 100644 --- a/projects/biogears/libBiogears/src/cdm/system/physiology/SENervousSystem.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/physiology/SENervousSystem.cpp @@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Physiology.h" #include #include #include @@ -57,7 +58,7 @@ SENervousSystem::SENervousSystem(Logger* logger) m_ResistanceScaleMuscle = nullptr; m_ResistanceScaleMyocardium = nullptr; m_SleepTime = nullptr; - m_SleepState = (CDM::enumSleepState::value)-1; + m_SleepState = (SESleepState)-1; m_WakeTime = nullptr; m_RichmondAgitationSedationScale = nullptr; } @@ -65,13 +66,13 @@ SENervousSystem::SENervousSystem(Logger* logger) SENervousSystem::~SENervousSystem() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SENervousSystem::Clear() +void SENervousSystem::Invalidate() { - SESystem::Clear(); + SESystem::Invalidate(); SAFE_DELETE(m_AttentionLapses); SAFE_DELETE(m_BiologicalDebt); SAFE_DELETE(m_HeartRateScale); @@ -88,7 +89,7 @@ void SENervousSystem::Clear() SAFE_DELETE(m_RightEyePupillaryResponse); SAFE_DELETE(m_PainVisualAnalogueScale); SAFE_DELETE(m_SleepTime); - m_SleepState = (CDM::enumSleepState::value)-1; + m_SleepState = (SESleepState)-1; SAFE_DELETE(m_WakeTime); SAFE_DELETE(m_RichmondAgitationSedationScale); } @@ -144,104 +145,6 @@ const SEScalar* SENervousSystem::GetScalar(const std::string& name) } return nullptr; } -//------------------------------------------------------------------------------- - -bool SENervousSystem::Load(const CDM::NervousSystemData& in) -{ - SESystem::Load(in); - if (in.AttentionLapses().present()) - GetAttentionLapses().Load(in.AttentionLapses().get()); - if (in.BiologicalDebt().present()) - GetBiologicalDebt().Load(in.BiologicalDebt().get()); - if (in.HeartRateScale().present()) - GetHeartRateScale().Load(in.HeartRateScale().get()); - if (in.HeartElastanceScale().present()) - GetHeartElastanceScale().Load(in.HeartElastanceScale().get()); - if (in.MentalStatus().present()) - GetMentalStatus().Load(in.MentalStatus().get()); - if (in.ReactionTime().present()) - GetReactionTime().Load(in.ReactionTime().get()); - if (in.ResistanceScaleExtrasplanchnic().present()) - GetResistanceScaleExtrasplanchnic().Load(in.ResistanceScaleExtrasplanchnic().get()); - if (in.ResistanceScaleMuscle().present()) - GetResistanceScaleMuscle().Load(in.ResistanceScaleMuscle().get()); - if (in.ResistanceScaleMyocardium().present()) - GetResistanceScaleMyocardium().Load(in.ResistanceScaleMyocardium().get()); - if (in.ResistanceScaleSplanchnic().present()) - GetResistanceScaleSplanchnic().Load(in.ResistanceScaleSplanchnic().get()); - if (in.ComplianceScale().present()) - GetComplianceScale().Load(in.ComplianceScale().get()); - if (in.PainVisualAnalogueScale().present()) - GetPainVisualAnalogueScale().Load(in.PainVisualAnalogueScale().get()); - if (in.GlasgowComaScalar().present()) - GetGlasgowComaScalar().Load(in.GlasgowComaScalar().get()); - if (in.LeftEyePupillaryResponse().present()) - GetLeftEyePupillaryResponse().Load(in.LeftEyePupillaryResponse().get()); - if (in.RichmondAgitationSedationScale().present()) - GetRichmondAgitationSedationScale().Load(in.RichmondAgitationSedationScale().get()); - if (in.RightEyePupillaryResponse().present()) - GetRightEyePupillaryResponse().Load(in.RightEyePupillaryResponse().get()); - if (in.SleepTime().present()) - GetSleepTime().Load(in.SleepTime().get()); - if (in.SleepState().present()) - SetSleepState(in.SleepState().get()); - if (in.WakeTime().present()) - GetWakeTime().Load(in.WakeTime().get()); - return true; -} -//------------------------------------------------------------------------------- - -CDM::NervousSystemData* SENervousSystem::Unload() const -{ - CDM::NervousSystemData* data = new CDM::NervousSystemData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- - -void SENervousSystem::Unload(CDM::NervousSystemData& data) const -{ - SESystem::Unload(data); - if (m_AttentionLapses != nullptr) - data.AttentionLapses(std::unique_ptr(m_AttentionLapses->Unload())); - if (m_BiologicalDebt != nullptr) - data.BiologicalDebt(std::unique_ptr(m_BiologicalDebt->Unload())); - if (m_HeartRateScale != nullptr) - data.HeartRateScale(std::unique_ptr(m_HeartRateScale->Unload())); - if (m_HeartElastanceScale != nullptr) - data.HeartElastanceScale(std::unique_ptr(m_HeartElastanceScale->Unload())); - if (m_MentalStatus != nullptr) - data.MentalStatus(std::unique_ptr(m_MentalStatus->Unload())); - if (m_ReactionTime != nullptr) - data.ReactionTime(std::unique_ptr(m_ReactionTime->Unload())); - if (m_ResistanceScaleExtrasplanchnic != nullptr) - data.ResistanceScaleExtrasplanchnic(std::unique_ptr(m_ResistanceScaleExtrasplanchnic->Unload())); - if (m_ResistanceScaleMuscle != nullptr) - data.ResistanceScaleMuscle(std::unique_ptr(m_ResistanceScaleMuscle->Unload())); - if (m_ResistanceScaleMyocardium != nullptr) - data.ResistanceScaleMyocardium(std::unique_ptr(m_ResistanceScaleMyocardium->Unload())); - if (m_ResistanceScaleSplanchnic != nullptr) - data.ResistanceScaleSplanchnic(std::unique_ptr(m_ResistanceScaleSplanchnic->Unload())); - if (m_ComplianceScale != nullptr) - data.ComplianceScale(std::unique_ptr(m_ComplianceScale->Unload())); - if (m_PainVisualAnalogueScale != nullptr) - data.PainVisualAnalogueScale(std::unique_ptr(m_PainVisualAnalogueScale->Unload())); - if (m_GlasgowComaScalar != nullptr) - data.GlasgowComaScalar(std::unique_ptr(m_GlasgowComaScalar->Unload())); - if (m_LeftEyePupillaryResponse != nullptr) - data.LeftEyePupillaryResponse(std::unique_ptr(m_LeftEyePupillaryResponse->Unload())); - if (m_RichmondAgitationSedationScale != nullptr) - data.RichmondAgitationSedationScale(std::unique_ptr(m_RichmondAgitationSedationScale->Unload())); - if (m_RightEyePupillaryResponse != nullptr) - data.RightEyePupillaryResponse(std::unique_ptr(m_RightEyePupillaryResponse->Unload())); - if (m_SleepTime != nullptr) - data.SleepTime(std::unique_ptr(m_SleepTime->Unload())); - if (HasSleepState()) - data.SleepState(m_SleepState); - if (m_WakeTime != nullptr) - data.WakeTime(std::unique_ptr(m_WakeTime->Unload())); -} - //------------------------------------------------------------------------------- bool SENervousSystem::HasAttentionLapses() const { @@ -557,7 +460,7 @@ double SENervousSystem::GetReactionTime(const TimeUnit& unit) const //------------------------------------------------------------------------------- bool SENervousSystem::IsAsleep() const { - return m_SleepState == ((CDM::enumSleepState::Asleep)) ? true : false; + return m_SleepState == ((SESleepState::Sleeping)) ? true : false; } //------------------------------------------------------------------------------- SEScalarTime& SENervousSystem::GetSleepTime() @@ -575,29 +478,29 @@ double SENervousSystem::GetSleepTime(const TimeUnit& unit) const } //------------------------------------------------------------------------------- -CDM::enumSleepState::value SENervousSystem::GetSleepState() const +SESleepState SENervousSystem::GetSleepState() const { return m_SleepState; } //------------------------------------------------------------------------------- -void SENervousSystem::SetSleepState(CDM::enumSleepState::value sleep) +void SENervousSystem::SetSleepState(SESleepState sleep) { m_SleepState = sleep; } //------------------------------------------------------------------------------- void SENervousSystem::InvalidateSleepState() { - m_SleepState = (CDM::enumSleepState::value)-1; + m_SleepState = (SESleepState)-1; } //------------------------------------------------------------------------------- bool SENervousSystem::HasSleepState() const { - return m_SleepState == ((CDM::enumSleepState::value)-1) ? false : true; + return m_SleepState == ((SESleepState)-1) ? false : true; } //------------------------------------------------------------------------------- bool SENervousSystem::IsAwake() const { - return m_SleepState == ((CDM::enumSleepState::Awake)) ? true : false; + return m_SleepState == ((SESleepState::Awake)) ? true : false; } //------------------------------------------------------------------------------- SEScalarTime& SENervousSystem::GetWakeTime() @@ -669,4 +572,4 @@ bool SENervousSystem::operator!=(SENervousSystem const& rhs) const return !(*this == rhs); } //------------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/projects/biogears/libBiogears/src/cdm/system/physiology/SERenalSystem.cpp b/projects/biogears/libBiogears/src/cdm/system/physiology/SERenalSystem.cpp index 155305b56..ece88d146 100644 --- a/projects/biogears/libBiogears/src/cdm/system/physiology/SERenalSystem.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/physiology/SERenalSystem.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Physiology.h" + #include #include #include @@ -154,13 +156,13 @@ SERenalSystem::SERenalSystem(Logger* logger) SERenalSystem::~SERenalSystem() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SERenalSystem::Clear() +void SERenalSystem::Invalidate() { - SESystem::Clear(); + SESystem::Invalidate(); SAFE_DELETE(m_BladderPressure); SAFE_DELETE(m_GlomerularFiltrationRate); @@ -352,261 +354,6 @@ const SEScalar* SERenalSystem::GetScalar(const std::string& name) } //------------------------------------------------------------------------------- -bool SERenalSystem::Load(const CDM::RenalSystemData& in) -{ - SESystem::Load(in); - - if (in.BladderPressure().present()) - GetBladderPressure().Load(in.BladderPressure().get()); - if (in.GlomerularFiltrationRate().present()) - GetGlomerularFiltrationRate().Load(in.GlomerularFiltrationRate().get()); - if (in.FiltrationFraction().present()) - GetFiltrationFraction().Load(in.FiltrationFraction().get()); - - if (in.LeftAfferentArterioleResistance().present()) - GetLeftAfferentArterioleResistance().Load(in.LeftAfferentArterioleResistance().get()); - if (in.LeftBowmansCapsulesHydrostaticPressure().present()) - GetLeftBowmansCapsulesHydrostaticPressure().Load(in.LeftBowmansCapsulesHydrostaticPressure().get()); - if (in.LeftBowmansCapsulesOsmoticPressure().present()) - GetLeftBowmansCapsulesOsmoticPressure().Load(in.LeftBowmansCapsulesOsmoticPressure().get()); - if (in.LeftEfferentArterioleResistance().present()) - GetLeftEfferentArterioleResistance().Load(in.LeftEfferentArterioleResistance().get()); - if (in.LeftGlomerularCapillariesHydrostaticPressure().present()) - GetLeftGlomerularCapillariesHydrostaticPressure().Load(in.LeftGlomerularCapillariesHydrostaticPressure().get()); - if (in.LeftGlomerularCapillariesOsmoticPressure().present()) - GetLeftGlomerularCapillariesOsmoticPressure().Load(in.LeftGlomerularCapillariesOsmoticPressure().get()); - if (in.LeftGlomerularFiltrationCoefficient().present()) - GetLeftGlomerularFiltrationCoefficient().Load(in.LeftGlomerularFiltrationCoefficient().get()); - if (in.LeftGlomerularFiltrationRate().present()) - GetLeftGlomerularFiltrationRate().Load(in.LeftGlomerularFiltrationRate().get()); - if (in.LeftGlomerularFiltrationSurfaceArea().present()) - GetLeftGlomerularFiltrationSurfaceArea().Load(in.LeftGlomerularFiltrationSurfaceArea().get()); - if (in.LeftGlomerularFluidPermeability().present()) - GetLeftGlomerularFluidPermeability().Load(in.LeftGlomerularFluidPermeability().get()); - if (in.LeftFiltrationFraction().present()) - GetLeftFiltrationFraction().Load(in.LeftFiltrationFraction().get()); - if (in.LeftNetFiltrationPressure().present()) - GetLeftNetFiltrationPressure().Load(in.LeftNetFiltrationPressure().get()); - if (in.LeftNetReabsorptionPressure().present()) - GetLeftNetReabsorptionPressure().Load(in.LeftNetReabsorptionPressure().get()); - if (in.LeftPeritubularCapillariesHydrostaticPressure().present()) - GetLeftPeritubularCapillariesHydrostaticPressure().Load(in.LeftPeritubularCapillariesHydrostaticPressure().get()); - if (in.LeftPeritubularCapillariesOsmoticPressure().present()) - GetLeftPeritubularCapillariesOsmoticPressure().Load(in.LeftPeritubularCapillariesOsmoticPressure().get()); - if (in.LeftReabsorptionFiltrationCoefficient().present()) - GetLeftReabsorptionFiltrationCoefficient().Load(in.LeftReabsorptionFiltrationCoefficient().get()); - if (in.LeftReabsorptionRate().present()) - GetLeftReabsorptionRate().Load(in.LeftReabsorptionRate().get()); - if (in.LeftTubularReabsorptionFiltrationSurfaceArea().present()) - GetLeftTubularReabsorptionFiltrationSurfaceArea().Load(in.LeftTubularReabsorptionFiltrationSurfaceArea().get()); - if (in.LeftTubularReabsorptionFluidPermeability().present()) - GetLeftTubularReabsorptionFluidPermeability().Load(in.LeftTubularReabsorptionFluidPermeability().get()); - if (in.LeftTubularHydrostaticPressure().present()) - GetLeftTubularHydrostaticPressure().Load(in.LeftTubularHydrostaticPressure().get()); - if (in.LeftTubularOsmoticPressure().present()) - GetLeftTubularOsmoticPressure().Load(in.LeftTubularOsmoticPressure().get()); - - if (in.RenalBloodFlow().present()) - GetRenalBloodFlow().Load(in.RenalBloodFlow().get()); - if (in.RenalPlasmaFlow().present()) - GetRenalPlasmaFlow().Load(in.RenalPlasmaFlow().get()); - if (in.RenalVascularResistance().present()) - GetRenalVascularResistance().Load(in.RenalVascularResistance().get()); - - if (in.RightAfferentArterioleResistance().present()) - GetRightAfferentArterioleResistance().Load(in.RightAfferentArterioleResistance().get()); - if (in.RightBowmansCapsulesHydrostaticPressure().present()) - GetRightBowmansCapsulesHydrostaticPressure().Load(in.RightBowmansCapsulesHydrostaticPressure().get()); - if (in.RightBowmansCapsulesOsmoticPressure().present()) - GetRightBowmansCapsulesOsmoticPressure().Load(in.RightBowmansCapsulesOsmoticPressure().get()); - if (in.RightEfferentArterioleResistance().present()) - GetRightEfferentArterioleResistance().Load(in.RightEfferentArterioleResistance().get()); - if (in.RightGlomerularCapillariesHydrostaticPressure().present()) - GetRightGlomerularCapillariesHydrostaticPressure().Load(in.RightGlomerularCapillariesHydrostaticPressure().get()); - if (in.RightGlomerularCapillariesOsmoticPressure().present()) - GetRightGlomerularCapillariesOsmoticPressure().Load(in.RightGlomerularCapillariesOsmoticPressure().get()); - if (in.RightGlomerularFiltrationCoefficient().present()) - GetRightGlomerularFiltrationCoefficient().Load(in.RightGlomerularFiltrationCoefficient().get()); - if (in.RightGlomerularFiltrationRate().present()) - GetRightGlomerularFiltrationRate().Load(in.RightGlomerularFiltrationRate().get()); - if (in.RightGlomerularFiltrationSurfaceArea().present()) - GetRightGlomerularFiltrationSurfaceArea().Load(in.RightGlomerularFiltrationSurfaceArea().get()); - if (in.RightGlomerularFluidPermeability().present()) - GetRightGlomerularFluidPermeability().Load(in.RightGlomerularFluidPermeability().get()); - if (in.RightFiltrationFraction().present()) - GetRightFiltrationFraction().Load(in.RightFiltrationFraction().get()); - if (in.RightNetFiltrationPressure().present()) - GetRightNetFiltrationPressure().Load(in.RightNetFiltrationPressure().get()); - if (in.RightNetReabsorptionPressure().present()) - GetRightNetReabsorptionPressure().Load(in.RightNetReabsorptionPressure().get()); - if (in.RightPeritubularCapillariesHydrostaticPressure().present()) - GetRightPeritubularCapillariesHydrostaticPressure().Load(in.RightPeritubularCapillariesHydrostaticPressure().get()); - if (in.RightPeritubularCapillariesOsmoticPressure().present()) - GetRightPeritubularCapillariesOsmoticPressure().Load(in.RightPeritubularCapillariesOsmoticPressure().get()); - if (in.RightReabsorptionFiltrationCoefficient().present()) - GetRightReabsorptionFiltrationCoefficient().Load(in.RightReabsorptionFiltrationCoefficient().get()); - if (in.RightReabsorptionRate().present()) - GetRightReabsorptionRate().Load(in.RightReabsorptionRate().get()); - if (in.RightTubularReabsorptionFiltrationSurfaceArea().present()) - GetRightTubularReabsorptionFiltrationSurfaceArea().Load(in.RightTubularReabsorptionFiltrationSurfaceArea().get()); - if (in.RightTubularReabsorptionFluidPermeability().present()) - GetRightTubularReabsorptionFluidPermeability().Load(in.RightTubularReabsorptionFluidPermeability().get()); - if (in.RightTubularHydrostaticPressure().present()) - GetRightTubularHydrostaticPressure().Load(in.RightTubularHydrostaticPressure().get()); - if (in.RightTubularOsmoticPressure().present()) - GetRightTubularOsmoticPressure().Load(in.RightTubularOsmoticPressure().get()); - - if (in.UrinationRate().present()) - GetUrinationRate().Load(in.UrinationRate().get()); - if (in.UrineOsmolality().present()) - GetUrineOsmolality().Load(in.UrineOsmolality().get()); - if (in.UrineOsmolarity().present()) - GetUrineOsmolarity().Load(in.UrineOsmolarity().get()); - if (in.UrineProductionRate().present()) - GetUrineProductionRate().Load(in.UrineProductionRate().get()); - if (in.MeanUrineOutput().present()) - GetMeanUrineOutput().Load(in.MeanUrineOutput().get()); - if (in.UrineSpecificGravity().present()) - GetUrineSpecificGravity().Load(in.UrineSpecificGravity().get()); - if (in.UrineVolume().present()) - GetUrineVolume().Load(in.UrineVolume().get()); - if (in.UrineUreaNitrogenConcentration().present()) - GetUrineUreaNitrogenConcentration().Load(in.UrineUreaNitrogenConcentration().get()); - - return true; -} -//------------------------------------------------------------------------------- - -CDM::RenalSystemData* SERenalSystem::Unload() const -{ - CDM::RenalSystemData* data = new CDM::RenalSystemData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- - -void SERenalSystem::Unload(CDM::RenalSystemData& data) const -{ - SESystem::Unload(data); - if (m_BladderPressure != nullptr) - data.BladderPressure(std::unique_ptr(m_BladderPressure->Unload())); - if (m_GlomerularFiltrationRate != nullptr) - data.GlomerularFiltrationRate(std::unique_ptr(m_GlomerularFiltrationRate->Unload())); - if (m_FiltrationFraction != nullptr) - data.FiltrationFraction(std::unique_ptr(m_FiltrationFraction->Unload())); - - if (m_LeftAfferentArterioleResistance != nullptr) - data.LeftAfferentArterioleResistance(std::unique_ptr(m_LeftAfferentArterioleResistance->Unload())); - if (m_LeftBowmansCapsulesHydrostaticPressure != nullptr) - data.LeftBowmansCapsulesHydrostaticPressure(std::unique_ptr(m_LeftBowmansCapsulesHydrostaticPressure->Unload())); - if (m_LeftBowmansCapsulesOsmoticPressure != nullptr) - data.LeftBowmansCapsulesOsmoticPressure(std::unique_ptr(m_LeftBowmansCapsulesOsmoticPressure->Unload())); - if (m_LeftEfferentArterioleResistance != nullptr) - data.LeftEfferentArterioleResistance(std::unique_ptr(m_LeftEfferentArterioleResistance->Unload())); - if (m_LeftGlomerularCapillariesHydrostaticPressure != nullptr) - data.LeftGlomerularCapillariesHydrostaticPressure(std::unique_ptr(m_LeftGlomerularCapillariesHydrostaticPressure->Unload())); - if (m_LeftGlomerularCapillariesOsmoticPressure != nullptr) - data.LeftGlomerularCapillariesOsmoticPressure(std::unique_ptr(m_LeftGlomerularCapillariesOsmoticPressure->Unload())); - if (m_LeftGlomerularFiltrationCoefficient != nullptr) - data.LeftGlomerularFiltrationCoefficient(std::unique_ptr(m_LeftGlomerularFiltrationCoefficient->Unload())); - if (m_LeftGlomerularFiltrationRate != nullptr) - data.LeftGlomerularFiltrationRate(std::unique_ptr(m_LeftGlomerularFiltrationRate->Unload())); - if (m_LeftGlomerularFiltrationSurfaceArea != nullptr) - data.LeftGlomerularFiltrationSurfaceArea(std::unique_ptr(m_LeftGlomerularFiltrationSurfaceArea->Unload())); - if (m_LeftGlomerularFluidPermeability != nullptr) - data.LeftGlomerularFluidPermeability(std::unique_ptr(m_LeftGlomerularFluidPermeability->Unload())); - if (m_LeftFiltrationFraction != nullptr) - data.LeftFiltrationFraction(std::unique_ptr(m_LeftFiltrationFraction->Unload())); - if (m_LeftNetFiltrationPressure != nullptr) - data.LeftNetFiltrationPressure(std::unique_ptr(m_LeftNetFiltrationPressure->Unload())); - if (m_LeftNetReabsorptionPressure != nullptr) - data.LeftNetReabsorptionPressure(std::unique_ptr(m_LeftNetReabsorptionPressure->Unload())); - if (m_LeftPeritubularCapillariesHydrostaticPressure != nullptr) - data.LeftPeritubularCapillariesHydrostaticPressure(std::unique_ptr(m_LeftPeritubularCapillariesHydrostaticPressure->Unload())); - if (m_LeftPeritubularCapillariesOsmoticPressure != nullptr) - data.LeftPeritubularCapillariesOsmoticPressure(std::unique_ptr(m_LeftPeritubularCapillariesOsmoticPressure->Unload())); - if (m_LeftReabsorptionFiltrationCoefficient != nullptr) - data.LeftReabsorptionFiltrationCoefficient(std::unique_ptr(m_LeftReabsorptionFiltrationCoefficient->Unload())); - if (m_LeftReabsorptionRate != nullptr) - data.LeftReabsorptionRate(std::unique_ptr(m_LeftReabsorptionRate->Unload())); - if (m_LeftTubularReabsorptionFiltrationSurfaceArea != nullptr) - data.LeftTubularReabsorptionFiltrationSurfaceArea(std::unique_ptr(m_LeftTubularReabsorptionFiltrationSurfaceArea->Unload())); - if (m_LeftTubularReabsorptionFluidPermeability != nullptr) - data.LeftTubularReabsorptionFluidPermeability(std::unique_ptr(m_LeftTubularReabsorptionFluidPermeability->Unload())); - if (m_LeftTubularHydrostaticPressure != nullptr) - data.LeftTubularHydrostaticPressure(std::unique_ptr(m_LeftTubularHydrostaticPressure->Unload())); - if (m_LeftTubularOsmoticPressure != nullptr) - data.LeftTubularOsmoticPressure(std::unique_ptr(m_LeftTubularOsmoticPressure->Unload())); - - if (m_RenalBloodFlow != nullptr) - data.RenalBloodFlow(std::unique_ptr(m_RenalBloodFlow->Unload())); - if (m_RenalPlasmaFlow != nullptr) - data.RenalPlasmaFlow(std::unique_ptr(m_RenalPlasmaFlow->Unload())); - if (m_RenalVascularResistance != nullptr) - data.RenalVascularResistance(std::unique_ptr(m_RenalVascularResistance->Unload())); - - if (m_RightAfferentArterioleResistance != nullptr) - data.RightAfferentArterioleResistance(std::unique_ptr(m_RightAfferentArterioleResistance->Unload())); - if (m_RightBowmansCapsulesHydrostaticPressure != nullptr) - data.RightBowmansCapsulesHydrostaticPressure(std::unique_ptr(m_RightBowmansCapsulesHydrostaticPressure->Unload())); - if (m_RightBowmansCapsulesOsmoticPressure != nullptr) - data.RightBowmansCapsulesOsmoticPressure(std::unique_ptr(m_RightBowmansCapsulesOsmoticPressure->Unload())); - if (m_RightEfferentArterioleResistance != nullptr) - data.RightEfferentArterioleResistance(std::unique_ptr(m_RightEfferentArterioleResistance->Unload())); - if (m_RightGlomerularCapillariesHydrostaticPressure != nullptr) - data.RightGlomerularCapillariesHydrostaticPressure(std::unique_ptr(m_RightGlomerularCapillariesHydrostaticPressure->Unload())); - if (m_RightGlomerularCapillariesOsmoticPressure != nullptr) - data.RightGlomerularCapillariesOsmoticPressure(std::unique_ptr(m_RightGlomerularCapillariesOsmoticPressure->Unload())); - if (m_RightGlomerularFiltrationCoefficient != nullptr) - data.RightGlomerularFiltrationCoefficient(std::unique_ptr(m_RightGlomerularFiltrationCoefficient->Unload())); - if (m_RightGlomerularFiltrationRate != nullptr) - data.RightGlomerularFiltrationRate(std::unique_ptr(m_RightGlomerularFiltrationRate->Unload())); - if (m_RightGlomerularFiltrationSurfaceArea != nullptr) - data.RightGlomerularFiltrationSurfaceArea(std::unique_ptr(m_RightGlomerularFiltrationSurfaceArea->Unload())); - if (m_RightGlomerularFluidPermeability != nullptr) - data.RightGlomerularFluidPermeability(std::unique_ptr(m_RightGlomerularFluidPermeability->Unload())); - if (m_RightFiltrationFraction != nullptr) - data.RightFiltrationFraction(std::unique_ptr(m_RightFiltrationFraction->Unload())); - if (m_RightNetFiltrationPressure != nullptr) - data.RightNetFiltrationPressure(std::unique_ptr(m_RightNetFiltrationPressure->Unload())); - if (m_RightNetReabsorptionPressure != nullptr) - data.RightNetReabsorptionPressure(std::unique_ptr(m_RightNetReabsorptionPressure->Unload())); - if (m_RightPeritubularCapillariesHydrostaticPressure != nullptr) - data.RightPeritubularCapillariesHydrostaticPressure(std::unique_ptr(m_RightPeritubularCapillariesHydrostaticPressure->Unload())); - if (m_RightPeritubularCapillariesOsmoticPressure != nullptr) - data.RightPeritubularCapillariesOsmoticPressure(std::unique_ptr(m_RightPeritubularCapillariesOsmoticPressure->Unload())); - if (m_RightReabsorptionFiltrationCoefficient != nullptr) - data.RightReabsorptionFiltrationCoefficient(std::unique_ptr(m_RightReabsorptionFiltrationCoefficient->Unload())); - if (m_RightReabsorptionRate != nullptr) - data.RightReabsorptionRate(std::unique_ptr(m_RightReabsorptionRate->Unload())); - if (m_RightTubularReabsorptionFiltrationSurfaceArea != nullptr) - data.RightTubularReabsorptionFiltrationSurfaceArea(std::unique_ptr(m_RightTubularReabsorptionFiltrationSurfaceArea->Unload())); - if (m_RightTubularReabsorptionFluidPermeability != nullptr) - data.RightTubularReabsorptionFluidPermeability(std::unique_ptr(m_RightTubularReabsorptionFluidPermeability->Unload())); - if (m_RightTubularHydrostaticPressure != nullptr) - data.RightTubularHydrostaticPressure(std::unique_ptr(m_RightTubularHydrostaticPressure->Unload())); - if (m_RightTubularOsmoticPressure != nullptr) - data.RightTubularOsmoticPressure(std::unique_ptr(m_RightTubularOsmoticPressure->Unload())); - - if (m_UrinationRate != nullptr) - data.UrinationRate(std::unique_ptr(m_UrinationRate->Unload())); - if (m_UrineOsmolality != nullptr) - data.UrineOsmolality(std::unique_ptr(m_UrineOsmolality->Unload())); - if (m_UrineOsmolarity != nullptr) - data.UrineOsmolarity(std::unique_ptr(m_UrineOsmolarity->Unload())); - if (m_UrineProductionRate != nullptr) - data.UrineProductionRate(std::unique_ptr(m_UrineProductionRate->Unload())); - if (m_MeanUrineOutput != nullptr) - data.MeanUrineOutput(std::unique_ptr(m_MeanUrineOutput->Unload())); - if (m_UrineSpecificGravity != nullptr) - data.UrineSpecificGravity(std::unique_ptr(m_UrineSpecificGravity->Unload())); - if (m_UrineVolume != nullptr) - data.UrineVolume(std::unique_ptr(m_UrineVolume->Unload())); - if (m_UrineUreaNitrogenConcentration != nullptr) - data.UrineUreaNitrogenConcentration(std::unique_ptr(m_UrineUreaNitrogenConcentration->Unload())); -} -//------------------------------------------------------------------------------- - bool SERenalSystem::HasBladderPressure() const { return m_BladderPressure == nullptr ? false : m_BladderPressure->IsValid(); diff --git a/projects/biogears/libBiogears/src/cdm/system/physiology/SERespiratorySystem.cpp b/projects/biogears/libBiogears/src/cdm/system/physiology/SERespiratorySystem.cpp index 4d54fef1d..e04db1582 100644 --- a/projects/biogears/libBiogears/src/cdm/system/physiology/SERespiratorySystem.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/physiology/SERespiratorySystem.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Physiology.h" + #include #include #include @@ -82,13 +84,13 @@ SERespiratorySystem::SERespiratorySystem(Logger* logger) SERespiratorySystem::~SERespiratorySystem() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SERespiratorySystem::Clear() +void SERespiratorySystem::Invalidate() { - SESystem::Clear(); + SESystem::Invalidate(); SAFE_DELETE(m_AlveolarArterialGradient); SAFE_DELETE(m_CarricoIndex); @@ -177,130 +179,6 @@ const SEScalar* SERespiratorySystem::GetScalar(const std::string& name) } //------------------------------------------------------------------------------- -bool SERespiratorySystem::Load(const CDM::RespiratorySystemData& in) -{ - SESystem::Load(in); - - if (in.AlveolarArterialGradient().present()) - GetAlveolarArterialGradient().Load(in.AlveolarArterialGradient().get()); - if (in.CarricoIndex().present()) - GetCarricoIndex().Load(in.CarricoIndex().get()); - if (in.EndTidalCarbonDioxideFraction().present()) - GetEndTidalCarbonDioxideFraction().Load(in.EndTidalCarbonDioxideFraction().get()); - if (in.EndTidalCarbonDioxidePressure().present()) - GetEndTidalCarbonDioxidePressure().Load(in.EndTidalCarbonDioxidePressure().get()); - if (in.ExpiratoryFlow().present()) - GetExpiratoryFlow().Load(in.ExpiratoryFlow().get()); - if (in.InspiratoryExpiratoryRatio().present()) - GetInspiratoryExpiratoryRatio().Load(in.InspiratoryExpiratoryRatio().get()); - if (in.InspiratoryFlow().present()) - GetInspiratoryFlow().Load(in.InspiratoryFlow().get()); - if (in.MeanPleuralPressure().present()) - GetMeanPleuralPressure().Load(in.MeanPleuralPressure().get()); - if (in.PulmonaryCompliance().present()) - GetPulmonaryCompliance().Load(in.PulmonaryCompliance().get()); - if (in.PulmonaryResistance().present()) - GetPulmonaryResistance().Load(in.PulmonaryResistance().get()); - if (in.RespirationCyclePercentComplete().present()) - GetRespirationCyclePercentComplete().Load(in.RespirationCyclePercentComplete().get()); - if (in.RespirationDriverFrequency().present()) - GetRespirationDriverFrequency().Load(in.RespirationDriverFrequency().get()); - if (in.RespirationDriverPressure().present()) - GetRespirationDriverPressure().Load(in.RespirationDriverPressure().get()); - if (in.RespirationMusclePressure().present()) - GetRespirationMusclePressure().Load(in.RespirationMusclePressure().get()); - if (in.RespirationRate().present()) - GetRespirationRate().Load(in.RespirationRate().get()); - if (in.SpecificVentilation().present()) - GetSpecificVentilation().Load(in.SpecificVentilation().get()); - if (in.TargetPulmonaryVentilation().present()) - GetTargetPulmonaryVentilation().Load(in.TargetPulmonaryVentilation().get()); - if (in.TidalVolume().present()) - GetTidalVolume().Load(in.TidalVolume().get()); - if (in.TotalAlveolarVentilation().present()) - GetTotalAlveolarVentilation().Load(in.TotalAlveolarVentilation().get()); - if (in.TotalDeadSpaceVentilation().present()) - GetTotalDeadSpaceVentilation().Load(in.TotalDeadSpaceVentilation().get()); - if (in.LeftLungVolume().present()) - GetLeftLungVolume().Load(in.LeftLungVolume().get()); - if (in.RightLungVolume().present()) - GetRightLungVolume().Load(in.RightLungVolume().get()); - if (in.TotalLungVolume().present()) - GetTotalLungVolume().Load(in.TotalLungVolume().get()); - if (in.TotalPulmonaryVentilation().present()) - GetTotalPulmonaryVentilation().Load(in.TotalPulmonaryVentilation().get()); - if (in.TranspulmonaryPressure().present()) - GetTranspulmonaryPressure().Load(in.TranspulmonaryPressure().get()); - - return true; -} -//------------------------------------------------------------------------------- - -CDM::RespiratorySystemData* SERespiratorySystem::Unload() const -{ - CDM::RespiratorySystemData* data = new CDM::RespiratorySystemData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- - -void SERespiratorySystem::Unload(CDM::RespiratorySystemData& data) const -{ - SESystem::Unload(data); - - if (m_AlveolarArterialGradient != nullptr) - data.AlveolarArterialGradient(std::unique_ptr(m_AlveolarArterialGradient->Unload())); - if (m_CarricoIndex != nullptr) - data.CarricoIndex(std::unique_ptr(m_CarricoIndex->Unload())); - if (m_EndTidalCarbonDioxideFraction != nullptr) - data.EndTidalCarbonDioxideFraction(std::unique_ptr(m_EndTidalCarbonDioxideFraction->Unload())); - if (m_EndTidalCarbonDioxidePressure != nullptr) - data.EndTidalCarbonDioxidePressure(std::unique_ptr(m_EndTidalCarbonDioxidePressure->Unload())); - if (m_ExpiratoryFlow != nullptr) - data.ExpiratoryFlow(std::unique_ptr(m_ExpiratoryFlow->Unload())); - if (m_InspiratoryExpiratoryRatio != nullptr) - data.InspiratoryExpiratoryRatio(std::unique_ptr(m_InspiratoryExpiratoryRatio->Unload())); - if (m_InspiratoryFlow != nullptr) - data.InspiratoryFlow(std::unique_ptr(m_InspiratoryFlow->Unload())); - if (m_MeanPleuralPressure != nullptr) - data.MeanPleuralPressure(std::unique_ptr(m_MeanPleuralPressure->Unload())); - if (m_PulmonaryCompliance != nullptr) - data.PulmonaryCompliance(std::unique_ptr(m_PulmonaryCompliance->Unload())); - if (m_PulmonaryResistance != nullptr) - data.PulmonaryResistance(std::unique_ptr(m_PulmonaryResistance->Unload())); - if (m_RespirationCyclePercentComplete != nullptr) - data.RespirationCyclePercentComplete(std::unique_ptr(m_RespirationCyclePercentComplete->Unload())); - if (m_RespirationDriverFrequency != nullptr) - data.RespirationDriverFrequency(std::unique_ptr(m_RespirationDriverFrequency->Unload())); - if (m_RespirationDriverPressure != nullptr) - data.RespirationDriverPressure(std::unique_ptr(m_RespirationDriverPressure->Unload())); - if (m_RespirationMusclePressure != nullptr) - data.RespirationMusclePressure(std::unique_ptr(m_RespirationMusclePressure->Unload())); - if (m_RespirationRate != nullptr) - data.RespirationRate(std::unique_ptr(m_RespirationRate->Unload())); - if (m_SpecificVentilation != nullptr) - data.SpecificVentilation(std::unique_ptr(m_SpecificVentilation->Unload())); - if (m_TargetPulmonaryVentilation != nullptr) - data.TargetPulmonaryVentilation(std::unique_ptr(m_TargetPulmonaryVentilation->Unload())); - if (m_TidalVolume != nullptr) - data.TidalVolume(std::unique_ptr(m_TidalVolume->Unload())); - if (m_TotalAlveolarVentilation != nullptr) - data.TotalAlveolarVentilation(std::unique_ptr(m_TotalAlveolarVentilation->Unload())); - if (m_TotalDeadSpaceVentilation != nullptr) - data.TotalDeadSpaceVentilation(std::unique_ptr(m_TotalDeadSpaceVentilation->Unload())); - if (m_LeftLungVolume != nullptr) - data.LeftLungVolume(std::unique_ptr(m_LeftLungVolume->Unload())); - if (m_RightLungVolume != nullptr) - data.RightLungVolume(std::unique_ptr(m_RightLungVolume->Unload())); - if (m_TotalLungVolume != nullptr) - data.TotalLungVolume(std::unique_ptr(m_TotalLungVolume->Unload())); - if (m_TotalPulmonaryVentilation != nullptr) - data.TotalPulmonaryVentilation(std::unique_ptr(m_TotalPulmonaryVentilation->Unload())); - if (m_TranspulmonaryPressure != nullptr) - data.TranspulmonaryPressure(std::unique_ptr(m_TranspulmonaryPressure->Unload())); -} -//------------------------------------------------------------------------------- - bool SERespiratorySystem::HasAlveolarArterialGradient() const { return m_AlveolarArterialGradient == nullptr ? false : m_AlveolarArterialGradient->IsValid(); diff --git a/projects/biogears/libBiogears/src/cdm/system/physiology/SETissueSystem.cpp b/projects/biogears/libBiogears/src/cdm/system/physiology/SETissueSystem.cpp index de3be2f69..ed943aba9 100644 --- a/projects/biogears/libBiogears/src/cdm/system/physiology/SETissueSystem.cpp +++ b/projects/biogears/libBiogears/src/cdm/system/physiology/SETissueSystem.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Physiology.h" + #include #include #include @@ -69,10 +71,10 @@ SETissueSystem::SETissueSystem(Logger* logger) //------------------------------------------------------------------------------- SETissueSystem::~SETissueSystem() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SETissueSystem::Clear() +void SETissueSystem::Invalidate() { SAFE_DELETE(m_CarbonDioxideProductionRate); SAFE_DELETE(m_DehydrationFraction); @@ -144,102 +146,6 @@ const SEScalar* SETissueSystem::GetScalar(const std::string& name) return nullptr; } //------------------------------------------------------------------------------- -bool SETissueSystem::Load(const CDM::TissueSystemData& in) -{ - SESystem::Load(in); - if (in.CarbonDioxideProductionRate().present()) - GetCarbonDioxideProductionRate().Load(in.CarbonDioxideProductionRate().get()); - if (in.DehydrationFraction().present()) - GetDehydrationFraction().Load(in.DehydrationFraction().get()); - if (in.ExtracellularFluidVolume().present()) - GetExtracellularFluidVolume().Load(in.ExtracellularFluidVolume().get()); - if (in.ExtravascularFluidVolume().present()) - GetExtravascularFluidVolume().Load(in.ExtravascularFluidVolume().get()); - if (in.IntracellularFluidPH().present()) - GetIntracellularFluidPH().Load(in.IntracellularFluidPH().get()); - if (in.IntracellularFluidVolume().present()) - GetIntracellularFluidVolume().Load(in.IntracellularFluidVolume().get()); - if (in.TotalBodyFluidVolume().present()) - GetTotalBodyFluidVolume().Load(in.TotalBodyFluidVolume().get()); - if (in.OxygenConsumptionRate().present()) - GetOxygenConsumptionRate().Load(in.OxygenConsumptionRate().get()); - if (in.RespiratoryExchangeRatio().present()) - GetRespiratoryExchangeRatio().Load(in.RespiratoryExchangeRatio().get()); - if (in.LiverInsulinSetPoint().present()) - GetLiverInsulinSetPoint().Load(in.LiverInsulinSetPoint().get()); - if (in.LiverGlucagonSetPoint().present()) - GetLiverGlucagonSetPoint().Load(in.LiverGlucagonSetPoint().get()); - if (in.MuscleInsulinSetPoint().present()) - GetMuscleInsulinSetPoint().Load(in.MuscleInsulinSetPoint().get()); - if (in.MuscleGlucagonSetPoint().present()) - GetMuscleGlucagonSetPoint().Load(in.MuscleGlucagonSetPoint().get()); - if (in.FatInsulinSetPoint().present()) - GetFatInsulinSetPoint().Load(in.FatInsulinSetPoint().get()); - if (in.FatGlucagonSetPoint().present()) - GetFatGlucagonSetPoint().Load(in.FatGlucagonSetPoint().get()); - if (in.LiverGlycogen().present()) - GetLiverGlycogen().Load(in.LiverGlycogen().get()); - if (in.MuscleGlycogen().present()) - GetMuscleGlycogen().Load(in.MuscleGlycogen().get()); - if (in.StoredProtein().present()) - GetStoredProtein().Load(in.StoredProtein().get()); - if (in.StoredFat().present()) - GetStoredFat().Load(in.StoredFat().get()); - - return true; -} -//------------------------------------------------------------------------------- -CDM::TissueSystemData* SETissueSystem::Unload() const -{ - CDM::TissueSystemData* data = new CDM::TissueSystemData(); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SETissueSystem::Unload(CDM::TissueSystemData& data) const -{ - if (m_CarbonDioxideProductionRate != nullptr) - data.CarbonDioxideProductionRate(std::unique_ptr(m_CarbonDioxideProductionRate->Unload())); - if (m_DehydrationFraction != nullptr) - data.DehydrationFraction(std::unique_ptr(m_DehydrationFraction->Unload())); - if (m_ExtracellularFluidVolume != nullptr) - data.ExtracellularFluidVolume(std::unique_ptr(m_ExtracellularFluidVolume->Unload())); - if (m_ExtravascularFluidVolume != nullptr) - data.ExtravascularFluidVolume(std::unique_ptr(m_ExtravascularFluidVolume->Unload())); - if (m_IntracellularFluidPH != nullptr) - data.IntracellularFluidPH(std::unique_ptr(m_IntracellularFluidPH->Unload())); - if (m_IntracellularFluidVolume != nullptr) - data.IntracellularFluidVolume(std::unique_ptr(m_IntracellularFluidVolume->Unload())); - if (m_TotalBodyFluidVolume != nullptr) - data.TotalBodyFluidVolume(std::unique_ptr(m_TotalBodyFluidVolume->Unload())); - if (m_OxygenConsumptionRate != nullptr) - data.OxygenConsumptionRate(std::unique_ptr(m_OxygenConsumptionRate->Unload())); - if (m_RespiratoryExchangeRatio != nullptr) - data.RespiratoryExchangeRatio(std::unique_ptr(m_RespiratoryExchangeRatio->Unload())); - if (m_LiverInsulinSetPoint != nullptr) - data.LiverInsulinSetPoint(std::unique_ptr(m_LiverInsulinSetPoint->Unload())); - if (m_LiverGlucagonSetPoint != nullptr) - data.LiverGlucagonSetPoint(std::unique_ptr(m_LiverGlucagonSetPoint->Unload())); - if (m_MuscleInsulinSetPoint != nullptr) - data.MuscleInsulinSetPoint(std::unique_ptr(m_MuscleInsulinSetPoint->Unload())); - if (m_MuscleGlucagonSetPoint != nullptr) - data.MuscleGlucagonSetPoint(std::unique_ptr(m_MuscleGlucagonSetPoint->Unload())); - if (m_FatInsulinSetPoint != nullptr) - data.FatInsulinSetPoint(std::unique_ptr(m_FatInsulinSetPoint->Unload())); - if (m_FatGlucagonSetPoint != nullptr) - data.FatGlucagonSetPoint(std::unique_ptr(m_FatGlucagonSetPoint->Unload())); - if (m_LiverGlycogen != nullptr) - data.LiverGlycogen(std::unique_ptr(m_LiverGlycogen->Unload())); - if (m_MuscleGlycogen != nullptr) - data.MuscleGlycogen(std::unique_ptr(m_MuscleGlycogen->Unload())); - if (m_StoredProtein != nullptr) - data.StoredProtein(std::unique_ptr(m_StoredProtein->Unload())); - if (m_StoredFat != nullptr) - data.StoredFat(std::unique_ptr(m_StoredFat->Unload())); - - SESystem::Unload(data); -} -//------------------------------------------------------------------------------- bool SETissueSystem::HasCarbonDioxideProductionRate() const { return m_CarbonDioxideProductionRate == nullptr ? false : m_CarbonDioxideProductionRate->IsValid(); diff --git a/projects/biogears/libBiogears/src/cdm/utils/DataTrack.cpp b/projects/biogears/libBiogears/src/cdm/utils/DataTrack.cpp index 029d4434b..31658c9e3 100644 --- a/projects/biogears/libBiogears/src/cdm/utils/DataTrack.cpp +++ b/projects/biogears/libBiogears/src/cdm/utils/DataTrack.cpp @@ -30,7 +30,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include #include namespace biogears { @@ -76,10 +76,10 @@ DataTrack& DataTrack::operator=(DataTrack&& rhs) DataTrack::~DataTrack() { - Clear(); + Invalidate(); } -void DataTrack::Clear() +void DataTrack::Invalidate() { Reset(); if (m_FileStream.is_open()) @@ -172,9 +172,9 @@ void DataTrack::Probe(const SEFluidCircuit& c) } for (SEFluidCircuitPath* p : c.GetPaths()) { if (p->HasSwitch()) - Probe(std::string { p->GetName() } + "_Switch", p->GetSwitch() == CDM::enumOpenClosed::Open ? 1 : 0); + Probe(std::string { p->GetName() } + "_Switch", p->GetSwitch() == SEOpenClosed::Open ? 1 : 0); if (p->HasValve()) - Probe(std::string { p->GetName() } + "_Valve", p->GetValve() == CDM::enumOpenClosed::Closed ? 1 : 0); + Probe(std::string { p->GetName() } + "_Valve", p->GetValve() == SEOpenClosed::Closed ? 1 : 0); if (p->HasResistance()) { auto unit = p->GetResistance().GetUnit(); @@ -217,9 +217,9 @@ void DataTrack::Probe(const SEThermalCircuit& c) } for (SEThermalCircuitPath* p : c.GetPaths()) { if (p->HasSwitch()) - Probe(std::string { p->GetName() } + "_Switch", p->GetSwitch() == CDM::enumOpenClosed::Open ? 1 : 0); + Probe(std::string { p->GetName() } + "_Switch", p->GetSwitch() == SEOpenClosed::Open ? 1 : 0); if (p->HasValve()) - Probe(std::string { p->GetName() } + "_Valve", p->GetValve() == CDM::enumOpenClosed::Closed ? 1 : 0); + Probe(std::string { p->GetName() } + "_Valve", p->GetValve() == SEOpenClosed::Closed ? 1 : 0); if (p->HasResistance()) { auto unit = p->GetResistance().GetUnit(); @@ -262,9 +262,9 @@ void DataTrack::Probe(const SEElectricalCircuit& c) } for (SEElectricalCircuitPath* p : c.GetPaths()) { if (p->HasSwitch()) - Probe(std::string { p->GetName() } + "_Switch", p->GetSwitch() == CDM::enumOpenClosed::Open ? 1 : 0); + Probe(std::string { p->GetName() } + "_Switch", p->GetSwitch() == SEOpenClosed::Open ? 1 : 0); if (p->HasValve()) - Probe(std::string { p->GetName() } + "_Valve", p->GetValve() == CDM::enumOpenClosed::Closed ? 1 : 0); + Probe(std::string { p->GetName() } + "_Valve", p->GetValve() == SEOpenClosed::Closed ? 1 : 0); if (p->HasResistance()) { auto unit = p->GetResistance().GetUnit(); @@ -399,9 +399,9 @@ void DataTrack::Track(double time_s, const SEElectricalCircuit& c) } for (SEElectricalCircuitPath* p : c.GetPaths()) { if (p->HasSwitch()) - Track(std::string { p->GetName() } + "_Switch", time_s, p->GetSwitch() == CDM::enumOpenClosed::Open ? 1 : 0); + Track(std::string { p->GetName() } + "_Switch", time_s, p->GetSwitch() == SEOpenClosed::Open ? 1 : 0); if (p->HasValve()) - Track(std::string { p->GetName() } + "_Valve", time_s, p->GetValve() == CDM::enumOpenClosed::Closed ? 1 : 0); + Track(std::string { p->GetName() } + "_Valve", time_s, p->GetValve() == SEOpenClosed::Closed ? 1 : 0); if (p->HasResistance()) { auto unit = p->GetResistance().GetUnit(); @@ -443,9 +443,9 @@ void DataTrack::Track(double time_s, const SEFluidCircuit& c) } for (SEFluidCircuitPath* p : c.GetPaths()) { if (p->HasSwitch()) - Track(std::string { p->GetName() } + "_Switch", time_s, p->GetSwitch() == CDM::enumOpenClosed::Open ? 1 : 0); + Track(std::string { p->GetName() } + "_Switch", time_s, p->GetSwitch() == SEOpenClosed::Open ? 1 : 0); if (p->HasValve()) - Track(std::string { p->GetName() } + "_Valve", time_s, p->GetValve() == CDM::enumOpenClosed::Closed ? 1 : 0); + Track(std::string { p->GetName() } + "_Valve", time_s, p->GetValve() == SEOpenClosed::Closed ? 1 : 0); if (p->HasResistance()) { auto unit = p->GetResistance().GetUnit(); @@ -487,9 +487,9 @@ void DataTrack::Track(double time_s, const SEThermalCircuit& c) } for (SEThermalCircuitPath* p : c.GetPaths()) { if (p->HasSwitch()) - Track(std::string { p->GetName() } + "_Switch", time_s, p->GetSwitch() == CDM::enumOpenClosed::Open ? 1 : 0); + Track(std::string { p->GetName() } + "_Switch", time_s, p->GetSwitch() == SEOpenClosed::Open ? 1 : 0); if (p->HasValve()) - Track(std::string { p->GetName() } + "_Valve", time_s, p->GetValve() == CDM::enumOpenClosed::Closed ? 1 : 0); + Track(std::string { p->GetName() } + "_Valve", time_s, p->GetValve() == SEOpenClosed::Closed ? 1 : 0); if (p->HasResistance()) { auto unit = p->GetResistance().GetUnit(); diff --git a/projects/biogears/libBiogears/src/cdm/utils/GeneralMath.cpp b/projects/biogears/libBiogears/src/cdm/utils/GeneralMath.cpp index 352e51bf1..907fe8795 100644 --- a/projects/biogears/libBiogears/src/cdm/utils/GeneralMath.cpp +++ b/projects/biogears/libBiogears/src/cdm/utils/GeneralMath.cpp @@ -14,6 +14,7 @@ specific language governing permissions and limitations under the License. //Standard Includes #include //Project Includes +#include #include #include #include @@ -117,7 +118,7 @@ void GeneralMath::CalculateMass(const SEScalarVolume& volume, const SEScalarMass void GeneralMath::CalculateHenrysLawConcentration(const SESubstance& substance, const SEScalarPressure& partialPressure, SEScalarMassPerVolume& concentration, Logger* logger) { double pp_mmHg = partialPressure.GetValue(PressureUnit::mmHg); - if (substance.GetState() != CDM::enumSubstanceState::Gas) + if (substance.GetState() != SESubstanceState::Gas) throw CommonDataModelException("Cannot calculate a molarity by Henry's law from partial pressure of a non gaseous substance in a liquid"); if (pp_mmHg < 0.0) { std::stringstream ss; @@ -173,7 +174,7 @@ void GeneralMath::CalculatePartialPressureInGas(const SEScalarFraction& volumeFr //-------------------------------------------------------------------------------------------------- void GeneralMath::CalculatePartialPressureInLiquid(const SESubstance& substance, const SEScalarMassPerVolume& concentration, SEScalarPressure& partialPressure, Logger* logger) { - if (substance.GetState() != CDM::enumSubstanceState::Gas) + if (substance.GetState() != SESubstanceState::Gas) throw CommonDataModelException("Cannot calculate a partial pressure of a non gaseous substance in a liquid"); double concentration_ug_Per_mL = concentration.GetValue(MassPerVolumeUnit::ug_Per_mL); if (concentration_ug_Per_mL < 0.0) { @@ -414,9 +415,9 @@ double GeneralMath::CalculateNernstPotential(SELiquidCompartment& extra, SELiqui double intraIon_M = intra.GetSubstanceQuantity(*ion)->GetMolarity(AmountPerVolumeUnit::mol_Per_L); double extraIon_M = extra.GetSubstanceQuantity(*ion)->GetMolarity(AmountPerVolumeUnit::mol_Per_L); double z = 1.0; - if (ion->GetName() == "Chloride") + if (ion->GetName() == StandardSubstances::Chloride) z = -1.0; - if (ion->GetName() == "Calcium") + if (ion->GetName() == StandardSubstances::Calcium) z = 2.0; double nernst_V = (gasConstant_J_Per_mol * coreTemp_K) / (faradaysConstant_C_Per_mol * z) * log(extraIon_M / intraIon_M); diff --git a/projects/biogears/libBiogears/src/cdm/utils/Logger.cpp b/projects/biogears/libBiogears/src/cdm/utils/Logger.cpp index 4434166aa..f1dc73934 100644 --- a/projects/biogears/libBiogears/src/cdm/utils/Logger.cpp +++ b/projects/biogears/libBiogears/src/cdm/utils/Logger.cpp @@ -537,6 +537,14 @@ void Logger::LogMessage(std::istream& msg, std::string const& origin, LogLevel p break; case Logger::eStabilization: break; + case Logger::eFatal: + impl.userDefinedLogger->Error(message.c_str()); + break; + case Logger::eAll: + impl.userDefinedLogger->Info(message.c_str()); + break; + default: + break; } } switch (priority) { @@ -556,6 +564,14 @@ void Logger::LogMessage(std::istream& msg, std::string const& origin, LogLevel p break; case Logger::eStabilization: break; + case Logger::eFatal: + forward_to_logcat(ANDROID_LOG_ERROR, message.c_str()); + break; + case Logger::eAll: + forward_to_logcat(ANDROID_LOG_INFO, message.c_str()); + break; + default: + break; } } void Logger::LogMessage(std::istream&& msg, std::string const& origin, LogLevel priority) const @@ -607,11 +623,18 @@ void Logger::LogMessage(std::istream&& msg, std::string const& origin, LogLevel impl.userDefinedLogger->Warning(message.c_str()); break; case Logger::eInfo: - impl.userDefinedLogger->Info(message.c_str()); break; case Logger::eStabilization: break; + case Logger::eFatal: + impl.userDefinedLogger->Error(message.c_str()); + break; + case Logger::eAll: + impl.userDefinedLogger->Info(message.c_str()); + break; + default: + break; } } switch (priority) { @@ -631,6 +654,14 @@ void Logger::LogMessage(std::istream&& msg, std::string const& origin, LogLevel break; case Logger::eStabilization: break; + case Logger::eFatal: + forward_to_logcat(ANDROID_LOG_ERROR, message.c_str()); + break; + case Logger::eAll: + forward_to_logcat(ANDROID_LOG_INFO, message.c_str()); + break; + default: + break; } } @@ -682,6 +713,14 @@ void Logger::LogMessage(std::string const& msg, std::string const& origin, LogLe break; case Logger::eStabilization: break; + case Logger::eFatal: + impl.userDefinedLogger->Error(msg.c_str()); + break; + case Logger::eAll: + impl.userDefinedLogger->Info(msg.c_str()); + break; + default: + break; } } switch (priority) { @@ -701,6 +740,14 @@ void Logger::LogMessage(std::string const& msg, std::string const& origin, LogLe break; case Logger::eStabilization: break; + case Logger::eFatal: + forward_to_logcat(ANDROID_LOG_ERROR, msg.c_str()); + break; + case Logger::eAll: + forward_to_logcat(ANDROID_LOG_INFO, msg.c_str()); + break; + default: + break; } } void Logger::LogMessage(std::string&& msg, std::string const& origin, LogLevel priority) const @@ -751,6 +798,14 @@ void Logger::LogMessage(std::string&& msg, std::string const& origin, LogLevel p break; case Logger::eStabilization: break; + case Logger::eFatal: + impl.userDefinedLogger->Error(msg.c_str()); + break; + case Logger::eAll: + impl.userDefinedLogger->Info(msg.c_str()); + break; + default: + break; } } switch (priority) { @@ -770,6 +825,14 @@ void Logger::LogMessage(std::string&& msg, std::string const& origin, LogLevel p break; case Logger::eStabilization: break; + case Logger::eFatal: + forward_to_logcat(ANDROID_LOG_ERROR, msg.c_str()); + break; + case Logger::eAll: + forward_to_logcat(ANDROID_LOG_INFO, msg.c_str()); + break; + default: + break; } } diff --git a/projects/biogears/libBiogears/src/cdm/utils/RunningAverage.cpp b/projects/biogears/libBiogears/src/cdm/utils/RunningAverage.cpp index da377ba75..46e48636a 100644 --- a/projects/biogears/libBiogears/src/cdm/utils/RunningAverage.cpp +++ b/projects/biogears/libBiogears/src/cdm/utils/RunningAverage.cpp @@ -15,6 +15,7 @@ specific language governing permissions and limitations under the License. //Project Includes #include +#include "io/cdm/Property.h" namespace biogears { RunningAverage::RunningAverage() @@ -26,24 +27,6 @@ RunningAverage::~RunningAverage() { } -bool RunningAverage::Load(const CDM::RunningAverageData& in) -{ - m_Sum = in.sum(); - m_NumSamples = in.numSamples(); - return true; -} -CDM::RunningAverageData* RunningAverage::Unload() const -{ - CDM::RunningAverageData* data = new CDM::RunningAverageData(); - Unload(*data); - return data; -} -void RunningAverage::Unload(CDM::RunningAverageData& data) const -{ - data.sum(m_Sum); - data.numSamples(m_NumSamples); -} - void RunningAverage::Reset() { m_Sum = 0.0; diff --git a/projects/biogears/libBiogears/src/cdm/utils/TimingProfile.cpp b/projects/biogears/libBiogears/src/cdm/utils/TimingProfile.cpp index d8204b061..6b6aa5d31 100644 --- a/projects/biogears/libBiogears/src/cdm/utils/TimingProfile.cpp +++ b/projects/biogears/libBiogears/src/cdm/utils/TimingProfile.cpp @@ -35,7 +35,7 @@ TimingProfile::~TimingProfile() { } -void TimingProfile::Clear() +void TimingProfile::Invalidate() { m_timers.clear(); } diff --git a/projects/biogears/libBiogears/src/cdm/utils/testing/SETestCase.cpp b/projects/biogears/libBiogears/src/cdm/utils/testing/SETestCase.cpp index 4d1c64304..d86b838c6 100644 --- a/projects/biogears/libBiogears/src/cdm/utils/testing/SETestCase.cpp +++ b/projects/biogears/libBiogears/src/cdm/utils/testing/SETestCase.cpp @@ -1,3 +1,4 @@ + /************************************************************************************** Copyright 2015 Applied Research Associates, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use @@ -15,6 +16,8 @@ specific language governing permissions and limitations under the License. #include #include +#include "io/cdm/Property.h" + namespace biogears { SETestCase::SETestCase(Logger* logger) : Loggable(logger) @@ -30,10 +33,10 @@ SETestCase::SETestCase(const std::string& name, Logger* logger) //----------------------------------------------------------------------------- SETestCase::~SETestCase() { - Clear(); + Invalidate(); } //----------------------------------------------------------------------------- -void SETestCase::Clear() +void SETestCase::Invalidate() { m_Failure.clear(); DELETE_VECTOR(m_CaseEqualsErrors); @@ -46,53 +49,6 @@ void SETestCase::Reset() DELETE_VECTOR(m_CaseEqualsErrors); } //----------------------------------------------------------------------------- -bool SETestCase::Load(const CDM::TestCaseData& in) -{ - Reset(); - - m_Name = in.Name(); - GetDuration().Load(in.Duration()); - - SETestErrorStatistics* ex; - CDM::TestErrorStatisticsData* eData; - for (unsigned int i = 0; i < in.CaseEqualError().size(); i++) { - eData = (CDM::TestErrorStatisticsData*)&in.CaseEqualError().at(i); - if (eData != nullptr) { - ex = new SETestErrorStatistics(GetLogger()); - ex->Load(*eData); - } - m_CaseEqualsErrors.push_back(ex); - } - - for (unsigned int i = 0; i < in.Failure().size(); i++) { - m_Failure.push_back(in.Failure().at(i)); - } - - return true; -} -//----------------------------------------------------------------------------- -std::unique_ptr SETestCase::Unload() const -{ - std::unique_ptr data(new CDM::TestCaseData()); - Unload(*data); - return data; -} -//----------------------------------------------------------------------------- -void SETestCase::Unload(CDM::TestCaseData& data) const -{ - data.Name(m_Name); - - data.Duration(std::unique_ptr(m_Duration.Unload())); - - for (unsigned int i = 0; i < m_Failure.size(); i++) { - data.Failure().push_back(m_Failure.at(i)); - } - - for (unsigned int i = 0; i < m_CaseEqualsErrors.size(); i++) { - data.CaseEqualError().push_back(*m_CaseEqualsErrors.at(i)->Unload()); - } -} -//----------------------------------------------------------------------------- void SETestCase::SetName(const std::string& Name) { m_Name = Name; diff --git a/projects/biogears/libBiogears/src/cdm/utils/testing/SETestErrorStatistics.cpp b/projects/biogears/libBiogears/src/cdm/utils/testing/SETestErrorStatistics.cpp index d896e77f6..a684da84b 100644 --- a/projects/biogears/libBiogears/src/cdm/utils/testing/SETestErrorStatistics.cpp +++ b/projects/biogears/libBiogears/src/cdm/utils/testing/SETestErrorStatistics.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Property.h" + #include #include @@ -24,10 +26,10 @@ SETestErrorStatistics::SETestErrorStatistics(Logger* logger) //------------------------------------------------------------------------------- SETestErrorStatistics::~SETestErrorStatistics() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SETestErrorStatistics::Clear() +void SETestErrorStatistics::Invalidate() { SAFE_DELETE(m_PercentToleranceVsNumErrors); } @@ -35,65 +37,7 @@ void SETestErrorStatistics::Clear() void SETestErrorStatistics::Reset() { } -//------------------------------------------------------------------------------- -bool SETestErrorStatistics::Load(const CDM::TestErrorStatisticsData& in) -{ - Reset(); - m_MinimumError = in.MinimumError().get(); - m_MaximumError = in.MaximumError().get(); - m_AverageError = in.AverageError().get(); - m_StandardDeviation = in.StandardDeviation().get(); - std::string dData; - for (unsigned int i = 0; i < in.Differences().size(); i++) { - dData = (std::string)in.Differences().at(i); - if (!dData.empty()) - m_Differences.push_back(dData); - } - m_ComputedPropertyID = in.ComputedPropertyID(); - m_ExpectedPropertyID = in.ExpectedPropertyID(); - m_NumberOfErrors = in.NumberOfErrors().get(); - m_PercentTolerance = in.PercentTolerance(); - m_PropertyName = in.PropertyName(); - return IsValid(); -} -//------------------------------------------------------------------------------- -std::unique_ptr SETestErrorStatistics::Unload() const -{ - std::unique_ptr data(new CDM::TestErrorStatisticsData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SETestErrorStatistics::Unload(CDM::TestErrorStatisticsData& data) const -{ - if (!std::isnan(m_MinimumError)) - data.MinimumError(m_MinimumError); - if (!std::isnan(m_MaximumError)) - data.MaximumError(m_MaximumError); - if (!std::isnan(m_AverageError)) - data.AverageError(m_AverageError); - if (!std::isnan(m_StandardDeviation)) - data.StandardDeviation(m_StandardDeviation); - - std::string dData; - for (unsigned int i = 0; i < m_Differences.size(); i++) { - dData = m_Differences.at(i); - if (!dData.empty()) - data.Differences().push_back(dData); - } - if (!m_ComputedPropertyID.empty()) - data.ComputedPropertyID(m_ComputedPropertyID); - if (!m_ExpectedPropertyID.empty()) - data.ExpectedPropertyID(m_ExpectedPropertyID); - data.NumberOfErrors(m_NumberOfErrors); - data.PercentTolerance(m_PercentTolerance); - if (!m_PropertyName.empty()) - data.PropertyName(m_PropertyName); - if (m_PercentToleranceVsNumErrors != nullptr) { - data.PercentToleranceVsNumErrors(std::unique_ptr(m_PercentToleranceVsNumErrors->Unload())); - } -} //------------------------------------------------------------------------------- bool SETestErrorStatistics::IsValid() { diff --git a/projects/biogears/libBiogears/src/cdm/utils/testing/SETestReport.cpp b/projects/biogears/libBiogears/src/cdm/utils/testing/SETestReport.cpp index ca6a98f42..f190da056 100644 --- a/projects/biogears/libBiogears/src/cdm/utils/testing/SETestReport.cpp +++ b/projects/biogears/libBiogears/src/cdm/utils/testing/SETestReport.cpp @@ -19,6 +19,8 @@ specific language governing permissions and limitations under the License. #include #include +#include "io/cdm/TestReport.h" + namespace biogears { SETestReport::SETestReport(Logger* logger) : Loggable(logger) @@ -28,10 +30,10 @@ SETestReport::SETestReport(Logger* logger) //------------------------------------------------------------------------------- SETestReport::~SETestReport() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SETestReport::Clear() +void SETestReport::Invalidate() { DELETE_VECTOR(m_testSuite); } @@ -39,38 +41,7 @@ void SETestReport::Clear() void SETestReport::Reset() { } -//------------------------------------------------------------------------------- -bool SETestReport::Load(const CDM::TestReportData& in) -{ - Reset(); - SETestSuite* sx; - CDM::TestSuiteData* sData; - for (unsigned int i = 0; i < in.TestSuite().size(); i++) { - sData = (CDM::TestSuiteData*)&in.TestSuite().at(i); - if (sData != nullptr) { - sx = new SETestSuite(GetLogger()); - sx->Load(*sData); - } - m_testSuite.push_back(sx); - } - - return true; -} -//------------------------------------------------------------------------------- -std::unique_ptr SETestReport::Unload() const -{ - std::unique_ptr data(new CDM::TestReportData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SETestReport::Unload(CDM::TestReportData& data) const -{ - for (unsigned int i = 0; i < m_testSuite.size(); i++) { - data.TestSuite().push_back(*m_testSuite.at(i)->Unload()); - } -} //------------------------------------------------------------------------------- bool SETestReport::WriteFile(const std::string& fileName) { @@ -82,7 +53,8 @@ bool SETestReport::WriteFile(const std::string& fileName) std::ofstream outFile; auto io = m_Logger->GetIoManager().lock(); outFile.open(io->ResolveLogFileLocation(fileName)); - std::unique_ptr unloaded = Unload(); + auto unloaded = std::make_unique(); + io::TestReport::Marshall(*this, *unloaded); CDM::TestReport(outFile, *unloaded, map); } catch (const xml_schema::exception& e) { Error(e.what()); diff --git a/projects/biogears/libBiogears/src/cdm/utils/testing/SETestSuite.cpp b/projects/biogears/libBiogears/src/cdm/utils/testing/SETestSuite.cpp index 892940217..795c7ea67 100644 --- a/projects/biogears/libBiogears/src/cdm/utils/testing/SETestSuite.cpp +++ b/projects/biogears/libBiogears/src/cdm/utils/testing/SETestSuite.cpp @@ -12,6 +12,8 @@ specific language governing permissions and limitations under the License. #include #include +#include "io/cdm/Property.h" + #include #include #include @@ -26,10 +28,10 @@ SETestSuite::SETestSuite(Logger* logger) //------------------------------------------------------------------------------- SETestSuite::~SETestSuite() { - Clear(); + Invalidate(); } //------------------------------------------------------------------------------- -void SETestSuite::Clear() +void SETestSuite::Invalidate() { DELETE_VECTOR(m_SuiteEqualError); DELETE_VECTOR(m_TestCase); @@ -44,77 +46,6 @@ void SETestSuite::Reset() m_Name = ""; } //------------------------------------------------------------------------------- -bool SETestSuite::Load(const CDM::TestSuiteData& in) -{ - Reset(); - - std::string sData; - for (unsigned int i = 0; i < in.Requirement().size(); i++) { - sData = (std::string)in.Requirement().at(i); - if (!sData.empty()) - m_Requirements.push_back(sData); - } - - SETestErrorStatistics* ex; - CDM::TestErrorStatisticsData* eData; - for (unsigned int i = 0; i < in.SuiteEqualError().size(); i++) { - eData = (CDM::TestErrorStatisticsData*)&in.SuiteEqualError().at(i); - if (eData != nullptr) { - ex = new SETestErrorStatistics(GetLogger()); - ex->Load(*eData); - } - m_SuiteEqualError.push_back(ex); - } - - SETestCase* tx; - CDM::TestCaseData* tData; - for (unsigned int i = 0; i < in.TestCase().size(); i++) { - tData = (CDM::TestCaseData*)&in.SuiteEqualError().at(i); - if (tData != nullptr) { - tx = new SETestCase(m_Name, GetLogger()); - tx->Load(*tData); - } - m_TestCase.push_back(tx); - } - m_Performed = in.Performed(); - m_Name = in.Name(); - - return true; -} -//------------------------------------------------------------------------------- -std::unique_ptr SETestSuite::Unload() const -{ - std::unique_ptr data(new CDM::TestSuiteData()); - Unload(*data); - return data; -} -//------------------------------------------------------------------------------- -void SETestSuite::Unload(CDM::TestSuiteData& data) const -{ - std::string sData; - for (unsigned int i = 0; i < m_Requirements.size(); i++) { - sData = m_Requirements.at(i); - if (!sData.empty()) - data.Requirement().push_back(sData); - } - for (unsigned int i = 0; i < m_SuiteEqualError.size(); i++) { - data.SuiteEqualError().push_back(*m_SuiteEqualError.at(i)->Unload()); - } - for (unsigned int i = 0; i < m_TestCase.size(); i++) { - data.TestCase().push_back(*m_TestCase.at(i)->Unload()); - } - - data.Performed(m_Performed); - if (GetNumberOfTests() != 0) { - data.Tests(GetNumberOfTests()); - data.Duration(std::unique_ptr(GetDuration().Unload())); - data.Errors(GetNumberOfErrors()); - } - - if (m_Name.compare("") != 0) - data.Name(m_Name); -} -//------------------------------------------------------------------------------- void SETestSuite::SetName(const std::string& Name) { m_Name = Name; diff --git a/projects/biogears/libBiogears/src/engine/BioGearsPhysiologyEngine.cpp b/projects/biogears/libBiogears/src/engine/BioGearsPhysiologyEngine.cpp index 47c248a7c..81309c854 100644 --- a/projects/biogears/libBiogears/src/engine/BioGearsPhysiologyEngine.cpp +++ b/projects/biogears/libBiogears/src/engine/BioGearsPhysiologyEngine.cpp @@ -1,9 +1,12 @@ #include #include +#include +#include -#include +#include +#include namespace biogears { std::unique_ptr CreateBioGearsEngine(Logger* logger) diff --git a/projects/biogears/libBiogears/src/engine/Controller/BioGears.cpp b/projects/biogears/libBiogears/src/engine/Controller/BioGears.cpp index f5c25a48e..42d199f77 100644 --- a/projects/biogears/libBiogears/src/engine/Controller/BioGears.cpp +++ b/projects/biogears/libBiogears/src/engine/Controller/BioGears.cpp @@ -11,14 +11,18 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Patient.h" +#include "io/cdm/Environment.h" + #include +#include #include #include #include #include +#include #include #include -#include #include #include #include @@ -44,8 +48,6 @@ specific language governing permissions and limitations under the License. #include #include -namespace BGE = mil::tatrc::physiology::biogears; - namespace biogears { BioGears::BioGears(const std::string& logFileName) : BioGears(new Logger(logFileName)) @@ -102,8 +104,8 @@ void BioGears::SetUp() m_Patient = std::make_unique(GetLogger()); - m_Config = std::make_unique(*m_Substances); - m_Config->Initialize(); + m_Configuration = std::make_unique(*m_Substances); + m_Configuration->Initialize(); m_SaturationCalculator = SaturationCalculator::make_unique(*this); @@ -129,9 +131,14 @@ void BioGears::SetUp() m_AnesthesiaMachine = AnesthesiaMachine::make_unique(*this); m_Inhaler = Inhaler::make_unique(*this); - + try { m_Compartments = BioGearsCompartments::make_unique(*this); + } + catch (CommonDataModelException ex) { + std::cout << ex.what() << std::endl; + } + m_Circuits = BioGearsCircuits::make_unique(*this); m_DiffusionCalculator = DiffusionCalculator::make_unique(*this); @@ -154,25 +161,29 @@ bool BioGears::Initialize(const PhysiologyEngineConfiguration* config) // to any substance child objects, those will need to be fixed up, if they exist Info("Initializing Configuration"); - m_Config->Initialize(); // Load up Defaults + m_Configuration->Initialize(); // Load up Defaults if (config != nullptr) { Info("Merging Provided Configuration"); - m_Config->Merge(*config); + m_Configuration->Merge(*config); } // Now, Let's see if there is anything to merge into our base configuration Info("Merging OnDisk Configuration"); BioGearsConfiguration cFile(*m_Substances); cFile.Load("BioGearsConfiguration.xml"); - m_Config->Merge(cFile); + m_Configuration->Merge(cFile); // Now we can check the config - if (m_Config->WritePatientBaselineFile()) { + if (m_Configuration->WritePatientBaselineFile()) { auto io = GetLogger()->GetIoManager().lock(); std::string stableDir = io->GetBioGearsWorkingDirectory() += "/stable/"; filesystem::create_directories(stableDir); - CDM::PatientData* pData = m_Patient->Unload(); + auto pData = std::make_unique(); + + io::Patient::Marshall(*m_Patient, *pData); + pData->contentVersion(branded_version_string()); + // Write out the stable patient state std::ofstream stream(stableDir + m_Patient->GetName() + ".xml"); // Write out the xml file @@ -180,21 +191,20 @@ bool BioGears::Initialize(const PhysiologyEngineConfiguration* config) map[""].name = "uri:/mil/tatrc/physiology/datamodel"; Patient(stream, *pData, map); stream.close(); - SAFE_DELETE(pData); } m_SaturationCalculator->Initialize(*m_Substances); - m_Actions->Clear(); - m_Conditions->Clear(); + m_Actions->Invalidate(); + m_Conditions->Invalidate(); // This will also Initialize the environment // Due to needing the initial environment values for circuits to construct properly Info("Creating Circuits and Compartments"); CreateCircuitsAndCompartments(); - m_AirwayMode = CDM::enumBioGearsAirwayMode::Free; - m_Intubation = CDM::enumOnOff::Off; + m_AirwayMode = SEBioGearsAirwayMode::Free; + m_Intubation = SEOnOff::Off; m_CurrentTime->SetValue(0, TimeUnit::s); m_SimulationTime->SetValue(0, TimeUnit::s); GetLogger()->SetLogTime(m_SimulationTime.get()); @@ -202,7 +212,7 @@ bool BioGears::Initialize(const PhysiologyEngineConfiguration* config) Info("Initializing Substances"); m_Substances->InitializeSubstances(); // Sets all concentrations and such of all substances for all compartments, need to do this after we figure out what's in the environment - //Note: Diffusion Calculator is initialized in Tissue::SetUp because it depends on so many Tissue parameters + // Note: Diffusion Calculator is initialized in Tissue::SetUp because it depends on so many Tissue parameters Info("Initializing Systems"); m_CardiovascularSystem->Initialize(); @@ -223,41 +233,41 @@ bool BioGears::Initialize(const PhysiologyEngineConfiguration* config) return true; } -void BioGears::SetAirwayMode(CDM::enumBioGearsAirwayMode::value mode) +void BioGears::SetAirwayMode(SEBioGearsAirwayMode mode) { if (mode == m_AirwayMode) { - return; + return; } - if (mode == CDM::enumBioGearsAirwayMode::Inhaler && m_AirwayMode != CDM::enumBioGearsAirwayMode::Free) { + if (mode == SEBioGearsAirwayMode::Inhaler && m_AirwayMode != SEBioGearsAirwayMode::Free) { throw CommonDataModelException("Can only change airway mode to Inhaler from the Free mode, Disable other equipment first."); } - if (mode == CDM::enumBioGearsAirwayMode::NasalCannula && m_AirwayMode != CDM::enumBioGearsAirwayMode::Free) { + if (mode == SEBioGearsAirwayMode::NasalCannula && m_AirwayMode != SEBioGearsAirwayMode::Free) { throw CommonDataModelException("Can only change airway mode to NasalCannula from the Free mode, Disable other equipment first."); } - if (mode == CDM::enumBioGearsAirwayMode::AnesthesiaMachine && m_AirwayMode != CDM::enumBioGearsAirwayMode::Free) { + if (mode == SEBioGearsAirwayMode::AnesthesiaMachine && m_AirwayMode != SEBioGearsAirwayMode::Free) { throw CommonDataModelException("Can only change airway mode to Anesthesia Machine from the Free mode, Disable other equipment first."); } - if (mode == CDM::enumBioGearsAirwayMode::MechanicalVentilator && m_AirwayMode != CDM::enumBioGearsAirwayMode::Free) { + if (mode == SEBioGearsAirwayMode::MechanicalVentilator && m_AirwayMode != SEBioGearsAirwayMode::Free) { throw CommonDataModelException("Can only change airway mode to Mechanical Ventilator from the Free mode, Disable other equipment first."); } if (mode != m_AirwayMode) { m_Compartments->UpdateAirwayGraph(); } m_AirwayMode = mode; - Info(asprintf( "Airway Mode : %s", - ( CDM::enumBioGearsAirwayMode::Free == m_AirwayMode) ? "Free": - ( CDM::enumBioGearsAirwayMode::AnesthesiaMachine == m_AirwayMode) ? "AnesthesiaMachine": - ( CDM::enumBioGearsAirwayMode::Inhaler == m_AirwayMode) ? "Inhaler": - ( CDM::enumBioGearsAirwayMode::NasalCannula == m_AirwayMode) ? "NasalCannula": - ( CDM::enumBioGearsAirwayMode::MechanicalVentilator == m_AirwayMode) ? "MechanicalVentilator": "Unknown")); + Info(asprintf("Airway Mode : %s", + (SEBioGearsAirwayMode::Free == m_AirwayMode) ? "Free" : (SEBioGearsAirwayMode::AnesthesiaMachine == m_AirwayMode) ? "AnesthesiaMachine" + : (SEBioGearsAirwayMode::Inhaler == m_AirwayMode) ? "Inhaler" + : (SEBioGearsAirwayMode::NasalCannula == m_AirwayMode) ? "NasalCannula" + : (SEBioGearsAirwayMode::MechanicalVentilator == m_AirwayMode) ? "MechanicalVentilator" + : "Unknown")); } -void BioGears::SetIntubation(CDM::enumOnOff::value s) +void BioGears::SetIntubation(SEOnOff s) { if (m_Intubation == s) { return; // do nazing! } - if (m_AirwayMode == CDM::enumBioGearsAirwayMode::Inhaler) { + if (m_AirwayMode == SEBioGearsAirwayMode::Inhaler) { throw CommonDataModelException("Cannot intubate if the inhaler is active."); } m_Intubation = s; @@ -266,17 +276,17 @@ void BioGears::SetIntubation(CDM::enumOnOff::value s) bool BioGears::SetupPatient() { bool err = false; - //Gender is the only thing we absolutely need to be defined - //Everything else is either derived or assumed to be a "standard" value - if (!m_Patient->HasGender()) { + // Gender is the only thing we absolutely need to be defined + // Everything else is either derived or assumed to be a "standard" value + if (!m_Patient->HasSex()) { Error("Patient must provide a gender."); err = true; } - //AGE --------------------------------------------------------------- + // AGE --------------------------------------------------------------- double age_yr; double ageMin_yr = 18.0; - double ageMax_yr = 65.0; + double ageMax_yr = 105.0; double ageStandard_yr = 44.0; if (!m_Patient->HasAge()) { m_Patient->GetAge().SetValue(ageStandard_yr, TimeUnit::yr); @@ -291,36 +301,36 @@ bool BioGears::SetupPatient() err = true; } - //PAIN SUSCEPTIBILITY ----------------------------------------------------------------------------------- + // PAIN SUSCEPTIBILITY ----------------------------------------------------------------------------------- double painStandard = 0.0; if (!m_Patient->HasPainSusceptibility()) { m_Patient->GetPainSusceptibility().SetValue(painStandard); Info(asprintf("No patient pain susceptibility set %f being used.", painStandard)); } - //SWEAT SUSCEPTIBILITY ----------------------------------------------------------------------------------- + // SWEAT SUSCEPTIBILITY ----------------------------------------------------------------------------------- double sweatStandard = 0.0; if (!m_Patient->HasHyperhidrosis()) { m_Patient->GetHyperhidrosis().SetValue(sweatStandard); Info(asprintf("No patient sweat susceptibility set %f being used.", sweatStandard)); } - //Sleep Amount --------------------------------------------------------------- + // Sleep Amount --------------------------------------------------------------- double sleepAmount_hr = 8.0; if (!m_Patient->HasSleepAmount()) { m_Patient->GetSleepAmount().SetValue(sleepAmount_hr, TimeUnit::hr); Info(asprintf("No patient sleep amount set %f hr being used.", sleepAmount_hr)); } - //additional checks to ensure non-zero and negative values: + // additional checks to ensure non-zero and negative values: if (m_Patient->GetSleepAmount().GetValue(TimeUnit::hr) < 0 || m_Patient->GetSleepAmount().GetValue(TimeUnit::hr) == 0) { m_Patient->GetSleepAmount().SetValue(sleepAmount_hr, TimeUnit::hr); Info(asprintf("Sleep amount must be a non-zero positive number, setting to default: %f hr being used.", sleepAmount_hr)); } - //HEIGHT --------------------------------------------------------------- - //From CDC values for 20 year olds - //Minimums are 3rd percentile, Maximums are 97th percentile, and standard is 50th percentile + // HEIGHT --------------------------------------------------------------- + // From CDC values for 20 year olds + // Minimums are 3rd percentile, Maximums are 97th percentile, and standard is 50th percentile /// \cite Centers2016clinical double heightMinMale_cm = 163.0; double heightMaxMale_cm = 190.0; @@ -328,23 +338,23 @@ bool BioGears::SetupPatient() double heightMinFemale_cm = 151.0; double heightMaxFemale_cm = 175.5; double heightStandardFemale_cm = 163.0; - //Male + // Male double heightMin_cm = heightMinMale_cm; double heightMax_cm = heightMaxMale_cm; double heightStandard_cm = heightStandardMale_cm; - if (m_Patient->GetGender() == CDM::enumSex::Female) { - //Female + if (m_Patient->GetSex() == SESex::Female) { + // Female heightMin_cm = heightMinFemale_cm; heightMax_cm = heightMaxFemale_cm; heightStandard_cm = heightStandardFemale_cm; } if (!m_Patient->HasHeight()) { m_Patient->GetHeight().SetValue(heightStandard_cm, LengthUnit::cm); - Info( asprintf("No patient height set. Using the standard value of %f cm.", heightStandard_cm)); + Info(asprintf("No patient height set. Using the standard value of %f cm.", heightStandard_cm)); } double height_cm = m_Patient->GetHeight().GetValue(LengthUnit::cm); double height_ft = Convert(height_cm, LengthUnit::cm, LengthUnit::ft); - //Check for outrageous values + // Check for outrageous values if (height_ft < 4.5 || height_ft > 7.0) { Error("Patient height setting is outrageous. It must be between 4.5 and 7.0 ft"); err = true; @@ -355,7 +365,7 @@ bool BioGears::SetupPatient() Warning(asprintf("Patient height of %f cm is outside of typical ranges - above 97th percentile(%f cm). No guarantees of model validity.", height_cm, heightMin_cm)); } - //WEIGHT --------------------------------------------------------------- + // WEIGHT --------------------------------------------------------------- /// \cite World2006bmi double weight_kg; double BMI_kg_per_m2; @@ -367,7 +377,7 @@ bool BioGears::SetupPatient() if (!m_Patient->HasWeight()) { weight_kg = BMIStandard_kg_per_m2 * std::pow(m_Patient->GetHeight().GetValue(LengthUnit::m), 2); m_Patient->GetWeight().SetValue(weight_kg, MassUnit::kg); - Info(asprintf( "No patient weight set. Using the standard BMI value of 21.75 kg/m^2, resulting in a weight of %f kg.", weight_kg)); + Info(asprintf("No patient weight set. Using the standard BMI value of 21.75 kg/m^2, resulting in a weight of %f kg.", weight_kg)); } weight_kg = m_Patient->GetWeight(MassUnit::kg); BMI_kg_per_m2 = weight_kg / std::pow(m_Patient->GetHeight().GetValue(LengthUnit::m), 2); @@ -392,22 +402,22 @@ bool BioGears::SetupPatient() Warning(asprintf("Patient Body Mass Index (BMI) of %f kg/m^2 is underweight. No guarantees of model validity.", BMI_kg_per_m2)); } - //BODY FAT FRACTION --------------------------------------------------------------- - //From American Council on Exercise + // BODY FAT FRACTION --------------------------------------------------------------- + // From American Council on Exercise /// \cite muth2009what - double fatFraction; + double fatFraction = 0.0; double fatFractionStandardMale = 0.21; double fatFractionStandardFemale = 0.28; - double fatFractionMaxMale = 0.25; //Obese - double fatFractionMaxFemale = 0.32; //Obese - double fatFractionMinMale = 0.02; //Essential fat - double fatFractionMinFemale = 0.10; //Essential fat - //Male + double fatFractionMaxMale = 0.25; // Obese + double fatFractionMaxFemale = 0.32; // Obese + double fatFractionMinMale = 0.02; // Essential fat + double fatFractionMinFemale = 0.10; // Essential fat + // Male double fatFractionMin = fatFractionMinMale; double fatFractionMax = fatFractionMaxMale; double fatFractionStandard = fatFractionStandardMale; - if (m_Patient->GetGender() == CDM::enumSex::Female) { - //Female + if (m_Patient->GetSex() == SESex::Female) { + // Female fatFractionMin = fatFractionMinFemale; fatFractionMax = fatFractionMaxFemale; fatFractionStandard = fatFractionStandardFemale; @@ -421,51 +431,51 @@ bool BioGears::SetupPatient() fatFraction = m_Patient->GetBodyFatFraction().GetValue(); if (fatFraction > fatFractionMax) { Warning(asprintf("Patient body fat fraction of %f is too high. Obese patients must be modeled by adding/using a condition. Maximum body fat fraction allowed is %f.", fatFraction, fatFractionMax)); - //err = true; + // err = true; } else if (fatFraction < fatFractionMin) { Warning(asprintf("Patient body fat fraction %f is too low. Patients must have essential fat. Minimum body fat fraction allowed is %f.", fatFraction, fatFractionMin)); - //err = true; + // err = true; } - //Lean Body Mass --------------------------------------------------------------- + // Lean Body Mass --------------------------------------------------------------- if (m_Patient->HasLeanBodyMass()) { - Error(asprintf( "Patient lean body mass cannot be set. It is determined by weight and body fat fraction.")); + Error(asprintf("Patient lean body mass cannot be set. It is determined by weight and body fat fraction.")); err = true; } double leanBodyMass_kg = weight_kg * (1.0 - fatFraction); m_Patient->GetLeanBodyMass().SetValue(leanBodyMass_kg, MassUnit::kg); - Info(asprintf( "Patient lean body mass computed and set to %f kg.",leanBodyMass_kg)); + Info(asprintf("Patient lean body mass computed and set to %f kg.", leanBodyMass_kg)); - //Muscle Mass --------------------------------------------------------------- - // \cite janssen2000skeletal + // Muscle Mass --------------------------------------------------------------- + // \cite janssen2000skeletal if (m_Patient->HasMuscleMass()) { - Error( "Patient muscle mass cannot be set directly. It is determined by a percentage of weight."); + Error("Patient muscle mass cannot be set directly. It is determined by a percentage of weight."); err = true; } - if (m_Patient->GetGender() == CDM::enumSex::Female) { + if (m_Patient->GetSex() == SESex::Female) { m_Patient->GetMuscleMass().SetValue(weight_kg * .306, MassUnit::kg); } else { m_Patient->GetMuscleMass().SetValue(weight_kg * .384, MassUnit::kg); } - Info(asprintf( "Patient muscle mass computed and set to %f kg.", m_Patient->GetMuscleMass().GetValue(MassUnit::kg))); + Info(asprintf("Patient muscle mass computed and set to %f kg.", m_Patient->GetMuscleMass().GetValue(MassUnit::kg))); - //Body Density --------------------------------------------------------------- + // Body Density --------------------------------------------------------------- if (m_Patient->HasBodyDensity()) { - Error( "Patient body density cannot be set. It is determined using body fat fraction."); + Error("Patient body density cannot be set. It is determined using body fat fraction."); err = true; } - //Using the average of Siri and Brozek formulas + // Using the average of Siri and Brozek formulas /// \cite siri1961body /// \cite brovzek1963densitometric double SiriBodyDensity_g_Per_cm3 = 4.95 / (fatFraction + 4.50); double BrozekBodyDensity_g_Per_cm3 = 4.57 / (fatFraction + 4.142); double bodyDensity_g_Per_cm3 = (SiriBodyDensity_g_Per_cm3 + BrozekBodyDensity_g_Per_cm3) / 2.0; m_Patient->GetBodyDensity().SetValue(bodyDensity_g_Per_cm3, MassPerVolumeUnit::g_Per_cm3); - Info(asprintf( "Patient body density computed and set to %f g/cm^3.", bodyDensity_g_Per_cm3)); + Info(asprintf("Patient body density computed and set to %f g/cm^3.", bodyDensity_g_Per_cm3)); - //Heart Rate --------------------------------------------------------------- + // Heart Rate --------------------------------------------------------------- double heartRate_bpm; double heartStandard_bpm = 72.0; double heartRateMax_bpm = 109.0; @@ -475,7 +485,7 @@ bool BioGears::SetupPatient() if (!m_Patient->HasHeartRateBaseline()) { heartRate_bpm = heartStandard_bpm; m_Patient->GetHeartRateBaseline().SetValue(heartRate_bpm, FrequencyUnit::Per_min); - Info(asprintf( "No patient heart rate baseline set. Using the standard value of %f bpm.",heartRate_bpm)); + Info(asprintf("No patient heart rate baseline set. Using the standard value of %f bpm.", heartRate_bpm)); } heartRate_bpm = m_Patient->GetHeartRateBaseline(FrequencyUnit::Per_min); if (heartRateTachycardia_bpm < heartRate_bpm) { @@ -487,18 +497,18 @@ bool BioGears::SetupPatient() } } else if (heartRate_bpm < heartRateBradycardia_bpm) { if (heartRateMin_bpm <= heartRate_bpm) { - Info( "Patient heart rate baseline of %f bpm is bradycardic"); + Info("Patient heart rate baseline of %f bpm is bradycardic"); } else { m_Patient->GetHeartRateBaseline().SetValue(heartRateMin_bpm, FrequencyUnit::Per_min); Info(asprintf("Patient heart rate baseline of %f exceeds minimum stable value of %f bpm. Resetting heart rate baseline to ", heartRate_bpm, heartRateMin_bpm, heartRateMin_bpm)); } } - //Tanaka H, Monahan KD, Seals DR (January 2001). "Age-predicted maximal heart rate revisited". J. Am. Coll. Cardiol. 37(1): 153–6. doi:10.1016/S0735-1097(00)01054-8.PMID 11153730. + // Tanaka H, Monahan KD, Seals DR (January 2001). "Age-predicted maximal heart rate revisited". J. Am. Coll. Cardiol. 37(1): 153–6. doi:10.1016/S0735-1097(00)01054-8.PMID 11153730. double computedHeartRateMaximum_bpm = 208.0 - (0.7 * m_Patient->GetAge(TimeUnit::yr)); if (!m_Patient->HasHeartRateMaximum()) { m_Patient->GetHeartRateMaximum().SetValue(computedHeartRateMaximum_bpm, FrequencyUnit::Per_min); - Info(asprintf( "No patient heart rate maximum set. Using a computed value of %f bpm.", computedHeartRateMaximum_bpm)); + Info(asprintf("No patient heart rate maximum set. Using a computed value of %f bpm.", computedHeartRateMaximum_bpm)); } else { if (m_Patient->GetHeartRateMaximum(FrequencyUnit::Per_min) < heartRate_bpm) { Error("Patient heart rate maximum must be greater than the baseline heart rate."); @@ -515,59 +525,59 @@ bool BioGears::SetupPatient() err = true; } - //Arterial Pressures --------------------------------------------------------------- + // Arterial Pressures --------------------------------------------------------------- double systolic_mmHg; double diastolic_mmHg; double systolicStandard_mmHg = 114.0; double diastolicStandard_mmHg = 73.5; - double systolicMax_mmHg = 120.0; //Hypertension - double diastolicMax_mmHg = 80.0; //Hypertension - double systolicMin_mmHg = 90.0; //Hypotension - double diastolicMin_mmHg = 60.0; //Hypotension - double narrowestPulseFactor = 0.75; //From Wikipedia: Pulse Pressure + double systolicMax_mmHg = 120.0; // Hypertension + double diastolicMax_mmHg = 80.0; // Hypertension + double systolicMin_mmHg = 90.0; // Hypotension + double diastolicMin_mmHg = 60.0; // Hypotension + double narrowestPulseFactor = 0.75; // From Wikipedia: Pulse Pressure if (!m_Patient->HasSystolicArterialPressureBaseline()) { systolic_mmHg = systolicStandard_mmHg; m_Patient->GetSystolicArterialPressureBaseline().SetValue(systolic_mmHg, PressureUnit::mmHg); - Info(asprintf( "No patient systolic pressure baseline set. Using the standard value of %f mmHg.", systolic_mmHg)); + Info(asprintf("No patient systolic pressure baseline set. Using the standard value of %f mmHg.", systolic_mmHg)); } systolic_mmHg = m_Patient->GetSystolicArterialPressureBaseline(PressureUnit::mmHg); if (systolic_mmHg < systolicMin_mmHg) { Warning(asprintf("Patient systolic pressure baseline of %f mmHg is too low. Hypotension must be modeled by adding/using a condition. Minimum systolic pressure baseline allowed is %f mmHg.", systolic_mmHg, systolicMin_mmHg)); - //err = true; + // err = true; } else if (systolic_mmHg > systolicMax_mmHg) { Warning(asprintf("Patient systolic pressure baseline of %f mmHg is too high. Hypertension must be modeled by adding/using a condition. Maximum systolic pressure baseline allowed is %f mmHg.", systolic_mmHg, systolicMax_mmHg)); - //err = true; + // err = true; } if (!m_Patient->HasDiastolicArterialPressureBaseline()) { diastolic_mmHg = diastolicStandard_mmHg; m_Patient->GetDiastolicArterialPressureBaseline().SetValue(diastolic_mmHg, PressureUnit::mmHg); - Info(asprintf( "No patient diastolic pressure baseline set. Using the standard value of %f mmHg.", diastolic_mmHg)); + Info(asprintf("No patient diastolic pressure baseline set. Using the standard value of %f mmHg.", diastolic_mmHg)); } diastolic_mmHg = m_Patient->GetDiastolicArterialPressureBaseline(PressureUnit::mmHg); if (diastolic_mmHg < diastolicMin_mmHg) { Warning(asprintf("Patient diastolic pressure baseline of %f mmHg is too low. Hypotension must be modeled by adding/using a condition. Minimum diastolic pressure baseline allowed is %f mmHg.", diastolic_mmHg, diastolicMin_mmHg)); - //err = true; + // err = true; } else if (diastolic_mmHg > diastolicMax_mmHg) { Warning(asprintf("Patient diastolic pressure baseline of %f mmHg is too high. Hypertension must be modeled by adding/using a condition. Maximum diastolic pressure baseline allowed is %f mmHg.", diastolic_mmHg, diastolicMax_mmHg)); - //err = true; + // err = true; } if (diastolic_mmHg > 0.75 * systolic_mmHg) { Warning(asprintf("Patient baseline pulse pressure (systolic vs. diastolic pressure fraction) of %f is abnormally narrow. Minimum fraction allowed is %f .", diastolic_mmHg / systolic_mmHg, narrowestPulseFactor)); - //err = true; + // err = true; } if (m_Patient->HasMeanArterialPressureBaseline()) { - Error( "Patient mean arterial pressure baseline cannot be set. It is determined through homeostatic simulation."); + Error("Patient mean arterial pressure baseline cannot be set. It is determined through homeostatic simulation."); err = true; } double MAP_mmHg = 1.0 / 3.0 * systolic_mmHg + 2.0 / 3.0 * diastolic_mmHg; m_Patient->GetMeanArterialPressureBaseline().SetValue(MAP_mmHg, PressureUnit::mmHg); - //Blood Type ----------------------------------------------------------------- - //default blood type based on universal acceptor - CDM::enumBloodType::value defaultBloodType_ABO = CDM::enumBloodType::AB; + // Blood Type ----------------------------------------------------------------- + // default blood type based on universal acceptor + SEBloodType defaultBloodType_ABO = SEBloodType::AB; bool defaultBloodRh = true; if (!m_Patient->HasBloodRh()) { m_Patient->SetBloodRh(defaultBloodRh); @@ -579,12 +589,12 @@ bool BioGears::SetupPatient() Info(asprintf("Patient's blood type antigen has not been set. Defaulting to %f", defaultBloodType_ABO)); } - //Blood Volume --------------------------------------------------------------- + // Blood Volume --------------------------------------------------------------- /// \cite Morgan2006Clinical double bloodVolume_mL; double computedBloodVolume_mL = 65.6 * std::pow(weight_kg, 1.02); - double bloodVolumeMin_mL = computedBloodVolume_mL * 0.85; //Stage 1 Hypovolemia - double bloodVolumeMax_mL = computedBloodVolume_mL * 1.15; //Just go the same distance on the other side + double bloodVolumeMin_mL = computedBloodVolume_mL * 0.85; // Stage 1 Hypovolemia + double bloodVolumeMax_mL = computedBloodVolume_mL * 1.15; // Just go the same distance on the other side if (!m_Patient->HasBloodVolumeBaseline()) { bloodVolume_mL = computedBloodVolume_mL; m_Patient->GetBloodVolumeBaseline().SetValue(bloodVolume_mL, VolumeUnit::mL); @@ -602,12 +612,12 @@ bool BioGears::SetupPatient() err = true; } - //Respiration Rate --------------------------------------------------------------- - //Note: This is overwritten after stabilization + // Respiration Rate --------------------------------------------------------------- + // Note: This is overwritten after stabilization double respirationRate_bpm; double respirationRateStandard_bpm = 14.0; double respirationRateMax_bpm = 20.0; - double respirationRateMin_bpm = 12.0; + double respirationRateMin_bpm = 10.0; if (!m_Patient->HasRespirationRateBaseline()) { respirationRate_bpm = respirationRateStandard_bpm; m_Patient->GetRespirationRateBaseline().SetValue(respirationRate_bpm, FrequencyUnit::Per_min); @@ -624,7 +634,7 @@ bool BioGears::SetupPatient() err = true; } - //Right Lung Ratio --------------------------------------------------------------- + // Right Lung Ratio --------------------------------------------------------------- double rightLungRatio; double rightLungRatioStandard = 0.525; double rightLungRatioMax = 0.60; @@ -643,8 +653,8 @@ bool BioGears::SetupPatient() err = true; } - //Respiratory Volumes --------------------------------------------------------------- - //These are based on weight + // Respiratory Volumes --------------------------------------------------------------- + // These are based on weight /// \cite ganong1995review double totalLungCapacity_L; double computedTotalLungCapacity_L = 80.0 * weight_kg / 1000.0; @@ -707,15 +717,15 @@ bool BioGears::SetupPatient() double targetVent_L_Per_min = tidalVolume_L * respirationRate_bpm; m_Patient->GetTotalVentilationBaseline().SetValue(targetVent_L_Per_min, VolumePerTimeUnit::L_Per_min); - //Stabilization goes faster if we start the driver with a good amplitude that pushes blood gas levels to setpoint. - //Based off testing, this relationship holds up well between RR = 12 and RR = 16 for Standard Male. + // Stabilization goes faster if we start the driver with a good amplitude that pushes blood gas levels to setpoint. + // Based off testing, this relationship holds up well between RR = 12 and RR = 16 for Standard Male. double baselineDriverPressure_cmH2O = -6.2 + 0.25 * (respirationRate_bpm - 12.0); - //Adjust driver pressure relationship for respiration rates > 16 (slope of driver - RR line decreases) + // Adjust driver pressure relationship for respiration rates > 16 (slope of driver - RR line decreases) if (respirationRate_bpm > 16.0) { //-5.2 = driver pressure at 16 bpm. baselineDriverPressure_cmH2O = -5.2 + 0.125 * (respirationRate_bpm - 16); } - //Scale target pressure as ratio of calculated FRC to Standard Male FRC + // Scale target pressure as ratio of calculated FRC to Standard Male FRC double standardFRC_L = 2.31332; baselineDriverPressure_cmH2O *= functionalResidualCapacity_L / standardFRC_L; @@ -726,33 +736,33 @@ bool BioGears::SetupPatient() double expiratoryReserveVolume = functionalResidualCapacity_L - residualVolume_L; double inspiratoryReserveVolume = totalLungCapacity_L - functionalResidualCapacity_L - tidalVolume_L; double inspiratoryCapacity = totalLungCapacity_L - functionalResidualCapacity_L; - //No negative volumes + // No negative volumes if (totalLungCapacity_L < 0.0 || functionalResidualCapacity_L < 0.0 || residualVolume_L < 0.0 || tidalVolume_L < 0.0 || vitalCapacity < 0.0 || expiratoryReserveVolume < 0.0 || inspiratoryReserveVolume < 0.0 || inspiratoryCapacity < 0.0) { - Error( "All patient lung volumes must be positive."); + Error("All patient lung volumes must be positive."); err = true; } - m_Patient->GetTidalVolumeBaseline().SetValue(tidalVolume_L, VolumeUnit::L); //This is overwritten after stabilization - Info(asprintf( "Patient tidal volume computed and set to %f L.", tidalVolume_L)); + m_Patient->GetTidalVolumeBaseline().SetValue(tidalVolume_L, VolumeUnit::L); // This is overwritten after stabilization + Info(asprintf("Patient tidal volume computed and set to %f L.", tidalVolume_L)); m_Patient->GetVitalCapacity().SetValue(vitalCapacity, VolumeUnit::L); - Info(asprintf( "Patient vital capacity computed and set to %f L.", vitalCapacity)); + Info(asprintf("Patient vital capacity computed and set to %f L.", vitalCapacity)); m_Patient->GetExpiratoryReserveVolume().SetValue(expiratoryReserveVolume, VolumeUnit::L); - Info(asprintf( "Patient expiratory reserve volume computed and set to %f L.", expiratoryReserveVolume)); + Info(asprintf("Patient expiratory reserve volume computed and set to %f L.", expiratoryReserveVolume)); m_Patient->GetInspiratoryReserveVolume().SetValue(inspiratoryReserveVolume, VolumeUnit::L); - Info(asprintf( "Patient inspiratory reserve volume computed and set to %f L.", inspiratoryReserveVolume)); + Info(asprintf("Patient inspiratory reserve volume computed and set to %f L.", inspiratoryReserveVolume)); m_Patient->GetInspiratoryCapacity().SetValue(inspiratoryCapacity, VolumeUnit::L); - Info(asprintf( "Patient inspiratory capacity computed and set to %f L.", inspiratoryCapacity)); + Info(asprintf("Patient inspiratory capacity computed and set to %f L.", inspiratoryCapacity)); - //Alveoli Surface Area --------------------------------------------------------------- + // Alveoli Surface Area --------------------------------------------------------------- /// \cite roberts2000gaseous double standardAlveoliSurfaceArea_m2 = 70.0; double alveoliSurfaceArea_m2; - //Scale the alveoli surface area based on the size of the patient’s lungs + // Scale the alveoli surface area based on the size of the patient’s lungs /// cite ganong1995review - double standardTotalLungCapacity_L = 6.17; //This is the Total Lung Capacity of our standard patient + double standardTotalLungCapacity_L = 6.17; // This is the Total Lung Capacity of our standard patient double computedAlveoliSurfaceArea_m2 = totalLungCapacity_L / standardTotalLungCapacity_L * standardAlveoliSurfaceArea_m2; if (!m_Patient->HasAlveoliSurfaceArea()) { alveoliSurfaceArea_m2 = computedAlveoliSurfaceArea_m2; @@ -764,7 +774,7 @@ bool BioGears::SetupPatient() Warning(asprintf("Specified alveoli surface area of %f m^2 differs from computed value of %f m^2. No guarantees of model validity.", alveoliSurfaceArea_m2, computedAlveoliSurfaceArea_m2)); } - //Skin Surface Area --------------------------------------------------------------- + // Skin Surface Area --------------------------------------------------------------- /// \cite du1989formula double skinSurfaceArea_m2; double computSkinSurfaceArea_m2 = 0.20247 * std::pow(weight_kg, 0.425) * std::pow(Convert(height_cm, LengthUnit::cm, LengthUnit::m), 0.725); @@ -775,16 +785,16 @@ bool BioGears::SetupPatient() } skinSurfaceArea_m2 = m_Patient->GetSkinSurfaceArea(AreaUnit::m2); if (skinSurfaceArea_m2 != computSkinSurfaceArea_m2) { - Warning(asprintf( "Specified skin surface area of %f cm differs from computed value of %f cm. No guarantees of model validity.", skinSurfaceArea_m2, computSkinSurfaceArea_m2)); + Warning(asprintf("Specified skin surface area of %f cm differs from computed value of %f cm. No guarantees of model validity.", skinSurfaceArea_m2, computSkinSurfaceArea_m2)); } - //Basal Metabolic Rate --------------------------------------------------------------- - //The basal metabolic rate is determined from the Harris-Benedict formula, with differences dependent on sex, age, height and mass + // Basal Metabolic Rate --------------------------------------------------------------- + // The basal metabolic rate is determined from the Harris-Benedict formula, with differences dependent on sex, age, height and mass /// \cite roza1984metabolic double BMR_kcal_Per_day; - double computBMR_kcal_Per_day = 88.632 + 13.397 * weight_kg + 4.799 * height_cm - 5.677 * age_yr; //Male - if (m_Patient->GetGender() == CDM::enumSex::Female) { - computBMR_kcal_Per_day = 447.593 + 9.247 * weight_kg + 3.098 * height_cm - 4.330 * age_yr; //Female + double computBMR_kcal_Per_day = 88.632 + 13.397 * weight_kg + 4.799 * height_cm - 5.677 * age_yr; // Male + if (m_Patient->GetSex() == SESex::Female) { + computBMR_kcal_Per_day = 447.593 + 9.247 * weight_kg + 3.098 * height_cm - 4.330 * age_yr; // Female } if (!m_Patient->HasBasalMetabolicRate()) { BMR_kcal_Per_day = computBMR_kcal_Per_day; @@ -796,13 +806,13 @@ bool BioGears::SetupPatient() Warning(asprintf("Specified basal metabolic rate of %f kcal/day differs from computed value of %f kcal/day. No guarantees of model validity.", BMR_kcal_Per_day, computBMR_kcal_Per_day)); } - //Maximum Work Rate --------------------------------------------------------------- - //The max work rate is determined from linear regressions of research by Plowman et al., with differences dependent on sex and age + // Maximum Work Rate --------------------------------------------------------------- + // The max work rate is determined from linear regressions of research by Plowman et al., with differences dependent on sex and age /// \cite plowman2013exercise double maxWorkRate_W; double computedMaxWorkRate_W; - if (m_Patient->GetGender() == CDM::enumSex::Male) { + if (m_Patient->GetSex() == SESex::Male) { if (age_yr >= 60.) { computedMaxWorkRate_W = ((-24.3 * 60.) + 2070.); } else { @@ -823,7 +833,7 @@ bool BioGears::SetupPatient() } maxWorkRate_W = m_Patient->GetMaxWorkRate(PowerUnit::W); if (maxWorkRate_W != computedMaxWorkRate_W) { - Warning(asprintf( "Specified maximum work rate of %f Watts differs from computed value of %f Watts. No guarantees of model validity.", maxWorkRate_W, computedMaxWorkRate_W)); + Warning(asprintf("Specified maximum work rate of %f Watts differs from computed value of %f Watts. No guarantees of model validity.", maxWorkRate_W, computedMaxWorkRate_W)); } if (err) { @@ -834,31 +844,28 @@ bool BioGears::SetupPatient() BioGears::~BioGears() { - - m_Logger->FormatMessages(false); - m_Config = nullptr; + m_Configuration = nullptr; m_SaturationCalculator = nullptr; m_DiffusionCalculator = nullptr; - m_Actions = nullptr; m_Conditions = nullptr; m_Circuits = nullptr; - m_Compartments= nullptr; + m_Compartments = nullptr; m_Environment = nullptr; m_BloodChemistrySystem = nullptr; - m_CardiovascularSystem= nullptr; - m_EndocrineSystem= nullptr; - m_EnergySystem= nullptr; - m_GastrointestinalSystem= nullptr; - m_HepaticSystem= nullptr; - m_NervousSystem= nullptr; - m_RenalSystem= nullptr; - m_RespiratorySystem= nullptr; - m_DrugSystem= nullptr; - m_TissueSystem= nullptr; + m_CardiovascularSystem = nullptr; + m_EndocrineSystem = nullptr; + m_EnergySystem = nullptr; + m_GastrointestinalSystem = nullptr; + m_HepaticSystem = nullptr; + m_NervousSystem = nullptr; + m_RenalSystem = nullptr; + m_RespiratorySystem = nullptr; + m_DrugSystem = nullptr; + m_TissueSystem = nullptr; m_ECG = nullptr; @@ -868,11 +875,13 @@ BioGears::~BioGears() m_Patient = nullptr; - m_Substances; - m_CurrentTime = nullptr; m_SimulationTime = nullptr; + if (m_Logger) { + m_Logger->SetLogTime(nullptr); + } m_managedLogger = nullptr; + m_Substances = nullptr; } EngineState BioGears::GetState() { return m_State; } @@ -918,12 +927,12 @@ SEActionManager& BioGears::GetActions() { return *m_Actions; } SEConditionManager& BioGears::GetConditions() { return *m_Conditions; } BioGearsCircuits& BioGears::GetCircuits() { return *m_Circuits; } BioGearsCompartments& BioGears::GetCompartments() { return *m_Compartments; } -const BioGearsConfiguration& BioGears::GetConfiguration() { return *m_Config; } +const BioGearsConfiguration& BioGears::GetConfiguration() { return *m_Configuration; } const SEScalarTime& BioGears::GetEngineTime() { return *m_CurrentTime; } const SEScalarTime& BioGears::GetSimulationTime() { return *m_SimulationTime; } -const SEScalarTime& BioGears::GetTimeStep() { return m_Config->GetTimeStep(); } -CDM::enumBioGearsAirwayMode::value BioGears::GetAirwayMode() { return m_AirwayMode; } -CDM::enumOnOff::value BioGears::GetIntubation() { return m_Intubation; } +const SEScalarTime& BioGears::GetTimeStep() { return m_Configuration->GetTimeStep(); } +SEBioGearsAirwayMode BioGears::GetAirwayMode() { return m_AirwayMode; } +SEOnOff BioGears::GetIntubation() { return m_Intubation; } const SEAnesthesiaMachine& BioGears::GetAnesthesiaMachine() const { return *m_AnesthesiaMachine; } const SEElectroCardioGram& BioGears::GetECG() const { return *m_ECG; } @@ -932,12 +941,12 @@ const SEActionManager& BioGears::GetActions() const { return *m_Actions; } const SEConditionManager& BioGears::GetConditions() const { return *m_Conditions; } const BioGearsCircuits& BioGears::GetCircuits() const { return *m_Circuits; } const BioGearsCompartments& BioGears::GetCompartments() const { return *m_Compartments; } -const BioGearsConfiguration& BioGears::GetConfiguration() const { return *m_Config; } +const BioGearsConfiguration& BioGears::GetConfiguration() const { return *m_Configuration; } const SEScalarTime& BioGears::GetEngineTime() const { return *m_CurrentTime; } const SEScalarTime& BioGears::GetSimulationTime() const { return *m_SimulationTime; } -const SEScalarTime& BioGears::GetTimeStep() const { return m_Config->GetTimeStep(); } -const CDM::enumBioGearsAirwayMode::value BioGears::GetAirwayMode() const { return m_AirwayMode; } -const CDM::enumOnOff::value BioGears::GetIntubation() const { return m_Intubation; } +const SEScalarTime& BioGears::GetTimeStep() const { return m_Configuration->GetTimeStep(); } +const SEBioGearsAirwayMode BioGears::GetAirwayMode() const { return m_AirwayMode; } +const SEOnOff BioGears::GetIntubation() const { return m_Intubation; } void BioGears::AtSteadyState(EngineState state) { @@ -1069,17 +1078,17 @@ bool BioGears::GetPatientAssessment(SEPatientAssessment& assessment) bool BioGears::CreateCircuitsAndCompartments() { - m_Circuits->Clear(); - m_Compartments->Clear(); + m_Circuits->Invalidate(); + m_Compartments->Invalidate(); SetupCardiovascular(); - if (m_Config->IsCerebralEnabled()) { + if (m_Configuration->IsCerebralEnabled()) { SetupCerebral(); } - if (m_Config->IsRenalEnabled()) { + if (m_Configuration->IsRenalEnabled()) { SetupRenal(); } - if (m_Config->IsTissueEnabled()) { + if (m_Configuration->IsTissueEnabled()) { SetupTissue(); } SetupGastrointestinal(); @@ -1162,7 +1171,9 @@ bool BioGears::CreateCircuitsAndCompartments() lEnvironment.MapNode(Ambient); m_Environment->Initialize(); - CDM_COPY((&m_Config->GetInitialEnvironmentalConditions()), (&m_Environment->GetConditions())); + + CDM_ENVIRONMENT_COPY(EnvironmentalConditions, m_Configuration->GetInitialEnvironmentalConditions(), m_Environment->GetConditions()) + m_Environment->StateChange(); // Update the environment pressures on all the 'air' circuits to match what the environment was set to gEnvironment.GetPressure().Set(m_Environment->GetConditions().GetAtmosphericPressure()); @@ -1180,14 +1191,14 @@ bool BioGears::CreateCircuitsAndCompartments() void BioGears::SetupCardiovascular() { Info("Setting Up Cardiovascular"); - bool male = m_Patient->GetGender() == CDM::enumSex::Male ? true : false; + bool male = m_Patient->GetSex() == SESex::Male ? true : false; double RightLungRatio = m_Patient->GetRightLungRatio().GetValue(); double LeftLungRatio = 1 - RightLungRatio; double bloodVolume_mL = m_Patient->GetBloodVolumeBaseline(VolumeUnit::mL); double systolicPressureTarget_mmHg = m_Patient->GetSystolicArterialPressureBaseline(PressureUnit::mmHg); double heartRate_bpm = m_Patient->GetHeartRateBaseline(FrequencyUnit::Per_min); - double strokeVolumeTarget_mL = 81.0; //Note: Had set this to 87 in previous commit when vascular->interstitium resistances were different + double strokeVolumeTarget_mL = 81.0; // Note: Had set this to 87 in previous commit when vascular->interstitium resistances were different double cardiacOutputTarget_mL_Per_s = heartRate_bpm / 60.0 * strokeVolumeTarget_mL; double diastolicPressureTarget_mmHg = 80.0; double centralVenousPressureTarget_mmHg = 4.0; @@ -1447,15 +1458,15 @@ void BioGears::SetupCardiovascular() SEFluidCircuitPath& RightAtrium1ToRightAtrium2 = cCardiovascular.CreatePath(RightAtrium1, RightAtrium2, BGE::CardiovascularPath::RightAtrium1ToRightAtrium2); RightAtrium1ToRightAtrium2.GetResistanceBaseline().SetValue(5.94e-5, FlowResistanceUnit::mmHg_s_Per_mL); SEFluidCircuitPath& RightAtrium2ToRightVentricle1 = cCardiovascular.CreatePath(RightAtrium2, RightVentricle1, BGE::CardiovascularPath::RightAtrium2ToRightVentricle1); - RightAtrium2ToRightVentricle1.SetNextValve(CDM::enumOpenClosed::Closed); + RightAtrium2ToRightVentricle1.SetNextValve(SEOpenClosed::Closed); SEFluidCircuitPath& RightVentricle1ToRightVentricle2 = cCardiovascular.CreatePath(RightVentricle1, RightVentricle2, BGE::CardiovascularPath::RightVentricle1ToRightVentricle2); SEFluidCircuitPath& RightVentricle2ToGround = cCardiovascular.CreatePath(Ground, RightVentricle2, BGE::CardiovascularPath::RightVentricle2ToGround); RightVentricle2ToGround.GetPressureSourceBaseline().SetValue(0.0, PressureUnit::mmHg); SEFluidCircuitPath& RightVentricle1ToMainPulmonaryArteries = cCardiovascular.CreatePath(RightVentricle1, MainPulmonaryArteries, BGE::CardiovascularPath::RightVentricle1ToMainPulmonaryArteries); - RightVentricle1ToMainPulmonaryArteries.SetNextValve(CDM::enumOpenClosed::Closed); + RightVentricle1ToMainPulmonaryArteries.SetNextValve(SEOpenClosed::Closed); SEFluidCircuitPath& MainPulmonaryArteriesToRightIntermediatePulmonaryArteries = cCardiovascular.CreatePath(MainPulmonaryArteries, RightIntermediatePulmonaryArteries, BGE::CardiovascularPath::MainPulmonaryArteriesToRightIntermediatePulmonaryArteries); - //MainPulmonaryArteriesToRightIntermediatePulmonaryArteries.SetNextValve(CDM::enumOpenClosed::Closed); + // MainPulmonaryArteriesToRightIntermediatePulmonaryArteries.SetNextValve(SEOpenClosed::Closed); SEFluidCircuitPath& RightIntermediatePulmonaryArteriesToRightPulmonaryArteries = cCardiovascular.CreatePath(RightIntermediatePulmonaryArteries, RightPulmonaryArteries, BGE::CardiovascularPath::RightIntermediatePulmonaryArteriesToRightPulmonaryArteries); RightIntermediatePulmonaryArteriesToRightPulmonaryArteries.GetResistanceBaseline().SetValue(ResistancePulmArtLeft, FlowResistanceUnit::mmHg_s_Per_mL); @@ -1475,10 +1486,10 @@ void BioGears::SetupCardiovascular() SEFluidCircuitPath& RightPulmonaryVeinsToGround = cCardiovascular.CreatePath(RightPulmonaryVeins, Ground, BGE::CardiovascularPath::RightPulmonaryVeinsToGround); RightPulmonaryVeinsToGround.GetComplianceBaseline().SetValue(0.0, FlowComplianceUnit::mL_Per_mmHg); SEFluidCircuitPath& RightIntermediatePulmonaryVeinsToLeftAtrium1 = cCardiovascular.CreatePath(RightIntermediatePulmonaryVeins, LeftAtrium1, BGE::CardiovascularPath::RightIntermediatePulmonaryVeinsToLeftAtrium1); - //RightIntermediatePulmonaryVeinsToLeftAtrium2.SetNextValve(CDM::enumOpenClosed::Closed); + // RightIntermediatePulmonaryVeinsToLeftAtrium2.SetNextValve(SEOpenClosed::Closed); SEFluidCircuitPath& MainPulmonaryArteriesToLeftIntermediatePulmonaryArteries = cCardiovascular.CreatePath(MainPulmonaryArteries, LeftIntermediatePulmonaryArteries, BGE::CardiovascularPath::MainPulmonaryArteriesToLeftIntermediatePulmonaryArteries); - //MainPulmonaryArteriesToLeftIntermediatePulmonaryArteries.SetNextValve(CDM::enumOpenClosed::Closed); + // MainPulmonaryArteriesToLeftIntermediatePulmonaryArteries.SetNextValve(SEOpenClosed::Closed); SEFluidCircuitPath& LeftIntermediatePulmonaryArteriesToLeftPulmonaryArteries = cCardiovascular.CreatePath(LeftIntermediatePulmonaryArteries, LeftPulmonaryArteries, BGE::CardiovascularPath::LeftIntermediatePulmonaryArteriesToLeftPulmonaryArteries); LeftIntermediatePulmonaryArteriesToLeftPulmonaryArteries.GetResistanceBaseline().SetValue(ResistancePulmArtLeft, FlowResistanceUnit::mmHg_s_Per_mL); @@ -1498,19 +1509,19 @@ void BioGears::SetupCardiovascular() SEFluidCircuitPath& LeftPulmonaryVeinsToGround = cCardiovascular.CreatePath(LeftPulmonaryVeins, Ground, BGE::CardiovascularPath::LeftPulmonaryVeinsToGround); LeftPulmonaryVeinsToGround.GetComplianceBaseline().SetValue(0.0, FlowComplianceUnit::mL_Per_mmHg); SEFluidCircuitPath& LeftIntermediatePulmonaryVeinsToLeftAtrium1 = cCardiovascular.CreatePath(LeftIntermediatePulmonaryVeins, LeftAtrium1, BGE::CardiovascularPath::LeftIntermediatePulmonaryVeinsToLeftAtrium1); - //LeftIntermediatePulmonaryVeinsToLeftAtrium2.SetNextValve(CDM::enumOpenClosed::Closed); + // LeftIntermediatePulmonaryVeinsToLeftAtrium2.SetNextValve(SEOpenClosed::Closed); SEFluidCircuitPath& LeftAtrium1ToGround = cCardiovascular.CreatePath(LeftAtrium1, Ground, BGE::CardiovascularPath::LeftAtrium1ToGround); LeftAtrium1ToGround.GetComplianceBaseline().SetValue(1.0 / 0.075, FlowComplianceUnit::mL_Per_mmHg); SEFluidCircuitPath& LeftAtrium1ToLeftAtrium2 = cCardiovascular.CreatePath(LeftAtrium1, LeftAtrium2, BGE::CardiovascularPath::LeftAtrium1ToLeftAtrium2); LeftAtrium1ToLeftAtrium2.GetResistanceBaseline().SetValue(8.9e-5, FlowResistanceUnit::mmHg_s_Per_mL); SEFluidCircuitPath& LeftAtrium2ToLeftVentricle1 = cCardiovascular.CreatePath(LeftAtrium2, LeftVentricle1, BGE::CardiovascularPath::LeftAtrium2ToLeftVentricle1); - LeftAtrium2ToLeftVentricle1.SetNextValve(CDM::enumOpenClosed::Closed); + LeftAtrium2ToLeftVentricle1.SetNextValve(SEOpenClosed::Closed); SEFluidCircuitPath& LeftVentricle1ToLeftVentricle2 = cCardiovascular.CreatePath(LeftVentricle1, LeftVentricle2, BGE::CardiovascularPath::LeftVentricle1ToLeftVentricle2); SEFluidCircuitPath& LeftVentricle2ToGround = cCardiovascular.CreatePath(Ground, LeftVentricle2, BGE::CardiovascularPath::LeftVentricle2ToGround); LeftVentricle2ToGround.GetPressureSourceBaseline().SetValue(0.0, PressureUnit::mmHg); SEFluidCircuitPath& LeftVentricle1ToAorta2 = cCardiovascular.CreatePath(LeftVentricle1, Aorta2, BGE::CardiovascularPath::LeftVentricle1ToAorta2); - LeftVentricle1ToAorta2.SetNextValve(CDM::enumOpenClosed::Closed); + LeftVentricle1ToAorta2.SetNextValve(SEOpenClosed::Closed); SEFluidCircuitPath& Aorta2ToAorta3 = cCardiovascular.CreatePath(Aorta2, Aorta3, BGE::CardiovascularPath::Aorta2ToAorta3); SEFluidCircuitPath& Aorta3ToAorta1 = cCardiovascular.CreatePath(Aorta3, Aorta1, BGE::CardiovascularPath::Aorta3ToAorta1); @@ -1520,104 +1531,104 @@ void BioGears::SetupCardiovascular() SEFluidCircuitPath& Aorta1ToBrain1 = cCardiovascular.CreatePath(Aorta1, Brain1, BGE::CardiovascularPath::Aorta1ToBrain1); Aorta1ToBrain1.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceBrain, FlowResistanceUnit::mmHg_s_Per_mL); - Aorta1ToBrain1.SetCardiovascularRegion(CDM::enumResistancePathType::Cerebral); + Aorta1ToBrain1.SetCardiovascularRegion(SEResistancePathType::Cerebral); SEFluidCircuitPath& Brain1ToGround = cCardiovascular.CreatePath(Brain1, Ground, BGE::CardiovascularPath::Brain1ToGround); Brain1ToGround.GetComplianceBaseline().SetValue(0.0, FlowComplianceUnit::mL_Per_mmHg); SEFluidCircuitPath& Brain1ToBrain2 = cCardiovascular.CreatePath(Brain1, Brain2, BGE::CardiovascularPath::Brain1ToBrain2); Brain1ToBrain2.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceBrainVenous, FlowResistanceUnit::mmHg_s_Per_mL); - Brain1ToBrain2.SetCardiovascularRegion(CDM::enumResistancePathType::Cerebral); + Brain1ToBrain2.SetCardiovascularRegion(SEResistancePathType::Cerebral); SEFluidCircuitPath& Brain2ToVenaCava = cCardiovascular.CreatePath(Brain2, VenaCava, BGE::CardiovascularPath::Brain2ToVenaCava); SEFluidCircuitPath& Aorta1ToBone1 = cCardiovascular.CreatePath(Aorta1, Bone1, BGE::CardiovascularPath::Aorta1ToBone1); Aorta1ToBone1.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceBone, FlowResistanceUnit::mmHg_s_Per_mL); - Aorta1ToBone1.SetCardiovascularRegion(CDM::enumResistancePathType::Extrasplanchnic); + Aorta1ToBone1.SetCardiovascularRegion(SEResistancePathType::Extrasplanchnic); SEFluidCircuitPath& Bone1ToGround = cCardiovascular.CreatePath(Bone1, Ground, BGE::CardiovascularPath::Bone1ToGround); Bone1ToGround.GetComplianceBaseline().SetValue(0.0, FlowComplianceUnit::mL_Per_mmHg); SEFluidCircuitPath& Bone1ToBone2 = cCardiovascular.CreatePath(Bone1, Bone2, BGE::CardiovascularPath::Bone1ToBone2); Bone1ToBone2.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceBoneVenous, FlowResistanceUnit::mmHg_s_Per_mL); - Bone1ToBone2.SetCardiovascularRegion(CDM::enumResistancePathType::Extrasplanchnic); + Bone1ToBone2.SetCardiovascularRegion(SEResistancePathType::Extrasplanchnic); SEFluidCircuitPath& Bone2ToVenaCava = cCardiovascular.CreatePath(Bone2, VenaCava, BGE::CardiovascularPath::Bone2ToVenaCava); SEFluidCircuitPath& Aorta1ToFat1 = cCardiovascular.CreatePath(Aorta1, Fat1, BGE::CardiovascularPath::Aorta1ToFat1); Aorta1ToFat1.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceFat, FlowResistanceUnit::mmHg_s_Per_mL); - Aorta1ToFat1.SetCardiovascularRegion(CDM::enumResistancePathType::Extrasplanchnic); + Aorta1ToFat1.SetCardiovascularRegion(SEResistancePathType::Extrasplanchnic); SEFluidCircuitPath& Fat1ToGround = cCardiovascular.CreatePath(Fat1, Ground, BGE::CardiovascularPath::Fat1ToGround); Fat1ToGround.GetComplianceBaseline().SetValue(0.0, FlowComplianceUnit::mL_Per_mmHg); SEFluidCircuitPath& Fat1ToFat2 = cCardiovascular.CreatePath(Fat1, Fat2, BGE::CardiovascularPath::Fat1ToFat2); Fat1ToFat2.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceFatVenous, FlowResistanceUnit::mmHg_s_Per_mL); - Fat1ToFat2.SetCardiovascularRegion(CDM::enumResistancePathType::Extrasplanchnic); + Fat1ToFat2.SetCardiovascularRegion(SEResistancePathType::Extrasplanchnic); SEFluidCircuitPath& Fat2ToVenaCava = cCardiovascular.CreatePath(Fat2, VenaCava, BGE::CardiovascularPath::Fat2ToVenaCava); SEFluidCircuitPath& Aorta1ToLargeIntestine = cCardiovascular.CreatePath(Aorta1, LargeIntestine, BGE::CardiovascularPath::Aorta1ToLargeIntestine); Aorta1ToLargeIntestine.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceLargeIntestine, FlowResistanceUnit::mmHg_s_Per_mL); - Aorta1ToLargeIntestine.SetCardiovascularRegion(CDM::enumResistancePathType::Splanchnic); + Aorta1ToLargeIntestine.SetCardiovascularRegion(SEResistancePathType::Splanchnic); SEFluidCircuitPath& LargeIntestineToGround = cCardiovascular.CreatePath(LargeIntestine, Ground, BGE::CardiovascularPath::LargeIntestineToGround); LargeIntestineToGround.GetComplianceBaseline().SetValue(0.0, FlowComplianceUnit::mL_Per_mmHg); SEFluidCircuitPath& LargeIntestineToPortalVein = cCardiovascular.CreatePath(LargeIntestine, PortalVein, BGE::CardiovascularPath::LargeIntestineToPortalVein); LargeIntestineToPortalVein.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceLargeIntestineVenous, FlowResistanceUnit::mmHg_s_Per_mL); - LargeIntestineToPortalVein.SetCardiovascularRegion(CDM::enumResistancePathType::Splanchnic); + LargeIntestineToPortalVein.SetCardiovascularRegion(SEResistancePathType::Splanchnic); SEFluidCircuitPath& Aorta1ToLeftArm1 = cCardiovascular.CreatePath(Aorta1, LeftArm1, BGE::CardiovascularPath::Aorta1ToLeftArm1); Aorta1ToLeftArm1.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceArmLeft, FlowResistanceUnit::mmHg_s_Per_mL); - Aorta1ToLeftArm1.SetCardiovascularRegion(CDM::enumResistancePathType::Extrasplanchnic); + Aorta1ToLeftArm1.SetCardiovascularRegion(SEResistancePathType::Extrasplanchnic); SEFluidCircuitPath& LeftArm1ToGround = cCardiovascular.CreatePath(LeftArm1, Ground, BGE::CardiovascularPath::LeftArm1ToGround); LeftArm1ToGround.GetComplianceBaseline().SetValue(0.0, FlowComplianceUnit::mL_Per_mmHg); SEFluidCircuitPath& LeftArm1ToLeftArm2 = cCardiovascular.CreatePath(LeftArm1, LeftArm2, BGE::CardiovascularPath::LeftArm1ToLeftArm2); LeftArm1ToLeftArm2.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceArmLeftVenous, FlowResistanceUnit::mmHg_s_Per_mL); - LeftArm1ToLeftArm2.SetCardiovascularRegion(CDM::enumResistancePathType::Extrasplanchnic); + LeftArm1ToLeftArm2.SetCardiovascularRegion(SEResistancePathType::Extrasplanchnic); SEFluidCircuitPath& LeftArm2ToVenaCava = cCardiovascular.CreatePath(LeftArm2, VenaCava, BGE::CardiovascularPath::LeftArm2ToVenaCava); SEFluidCircuitPath& Aorta1ToLeftKidney1 = cCardiovascular.CreatePath(Aorta1, LeftKidney1, BGE::CardiovascularPath::Aorta1ToLeftKidney1); Aorta1ToLeftKidney1.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceKidney, FlowResistanceUnit::mmHg_s_Per_mL); - Aorta1ToLeftKidney1.SetCardiovascularRegion(CDM::enumResistancePathType::Extrasplanchnic); + Aorta1ToLeftKidney1.SetCardiovascularRegion(SEResistancePathType::Extrasplanchnic); SEFluidCircuitPath& LeftKidney1ToGround = cCardiovascular.CreatePath(LeftKidney1, Ground, BGE::CardiovascularPath::LeftKidney1ToGround); LeftKidney1ToGround.GetComplianceBaseline().SetValue(0.0, FlowComplianceUnit::mL_Per_mmHg); SEFluidCircuitPath& LeftKidney1ToLeftKidney2 = cCardiovascular.CreatePath(LeftKidney1, LeftKidney2, BGE::CardiovascularPath::LeftKidney1ToLeftKidney2); LeftKidney1ToLeftKidney2.GetResistanceBaseline().SetValue(ResistanceKidneyVenous, FlowResistanceUnit::mmHg_s_Per_mL); - LeftKidney1ToLeftKidney2.SetCardiovascularRegion(CDM::enumResistancePathType::Extrasplanchnic); + LeftKidney1ToLeftKidney2.SetCardiovascularRegion(SEResistancePathType::Extrasplanchnic); SEFluidCircuitPath& LeftKidney2ToVenaCava = cCardiovascular.CreatePath(LeftKidney2, VenaCava, BGE::CardiovascularPath::LeftKidney2ToVenaCava); SEFluidCircuitPath& Aorta1ToLeftLeg1 = cCardiovascular.CreatePath(Aorta1, LeftLeg1, BGE::CardiovascularPath::Aorta1ToLeftLeg1); Aorta1ToLeftLeg1.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceLegLeft, FlowResistanceUnit::mmHg_s_Per_mL); - Aorta1ToLeftLeg1.SetCardiovascularRegion(CDM::enumResistancePathType::Extrasplanchnic); + Aorta1ToLeftLeg1.SetCardiovascularRegion(SEResistancePathType::Extrasplanchnic); SEFluidCircuitPath& LeftLeg1ToGround = cCardiovascular.CreatePath(LeftLeg1, Ground, BGE::CardiovascularPath::LeftLeg1ToGround); LeftLeg1ToGround.GetComplianceBaseline().SetValue(0.0, FlowComplianceUnit::mL_Per_mmHg); SEFluidCircuitPath& LeftLeg1ToLeftLeg2 = cCardiovascular.CreatePath(LeftLeg1, LeftLeg2, BGE::CardiovascularPath::LeftLeg1ToLeftLeg2); LeftLeg1ToLeftLeg2.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceLegLeftVenous, FlowResistanceUnit::mmHg_s_Per_mL); - LeftLeg1ToLeftLeg2.SetCardiovascularRegion(CDM::enumResistancePathType::Extrasplanchnic); + LeftLeg1ToLeftLeg2.SetCardiovascularRegion(SEResistancePathType::Extrasplanchnic); SEFluidCircuitPath& LeftLeg2ToVenaCava = cCardiovascular.CreatePath(LeftLeg2, VenaCava, BGE::CardiovascularPath::LeftLeg2ToVenaCava); SEFluidCircuitPath& Aorta1ToLiver1 = cCardiovascular.CreatePath(Aorta1, Liver1, BGE::CardiovascularPath::Aorta1ToLiver1); Aorta1ToLiver1.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceLiver, FlowResistanceUnit::mmHg_s_Per_mL); - Aorta1ToLiver1.SetCardiovascularRegion(CDM::enumResistancePathType::Splanchnic); + Aorta1ToLiver1.SetCardiovascularRegion(SEResistancePathType::Splanchnic); SEFluidCircuitPath& Liver1ToGround = cCardiovascular.CreatePath(Liver1, Ground, BGE::CardiovascularPath::Liver1ToGround); Liver1ToGround.GetComplianceBaseline().SetValue(0.0, FlowComplianceUnit::mL_Per_mmHg); SEFluidCircuitPath& PortalVeinToLiver1 = cCardiovascular.CreatePath(PortalVein, Liver1, BGE::CardiovascularPath::PortalVeinToLiver1); PortalVeinToLiver1.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistancePortalVein, FlowResistanceUnit::mmHg_s_Per_mL); - PortalVeinToLiver1.SetCardiovascularRegion(CDM::enumResistancePathType::Splanchnic); + PortalVeinToLiver1.SetCardiovascularRegion(SEResistancePathType::Splanchnic); SEFluidCircuitPath& Liver1ToLiver2 = cCardiovascular.CreatePath(Liver1, Liver2, BGE::CardiovascularPath::Liver1ToLiver2); Liver1ToLiver2.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceLiverVenous, FlowResistanceUnit::mmHg_s_Per_mL); - Liver1ToLiver2.SetCardiovascularRegion(CDM::enumResistancePathType::Splanchnic); + Liver1ToLiver2.SetCardiovascularRegion(SEResistancePathType::Splanchnic); SEFluidCircuitPath& Liver2ToVenaCava = cCardiovascular.CreatePath(Liver2, VenaCava, BGE::CardiovascularPath::Liver2ToVenaCava); SEFluidCircuitPath& Aorta1ToMuscle1 = cCardiovascular.CreatePath(Aorta1, Muscle1, BGE::CardiovascularPath::Aorta1ToMuscle1); Aorta1ToMuscle1.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceMuscle, FlowResistanceUnit::mmHg_s_Per_mL); - Aorta1ToMuscle1.SetCardiovascularRegion(CDM::enumResistancePathType::Muscle); + Aorta1ToMuscle1.SetCardiovascularRegion(SEResistancePathType::Muscle); SEFluidCircuitPath& Muscle1ToGround = cCardiovascular.CreatePath(Muscle1, Ground, BGE::CardiovascularPath::Muscle1ToGround); Muscle1ToGround.GetComplianceBaseline().SetValue(0.0, FlowComplianceUnit::mL_Per_mmHg); SEFluidCircuitPath& Muscle1ToMuscle2 = cCardiovascular.CreatePath(Muscle1, Muscle2, BGE::CardiovascularPath::Muscle1ToMuscle2); Muscle1ToMuscle2.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceMuscleVenous, FlowResistanceUnit::mmHg_s_Per_mL); - Muscle1ToMuscle2.SetCardiovascularRegion(CDM::enumResistancePathType::Muscle); + Muscle1ToMuscle2.SetCardiovascularRegion(SEResistancePathType::Muscle); SEFluidCircuitPath& Muscle2ToVenaCava = cCardiovascular.CreatePath(Muscle2, VenaCava, BGE::CardiovascularPath::Muscle2ToVenaCava); SEFluidCircuitPath& Aorta1ToMyocardium1 = cCardiovascular.CreatePath(Aorta1, Myocardium1, BGE::CardiovascularPath::Aorta1ToMyocardium1); Aorta1ToMyocardium1.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceMyocardium, FlowResistanceUnit::mmHg_s_Per_mL); - Aorta1ToMyocardium1.SetCardiovascularRegion(CDM::enumResistancePathType::Myocardium); + Aorta1ToMyocardium1.SetCardiovascularRegion(SEResistancePathType::Myocardium); SEFluidCircuitPath& Myocardium1ToGround = cCardiovascular.CreatePath(Myocardium1, Ground, BGE::CardiovascularPath::Myocardium1ToGround); Myocardium1ToGround.GetComplianceBaseline().SetValue(0.0, FlowComplianceUnit::mL_Per_mmHg); SEFluidCircuitPath& Myocardium1ToMyocardium2 = cCardiovascular.CreatePath(Myocardium1, Myocardium2, BGE::CardiovascularPath::Myocardium1ToMyocardium2); Myocardium1ToMyocardium2.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceMyocardiumVenous, FlowResistanceUnit::mmHg_s_Per_mL); - Myocardium1ToMyocardium2.SetCardiovascularRegion(CDM::enumResistancePathType::Myocardium); + Myocardium1ToMyocardium2.SetCardiovascularRegion(SEResistancePathType::Myocardium); SEFluidCircuitPath& Myocardium2ToVenaCava = cCardiovascular.CreatePath(Myocardium2, VenaCava, BGE::CardiovascularPath::Myocardium2ToVenaCava); SEFluidCircuitPath& PericardiumToGround = cCardiovascular.CreatePath(Pericardium, Ground, BGE::CardiovascularPath::Pericardium1ToGround); @@ -1626,108 +1637,108 @@ void BioGears::SetupCardiovascular() SEFluidCircuitPath& Aorta1ToRightArm1 = cCardiovascular.CreatePath(Aorta1, RightArm1, BGE::CardiovascularPath::Aorta1ToRightArm1); Aorta1ToRightArm1.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceArmRight, FlowResistanceUnit::mmHg_s_Per_mL); - Aorta1ToRightArm1.SetCardiovascularRegion(CDM::enumResistancePathType::Extrasplanchnic); + Aorta1ToRightArm1.SetCardiovascularRegion(SEResistancePathType::Extrasplanchnic); SEFluidCircuitPath& RightArm1ToGround = cCardiovascular.CreatePath(RightArm1, Ground, BGE::CardiovascularPath::RightArm1ToGround); RightArm1ToGround.GetComplianceBaseline().SetValue(0.0, FlowComplianceUnit::mL_Per_mmHg); SEFluidCircuitPath& RightArm1ToRightArm2 = cCardiovascular.CreatePath(RightArm1, RightArm2, BGE::CardiovascularPath::RightArm1ToRightArm2); RightArm1ToRightArm2.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceArmRightVenous, FlowResistanceUnit::mmHg_s_Per_mL); - RightArm1ToRightArm2.SetCardiovascularRegion(CDM::enumResistancePathType::Extrasplanchnic); + RightArm1ToRightArm2.SetCardiovascularRegion(SEResistancePathType::Extrasplanchnic); SEFluidCircuitPath& RightArm2ToVenaCava = cCardiovascular.CreatePath(RightArm2, VenaCava, BGE::CardiovascularPath::RightArm2ToVenaCava); SEFluidCircuitPath& Aorta1ToRightKidney1 = cCardiovascular.CreatePath(Aorta1, RightKidney1, BGE::CardiovascularPath::Aorta1ToRightKidney1); Aorta1ToRightKidney1.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceKidney, FlowResistanceUnit::mmHg_s_Per_mL); - Aorta1ToRightKidney1.SetCardiovascularRegion(CDM::enumResistancePathType::Extrasplanchnic); + Aorta1ToRightKidney1.SetCardiovascularRegion(SEResistancePathType::Extrasplanchnic); SEFluidCircuitPath& RightKidney1ToGround = cCardiovascular.CreatePath(RightKidney1, Ground, BGE::CardiovascularPath::RightKidney1ToGround); RightKidney1ToGround.GetComplianceBaseline().SetValue(0.0, FlowComplianceUnit::mL_Per_mmHg); SEFluidCircuitPath& RightKidney1ToRightKidney2 = cCardiovascular.CreatePath(RightKidney1, RightKidney2, BGE::CardiovascularPath::RightKidney1ToRightKidney2); RightKidney1ToRightKidney2.GetResistanceBaseline().SetValue(ResistanceKidneyVenous, FlowResistanceUnit::mmHg_s_Per_mL); - RightKidney1ToRightKidney2.SetCardiovascularRegion(CDM::enumResistancePathType::Extrasplanchnic); + RightKidney1ToRightKidney2.SetCardiovascularRegion(SEResistancePathType::Extrasplanchnic); SEFluidCircuitPath& RightKidney2ToVenaCava = cCardiovascular.CreatePath(RightKidney2, VenaCava, BGE::CardiovascularPath::RightKidney2ToVenaCava); SEFluidCircuitPath& Aorta1ToRightLeg1 = cCardiovascular.CreatePath(Aorta1, RightLeg1, BGE::CardiovascularPath::Aorta1ToRightLeg1); Aorta1ToRightLeg1.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceLegRight, FlowResistanceUnit::mmHg_s_Per_mL); - Aorta1ToRightLeg1.SetCardiovascularRegion(CDM::enumResistancePathType::Extrasplanchnic); + Aorta1ToRightLeg1.SetCardiovascularRegion(SEResistancePathType::Extrasplanchnic); SEFluidCircuitPath& RightLeg1ToGround = cCardiovascular.CreatePath(RightLeg1, Ground, BGE::CardiovascularPath::RightLeg1ToGround); RightLeg1ToGround.GetComplianceBaseline().SetValue(0.0, FlowComplianceUnit::mL_Per_mmHg); SEFluidCircuitPath& RightLeg1ToRightLeg2 = cCardiovascular.CreatePath(RightLeg1, RightLeg2, BGE::CardiovascularPath::RightLeg1ToRightLeg2); RightLeg1ToRightLeg2.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceLegRightVenous, FlowResistanceUnit::mmHg_s_Per_mL); - RightLeg1ToRightLeg2.SetCardiovascularRegion(CDM::enumResistancePathType::Extrasplanchnic); + RightLeg1ToRightLeg2.SetCardiovascularRegion(SEResistancePathType::Extrasplanchnic); SEFluidCircuitPath& RightLeg2ToVenaCava = cCardiovascular.CreatePath(RightLeg2, VenaCava, BGE::CardiovascularPath::RightLeg2ToVenaCava); SEFluidCircuitPath& Aorta1ToSkin1 = cCardiovascular.CreatePath(Aorta1, Skin1, BGE::CardiovascularPath::Aorta1ToSkin1); Aorta1ToSkin1.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceSkin, FlowResistanceUnit::mmHg_s_Per_mL); - Aorta1ToSkin1.SetCardiovascularRegion(CDM::enumResistancePathType::Extrasplanchnic); + Aorta1ToSkin1.SetCardiovascularRegion(SEResistancePathType::Extrasplanchnic); SEFluidCircuitPath& Skin1ToGround = cCardiovascular.CreatePath(Skin1, Ground, BGE::CardiovascularPath::Skin1ToGround); Skin1ToGround.GetComplianceBaseline().SetValue(0.0, FlowComplianceUnit::mL_Per_mmHg); SEFluidCircuitPath& Skin1ToSkin2 = cCardiovascular.CreatePath(Skin1, Skin2, BGE::CardiovascularPath::Skin1ToSkin2); Skin1ToSkin2.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceSkinVenous, FlowResistanceUnit::mmHg_s_Per_mL); - Skin1ToSkin2.SetCardiovascularRegion(CDM::enumResistancePathType::Extrasplanchnic); + Skin1ToSkin2.SetCardiovascularRegion(SEResistancePathType::Extrasplanchnic); SEFluidCircuitPath& Skin2ToVenaCava = cCardiovascular.CreatePath(Skin2, VenaCava, BGE::CardiovascularPath::Skin2ToVenaCava); SEFluidCircuitPath& Aorta1ToSmallIntestine = cCardiovascular.CreatePath(Aorta1, SmallIntestine, BGE::CardiovascularPath::Aorta1ToSmallIntestine); Aorta1ToSmallIntestine.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceSmallIntestine, FlowResistanceUnit::mmHg_s_Per_mL); - Aorta1ToSmallIntestine.SetCardiovascularRegion(CDM::enumResistancePathType::Splanchnic); + Aorta1ToSmallIntestine.SetCardiovascularRegion(SEResistancePathType::Splanchnic); SEFluidCircuitPath& SmallIntestineToGround = cCardiovascular.CreatePath(SmallIntestine, Ground, BGE::CardiovascularPath::SmallIntestineToGround); SmallIntestineToGround.GetComplianceBaseline().SetValue(0.0, FlowComplianceUnit::mL_Per_mmHg); SEFluidCircuitPath& SmallIntestineToPortalVein = cCardiovascular.CreatePath(SmallIntestine, PortalVein, BGE::CardiovascularPath::SmallIntestineToPortalVein); - SmallIntestineToPortalVein.SetCardiovascularRegion(CDM::enumResistancePathType::Splanchnic); + SmallIntestineToPortalVein.SetCardiovascularRegion(SEResistancePathType::Splanchnic); SmallIntestineToPortalVein.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceSmallIntestineVenous, FlowResistanceUnit::mmHg_s_Per_mL); SEFluidCircuitPath& Aorta1ToSplanchnic = cCardiovascular.CreatePath(Aorta1, Splanchnic, BGE::CardiovascularPath::Aorta1ToSplanchnic); Aorta1ToSplanchnic.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceSplanchnic, FlowResistanceUnit::mmHg_s_Per_mL); - Aorta1ToSplanchnic.SetCardiovascularRegion(CDM::enumResistancePathType::Splanchnic); + Aorta1ToSplanchnic.SetCardiovascularRegion(SEResistancePathType::Splanchnic); SEFluidCircuitPath& SplanchnicToGround = cCardiovascular.CreatePath(Splanchnic, Ground, BGE::CardiovascularPath::SplanchnicToGround); SplanchnicToGround.GetComplianceBaseline().SetValue(0.0, FlowComplianceUnit::mL_Per_mmHg); SEFluidCircuitPath& SplanchnicToPortalVein = cCardiovascular.CreatePath(Splanchnic, PortalVein, BGE::CardiovascularPath::SplanchnicToPortalVein); SplanchnicToPortalVein.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceSplanchnicVenous, FlowResistanceUnit::mmHg_s_Per_mL); - SplanchnicToPortalVein.SetCardiovascularRegion(CDM::enumResistancePathType::Splanchnic); + SplanchnicToPortalVein.SetCardiovascularRegion(SEResistancePathType::Splanchnic); SEFluidCircuitPath& Aorta1ToSpleen = cCardiovascular.CreatePath(Aorta1, Spleen, BGE::CardiovascularPath::Aorta1ToSpleen); Aorta1ToSpleen.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceSpleen, FlowResistanceUnit::mmHg_s_Per_mL); - Aorta1ToSpleen.SetCardiovascularRegion(CDM::enumResistancePathType::Splanchnic); + Aorta1ToSpleen.SetCardiovascularRegion(SEResistancePathType::Splanchnic); SEFluidCircuitPath& SpleenToGround = cCardiovascular.CreatePath(Spleen, Ground, BGE::CardiovascularPath::SpleenToGround); SpleenToGround.GetComplianceBaseline().SetValue(0.0, FlowComplianceUnit::mL_Per_mmHg); SEFluidCircuitPath& SpleenToPortalVein = cCardiovascular.CreatePath(Spleen, PortalVein, BGE::CardiovascularPath::SpleenToPortalVein); SpleenToPortalVein.GetResistanceBaseline().SetValue(systemicResistanceModifier * ResistanceSpleenVenous, FlowResistanceUnit::mmHg_s_Per_mL); - SpleenToPortalVein.SetCardiovascularRegion(CDM::enumResistancePathType::Splanchnic); + SpleenToPortalVein.SetCardiovascularRegion(SEResistancePathType::Splanchnic); SEFluidCircuitPath& VenaCavaToGround = cCardiovascular.CreatePath(VenaCava, Ground, BGE::CardiovascularPath::VenaCavaToGround); VenaCavaToGround.GetComplianceBaseline().SetValue(0.0, FlowComplianceUnit::mL_Per_mmHg); SEFluidCircuitPath& VenaCavaBleed = cCardiovascular.CreatePath(VenaCava, Ground, BGE::CardiovascularPath::VenaCavaBleed); - VenaCavaBleed.GetResistanceBaseline().SetValue(m_Config->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); + VenaCavaBleed.GetResistanceBaseline().SetValue(m_Configuration->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); SEFluidCircuitPath& IVToVenaCava = cCardiovascular.CreatePath(Ground, VenaCava, BGE::CardiovascularPath::IVToVenaCava); IVToVenaCava.GetFlowSourceBaseline().SetValue(0.0, VolumePerTimeUnit::mL_Per_s); - //Hemorrhage--Include major organs, if there is a right/left side just adjust the resistance of the right side + // Hemorrhage--Include major organs, if there is a right/left side just adjust the resistance of the right side SEFluidCircuitPath& AortaBleed = cCardiovascular.CreatePath(Aorta1, Ground, BGE::CardiovascularPath::AortaBleed); - AortaBleed.GetResistanceBaseline().SetValue(m_Config->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); + AortaBleed.GetResistanceBaseline().SetValue(m_Configuration->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); SEFluidCircuitPath& HeartBleed = cCardiovascular.CreatePath(Myocardium1, Ground, BGE::CardiovascularPath::MyocardiumBleed); - HeartBleed.GetResistanceBaseline().SetValue(m_Config->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); + HeartBleed.GetResistanceBaseline().SetValue(m_Configuration->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); SEFluidCircuitPath& LeftLungBleed = cCardiovascular.CreatePath(LeftPulmonaryArteries, Ground, BGE::CardiovascularPath::LeftLungBleed); - LeftLungBleed.GetResistanceBaseline().SetValue(m_Config->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); + LeftLungBleed.GetResistanceBaseline().SetValue(m_Configuration->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); SEFluidCircuitPath& RightLungBleed = cCardiovascular.CreatePath(RightPulmonaryArteries, Ground, BGE::CardiovascularPath::RightLungBleed); - RightLungBleed.GetResistanceBaseline().SetValue(m_Config->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); + RightLungBleed.GetResistanceBaseline().SetValue(m_Configuration->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); SEFluidCircuitPath& LeftArmBleed = cCardiovascular.CreatePath(LeftArm1, Ground, BGE::CardiovascularPath::LeftArmBleed); - LeftArmBleed.GetResistanceBaseline().SetValue(m_Config->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); + LeftArmBleed.GetResistanceBaseline().SetValue(m_Configuration->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); SEFluidCircuitPath& RightArmBleed = cCardiovascular.CreatePath(RightArm1, Ground, BGE::CardiovascularPath::RightArmBleed); - RightArmBleed.GetResistanceBaseline().SetValue(m_Config->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); + RightArmBleed.GetResistanceBaseline().SetValue(m_Configuration->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); SEFluidCircuitPath& SpleenBleed = cCardiovascular.CreatePath(Spleen, Ground, BGE::CardiovascularPath::SpleenBleed); - SpleenBleed.GetResistanceBaseline().SetValue(m_Config->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); + SpleenBleed.GetResistanceBaseline().SetValue(m_Configuration->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); SEFluidCircuitPath& SmallIntestineBleed = cCardiovascular.CreatePath(SmallIntestine, Ground, BGE::CardiovascularPath::SmallIntestineBleed); - SmallIntestineBleed.GetResistanceBaseline().SetValue(m_Config->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); + SmallIntestineBleed.GetResistanceBaseline().SetValue(m_Configuration->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); SEFluidCircuitPath& LargeIntestineBleed = cCardiovascular.CreatePath(LargeIntestine, Ground, BGE::CardiovascularPath::LargeIntestineBleed); - LargeIntestineBleed.GetResistanceBaseline().SetValue(m_Config->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); + LargeIntestineBleed.GetResistanceBaseline().SetValue(m_Configuration->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); SEFluidCircuitPath& SplanchnicBleed = cCardiovascular.CreatePath(Splanchnic, Ground, BGE::CardiovascularPath::SplanchnicBleed); - SplanchnicBleed.GetResistanceBaseline().SetValue(m_Config->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); + SplanchnicBleed.GetResistanceBaseline().SetValue(m_Configuration->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); SEFluidCircuitPath& LiverBleed = cCardiovascular.CreatePath(Liver1, Ground, BGE::CardiovascularPath::LiverBleed); - LiverBleed.GetResistanceBaseline().SetValue(m_Config->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); + LiverBleed.GetResistanceBaseline().SetValue(m_Configuration->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); SEFluidCircuitPath& PortalBleed = cCardiovascular.CreatePath(PortalVein, Ground, BGE::CardiovascularPath::PortalBleed); - PortalBleed.GetResistanceBaseline().SetValue(m_Config->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_min_Per_L); - //Note: kidney hemorrhage path is set below in renal circuit + PortalBleed.GetResistanceBaseline().SetValue(m_Configuration->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_min_Per_L); + // Note: kidney hemorrhage path is set below in renal circuit SEFluidCircuitPath& LeftLegBleed = cCardiovascular.CreatePath(LeftLeg1, Ground, BGE::CardiovascularPath::LeftLegBleed); - LeftLegBleed.GetResistanceBaseline().SetValue(m_Config->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); + LeftLegBleed.GetResistanceBaseline().SetValue(m_Configuration->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); SEFluidCircuitPath& RightLegBleed = cCardiovascular.CreatePath(RightLeg1, Ground, BGE::CardiovascularPath::RightLegBleed); - RightLegBleed.GetResistanceBaseline().SetValue(m_Config->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); + RightLegBleed.GetResistanceBaseline().SetValue(m_Configuration->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); // Compute compliances from target pressures and baseline volumes for (SEFluidCircuitPath* p : cCardiovascular.GetPaths()) { @@ -1753,7 +1764,7 @@ void BioGears::SetupCardiovascular() // and there will be issues with available flow as the elastance decreases during the first relaxation phase. // The 1/4 full initialization gives decent results. // RightHeart1ToRightHeart3.GetComplianceBaseline().SetValue(InitialComplianceHeartRight, FlowComplianceUnit::mL_Per_mmHg); - //LeftHeart1ToLeftHeart3.GetComplianceBaseline().SetValue(InitialComplianceHeartLeft, FlowComplianceUnit::mL_Per_mmHg); + // LeftHeart1ToLeftHeart3.GetComplianceBaseline().SetValue(InitialComplianceHeartLeft, FlowComplianceUnit::mL_Per_mmHg); LeftVentricle1ToLeftVentricle2.GetComplianceBaseline().SetValue(1.0 / 0.049, FlowComplianceUnit::mL_Per_mmHg); RightVentricle1ToRightVentricle2.GetComplianceBaseline().SetValue(1.0 / 0.0243, FlowComplianceUnit::mL_Per_mmHg); PericardiumToGround.GetComplianceBaseline().SetValue(100.0, FlowComplianceUnit::mL_Per_mmHg); @@ -1766,7 +1777,7 @@ void BioGears::SetupCardiovascular() double VolumeModifierSkin = 1.007306 * 1.035695, VolumeModifierSmallIntestine = 1.17528 * 0.986509, VolumeModifierSplanchnic = 1.17528 * 0.986509, VolumeModifierSpleen = 1.17528 * 0.986509; double VolumeModifierVenaCava = 0.66932 * 1.134447; - //And also modify the compliances + // And also modify the compliances Aorta1ToGround.GetComplianceBaseline().SetValue(largeArteriesComplianceModifier * Aorta1ToGround.GetComplianceBaseline(FlowComplianceUnit::mL_Per_mmHg), FlowComplianceUnit::mL_Per_mmHg); RightPulmonaryArteries.GetVolumeBaseline().SetValue(VolumeModifierPulmArtR * RightPulmonaryArteries.GetVolumeBaseline(VolumeUnit::mL), VolumeUnit::mL); @@ -2007,7 +2018,7 @@ void BioGears::SetupCardiovascular() ///////////////////// // Heart and Lungs // SELiquidCompartmentLink& vVenaCavaToRightAtrium = m_Compartments->CreateLiquidLink(vVenaCava, vRightAtrium, BGE::VascularLink::VenaCavaToRightAtrium); - //vVenaCavaToRightHeart.MapPath(VenaCavaToRightHeart2); + // vVenaCavaToRightHeart.MapPath(VenaCavaToRightHeart2); vVenaCavaToRightAtrium.MapPath(VenaCavaToRightAtrium1); SELiquidCompartmentLink& vRightAtriumToRightVentricle = m_Compartments->CreateLiquidLink(vRightAtrium, vRightVentricle, BGE::VascularLink::RightAtriumToRightVentricle); vRightAtriumToRightVentricle.MapPath(RightAtrium2ToRightVentricle1); @@ -2164,7 +2175,7 @@ void BioGears::SetupCardiovascular() vLargeIntestineHemorrhage.MapPath(LargeIntestineBleed); SELiquidCompartmentLink& vSplanchnicHemorrhage = m_Compartments->CreateLiquidLink(vSplanchnic, vGround, BGE::VascularLink::SplanchnicHemorrhage); vSplanchnicHemorrhage.MapPath(SplanchnicBleed); - //Take care of kidney hemorrhage in renal circuit set up below + // Take care of kidney hemorrhage in renal circuit set up below SELiquidCompartmentLink& vLiverHemorrhage = m_Compartments->CreateLiquidLink(vLiver, vGround, BGE::VascularLink::LiverHemorrhage); vLiverHemorrhage.MapPath(LiverBleed); SELiquidCompartmentLink& vLeftLegHemorrhage = m_Compartments->CreateLiquidLink(vLeftLeg, vGround, BGE::VascularLink::LeftLegHemorrhage); @@ -2280,18 +2291,18 @@ void BioGears::SetupCerebral() SEFluidCircuit& CardioCircuit = m_Circuits->GetCardiovascularCircuit(); //--------------------Define target circuit values--------------------------------------- - //Get target flow from cardiovascular circuit--probably seems circuitous but I'd rather this function know if the target in SetupCardiovascular changes + // Get target flow from cardiovascular circuit--probably seems circuitous but I'd rather this function know if the target in SetupCardiovascular changes double cardioBrain1Pressure = CardioCircuit.GetNode(BGE::CardiovascularNode::Brain1)->GetPressure(PressureUnit::mmHg); double cardioAorta1Pressure = CardioCircuit.GetNode(BGE::CardiovascularNode::Aorta1)->GetPressure(PressureUnit::mmHg); double cardioAortaToBrainResistance = CardioCircuit.GetPath(BGE::CardiovascularPath::Aorta1ToBrain1)->GetResistanceBaseline(FlowResistanceUnit::mmHg_s_Per_mL); double cerebralTargetFlow_mL_Per_s = (cardioAorta1Pressure - cardioBrain1Pressure) / cardioAortaToBrainResistance; double cerebralTargetVolume_mL = CardioCircuit.GetNode(BGE::CardiovascularNode::Brain1)->GetVolumeBaseline(VolumeUnit::mL); - //Remaining parameters derived from Lu2003Cerebral - //Target cerebral spinal fluid flow--same target for both formation and absorption since net = 0 at steady state + // Remaining parameters derived from Lu2003Cerebral + // Target cerebral spinal fluid flow--same target for both formation and absorption since net = 0 at steady state double cerebroSpinalFluidFlow_mL_Per_s = Convert(560.0, VolumePerTimeUnit::mL_Per_day, VolumePerTimeUnit::mL_Per_s); - //Target volumes--Lu assumes 100 mL of brain vasculature disctributed 20/20/60 (discounting neck), so scale reported values by BioGears target - //Factor in volume modifier applied to vascular nodes in Setup Cardiovascular since this will affect the stabilized pressure after tuning + // Target volumes--Lu assumes 100 mL of brain vasculature disctributed 20/20/60 (discounting neck), so scale reported values by BioGears target + // Factor in volume modifier applied to vascular nodes in Setup Cardiovascular since this will affect the stabilized pressure after tuning double VolumeModifierBrain = 0.998011 * 1.038409; double neckArteriesVolume_mL = 15.0 * VolumeModifierBrain; double cerebralArteriesVolume_mL = 0.2 * cerebralTargetVolume_mL * VolumeModifierBrain; @@ -2299,16 +2310,16 @@ void BioGears::SetupCerebral() double cerebralVeinsVolume_mL = 0.6 * cerebralTargetVolume_mL * VolumeModifierBrain; double neckVeinsVolume_mL = 35.0 * VolumeModifierBrain; double intracranialVolume_mL = 150.0 * VolumeModifierBrain; - //Target pressures - double neckArteriesPressure_mmHg = 85.0; //This pressure is below enforced patient systolic baseline of 90mmHg, so we can safely hard-code this value + // Target pressures + double neckArteriesPressure_mmHg = 85.0; // This pressure is below enforced patient systolic baseline of 90mmHg, so we can safely hard-code this value double cerebralArteries1Pressure_mmHg = 65.0; double cerebralAreteries2Pressure_mmHg = cerebralArteries1Pressure_mmHg; double cerebralCapillariesPressure_mmHg = 25.0; double cerebralVeins1Pressure_mmHg = 14.0; - double cerebralVeins2Pressure_mmHg = 7.5; //Assumed--value should be < ICP (10.0) but greater than vena cava pressure (~4) + double cerebralVeins2Pressure_mmHg = 7.5; // Assumed--value should be < ICP (10.0) but greater than vena cava pressure (~4) double neckVeinsPressure_mmHg = cerebralVeins2Pressure_mmHg; double intracranialPressure_mmHg = 15.0; - //Derive restistance elements + // Derive restistance elements double aorta1ToNeckArteriesResitance_mmHg_s_Per_mL = (CardioCircuit.GetNode(BGE::CardiovascularNode::Aorta1)->GetPressure(PressureUnit::mmHg) - neckArteriesPressure_mmHg) / cerebralTargetFlow_mL_Per_s; double neckToCerebralArteries1Resistance_mmHg_s_Per_mL = (neckArteriesPressure_mmHg - cerebralArteries1Pressure_mmHg) / cerebralTargetFlow_mL_Per_s; double cerebralArteries2ToCapillariesResistance_mmHg_s_Per_mL = (cerebralAreteries2Pressure_mmHg - cerebralCapillariesPressure_mmHg) / cerebralTargetFlow_mL_Per_s; @@ -2317,15 +2328,15 @@ void BioGears::SetupCerebral() double neckVeinsToVenaCavaResistance_mmHg_s_Per_mL = (neckVeinsPressure_mmHg - CardioCircuit.GetNode(BGE::CardiovascularNode::VenaCava)->GetPressure(PressureUnit::mmHg)) / cerebralTargetFlow_mL_Per_s; double cerebralArteries2ToSpinalFluidResistance_mmHg_s_Per_mL = (cerebralAreteries2Pressure_mmHg - intracranialPressure_mmHg) / cerebroSpinalFluidFlow_mL_Per_s; double spinalFluidToVeinsCheckResistance_mmHg_s_Per_mL = (intracranialPressure_mmHg - cerebralVeins2Pressure_mmHg) / cerebroSpinalFluidFlow_mL_Per_s; - //Compliance elements + // Compliance elements double neckArteriesToGroundCompliance_mL_Per_mmHg = 0.20; double cerebralArteries1ToSpinalFluidCompliance_mL_Per_mmHg = 0.20; double cerebralCapillariesToSpinalFluidCompliance_mL_Per_mmHg = 0.22; double cerebralVeins1ToSpinalFluidCompliance_mL_Per_mmHg = 1.0; - double intracranialCompliance_mL_Per_mmHg = 1.0 / (0.11 * intracranialPressure_mmHg); //Lu cites 0.11 as an "intracranial rigidity" factor + double intracranialCompliance_mL_Per_mmHg = 1.0 / (0.11 * intracranialPressure_mmHg); // Lu cites 0.11 as an "intracranial rigidity" factor //------------------------Cerebral Circuit (n = nodes, p = paths)----------------------- - //Create circuit nodes + // Create circuit nodes SEFluidCircuitNode& nGround = CerebralCircuit.CreateNode(BGE::CerebralNode::Ground); nGround.GetPressure().SetValue(0.0, PressureUnit::mmHg); CerebralCircuit.AddReferenceNode(nGround); @@ -2363,10 +2374,10 @@ void BioGears::SetupCerebral() nSpinalFluid.GetPressure().SetValue(intracranialPressure_mmHg, PressureUnit::mmHg); nSpinalFluid.GetVolumeBaseline().SetValue(intracranialVolume_mL, VolumeUnit::mL); - //Paths + // Paths SEFluidCircuitPath& pNeckArteriesToCerebralArteries1 = CerebralCircuit.CreatePath(nNeckArteries, nCerebralArteries1, BGE::CerebralPath::NeckArteriesToCerebralArteries1); pNeckArteriesToCerebralArteries1.GetResistanceBaseline().SetValue(neckToCerebralArteries1Resistance_mmHg_s_Per_mL, FlowResistanceUnit::mmHg_s_Per_mL); - pNeckArteriesToCerebralArteries1.SetCardiovascularRegion(CDM::enumResistancePathType::Cerebral); + pNeckArteriesToCerebralArteries1.SetCardiovascularRegion(SEResistancePathType::Cerebral); SEFluidCircuitPath& pNeckArteriesToGround = CerebralCircuit.CreatePath(nNeckArteries, nGround, BGE::CerebralPath::NeckArteriesToGround); pNeckArteriesToGround.GetComplianceBaseline().SetValue(neckArteriesToGroundCompliance_mL_Per_mmHg, FlowComplianceUnit::mL_Per_mmHg); @@ -2381,18 +2392,18 @@ void BioGears::SetupCerebral() SEFluidCircuitPath& pCerebralArteries2ToCapillaries = CerebralCircuit.CreatePath(nCerebralArteries2, nCerebralCapillaries, BGE::CerebralPath::CerebralArteries2ToCapillaries); pCerebralArteries2ToCapillaries.GetResistanceBaseline().SetValue(cerebralArteries2ToCapillariesResistance_mmHg_s_Per_mL, FlowResistanceUnit::mmHg_s_Per_mL); - pCerebralArteries2ToCapillaries.SetCardiovascularRegion(CDM::enumResistancePathType::Cerebral); + pCerebralArteries2ToCapillaries.SetCardiovascularRegion(SEResistancePathType::Cerebral); SEFluidCircuitPath& pCerebralCapillariesToSpinalFluid = CerebralCircuit.CreatePath(nCerebralCapillaries, nSpinalFluid, BGE::CerebralPath::CerebralCapillariesToSpinalFluid); pCerebralCapillariesToSpinalFluid.GetComplianceBaseline().SetValue(cerebralCapillariesToSpinalFluidCompliance_mL_Per_mmHg, FlowComplianceUnit::mL_Per_mmHg); SEFluidCircuitPath& pCerebralCapillariesToCerebralVeins1 = CerebralCircuit.CreatePath(nCerebralCapillaries, nCerebralVeins1, BGE::CerebralPath::CerebralCapillariesToCerebralVeins1); pCerebralCapillariesToCerebralVeins1.GetResistanceBaseline().SetValue(cerebralCapillariesToVeins1Resistance_mmHg_s_Per_mL, FlowResistanceUnit::mmHg_s_Per_mL); - pCerebralCapillariesToCerebralVeins1.SetCardiovascularRegion(CDM::enumResistancePathType::Cerebral); + pCerebralCapillariesToCerebralVeins1.SetCardiovascularRegion(SEResistancePathType::Cerebral); SEFluidCircuitPath& pCerebralVeins1ToVeins2 = CerebralCircuit.CreatePath(nCerebralVeins1, nCerebralVeins2, BGE::CerebralPath::CerebralVeins1ToCerebralVeins2); pCerebralVeins1ToVeins2.GetResistanceBaseline().SetValue(cerebralVeins1ToVeins2Resistance_mmHg_s_Per_mL, FlowResistanceUnit::mmHg_s_Per_mL); - pCerebralVeins1ToVeins2.SetCardiovascularRegion(CDM::enumResistancePathType::Cerebral); + pCerebralVeins1ToVeins2.SetCardiovascularRegion(SEResistancePathType::Cerebral); SEFluidCircuitPath& pCerebralVeins2ToNeckVeins = CerebralCircuit.CreatePath(nCerebralVeins2, nNeckVeins, BGE::CerebralPath::CerebralVeins2ToNeckVeins); @@ -2403,7 +2414,7 @@ void BioGears::SetupCerebral() pSpinalFluidToCerebralVeinsCheck.GetResistanceBaseline().SetValue(spinalFluidToVeinsCheckResistance_mmHg_s_Per_mL, FlowResistanceUnit::mmHg_s_Per_mL); SEFluidCircuitPath& pCerebralVeinsCheckToVeins2 = CerebralCircuit.CreatePath(nCerebralVeinsCheck, nCerebralVeins2, BGE::CerebralPath::CerebralVeinsCheckToCerebralVeins2); - pCerebralVeinsCheckToVeins2.SetNextValve(CDM::enumOpenClosed::Closed); + pCerebralVeinsCheckToVeins2.SetNextValve(SEOpenClosed::Closed); SEFluidCircuitPath& pSpinalFluidToGround = CerebralCircuit.CreatePath(nSpinalFluid, nGround, BGE::CerebralPath::SpinalFluidToGround); pSpinalFluidToGround.GetComplianceBaseline().SetValue(intracranialCompliance_mL_Per_mmHg, FlowComplianceUnit::mL_Per_mmHg); @@ -2422,7 +2433,7 @@ void BioGears::SetupCerebral() // Hemorrhage--Specific to brain with new cerebral circuit SEFluidCircuitPath& BrainBleed = CerebralCircuit.CreatePath(nCerebralCapillaries, nGround, BGE::CardiovascularPath::BrainBleed); - BrainBleed.GetResistanceBaseline().SetValue(m_Config->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); + BrainBleed.GetResistanceBaseline().SetValue(m_Configuration->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); CombinedCardioCircuit.AddCircuit(CerebralCircuit); // Grab the nodes that we will be connecting between the 2 circuits @@ -2431,17 +2442,17 @@ void BioGears::SetupCerebral() // Add the new connection paths SEFluidCircuitPath& pAorta1ToNeckArteries = CombinedCardioCircuit.CreatePath(*nAorta1, nNeckArteries, BGE::CardiovascularPath::Aorta1ToNeckArteries); pAorta1ToNeckArteries.GetResistanceBaseline().SetValue(aorta1ToNeckArteriesResitance_mmHg_s_Per_mL, FlowResistanceUnit::mmHg_s_Per_mL); - pAorta1ToNeckArteries.SetCardiovascularRegion(CDM::enumResistancePathType::Cerebral); + pAorta1ToNeckArteries.SetCardiovascularRegion(SEResistancePathType::Cerebral); SEFluidCircuitPath& pNeckVeinsToVenaCava = CombinedCardioCircuit.CreatePath(nNeckVeins, *nVenaCava, BGE::CardiovascularPath::NeckVeinsToVenaCava); pNeckVeinsToVenaCava.GetResistanceBaseline().SetValue(neckVeinsToVenaCavaResistance_mmHg_s_Per_mL, FlowResistanceUnit::mmHg_s_Per_mL); - pNeckVeinsToVenaCava.SetCardiovascularRegion(CDM::enumResistancePathType::Cerebral); + pNeckVeinsToVenaCava.SetCardiovascularRegion(SEResistancePathType::Cerebral); // Update the circuit CombinedCardioCircuit.SetNextAndCurrentFromBaselines(); CombinedCardioCircuit.StateChange(); //---------------------Set up Cerebral Graph (c = compartment, l = liquid link)------------------- - //Compartments + // Compartments SELiquidCompartment& cNeckArteries = m_Compartments->CreateLiquidCompartment(BGE::VascularCompartment::NeckArteries); cNeckArteries.MapNode(nNeckArteries); @@ -2465,17 +2476,17 @@ void BioGears::SetupCerebral() cSpinalFluid.MapNode(nSpinalFluid); SELiquidCompartment& cBrain = *m_Compartments->GetLiquidCompartment(BGE::VascularCompartment::Brain); - cBrain.GetNodeMapping().Clear(); + cBrain.GetNodeMapping().Invalidate(); cBrain.AddChild(cCerebralArteries); cBrain.AddChild(cCerebralCapillaries); cBrain.AddChild(cCerebralVeins); - //Existing compartments to link with cerebral graph + // Existing compartments to link with cerebral graph SELiquidCompartment& cAorta = *m_Compartments->GetLiquidCompartment(BGE::VascularCompartment::Aorta); SELiquidCompartment& cVenaCava = *m_Compartments->GetLiquidCompartment(BGE::VascularCompartment::VenaCava); - //Liquid Links - m_Compartments->DeleteLiquidLink(BGE::VascularLink::AortaToBrain); //Replace this link + // Liquid Links + m_Compartments->DeleteLiquidLink(BGE::VascularLink::AortaToBrain); // Replace this link SELiquidCompartmentLink& lAortaToNeckArteries = m_Compartments->CreateLiquidLink(cAorta, cNeckArteries, BGE::VascularLink::AortaToNeckArteries); lAortaToNeckArteries.MapPath(pAorta1ToNeckArteries); @@ -2492,11 +2503,11 @@ void BioGears::SetupCerebral() SELiquidCompartmentLink& lCerebralVeinsToNeckVeins = m_Compartments->CreateLiquidLink(cCerebralVeins, cNeckVeins, BGE::VascularLink::CerebralVeinsToNeckVeins); lCerebralVeinsToNeckVeins.MapPath(pCerebralVeins2ToNeckVeins); - m_Compartments->DeleteLiquidLink(BGE::VascularLink::BrainToVenaCava); //Replace this link + m_Compartments->DeleteLiquidLink(BGE::VascularLink::BrainToVenaCava); // Replace this link SELiquidCompartmentLink& lNeckVeinsToVenaCava = m_Compartments->CreateLiquidLink(cNeckVeins, cVenaCava, BGE::VascularLink::NeckVeinsToVenaCava); lNeckVeinsToVenaCava.MapPath(pNeckVeinsToVenaCava); - //Delete cerebral hemorrhage link (re-define after some more testing), otherwise graph will go searching for old BrainVasculature cmpt, which is called by this link + // Delete cerebral hemorrhage link (re-define after some more testing), otherwise graph will go searching for old BrainVasculature cmpt, which is called by this link m_Compartments->DeleteLiquidLink(BGE::VascularLink::BrainHemorrhage); SELiquidCompartment& cGround = m_Compartments->CreateLiquidCompartment(BGE::VascularCompartment::Ground); @@ -2504,7 +2515,7 @@ void BioGears::SetupCerebral() SELiquidCompartmentLink& lBrainHemorrhage = m_Compartments->CreateLiquidLink(cCerebralCapillaries, cGround, BGE::VascularLink::BrainHemorrhage); lBrainHemorrhage.MapPath(BrainBleed); - //Add compartments and links to cerebral graph + // Add compartments and links to cerebral graph SELiquidCompartmentGraph& gCerebral = m_Compartments->GetCerebralGraph(); gCerebral.AddCompartment(cAorta); gCerebral.AddCompartment(cVenaCava); @@ -2524,7 +2535,7 @@ void BioGears::SetupCerebral() gCerebral.StateChange(); - //Remove brain cmpt from active CV graph (because it's discretized into smaller cmpts) and then add cerebral graph + // Remove brain cmpt from active CV graph (because it's discretized into smaller cmpts) and then add cerebral graph m_Compartments->GetActiveCardiovascularGraph().RemoveCompartment(*m_Compartments->GetLiquidCompartment(BGE::VascularCompartment::Brain)); m_Compartments->GetActiveCardiovascularGraph().AddGraph(gCerebral); m_Compartments->GetActiveCardiovascularGraph().StateChange(); @@ -2537,16 +2548,16 @@ void BioGears::SetupRenal() // Circuit Interdependence SEFluidCircuit& cCardiovascular = m_Circuits->GetCardiovascularCircuit(); - //assuming there is a left and right kidney node in cardiovascular AND that a baseline volume is set (as a function of patient mass): + // assuming there is a left and right kidney node in cardiovascular AND that a baseline volume is set (as a function of patient mass): double leftKidneyFluidVolume_mL = cCardiovascular.GetNode(BGE::CardiovascularNode::LeftKidney1)->GetVolumeBaseline(VolumeUnit::mL); double rightKidneyFluidVolume_mL = cCardiovascular.GetNode(BGE::CardiovascularNode::RightKidney1)->GetVolumeBaseline(VolumeUnit::mL); - double singleKidneyLargeVasculatureFluidVolume_mL = leftKidneyFluidVolume_mL / 2; //Total large vasculature fluid volume - double singleKidneySmallVasculatureFluidVolume_mL = leftKidneyFluidVolume_mL / 2; //Total small vasculature fluid volume + double singleKidneyLargeVasculatureFluidVolume_mL = leftKidneyFluidVolume_mL / 2; // Total large vasculature fluid volume + double singleKidneySmallVasculatureFluidVolume_mL = leftKidneyFluidVolume_mL / 2; // Total small vasculature fluid volume ////////////////////////// ///// Circuit Parameters////// - double openSwitch_mmHg_s_Per_mL = m_Config->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL); - //Resistances with some tuning multipliers + double openSwitch_mmHg_s_Per_mL = m_Configuration->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL); + // Resistances with some tuning multipliers double urineTuningMultiplier = 0.9; double arteryTuningMultiplier = 0.8; double reabsorptionTuningMultiplier = 0.5; @@ -2562,43 +2573,43 @@ void BioGears::SetupRenal() double glomerularFilterResistance_mmHg_s_Per_mL = Convert(0.1600 * gfrTuning, FlowResistanceUnit::mmHg_min_Per_mL, FlowResistanceUnit::mmHg_s_Per_mL); double tubulesResistance_mmHg_s_Per_mL = Convert(0.1920 * urineTuningMultiplier, FlowResistanceUnit::mmHg_min_Per_mL, FlowResistanceUnit::mmHg_s_Per_mL); double reabsoprtionResistance_mmHg_s_Per_mL = Convert(0.1613 * reabsorptionTuningMultiplier, FlowResistanceUnit::mmHg_min_Per_mL, FlowResistanceUnit::mmHg_s_Per_mL); - //This one is tuned + // This one is tuned double ureterTuningMultiplier = 0.59; double ureterResistance_mmHg_s_Per_mL = Convert(30.0 * ureterTuningMultiplier, FlowResistanceUnit::mmHg_min_Per_mL, FlowResistanceUnit::mmHg_s_Per_mL); double urethraResistance_mmHg_s_Per_mL = openSwitch_mmHg_s_Per_mL; - //Compliances - //0.5 * CapacitanceKidney is the per-kidney value from 3 element Windkessel + // Compliances + // 0.5 * CapacitanceKidney is the per-kidney value from 3 element Windkessel double totalCompliance = (0.5 * (0.91 * 1.7560) * 0.02); - //The fractions here should add to 1.0; + // The fractions here should add to 1.0; double renalArteryCompliance_mL_Per_mmHg = totalCompliance * 0.11; double renalVeinCompliance_mL_Per_mmHg = totalCompliance * 0.70; double glomerularCompliance_mL_Per_mmHg = totalCompliance * 0.11; ///\todo The bladder is currently not being modeled as a compliance - //double bladderCompliance_mL_Per_mmHg = Convert(38.3, FlowComplianceUnit::mL_Per_cmH2O, FlowComplianceUnit::mL_Per_mmHg); + // double bladderCompliance_mL_Per_mmHg = Convert(38.3, FlowComplianceUnit::mL_Per_cmH2O, FlowComplianceUnit::mL_Per_mmHg); - //Large Vasculature (divide total large vasculature fluid volume three ways): + // Large Vasculature (divide total large vasculature fluid volume three ways): double tubulesVolume_mL = singleKidneyLargeVasculatureFluidVolume_mL / 3.0; double renalArteryVolume_mL = singleKidneyLargeVasculatureFluidVolume_mL / 3.2; double renalVeinVolume_mL = singleKidneyLargeVasculatureFluidVolume_mL / 3.0; - //Small vasculature (divide total small vasculature fluid volume five ways): + // Small vasculature (divide total small vasculature fluid volume five ways): double peritubularVolume_mL = singleKidneySmallVasculatureFluidVolume_mL / 5.0; double efferentVolume_mL = singleKidneySmallVasculatureFluidVolume_mL / 5.0; double afferentVolume_mL = singleKidneySmallVasculatureFluidVolume_mL / 5.0; double bowmansVolume_mL = singleKidneySmallVasculatureFluidVolume_mL / 5.0; double glomerularVolume_mL = singleKidneySmallVasculatureFluidVolume_mL / 5.0; - //Using width = 1.8 mm and length = 11 inches => 710.6 mm^3 + // Using width = 1.8 mm and length = 11 inches => 710.6 mm^3 double ureterVolume_mL = 0.71; - //Tuned constants + // Tuned constants double bladderVolume_mL = 1.0; - //Unstressed Pressures - set to zero to use unstressed properly + // Unstressed Pressures - set to zero to use unstressed properly double renalArteryPressure_mmHg = 0.0; double renalVeinPressure_mmHg = 0.0; double glomerularPressure_mmHg = cCardiovascular.GetNode(BGE::CardiovascularNode::LeftKidney1)->GetPressure(PressureUnit::mmHg); - //double bladderPressure_mmHg = bladderVolume_mL / bladderCompliance_mL_Per_mmHg; - //Pressure Sources + // double bladderPressure_mmHg = bladderVolume_mL / bladderCompliance_mL_Per_mmHg; + // Pressure Sources double glomerularOsmoticPressure_mmHg = -32.0; double bowmansOsmoticPressure_mmHg = 0.0; double tubulesOsmoticPressure_mmHg = -15.0; @@ -2750,7 +2761,7 @@ void BioGears::SetupRenal() // Bladder // SEFluidCircuitNode& Bladder = cRenal.CreateNode(BGE::RenalNode::Bladder); Bladder.GetVolumeBaseline().SetValue(bladderVolume_mL, VolumeUnit::mL); - //Bladder.GetPressure().SetValue(0.0, PressureUnit::mmHg); + // Bladder.GetPressure().SetValue(0.0, PressureUnit::mmHg); ////////////////// // Create Paths // @@ -2806,7 +2817,7 @@ void BioGears::SetupRenal() // RightNetGlomerularCapillariesToNetBowmansCapsules // SEFluidCircuitPath& RightNetGlomerularCapillariesToNetBowmansCapsules = cRenal.CreatePath(RightNetGlomerularCapillaries, RightNetBowmansCapsules, BGE::RenalPath::RightNetGlomerularCapillariesToNetBowmansCapsules); RightNetGlomerularCapillariesToNetBowmansCapsules.GetResistanceBaseline().SetValue(glomerularFilterResistance_mmHg_s_Per_mL, FlowResistanceUnit::mmHg_s_Per_mL); - RightNetGlomerularCapillariesToNetBowmansCapsules.SetNextPolarizedState(CDM::enumOpenClosed::Open); + RightNetGlomerularCapillariesToNetBowmansCapsules.SetNextPolarizedState(SEOpenClosed::Open); ////////////////////////////////////////////// // RightBowmansCapsulesToNetBowmansCapsules // SEFluidCircuitPath& RightBowmansCapsulesToNetBowmansCapsules = cRenal.CreatePath(RightBowmansCapsules, RightNetBowmansCapsules, BGE::RenalPath::RightBowmansCapsulesToNetBowmansCapsules); @@ -2814,12 +2825,12 @@ void BioGears::SetupRenal() ///////////////// // Hemorrhage from right kidney// SEFluidCircuitPath& RightKidneyBleed = cRenal.CreatePath(RightRenalVein, Ground, BGE::CardiovascularPath::RightKidneyBleed); - RightKidneyBleed.GetResistanceBaseline().SetValue(m_Config->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); + RightKidneyBleed.GetResistanceBaseline().SetValue(m_Configuration->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); /////////////////////////////////// ///////////////// // Hemorrhage from left kidney// SEFluidCircuitPath& LeftKidneyBleed = cRenal.CreatePath(LeftRenalVein, Ground, BGE::CardiovascularPath::LeftKidneyBleed); - LeftKidneyBleed.GetResistanceBaseline().SetValue(m_Config->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); + LeftKidneyBleed.GetResistanceBaseline().SetValue(m_Configuration->GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL), FlowResistanceUnit::mmHg_s_Per_mL); /////////////////////////////////// // Right Urine // ///////////////// @@ -2846,7 +2857,7 @@ void BioGears::SetupRenal() ////////////////////////// // RightUreterToBladder // SEFluidCircuitPath& RightUreterToBladder = cRenal.CreatePath(RightUreter, Bladder, BGE::RenalPath::RightUreterToBladder); - RightUreterToBladder.SetNextValve(CDM::enumOpenClosed::Closed); + RightUreterToBladder.SetNextValve(SEOpenClosed::Closed); ///////////////// // Left Blood // @@ -2898,7 +2909,7 @@ void BioGears::SetupRenal() // LeftNetGlomerularCapillariesToNetBowmansCapsules // SEFluidCircuitPath& LeftNetGlomerularCapillariesToNetBowmansCapsules = cRenal.CreatePath(LeftNetGlomerularCapillaries, LeftNetBowmansCapsules, BGE::RenalPath::LeftNetGlomerularCapillariesToNetBowmansCapsules); LeftNetGlomerularCapillariesToNetBowmansCapsules.GetResistanceBaseline().SetValue(glomerularFilterResistance_mmHg_s_Per_mL, FlowResistanceUnit::mmHg_s_Per_mL); - LeftNetGlomerularCapillariesToNetBowmansCapsules.SetNextPolarizedState(CDM::enumOpenClosed::Open); + LeftNetGlomerularCapillariesToNetBowmansCapsules.SetNextPolarizedState(SEOpenClosed::Open); ////////////////////////////////////////////// // LeftBowmansCapsulesToNetBowmansCapsules // SEFluidCircuitPath& LeftBowmansCapsulesToNetBowmansCapsules = cRenal.CreatePath(LeftBowmansCapsules, LeftNetBowmansCapsules, BGE::RenalPath::LeftBowmansCapsulesToNetBowmansCapsules); @@ -2929,14 +2940,14 @@ void BioGears::SetupRenal() ////////////////////////// // LeftUreterToBladder // SEFluidCircuitPath& LeftUreterToBladder = cRenal.CreatePath(LeftUreter, Bladder, BGE::RenalPath::LeftUreterToBladder); - LeftUreterToBladder.SetNextValve(CDM::enumOpenClosed::Closed); + LeftUreterToBladder.SetNextValve(SEOpenClosed::Closed); /////////////////////// // BladderCompliance // SEFluidCircuitPath& BladderToGroundPressure = cRenal.CreatePath(Bladder, Ground, BGE::RenalPath::BladderToGroundPressure); /// \todo Use a compliance here - make sure you remove the current handling of bladder volume in the renal system as a pressure source - //BladderCompliance.GetComplianceBaseline().SetValue(bladderCompliance_mL_Per_mmHg, FlowComplianceUnit::mL_Per_mmHg); - BladderToGroundPressure.GetPressureSourceBaseline().SetValue(-4.0, PressureUnit::mmHg); //Negative because source-target is for compliance + // BladderCompliance.GetComplianceBaseline().SetValue(bladderCompliance_mL_Per_mmHg, FlowComplianceUnit::mL_Per_mmHg); + BladderToGroundPressure.GetPressureSourceBaseline().SetValue(-4.0, PressureUnit::mmHg); // Negative because source-target is for compliance ////////////// // BladderGround // SEFluidCircuitPath& BladderToGroundUrinate = cRenal.CreatePath(Bladder, Ground, BGE::RenalPath::BladderToGroundUrinate); @@ -3067,7 +3078,7 @@ void BioGears::SetupRenal() // Grab these, as cardiovascular already made them SELiquidCompartment* vLeftKidney = m_Compartments->GetLiquidCompartment(BGE::VascularCompartment::LeftKidney); SELiquidCompartment& vLeftNephron = m_Compartments->CreateLiquidCompartment(BGE::VascularCompartment::LeftNephron); - vLeftKidney->GetNodeMapping().Clear(); // Remove the nodes the cardiovascular was using to model the kidney + vLeftKidney->GetNodeMapping().Invalidate(); // Remove the nodes the cardiovascular was using to model the kidney vLeftKidney->AddChild(vLeftRenalArtery); vLeftKidney->AddChild(vLeftNephron); vLeftNephron.AddChild(vLeftAfferentArteriole); @@ -3079,7 +3090,7 @@ void BioGears::SetupRenal() vLeftKidney->AddChild(vLeftRenalVein); SELiquidCompartment* vRightKidney = m_Compartments->GetLiquidCompartment(BGE::VascularCompartment::RightKidney); SELiquidCompartment& vRightNephron = m_Compartments->CreateLiquidCompartment(BGE::VascularCompartment::RightNephron); - vRightKidney->GetNodeMapping().Clear(); // Remove the nodes the cardiovascular was using to model the kidney + vRightKidney->GetNodeMapping().Invalidate(); // Remove the nodes the cardiovascular was using to model the kidney vRightKidney->AddChild(vRightRenalArtery); vRightKidney->AddChild(vRightNephron); vRightNephron.AddChild(vRightAfferentArteriole); @@ -3263,9 +3274,9 @@ void BioGears::SetupRenal() gRenal.AddLink(vLeftRenalArteryToAfferentArteriole); gRenal.AddLink(vLeftAfferentArterioleToGlomerularCapillaries); gRenal.AddLink(vLeftGlomerularCapillariesToEfferentArteriole); - //gRenal.AddLink(vLeftGlomerularCapillariesToBowmansCapsules); //Active transport only + // gRenal.AddLink(vLeftGlomerularCapillariesToBowmansCapsules); //Active transport only gRenal.AddLink(vLeftBowmansCapsulesToTubules); - //gRenal.AddLink(vLeftTubulesToPeritubularCapillaries); //Active transport only + // gRenal.AddLink(vLeftTubulesToPeritubularCapillaries); //Active transport only gRenal.AddLink(vLeftEfferentArterioleToPeritubularCapillaries); gRenal.AddLink(vLeftPeritubularCapillariesToRenalVein); gRenal.AddLink(vLeftRenalVeinToVenaCava); @@ -3284,9 +3295,9 @@ void BioGears::SetupRenal() gRenal.AddLink(vRightGlomerularCapillariesToEfferentArteriole); gRenal.AddLink(vLeftKidneyHemorrhage); gRenal.AddLink(vRightKidneyHemorrhage); - //gRenal.AddLink(vRightGlomerularCapillariesToBowmansCapsules); //Active transport only + // gRenal.AddLink(vRightGlomerularCapillariesToBowmansCapsules); //Active transport only gRenal.AddLink(vRightBowmansCapsulesToTubules); - //gRenal.AddLink(vRightTubulesToPeritubularCapillaries); //Active transport only + // gRenal.AddLink(vRightTubulesToPeritubularCapillaries); //Active transport only gRenal.AddLink(vRightEfferentArterioleToPeritubularCapillaries); gRenal.AddLink(vRightPeritubularCapillariesToRenalVein); gRenal.AddLink(vRightRenalVeinToVenaCava); @@ -3325,9 +3336,9 @@ void BioGears::SetupTissue() // Lymph // SEFluidCircuitNode& Lymph = cCombinedCardiovascular.CreateNode(BGE::TissueNode::Lymph); Lymph.GetPressure().SetValue(5.0, PressureUnit::mmHg); - //If we break out Lymph, Table 8.5 in Nanomedicine: Volume 1 (found @ http://www.nanomedicine.com/NMI/8.2.1.3.htm) has a total capacity of ~2.0 L. + // If we break out Lymph, Table 8.5 in Nanomedicine: Volume 1 (found @ http://www.nanomedicine.com/NMI/8.2.1.3.htm) has a total capacity of ~2.0 L. Lymph.GetVolumeBaseline().SetValue(2.0, VolumeUnit::L); - double lymphTotalBody_mL_Per_min = 3.5; //This corresponds to ~ 5 L/day of lymph flow in body + double lymphTotalBody_mL_Per_min = 3.5; // This corresponds to ~ 5 L/day of lymph flow in body SEFluidCircuitNode* VenaCava = cCombinedCardiovascular.GetNode(BGE::CardiovascularNode::VenaCava); SEFluidCircuitPath& LymphToVenaCava = cCombinedCardiovascular.CreatePath(Lymph, *VenaCava, BGE::TissuePath::LymphToVenaCava); @@ -3344,7 +3355,7 @@ void BioGears::SetupTissue() /// \todo Put Initial Circuit/Compartment data values into the configuration file. - //Density (kg/L) + // Density (kg/L) double AdiposeTissueDensity = 0.92; double BoneTissueDensity = 1.3; double BrainTissueDensity = 1.0; @@ -3374,8 +3385,8 @@ void BioGears::SetupTissue() double SkinEWFraction = 0.382, SkinIWFraction = 0.291, SkinNLFraction = 0.0284, SkinNPFraction = 0.0111, SkinARatio = 0.277, SkinAAGRatio = 0.277, SkinLRatio = 0.096, SkinAPL = 1.32; double SpleenEWFraction = 0.207, SpleenIWFraction = 0.579, SpleenNLFraction = 0.0201, SpleenNPFraction = 0.0198, SpleenARatio = 0.277, SpleenAAGRatio = 0.277, SpleenLRatio = 0.096, SpleenAPL = 3.18; - //Typical ICRP Male - //Total Mass (kg) + // Typical ICRP Male + // Total Mass (kg) double AdiposeTissueMass = 14.5; double BoneTissueMass = 10.5; double BrainTissueMass = 1.45; @@ -3390,9 +3401,9 @@ void BioGears::SetupTissue() double SkinTissueMass = 3.3; double SpleenTissueMass = 0.15; - //Typical ICRP Female - From ICRP - //Total Mass (kg) - if (m_Patient->GetGender() == CDM::enumSex::Female) { + // Typical ICRP Female - From ICRP + // Total Mass (kg) + if (m_Patient->GetSex() == SESex::Female) { AdiposeTissueMass = 19.0; BoneTissueMass = 7.8; BrainTissueMass = 1.3; @@ -3408,17 +3419,17 @@ void BioGears::SetupTissue() SpleenTissueMass = 0.13; } - //Scale things based on patient parameters ------------------------------- + // Scale things based on patient parameters ------------------------------- - //Modify adipose (i.e. fat) directly using the body fat fraction + // Modify adipose (i.e. fat) directly using the body fat fraction AdiposeTissueMass = m_Patient->GetBodyFatFraction().GetValue() * m_Patient->GetWeight().GetValue(MassUnit::kg); - //Modify skin based on total surface area - //Male + // Modify skin based on total surface area + // Male double standardPatientWeight_lb = 170.0; double standardPatientHeight_in = 71.0; - if (m_Patient->GetGender() == CDM::enumSex::Female) { - //Female + if (m_Patient->GetSex() == SESex::Female) { + // Female standardPatientWeight_lb = 130.0; standardPatientHeight_in = 64.0; } @@ -3426,18 +3437,18 @@ void BioGears::SetupTissue() double patientSkinArea_m2 = m_Patient->GetSkinSurfaceArea(AreaUnit::m2); SkinTissueMass = SkinTissueMass * patientSkinArea_m2 / typicalSkinSurfaceArea_m2; - //Modify most based on lean body mass - //Hume, R (Jul 1966). "Prediction of lean body mass from height and weight." Journal of clinical pathology. 19 (4): 389–91. doi:10.1136/jcp.19.4.389. PMC 473290. PMID 5929341. - //double typicalLeanBodyMass_kg = 0.32810 * Convert(standardPatientWeight_lb, MassUnit::lb, MassUnit::kg) + 0.33929 * Convert(standardPatientHeight_in, LengthUnit::inch, LengthUnit::cm) - 29.5336; //Male - //if (m_Patient->GetGender() == CDM::enumSex::Female) + // Modify most based on lean body mass + // Hume, R (Jul 1966). "Prediction of lean body mass from height and weight." Journal of clinical pathology. 19 (4): 389–91. doi:10.1136/jcp.19.4.389. PMC 473290. PMID 5929341. + // double typicalLeanBodyMass_kg = 0.32810 * Convert(standardPatientWeight_lb, MassUnit::lb, MassUnit::kg) + 0.33929 * Convert(standardPatientHeight_in, LengthUnit::inch, LengthUnit::cm) - 29.5336; //Male + // if (m_Patient->GetSex() == SESex::Female) //{ - // typicalLeanBodyMass_kg = 0.29569 * Convert(standardPatientWeight_lb, MassUnit::lb, MassUnit::kg) + 0.41813 * Convert(standardPatientHeight_in, LengthUnit::inch, LengthUnit::cm) - 43.2933; //Female - //} + // typicalLeanBodyMass_kg = 0.29569 * Convert(standardPatientWeight_lb, MassUnit::lb, MassUnit::kg) + 0.41813 * Convert(standardPatientHeight_in, LengthUnit::inch, LengthUnit::cm) - 43.2933; //Female + // } - //Male + // Male double standardFatFraction = 0.21; - if (m_Patient->GetGender() == CDM::enumSex::Female) { - //Female + if (m_Patient->GetSex() == SESex::Female) { + // Female standardFatFraction = 0.28; } double standardLeanBodyMass_kg = Convert(standardPatientWeight_lb, MassUnit::lb, MassUnit::kg) * (1.0 - standardFatFraction); @@ -3455,9 +3466,9 @@ void BioGears::SetupTissue() MyocardiumTissueMass *= leanBodyMassFractionOfTypical; SpleenTissueMass *= leanBodyMassFractionOfTypical; - //Note: Brain doesn't change + // Note: Brain doesn't change - //Total Volume(L) + // Total Volume(L) double AdiposeTissueVolume = AdiposeTissueMass / AdiposeTissueDensity; double BoneTissueVolume = BoneTissueMass / BoneTissueDensity; double BrainTissueVolume = BrainTissueMass / BrainTissueDensity; @@ -3476,31 +3487,31 @@ void BioGears::SetupTissue() + LiverEWFraction * LiverTissueVolume + RLungEWFraction * RLungTissueVolume + LLungEWFraction * LLungTissueVolume + MuscleEWFraction * MuscleTissueVolume + MyocardiumEWFraction * MyocardiumTissueVolume + SkinEWFraction * SkinTissueVolume + SpleenEWFraction * SpleenTissueVolume + LKidneyTissueVolume * LKidneyEWFraction + RKidneyTissueVolume * RKidneyEWFraction; - //Create the circuit ------------------------------- + // Create the circuit ------------------------------- // Colloid Osmotic Pressure--establish here so we can define pressure sources on tissue circuit (substances haven't been set up yet) and, if we need to, change them without jacking everything up /// \cite Mazonni1988Dynamic double albuminVascular_g_Per_dL = 4.5; double albuminExtracell_g_Per_dL = 2.0; - double totalPlasamaProtein_g_Per_dL = 1.6 * albuminVascular_g_Per_dL; //Relationship between albumin and total plasma protein + double totalPlasamaProtein_g_Per_dL = 1.6 * albuminVascular_g_Per_dL; // Relationship between albumin and total plasma protein double totalInterstitialProtein_g_Per_dL = 1.6 * albuminExtracell_g_Per_dL; - double copVascular_mmHg = 2.1 * totalPlasamaProtein_g_Per_dL + 0.16 * std::pow(totalPlasamaProtein_g_Per_dL, 2) + 0.009 * std::pow(totalPlasamaProtein_g_Per_dL, 3); //Use Landis-Pappenheimer equation to get plasma colloid oncotic pressure - double copExtracell_mmHg = 2.1 * totalInterstitialProtein_g_Per_dL + 0.16 * std::pow(totalInterstitialProtein_g_Per_dL, 2) + 0.009 * std::pow(totalInterstitialProtein_g_Per_dL, 3); //If we assume only albumin leaks across membrame, use relationshp for albumin colloid pressure from Mazzoni1988Dynamic + double copVascular_mmHg = 2.1 * totalPlasamaProtein_g_Per_dL + 0.16 * std::pow(totalPlasamaProtein_g_Per_dL, 2) + 0.009 * std::pow(totalPlasamaProtein_g_Per_dL, 3); // Use Landis-Pappenheimer equation to get plasma colloid oncotic pressure + double copExtracell_mmHg = 2.1 * totalInterstitialProtein_g_Per_dL + 0.16 * std::pow(totalInterstitialProtein_g_Per_dL, 2) + 0.009 * std::pow(totalInterstitialProtein_g_Per_dL, 3); // If we assume only albumin leaks across membrame, use relationshp for albumin colloid pressure from Mazzoni1988Dynamic double targetPressureGradient_mmHg = 5.0; - //Boron: Medical Physiology has total pressure gradient from capillary to interstitium as 12 mmHg at arterial end and -5 mmHg at venous end - //So there should be a small net gradient towards interstitium. - double targetHydrostaticGradient_mmHg = targetPressureGradient_mmHg + (copVascular_mmHg - copExtracell_mmHg); //COP gradient opposes flow into capillaries. Thus, to get to target total gradient we need a hydrostatic gradient to oppose it + // Boron: Medical Physiology has total pressure gradient from capillary to interstitium as 12 mmHg at arterial end and -5 mmHg at venous end + // So there should be a small net gradient towards interstitium. + double targetHydrostaticGradient_mmHg = targetPressureGradient_mmHg + (copVascular_mmHg - copExtracell_mmHg); // COP gradient opposes flow into capillaries. Thus, to get to target total gradient we need a hydrostatic gradient to oppose it - //These modifiers are copied from the SetUp Cardiovascular function. The volume modification helps tune the vascular node volumes, but it also causes pressure drops - //on those nodes. This is a problem because the tissue nodes below have their pressures set based on the pressures set on the CV nodes. If the pressure in the vasculature - //drops too much, the gradient favoring filtration to the tissue is lost. Factoring in these modifiers prevents this. Note: Did not include modifier for brain, lungs, or kidneys. + // These modifiers are copied from the SetUp Cardiovascular function. The volume modification helps tune the vascular node volumes, but it also causes pressure drops + // on those nodes. This is a problem because the tissue nodes below have their pressures set based on the pressures set on the CV nodes. If the pressure in the vasculature + // drops too much, the gradient favoring filtration to the tissue is lost. Factoring in these modifiers prevents this. Note: Did not include modifier for brain, lungs, or kidneys. double VolumeModifierBone = 1.175574 * 0.985629, VolumeModifierFat = 1.175573 * 0.986527; double VolumeModifierGut = 1.17528 * 0.985609, VolumeModifierLiver = 1.157475 * 0.991848; double VolumeModifierMuscle = 1.175573 * 0.986529, VolumeModifierMyocardium = 1.175564 * 0.986531; double VolumeModifierSpleen = 1.17528 * 0.986509, VolumeModifierSkin = 1.007306 * 1.035695; - //Use these and keep recycling for each tissue to help define node and path baselines + // Use these and keep recycling for each tissue to help define node and path baselines double vNodePressure = 0.0; double e1NodePressure = 0.0; double e2NodePressure = 0.0; @@ -3513,11 +3524,11 @@ void BioGears::SetupTissue() double lymphResistance_mmHg_min_Per_mL = 0.0; double lymphDrivePressure_mmHg = 0.0; - //Circuit Set-Up + // Circuit Set-Up /* V = vascular, E = tissue extracellular, I = tissue intracellular >> = pressure source (and direction), ~~~ = resistor, || = capacitor, ( = flow source - + I---||----Ground ( ( @@ -3525,7 +3536,7 @@ void BioGears::SetupTissue() ( ( Back to Vena cava <--Lymph - + */ ///////// @@ -3535,13 +3546,13 @@ void BioGears::SetupTissue() SEFluidCircuitNode& FatE2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::FatE2); SEFluidCircuitNode& FatE3 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::FatE3); SEFluidCircuitNode& FatI = cCombinedCardiovascular.CreateNode(BGE::TissueNode::FatI); - SEFluidCircuitNode& FatL1 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::FatL1); //Pre-lymphatic node 1 - SEFluidCircuitNode& FatL2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::FatL2); //Pre-lymphatic node 2--valve check + SEFluidCircuitNode& FatL1 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::FatL1); // Pre-lymphatic node 1 + SEFluidCircuitNode& FatL2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::FatL2); // Pre-lymphatic node 2--valve check vNodePressure = FatV->GetPressure(PressureUnit::mmHg) / VolumeModifierFat; - e1NodePressure = vNodePressure - copVascular_mmHg; //Plasma colloid osmotic pressure opposes flow into tissue space (i.e. favor E1 to V) + e1NodePressure = vNodePressure - copVascular_mmHg; // Plasma colloid osmotic pressure opposes flow into tissue space (i.e. favor E1 to V) e3NodePressure = vNodePressure - targetHydrostaticGradient_mmHg; - e2NodePressure = e3NodePressure - copExtracell_mmHg; //Extracellular colloid osmotic pressure promotes flow from E2 to E3 + e2NodePressure = e3NodePressure - copExtracell_mmHg; // Extracellular colloid osmotic pressure promotes flow from E2 to E3 if (e3NodePressure > preLymphaticPressureMin_mmHg) { l1NodePressure = e3NodePressure; } else { @@ -3558,8 +3569,8 @@ void BioGears::SetupTissue() FatE2.GetPressure().SetValue(e2NodePressure, PressureUnit::mmHg); FatE3.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); FatE3.GetVolumeBaseline().SetValue(AdiposeEWFraction * AdiposeTissueVolume * 1000.0, VolumeUnit::mL); - FatI.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); //No hydrostatic pressure difference between intra/extra - FatI.GetVolumeBaseline().SetValue(AdiposeIWFraction * AdiposeTissueVolume * 1000.0, VolumeUnit::mL); //intracellular node + FatI.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); // No hydrostatic pressure difference between intra/extra + FatI.GetVolumeBaseline().SetValue(AdiposeIWFraction * AdiposeTissueVolume * 1000.0, VolumeUnit::mL); // intracellular node FatL1.GetPressure().SetValue(l1NodePressure, PressureUnit::mmHg); FatL2.GetPressure().SetValue(l2NodePressure, PressureUnit::mmHg); @@ -3570,7 +3581,7 @@ void BioGears::SetupTissue() SEFluidCircuitPath& FatE2ToFatE3 = cCombinedCardiovascular.CreatePath(FatE2, FatE3, BGE::TissuePath::FatE2ToFatE3); FatE2ToFatE3.GetPressureSourceBaseline().SetValue(copExtracell_mmHg, PressureUnit::mmHg); SEFluidCircuitPath& FatE3ToGround = cCombinedCardiovascular.CreatePath(FatE3, *Ground, BGE::TissuePath::FatE3ToGround); - FatE3ToGround.GetComplianceBaseline().SetValue(FatE3.GetVolumeBaseline(VolumeUnit::mL) / vNodePressure, FlowComplianceUnit::mL_Per_mmHg); //Might need to change this + FatE3ToGround.GetComplianceBaseline().SetValue(FatE3.GetVolumeBaseline(VolumeUnit::mL) / vNodePressure, FlowComplianceUnit::mL_Per_mmHg); // Might need to change this SEFluidCircuitPath& FatE3ToFatI = cCombinedCardiovascular.CreatePath(FatE3, FatI, BGE::TissuePath::FatE3ToFatI); FatE3ToFatI.GetFlowSourceBaseline().SetValue(0.0, VolumePerTimeUnit::mL_Per_s); SEFluidCircuitPath& FatIToGround = cCombinedCardiovascular.CreatePath(FatI, *Ground, BGE::TissuePath::FatIToGround); @@ -3581,7 +3592,7 @@ void BioGears::SetupTissue() SEFluidCircuitPath& FatL1ToFatL2 = cCombinedCardiovascular.CreatePath(FatL1, FatL2, BGE::TissuePath::FatL1ToFatL2); FatL1ToFatL2.GetResistanceBaseline().SetValue(lymphResistance_mmHg_min_Per_mL, FlowResistanceUnit::mmHg_min_Per_mL); SEFluidCircuitPath& FatL2ToLymph = cCombinedCardiovascular.CreatePath(FatL2, Lymph, BGE::TissuePath::FatToLymphValve); - FatL2ToLymph.SetNextValve(CDM::enumOpenClosed::Closed); + FatL2ToLymph.SetNextValve(SEOpenClosed::Closed); SETissueCompartment& FatTissue = m_Compartments->CreateTissueCompartment(BGE::TissueCompartment::Fat); SELiquidCompartment& FatExtracellular = m_Compartments->CreateLiquidCompartment(BGE::ExtravascularCompartment::FatExtracellular); @@ -3612,13 +3623,13 @@ void BioGears::SetupTissue() SEFluidCircuitNode& BoneE2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::BoneE2); SEFluidCircuitNode& BoneE3 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::BoneE3); SEFluidCircuitNode& BoneI = cCombinedCardiovascular.CreateNode(BGE::TissueNode::BoneI); - SEFluidCircuitNode& BoneL1 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::BoneL1); //Pre-lymphatic node 1 - SEFluidCircuitNode& BoneL2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::BoneL2); //Pre-lymphatic node 2--valve check + SEFluidCircuitNode& BoneL1 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::BoneL1); // Pre-lymphatic node 1 + SEFluidCircuitNode& BoneL2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::BoneL2); // Pre-lymphatic node 2--valve check vNodePressure = BoneV->GetPressure(PressureUnit::mmHg) / VolumeModifierBone; - e1NodePressure = vNodePressure - copVascular_mmHg; //Plasma colloid osmotic pressure opposes flow into tissue space (i.e. favor E1 to V) + e1NodePressure = vNodePressure - copVascular_mmHg; // Plasma colloid osmotic pressure opposes flow into tissue space (i.e. favor E1 to V) e3NodePressure = vNodePressure - targetHydrostaticGradient_mmHg; - e2NodePressure = e3NodePressure - copExtracell_mmHg; //Extracellular colloid osmotic pressure promotes flow from E2 to E3 + e2NodePressure = e3NodePressure - copExtracell_mmHg; // Extracellular colloid osmotic pressure promotes flow from E2 to E3 if (e3NodePressure > preLymphaticPressureMin_mmHg) { l1NodePressure = e3NodePressure; } else { @@ -3635,8 +3646,8 @@ void BioGears::SetupTissue() BoneE2.GetPressure().SetValue(e2NodePressure, PressureUnit::mmHg); BoneE3.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); BoneE3.GetVolumeBaseline().SetValue(BoneEWFraction * BoneTissueVolume * 1000.0, VolumeUnit::mL); - BoneI.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); //No hydrostatic pressure difference between intra/extra - BoneI.GetVolumeBaseline().SetValue(BoneIWFraction * BoneTissueVolume * 1000.0, VolumeUnit::mL); //intracellular node + BoneI.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); // No hydrostatic pressure difference between intra/extra + BoneI.GetVolumeBaseline().SetValue(BoneIWFraction * BoneTissueVolume * 1000.0, VolumeUnit::mL); // intracellular node BoneL1.GetPressure().SetValue(l1NodePressure, PressureUnit::mmHg); BoneL2.GetPressure().SetValue(l2NodePressure, PressureUnit::mmHg); @@ -3647,7 +3658,7 @@ void BioGears::SetupTissue() SEFluidCircuitPath& BoneE2ToBoneE3 = cCombinedCardiovascular.CreatePath(BoneE2, BoneE3, BGE::TissuePath::BoneE2ToBoneE3); BoneE2ToBoneE3.GetPressureSourceBaseline().SetValue(copExtracell_mmHg, PressureUnit::mmHg); SEFluidCircuitPath& BoneE3ToGround = cCombinedCardiovascular.CreatePath(BoneE3, *Ground, BGE::TissuePath::BoneE3ToGround); - BoneE3ToGround.GetComplianceBaseline().SetValue(BoneE3.GetVolumeBaseline(VolumeUnit::mL) / vNodePressure, FlowComplianceUnit::mL_Per_mmHg); //Might need to change this + BoneE3ToGround.GetComplianceBaseline().SetValue(BoneE3.GetVolumeBaseline(VolumeUnit::mL) / vNodePressure, FlowComplianceUnit::mL_Per_mmHg); // Might need to change this SEFluidCircuitPath& BoneE3ToBoneI = cCombinedCardiovascular.CreatePath(BoneE3, BoneI, BGE::TissuePath::BoneE3ToBoneI); BoneE3ToBoneI.GetFlowSourceBaseline().SetValue(0.0, VolumePerTimeUnit::mL_Per_s); SEFluidCircuitPath& BoneIToGround = cCombinedCardiovascular.CreatePath(BoneI, *Ground, BGE::TissuePath::BoneIToGround); @@ -3658,7 +3669,7 @@ void BioGears::SetupTissue() SEFluidCircuitPath& BoneL1ToBoneL2 = cCombinedCardiovascular.CreatePath(BoneL1, BoneL2, BGE::TissuePath::BoneL1ToBoneL2); BoneL1ToBoneL2.GetResistanceBaseline().SetValue(lymphResistance_mmHg_min_Per_mL, FlowResistanceUnit::mmHg_min_Per_mL); SEFluidCircuitPath& BoneL2ToLymph = cCombinedCardiovascular.CreatePath(BoneL2, Lymph, BGE::TissuePath::BoneToLymphValve); - BoneL2ToLymph.SetNextValve(CDM::enumOpenClosed::Closed); + BoneL2ToLymph.SetNextValve(SEOpenClosed::Closed); SETissueCompartment& BoneTissue = m_Compartments->CreateTissueCompartment(BGE::TissueCompartment::Bone); SELiquidCompartment& BoneExtracellular = m_Compartments->CreateLiquidCompartment(BGE::ExtravascularCompartment::BoneExtracellular); @@ -3695,13 +3706,13 @@ void BioGears::SetupTissue() SEFluidCircuitNode& BrainE2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::BrainE2); SEFluidCircuitNode& BrainE3 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::BrainE3); SEFluidCircuitNode& BrainI = cCombinedCardiovascular.CreateNode(BGE::TissueNode::BrainI); - SEFluidCircuitNode& BrainL1 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::BrainL1); //Pre-lymphatic node 1 - SEFluidCircuitNode& BrainL2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::BrainL2); //Pre-lymphatic node 2--valve check + SEFluidCircuitNode& BrainL1 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::BrainL1); // Pre-lymphatic node 1 + SEFluidCircuitNode& BrainL2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::BrainL2); // Pre-lymphatic node 2--valve check vNodePressure = BrainV->GetPressure(PressureUnit::mmHg); // VolumeModifierBrain; - e1NodePressure = vNodePressure - copVascular_mmHg; //Plasma colloid osmotic pressure opposes flow into tissue space (i.e. favor E1 to V) + e1NodePressure = vNodePressure - copVascular_mmHg; // Plasma colloid osmotic pressure opposes flow into tissue space (i.e. favor E1 to V) e3NodePressure = vNodePressure - targetHydrostaticGradient_mmHg; - e2NodePressure = e3NodePressure - copExtracell_mmHg; //Extracellular colloid osmotic pressure promotes flow from E2 to E3 + e2NodePressure = e3NodePressure - copExtracell_mmHg; // Extracellular colloid osmotic pressure promotes flow from E2 to E3 if (e3NodePressure > preLymphaticPressureMin_mmHg) { l1NodePressure = e3NodePressure; } else { @@ -3718,8 +3729,8 @@ void BioGears::SetupTissue() BrainE2.GetPressure().SetValue(e2NodePressure, PressureUnit::mmHg); BrainE3.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); BrainE3.GetVolumeBaseline().SetValue(BrainEWFraction * BrainTissueVolume * 1000.0, VolumeUnit::mL); - BrainI.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); //No hydrostatic pressure difference between intra/extra - BrainI.GetVolumeBaseline().SetValue(BrainIWFraction * BrainTissueVolume * 1000.0, VolumeUnit::mL); //intracellular node + BrainI.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); // No hydrostatic pressure difference between intra/extra + BrainI.GetVolumeBaseline().SetValue(BrainIWFraction * BrainTissueVolume * 1000.0, VolumeUnit::mL); // intracellular node BrainL1.GetPressure().SetValue(l1NodePressure, PressureUnit::mmHg); BrainL2.GetPressure().SetValue(l2NodePressure, PressureUnit::mmHg); @@ -3730,8 +3741,8 @@ void BioGears::SetupTissue() SEFluidCircuitPath& BrainE2ToBrainE3 = cCombinedCardiovascular.CreatePath(BrainE2, BrainE3, BGE::TissuePath::BrainE2ToBrainE3); BrainE2ToBrainE3.GetPressureSourceBaseline().SetValue(copExtracell_mmHg, PressureUnit::mmHg); SEFluidCircuitPath& BrainE3ToGround = cCombinedCardiovascular.CreatePath(BrainE3, *Ground, BGE::TissuePath::BrainE3ToGround); - //Minus sign in compliance baselines are because the interstitial pressure is negative with respect to atmosphere and we don't want negative compliance - BrainE3ToGround.GetComplianceBaseline().SetValue(BrainE3.GetVolumeBaseline(VolumeUnit::mL) / vNodePressure, FlowComplianceUnit::mL_Per_mmHg); //Might need to change this + // Minus sign in compliance baselines are because the interstitial pressure is negative with respect to atmosphere and we don't want negative compliance + BrainE3ToGround.GetComplianceBaseline().SetValue(BrainE3.GetVolumeBaseline(VolumeUnit::mL) / vNodePressure, FlowComplianceUnit::mL_Per_mmHg); // Might need to change this SEFluidCircuitPath& BrainE3ToBrainI = cCombinedCardiovascular.CreatePath(BrainE3, BrainI, BGE::TissuePath::BrainE3ToBrainI); BrainE3ToBrainI.GetFlowSourceBaseline().SetValue(0.0, VolumePerTimeUnit::mL_Per_s); SEFluidCircuitPath& BrainIToGround = cCombinedCardiovascular.CreatePath(BrainI, *Ground, BGE::TissuePath::BrainIToGround); @@ -3742,7 +3753,7 @@ void BioGears::SetupTissue() SEFluidCircuitPath& BrainL1ToBrainL2 = cCombinedCardiovascular.CreatePath(BrainL1, BrainL2, BGE::TissuePath::BrainL1ToBrainL2); BrainL1ToBrainL2.GetResistanceBaseline().SetValue(lymphResistance_mmHg_min_Per_mL, FlowResistanceUnit::mmHg_min_Per_mL); SEFluidCircuitPath& BrainL2ToLymph = cCombinedCardiovascular.CreatePath(BrainL2, Lymph, BGE::TissuePath::BrainToLymphValve); - BrainL2ToLymph.SetNextValve(CDM::enumOpenClosed::Closed); + BrainL2ToLymph.SetNextValve(SEOpenClosed::Closed); SETissueCompartment& BrainTissue = m_Compartments->CreateTissueCompartment(BGE::TissueCompartment::Brain); SELiquidCompartment& BrainExtracellular = m_Compartments->CreateLiquidCompartment(BGE::ExtravascularCompartment::BrainExtracellular); @@ -3775,16 +3786,16 @@ void BioGears::SetupTissue() SEFluidCircuitNode& GutE2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::GutE2); SEFluidCircuitNode& GutE3 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::GutE3); SEFluidCircuitNode& GutI = cCombinedCardiovascular.CreateNode(BGE::TissueNode::GutI); - SEFluidCircuitNode& GutL1 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::GutL1); //Pre-lymphatic node 1 - SEFluidCircuitNode& GutL2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::GutL2); //Pre-lymphatic node 2--valve check + SEFluidCircuitNode& GutL1 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::GutL1); // Pre-lymphatic node 1 + SEFluidCircuitNode& GutL2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::GutL2); // Pre-lymphatic node 2--valve check - //Gut tissue takes fluid from large and small intestines and splanchnic - //These vascular compartments have the same pressure setpoints, but take an average just in case they were changed during tuning + // Gut tissue takes fluid from large and small intestines and splanchnic + // These vascular compartments have the same pressure setpoints, but take an average just in case they were changed during tuning vNodePressure = (SmallIntestineV->GetPressure(PressureUnit::mmHg) + LargeIntestineV->GetPressure(PressureUnit::mmHg) + SplanchnicV->GetPressure(PressureUnit::mmHg)) / 3.0 / VolumeModifierGut; - e1NodePressure = vNodePressure - copVascular_mmHg; //Plasma colloid osmotic pressure opposes flow into tissue space (i.e. favor E1 to V) + e1NodePressure = vNodePressure - copVascular_mmHg; // Plasma colloid osmotic pressure opposes flow into tissue space (i.e. favor E1 to V) e3NodePressure = vNodePressure - targetHydrostaticGradient_mmHg; - e2NodePressure = e3NodePressure - copExtracell_mmHg; //Extracellular colloid osmotic pressure promotes flow from E2 to E3 + e2NodePressure = e3NodePressure - copExtracell_mmHg; // Extracellular colloid osmotic pressure promotes flow from E2 to E3 if (e3NodePressure > preLymphaticPressureMin_mmHg) { l1NodePressure = e3NodePressure; } else { @@ -3801,8 +3812,8 @@ void BioGears::SetupTissue() GutE2.GetPressure().SetValue(e2NodePressure, PressureUnit::mmHg); GutE3.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); GutE3.GetVolumeBaseline().SetValue(GutEWFraction * GutTissueVolume * 1000.0, VolumeUnit::mL); - GutI.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); //No hydrostatic pressure difference between intra/extra - GutI.GetVolumeBaseline().SetValue(GutIWFraction * GutTissueVolume * 1000.0, VolumeUnit::mL); //intracellular node + GutI.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); // No hydrostatic pressure difference between intra/extra + GutI.GetVolumeBaseline().SetValue(GutIWFraction * GutTissueVolume * 1000.0, VolumeUnit::mL); // intracellular node GutL1.GetPressure().SetValue(l1NodePressure, PressureUnit::mmHg); GutL2.GetPressure().SetValue(l2NodePressure, PressureUnit::mmHg); @@ -3818,7 +3829,7 @@ void BioGears::SetupTissue() SEFluidCircuitPath& GutE2ToGutE3 = cCombinedCardiovascular.CreatePath(GutE2, GutE3, BGE::TissuePath::GutE2ToGutE3); GutE2ToGutE3.GetPressureSourceBaseline().SetValue(copExtracell_mmHg, PressureUnit::mmHg); SEFluidCircuitPath& GutE3ToGround = cCombinedCardiovascular.CreatePath(GutE3, *Ground, BGE::TissuePath::GutE3ToGround); - GutE3ToGround.GetComplianceBaseline().SetValue(GutE3.GetVolumeBaseline(VolumeUnit::mL) / vNodePressure, FlowComplianceUnit::mL_Per_mmHg); //Might need to change this + GutE3ToGround.GetComplianceBaseline().SetValue(GutE3.GetVolumeBaseline(VolumeUnit::mL) / vNodePressure, FlowComplianceUnit::mL_Per_mmHg); // Might need to change this SEFluidCircuitPath& GutE3ToGutI = cCombinedCardiovascular.CreatePath(GutE3, GutI, BGE::TissuePath::GutE3ToGutI); GutE3ToGutI.GetFlowSourceBaseline().SetValue(0.0, VolumePerTimeUnit::mL_Per_s); SEFluidCircuitPath& GutIToGround = cCombinedCardiovascular.CreatePath(GutI, *Ground, BGE::TissuePath::GutIToGround); @@ -3829,7 +3840,7 @@ void BioGears::SetupTissue() SEFluidCircuitPath& GutL1ToGutL2 = cCombinedCardiovascular.CreatePath(GutL1, GutL2, BGE::TissuePath::GutL1ToGutL2); GutL1ToGutL2.GetResistanceBaseline().SetValue(lymphResistance_mmHg_min_Per_mL, FlowResistanceUnit::mmHg_min_Per_mL); SEFluidCircuitPath& GutL2ToLymph = cCombinedCardiovascular.CreatePath(GutL2, Lymph, BGE::TissuePath::GutToLymphValve); - GutL2ToLymph.SetNextValve(CDM::enumOpenClosed::Closed); + GutL2ToLymph.SetNextValve(SEOpenClosed::Closed); SETissueCompartment& GutTissue = m_Compartments->CreateTissueCompartment(BGE::TissueCompartment::Gut); SELiquidCompartment& GutExtracellular = m_Compartments->CreateLiquidCompartment(BGE::ExtravascularCompartment::GutExtracellular); @@ -3856,7 +3867,7 @@ void BioGears::SetupTissue() ///////////////// // Left Kidney // SEFluidCircuitNode* LeftKidneyV; - if (!m_Config->IsRenalEnabled()) { + if (!m_Configuration->IsRenalEnabled()) { LeftKidneyV = cCombinedCardiovascular.GetNode(BGE::CardiovascularNode::LeftKidney1); } else { LeftKidneyV = cCombinedCardiovascular.GetNode(BGE::RenalNode::LeftGlomerularCapillaries); @@ -3866,15 +3877,15 @@ void BioGears::SetupTissue() SEFluidCircuitNode& LeftKidneyE2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::LeftKidneyE2); SEFluidCircuitNode& LeftKidneyE3 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::LeftKidneyE3); SEFluidCircuitNode& LeftKidneyI = cCombinedCardiovascular.CreateNode(BGE::TissueNode::LeftKidneyI); - SEFluidCircuitNode& LeftKidneyL1 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::LeftKidneyL1); //Pre-lymphatic node 1 - SEFluidCircuitNode& LeftKidneyL2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::LeftKidneyL2); //Pre-lymphatic node 2--valve check + SEFluidCircuitNode& LeftKidneyL1 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::LeftKidneyL1); // Pre-lymphatic node 1 + SEFluidCircuitNode& LeftKidneyL2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::LeftKidneyL2); // Pre-lymphatic node 2--valve check - //Kidneys are a little bit different because there is an oncotic pressure source set against glomerular capillaries that increases - //effective pressure on node quite a bit. This value is derived from average hydrostatic pressure on node and glomerular oncotic pressure source. + // Kidneys are a little bit different because there is an oncotic pressure source set against glomerular capillaries that increases + // effective pressure on node quite a bit. This value is derived from average hydrostatic pressure on node and glomerular oncotic pressure source. vNodePressure = 65.474; - e1NodePressure = vNodePressure - copVascular_mmHg; //Plasma colloid osmotic pressure opposes flow into tissue space (i.e. favor E1 to V) + e1NodePressure = vNodePressure - copVascular_mmHg; // Plasma colloid osmotic pressure opposes flow into tissue space (i.e. favor E1 to V) e3NodePressure = vNodePressure - targetHydrostaticGradient_mmHg; - e2NodePressure = e3NodePressure - copExtracell_mmHg; //Extracellular colloid osmotic pressure promotes flow from E2 to E3 + e2NodePressure = e3NodePressure - copExtracell_mmHg; // Extracellular colloid osmotic pressure promotes flow from E2 to E3 if (e3NodePressure > preLymphaticPressureMin_mmHg) { l1NodePressure = e3NodePressure; } else { @@ -3891,8 +3902,8 @@ void BioGears::SetupTissue() LeftKidneyE2.GetPressure().SetValue(e2NodePressure, PressureUnit::mmHg); LeftKidneyE3.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); LeftKidneyE3.GetVolumeBaseline().SetValue(LKidneyEWFraction * LKidneyTissueVolume * 1000.0, VolumeUnit::mL); - LeftKidneyI.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); //No hydrostatic pressure difference between intra/extra - LeftKidneyI.GetVolumeBaseline().SetValue(LKidneyIWFraction * LKidneyTissueVolume * 1000.0, VolumeUnit::mL); //intracellular node + LeftKidneyI.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); // No hydrostatic pressure difference between intra/extra + LeftKidneyI.GetVolumeBaseline().SetValue(LKidneyIWFraction * LKidneyTissueVolume * 1000.0, VolumeUnit::mL); // intracellular node LeftKidneyL1.GetPressure().SetValue(l1NodePressure, PressureUnit::mmHg); LeftKidneyL2.GetPressure().SetValue(l2NodePressure, PressureUnit::mmHg); @@ -3903,7 +3914,7 @@ void BioGears::SetupTissue() SEFluidCircuitPath& LeftKidneyE2ToLeftKidneyE3 = cCombinedCardiovascular.CreatePath(LeftKidneyE2, LeftKidneyE3, BGE::TissuePath::LeftKidneyE2ToLeftKidneyE3); LeftKidneyE2ToLeftKidneyE3.GetPressureSourceBaseline().SetValue(copExtracell_mmHg, PressureUnit::mmHg); SEFluidCircuitPath& LeftKidneyE3ToGround = cCombinedCardiovascular.CreatePath(LeftKidneyE3, *Ground, BGE::TissuePath::LeftKidneyE3ToGround); - LeftKidneyE3ToGround.GetComplianceBaseline().SetValue(LeftKidneyE3.GetVolumeBaseline(VolumeUnit::mL) / vNodePressure, FlowComplianceUnit::mL_Per_mmHg); //Might need to change this + LeftKidneyE3ToGround.GetComplianceBaseline().SetValue(LeftKidneyE3.GetVolumeBaseline(VolumeUnit::mL) / vNodePressure, FlowComplianceUnit::mL_Per_mmHg); // Might need to change this SEFluidCircuitPath& LeftKidneyE3ToLeftKidneyI = cCombinedCardiovascular.CreatePath(LeftKidneyE3, LeftKidneyI, BGE::TissuePath::LeftKidneyE3ToLeftKidneyI); LeftKidneyE3ToLeftKidneyI.GetFlowSourceBaseline().SetValue(0.0, VolumePerTimeUnit::mL_Per_s); SEFluidCircuitPath& LeftKidneyIToGround = cCombinedCardiovascular.CreatePath(LeftKidneyI, *Ground, BGE::TissuePath::LeftKidneyIToGround); @@ -3914,7 +3925,7 @@ void BioGears::SetupTissue() SEFluidCircuitPath& LeftKidneyL1ToLeftKidneyL2 = cCombinedCardiovascular.CreatePath(LeftKidneyL1, LeftKidneyL2, BGE::TissuePath::LeftKidneyL1ToLeftKidneyL2); LeftKidneyL1ToLeftKidneyL2.GetResistanceBaseline().SetValue(lymphResistance_mmHg_min_Per_mL, FlowResistanceUnit::mmHg_min_Per_mL); SEFluidCircuitPath& LeftKidneyL2ToLymph = cCombinedCardiovascular.CreatePath(LeftKidneyL2, Lymph, BGE::TissuePath::LeftKidneyToLymphValve); - LeftKidneyL2ToLymph.SetNextValve(CDM::enumOpenClosed::Closed); + LeftKidneyL2ToLymph.SetNextValve(SEOpenClosed::Closed); SETissueCompartment& LeftKidneyTissue = m_Compartments->CreateTissueCompartment(BGE::TissueCompartment::LeftKidney); SELiquidCompartment& LeftKidneyExtracellular = m_Compartments->CreateLiquidCompartment(BGE::ExtravascularCompartment::LeftKidneyExtracellular); @@ -3945,16 +3956,16 @@ void BioGears::SetupTissue() SEFluidCircuitNode& LeftLungE2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::LeftLungE2); SEFluidCircuitNode& LeftLungE3 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::LeftLungE3); SEFluidCircuitNode& LeftLungI = cCombinedCardiovascular.CreateNode(BGE::TissueNode::LeftLungI); - SEFluidCircuitNode& LeftLungL1 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::LeftLungL1); //Pre-lymphatic node 1 - SEFluidCircuitNode& LeftLungL2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::LeftLungL2); //Pre-lymphatic node 2--valve check + SEFluidCircuitNode& LeftLungL1 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::LeftLungL1); // Pre-lymphatic node 1 + SEFluidCircuitNode& LeftLungL2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::LeftLungL2); // Pre-lymphatic node 2--valve check - //vNodePressure = LeftLungV->GetPressure(PressureUnit::mmHg); - //Using empirical value from previous iteration of tissue circuit because the extracellular lung volume was increasing too much - //When we revisit oncotic pressure calculations, this might be attributate to different concentrations of albumin in lungs than rest of body + // vNodePressure = LeftLungV->GetPressure(PressureUnit::mmHg); + // Using empirical value from previous iteration of tissue circuit because the extracellular lung volume was increasing too much + // When we revisit oncotic pressure calculations, this might be attributate to different concentrations of albumin in lungs than rest of body vNodePressure = 9.339; - e1NodePressure = vNodePressure - copVascular_mmHg; //Plasma colloid osmotic pressure opposes flow into tissue space (i.e. favor E1 to V) + e1NodePressure = vNodePressure - copVascular_mmHg; // Plasma colloid osmotic pressure opposes flow into tissue space (i.e. favor E1 to V) e3NodePressure = vNodePressure - targetHydrostaticGradient_mmHg; - e2NodePressure = e3NodePressure - copExtracell_mmHg; //Extracellular colloid osmotic pressure promotes flow from E2 to E3 + e2NodePressure = e3NodePressure - copExtracell_mmHg; // Extracellular colloid osmotic pressure promotes flow from E2 to E3 if (e3NodePressure > preLymphaticPressureMin_mmHg) { l1NodePressure = e3NodePressure; } else { @@ -3971,8 +3982,8 @@ void BioGears::SetupTissue() LeftLungE2.GetPressure().SetValue(e2NodePressure, PressureUnit::mmHg); LeftLungE3.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); LeftLungE3.GetVolumeBaseline().SetValue(LLungEWFraction * LLungTissueVolume * 1000.0, VolumeUnit::mL); - LeftLungI.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); //No hydrostatic pressure difference between intra/extra - LeftLungI.GetVolumeBaseline().SetValue(LLungIWFraction * LLungTissueVolume * 1000.0, VolumeUnit::mL); //intracellular node + LeftLungI.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); // No hydrostatic pressure difference between intra/extra + LeftLungI.GetVolumeBaseline().SetValue(LLungIWFraction * LLungTissueVolume * 1000.0, VolumeUnit::mL); // intracellular node LeftLungL1.GetPressure().SetValue(l1NodePressure, PressureUnit::mmHg); LeftLungL2.GetPressure().SetValue(l2NodePressure, PressureUnit::mmHg); @@ -3983,8 +3994,8 @@ void BioGears::SetupTissue() SEFluidCircuitPath& LeftLungE2ToLeftLungE3 = cCombinedCardiovascular.CreatePath(LeftLungE2, LeftLungE3, BGE::TissuePath::LeftLungE2ToLeftLungE3); LeftLungE2ToLeftLungE3.GetPressureSourceBaseline().SetValue(copExtracell_mmHg, PressureUnit::mmHg); SEFluidCircuitPath& LeftLungE3ToGround = cCombinedCardiovascular.CreatePath(LeftLungE3, *Ground, BGE::TissuePath::LeftLungE3ToGround); - //Lung interstitial compliance based of value in Miserocchi1993Pulmonary - LeftLungE3ToGround.GetComplianceBaseline().SetValue(0.00544 * LeftLungE3.GetVolumeBaseline(VolumeUnit::mL), FlowComplianceUnit::mL_Per_mmHg); //Might need to change this + // Lung interstitial compliance based of value in Miserocchi1993Pulmonary + LeftLungE3ToGround.GetComplianceBaseline().SetValue(0.00544 * LeftLungE3.GetVolumeBaseline(VolumeUnit::mL), FlowComplianceUnit::mL_Per_mmHg); // Might need to change this SEFluidCircuitPath& LeftLungE3ToLeftLungI = cCombinedCardiovascular.CreatePath(LeftLungE3, LeftLungI, BGE::TissuePath::LeftLungE3ToLeftLungI); LeftLungE3ToLeftLungI.GetFlowSourceBaseline().SetValue(0.0, VolumePerTimeUnit::mL_Per_s); SEFluidCircuitPath& LeftLungIToGround = cCombinedCardiovascular.CreatePath(LeftLungI, *Ground, BGE::TissuePath::LeftLungIToGround); @@ -3995,7 +4006,7 @@ void BioGears::SetupTissue() SEFluidCircuitPath& LeftLungL1ToLeftLungL2 = cCombinedCardiovascular.CreatePath(LeftLungL1, LeftLungL2, BGE::TissuePath::LeftLungL1ToLeftLungL2); LeftLungL1ToLeftLungL2.GetResistanceBaseline().SetValue(lymphResistance_mmHg_min_Per_mL, FlowResistanceUnit::mmHg_min_Per_mL); SEFluidCircuitPath& LeftLungL2ToLymph = cCombinedCardiovascular.CreatePath(LeftLungL2, Lymph, BGE::TissuePath::LeftLungToLymphValve); - LeftLungL2ToLymph.SetNextValve(CDM::enumOpenClosed::Closed); + LeftLungL2ToLymph.SetNextValve(SEOpenClosed::Closed); SETissueCompartment& LeftLungTissue = m_Compartments->CreateTissueCompartment(BGE::TissueCompartment::LeftLung); SELiquidCompartment& LeftLungExtracellular = m_Compartments->CreateLiquidCompartment(BGE::ExtravascularCompartment::LeftLungExtracellular); @@ -4023,8 +4034,8 @@ void BioGears::SetupTissue() LeftLungExtracellular, BGE::VascularLink::LeftLungVascularToTissue); LeftLungVascularToTissue.MapPath(LeftLungVToLeftLungE1); - //SELiquidCompartmentLink& LeftLungTissueToLymph = m_Compartments->CreateLiquidLink(LeftLungExtracellular, cLymph, BGE::LymphLink::LeftLungTissueToLymph); - //LeftLungTissueToLymph.MapPath(LeftLungL2ToLymph); + // SELiquidCompartmentLink& LeftLungTissueToLymph = m_Compartments->CreateLiquidLink(LeftLungExtracellular, cLymph, BGE::LymphLink::LeftLungTissueToLymph); + // LeftLungTissueToLymph.MapPath(LeftLungL2ToLymph); /////////// // Liver // @@ -4033,13 +4044,13 @@ void BioGears::SetupTissue() SEFluidCircuitNode& LiverE2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::LiverE2); SEFluidCircuitNode& LiverE3 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::LiverE3); SEFluidCircuitNode& LiverI = cCombinedCardiovascular.CreateNode(BGE::TissueNode::LiverI); - SEFluidCircuitNode& LiverL1 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::LiverL1); //Pre-lymphatic node 1 - SEFluidCircuitNode& LiverL2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::LiverL2); //Pre-lymphatic node 2--valve check + SEFluidCircuitNode& LiverL1 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::LiverL1); // Pre-lymphatic node 1 + SEFluidCircuitNode& LiverL2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::LiverL2); // Pre-lymphatic node 2--valve check vNodePressure = LiverV->GetPressure(PressureUnit::mmHg) / VolumeModifierLiver; - e1NodePressure = vNodePressure - copVascular_mmHg; //Plasma colloid osmotic pressure opposes flow into tissue space (i.e. favor E1 to V) + e1NodePressure = vNodePressure - copVascular_mmHg; // Plasma colloid osmotic pressure opposes flow into tissue space (i.e. favor E1 to V) e3NodePressure = vNodePressure - targetHydrostaticGradient_mmHg; - e2NodePressure = e3NodePressure - copExtracell_mmHg; //Extracellular colloid osmotic pressure promotes flow from E2 to E3 + e2NodePressure = e3NodePressure - copExtracell_mmHg; // Extracellular colloid osmotic pressure promotes flow from E2 to E3 if (e3NodePressure > preLymphaticPressureMin_mmHg) { l1NodePressure = e3NodePressure; } else { @@ -4056,8 +4067,8 @@ void BioGears::SetupTissue() LiverE2.GetPressure().SetValue(e2NodePressure, PressureUnit::mmHg); LiverE3.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); LiverE3.GetVolumeBaseline().SetValue(LiverEWFraction * LiverTissueVolume * 1000.0, VolumeUnit::mL); - LiverI.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); //No hydrostatic pressure difference between intra/extra - LiverI.GetVolumeBaseline().SetValue(LiverIWFraction * LiverTissueVolume * 1000.0, VolumeUnit::mL); //intracellular node + LiverI.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); // No hydrostatic pressure difference between intra/extra + LiverI.GetVolumeBaseline().SetValue(LiverIWFraction * LiverTissueVolume * 1000.0, VolumeUnit::mL); // intracellular node LiverL1.GetPressure().SetValue(l1NodePressure, PressureUnit::mmHg); LiverL2.GetPressure().SetValue(l2NodePressure, PressureUnit::mmHg); @@ -4068,7 +4079,7 @@ void BioGears::SetupTissue() SEFluidCircuitPath& LiverE2ToLiverE3 = cCombinedCardiovascular.CreatePath(LiverE2, LiverE3, BGE::TissuePath::LiverE2ToLiverE3); LiverE2ToLiverE3.GetPressureSourceBaseline().SetValue(copExtracell_mmHg, PressureUnit::mmHg); SEFluidCircuitPath& LiverE3ToGround = cCombinedCardiovascular.CreatePath(LiverE3, *Ground, BGE::TissuePath::LiverE3ToGround); - LiverE3ToGround.GetComplianceBaseline().SetValue(LiverE3.GetVolumeBaseline(VolumeUnit::mL) / vNodePressure, FlowComplianceUnit::mL_Per_mmHg); //Might need to change this + LiverE3ToGround.GetComplianceBaseline().SetValue(LiverE3.GetVolumeBaseline(VolumeUnit::mL) / vNodePressure, FlowComplianceUnit::mL_Per_mmHg); // Might need to change this SEFluidCircuitPath& LiverE3ToLiverI = cCombinedCardiovascular.CreatePath(LiverE3, LiverI, BGE::TissuePath::LiverE3ToLiverI); LiverE3ToLiverI.GetFlowSourceBaseline().SetValue(0.0, VolumePerTimeUnit::mL_Per_s); SEFluidCircuitPath& LiverIToGround = cCombinedCardiovascular.CreatePath(LiverI, *Ground, BGE::TissuePath::LiverIToGround); @@ -4079,7 +4090,7 @@ void BioGears::SetupTissue() SEFluidCircuitPath& LiverL1ToLiverL2 = cCombinedCardiovascular.CreatePath(LiverL1, LiverL2, BGE::TissuePath::LiverL1ToLiverL2); LiverL1ToLiverL2.GetResistanceBaseline().SetValue(lymphResistance_mmHg_min_Per_mL, FlowResistanceUnit::mmHg_min_Per_mL); SEFluidCircuitPath& LiverL2ToLymph = cCombinedCardiovascular.CreatePath(LiverL2, Lymph, BGE::TissuePath::LiverToLymphValve); - LiverL2ToLymph.SetNextValve(CDM::enumOpenClosed::Closed); + LiverL2ToLymph.SetNextValve(SEOpenClosed::Closed); SETissueCompartment& LiverTissue = m_Compartments->CreateTissueCompartment(BGE::TissueCompartment::Liver); SELiquidCompartment& LiverExtracellular = m_Compartments->CreateLiquidCompartment(BGE::ExtravascularCompartment::LiverExtracellular); @@ -4110,13 +4121,13 @@ void BioGears::SetupTissue() SEFluidCircuitNode& MuscleE2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::MuscleE2); SEFluidCircuitNode& MuscleE3 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::MuscleE3); SEFluidCircuitNode& MuscleI = cCombinedCardiovascular.CreateNode(BGE::TissueNode::MuscleI); - SEFluidCircuitNode& MuscleL1 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::MuscleL1); //Pre-lymphatic node 1 - SEFluidCircuitNode& MuscleL2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::MuscleL2); //Pre-lymphatic node 2--valve check + SEFluidCircuitNode& MuscleL1 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::MuscleL1); // Pre-lymphatic node 1 + SEFluidCircuitNode& MuscleL2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::MuscleL2); // Pre-lymphatic node 2--valve check vNodePressure = MuscleV->GetPressure(PressureUnit::mmHg) / VolumeModifierMuscle; - e1NodePressure = vNodePressure - copVascular_mmHg; //Plasma colloid osmotic pressure opposes flow into tissue space (i.e. favor E1 to V) + e1NodePressure = vNodePressure - copVascular_mmHg; // Plasma colloid osmotic pressure opposes flow into tissue space (i.e. favor E1 to V) e3NodePressure = vNodePressure - targetHydrostaticGradient_mmHg; - e2NodePressure = e3NodePressure - copExtracell_mmHg; //Extracellular colloid osmotic pressure promotes flow from E2 to E3 + e2NodePressure = e3NodePressure - copExtracell_mmHg; // Extracellular colloid osmotic pressure promotes flow from E2 to E3 if (e3NodePressure > preLymphaticPressureMin_mmHg) { l1NodePressure = e3NodePressure; } else { @@ -4133,8 +4144,8 @@ void BioGears::SetupTissue() MuscleE2.GetPressure().SetValue(e2NodePressure, PressureUnit::mmHg); MuscleE3.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); MuscleE3.GetVolumeBaseline().SetValue(MuscleEWFraction * MuscleTissueVolume * 1000.0, VolumeUnit::mL); - MuscleI.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); //No hydrostatic pressure difference between intra/extra - MuscleI.GetVolumeBaseline().SetValue(MuscleIWFraction * MuscleTissueVolume * 1000.0, VolumeUnit::mL); //intracellular node + MuscleI.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); // No hydrostatic pressure difference between intra/extra + MuscleI.GetVolumeBaseline().SetValue(MuscleIWFraction * MuscleTissueVolume * 1000.0, VolumeUnit::mL); // intracellular node MuscleL1.GetPressure().SetValue(l1NodePressure, PressureUnit::mmHg); MuscleL2.GetPressure().SetValue(l2NodePressure, PressureUnit::mmHg); @@ -4145,7 +4156,7 @@ void BioGears::SetupTissue() SEFluidCircuitPath& MuscleE2ToMuscleE3 = cCombinedCardiovascular.CreatePath(MuscleE2, MuscleE3, BGE::TissuePath::MuscleE2ToMuscleE3); MuscleE2ToMuscleE3.GetPressureSourceBaseline().SetValue(copExtracell_mmHg, PressureUnit::mmHg); SEFluidCircuitPath& MuscleE3ToGround = cCombinedCardiovascular.CreatePath(MuscleE3, *Ground, BGE::TissuePath::MuscleE3ToGround); - MuscleE3ToGround.GetComplianceBaseline().SetValue(200.0, FlowComplianceUnit::mL_Per_mmHg); //From Reisner2012Computational + MuscleE3ToGround.GetComplianceBaseline().SetValue(200.0, FlowComplianceUnit::mL_Per_mmHg); // From Reisner2012Computational SEFluidCircuitPath& MuscleE3ToMuscleI = cCombinedCardiovascular.CreatePath(MuscleE3, MuscleI, BGE::TissuePath::MuscleE3ToMuscleI); MuscleE3ToMuscleI.GetFlowSourceBaseline().SetValue(0.0, VolumePerTimeUnit::mL_Per_s); SEFluidCircuitPath& MuscleIToGround = cCombinedCardiovascular.CreatePath(MuscleI, *Ground, BGE::TissuePath::MuscleIToGround); @@ -4156,7 +4167,7 @@ void BioGears::SetupTissue() SEFluidCircuitPath& MuscleL1ToMuscleL2 = cCombinedCardiovascular.CreatePath(MuscleL1, MuscleL2, BGE::TissuePath::MuscleL1ToMuscleL2); MuscleL1ToMuscleL2.GetResistanceBaseline().SetValue(lymphResistance_mmHg_min_Per_mL, FlowResistanceUnit::mmHg_min_Per_mL); SEFluidCircuitPath& MuscleL2ToLymph = cCombinedCardiovascular.CreatePath(MuscleL2, Lymph, BGE::TissuePath::MuscleToLymphValve); - MuscleL2ToLymph.SetNextValve(CDM::enumOpenClosed::Closed); + MuscleL2ToLymph.SetNextValve(SEOpenClosed::Closed); SETissueCompartment& MuscleTissue = m_Compartments->CreateTissueCompartment(BGE::TissueCompartment::Muscle); SELiquidCompartment& MuscleExtracellular = m_Compartments->CreateLiquidCompartment(BGE::ExtravascularCompartment::MuscleExtracellular); @@ -4187,13 +4198,13 @@ void BioGears::SetupTissue() SEFluidCircuitNode& MyocardiumE2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::MyocardiumE2); SEFluidCircuitNode& MyocardiumE3 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::MyocardiumE3); SEFluidCircuitNode& MyocardiumI = cCombinedCardiovascular.CreateNode(BGE::TissueNode::MyocardiumI); - SEFluidCircuitNode& MyocardiumL1 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::MyocardiumL1); //Pre-lymphatic node 1 - SEFluidCircuitNode& MyocardiumL2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::MyocardiumL2); //Pre-lymphatic node 2--valve check + SEFluidCircuitNode& MyocardiumL1 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::MyocardiumL1); // Pre-lymphatic node 1 + SEFluidCircuitNode& MyocardiumL2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::MyocardiumL2); // Pre-lymphatic node 2--valve check vNodePressure = MyocardiumV->GetPressure(PressureUnit::mmHg) / VolumeModifierMyocardium; - e1NodePressure = vNodePressure - copVascular_mmHg; //Plasma colloid osmotic pressure opposes flow into tissue space (i.e. favor E1 to V) + e1NodePressure = vNodePressure - copVascular_mmHg; // Plasma colloid osmotic pressure opposes flow into tissue space (i.e. favor E1 to V) e3NodePressure = vNodePressure - targetHydrostaticGradient_mmHg; - e2NodePressure = e3NodePressure - copExtracell_mmHg; //Extracellular colloid osmotic pressure promotes flow from E2 to E3 + e2NodePressure = e3NodePressure - copExtracell_mmHg; // Extracellular colloid osmotic pressure promotes flow from E2 to E3 if (e3NodePressure > preLymphaticPressureMin_mmHg) { l1NodePressure = e3NodePressure; } else { @@ -4210,8 +4221,8 @@ void BioGears::SetupTissue() MyocardiumE2.GetPressure().SetValue(e2NodePressure, PressureUnit::mmHg); MyocardiumE3.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); MyocardiumE3.GetVolumeBaseline().SetValue(MyocardiumEWFraction * MyocardiumTissueVolume * 1000.0, VolumeUnit::mL); - MyocardiumI.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); //No hydrostatic pressure difference between intra/extra - MyocardiumI.GetVolumeBaseline().SetValue(MyocardiumIWFraction * MyocardiumTissueVolume * 1000.0, VolumeUnit::mL); //intracellular node + MyocardiumI.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); // No hydrostatic pressure difference between intra/extra + MyocardiumI.GetVolumeBaseline().SetValue(MyocardiumIWFraction * MyocardiumTissueVolume * 1000.0, VolumeUnit::mL); // intracellular node MyocardiumL1.GetPressure().SetValue(l1NodePressure, PressureUnit::mmHg); MyocardiumL2.GetPressure().SetValue(l2NodePressure, PressureUnit::mmHg); @@ -4222,7 +4233,7 @@ void BioGears::SetupTissue() SEFluidCircuitPath& MyocardiumE2ToMyocardiumE3 = cCombinedCardiovascular.CreatePath(MyocardiumE2, MyocardiumE3, BGE::TissuePath::MyocardiumE2ToMyocardiumE3); MyocardiumE2ToMyocardiumE3.GetPressureSourceBaseline().SetValue(copExtracell_mmHg, PressureUnit::mmHg); SEFluidCircuitPath& MyocardiumE3ToGround = cCombinedCardiovascular.CreatePath(MyocardiumE3, *Ground, BGE::TissuePath::MyocardiumE3ToGround); - MyocardiumE3ToGround.GetComplianceBaseline().SetValue(MyocardiumE3.GetVolumeBaseline(VolumeUnit::mL) / vNodePressure, FlowComplianceUnit::mL_Per_mmHg); //Might need to change this + MyocardiumE3ToGround.GetComplianceBaseline().SetValue(MyocardiumE3.GetVolumeBaseline(VolumeUnit::mL) / vNodePressure, FlowComplianceUnit::mL_Per_mmHg); // Might need to change this SEFluidCircuitPath& MyocardiumE3ToMyocardiumI = cCombinedCardiovascular.CreatePath(MyocardiumE3, MyocardiumI, BGE::TissuePath::MyocardiumE3ToMyocardiumI); MyocardiumE3ToMyocardiumI.GetFlowSourceBaseline().SetValue(0.0, VolumePerTimeUnit::mL_Per_s); SEFluidCircuitPath& MyocardiumIToGround = cCombinedCardiovascular.CreatePath(MyocardiumI, *Ground, BGE::TissuePath::MyocardiumIToGround); @@ -4233,7 +4244,7 @@ void BioGears::SetupTissue() SEFluidCircuitPath& MyocardiumL1ToMyocardiumL2 = cCombinedCardiovascular.CreatePath(MyocardiumL1, MyocardiumL2, BGE::TissuePath::MyocardiumL1ToMyocardiumL2); MyocardiumL1ToMyocardiumL2.GetResistanceBaseline().SetValue(lymphResistance_mmHg_min_Per_mL, FlowResistanceUnit::mmHg_min_Per_mL); SEFluidCircuitPath& MyocardiumL2ToLymph = cCombinedCardiovascular.CreatePath(MyocardiumL2, Lymph, BGE::TissuePath::MyocardiumToLymphValve); - MyocardiumL2ToLymph.SetNextValve(CDM::enumOpenClosed::Closed); + MyocardiumL2ToLymph.SetNextValve(SEOpenClosed::Closed); SETissueCompartment& MyocardiumTissue = m_Compartments->CreateTissueCompartment(BGE::TissueCompartment::Myocardium); SELiquidCompartment& MyocardiumExtracellular = m_Compartments->CreateLiquidCompartment(BGE::ExtravascularCompartment::MyocardiumExtracellular); @@ -4260,7 +4271,7 @@ void BioGears::SetupTissue() ////////////////// // Right Kidney // SEFluidCircuitNode* RightKidneyV; - if (!m_Config->IsRenalEnabled()) { + if (!m_Configuration->IsRenalEnabled()) { RightKidneyV = cCombinedCardiovascular.GetNode(BGE::CardiovascularNode::RightKidney1); } else { RightKidneyV = cCombinedCardiovascular.GetNode(BGE::RenalNode::RightGlomerularCapillaries); @@ -4270,15 +4281,15 @@ void BioGears::SetupTissue() SEFluidCircuitNode& RightKidneyE2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::RightKidneyE2); SEFluidCircuitNode& RightKidneyE3 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::RightKidneyE3); SEFluidCircuitNode& RightKidneyI = cCombinedCardiovascular.CreateNode(BGE::TissueNode::RightKidneyI); - SEFluidCircuitNode& RightKidneyL1 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::RightKidneyL1); //Pre-lymphatic node 1 - SEFluidCircuitNode& RightKidneyL2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::RightKidneyL2); //Pre-lymphatic node 2--valve check + SEFluidCircuitNode& RightKidneyL1 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::RightKidneyL1); // Pre-lymphatic node 1 + SEFluidCircuitNode& RightKidneyL2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::RightKidneyL2); // Pre-lymphatic node 2--valve check - //Kidneys are a little bit different because there is an oncotic pressure source set against glomerular capillaries that increases - //effective pressure on node quite a bit. This value is derived from average hydrostatic pressure on node and glomerular oncotic pressure source. + // Kidneys are a little bit different because there is an oncotic pressure source set against glomerular capillaries that increases + // effective pressure on node quite a bit. This value is derived from average hydrostatic pressure on node and glomerular oncotic pressure source. vNodePressure = 65.474; - e1NodePressure = vNodePressure - copVascular_mmHg; //Plasma colloid osmotic pressure opposes flow into tissue space (i.e. favor E1 to V) + e1NodePressure = vNodePressure - copVascular_mmHg; // Plasma colloid osmotic pressure opposes flow into tissue space (i.e. favor E1 to V) e3NodePressure = vNodePressure - targetHydrostaticGradient_mmHg; - e2NodePressure = e3NodePressure - copExtracell_mmHg; //Extracellular colloid osmotic pressure promotes flow from E2 to E3 + e2NodePressure = e3NodePressure - copExtracell_mmHg; // Extracellular colloid osmotic pressure promotes flow from E2 to E3 if (e3NodePressure > preLymphaticPressureMin_mmHg) { l1NodePressure = e3NodePressure; } else { @@ -4295,8 +4306,8 @@ void BioGears::SetupTissue() RightKidneyE2.GetPressure().SetValue(e2NodePressure, PressureUnit::mmHg); RightKidneyE3.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); RightKidneyE3.GetVolumeBaseline().SetValue(RKidneyEWFraction * RKidneyTissueVolume * 1000.0, VolumeUnit::mL); - RightKidneyI.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); //No hydrostatic pressure difference between intra/extra - RightKidneyI.GetVolumeBaseline().SetValue(RKidneyIWFraction * RKidneyTissueVolume * 1000.0, VolumeUnit::mL); //intracellular node + RightKidneyI.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); // No hydrostatic pressure difference between intra/extra + RightKidneyI.GetVolumeBaseline().SetValue(RKidneyIWFraction * RKidneyTissueVolume * 1000.0, VolumeUnit::mL); // intracellular node RightKidneyL1.GetPressure().SetValue(l1NodePressure, PressureUnit::mmHg); RightKidneyL2.GetPressure().SetValue(l2NodePressure, PressureUnit::mmHg); @@ -4307,7 +4318,7 @@ void BioGears::SetupTissue() SEFluidCircuitPath& RightKidneyE2ToRightKidneyE3 = cCombinedCardiovascular.CreatePath(RightKidneyE2, RightKidneyE3, BGE::TissuePath::RightKidneyE2ToRightKidneyE3); RightKidneyE2ToRightKidneyE3.GetPressureSourceBaseline().SetValue(copExtracell_mmHg, PressureUnit::mmHg); SEFluidCircuitPath& RightKidneyE3ToGround = cCombinedCardiovascular.CreatePath(RightKidneyE3, *Ground, BGE::TissuePath::RightKidneyE3ToGround); - RightKidneyE3ToGround.GetComplianceBaseline().SetValue(RightKidneyE3.GetVolumeBaseline(VolumeUnit::mL) / vNodePressure, FlowComplianceUnit::mL_Per_mmHg); //Might need to change this + RightKidneyE3ToGround.GetComplianceBaseline().SetValue(RightKidneyE3.GetVolumeBaseline(VolumeUnit::mL) / vNodePressure, FlowComplianceUnit::mL_Per_mmHg); // Might need to change this SEFluidCircuitPath& RightKidneyE3ToRightKidneyI = cCombinedCardiovascular.CreatePath(RightKidneyE3, RightKidneyI, BGE::TissuePath::RightKidneyE3ToRightKidneyI); RightKidneyE3ToRightKidneyI.GetFlowSourceBaseline().SetValue(0.0, VolumePerTimeUnit::mL_Per_s); SEFluidCircuitPath& RightKidneyIToGround = cCombinedCardiovascular.CreatePath(RightKidneyI, *Ground, BGE::TissuePath::RightKidneyIToGround); @@ -4318,7 +4329,7 @@ void BioGears::SetupTissue() SEFluidCircuitPath& RightKidneyL1ToRightKidneyL2 = cCombinedCardiovascular.CreatePath(RightKidneyL1, RightKidneyL2, BGE::TissuePath::RightKidneyL1ToRightKidneyL2); RightKidneyL1ToRightKidneyL2.GetResistanceBaseline().SetValue(lymphResistance_mmHg_min_Per_mL, FlowResistanceUnit::mmHg_min_Per_mL); SEFluidCircuitPath& RightKidneyL2ToLymph = cCombinedCardiovascular.CreatePath(RightKidneyL2, Lymph, BGE::TissuePath::RightKidneyToLymphValve); - RightKidneyL2ToLymph.SetNextValve(CDM::enumOpenClosed::Closed); + RightKidneyL2ToLymph.SetNextValve(SEOpenClosed::Closed); SETissueCompartment& RightKidneyTissue = m_Compartments->CreateTissueCompartment(BGE::TissueCompartment::RightKidney); SELiquidCompartment& RightKidneyExtracellular = m_Compartments->CreateLiquidCompartment(BGE::ExtravascularCompartment::RightKidneyExtracellular); @@ -4349,16 +4360,16 @@ void BioGears::SetupTissue() SEFluidCircuitNode& RightLungE2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::RightLungE2); SEFluidCircuitNode& RightLungE3 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::RightLungE3); SEFluidCircuitNode& RightLungI = cCombinedCardiovascular.CreateNode(BGE::TissueNode::RightLungI); - SEFluidCircuitNode& RightLungL1 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::RightLungL1); //Pre-lymphatic node 1 - SEFluidCircuitNode& RightLungL2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::RightLungL2); //Pre-lymphatic node 2--valve check + SEFluidCircuitNode& RightLungL1 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::RightLungL1); // Pre-lymphatic node 1 + SEFluidCircuitNode& RightLungL2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::RightLungL2); // Pre-lymphatic node 2--valve check - //vNodePressure = RightLungV->GetPressure(PressureUnit::mmHg); - //Using empirical value from previous iteration of tissue circuit because the extracellular lung volume was increasing too much - //When we revisit oncotic pressure calculations, this might be attributate to different concentrations of albumin in lungs than rest of body + // vNodePressure = RightLungV->GetPressure(PressureUnit::mmHg); + // Using empirical value from previous iteration of tissue circuit because the extracellular lung volume was increasing too much + // When we revisit oncotic pressure calculations, this might be attributate to different concentrations of albumin in lungs than rest of body vNodePressure = 9.339; - e1NodePressure = vNodePressure - copVascular_mmHg; //Plasma colloid osmotic pressure opposes flow into tissue space (i.e. favor E1 to V) + e1NodePressure = vNodePressure - copVascular_mmHg; // Plasma colloid osmotic pressure opposes flow into tissue space (i.e. favor E1 to V) e3NodePressure = vNodePressure - targetHydrostaticGradient_mmHg; - e2NodePressure = e3NodePressure - copExtracell_mmHg; //Extracellular colloid osmotic pressure promotes flow from E2 to E3 + e2NodePressure = e3NodePressure - copExtracell_mmHg; // Extracellular colloid osmotic pressure promotes flow from E2 to E3 if (e3NodePressure > preLymphaticPressureMin_mmHg) { l1NodePressure = e3NodePressure; } else { @@ -4375,8 +4386,8 @@ void BioGears::SetupTissue() RightLungE2.GetPressure().SetValue(e2NodePressure, PressureUnit::mmHg); RightLungE3.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); RightLungE3.GetVolumeBaseline().SetValue(RLungEWFraction * RLungTissueVolume * 1000.0, VolumeUnit::mL); - RightLungI.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); //No hydrostatic pressure difference between intra/extra - RightLungI.GetVolumeBaseline().SetValue(RLungIWFraction * RLungTissueVolume * 1000.0, VolumeUnit::mL); //intracellular node + RightLungI.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); // No hydrostatic pressure difference between intra/extra + RightLungI.GetVolumeBaseline().SetValue(RLungIWFraction * RLungTissueVolume * 1000.0, VolumeUnit::mL); // intracellular node RightLungL1.GetPressure().SetValue(l1NodePressure, PressureUnit::mmHg); RightLungL2.GetPressure().SetValue(l2NodePressure, PressureUnit::mmHg); @@ -4387,8 +4398,8 @@ void BioGears::SetupTissue() SEFluidCircuitPath& RightLungE2ToRightLungE3 = cCombinedCardiovascular.CreatePath(RightLungE2, RightLungE3, BGE::TissuePath::RightLungE2ToRightLungE3); RightLungE2ToRightLungE3.GetPressureSourceBaseline().SetValue(copExtracell_mmHg, PressureUnit::mmHg); SEFluidCircuitPath& RightLungE3ToGround = cCombinedCardiovascular.CreatePath(RightLungE3, *Ground, BGE::TissuePath::RightLungE3ToGround); - //Lung interstitial compliance based of value in Miserocchi1993Pulmonary - RightLungE3ToGround.GetComplianceBaseline().SetValue(0.00544 * RightLungE3.GetVolumeBaseline(VolumeUnit::mL), FlowComplianceUnit::mL_Per_mmHg); //Might need to change this + // Lung interstitial compliance based of value in Miserocchi1993Pulmonary + RightLungE3ToGround.GetComplianceBaseline().SetValue(0.00544 * RightLungE3.GetVolumeBaseline(VolumeUnit::mL), FlowComplianceUnit::mL_Per_mmHg); // Might need to change this // RightLungE3ToGround.GetComplianceBaseline().SetValue(RightLungE3.GetVolumeBaseline(VolumeUnit::mL) / vNodePressure, FlowComplianceUnit::mL_Per_mmHg); SEFluidCircuitPath& RightLungE3ToRightLungI = cCombinedCardiovascular.CreatePath(RightLungE3, RightLungI, BGE::TissuePath::RightLungE3ToRightLungI); RightLungE3ToRightLungI.GetFlowSourceBaseline().SetValue(0.0, VolumePerTimeUnit::mL_Per_s); @@ -4400,7 +4411,7 @@ void BioGears::SetupTissue() SEFluidCircuitPath& RightLungL1ToRightLungL2 = cCombinedCardiovascular.CreatePath(RightLungL1, RightLungL2, BGE::TissuePath::RightLungL1ToRightLungL2); RightLungL1ToRightLungL2.GetResistanceBaseline().SetValue(lymphResistance_mmHg_min_Per_mL, FlowResistanceUnit::mmHg_min_Per_mL); SEFluidCircuitPath& RightLungL2ToLymph = cCombinedCardiovascular.CreatePath(RightLungL2, Lymph, BGE::TissuePath::RightLungToLymphValve); - RightLungL2ToLymph.SetNextValve(CDM::enumOpenClosed::Closed); + RightLungL2ToLymph.SetNextValve(SEOpenClosed::Closed); SETissueCompartment& RightLungTissue = m_Compartments->CreateTissueCompartment(BGE::TissueCompartment::RightLung); SELiquidCompartment& RightLungExtracellular = m_Compartments->CreateLiquidCompartment(BGE::ExtravascularCompartment::RightLungExtracellular); @@ -4431,13 +4442,13 @@ void BioGears::SetupTissue() SEFluidCircuitNode& SkinE2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::SkinE2); SEFluidCircuitNode& SkinE3 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::SkinE3); SEFluidCircuitNode& SkinI = cCombinedCardiovascular.CreateNode(BGE::TissueNode::SkinI); - SEFluidCircuitNode& SkinL1 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::SkinL1); //Pre-lymphatic node 1 - SEFluidCircuitNode& SkinL2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::SkinL2); //Pre-lymphatic node 2--valve check + SEFluidCircuitNode& SkinL1 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::SkinL1); // Pre-lymphatic node 1 + SEFluidCircuitNode& SkinL2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::SkinL2); // Pre-lymphatic node 2--valve check vNodePressure = SkinV->GetPressure(PressureUnit::mmHg) / VolumeModifierSkin; - e1NodePressure = vNodePressure - copVascular_mmHg; //Plasma colloid osmotic pressure opposes flow into tissue space (i.e. favor E1 to V) + e1NodePressure = vNodePressure - copVascular_mmHg; // Plasma colloid osmotic pressure opposes flow into tissue space (i.e. favor E1 to V) e3NodePressure = vNodePressure - targetHydrostaticGradient_mmHg; - e2NodePressure = e3NodePressure - copExtracell_mmHg; //Extracellular colloid osmotic pressure promotes flow from E2 to E3 + e2NodePressure = e3NodePressure - copExtracell_mmHg; // Extracellular colloid osmotic pressure promotes flow from E2 to E3 if (e3NodePressure > preLymphaticPressureMin_mmHg) { l1NodePressure = e3NodePressure; } else { @@ -4454,8 +4465,8 @@ void BioGears::SetupTissue() SkinE2.GetPressure().SetValue(e2NodePressure, PressureUnit::mmHg); SkinE3.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); SkinE3.GetVolumeBaseline().SetValue(SkinEWFraction * SkinTissueVolume * 1000.0, VolumeUnit::mL); - SkinI.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); //No hydrostatic pressure difference between intra/extra - SkinI.GetVolumeBaseline().SetValue(SkinIWFraction * SkinTissueVolume * 1000.0, VolumeUnit::mL); //intracellular node + SkinI.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); // No hydrostatic pressure difference between intra/extra + SkinI.GetVolumeBaseline().SetValue(SkinIWFraction * SkinTissueVolume * 1000.0, VolumeUnit::mL); // intracellular node SkinL1.GetPressure().SetValue(l1NodePressure, PressureUnit::mmHg); SkinL2.GetPressure().SetValue(l2NodePressure, PressureUnit::mmHg); @@ -4466,8 +4477,8 @@ void BioGears::SetupTissue() SEFluidCircuitPath& SkinE2ToSkinE3 = cCombinedCardiovascular.CreatePath(SkinE2, SkinE3, BGE::TissuePath::SkinE2ToSkinE3); SkinE2ToSkinE3.GetPressureSourceBaseline().SetValue(copExtracell_mmHg, PressureUnit::mmHg); SEFluidCircuitPath& SkinE3ToGround = cCombinedCardiovascular.CreatePath(SkinE3, *Ground, BGE::TissuePath::SkinE3ToGround); - //Minus sign in compliance baselines are because the interstitial pressure is negative with respect to atmosphere and we don't want negative compliance - SkinE3ToGround.GetComplianceBaseline().SetValue(SkinE3.GetVolumeBaseline(VolumeUnit::mL) / vNodePressure, FlowComplianceUnit::mL_Per_mmHg); //Might need to change this + // Minus sign in compliance baselines are because the interstitial pressure is negative with respect to atmosphere and we don't want negative compliance + SkinE3ToGround.GetComplianceBaseline().SetValue(SkinE3.GetVolumeBaseline(VolumeUnit::mL) / vNodePressure, FlowComplianceUnit::mL_Per_mmHg); // Might need to change this SEFluidCircuitPath& SkinE3ToSkinI = cCombinedCardiovascular.CreatePath(SkinE3, SkinI, BGE::TissuePath::SkinE3ToSkinI); SkinE3ToSkinI.GetFlowSourceBaseline().SetValue(0.0, VolumePerTimeUnit::mL_Per_s); SEFluidCircuitPath& SkinIToGround = cCombinedCardiovascular.CreatePath(SkinI, *Ground, BGE::TissuePath::SkinIToGround); @@ -4478,7 +4489,7 @@ void BioGears::SetupTissue() SEFluidCircuitPath& SkinL1ToSkinL2 = cCombinedCardiovascular.CreatePath(SkinL1, SkinL2, BGE::TissuePath::SkinL1ToSkinL2); SkinL1ToSkinL2.GetResistanceBaseline().SetValue(lymphResistance_mmHg_min_Per_mL, FlowResistanceUnit::mmHg_min_Per_mL); SEFluidCircuitPath& SkinL2ToLymph = cCombinedCardiovascular.CreatePath(SkinL2, Lymph, BGE::TissuePath::SkinToLymphValve); - SkinL2ToLymph.SetNextValve(CDM::enumOpenClosed::Closed); + SkinL2ToLymph.SetNextValve(SEOpenClosed::Closed); SEFluidCircuitPath& SkinSweatLossToGround = cCombinedCardiovascular.CreatePath(SkinE3, *Ground, BGE::TissuePath::SkinSweating); SkinSweatLossToGround.GetFlowSourceBaseline().SetValue(0.0, VolumePerTimeUnit::mL_Per_s); @@ -4512,13 +4523,13 @@ void BioGears::SetupTissue() SEFluidCircuitNode& SpleenE2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::SpleenE2); SEFluidCircuitNode& SpleenE3 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::SpleenE3); SEFluidCircuitNode& SpleenI = cCombinedCardiovascular.CreateNode(BGE::TissueNode::SpleenI); - SEFluidCircuitNode& SpleenL1 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::SpleenL1); //Pre-lymphatic node 1 - SEFluidCircuitNode& SpleenL2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::SpleenL2); //Pre-lymphatic node 2--valve check + SEFluidCircuitNode& SpleenL1 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::SpleenL1); // Pre-lymphatic node 1 + SEFluidCircuitNode& SpleenL2 = cCombinedCardiovascular.CreateNode(BGE::TissueNode::SpleenL2); // Pre-lymphatic node 2--valve check vNodePressure = SpleenV->GetPressure(PressureUnit::mmHg) / VolumeModifierSpleen; - e1NodePressure = vNodePressure - copVascular_mmHg; //Plasma colloid osmotic pressure opposes flow into tissue space (i.e. favor E1 to V) + e1NodePressure = vNodePressure - copVascular_mmHg; // Plasma colloid osmotic pressure opposes flow into tissue space (i.e. favor E1 to V) e3NodePressure = vNodePressure - targetHydrostaticGradient_mmHg; - e2NodePressure = e3NodePressure - copExtracell_mmHg; //Extracellular colloid osmotic pressure promotes flow from E2 to E3 + e2NodePressure = e3NodePressure - copExtracell_mmHg; // Extracellular colloid osmotic pressure promotes flow from E2 to E3 if (e3NodePressure > preLymphaticPressureMin_mmHg) { l1NodePressure = e3NodePressure; } else { @@ -4535,8 +4546,8 @@ void BioGears::SetupTissue() SpleenE2.GetPressure().SetValue(e2NodePressure, PressureUnit::mmHg); SpleenE3.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); SpleenE3.GetVolumeBaseline().SetValue(SpleenEWFraction * SpleenTissueVolume * 1000.0, VolumeUnit::mL); - SpleenI.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); //No hydrostatic pressure difference between intra/extra - SpleenI.GetVolumeBaseline().SetValue(SpleenIWFraction * SpleenTissueVolume * 1000.0, VolumeUnit::mL); //intracellular node + SpleenI.GetPressure().SetValue(e3NodePressure, PressureUnit::mmHg); // No hydrostatic pressure difference between intra/extra + SpleenI.GetVolumeBaseline().SetValue(SpleenIWFraction * SpleenTissueVolume * 1000.0, VolumeUnit::mL); // intracellular node SpleenL1.GetPressure().SetValue(l1NodePressure, PressureUnit::mmHg); SpleenL2.GetPressure().SetValue(l2NodePressure, PressureUnit::mmHg); @@ -4547,7 +4558,7 @@ void BioGears::SetupTissue() SEFluidCircuitPath& SpleenE2ToSpleenE3 = cCombinedCardiovascular.CreatePath(SpleenE2, SpleenE3, BGE::TissuePath::SpleenE2ToSpleenE3); SpleenE2ToSpleenE3.GetPressureSourceBaseline().SetValue(copExtracell_mmHg, PressureUnit::mmHg); SEFluidCircuitPath& SpleenE3ToGround = cCombinedCardiovascular.CreatePath(SpleenE3, *Ground, BGE::TissuePath::SpleenE3ToGround); - SpleenE3ToGround.GetComplianceBaseline().SetValue(SpleenE3.GetVolumeBaseline(VolumeUnit::mL) / vNodePressure, FlowComplianceUnit::mL_Per_mmHg); //Might need to change this + SpleenE3ToGround.GetComplianceBaseline().SetValue(SpleenE3.GetVolumeBaseline(VolumeUnit::mL) / vNodePressure, FlowComplianceUnit::mL_Per_mmHg); // Might need to change this SEFluidCircuitPath& SpleenE3ToSpleenI = cCombinedCardiovascular.CreatePath(SpleenE3, SpleenI, BGE::TissuePath::SpleenE3ToSpleenI); SpleenE3ToSpleenI.GetFlowSourceBaseline().SetValue(0.0, VolumePerTimeUnit::mL_Per_s); SEFluidCircuitPath& SpleenIToGround = cCombinedCardiovascular.CreatePath(SpleenI, *Ground, BGE::TissuePath::SpleenIToGround); @@ -4558,7 +4569,7 @@ void BioGears::SetupTissue() SEFluidCircuitPath& SpleenL1ToSpleenL2 = cCombinedCardiovascular.CreatePath(SpleenL1, SpleenL2, BGE::TissuePath::SpleenL1ToSpleenL2); SpleenL1ToSpleenL2.GetResistanceBaseline().SetValue(lymphResistance_mmHg_min_Per_mL, FlowResistanceUnit::mmHg_min_Per_mL); SEFluidCircuitPath& SpleenL2ToLymph = cCombinedCardiovascular.CreatePath(SpleenL2, Lymph, BGE::TissuePath::SpleenToLymphValve); - SpleenL2ToLymph.SetNextValve(CDM::enumOpenClosed::Closed); + SpleenL2ToLymph.SetNextValve(SEOpenClosed::Closed); SETissueCompartment& SpleenTissue = m_Compartments->CreateTissueCompartment(BGE::TissueCompartment::Spleen); SELiquidCompartment& SpleenExtracellular = m_Compartments->CreateLiquidCompartment(BGE::ExtravascularCompartment::SpleenExtracellular); @@ -4627,18 +4638,18 @@ void BioGears::SetupRespiratory() SEGasCompartmentGraph& gRespiratory = m_Compartments->GetRespiratoryGraph(); SEGasCompartment* gEnvironment = m_Compartments->GetGasCompartment(BGE::EnvironmentCompartment::Ambient); - //Standard lung parameters - double AmbientPressure_cmH2O = 1033.23; //1 atm + // Standard lung parameters + double AmbientPressure_cmH2O = 1033.23; // 1 atm double FunctionalResidualCapacity_L = 2.313; double LungResidualVolume_L = m_Patient->GetResidualVolume(VolumeUnit::L); - double OpenResistance_cmH2O_s_Per_L = m_Config->GetDefaultOpenFlowResistance(FlowResistanceUnit::cmH2O_s_Per_L); + double OpenResistance_cmH2O_s_Per_L = m_Configuration->GetDefaultOpenFlowResistance(FlowResistanceUnit::cmH2O_s_Per_L); - //Compliances + // Compliances double tracheaCompliance_L_Per_cmH2O = 0.00238; double bronchiCompliance_L_Per_cmH2O = 0.0305; double alveoliCompliance_L_Per_cmH2O = 0.175; double pleuralCompliance_L_Per_cmH2O = 0.21; - //Resistance + // Resistance double totalPulmonaryResistance_cmH2O_s_Per_L = 1.75; double tracheaResistancePercent = 0.6; double bronchiResistancePercent = 0.3; @@ -4647,7 +4658,7 @@ void BioGears::SetupRespiratory() double tracheaToBronchiResistance_cmH2O_s_Per_L = bronchiResistancePercent * totalPulmonaryResistance_cmH2O_s_Per_L; double bronchiToAlveoliResistance_cmH2O_s_Per_L = alveoliResistancePercent * totalPulmonaryResistance_cmH2O_s_Per_L; - //Target volumes are end-expiratory (i.e. bottom of breathing cycle, pressure = ambient pressure) + // Target volumes are end-expiratory (i.e. bottom of breathing cycle, pressure = ambient pressure) double larynxVolume_mL = 34.4; double tracheaVolume_mL = 6.63; double totalBronchiVolume_mL = 15.0; @@ -4716,55 +4727,55 @@ void BioGears::SetupRespiratory() SEFluidCircuitPath& MouthToTrachea = cRespiratory.CreatePath(Mouth, Trachea, BGE::RespiratoryPath::MouthToTrachea); MouthToTrachea.GetResistanceBaseline().SetValue(mouthToTracheaResistance_cmH2O_s_Per_L, FlowResistanceUnit::cmH2O_s_Per_L); SEFluidCircuitPath& TracheaToRightBronchi = cRespiratory.CreatePath(Trachea, RightBronchi, BGE::RespiratoryPath::TracheaToRightBronchi); - TracheaToRightBronchi.GetResistanceBaseline().SetValue(tracheaToBronchiResistance_cmH2O_s_Per_L / 2.0, FlowResistanceUnit::cmH2O_s_Per_L); //Circuit math assumes equal resistances left/right + TracheaToRightBronchi.GetResistanceBaseline().SetValue(tracheaToBronchiResistance_cmH2O_s_Per_L / 2.0, FlowResistanceUnit::cmH2O_s_Per_L); // Circuit math assumes equal resistances left/right SEFluidCircuitPath& TracheaToLeftBronchi = cRespiratory.CreatePath(Trachea, LeftBronchi, BGE::RespiratoryPath::TracheaToLeftBronchi); TracheaToLeftBronchi.GetResistanceBaseline().SetValue(tracheaToBronchiResistance_cmH2O_s_Per_L / 2.0, FlowResistanceUnit::cmH2O_s_Per_L); SEFluidCircuitPath& RightBronchiToRightPleuralConnection = cRespiratory.CreatePath(RightBronchi, RightPleuralConnection, BGE::RespiratoryPath::RightBronchiToRightPleuralConnection); RightBronchiToRightPleuralConnection.GetComplianceBaseline().SetValue(bronchiCompliance_L_Per_cmH2O * RightLungRatio, FlowComplianceUnit::L_Per_cmH2O); - RightBronchiToRightPleuralConnection.SetNextPolarizedState(CDM::enumOpenClosed::Closed); + RightBronchiToRightPleuralConnection.SetNextPolarizedState(SEOpenClosed::Closed); SEFluidCircuitPath& LeftBronchiToLeftPleuralConnection = cRespiratory.CreatePath(LeftBronchi, LeftPleuralConnection, BGE::RespiratoryPath::LeftBronchiToLeftPleuralConnection); LeftBronchiToLeftPleuralConnection.GetComplianceBaseline().SetValue(bronchiCompliance_L_Per_cmH2O * LeftLungRatio, FlowComplianceUnit::L_Per_cmH2O); - LeftBronchiToLeftPleuralConnection.SetNextPolarizedState(CDM::enumOpenClosed::Closed); + LeftBronchiToLeftPleuralConnection.SetNextPolarizedState(SEOpenClosed::Closed); SEFluidCircuitPath& RightBronchiToRightAlveoli = cRespiratory.CreatePath(RightBronchi, RightAlveoli, BGE::RespiratoryPath::RightBronchiToRightAlveoli); - RightBronchiToRightAlveoli.GetResistanceBaseline().SetValue(bronchiToAlveoliResistance_cmH2O_s_Per_L / 2.0, FlowResistanceUnit::cmH2O_s_Per_L); //Circuit math assumes equal resistances left/right + RightBronchiToRightAlveoli.GetResistanceBaseline().SetValue(bronchiToAlveoliResistance_cmH2O_s_Per_L / 2.0, FlowResistanceUnit::cmH2O_s_Per_L); // Circuit math assumes equal resistances left/right SEFluidCircuitPath& LeftBronchiToLeftAlveoli = cRespiratory.CreatePath(LeftBronchi, LeftAlveoli, BGE::RespiratoryPath::LeftBronchiToLeftAlveoli); LeftBronchiToLeftAlveoli.GetResistanceBaseline().SetValue(bronchiToAlveoliResistance_cmH2O_s_Per_L / 2.0, FlowResistanceUnit::cmH2O_s_Per_L); SEFluidCircuitPath& RightAlveoliToRightPleuralConnection = cRespiratory.CreatePath(RightAlveoli, RightPleuralConnection, BGE::RespiratoryPath::RightAlveoliToRightPleuralConnection); RightAlveoliToRightPleuralConnection.GetComplianceBaseline().SetValue(alveoliCompliance_L_Per_cmH2O * RightLungRatio, FlowComplianceUnit::L_Per_cmH2O); - RightAlveoliToRightPleuralConnection.SetNextPolarizedState(CDM::enumOpenClosed::Closed); + RightAlveoliToRightPleuralConnection.SetNextPolarizedState(SEOpenClosed::Closed); SEFluidCircuitPath& LeftAlveoliToLeftPleuralConnection = cRespiratory.CreatePath(LeftAlveoli, LeftPleuralConnection, BGE::RespiratoryPath::LeftAlveoliToLeftPleuralConnection); LeftAlveoliToLeftPleuralConnection.GetComplianceBaseline().SetValue(alveoliCompliance_L_Per_cmH2O * LeftLungRatio, FlowComplianceUnit::L_Per_cmH2O); - LeftAlveoliToLeftPleuralConnection.SetNextPolarizedState(CDM::enumOpenClosed::Closed); - //Need a no element path to be able to include a node with no volume, so it doesn't get modified by compliances + LeftAlveoliToLeftPleuralConnection.SetNextPolarizedState(SEOpenClosed::Closed); + // Need a no element path to be able to include a node with no volume, so it doesn't get modified by compliances SEFluidCircuitPath& RightPleuralConnectionToRightPleuralCavity = cRespiratory.CreatePath(RightPleuralConnection, RightPleuralCavity, BGE::RespiratoryPath::RightPleuralConnectionToRightPleuralCavity); SEFluidCircuitPath& LeftPleuralConnectionToLeftPleuralCavity = cRespiratory.CreatePath(LeftPleuralConnection, LeftPleuralCavity, BGE::RespiratoryPath::LeftPleuralConnectionToLeftPleuralCavity); //---------------------------------------------------------------------------------------------------------------------------------------------- // Path between alveoli and pleural - for right pleural leak SEFluidCircuitPath& RightAlveoliToRightAlveoliLeak = cRespiratory.CreatePath(RightAlveoli, RightAlveoliLeak, BGE::RespiratoryPath::RightAlveoliToRightAlveoliLeak); - RightAlveoliToRightAlveoliLeak.SetNextValve(CDM::enumOpenClosed::Closed); + RightAlveoliToRightAlveoliLeak.SetNextValve(SEOpenClosed::Closed); SEFluidCircuitPath& RightAlveoliLeakToRightPleuralCavity = cRespiratory.CreatePath(RightAlveoliLeak, RightPleuralCavity, BGE::RespiratoryPath::RightAlveoliLeakToRightPleuralCavity); RightAlveoliLeakToRightPleuralCavity.GetResistanceBaseline().SetValue(OpenResistance_cmH2O_s_Per_L, FlowResistanceUnit::cmH2O_s_Per_L); // path between alveoli and pleural - for left pleural leak SEFluidCircuitPath& LeftAlveoliToLeftAlveoliLeak = cRespiratory.CreatePath(LeftAlveoli, LeftAlveoliLeak, BGE::RespiratoryPath::LeftAlveoliToLeftAlveoliLeak); - LeftAlveoliToLeftAlveoliLeak.SetNextValve(CDM::enumOpenClosed::Closed); + LeftAlveoliToLeftAlveoliLeak.SetNextValve(SEOpenClosed::Closed); SEFluidCircuitPath& LeftAlveoliLeakToLeftPleuralCavity = cRespiratory.CreatePath(LeftAlveoliLeak, LeftPleuralCavity, BGE::RespiratoryPath::LeftAlveoliLeakToLeftPleuralCavity); LeftAlveoliLeakToLeftPleuralCavity.GetResistanceBaseline().SetValue(OpenResistance_cmH2O_s_Per_L, FlowResistanceUnit::cmH2O_s_Per_L); // Path for needle decompression - right side SEFluidCircuitPath& RightPleuralCavityToEnvironment = cRespiratory.CreatePath(RightPleuralCavity, *Ambient, BGE::RespiratoryPath::RightPleuralCavityToEnvironment); RightPleuralCavityToEnvironment.GetResistanceBaseline().SetValue(OpenResistance_cmH2O_s_Per_L, FlowResistanceUnit::cmH2O_s_Per_L); - //Path for needle decompression - left side + // Path for needle decompression - left side SEFluidCircuitPath& LeftPleuralCavityToEnvironment = cRespiratory.CreatePath(LeftPleuralCavity, *Ambient, BGE::RespiratoryPath::LeftPleuralCavityToEnvironment); LeftPleuralCavityToEnvironment.GetResistanceBaseline().SetValue(OpenResistance_cmH2O_s_Per_L, FlowResistanceUnit::cmH2O_s_Per_L); // Path for open (chest wound) pneumothorax circuit - right side SEFluidCircuitPath& EnvironmentToRightChestLeak = cRespiratory.CreatePath(*Ambient, RightChestLeak, BGE::RespiratoryPath::EnvironmentToRightChestLeak); EnvironmentToRightChestLeak.GetResistanceBaseline().SetValue(OpenResistance_cmH2O_s_Per_L, FlowResistanceUnit::cmH2O_s_Per_L); SEFluidCircuitPath& RightChestLeakToRightPleuralCavity = cRespiratory.CreatePath(RightChestLeak, RightPleuralCavity, BGE::RespiratoryPath::RightChestLeakToRightPleuralCavity); - RightChestLeakToRightPleuralCavity.SetNextValve(CDM::enumOpenClosed::Closed); + RightChestLeakToRightPleuralCavity.SetNextValve(SEOpenClosed::Closed); // Path for open (chest wound) pneumothorax circuit - left side SEFluidCircuitPath& EnvironmentToLeftChestLeak = cRespiratory.CreatePath(*Ambient, LeftChestLeak, BGE::RespiratoryPath::EnvironmentToLeftChestLeak); EnvironmentToLeftChestLeak.GetResistanceBaseline().SetValue(OpenResistance_cmH2O_s_Per_L, FlowResistanceUnit::cmH2O_s_Per_L); SEFluidCircuitPath& LeftChestLeakToLeftPleuralCavity = cRespiratory.CreatePath(LeftChestLeak, LeftPleuralCavity, BGE::RespiratoryPath::LeftChestLeakToLeftPleuralCavity); - LeftChestLeakToLeftPleuralCavity.SetNextValve(CDM::enumOpenClosed::Closed); + LeftChestLeakToLeftPleuralCavity.SetNextValve(SEOpenClosed::Closed); // Paths for the Driver SEFluidCircuitPath& EnvironmentToRespiratoryMuscle = cRespiratory.CreatePath(*Ambient, RespiratoryMuscle, BGE::RespiratoryPath::EnvironmentToRespiratoryMuscle); EnvironmentToRespiratoryMuscle.GetPressureSourceBaseline().SetValue(0.0, PressureUnit::cmH2O); @@ -4959,7 +4970,7 @@ void BioGears::SetupGastrointestinal() SmallIntestineC1ToSmallIntestine1.GetFlowSourceBaseline().SetValue(0, VolumePerTimeUnit::mL_Per_min); SEFluidCircuitPath& GroundToSmallIntestineC1 = cCombinedCardiovascular.CreatePath(*Ground, SmallIntestineC1, BGE::ChymePath::GroundToSmallIntestineC1); - if (m_Config->IsTissueEnabled()) { + if (m_Configuration->IsTissueEnabled()) { SEFluidCircuitNode* GutE3 = cCombinedCardiovascular.GetNode(BGE::TissueNode::GutE3); SEFluidCircuitPath& GutE3ToGroundGI = cCombinedCardiovascular.CreatePath(*GutE3, *Ground, BGE::ChymePath::GutE3ToGroundGI); GutE3ToGroundGI.GetFlowSourceBaseline().SetValue(0.0, VolumePerTimeUnit::mL_Per_s); @@ -4972,14 +4983,14 @@ void BioGears::SetupGastrointestinal() SELiquidCompartment& cSmallIntestine = m_Compartments->CreateLiquidCompartment(BGE::ChymeCompartment::SmallIntestine); cSmallIntestine.MapNode(SmallIntestineC1); - //remove the link because substances are handled manually in model design + // remove the link because substances are handled manually in model design SELiquidCompartment* vSmallIntestine = m_Compartments->GetLiquidCompartment(BGE::VascularCompartment::SmallIntestine); - //SELiquidCompartmentLink& lSmallIntestineChymeToVasculature = m_Compartments->CreateLiquidLink(cSmallIntestine, *vSmallIntestine, BGE::ChymeLink::SmallIntestineChymeToVasculature); - //lSmallIntestineChymeToVasculature.MapPath(SmallIntestineC1ToSmallIntestine1); + // SELiquidCompartmentLink& lSmallIntestineChymeToVasculature = m_Compartments->CreateLiquidLink(cSmallIntestine, *vSmallIntestine, BGE::ChymeLink::SmallIntestineChymeToVasculature); + // lSmallIntestineChymeToVasculature.MapPath(SmallIntestineC1ToSmallIntestine1); SELiquidCompartmentGraph& gCombinedCardiovascular = m_Compartments->GetActiveCardiovascularGraph(); gCombinedCardiovascular.AddCompartment(cSmallIntestine); - //gCombinedCardiovascular.AddLink(lSmallIntestineChymeToVasculature); + // gCombinedCardiovascular.AddLink(lSmallIntestineChymeToVasculature); gCombinedCardiovascular.StateChange(); } @@ -4994,10 +5005,10 @@ void BioGears::SetupAnesthesiaMachine() double ventilatorVolume_L = 1.0; double ventilatorCompliance_L_Per_cmH2O = 0.5; - double dValveOpenResistance = m_Config->GetMachineOpenResistance(FlowResistanceUnit::cmH2O_s_Per_L); - double dValveClosedResistance = m_Config->GetMachineClosedResistance(FlowResistanceUnit::cmH2O_s_Per_L); - double dSwitchOpenResistance = m_Config->GetDefaultOpenFlowResistance(FlowResistanceUnit::cmH2O_s_Per_L); - double dSwitchClosedResistance = m_Config->GetDefaultClosedFlowResistance(FlowResistanceUnit::cmH2O_s_Per_L); + double dValveOpenResistance = m_Configuration->GetMachineOpenResistance(FlowResistanceUnit::cmH2O_s_Per_L); + double dValveClosedResistance = m_Configuration->GetMachineClosedResistance(FlowResistanceUnit::cmH2O_s_Per_L); + double dSwitchOpenResistance = m_Configuration->GetDefaultOpenFlowResistance(FlowResistanceUnit::cmH2O_s_Per_L); + double dSwitchClosedResistance = m_Configuration->GetDefaultClosedFlowResistance(FlowResistanceUnit::cmH2O_s_Per_L); double dLowResistance = 0.01; SEFluidCircuit& cAnesthesia = m_Circuits->GetAnesthesiaMachineCircuit(); @@ -5070,14 +5081,14 @@ void BioGears::SetupAnesthesiaMachine() // VentilatorConnectionToVentilator // SEFluidCircuitPath& VentilatorToVentilatorConnection = cAnesthesia.CreatePath(Ventilator, VentilatorConnection, BGE::AnesthesiaMachinePath::VentilatorToVentilatorConnection); VentilatorToVentilatorConnection.GetComplianceBaseline().SetValue(ventilatorCompliance_L_Per_cmH2O, FlowComplianceUnit::L_Per_cmH2O); - VentilatorToVentilatorConnection.SetNextPolarizedState(CDM::enumOpenClosed::Closed); + VentilatorToVentilatorConnection.SetNextPolarizedState(SEOpenClosed::Closed); //////////////////////////////////// // VentilatorConnectionToSelector // SEFluidCircuitPath& VentilatorConnectionToSelector = cAnesthesia.CreatePath(VentilatorConnection, Selector, BGE::AnesthesiaMachinePath::VentilatorConnectionToSelector); /////////////////////////// // SelectorToReliefValve // SEFluidCircuitPath& SelectorToReliefValve = cAnesthesia.CreatePath(Selector, ReliefValve, BGE::AnesthesiaMachinePath::SelectorToReliefValve); - SelectorToReliefValve.SetNextValve(CDM::enumOpenClosed::Open); + SelectorToReliefValve.SetNextValve(SEOpenClosed::Open); //////////////////////// // SelectorToScrubber // SEFluidCircuitPath& SelectorToScrubber = cAnesthesia.CreatePath(Selector, Scrubber, BGE::AnesthesiaMachinePath::SelectorToScrubber); @@ -5092,11 +5103,11 @@ void BioGears::SetupAnesthesiaMachine() /////////////////////////// // SelectorToEnvironment // SEFluidCircuitPath& SelectorToEnvironment = cAnesthesia.CreatePath(Selector, *Ambient, BGE::AnesthesiaMachinePath::SelectorToEnvironment); - SelectorToEnvironment.GetFlowSourceBaseline().SetValue(0.0, VolumePerTimeUnit::L_Per_s); //Exhaust + SelectorToEnvironment.GetFlowSourceBaseline().SetValue(0.0, VolumePerTimeUnit::L_Per_s); // Exhaust ///////////////////////// // GasSourceToGasInlet // SEFluidCircuitPath& GasSourceToGasInlet = cAnesthesia.CreatePath(GasSource, GasInlet, BGE::AnesthesiaMachinePath::GasSourceToGasInlet); - GasSourceToGasInlet.GetFlowSourceBaseline().SetValue(0.0, VolumePerTimeUnit::L_Per_s); //Fresh gas source + GasSourceToGasInlet.GetFlowSourceBaseline().SetValue(0.0, VolumePerTimeUnit::L_Per_s); // Fresh gas source /////////////////////////////// // GasInletToInspiratoryLimb // SEFluidCircuitPath& GasInletToInspiratoryLimb = cAnesthesia.CreatePath(GasInlet, InspiratoryLimb, BGE::AnesthesiaMachinePath::GasInletToInspiratoryLimb); @@ -5124,7 +5135,7 @@ void BioGears::SetupAnesthesiaMachine() cAnesthesia.SetNextAndCurrentFromBaselines(); cAnesthesia.StateChange(); - //Combined Respiratory and Anesthesia Machine Circuit + // Combined Respiratory and Anesthesia Machine Circuit SEFluidCircuit& cCombinedAnesthesia = m_Circuits->GetRespiratoryAndAnesthesiaMachineCircuit(); cCombinedAnesthesia.AddCircuit(cRespiratory); cCombinedAnesthesia.AddCircuit(cAnesthesia); @@ -5212,8 +5223,8 @@ void BioGears::SetupAnesthesiaMachine() gAnesthesia.AddLink(aAnesthesiaConnectionLeak); gAnesthesia.StateChange(); - //Now do the combined transport setup - // Grab the mouth from pulmonary + // Now do the combined transport setup + // Grab the mouth from pulmonary SEGasCompartment* pMouth = m_Compartments->GetGasCompartment(BGE::PulmonaryCompartment::Mouth); SEGasCompartmentLink& aMask = m_Compartments->CreateGasLink(aAnesthesiaConnection, *pMouth, BGE::AnesthesiaMachineLink::Mask); aMask.MapPath(AnesthesiaConnectionToMouth); @@ -5236,7 +5247,7 @@ void BioGears::SetupInhaler() SELiquidCompartmentGraph& lAerosol = m_Compartments->GetAerosolGraph(); /////////////////////// - //Combined Respiratory and Inhaler Circuit + // Combined Respiratory and Inhaler Circuit SEFluidCircuit& m_CombinedInhaler = m_Circuits->GetRespiratoryAndInhalerCircuit(); m_CombinedInhaler.AddCircuit(cRespiratory); // Grab connection points/nodes @@ -5309,17 +5320,16 @@ void BioGears::SetupInhaler() lCombinedInhaler.StateChange(); } - void BioGears::SetupNasalCannula() { Info("Setting Up Nasal Cannula"); /////////////////////// Circuit Interdependencies - double OpenResistance_cmH2O_s_Per_L = m_Config->GetDefaultOpenFlowResistance(FlowResistanceUnit::cmH2O_s_Per_L); + double OpenResistance_cmH2O_s_Per_L = m_Configuration->GetDefaultOpenFlowResistance(FlowResistanceUnit::cmH2O_s_Per_L); SEFluidCircuit& cRespiratory = m_Circuits->GetRespiratoryCircuit(); SEGasCompartmentGraph& gRespiratory = m_Compartments->GetRespiratoryGraph(); /////////////////////// - //Combined Respiratory and Inhaler Circuit + // Combined Respiratory and Inhaler Circuit SEFluidCircuit& m_CombinedNasalCannula = m_Circuits->GetRespiratoryAndNasalCannulaCircuit(); m_CombinedNasalCannula.AddCircuit(cRespiratory); // Grab connection points/nodes @@ -5328,14 +5338,14 @@ void BioGears::SetupNasalCannula() // Define node on the combined graph, this is a simple circuit, no reason to make a independent circuit at this point SEFluidCircuitNode& Nosepiece = m_CombinedNasalCannula.CreateNode(BGE::NasalCannulaNode::Nosepiece); Nosepiece.GetVolumeBaseline().SetValue(30, VolumeUnit::mL); // 30 milliliters - //Nosepiece.GetPressure().SetValue(0.0, PressureUnit::cmH2O); - //Nosepiece.GetNextPressure().SetValue(0.0, PressureUnit::cmH2O); + // Nosepiece.GetPressure().SetValue(0.0, PressureUnit::cmH2O); + // Nosepiece.GetNextPressure().SetValue(0.0, PressureUnit::cmH2O); SEFluidCircuitNode& OxygenTank = m_CombinedNasalCannula.CreateNode(BGE::NasalCannulaNode::OxygenTank); OxygenTank.GetVolumeBaseline().SetValue(std::numeric_limits::infinity(), VolumeUnit::L); // inf volume for the oxygen tank (assuming its a wall connection) // Define path on the combined graph, this is a simple circuit, no reason to make a independent circuit at this point SEFluidCircuitPath& EnvironmentToOxygentank = m_CombinedNasalCannula.CreatePath(Ambient, OxygenTank, BGE::NasalCannulaPath::EnvironmentToOxygentank); - EnvironmentToOxygentank.GetPressureSourceBaseline().SetValue(2000.0, PressureUnit::psi); //oxygen connection is pressurized + EnvironmentToOxygentank.GetPressureSourceBaseline().SetValue(2000.0, PressureUnit::psi); // oxygen connection is pressurized SEFluidCircuitPath& OxygenTankToNosepiece = m_CombinedNasalCannula.CreatePath(OxygenTank, Nosepiece, BGE::NasalCannulaPath::OxygenTankToNosepiece); OxygenTankToNosepiece.GetResistanceBaseline().SetValue(OpenResistance_cmH2O_s_Per_L, FlowResistanceUnit::cmH2O_s_Per_L); SEFluidCircuitPath& ReturnFlow = m_CombinedNasalCannula.CreatePath(Nosepiece, Ambient, BGE::NasalCannulaPath::ReturnFlow); @@ -5388,7 +5398,7 @@ void BioGears::SetupMechanicalVentilator() SEGasCompartmentGraph& gRespiratory = m_Compartments->GetRespiratoryGraph(); /////////////////////// - //Combined Respiratory and Mechanical Ventilator Circuit + // Combined Respiratory and Mechanical Ventilator Circuit SEFluidCircuit& m_CombinedMechanicalVentilator = m_Circuits->GetRespiratoryAndMechanicalVentilatorCircuit(); m_CombinedMechanicalVentilator.AddCircuit(cRespiratory); // Grab connection points/nodes @@ -5434,13 +5444,13 @@ void BioGears::SetupExternalTemperature() Info("Setting Up External Temperature"); SEThermalCircuit& exthermal = m_Circuits->GetExternalTemperatureCircuit(); - double dNoResistance = m_Config->GetDefaultClosedHeatResistance(HeatResistanceUnit::K_Per_W); - double dMaxResistance = m_Config->GetDefaultOpenHeatResistance(HeatResistanceUnit::K_Per_W); - //Define Nodes - //Initialize temperatures to a reasonable value (ambient temperature hasn't been read in yet) + double dNoResistance = m_Configuration->GetDefaultClosedHeatResistance(HeatResistanceUnit::K_Per_W); + double dMaxResistance = m_Configuration->GetDefaultOpenHeatResistance(HeatResistanceUnit::K_Per_W); + // Define Nodes + // Initialize temperatures to a reasonable value (ambient temperature hasn't been read in yet) double dAmbientTemperature_K = 295.4; //~72F - //Note: All resistances are bound by the default open and closed switch resistances + // Note: All resistances are bound by the default open and closed switch resistances SEThermalCircuitNode& ThermalEnvironment = exthermal.CreateNode(BGE::ExternalTemperatureNode::Ambient); ThermalEnvironment.GetTemperature().SetValue(dAmbientTemperature_K, TemperatureUnit::K); SEThermalCircuitNode& TorsoSkin = exthermal.CreateNode(BGE::ExternalTemperatureNode::ExternalTorsoSkin); @@ -5468,8 +5478,8 @@ void BioGears::SetupExternalTemperature() Ground.GetNextTemperature().SetValue(0.0, TemperatureUnit::K); exthermal.AddReferenceNode(Ground); - //Define Paths - //Everything will be properly initialized in Evironment::Reset + // Define Paths + // Everything will be properly initialized in Evironment::Reset SEThermalCircuitPath& EnvironmentCoreToAbsoluteReferencePath = exthermal.CreatePath(Core, Ground, BGE::ExternalTemperaturePath::ExternalCoreToGround); EnvironmentCoreToAbsoluteReferencePath.GetNextHeatSource().SetValue(0.0, PowerUnit::W); SEThermalCircuitPath& EnvironmentTorsoSkinToAbsoluteReferencePath = exthermal.CreatePath(TorsoSkin, Ground, BGE::ExternalTemperaturePath::ExternalTorsoSkinToGround); @@ -5509,7 +5519,7 @@ void BioGears::SetupExternalTemperature() SEThermalCircuitPath& AbsoluteReferenceToActivePath = exthermal.CreatePath(Ground, Active, BGE::ExternalTemperaturePath::GroundToActive); AbsoluteReferenceToActivePath.GetNextTemperatureSource().SetValue(0.0, TemperatureUnit::K); SEThermalCircuitPath& ActiveToClothing = exthermal.CreatePath(Active, Clothing, BGE::ExternalTemperaturePath::ActiveToClothing); - ActiveToClothing.SetNextSwitch(CDM::enumOpenClosed::Open); + ActiveToClothing.SetNextSwitch(SEOpenClosed::Open); exthermal.SetNextAndCurrentFromBaselines(); exthermal.StateChange(); @@ -5600,13 +5610,13 @@ void BioGears::SetupInternalTemperature() TemperatureGroundToCore.GetHeatSourceBaseline().SetValue(0.0, PowerUnit::W); double skinCapTuningFactor = 1.0; - + SEThermalCircuitNode& TorsoSkin = cIntemperature.CreateNode(BGE::InternalTemperatureNode::InternalTorsoSkin); TorsoSkin.GetTemperature().SetValue(34.4, TemperatureUnit::C); SEThermalCircuitPath& TorsoSkinToTemperatureGround = cIntemperature.CreatePath(TorsoSkin, Ground, BGE::InternalTemperaturePath::InternalTorsoSkinToTemperatureGround); TorsoSkinToTemperatureGround.GetCapacitanceBaseline().SetValue(skinCapTuningFactor * 1.21, HeatCapacitanceUnit::kcal_Per_C); TorsoSkin.GetHeatBaseline().SetValue(TorsoSkinToTemperatureGround.GetCapacitanceBaseline().GetValue(HeatCapacitanceUnit::J_Per_K) * TorsoSkin.GetTemperature().GetValue(TemperatureUnit::K), EnergyUnit::J); - + SEThermalCircuitNode& HeadSkin = cIntemperature.CreateNode(BGE::InternalTemperatureNode::InternalHeadSkin); HeadSkin.GetTemperature().SetValue(35.2, TemperatureUnit::C); SEThermalCircuitPath& HeadSkinToTemperatureGround = cIntemperature.CreatePath(HeadSkin, Ground, BGE::InternalTemperaturePath::InternalHeadSkinToTemperatureGround); @@ -5618,19 +5628,19 @@ void BioGears::SetupInternalTemperature() SEThermalCircuitPath& LeftArmSkinToTemperatureGround = cIntemperature.CreatePath(LeftArmSkin, Ground, BGE::InternalTemperaturePath::InternalLeftArmSkinToTemperatureGround); LeftArmSkinToTemperatureGround.GetCapacitanceBaseline().SetValue(skinCapTuningFactor * 0.30, HeatCapacitanceUnit::kcal_Per_C); LeftArmSkin.GetHeatBaseline().SetValue(LeftArmSkinToTemperatureGround.GetCapacitanceBaseline().GetValue(HeatCapacitanceUnit::J_Per_K) * LeftArmSkin.GetTemperature().GetValue(TemperatureUnit::K), EnergyUnit::J); - + SEThermalCircuitNode& RightArmSkin = cIntemperature.CreateNode(BGE::InternalTemperatureNode::InternalRightArmSkin); RightArmSkin.GetTemperature().SetValue(33.6, TemperatureUnit::C); SEThermalCircuitPath& RightArmSkinToTemperatureGround = cIntemperature.CreatePath(RightArmSkin, Ground, BGE::InternalTemperaturePath::InternalRightArmSkinToTemperatureGround); RightArmSkinToTemperatureGround.GetCapacitanceBaseline().SetValue(skinCapTuningFactor * 0.30, HeatCapacitanceUnit::kcal_Per_C); RightArmSkin.GetHeatBaseline().SetValue(RightArmSkinToTemperatureGround.GetCapacitanceBaseline().GetValue(HeatCapacitanceUnit::J_Per_K) * RightArmSkin.GetTemperature().GetValue(TemperatureUnit::K), EnergyUnit::J); - + SEThermalCircuitNode& LeftLegSkin = cIntemperature.CreateNode(BGE::InternalTemperatureNode::InternalLeftLegSkin); LeftLegSkin.GetTemperature().SetValue(33.0, TemperatureUnit::C); SEThermalCircuitPath& LeftLegSkinToTemperatureGround = cIntemperature.CreatePath(LeftLegSkin, Ground, BGE::InternalTemperaturePath::InternalLeftLegSkinToTemperatureGround); LeftLegSkinToTemperatureGround.GetCapacitanceBaseline().SetValue(skinCapTuningFactor * 0.7, HeatCapacitanceUnit::kcal_Per_C); LeftLegSkin.GetHeatBaseline().SetValue(LeftLegSkinToTemperatureGround.GetCapacitanceBaseline().GetValue(HeatCapacitanceUnit::J_Per_K) * LeftLegSkin.GetTemperature().GetValue(TemperatureUnit::K), EnergyUnit::J); - + SEThermalCircuitNode& RightLegSkin = cIntemperature.CreateNode(BGE::InternalTemperatureNode::InternalRightLegSkin); RightLegSkin.GetTemperature().SetValue(33.0, TemperatureUnit::C); SEThermalCircuitPath& RightLegSkinToTemperatureGround = cIntemperature.CreatePath(RightLegSkin, Ground, BGE::InternalTemperaturePath::InternalRightLegSkinToTemperatureGround); @@ -5730,7 +5740,6 @@ void BioGears::SetupInternalTemperature() InternalRightLegSkinToGround.MapPath(RightLegSkinToTemperatureGround); SEThermalCompartmentLink& InternalCoreToInternalRightLegSkin = m_Compartments->CreateThermalLink(InternalCore, InternalRightLegSkin, BGE::TemperatureLink::InternalCoreToInternalRightLegSkin); InternalCoreToInternalRightLegSkin.MapPath(CoreToRightLegSkin); - } Logger* BioGears::GetLogger() const { diff --git a/projects/biogears/libBiogears/src/engine/Controller/BioGearsCircuits.cpp b/projects/biogears/libBiogears/src/engine/Controller/BioGearsCircuits.cpp index 0b10f3494..f9662d863 100644 --- a/projects/biogears/libBiogears/src/engine/Controller/BioGearsCircuits.cpp +++ b/projects/biogears/libBiogears/src/engine/Controller/BioGearsCircuits.cpp @@ -13,7 +13,8 @@ specific language governing permissions and limitations under the License. #include #include -namespace BGE = mil::tatrc::physiology::biogears; + +#include "io/cdm/Circuit.h" namespace biogears { @@ -26,17 +27,17 @@ BioGearsCircuits::BioGearsCircuits(BioGears& bg) : SECircuitManager(bg.GetLogger()) , m_data(bg) { - Clear(); + Invalidate(); } BioGearsCircuits::~BioGearsCircuits() { - Clear(); + Invalidate(); } -void BioGearsCircuits::Clear() +void BioGearsCircuits::Invalidate() { - SECircuitManager::Clear(); + SECircuitManager::Invalidate(); m_CombinedCardiovascularCircuit = nullptr; m_CardiovascularCircuit = nullptr; m_CerebralCircuit = nullptr; @@ -52,78 +53,6 @@ void BioGearsCircuits::Clear() m_ExternalTemperatureCircuit = nullptr; } -bool BioGearsCircuits::Load(const CDM::CircuitManagerData& in) -{ - if (!SECircuitManager::Load(in)) - return false; - m_CombinedCardiovascularCircuit = GetFluidCircuit(BGE::Circuits::FullCardiovascular); - if (m_CombinedCardiovascularCircuit == nullptr) { - Error("BioGearsCircuits::Load could not find circuit : " + std::string(BGE::Circuits::FullCardiovascular)); - return false; - } - m_CardiovascularCircuit = GetFluidCircuit(BGE::Circuits::Cardiovascular); - if (m_CardiovascularCircuit == nullptr) { - Error("BioGearsCircuits::Load could not find circuit : " + std::string(BGE::Circuits::Cardiovascular)); - return false; - } - m_CerebralCircuit = GetFluidCircuit(BGE::Circuits::Cerebral); - if (m_CardiovascularCircuit == nullptr) { - Error("BioGearsCircuits::Load could not find circuit : " + std::string(BGE::Circuits::Cerebral)); - return false; - } - m_RenalCircuit = GetFluidCircuit(BGE::Circuits::Renal); - if (m_RenalCircuit == nullptr) { - Error("BioGearsCircuits::Load could not find circuit : " + std::string(BGE::Circuits::Renal)); - return false; - } - m_RespiratoryCircuit = GetFluidCircuit(BGE::Circuits::Respiratory); - if (m_RespiratoryCircuit == nullptr) { - Error("BioGearsCircuits::Load could not find circuit : " + std::string(BGE::Circuits::Respiratory)); - return false; - } - m_AnesthesiaMachineCircuit = GetFluidCircuit(BGE::Circuits::AnesthesiaMachine); - if (m_AnesthesiaMachineCircuit == nullptr) { - Error("BioGearsCircuits::Load could not find circuit : " + std::string(BGE::Circuits::AnesthesiaMachine)); - return false; - } - m_CombinedRespiratoryAnesthesiaCircuit = GetFluidCircuit(BGE::Circuits::RespiratoryAnesthesia); - if (m_CombinedRespiratoryAnesthesiaCircuit == nullptr) { - Error("BioGearsCircuits::Load could not find circuit : " + std::string(BGE::Circuits::RespiratoryAnesthesia)); - return false; - } - m_CombinedRespiratoryInhalerCircuit = GetFluidCircuit(BGE::Circuits::RespiratoryInhaler); - if (m_CombinedRespiratoryInhalerCircuit == nullptr) { - Error("BioGearsCircuits::Load could not find circuit : " + std::string(BGE::Circuits::RespiratoryInhaler)); - return false; - } - m_CombinedRespiratoryNasalCannulaCircuit = GetFluidCircuit(BGE::Circuits::RespiratoryNasalCannula); - if (m_CombinedRespiratoryNasalCannulaCircuit == nullptr) { - Error("BioGearsCircuits::Load could not find circuit : " + std::string(BGE::Circuits::RespiratoryNasalCannula)); - return false; - } - m_CombinedRespiratoryMechanicalVentilatorCircuit = GetFluidCircuit(BGE::Circuits::RespiratoryMechanicalVentilator); - if (m_CombinedRespiratoryMechanicalVentilatorCircuit == nullptr) { - Error("BioGearsCircuits::Load could not find circuit : " + std::string(BGE::Circuits::RespiratoryMechanicalVentilator)); - return false; - } - m_TemperatureCircuit = GetThermalCircuit(BGE::Circuits::Temperature); - if (m_TemperatureCircuit == nullptr) { - Error("BioGearsCircuits::Load could not find circuit : " + std::string(BGE::Circuits::Temperature)); - return false; - } - m_InternalTemperatureCircuit = GetThermalCircuit(BGE::Circuits::InternalTemperature); - if (m_InternalTemperatureCircuit == nullptr) { - Error("BioGearsCircuits::Load could not find circuit : " + std::string(BGE::Circuits::InternalTemperature)); - return false; - } - m_ExternalTemperatureCircuit = GetThermalCircuit(BGE::Circuits::ExternalTemperature); - if (m_ExternalTemperatureCircuit == nullptr) { - Error("BioGearsCircuits::Load could not find circuit : " + std::string(BGE::Circuits::ExternalTemperature)); - return false; - } - return true; -} - void BioGearsCircuits::SetReadOnlyFluid(bool b) { SECircuitManager::SetReadOnlyFluid(b); @@ -165,15 +94,15 @@ SEFluidCircuit& BioGearsCircuits::GetRenalCircuit() SEFluidCircuit& BioGearsCircuits::GetActiveRespiratoryCircuit() { switch (m_data.GetAirwayMode()) { - case CDM::enumBioGearsAirwayMode::Free: + case SEBioGearsAirwayMode::Free: return *m_RespiratoryCircuit; - case CDM::enumBioGearsAirwayMode::AnesthesiaMachine: + case SEBioGearsAirwayMode::AnesthesiaMachine: return *m_CombinedRespiratoryAnesthesiaCircuit; - case CDM::enumBioGearsAirwayMode::Inhaler: + case SEBioGearsAirwayMode::Inhaler: return *m_CombinedRespiratoryInhalerCircuit; - case CDM::enumBioGearsAirwayMode::NasalCannula: + case SEBioGearsAirwayMode::NasalCannula: return *m_CombinedRespiratoryNasalCannulaCircuit; - case CDM::enumBioGearsAirwayMode::MechanicalVentilator: + case SEBioGearsAirwayMode::MechanicalVentilator: return *m_CombinedRespiratoryMechanicalVentilatorCircuit; default: throw CommonDataModelException("Unknown airway mode"); diff --git a/projects/biogears/libBiogears/src/engine/Controller/BioGearsCompartments.cpp b/projects/biogears/libBiogears/src/engine/Controller/BioGearsCompartments.cpp index 8d574b7a2..37af19b98 100644 --- a/projects/biogears/libBiogears/src/engine/Controller/BioGearsCompartments.cpp +++ b/projects/biogears/libBiogears/src/engine/Controller/BioGearsCompartments.cpp @@ -11,17 +11,20 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include -//Standard Includes +#include "io/cdm/Compartment.h" + +// Standard Includes #include #include -//Project Includes +// Project Includes #include #include #include #include #include #include -namespace BGE = mil::tatrc::physiology::biogears; + +#include "io/biogears/BioGears.h" namespace biogears { auto BioGearsCompartments::make_unique(BioGears& bg) -> std::unique_ptr @@ -33,17 +36,17 @@ BioGearsCompartments::BioGearsCompartments(BioGears& bg) : SECompartmentManager(bg.GetSubstances()) , m_data(bg) { - Clear(); + Invalidate(); } BioGearsCompartments::~BioGearsCompartments() { - Clear(); + Invalidate(); } -void BioGearsCompartments::Clear() +void BioGearsCompartments::Invalidate() { - SECompartmentManager::Clear(); + SECompartmentManager::Invalidate(); m_CombinedCardiovascularGraph = nullptr; m_CardiovascularGraph = nullptr; m_CerebralGraph = nullptr; @@ -86,79 +89,10 @@ void BioGearsCompartments::Clear() m_IntracellularFluid.clear(); } -bool BioGearsCompartments::Load(const CDM::CompartmentManagerData& in, SECircuitManager* circuits) -{ - if (!SECompartmentManager::Load(in, circuits)) - return false; - - m_CombinedCardiovascularGraph = GetLiquidGraph(BGE::Graph::ActiveCardiovascular); - if (m_CombinedCardiovascularGraph == nullptr) { - Error("Could not find required Graph " + std::string(BGE::Graph::ActiveCardiovascular)); - return false; - } - m_CardiovascularGraph = GetLiquidGraph(BGE::Graph::Cardiovascular); - if (m_CardiovascularGraph == nullptr) { - Error("Could not find required Graph " + std::string(BGE::Graph::Cardiovascular)); - return false; - } - m_CerebralGraph = GetLiquidGraph(BGE::Graph::Cerebral); - if (m_CerebralGraph == nullptr) { - Error("Could not find required Graph " + std::string(BGE::Graph::Cerebral)); - return false; - } - m_RenalGraph = GetLiquidGraph(BGE::Graph::Renal); - if (m_RenalGraph == nullptr) { - Error("Could not find required Graph " + std::string(BGE::Graph::Renal)); - return false; - } - m_RespiratoryGraph = GetGasGraph(BGE::Graph::Respiratory); - if (m_RespiratoryGraph == nullptr) { - Error("Could not find required Graph " + std::string(BGE::Graph::Respiratory)); - return false; - } - m_AnesthesiaMachineGraph = GetGasGraph(BGE::Graph::AnesthesiaMachine); - if (m_AnesthesiaMachineGraph == nullptr) { - Error("Could not find required Graph " + std::string(BGE::Graph::AnesthesiaMachine)); - return false; - } - m_CombinedRespiratoryAnesthesiaGraph = GetGasGraph(BGE::Graph::RespiratoryAndAnesthesiaMachine); - if (m_CombinedRespiratoryAnesthesiaGraph == nullptr) { - Error("Could not find required Graph " + std::string(BGE::Graph::RespiratoryAndAnesthesiaMachine)); - return false; - } - m_CombinedRespiratoryInhalerGraph = GetGasGraph(BGE::Graph::RespiratoryAndInhaler); - if (m_CombinedRespiratoryInhalerGraph == nullptr) { - Error("Could not find required Graph " + std::string(BGE::Graph::RespiratoryAndInhaler)); - return false; - } - m_CombinedRespiratoryNasalCannulaGraph = GetGasGraph(BGE::Graph::RespiratoryAndNasalCannula); - if (m_CombinedRespiratoryNasalCannulaGraph == nullptr) { - Error("Could not find required Graph " + std::string(BGE::Graph::RespiratoryAndNasalCannula)); - return false; - } - m_AerosolGraph = GetLiquidGraph(BGE::Graph::Aerosol); - if (m_AerosolGraph == nullptr) { - Error("Could not find required Graph " + std::string(BGE::Graph::Aerosol)); - return false; - } - m_CombinedAerosolInhalerGraph = GetLiquidGraph(BGE::Graph::AerosolAndInhaler); - if (m_CombinedAerosolInhalerGraph == nullptr) { - Error("Could not find required Graph " + std::string(BGE::Graph::AerosolAndInhaler)); - return false; - } - m_CombinedRespiratoryMechanicalVentilatorGraph = GetGasGraph(BGE::Graph::RespiratoryAndMechanicalVentilator); - if (m_CombinedRespiratoryMechanicalVentilatorGraph == nullptr) { - Error("Could not find required Graph " + std::string(BGE::Graph::RespiratoryAndMechanicalVentilator)); - return false; - } - - return true; -} - #define SORT_CMPTS(bin, type) \ m_##bin##Compartments.clear(); \ m_##bin##LeafCompartments.clear(); \ - for (const std::string& name : BGE::bin##Compartment::GetValues()) { \ + for (const std::string& name : physiology::bin##Compartment::GetValues()) { \ SE##type##Compartment* cmpt = Get##type##Compartment(name); \ if (cmpt == nullptr) { \ Warning("Could not find expected " + std::string(#bin) + " compartment, " + name + " in compartment manager"); \ @@ -178,7 +112,7 @@ void BioGearsCompartments::StateChange() SORT_CMPTS(Temperature, Thermal); if (m_data.GetConfiguration().IsTissueEnabled()) { SORT_CMPTS(Tissue, Tissue); - for (const std::string& name : BGE::ExtravascularCompartment::GetValues()) { + for (const std::string& name : physiology::ExtravascularCompartment::GetValues()) { if (GetLiquidCompartment(name) == nullptr) Warning("Could not find expected Extravascular compartment, " + name + " in compartment manager"); } @@ -187,19 +121,19 @@ void BioGearsCompartments::StateChange() m_ExtracellularFluid.clear(); m_IntracellularFluid.clear(); for (SETissueCompartment* t : m_TissueLeafCompartments) { - cmpt = GetLiquidCompartment(std::string{ t->GetName() } + "Extracellular"); + cmpt = GetLiquidCompartment(std::string { t->GetName() } + "Extracellular"); if (cmpt == nullptr) - Fatal(std::string{ "Could not find the tissue " } + t->GetName() + " Extracellular compartment"); + Fatal(std::string { "Could not find the tissue " } + t->GetName() + " Extracellular compartment"); m_ExtracellularFluid[t] = cmpt; - cmpt = GetLiquidCompartment(std::string{ t->GetName() } + "Intracellular"); + cmpt = GetLiquidCompartment(std::string { t->GetName() } + "Intracellular"); if (cmpt == nullptr) - Fatal(std::string{ "Could not find the tissue " } + t->GetName() + " Intracellular compartment"); + Fatal(std::string { "Could not find the tissue " } + t->GetName() + " Intracellular compartment"); m_IntracellularFluid[t] = cmpt; } } if (m_data.GetConfiguration().IsRenalEnabled()) { SORT_CMPTS(Urine, Liquid); - } + } SORT_CMPTS(Vascular, Liquid); // Equipment SORT_CMPTS(AnesthesiaMachine, Gas); @@ -209,7 +143,7 @@ void BioGearsCompartments::StateChange() // so the macro does not work with us m_InhalerAerosolCompartments.clear(); m_InhalerAerosolLeafCompartments.clear(); - for (const std::string& name : BGE::InhalerCompartment::GetValues()) { + for (const std::string& name : physiology::InhalerCompartment::GetValues()) { SELiquidCompartment* cmpt = GetLiquidCompartment(name); if (cmpt == nullptr) { Warning("Could not find expected Aerosol compartment, " + name + " in compartment manager"); @@ -222,7 +156,7 @@ void BioGearsCompartments::StateChange() m_NasalCannulaCompartments.clear(); m_NasalCannulaLeafCompartments.clear(); - for (const std::string& name : BGE::NasalCannulaCompartment::GetValues()) { + for (const std::string& name : physiology::NasalCannulaCompartment::GetValues()) { SEGasCompartment* cmpt = GetGasCompartment(name); if (cmpt == nullptr) { Warning("Could not find expected Nasal Cannula compartment, " + name + " in compartment manager"); @@ -235,7 +169,7 @@ void BioGearsCompartments::StateChange() m_AerosolCompartments.clear(); m_AerosolLeafCompartments.clear(); - for (const std::string& name : BGE::PulmonaryCompartment::GetValues()) { + for (const std::string& name : physiology::PulmonaryCompartment::GetValues()) { SELiquidCompartment* cmpt = GetLiquidCompartment(name); if (cmpt == nullptr) { Warning("Could not find expected Aerosol compartment, " + name + " in compartment manager"); @@ -274,15 +208,15 @@ bool BioGearsCompartments::AllowLiquidSubstance(SESubstance& s, SELiquidCompartm return true; else { // Don't add it to the environment aerosol - const std::vector& e = BGE::EnvironmentCompartment::GetValues(); + const std::vector& e = physiology::EnvironmentCompartment::GetValues(); if (std::find(e.begin(), e.end(), cmpt.GetName()) != e.end()) return false; // Don't add it to the aerosol compartments (Liquid version of Respiratory cmpts) - const std::vector& p = BGE::PulmonaryCompartment::GetValues(); + const std::vector& p = physiology::PulmonaryCompartment::GetValues(); if (std::find(p.begin(), p.end(), cmpt.GetName()) != p.end()) return false; // Don't add it to aerosol cmpts either - const std::vector& i = BGE::InhalerCompartment::GetValues(); + const std::vector& i = physiology::InhalerCompartment::GetValues(); if (std::find(i.begin(), i.end(), cmpt.GetName()) != i.end()) return false; } @@ -292,51 +226,51 @@ bool BioGearsCompartments::AllowLiquidSubstance(SESubstance& s, SELiquidCompartm SELiquidCompartmentGraph& BioGearsCompartments::GetActiveCardiovascularGraph() { if (m_CombinedCardiovascularGraph == nullptr) - m_CombinedCardiovascularGraph = &CreateLiquidGraph(BGE::Graph::ActiveCardiovascular); + m_CombinedCardiovascularGraph = &CreateLiquidGraph(physiology::Graph::ActiveCardiovascular); return *m_CombinedCardiovascularGraph; } SELiquidCompartmentGraph& BioGearsCompartments::GetCardiovascularGraph() { if (m_CardiovascularGraph == nullptr) - m_CardiovascularGraph = &CreateLiquidGraph(BGE::Graph::Cardiovascular); + m_CardiovascularGraph = &CreateLiquidGraph(physiology::Graph::Cardiovascular); return *m_CardiovascularGraph; } SELiquidCompartmentGraph& BioGearsCompartments::GetCerebralGraph() { if (m_CerebralGraph == nullptr) - m_CerebralGraph = &CreateLiquidGraph(BGE::Graph::Cerebral); + m_CerebralGraph = &CreateLiquidGraph(physiology::Graph::Cerebral); return *m_CerebralGraph; } SELiquidCompartmentGraph& BioGearsCompartments::GetRenalGraph() { if (m_RenalGraph == nullptr) - m_RenalGraph = &CreateLiquidGraph(BGE::Graph::Renal); + m_RenalGraph = &CreateLiquidGraph(physiology::Graph::Renal); return *m_RenalGraph; } SEGasCompartmentGraph& BioGearsCompartments::GetActiveRespiratoryGraph() { switch (m_data.GetAirwayMode()) { - case CDM::enumBioGearsAirwayMode::Free: + case SEBioGearsAirwayMode::Free: if (m_UpdateActiveAirwayGraph) m_data.GetCompartments().UpdateLinks(*m_RespiratoryGraph); m_UpdateActiveAirwayGraph = false; return *m_RespiratoryGraph; - case CDM::enumBioGearsAirwayMode::AnesthesiaMachine: + case SEBioGearsAirwayMode::AnesthesiaMachine: if (m_UpdateActiveAirwayGraph) m_data.GetCompartments().UpdateLinks(*m_CombinedRespiratoryAnesthesiaGraph); m_UpdateActiveAirwayGraph = false; return *m_CombinedRespiratoryAnesthesiaGraph; - case CDM::enumBioGearsAirwayMode::Inhaler: + case SEBioGearsAirwayMode::Inhaler: if (m_UpdateActiveAirwayGraph) m_data.GetCompartments().UpdateLinks(*m_CombinedRespiratoryInhalerGraph); m_UpdateActiveAirwayGraph = false; return *m_CombinedRespiratoryInhalerGraph; - case CDM::enumBioGearsAirwayMode::NasalCannula: + case SEBioGearsAirwayMode::NasalCannula: if (m_UpdateActiveAirwayGraph) m_data.GetCompartments().UpdateLinks(*m_CombinedRespiratoryNasalCannulaGraph); m_UpdateActiveAirwayGraph = false; return *m_CombinedRespiratoryNasalCannulaGraph; - case CDM::enumBioGearsAirwayMode::MechanicalVentilator: + case SEBioGearsAirwayMode::MechanicalVentilator: if (m_UpdateActiveAirwayGraph) m_data.GetCompartments().UpdateLinks(*m_CombinedRespiratoryMechanicalVentilatorGraph); m_UpdateActiveAirwayGraph = false; @@ -348,47 +282,47 @@ SEGasCompartmentGraph& BioGearsCompartments::GetActiveRespiratoryGraph() SEGasCompartmentGraph& BioGearsCompartments::GetRespiratoryGraph() { if (m_RespiratoryGraph == nullptr) - m_RespiratoryGraph = &CreateGasGraph(BGE::Graph::Respiratory); + m_RespiratoryGraph = &CreateGasGraph(physiology::Graph::Respiratory); return *m_RespiratoryGraph; } SEGasCompartmentGraph& BioGearsCompartments::GetAnesthesiaMachineGraph() { if (m_AnesthesiaMachineGraph == nullptr) - m_AnesthesiaMachineGraph = &CreateGasGraph(BGE::Graph::AnesthesiaMachine); + m_AnesthesiaMachineGraph = &CreateGasGraph(physiology::Graph::AnesthesiaMachine); return *m_AnesthesiaMachineGraph; } SEGasCompartmentGraph& BioGearsCompartments::GetRespiratoryAndAnesthesiaMachineGraph() { if (m_CombinedRespiratoryAnesthesiaGraph == nullptr) - m_CombinedRespiratoryAnesthesiaGraph = &CreateGasGraph(BGE::Graph::RespiratoryAndAnesthesiaMachine); + m_CombinedRespiratoryAnesthesiaGraph = &CreateGasGraph(physiology::Graph::RespiratoryAndAnesthesiaMachine); return *m_CombinedRespiratoryAnesthesiaGraph; } SEGasCompartmentGraph& BioGearsCompartments::GetRespiratoryAndInhalerGraph() { if (m_CombinedRespiratoryInhalerGraph == nullptr) - m_CombinedRespiratoryInhalerGraph = &CreateGasGraph(BGE::Graph::RespiratoryAndInhaler); + m_CombinedRespiratoryInhalerGraph = &CreateGasGraph(physiology::Graph::RespiratoryAndInhaler); return *m_CombinedRespiratoryInhalerGraph; } SEGasCompartmentGraph& BioGearsCompartments::GetRespiratoryAndNasalCannulaGraph() { if (m_CombinedRespiratoryNasalCannulaGraph == nullptr) - m_CombinedRespiratoryNasalCannulaGraph = &CreateGasGraph(BGE::Graph::RespiratoryAndNasalCannula); + m_CombinedRespiratoryNasalCannulaGraph = &CreateGasGraph(physiology::Graph::RespiratoryAndNasalCannula); return *m_CombinedRespiratoryNasalCannulaGraph; } SELiquidCompartmentGraph& BioGearsCompartments::GetActiveAerosolGraph() { switch (m_data.GetAirwayMode()) { - case CDM::enumBioGearsAirwayMode::Free: - case CDM::enumBioGearsAirwayMode::AnesthesiaMachine: - case CDM::enumBioGearsAirwayMode::NasalCannula: - case CDM::enumBioGearsAirwayMode::MechanicalVentilator: // Just use the regular graph + case SEBioGearsAirwayMode::Free: + case SEBioGearsAirwayMode::AnesthesiaMachine: + case SEBioGearsAirwayMode::NasalCannula: + case SEBioGearsAirwayMode::MechanicalVentilator: // Just use the regular graph if (m_UpdateActiveAerosolGraph) m_data.GetCompartments().UpdateLinks(*m_AerosolGraph); m_UpdateActiveAerosolGraph = false; return *m_AerosolGraph; - case CDM::enumBioGearsAirwayMode::Inhaler: + case SEBioGearsAirwayMode::Inhaler: if (m_UpdateActiveAerosolGraph) m_data.GetCompartments().UpdateLinks(*m_CombinedAerosolInhalerGraph); m_UpdateActiveAerosolGraph = true; @@ -400,20 +334,20 @@ SELiquidCompartmentGraph& BioGearsCompartments::GetActiveAerosolGraph() SELiquidCompartmentGraph& BioGearsCompartments::GetAerosolGraph() { if (m_AerosolGraph == nullptr) - m_AerosolGraph = &CreateLiquidGraph(BGE::Graph::Aerosol); + m_AerosolGraph = &CreateLiquidGraph(physiology::Graph::Aerosol); return *m_AerosolGraph; } SELiquidCompartmentGraph& BioGearsCompartments::GetAerosolAndInhalerGraph() { if (m_CombinedAerosolInhalerGraph == nullptr) - m_CombinedAerosolInhalerGraph = &CreateLiquidGraph(BGE::Graph::AerosolAndInhaler); + m_CombinedAerosolInhalerGraph = &CreateLiquidGraph(physiology::Graph::AerosolAndInhaler); return *m_CombinedAerosolInhalerGraph; } SEGasCompartmentGraph& BioGearsCompartments::GetRespiratoryAndMechanicalVentilatorGraph() { if (m_CombinedRespiratoryMechanicalVentilatorGraph == nullptr) - m_CombinedRespiratoryMechanicalVentilatorGraph = &CreateGasGraph(BGE::Graph::RespiratoryAndMechanicalVentilator); + m_CombinedRespiratoryMechanicalVentilatorGraph = &CreateGasGraph(physiology::Graph::RespiratoryAndMechanicalVentilator); return *m_CombinedRespiratoryMechanicalVentilatorGraph; } } \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/engine/Controller/BioGearsConfiguration.cpp b/projects/biogears/libBiogears/src/engine/Controller/BioGearsConfiguration.cpp index 3289307d5..fae8fa6c4 100644 --- a/projects/biogears/libBiogears/src/engine/Controller/BioGearsConfiguration.cpp +++ b/projects/biogears/libBiogears/src/engine/Controller/BioGearsConfiguration.cpp @@ -11,6 +11,9 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Property.h" +#include "io/biogears/BioGearsConfiguration.h" + #include #include #include @@ -84,7 +87,7 @@ BioGearsConfiguration::BioGearsConfiguration(SESubstanceManager& substances) , m_StefanBoltzmann(nullptr) , m_UniversalGasConstant(nullptr) // Drugs - , m_PDEnabled(CDM::enumOnOff::value(-1)) + , m_PDEnabled(SEOnOff::Invalid) // Energy , m_BodySpecificHeat(nullptr) , m_CarbondDioxideProductionFromOxygenConsumptionConstant(nullptr) @@ -111,10 +114,10 @@ BioGearsConfiguration::BioGearsConfiguration(SESubstanceManager& substances) , m_ProteinToUreaFraction(nullptr) , m_WaterDigestionRate(nullptr) // Nervous - , m_CerebralEnabled(CDM::enumOnOff::value(-1)) + , m_CerebralEnabled(SEOnOff::Invalid) , m_PupilDiameterBaseline(nullptr) // Renal - , m_RenalEnabled(CDM::enumOnOff::value(-1)) + , m_RenalEnabled(SEOnOff::Invalid) , m_PlasmaSodiumConcentrationSetPoint(nullptr) , m_PeritubularPotassiumConcentrationSetPoint(nullptr) , m_LeftGlomerularFluidPermeabilityBaseline(nullptr) @@ -133,18 +136,18 @@ BioGearsConfiguration::BioGearsConfiguration(SESubstanceManager& substances) , m_PulmonaryVentilationRateMaximum(nullptr) , m_VentilatoryOcclusionPressure(nullptr) // Tissue - , m_TissueEnabled(CDM::enumOnOff::value(-1)) + , m_TissueEnabled(SEOnOff::Invalid) { } BioGearsConfiguration::~BioGearsConfiguration() { - Clear(); + Invalidate(); } -void BioGearsConfiguration::Clear() +void BioGearsConfiguration::Invalidate() { - PhysiologyEngineConfiguration::Clear(); + PhysiologyEngineConfiguration::Invalidate(); // Blood Chemistry SAFE_DELETE(m_MeanCorpuscularHemoglobin); @@ -179,7 +182,7 @@ void BioGearsConfiguration::Clear() SAFE_DELETE(m_UniversalGasConstant); // Drugs - m_PDEnabled = CDM::enumOnOff::value(-1); + m_PDEnabled = SEOnOff::Invalid; // Energy SAFE_DELETE(m_BodySpecificHeat); @@ -210,11 +213,11 @@ void BioGearsConfiguration::Clear() SAFE_DELETE(m_WaterDigestionRate); // Nervous - m_CerebralEnabled = CDM::enumOnOff::value(-1); + m_CerebralEnabled = SEOnOff::Invalid; SAFE_DELETE(m_PupilDiameterBaseline); // Renal - m_RenalEnabled = CDM::enumOnOff::value(-1); + m_RenalEnabled = SEOnOff::Invalid; SAFE_DELETE(m_PlasmaSodiumConcentrationSetPoint); SAFE_DELETE(m_PeritubularPotassiumConcentrationSetPoint); SAFE_DELETE(m_LeftGlomerularFluidPermeabilityBaseline); @@ -235,13 +238,13 @@ void BioGearsConfiguration::Clear() SAFE_DELETE(m_VentilatoryOcclusionPressure); //Tissue - m_TissueEnabled = CDM::enumOnOff::value(-1); + m_TissueEnabled = SEOnOff::Invalid; } void BioGearsConfiguration::Initialize() { - Clear(); - m_WritePatientBaselineFile = CDM::enumOnOff::Off; + Invalidate(); + m_WritePatientBaselineFile = SEOnOff::Off; // Reset to default values GetECGInterpolator().LoadWaveforms("StandardECG.xml"); @@ -282,7 +285,7 @@ void BioGearsConfiguration::Initialize() GetUniversalGasConstant().SetValue(8.3144621, HeatCapacitancePerAmountUnit::J_Per_K_mol); //http://physics.nist.gov/cuu/Constants/ // Drugs - m_PDEnabled = CDM::enumOnOff::On; + m_PDEnabled = SEOnOff::On; // Energy GetBodySpecificHeat().SetValue(0.83, HeatCapacitancePerMassUnit::kcal_Per_K_kg); @@ -314,11 +317,11 @@ void BioGearsConfiguration::Initialize() GetWaterDigestionRate().SetValue(0.417, VolumePerTimeUnit::mL_Per_s); // Peronnet2012Pharmacokinetic, Estimated from 300mL H20 being absorbed in 9.5-12m // Nervous - m_CerebralEnabled = CDM::enumOnOff::On; + m_CerebralEnabled = SEOnOff::On; GetPupilDiameterBaseline().SetValue(4, LengthUnit::mm); // Renal - m_RenalEnabled = CDM::enumOnOff::On; + m_RenalEnabled = SEOnOff::On; GetPlasmaSodiumConcentrationSetPoint().SetValue(3.23, MassPerVolumeUnit::mg_Per_mL); GetPeritubularPotassiumConcentrationSetPoint().SetValue(0.0185, MassPerVolumeUnit::g_Per_dL); GetLeftGlomerularFluidPermeabilityBaseline().SetValue(3.67647, VolumePerTimePressureAreaUnit::mL_Per_min_mmHg_m2); @@ -340,7 +343,7 @@ void BioGearsConfiguration::Initialize() GetVentilatoryOcclusionPressure().SetValue(0.75, PressureUnit::cmH2O); //This increases the absolute max driver pressure // Tissue - m_TissueEnabled = CDM::enumOnOff::On; + m_TissueEnabled = SEOnOff::On; } void BioGearsConfiguration::Merge(const PhysiologyEngineConfiguration& from) @@ -355,7 +358,7 @@ void BioGearsConfiguration::Merge(const PhysiologyEngineConfiguration& from) void BioGearsConfiguration::Merge(const BioGearsConfiguration& from) { m_Merge = true; - CDM_COPY((&from), this); + CDM_BIOGEARS_ENGINE_CONFIGURATION_COPY(BioGearsConfiguration, from, *this) m_Merge = false; } @@ -363,8 +366,8 @@ bool BioGearsConfiguration::Load(const std::string& file) { // if file does not exist, we stick with defaults - CDM::BioGearsConfigurationData* pData; - std::unique_ptr data; + CDM::BioGearsConfigurationData* pData = nullptr; + std::unique_ptr data = nullptr; auto io = m_Logger->GetIoManager().lock(); auto possible_path = io->FindConfigFile(file.c_str()); @@ -385,429 +388,10 @@ bool BioGearsConfiguration::Load(const std::string& file) Info(ss); return true; } - return Load(*pData); -} - -bool BioGearsConfiguration::Load(const CDM::PhysiologyEngineConfigurationData& from) -{ - const CDM::BioGearsConfigurationData* bgConfig = dynamic_cast(&from); - if (bgConfig != nullptr) - return Load(*bgConfig); - else - return PhysiologyEngineConfiguration::Load(from); -} - -bool BioGearsConfiguration::Load(const CDM::BioGearsConfigurationData& in) -{ - PhysiologyEngineConfiguration::Load(in); - - // Blood Chemistry - if (in.BloodChemistryConfiguration().present()) { - const CDM::BloodChemistryConfigurationData& config = in.BloodChemistryConfiguration().get(); - if (config.MeanCorpuscularVolume().present()) - GetMeanCorpuscularVolume().Load(config.MeanCorpuscularVolume().get()); - if (config.MeanCorpuscularHemoglobin().present()) - GetMeanCorpuscularHemoglobin().Load(config.MeanCorpuscularHemoglobin().get()); - if (config.StandardDiffusionDistance().present()) - GetStandardDiffusionDistance().Load(config.StandardDiffusionDistance().get()); - if (config.StandardOxygenDiffusionCoefficient().present()) - GetStandardOxygenDiffusionCoefficient().Load(config.StandardOxygenDiffusionCoefficient().get()); - } - - // Cardiovascular - if (in.CardiovascularConfiguration().present()) { - const CDM::CardiovascularConfigurationData& config = in.CardiovascularConfiguration().get(); - if (config.LeftHeartElastanceMaximum().present()) - GetLeftHeartElastanceMaximum().Load(config.LeftHeartElastanceMaximum().get()); - if (config.LeftHeartElastanceMinimum().present()) - GetLeftHeartElastanceMinimum().Load(config.LeftHeartElastanceMinimum().get()); - if (config.MinimumBloodVolumeFraction().present()) - GetMinimumBloodVolumeFraction().Load(config.MinimumBloodVolumeFraction().get()); - if (config.RightHeartElastanceMaximum().present()) - GetRightHeartElastanceMaximum().Load(config.RightHeartElastanceMaximum().get()); - if (config.RightHeartElastanceMinimum().present()) - GetRightHeartElastanceMinimum().Load(config.RightHeartElastanceMinimum().get()); - if (config.StandardPulmonaryCapillaryCoverage().present()) - GetStandardPulmonaryCapillaryCoverage().Load(config.StandardPulmonaryCapillaryCoverage().get()); - } - - // Circuit - if (in.CircuitConfiguration().present()) { - const CDM::CircuitConfigurationData& config = in.CircuitConfiguration().get(); - if (config.CardiovascularOpenResistance().present()) - GetCardiovascularOpenResistance().Load(config.CardiovascularOpenResistance().get()); - if (config.DefaultOpenElectricResistance().present()) - GetDefaultOpenElectricResistance().Load(config.DefaultOpenElectricResistance().get()); - if (config.DefaultOpenFlowResistance().present()) - GetDefaultOpenFlowResistance().Load(config.DefaultOpenFlowResistance().get()); - if (config.DefaultOpenHeatResistance().present()) - GetDefaultOpenHeatResistance().Load(config.DefaultOpenHeatResistance().get()); - if (config.DefaultClosedElectricResistance().present()) - GetDefaultClosedElectricResistance().Load(config.DefaultClosedElectricResistance().get()); - if (config.DefaultClosedFlowResistance().present()) - GetDefaultClosedFlowResistance().Load(config.DefaultClosedFlowResistance().get()); - if (config.DefaultClosedHeatResistance().present()) - GetDefaultClosedHeatResistance().Load(config.DefaultClosedHeatResistance().get()); - if (config.MachineClosedResistance().present()) - GetMachineClosedResistance().Load(config.MachineClosedResistance().get()); - if (config.MachineOpenResistance().present()) - GetMachineOpenResistance().Load(config.MachineOpenResistance().get()); - if (config.RespiratoryClosedResistance().present()) - GetRespiratoryClosedResistance().Load(config.RespiratoryClosedResistance().get()); - if (config.RespiratoryOpenResistance().present()) - GetRespiratoryOpenResistance().Load(config.RespiratoryOpenResistance().get()); - } - - // Constants - if (in.ConstantsConfiguration().present()) { - const CDM::ConstantsConfigurationData& config = in.ConstantsConfiguration().get(); - if (config.OxygenMetabolicConstant().present()) - GetOxygenMetabolicConstant().Load(config.OxygenMetabolicConstant().get()); - if (config.StefanBoltzmann().present()) - GetStefanBoltzmann().Load(config.StefanBoltzmann().get()); - if (config.UniversalGasConstant().present()) - GetUniversalGasConstant().Load(config.UniversalGasConstant().get()); - } - - // Drugs - if (in.DrugsConfiguration().present()) { - const CDM::DrugsConfigurationData& config = in.DrugsConfiguration().get(); - if (config.PDModel().present()) - UsePDModel(config.PDModel().get()); - } - - // Energy - if (in.EnergyConfiguration().present()) { - const CDM::EnergyConfigurationData& config = in.EnergyConfiguration().get(); - if (config.BodySpecificHeat().present()) - GetBodySpecificHeat().Load(config.BodySpecificHeat().get()); - if (config.CoreTemperatureLow().present()) - GetCoreTemperatureLow().Load(config.CoreTemperatureLow().get()); - if (config.CoreTemperatureHigh().present()) - GetCoreTemperatureHigh().Load(config.CoreTemperatureHigh().get()); - if (config.DeltaCoreTemperatureLow().present()) - GetDeltaCoreTemperatureLow().Load(config.DeltaCoreTemperatureLow().get()); - if (config.EnergyPerATP().present()) - GetEnergyPerATP().Load(config.EnergyPerATP().get()); - if (config.SweatHeatTransfer().present()) - GetSweatHeatTransfer().Load(config.SweatHeatTransfer().get()); - if (config.VaporizationEnergy().present()) - GetVaporizationEnergy().Load(config.VaporizationEnergy().get()); - if (config.VaporSpecificHeat().present()) - GetVaporSpecificHeat().Load(config.VaporSpecificHeat().get()); - } - - // Environment - if (in.EnvironmentConfiguration().present()) { - const CDM::EnvironmentConfigurationData& config = in.EnvironmentConfiguration().get(); - if (config.AirDensity().present()) - GetAirDensity().Load(config.AirDensity().get()); - if (config.AirSpecificHeat().present()) - GetAirSpecificHeat().Load(config.AirSpecificHeat().get()); - if (config.MolarMassOfDryAir().present()) - GetMolarMassOfDryAir().Load(config.MolarMassOfDryAir().get()); - if (config.MolarMassOfWaterVapor().present()) - GetMolarMassOfWaterVapor().Load(config.MolarMassOfWaterVapor().get()); - if (config.InitialEnvironmentalConditionsFile().present()) { - if (!GetInitialEnvironmentalConditions().Load(config.InitialEnvironmentalConditionsFile().get())) { - Error("Unable to load InitialEnvironmentalConditions file"); - return false; - } - } else if (config.InitialEnvironmentalConditions().present()) { - if (!GetInitialEnvironmentalConditions().Load(config.InitialEnvironmentalConditions().get())) { - Error("Unable to load InitialEnvironmentalConditions"); - return false; - } - } - if (config.WaterDensity().present()) - GetWaterDensity().Load(config.WaterDensity().get()); - } - - // Gastrointestinal - if (in.GastrointestinalConfiguration().present()) { - const CDM::GastrointestinalConfigurationData& config = in.GastrointestinalConfiguration().get(); - if (config.CalciumAbsorptionFraction().present()) - GetCalciumAbsorptionFraction().Load(config.CalciumAbsorptionFraction().get()); - if (config.CalciumDigestionRate().present()) - GetCalciumDigestionRate().Load(config.CalciumDigestionRate().get()); - if (config.CarbohydrateAbsorptionFraction().present()) - GetCarbohydrateAbsorptionFraction().Load(config.CarbohydrateAbsorptionFraction().get()); - if (config.DefaultStomachContentsFile().present()) { - if (!GetDefaultStomachContents().Load(config.DefaultStomachContentsFile().get())) { - Error("Unable to load Standard Stomach Contents file"); - return false; - } - } else if (config.DefaultStomachContents().present()) { - if (!GetDefaultStomachContents().Load(config.DefaultStomachContents().get())) { - Error("Unable to load Standard Stomach Contents"); - return false; - } - } - if (config.FatAbsorptionFraction().present()) - GetFatAbsorptionFraction().Load(config.FatAbsorptionFraction().get()); - if (config.ProteinToUreaFraction().present()) - GetProteinToUreaFraction().Load(config.ProteinToUreaFraction().get()); - if (config.WaterDigestionRate().present()) - GetWaterDigestionRate().Load(config.WaterDigestionRate().get()); - } - - // Nervous - if (in.NervousConfiguration().present()) { - const CDM::NervousConfigurationData& config = in.NervousConfiguration().get(); - if (config.EnableCerebral().present()) - EnableCerebral(config.EnableCerebral().get()); - if (config.PupilDiameterBaseline().present()) - GetPupilDiameterBaseline().Load(config.PupilDiameterBaseline().get()); - } - - // Renal - if (in.RenalConfiguration().present()) { - const CDM::RenalConfigurationData& config = in.RenalConfiguration().get(); - - if (config.EnableRenal().present()) - EnableRenal(config.EnableRenal().get()); - - if (config.PlasmaSodiumConcentrationSetPoint().present()) - GetPlasmaSodiumConcentrationSetPoint().Load(config.PlasmaSodiumConcentrationSetPoint().get()); - - if (config.LeftGlomerularFluidPermeabilityBaseline().present()) - GetLeftGlomerularFluidPermeabilityBaseline().Load(config.LeftGlomerularFluidPermeabilityBaseline().get()); - if (config.LeftGlomerularFilteringSurfaceAreaBaseline().present()) - GetLeftGlomerularFilteringSurfaceAreaBaseline().Load(config.LeftGlomerularFilteringSurfaceAreaBaseline().get()); - if (config.LeftTubularReabsorptionFluidPermeabilityBaseline().present()) - GetLeftTubularReabsorptionFluidPermeabilityBaseline().Load(config.LeftTubularReabsorptionFluidPermeabilityBaseline().get()); - if (config.LeftTubularReabsorptionFilteringSurfaceAreaBaseline().present()) - GetLeftTubularReabsorptionFilteringSurfaceAreaBaseline().Load(config.LeftTubularReabsorptionFilteringSurfaceAreaBaseline().get()); - - if (config.MaximumAfferentResistance().present()) - GetMaximumAfferentResistance().Load(config.MaximumAfferentResistance().get()); - if (config.MinimumAfferentResistance().present()) - GetMinimumAfferentResistance().Load(config.MinimumAfferentResistance().get()); - - if (config.RightGlomerularFluidPermeabilityBaseline().present()) - GetRightGlomerularFluidPermeabilityBaseline().Load(config.RightGlomerularFluidPermeabilityBaseline().get()); - if (config.RightGlomerularFilteringSurfaceAreaBaseline().present()) - GetRightGlomerularFilteringSurfaceAreaBaseline().Load(config.RightGlomerularFilteringSurfaceAreaBaseline().get()); - if (config.RightTubularReabsorptionFluidPermeabilityBaseline().present()) - GetRightTubularReabsorptionFluidPermeabilityBaseline().Load(config.RightTubularReabsorptionFluidPermeabilityBaseline().get()); - if (config.RightTubularReabsorptionFilteringSurfaceAreaBaseline().present()) - GetRightTubularReabsorptionFilteringSurfaceAreaBaseline().Load(config.RightTubularReabsorptionFilteringSurfaceAreaBaseline().get()); - if (config.TargetSodiumDelivery().present()) - GetTargetSodiumDelivery().Load(config.TargetSodiumDelivery().get()); - } - - // Respiratory - if (in.RespiratoryConfiguration().present()) { - const CDM::RespiratoryConfigurationData& config = in.RespiratoryConfiguration().get(); - if (config.PleuralComplianceSensitivity().present()) - GetPleuralComplianceSensitivity().Load(config.PleuralComplianceSensitivity().get()); - if (config.PulmonaryVentilationRateMaximum().present()) - GetPulmonaryVentilationRateMaximum().Load(config.PulmonaryVentilationRateMaximum().get()); - if (config.VentilatoryOcclusionPressure().present()) - GetVentilatoryOcclusionPressure().Load(config.VentilatoryOcclusionPressure().get()); - } - - // Tissue - if (in.TissueConfiguration().present()) { - const CDM::TissueConfigurationData& config = in.TissueConfiguration().get(); - - if (config.EnableTissue().present()) - EnableTissue(config.EnableTissue().get()); - } - + io::BiogearsEngineConfiguration::UnMarshall(*pData, *this); return true; } -CDM::BioGearsConfigurationData* BioGearsConfiguration::Unload() const -{ - CDM::BioGearsConfigurationData* data(new CDM::BioGearsConfigurationData()); - Unload(*data); - return data; -} - -void BioGearsConfiguration::Unload(CDM::BioGearsConfigurationData& data) const -{ - PhysiologyEngineConfiguration::Unload(data); - - // Blood Chemistry - CDM::BloodChemistryConfigurationData* bc(new CDM::BloodChemistryConfigurationData()); - if (HasMeanCorpuscularHemoglobin()) - bc->MeanCorpuscularHemoglobin(std::unique_ptr(m_MeanCorpuscularHemoglobin->Unload())); - if (HasMeanCorpuscularVolume()) - bc->MeanCorpuscularVolume(std::unique_ptr(m_MeanCorpuscularVolume->Unload())); - if (HasStandardDiffusionDistance()) - bc->StandardDiffusionDistance(std::unique_ptr(m_StandardDiffusionDistance->Unload())); - if (HasStandardOxygenDiffusionCoefficient()) - bc->StandardOxygenDiffusionCoefficient(std::unique_ptr(m_StandardOxygenDiffusionCoefficient->Unload())); - data.BloodChemistryConfiguration(std::unique_ptr(bc)); - - // Cardiovascular - CDM::CardiovascularConfigurationData* cv(new CDM::CardiovascularConfigurationData()); - if (m_LeftHeartElastanceMaximum != nullptr) - cv->LeftHeartElastanceMaximum(std::unique_ptr(m_LeftHeartElastanceMaximum->Unload())); - if (m_LeftHeartElastanceMinimum != nullptr) - cv->LeftHeartElastanceMinimum(std::unique_ptr(m_LeftHeartElastanceMinimum->Unload())); - if (HasMinimumBloodVolumeFraction()) - cv->MinimumBloodVolumeFraction(std::unique_ptr(m_MinimumBloodVolumeFraction->Unload())); - if (m_RightHeartElastanceMaximum != nullptr) - cv->RightHeartElastanceMaximum(std::unique_ptr(m_RightHeartElastanceMaximum->Unload())); - if (m_RightHeartElastanceMinimum != nullptr) - cv->RightHeartElastanceMinimum(std::unique_ptr(m_RightHeartElastanceMinimum->Unload())); - if (HasStandardPulmonaryCapillaryCoverage()) - cv->StandardPulmonaryCapillaryCoverage(std::unique_ptr(m_StandardPulmonaryCapillaryCoverage->Unload())); - data.CardiovascularConfiguration(std::unique_ptr(cv)); - - // Circuits - CDM::CircuitConfigurationData* circuit(new CDM::CircuitConfigurationData()); - if (HasCardiovascularOpenResistance()) - circuit->CardiovascularOpenResistance(std::unique_ptr(m_CardiovascularOpenResistance->Unload())); - if (HasDefaultClosedElectricResistance()) - circuit->DefaultClosedElectricResistance(std::unique_ptr(m_DefaultClosedElectricResistance->Unload())); - if (HasDefaultClosedFlowResistance()) - circuit->DefaultClosedFlowResistance(std::unique_ptr(m_DefaultClosedFlowResistance->Unload())); - if (HasDefaultClosedHeatResistance()) - circuit->DefaultClosedHeatResistance(std::unique_ptr(m_DefaultClosedHeatResistance->Unload())); - if (HasDefaultOpenElectricResistance()) - circuit->DefaultOpenElectricResistance(std::unique_ptr(m_DefaultOpenElectricResistance->Unload())); - if (HasDefaultOpenFlowResistance()) - circuit->DefaultOpenFlowResistance(std::unique_ptr(m_DefaultOpenFlowResistance->Unload())); - if (HasDefaultOpenHeatResistance()) - circuit->DefaultOpenHeatResistance(std::unique_ptr(m_DefaultOpenHeatResistance->Unload())); - if (HasMachineClosedResistance()) - circuit->MachineClosedResistance(std::unique_ptr(m_MachineClosedResistance->Unload())); - if (HasMachineOpenResistance()) - circuit->MachineOpenResistance(std::unique_ptr(m_MachineOpenResistance->Unload())); - if (HasRespiratoryClosedResistance()) - circuit->RespiratoryClosedResistance(std::unique_ptr(m_RespiratoryClosedResistance->Unload())); - if (HasRespiratoryOpenResistance()) - circuit->RespiratoryOpenResistance(std::unique_ptr(m_RespiratoryOpenResistance->Unload())); - data.CircuitConfiguration(std::unique_ptr(circuit)); - - // Constants - CDM::ConstantsConfigurationData* consts(new CDM::ConstantsConfigurationData()); - if (HasOxygenMetabolicConstant()) - consts->OxygenMetabolicConstant(std::unique_ptr(m_OxygenMetabolicConstant->Unload())); - if (HasStefanBoltzmann()) - consts->StefanBoltzmann(std::unique_ptr(m_StefanBoltzmann->Unload())); - if (HasUniversalGasConstant()) - consts->UniversalGasConstant(std::unique_ptr(m_UniversalGasConstant->Unload())); - data.ConstantsConfiguration(std::unique_ptr(consts)); - - // Drugs - CDM::DrugsConfigurationData* drugs(new CDM::DrugsConfigurationData()); - if (HasUsePDModel()) - drugs->PDModel(m_PDEnabled); - data.DrugsConfiguration(std::unique_ptr(drugs)); - - // Energy - CDM::EnergyConfigurationData* energy(new CDM::EnergyConfigurationData()); - if (HasBodySpecificHeat()) - energy->BodySpecificHeat(std::unique_ptr(m_BodySpecificHeat->Unload())); - if (HasCoreTemperatureLow()) - energy->CoreTemperatureLow(std::unique_ptr(m_CoreTemperatureLow->Unload())); - if (HasCoreTemperatureHigh()) - energy->CoreTemperatureHigh(std::unique_ptr(m_CoreTemperatureHigh->Unload())); - if (HasDeltaCoreTemperatureLow()) - energy->DeltaCoreTemperatureLow(std::unique_ptr(m_DeltaCoreTemperatureLow->Unload())); - if (HasEnergyPerATP()) - energy->EnergyPerATP(std::unique_ptr(m_EnergyPerATP->Unload())); - if (HasSweatHeatTransfer()) - energy->SweatHeatTransfer(std::unique_ptr(m_SweatHeatTransfer->Unload())); - if (HasVaporSpecificHeat()) - energy->VaporSpecificHeat(std::unique_ptr(m_VaporSpecificHeat->Unload())); - if (HasVaporizationEnergy()) - energy->VaporizationEnergy(std::unique_ptr(m_VaporizationEnergy->Unload())); - data.EnergyConfiguration(std::unique_ptr(energy)); - - // Environment - CDM::EnvironmentConfigurationData* env(new CDM::EnvironmentConfigurationData()); - if (HasAirDensity()) - env->AirDensity(std::unique_ptr(m_AirDensity->Unload())); - if (HasAirSpecificHeat()) - env->AirSpecificHeat(std::unique_ptr(m_AirSpecificHeat->Unload())); - if (HasMolarMassOfDryAir()) - env->MolarMassOfDryAir(std::unique_ptr(m_MolarMassOfDryAir->Unload())); - if (HasMolarMassOfWaterVapor()) - env->MolarMassOfWaterVapor(std::unique_ptr(m_MolarMassOfWaterVapor->Unload())); - if (HasInitialEnvironmentalConditions()) - env->InitialEnvironmentalConditions(std::unique_ptr(m_InitialEnvironmentalConditions->Unload())); - if (HasWaterDensity()) - env->WaterDensity(std::unique_ptr(m_WaterDensity->Unload())); - data.EnvironmentConfiguration(std::unique_ptr(env)); - - // Gastrointestinal - CDM::GastrointestinalConfigurationData* gi(new CDM::GastrointestinalConfigurationData()); - if (HasCalciumAbsorptionFraction()) - gi->CalciumAbsorptionFraction(std::unique_ptr(m_CalciumAbsorptionFraction->Unload())); - if (HasCalciumDigestionRate()) - gi->CalciumDigestionRate(std::unique_ptr(m_CalciumDigestionRate->Unload())); - if (HasCarbohydrateAbsorptionFraction()) - gi->CarbohydrateAbsorptionFraction(std::unique_ptr(m_CarbohydrateAbsorptionFraction->Unload())); - if (HasDefaultStomachContents()) - gi->DefaultStomachContents(std::unique_ptr(m_DefaultStomachContents->Unload())); - if (HasFatAbsorptionFraction()) - gi->FatAbsorptionFraction(std::unique_ptr(m_FatAbsorptionFraction->Unload())); - if (HasProteinToUreaFraction()) - gi->ProteinToUreaFraction(std::unique_ptr(m_ProteinToUreaFraction->Unload())); - if (HasWaterDigestionRate()) - gi->WaterDigestionRate(std::unique_ptr(m_WaterDigestionRate->Unload())); - data.GastrointestinalConfiguration(std::unique_ptr(gi)); - - // Nervous - CDM::NervousConfigurationData* n(new CDM::NervousConfigurationData()); - if (HasEnableCerebral()) - n->EnableCerebral(m_CerebralEnabled); - if (HasPupilDiameterBaseline()) - n->PupilDiameterBaseline(std::unique_ptr(m_PupilDiameterBaseline->Unload())); - data.NervousConfiguration(std::unique_ptr(n)); - - // Renal - CDM::RenalConfigurationData* renal(new CDM::RenalConfigurationData()); - if (HasEnableRenal()) - renal->EnableRenal(m_RenalEnabled); - if (HasPlasmaSodiumConcentrationSetPoint()) - renal->PlasmaSodiumConcentrationSetPoint(std::unique_ptr(m_PlasmaSodiumConcentrationSetPoint->Unload())); - if (HasLeftGlomerularFilteringSurfaceAreaBaseline()) - renal->LeftGlomerularFilteringSurfaceAreaBaseline(std::unique_ptr(m_LeftGlomerularFilteringSurfaceAreaBaseline->Unload())); - if (HasLeftGlomerularFluidPermeabilityBaseline()) - renal->LeftGlomerularFluidPermeabilityBaseline(std::unique_ptr(m_LeftGlomerularFluidPermeabilityBaseline->Unload())); - if (HasLeftTubularReabsorptionFilteringSurfaceAreaBaseline()) - renal->LeftTubularReabsorptionFilteringSurfaceAreaBaseline(std::unique_ptr(m_LeftTubularReabsorptionFilteringSurfaceAreaBaseline->Unload())); - if (HasLeftTubularReabsorptionFluidPermeabilityBaseline()) - renal->LeftTubularReabsorptionFluidPermeabilityBaseline(std::unique_ptr(m_LeftTubularReabsorptionFluidPermeabilityBaseline->Unload())); - - if (HasMaximumAfferentResistance()) - renal->MaximumAfferentResistance(std::unique_ptr(m_MaximumAfferentResistance->Unload())); - if (HasMinimumAfferentResistance()) - renal->MinimumAfferentResistance(std::unique_ptr(m_MinimumAfferentResistance->Unload())); - - if (HasRightGlomerularFilteringSurfaceAreaBaseline()) - renal->RightGlomerularFilteringSurfaceAreaBaseline(std::unique_ptr(m_RightGlomerularFilteringSurfaceAreaBaseline->Unload())); - if (HasRightGlomerularFluidPermeabilityBaseline()) - renal->RightGlomerularFluidPermeabilityBaseline(std::unique_ptr(m_RightGlomerularFluidPermeabilityBaseline->Unload())); - if (HasRightTubularReabsorptionFilteringSurfaceAreaBaseline()) - renal->RightTubularReabsorptionFilteringSurfaceAreaBaseline(std::unique_ptr(m_RightTubularReabsorptionFilteringSurfaceAreaBaseline->Unload())); - if (HasRightTubularReabsorptionFluidPermeabilityBaseline()) - renal->RightTubularReabsorptionFluidPermeabilityBaseline(std::unique_ptr(m_RightTubularReabsorptionFluidPermeabilityBaseline->Unload())); - data.RenalConfiguration(std::unique_ptr(renal)); - - // Respiratory - CDM::RespiratoryConfigurationData* resp(new CDM::RespiratoryConfigurationData()); - if (HasPleuralComplianceSensitivity()) - resp->PleuralComplianceSensitivity(std::unique_ptr(m_PleuralComplianceSensitivity->Unload())); - if (m_PulmonaryVentilationRateMaximum != nullptr) - resp->PulmonaryVentilationRateMaximum(std::unique_ptr(m_PulmonaryVentilationRateMaximum->Unload())); - if (HasVentilatoryOcclusionPressure()) - resp->VentilatoryOcclusionPressure(std::unique_ptr(m_VentilatoryOcclusionPressure->Unload())); - data.RespiratoryConfiguration(std::unique_ptr(resp)); - - // Tissue - CDM::TissueConfigurationData* tissue(new CDM::TissueConfigurationData()); - if (HasEnableTissue()) - tissue->EnableTissue(m_TissueEnabled); - data.TissueConfiguration(std::unique_ptr(tissue)); -} - ////////////////////// /** Blood Chemistry */ ////////////////////// diff --git a/projects/biogears/libBiogears/src/engine/Controller/BioGearsEngine.cpp b/projects/biogears/libBiogears/src/engine/Controller/BioGearsEngine.cpp index 3eddfad48..329ad4ef2 100644 --- a/projects/biogears/libBiogears/src/engine/Controller/BioGearsEngine.cpp +++ b/projects/biogears/libBiogears/src/engine/Controller/BioGearsEngine.cpp @@ -17,10 +17,18 @@ specific language governing permissions and limitations under the License. #include #include +#include "io/biogears/BioGears.h" +#include "io/cdm/Circuit.h" +#include "io/cdm/Compartment.h" +#include "io/cdm/Conditions.h" +#include "io/cdm/Patient.h" +#include "io/cdm/PatientAssessments.h" + #include #include #include #include +#include #include #include #include @@ -39,16 +47,17 @@ specific language governing permissions and limitations under the License. #include #include #include +#include #include #include +#include + #if defined(BIOGEARS_IO_PRESENT) && defined(BIOGEARS_IO_EMBED_STATES) #include #endif #include -namespace BGE = mil::tatrc::physiology::biogears; - namespace biogears { //------------------------------------------------------------------------------- BioGearsEngine::BioGearsEngine(Logger* logger) @@ -155,11 +164,13 @@ bool BioGearsEngine::LoadState(const std::string& file, const SEScalarTime* simT auto state = dynamic_cast(obj.get()); if (state != nullptr) { - return LoadState(*state, simTime); + io::BioGears::UnMarshall(*state, *this, simTime); + return true; } m_Logger->Error("File does not contain a valid PhysiologyEngineState"); return false; } + //------------------------------------------------------------------------------- //! //! \param char const* buffer -- String literal ASCII encoding of a biogears EngineState file @@ -173,399 +184,25 @@ bool BioGearsEngine::LoadState(char const* buffer, size_t size) std::unique_ptr obj = Serializer::ReadBuffer((XMLByte const*)buffer, size, GetLogger()); auto state = dynamic_cast(obj.get()); if (state != nullptr) { - return LoadState(*state, nullptr); + io::BioGears::UnMarshall(*state, *this); + return true; } m_Logger->Error("File does not contain a valid PhysiologyEngineState"); return false; } -//------------------------------------------------------------------------------- -//! -//! Override of LoadState -//! \\see BioGearsEngine::LoadState(const char* file, const SEScalarTime* simTime) -bool BioGearsEngine::LoadState(const CDM::PhysiologyEngineStateData& state, const SEScalarTime* simTime) -{ - auto requests = GetEngineTrack()->GetDataRequestManager().GetDataRequests(); - auto resultsFile = GetEngineTrack()->GetDataRequestManager().GetResultsFilename(); - std::vector> dataVector; - for (auto& dr : requests) { - dataVector.emplace_back(dr->Unload()); - } - BioGears::SetUp(); - m_EngineTrack = PhysiologyEngineTrack(*this); - m_DataTrack = &m_EngineTrack.GetDataTrack(); - for (auto& data : dataVector) { - m_EngineTrack.GetDataRequestManager().CreateFromBind(*data, *m_Substances); - } - m_EngineTrack.GetDataRequestManager().SetResultsFilename(resultsFile); - m_ss.str(""); - m_ss.clear(); - - m_State = EngineState::NotReady; - - const CDM::BioGearsStateData* bgState = dynamic_cast(&state); - if (bgState == nullptr) { - m_Logger->Error("State data is not a BioGearsStateData object"); - return false; - } - - // if (state.DataRequests().present()) { - // m_EngineTrack.GetDataRequestManager().Clear(); - // m_EngineTrack.GetDataRequestManager().Load(state.DataRequests().get(), *m_Substances); - // m_EngineTrack.ForceConnection(); // I don't want to rest the file because I would loose all my data - // } - - if (simTime != nullptr) { - m_CurrentTime->Set(*simTime); - m_SimulationTime->Set(*simTime); - } else { - if (state.SimulationTime().present()) { - m_CurrentTime->Load(state.SimulationTime().get()); - m_SimulationTime->Load(state.SimulationTime().get()); - } else { - m_CurrentTime->SetValue(0, TimeUnit::s); - m_SimulationTime->SetValue(0, TimeUnit::s); - } - } - m_AirwayMode = bgState->AirwayMode(); - m_Intubation = bgState->Intubation(); - - /// Patient // - if (!bgState->Patient().present()) { - m_ss << "BioGearsState must have a patient" << std::endl; - } else if (!m_Patient->Load(bgState->Patient().get())) { - m_ss << "Error loading patient data" << std::endl; - } - // Conditions // - m_Conditions->Clear(); - for (const CDM::ConditionData& cData : bgState->Condition()) { - if (!m_Conditions->ProcessCondition(cData, *this)) { - m_ss << "Unable to load condition" << std::endl; - } - } - // Actions // - m_Actions->Clear(); - for (const CDM::ActionData& cData : bgState->ActiveAction()) { - if (!m_Actions->ProcessAction(cData, *this)) { - m_ss << "Unable to load action" << std::endl; - } - } - // Substances // - for (const CDM::SubstanceData& subData : bgState->ActiveSubstance()) { - SESubstance* sub = m_Substances->GetSubstance(subData.Name()); - if (sub == nullptr) { - sub = new SESubstance(GetLogger()); - m_Substances->AddSubstance(*sub); - } - if (!sub->Load(subData)) { - m_ss << "Unable to load substance" << subData.Name() << std::endl; - } - m_Substances->AddActiveSubstance(*sub); - } - // Compounds // - for (const CDM::SubstanceCompoundData& cmpdData : bgState->ActiveSubstanceCompound()) { - SESubstanceCompound* cmpd = m_Substances->GetCompound(cmpdData.Name()); - if (cmpd == nullptr) { - cmpd = new SESubstanceCompound(GetLogger()); - m_Substances->AddCompound(*cmpd); - } - if (!cmpd->Load(cmpdData, *m_Substances)) { - m_ss << "Unable to load compound" << cmpdData.Name() << std::endl; - } - } - // Circuit Manager // - if (!bgState->CircuitManager().present()) { - m_ss << "BioGearsState must have a circuit manager" << std::endl; - } else { - const CDM::CircuitManagerData* cmptMgrData = dynamic_cast(&bgState->CircuitManager().get()); - if (cmptMgrData == nullptr) { - m_ss << "BioGearsState must have a BioGears circuit manager" << std::endl; - } else if (!m_Circuits->Load(*cmptMgrData)) { - m_ss << "Error loading circuit manager data" << std::endl; - } - } - // Compartment Manager // - if (!bgState->CompartmentManager().present()) { - m_ss << "BioGearsState must have a compartment manager" << std::endl; - } else { - const CDM::CompartmentManagerData* cmptMgrData = dynamic_cast(&bgState->CompartmentManager().get()); - if (cmptMgrData == nullptr) { - m_ss << "BioGearsState must have a BioGears compartment manager" << std::endl; - } else if (!m_Compartments->Load(*cmptMgrData, m_Circuits.get())) { - m_ss << "Error loading compartment manager data" << std::endl; - } - } - // Configuration // - if (!bgState->Configuration().present()) { - m_ss << "BioGearsState must have a configuration" << std::endl; - } else { - const CDM::BioGearsConfigurationData* confData = dynamic_cast(&bgState->Configuration().get()); - if (confData == nullptr) { - m_ss << "BioGearsState must have a BioGears configuration" << std::endl; - } else if (!m_Config->Load(*confData)) { - m_ss << "Error loading configuration data" << std::endl; - } - } - // Now, Let's see if there is anything to merge into our base configuration - // At this point I don't think we should be doing this... but maybe you want to... - // m_Logger->Info("Merging OnDisk Configuration"); - // BioGearsConfiguration cFile(*m_Substances); - // cFile.Load("BioGearsConfiguration.xml"); - // m_Config->Merge(cFile); - - ///////////// - // Systems // - ///////////// - // Physiology - const CDM::BioGearsBloodChemistrySystemData* bcData = nullptr; - const CDM::BioGearsCardiovascularSystemData* cvData = nullptr; - const CDM::BioGearsDrugSystemData* dData = nullptr; - const CDM::BioGearsEndocrineSystemData* ndoData = nullptr; - const CDM::BioGearsEnergySystemData* nrgData = nullptr; - const CDM::BioGearsGastrointestinalSystemData* gasData = nullptr; - const CDM::BioGearsHepaticSystemData* hepData = nullptr; - const CDM::BioGearsNervousSystemData* nrvData = nullptr; - const CDM::BioGearsRenalSystemData* rnlData = nullptr; - const CDM::BioGearsRespiratorySystemData* rspData = nullptr; - const CDM::BioGearsTissueSystemData* tsuData = nullptr; - // Environment - const CDM::BioGearsEnvironmentData* envData = nullptr; - // Equipment - const CDM::BioGearsAnesthesiaMachineData* amData = nullptr; - const CDM::BioGearsElectroCardioGramData* ecgData = nullptr; - const CDM::BioGearsInhalerData* nhlData = nullptr; - for (const CDM::SystemData& sysData : bgState->System()) { - if (bcData == nullptr) { - bcData = dynamic_cast(&sysData); - if (bcData != nullptr && !m_BloodChemistrySystem->Load(*bcData)) { - m_ss << "Error loading Blood Chemistry data" << std::endl; - } - } - if (cvData == nullptr) { - cvData = dynamic_cast(&sysData); - if (cvData != nullptr && !m_CardiovascularSystem->Load(*cvData)) { - m_ss << "Error loading Cardiovascular data" << std::endl; - } - } - if (dData == nullptr) { - dData = dynamic_cast(&sysData); - if (dData != nullptr && !m_DrugSystem->Load(*dData)) { - m_ss << "Error loading Drug data" << std::endl; - } - } - if (ndoData == nullptr) { - ndoData = dynamic_cast(&sysData); - if (ndoData != nullptr && !m_EndocrineSystem->Load(*ndoData)) { - m_ss << "Error loading Endocrine data" << std::endl; - } - } - if (nrgData == nullptr) { - nrgData = dynamic_cast(&sysData); - if (nrgData != nullptr && !m_EnergySystem->Load(*nrgData)) { - m_ss << "Error loading Energy data" << std::endl; - } - } - if (gasData == nullptr) { - gasData = dynamic_cast(&sysData); - if (gasData != nullptr && !m_GastrointestinalSystem->Load(*gasData)) { - m_ss << "Error loading Gastrointestinal data" << std::endl; - } - } - if (hepData == nullptr) { - hepData = dynamic_cast(&sysData); - if (hepData != nullptr && !m_HepaticSystem->Load(*hepData)) { - m_ss << "Error loading Hepatic data" << std::endl; - } - } - if (nrvData == nullptr) { - nrvData = dynamic_cast(&sysData); - if (nrvData != nullptr && !m_NervousSystem->Load(*nrvData)) { - m_ss << "Error loading Nervous data" << std::endl; - } - } - if (rnlData == nullptr) { - rnlData = dynamic_cast(&sysData); - if (rnlData != nullptr && !m_RenalSystem->Load(*rnlData)) { - m_ss << "Error loading Renal data" << std::endl; - } - } - if (rspData == nullptr) { - rspData = dynamic_cast(&sysData); - if (rspData != nullptr && !m_RespiratorySystem->Load(*rspData)) { - m_ss << "Error loading Respiratory data" << std::endl; - } - } - if (tsuData == nullptr) { - tsuData = dynamic_cast(&sysData); - if (tsuData != nullptr && !m_TissueSystem->Load(*tsuData)) { - m_ss << "Error loading Tissue data" << std::endl; - } - } - if (envData == nullptr) { - envData = dynamic_cast(&sysData); - if (envData != nullptr && !m_Environment->Load(*envData)) { - m_ss << "Error loading Environment data" << std::endl; - } - } - if (amData == nullptr) { - amData = dynamic_cast(&sysData); - if (amData != nullptr && !m_AnesthesiaMachine->Load(*amData)) { - m_ss << "Error loading Anesthesia Machine data" << std::endl; - } - } - if (ecgData == nullptr) { - ecgData = dynamic_cast(&sysData); - if (ecgData != nullptr && !m_ECG->Load(*ecgData)) { - m_ss << "Error loading ECG data" << std::endl; - } - } - if (nhlData == nullptr) { - nhlData = dynamic_cast(&sysData); - if (nhlData != nullptr && !m_Inhaler->Load(*nhlData)) { - m_ss << "Error loading Inhaler data" << std::endl; - } - } - } - // Make sure we had all systems in the state - if (bcData == nullptr) { - m_ss << "Missing Blood Chemistry State" << std::endl; - } - if (cvData == nullptr) { - m_ss << "Missing Cardiovascular State" << std::endl; - } - if (dData == nullptr) { - m_ss << "Missing Drug State" << std::endl; - } - if (ndoData == nullptr) { - m_ss << "Missing Endocrine State" << std::endl; - } - if (nrgData == nullptr) { - m_ss << "Missing Energy State" << std::endl; - } - if (gasData == nullptr) { - m_ss << "Missing Gastrointestinal State" << std::endl; - } - if (hepData == nullptr) { - m_ss << "Missing Hepatic State" << std::endl; - } - if (nrvData == nullptr) { - m_ss << "Missing Nervous State" << std::endl; - } - if (rnlData == nullptr) { - m_ss << "Missing Renal State" << std::endl; - } - if (rspData == nullptr) { - m_ss << "Missing Respiratory State" << std::endl; - } - if (tsuData == nullptr) { - m_ss << "Missing Tissue State" << std::endl; - } - if (envData == nullptr) { - m_ss << "Missing Environment State" << std::endl; - } - if (amData == nullptr) { - m_ss << "Missing Anesthesia Machine State" << std::endl; - } - if (ecgData == nullptr) { - m_ss << "Missing ECG State" << std::endl; - } - if (nhlData == nullptr) { - m_ss << "Missing Inhaler State" << std::endl; - } - - if (!m_ss.str().empty()) { - m_Logger->Error(m_ss.str(), "BioGearsEngine"); - m_ss.str(""); - m_ss.clear(); - return false; - } - // Make sure links are correct with our modes - m_Compartments->UpdateAirwayGraph(); - m_Compartments->GetActiveRespiratoryGraph(); - m_Compartments->GetActiveAerosolGraph(); - - // It helps to unload what you just loaded and to a compare if you have issues - // SaveStateToFile("WhatIJustLoaded.xml"); - - // Good to go, save it off and carry on! - m_State = EngineState::Active; - if (state.Patient().present()) { - m_Logger->Info("Biogears has sucesfully loaded " + state.Patient()->Name() + "."); - } else { - m_Logger->Info("Biogears has sucesfully loaded the given statefile"); - } - - return true; // return CheckDataRequirements/IsValid() or something -} -//------------------------------------------------------------------------------- -std::unique_ptr BioGearsEngine::GetStateData() -{ - - std::unique_ptr state(new CDM::BioGearsStateData()); - - state->contentVersion(branded_version_string()); - - state->SimulationTime(std::unique_ptr(m_SimulationTime->Unload())); - if (m_EngineTrack.GetDataRequestManager().HasDataRequests()) { - state->DataRequests(std::unique_ptr(m_EngineTrack.GetDataRequestManager().Unload())); - } - - ((CDM::BioGearsStateData*)state.get())->AirwayMode(m_AirwayMode); - ((CDM::BioGearsStateData*)state.get())->Intubation(m_Intubation); - // Patient - state->Patient(std::unique_ptr(m_Patient->Unload())); - // Conditions - std::vector conditions; - m_Conditions->Unload(conditions); - for (CDM::ConditionData* cData : conditions) { - state->Condition().push_back(std::unique_ptr(cData)); - } - // Actions - std::vector activeActions; - m_Actions->Unload(activeActions); - for (CDM::ActionData* aData : activeActions) { - state->ActiveAction().push_back(std::unique_ptr(aData)); - } - // Active Substances/Compounds - for (SESubstance* s : m_Substances->GetActiveSubstances()) { - state->ActiveSubstance().push_back(std::unique_ptr(s->Unload())); - } - for (SESubstanceCompound* c : m_Substances->GetActiveCompounds()) { - state->ActiveSubstanceCompound().push_back(std::unique_ptr(c->Unload())); - } - // Systems - state->System().push_back(std::unique_ptr(m_BloodChemistrySystem->Unload())); - state->System().push_back(std::unique_ptr(m_CardiovascularSystem->Unload())); - state->System().push_back(std::unique_ptr(m_DrugSystem->Unload())); - state->System().push_back(std::unique_ptr(m_EndocrineSystem->Unload())); - state->System().push_back(std::unique_ptr(m_EnergySystem->Unload())); - state->System().push_back(std::unique_ptr(m_GastrointestinalSystem->Unload())); - state->System().push_back(std::unique_ptr(m_HepaticSystem->Unload())); - state->System().push_back(std::unique_ptr(m_NervousSystem->Unload())); - state->System().push_back(std::unique_ptr(m_RenalSystem->Unload())); - state->System().push_back(std::unique_ptr(m_RespiratorySystem->Unload())); - state->System().push_back(std::unique_ptr(m_TissueSystem->Unload())); - state->System().push_back(std::unique_ptr(m_Environment->Unload())); - state->System().push_back(std::unique_ptr(m_AnesthesiaMachine->Unload())); - state->System().push_back(std::unique_ptr(m_ECG->Unload())); - state->System().push_back(std::unique_ptr(m_Inhaler->Unload())); - // Compartments - state->CompartmentManager(std::unique_ptr(m_Compartments->Unload())); - // Configuration - state->Configuration(std::unique_ptr(m_Config->Unload())); - // Circuitsk - state->CircuitManager(std::unique_ptr(m_Circuits->Unload())); - return state; -} //------------------------------------------------------------------------------- void BioGearsEngine::SaveStateToFile(const char* file) { SaveStateToFile(std::string { file }); } + //------------------------------------------------------------------------------- + void BioGearsEngine::SaveStateToFile(const std::string& file) { - auto state = GetStateData(); + auto state = std::make_unique(); + io::BioGears::Marshall(*this, *state); if (!file.empty()) { filesystem::path qualified_path = m_Logger->GetIoManager().lock()->ResolveStateFileLocation(file); @@ -578,11 +215,12 @@ void BioGearsEngine::SaveStateToFile(const std::string& file) try { BioGearsState(stream, dynamic_cast(*state), map); } catch (std::exception& ex) { - m_Logger->Error(ex.what()); + m_Logger->Fatal(ex.what()); } stream.close(); } } + //------------------------------------------------------------------------------- bool BioGearsEngine::InitializeEngine(const char* patientFile) { @@ -613,7 +251,7 @@ bool BioGearsEngine::InitializeEngine(const std::string& patientFile, const std: //------------------------------------------------------------------------------- bool BioGearsEngine::InitializeEngine(const SEPatient& patient, const std::vector* conditions, const PhysiologyEngineConfiguration* config) { - CDM_COPY((&patient), m_Patient); + CDM_PATIENT_COPY(Patient, patient, *m_Patient); // We need logic here that makes sure we have what we need // and notify we are ignoring anything provided we won't use return InitializeEngine(conditions, config); @@ -632,13 +270,13 @@ bool BioGearsEngine::InitializeEngine(const std::vector* con m_AnesthesiaMachine->ForwardEvents(nullptr); // Stabilize the engine to a resting state (with a standard meal and environment) - if (!m_Config->HasStabilizationCriteria()) { + if (!m_Configuration->HasStabilizationCriteria()) { m_Logger->Error("BioGears needs stabilization criteria, none provided in configuration file"); return false; } m_State = EngineState::InitialStabilization; - if (!m_Config->GetStabilizationCriteria()->StabilizeRestingState(*this)) { + if (!m_Configuration->GetStabilizationCriteria()->StabilizeRestingState(*this)) { return false; } // We need to process conditions here, so systems can prepare for them in their AtSteadyState method @@ -658,11 +296,11 @@ bool BioGearsEngine::InitializeEngine(const std::vector* con // now that it's steady with provided patient, environment, and feedback if (conditions != nullptr && !conditions->empty()) { // Now restabilize the patient with any conditions that were applied // Push conditions into condition manager - if (!m_Config->GetStabilizationCriteria()->StabilizeConditions(*this, *conditions)) { + if (!m_Configuration->GetStabilizationCriteria()->StabilizeConditions(*this, *conditions)) { return false; } } else { - if (!m_Config->GetStabilizationCriteria()->StabilizeFeedbackState(*this)) { + if (!m_Configuration->GetStabilizationCriteria()->StabilizeFeedbackState(*this)) { return false; } } @@ -693,7 +331,7 @@ bool BioGearsEngine::InitializeEngine(const std::vector* con //------------------------------------------------------------------------------- double BioGearsEngine::GetTimeStep(const TimeUnit& unit) { - return m_Config->GetTimeStep(unit); + return m_Configuration->GetTimeStep(unit); } //------------------------------------------------------------------------------- double BioGearsEngine::GetSimulationTime(const TimeUnit& unit) const @@ -707,7 +345,7 @@ bool BioGearsEngine::AdvanceModelTime(bool appendDataTrack) if (!IsReady()) { return false; } - if (m_Patient->IsEventActive(CDM::enumPatientEvent::IrreversibleState)) { + if (m_Patient->IsEventActive(SEPatientEventType::IrreversibleState)) { return false; } @@ -715,12 +353,12 @@ bool BioGearsEngine::AdvanceModelTime(bool appendDataTrack) Process(); PostProcess(); - m_Patient->UpdateEvents(m_Config->GetTimeStep()); - m_CurrentTime->Increment(m_Config->GetTimeStep()); - m_SimulationTime->Increment(m_Config->GetTimeStep()); + m_Patient->UpdateEvents(m_Configuration->GetTimeStep()); + m_CurrentTime->Increment(m_Configuration->GetTimeStep()); + m_SimulationTime->Increment(m_Configuration->GetTimeStep()); const auto sample_interval_s = 1.0 / GetEngineTrack()->GetDataRequestManager().GetSamplesPerSecond(); - m_timeSinceLastDataTrack += m_Config->GetTimeStep(TimeUnit::s); + m_timeSinceLastDataTrack += m_Configuration->GetTimeStep(TimeUnit::s); if (m_timeSinceLastDataTrack >= sample_interval_s) { m_timeSinceLastDataTrack -= sample_interval_s; if ((m_isAutoTracking && EngineState::Active == m_State) || (m_State < EngineState::Active && m_areTrackingStabilization)) { @@ -735,11 +373,11 @@ bool BioGearsEngine::AdvanceModelTime(bool appendDataTrack) bool BioGearsEngine::AdvanceModelTime(double time, const TimeUnit& unit, bool appendDataTrack) { double time_s = Convert(time, unit, TimeUnit::s); - double remains = time_s / m_Config->GetTimeStep(TimeUnit::s); + double remains = time_s / m_Configuration->GetTimeStep(TimeUnit::s); remains -= static_cast(remains); m_timeStep_remainder += remains; - int count = static_cast(time_s / m_Config->GetTimeStep(TimeUnit::s)); + int count = static_cast(time_s / m_Configuration->GetTimeStep(TimeUnit::s)); if (m_timeStep_remainder >= 1.0) { ++count; m_timeStep_remainder -= 1.0; @@ -763,7 +401,7 @@ bool BioGearsEngine::ProcessAction(const SEAction& action) m_ss.str(""); const SESerializeState* serialize = dynamic_cast(&action); if (serialize != nullptr) { - if (serialize->GetType() == CDM::enumSerializationType::Save) { + if (serialize->GetType() == SESerializationType::Save) { if (serialize->HasFilename()) { if (filesystem::is_directory(serialize->GetFilename()) || (filesystem::is_directory("states/" + serialize->GetFilename()))) { SaveStateToFile(asprintf("%s%s@%.0fs.xml", serialize->GetFilename().c_str(), m_Patient->GetName().c_str(), GetSimulationTime(TimeUnit::s))); @@ -787,7 +425,7 @@ bool BioGearsEngine::ProcessAction(const SEAction& action) results_filepath = results_filepath.substr(0, results_filepath.find_last_of(".")); switch (assessment->GetType()) { - case CDM::enumPatientAssessment::ArterialBloodGasAnalysis: { + case SEPatientAssessmentType::ArterialBloodGasAnalysis: { SEArterialBloodGasAnalysis abga; GetPatientAssessment(abga); if (results_filepath.empty()) { @@ -797,14 +435,17 @@ bool BioGearsEngine::ProcessAction(const SEAction& action) // Write out the xml file xml_schema::namespace_infomap map; map[""].name = "uri:/mil/tatrc/phsyiology/datamodel"; - std::unique_ptr unloaded(abga.Unload()); - unloaded->contentVersion(branded_version_string()); - ArterialBloodGasAnalysis(stream, *unloaded, map); + + auto abgaData = std::make_unique(); + io::PatientAssessments::Marshall(abga, *abgaData); + + abgaData->contentVersion(branded_version_string()); + ArterialBloodGasAnalysis(stream, *abgaData, map); stream.close(); break; } - case CDM::enumPatientAssessment::PulmonaryFunctionTest: { + case SEPatientAssessmentType::PulmonaryFunctionTest: { SEPulmonaryFunctionTest pft; GetPatientAssessment(pft); if (results_filepath.empty()) { @@ -815,14 +456,16 @@ bool BioGearsEngine::ProcessAction(const SEAction& action) xml_schema::namespace_infomap map; map[""].name = "uri:/mil/tatrc/phsyiology/datamodel"; map[""].schema = "BioGears.xsd"; - std::unique_ptr unloaded(pft.Unload()); - unloaded->contentVersion(branded_version_string()); - PulmonaryFunctionTest(stream, *unloaded, map); + + auto pftData = std::make_unique(); + io::PatientAssessments::Marshall(pft, *pftData); + pftData->contentVersion(branded_version_string()); + PulmonaryFunctionTest(stream, *pftData, map); stream.close(); break; } - case CDM::enumPatientAssessment::ProthrombinTime: { + case SEPatientAssessmentType::ProthrombinTime: { SEProthrombinTime ptt; GetPatientAssessment(ptt); if (results_filepath.empty()) { @@ -833,14 +476,16 @@ bool BioGearsEngine::ProcessAction(const SEAction& action) xml_schema::namespace_infomap map; map[""].name = "uri:/mil/tatrc/phsyiology/datamodel"; map[""].schema = "BioGears.xsd"; - std::unique_ptr unloaded(ptt.Unload()); - unloaded->contentVersion(branded_version_string()); - ProthrombinTime(stream, *unloaded, map); + + auto pttData = std::make_unique(); + io::PatientAssessments::Marshall(ptt, *pttData); + pttData->contentVersion(branded_version_string()); + ProthrombinTime(stream, *pttData, map); stream.close(); break; } - case CDM::enumPatientAssessment::PsychomotorVigilanceTask: { + case SEPatientAssessmentType::PsychomotorVigilanceTask: { SEPsychomotorVigilanceTask pvt; GetPatientAssessment(pvt); if (results_filepath.empty()) { @@ -851,14 +496,16 @@ bool BioGearsEngine::ProcessAction(const SEAction& action) xml_schema::namespace_infomap map; map[""].name = "uri:/mil/tatrc/phsyiology/datamodel"; map[""].schema = "BioGears.xsd"; - std::unique_ptr unloaded(pvt.Unload()); - unloaded->contentVersion(branded_version_string()); - PsychomotorVigilanceTask(stream, *unloaded, map); + auto pvtData = std::make_unique(); + io::PatientAssessments::Marshall(pvt, *pvtData); + + pvtData->contentVersion(branded_version_string()); + PsychomotorVigilanceTask(stream, *pvtData, map); stream.close(); break; } - case CDM::enumPatientAssessment::Urinalysis: { + case SEPatientAssessmentType::Urinalysis: { SEUrinalysis upan; GetPatientAssessment(upan); if (results_filepath.empty()) { @@ -868,14 +515,15 @@ bool BioGearsEngine::ProcessAction(const SEAction& action) // Write out the xml file xml_schema::namespace_infomap map; map[""].name = "uri:/mil/tatrc/phsyiology/datamodel"; - std::unique_ptr unloaded(upan.Unload()); - unloaded->contentVersion(branded_version_string()); - Urinalysis(stream, *unloaded, map); + auto upanData = std::make_unique(); + io::PatientAssessments::Marshall(upan, *upanData); + upanData->contentVersion(branded_version_string()); + Urinalysis(stream, *upanData, map); stream.close(); break; } - case CDM::enumPatientAssessment::CompleteBloodCount: { + case SEPatientAssessmentType::CompleteBloodCount: { SECompleteBloodCount cbc; GetPatientAssessment(cbc); if (results_filepath.empty()) { @@ -885,16 +533,17 @@ bool BioGearsEngine::ProcessAction(const SEAction& action) // Write out the xml file xml_schema::namespace_infomap map; map[""].name = "uri:/mil/tatrc/phsyiology/datamodel"; - std::unique_ptr unloaded(cbc.Unload()); - unloaded->contentVersion(branded_version_string()); - CompleteBloodCount(stream, *unloaded, map); + auto cbcData = std::make_unique(); + io::PatientAssessments::Marshall(cbc, *cbcData); + cbcData->contentVersion(branded_version_string()); + CompleteBloodCount(stream, *cbcData, map); stream.close(); break; } - case CDM::enumPatientAssessment::ComprehensiveMetabolicPanel: { - SEComprehensiveMetabolicPanel mp; - GetPatientAssessment(mp); + case SEPatientAssessmentType::ComprehensiveMetabolicPanel: { + SEComprehensiveMetabolicPanel cmp; + GetPatientAssessment(cmp); if (results_filepath.empty()) { results_filepath = "ComprehensiveMetabolicPanel"; } @@ -902,13 +551,16 @@ bool BioGearsEngine::ProcessAction(const SEAction& action) // Write out the xml file xml_schema::namespace_infomap map; map[""].name = "uri:/mil/tatrc/phsyiology/datamodel"; - std::unique_ptr unloaded(mp.Unload()); - unloaded->contentVersion(branded_version_string()); - ComprehensiveMetabolicPanel(stream, *mp.Unload(), map); + + auto cmpData = std::make_unique(); + io::PatientAssessments::Marshall(cmp, *cmpData); + + cmpData->contentVersion(branded_version_string()); + ComprehensiveMetabolicPanel(stream, *cmpData, map); stream.close(); break; } - case CDM::enumPatientAssessment::SequentialOrganFailureAssessment: { + case SEPatientAssessmentType::SequentialOrganFailureAssessment: { SESequentialOrganFailureAssessment sofa; GetPatientAssessment(sofa); if (results_filepath.empty()) { @@ -918,9 +570,12 @@ bool BioGearsEngine::ProcessAction(const SEAction& action) // Write out the xml file xml_schema::namespace_infomap map; map[""].name = "uri:/mil/tatrc/phsyiology/datamodel"; - std::unique_ptr unloaded(sofa.Unload()); - unloaded->contentVersion(branded_version_string()); - SequentialOrganFailureAssessment(stream, *sofa.Unload(), map); + + auto sofaData = std::make_unique(); + io::PatientAssessments::Marshall(sofa, *sofaData); + + sofaData->contentVersion(branded_version_string()); + SequentialOrganFailureAssessment(stream, *sofaData, map); stream.close(); break; } diff --git a/projects/biogears/libBiogears/src/engine/Controller/BioGearsInterCircuitConnections_cpp b/projects/biogears/libBiogears/src/engine/Controller/BioGearsInterCircuitConnections_cpp deleted file mode 100644 index c2cf83729..000000000 --- a/projects/biogears/libBiogears/src/engine/Controller/BioGearsInterCircuitConnections_cpp +++ /dev/null @@ -1,70 +0,0 @@ -/************************************************************************************** -Copyright 2015 Applied Research Associates, Inc. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the License -at: -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software distributed under -the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -CONDITIONS OF ANY KIND, either express or implied. See the License for the -specific language governing permissions and limitations under the License. -**************************************************************************************/ - -#include "circuit/SECircuit.h" -#include "circuit/SEInterCircuitConnection.h" -#include "controller/BioGears.h" -#include "stdafx.h" - -namespace biogears { -BioGearsInterCircuitConnections::BioGearsInterCircuitConnections(BioGears& bg) - : SECircuitContainer(bg.GetLogger()) -{ - m_Data = &bg; - m_RespiratoryAnesthesiaMachineInterCircuitConnection = nullptr; -} - -BioGearsInterCircuitConnections::~BioGearsInterCircuitConnections() -{ - SECircuitContainer::Clear(); -} - -void BioGearsInterCircuitConnections::Clear() -{ - SECircuitContainer::Clear(); - m_RespiratoryAnesthesiaMachineInterCircuitConnection = nullptr; -} - -void BioGearsInterCircuitConnections::Reset() -{ - SECircuitContainer::Reset(); -} - -bool BioGearsInterCircuitConnections::IsValid() -{ - return true; -} - -SEInterCircuitConnection* BioGearsInterCircuitConnections::GetRespiratoryAnesthesiaMachineInterCircuitConnection() -{ - if (m_RespiratoryAnesthesiaMachineInterCircuitConnection == nullptr) - m_RespiratoryAnesthesiaMachineInterCircuitConnection = CreateInterCircuitConnection(); - return m_RespiratoryAnesthesiaMachineInterCircuitConnection; -} - -bool BioGearsInterCircuitConnections::LoadInterCircuitConnections(const std::string& circuitFile, Serializer& serlializer) -{ - Clear(); - - m_RespiratoryAnesthesiaMachineInterCircuitConnection = GetRespiratoryAnesthesiaMachineInterCircuitConnection(); - - SECircuit* RespiratoryCircuit = m_Data->GetCircuits()->GetRespiratoryCircuit(); - SECircuit* AnesthesiaMachineCircuit = m_Data->GetCircuits()->GetAnesthesiaCircuit(); - SECircuitNode* MouthNode = RespiratoryCircuit->GetNode(CDM::enumBioGearsNode::Mouth); - SECircuitNode* ConnectionNode = AnesthesiaMachineCircuit->GetNode(CDM::enumBioGearsNode::AnesthesiaConnection); - - m_RespiratoryAnesthesiaMachineInterCircuitConnection->CreateInterCircuitConnection("RespiratoryAnesthesiaMachineConnection", AnesthesiaMachineCircuit, ConnectionNode, RespiratoryCircuit, MouthNode); - m_RespiratoryAnesthesiaMachineInterCircuitConnection->SetActive(false); - - return true; -} -} \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/engine/Controller/BioGearsSubstances.cpp b/projects/biogears/libBiogears/src/engine/Controller/BioGearsSubstances.cpp index 02ae0acb0..66c957fab 100644 --- a/projects/biogears/libBiogears/src/engine/Controller/BioGearsSubstances.cpp +++ b/projects/biogears/libBiogears/src/engine/Controller/BioGearsSubstances.cpp @@ -18,6 +18,7 @@ specific language governing permissions and limitations under the License. #include #include #include +#include #include #include #include @@ -27,8 +28,6 @@ specific language governing permissions and limitations under the License. #include #include -namespace BGE = mil::tatrc::physiology::biogears; - namespace std { template class map; } @@ -74,9 +73,9 @@ BioGearsSubstances::~BioGearsSubstances() { } //------------------------------------------------------------------------------- -void BioGearsSubstances::Clear() +void BioGearsSubstances::Invalidate() { - SESubstanceManager::Clear(); + SESubstanceManager::Invalidate(); m_O2 = nullptr; m_CO = nullptr; m_CO2 = nullptr; @@ -142,7 +141,7 @@ void BioGearsSubstances::InitializeSubstances() AddActiveSubstance(*m_calcium); AddActiveSubstance(*m_chloride); AddActiveSubstance(*m_creatinine); - //AddActiveSubstance(*m_globulin);//We don't transport this + // AddActiveSubstance(*m_globulin);//We don't transport this AddActiveSubstance(*m_glucagon); AddActiveSubstance(*m_glucose); AddActiveSubstance(*m_insulin); @@ -214,7 +213,7 @@ void BioGearsSubstances::InitializeGasCompartments() Stomach->GetSubstanceQuantity(*m_O2)->GetVolumeFraction().SetValue(0.0); Stomach->Balance(BalanceGasBy::VolumeFraction); - //Initialize the compartments to Ambient values + // Initialize the compartments to Ambient values for (SEGasCompartment* cmpt : m_data.GetCompartments().GetAnesthesiaMachineLeafCompartments()) { if (cmpt->HasVolume()) { cmpt->GetSubstanceQuantity(*m_O2)->GetVolumeFraction().SetValue(AmbientO2VF); @@ -224,7 +223,7 @@ void BioGearsSubstances::InitializeGasCompartments() } } - //Initialize the compartments to Ambient values + // Initialize the compartments to Ambient values for (SEGasCompartment* cmpt : m_data.GetCompartments().GetNasalCannulaLeafCompartments()) { if (cmpt->HasVolume()) { if (cmpt->GetName() == BGE::NasalCannulaCompartment::Nosepiece) { @@ -259,7 +258,7 @@ void BioGearsSubstances::InitializeLiquidCompartmentGases() SEScalarAmountPerVolume phosphate; albuminConcentration.SetValue(45.0, MassPerVolumeUnit::g_Per_L); - hematocrit.SetValue(m_data.GetPatient().GetGender() == CDM::enumSex::Male ? 0.45 : 0.40); + hematocrit.SetValue(m_data.GetPatient().GetSex() == SESex::Male ? 0.45 : 0.40); bodyTemp.SetValue(37.0, TemperatureUnit::C); strongIonDifference.SetValue(40.5, AmountPerVolumeUnit::mmol_Per_L); phosphate.SetValue(1.1, AmountPerVolumeUnit::mmol_Per_L); @@ -277,7 +276,7 @@ void BioGearsSubstances::InitializeLiquidCompartmentGases() // For details please see @cite lodemann2010wrong double Hb_total_mM = Hb_total_g_Per_dL / m_Hb->GetMolarMass(MassPerAmountUnit::g_Per_mmol) * 10.0; - //These values were generated from steady state Standard Male run + // These values were generated from steady state Standard Male run InitializeBloodGases(*cmpts.GetLiquidCompartment(BGE::VascularCompartment::Aorta), Hb_total_mM, 0.979121, 0.13668, 0.0286758, 1.24913, 25.8409, 7.4157); InitializeBloodGases(*cmpts.GetLiquidCompartment(BGE::VascularCompartment::Bone), Hb_total_mM, 0.811429, 0.0586404, 0.119425, 1.38143, 26.0748, 7.37589); if (m_data.GetConfiguration().IsCerebralEnabled()) { @@ -331,7 +330,7 @@ void BioGearsSubstances::InitializeLiquidCompartmentGases() InitializeBloodGases(*cmpts.GetLiquidCompartment(BGE::VascularCompartment::Spleen), Hb_total_mM, 0.81215, 0.0587058, 0.115229, 1.37916, 26.071, 7.37654); InitializeBloodGases(*cmpts.GetLiquidCompartment(BGE::VascularCompartment::VenaCava), Hb_total_mM, 0.767376, 0.0534397, 0.15668, 1.40152, 26.1084, 7.37018); - //Tissues + // Tissues InitializeBloodGases(*cmpts.GetTissueCompartment(BGE::TissueCompartment::Bone), *cmpts.GetLiquidCompartment(BGE::VascularCompartment::Bone)); if (m_data.GetConfiguration().IsCerebralEnabled()) { InitializeBloodGases(*cmpts.GetTissueCompartment(BGE::TissueCompartment::Brain), *cmpts.GetLiquidCompartment(BGE::VascularCompartment::CerebralCapillaries)); @@ -374,13 +373,13 @@ void BioGearsSubstances::InitializeBloodGases(SELiquidCompartment& cmpt, double SELiquidSubstanceQuantity* HbO2CO2 = cmpt.GetSubstanceQuantity(*m_HbO2CO2); SELiquidSubstanceQuantity* HCO3 = cmpt.GetSubstanceQuantity(*m_HCO3); - //Assume no HbO2CO2 at first (O2sat + CO2sat < 100%) + // Assume no HbO2CO2 at first (O2sat + CO2sat < 100%) double HbUnbound_mM = Hb_total_mM * (1 - O2_sat - CO2_sat); if (std::abs(HbUnbound_mM) <= ZERO_APPROX) HbUnbound_mM = 0; - //If our assumption was wrong, that means there was HbO2CO2 contributing to sat values - //Any negative is due to HbO2CO2 + // If our assumption was wrong, that means there was HbO2CO2 contributing to sat values + // Any negative is due to HbO2CO2 if (HbUnbound_mM < 0) { double HbO2CO2_mM = -HbUnbound_mM; HbO2CO2->GetMolarity().SetValue(HbO2CO2_mM, AmountPerVolumeUnit::mmol_Per_L); @@ -390,7 +389,7 @@ void BioGearsSubstances::InitializeBloodGases(SELiquidCompartment& cmpt, double Hb->GetMolarity().SetValue(HbUnbound_mM, AmountPerVolumeUnit::mmol_Per_L); Hb->Balance(BalanceLiquidBy::Molarity); - //Now we know HbUnbound and HbO2CO2, and we can solve HbO2 and HbCO2 using saturation values + // Now we know HbUnbound and HbO2CO2, and we can solve HbO2 and HbCO2 using saturation values double HbO2_mM = O2_sat * Hb_total_mM - HbO2CO2_mM; double HbCO2_mM = CO2_sat * Hb_total_mM - HbO2CO2_mM; @@ -404,7 +403,7 @@ void BioGearsSubstances::InitializeBloodGases(SELiquidCompartment& cmpt, double HbCO2->GetMolarity().SetValue(HbCO2_mM, AmountPerVolumeUnit::mmol_Per_L); HbCO2->Balance(BalanceLiquidBy::Molarity); } - //If our assumption was right, we have excess Hb, and need to use the total Hb to solve + // If our assumption was right, we have excess Hb, and need to use the total Hb to solve else { double HbO2CO2_mM = (O2_sat * Hb_total_mM) - Hb_total_mM + HbUnbound_mM + (CO2_sat * Hb_total_mM); double HbO2_mM = O2_sat * Hb_total_mM - HbO2CO2_mM; @@ -529,10 +528,10 @@ void BioGearsSubstances::InitializeLiquidCompartmentNonGases() SELiquidCompartment* rightUreter = m_data.GetCompartments().GetLiquidCompartment(BGE::UrineCompartment::RightUreter); // Lower Tract // Note I don't modify the urethra, it's just a flow pipe, with no volume, hence, no substance quantities (NaN) - //SELiquidCompartment* urethra = m_data.GetCompartments().GetUrineCompartment("Urethra"); + // SELiquidCompartment* urethra = m_data.GetCompartments().GetUrineCompartment("Urethra"); SELiquidCompartment* bladder = m_data.GetCompartments().GetLiquidCompartment(BGE::UrineCompartment::Bladder); SELiquidCompartment* lymph = m_data.GetCompartments().GetLiquidCompartment(BGE::LymphCompartment::Lymph); - //Right now the lymph is not used, but code is in place and commented out in case we revisit + // Right now the lymph is not used, but code is in place and commented out in case we revisit SETissueCompartment* brain = m_data.GetCompartments().GetTissueCompartment(BGE::TissueCompartment::Brain); // ALBUMIN // @@ -556,9 +555,9 @@ void BioGearsSubstances::InitializeLiquidCompartmentNonGases() concentrationExtracellular.SetValue(1.0, MassPerVolumeUnit::mg_Per_dL); molarity1.SetValue(20.0 / (m_albumin->GetMolarMass(MassPerAmountUnit::g_Per_mmol)), AmountPerVolumeUnit::mmol_Per_L); molarity2.SetValue(0.0, AmountPerVolumeUnit::mmol_Per_L); - //SetSubstanceConcentration(*m_albumin, tissue, concentrationExtracellular, concentrationIntracellular); + // SetSubstanceConcentration(*m_albumin, tissue, concentrationExtracellular, concentrationIntracellular); SetSubstanceMolarity(*m_albumin, tissue, molarity1, molarity2); - //Lymph - should be same as extracellular + // Lymph - should be same as extracellular concentration.SetValue(2.0, MassPerVolumeUnit::g_Per_dL); lymph->GetSubstanceQuantity(*m_albumin)->GetConcentration().Set(concentration); lymph->GetSubstanceQuantity(*m_albumin)->Balance(BalanceLiquidBy::Concentration); @@ -569,7 +568,7 @@ void BioGearsSubstances::InitializeLiquidCompartmentNonGases() // Tissue molarity1.SetValue(concentration.GetValue(MassPerVolumeUnit::g_Per_L) / m_aminoAcids->GetMolarMass(MassPerAmountUnit::g_Per_mol), AmountPerVolumeUnit::mol_Per_L); SetSubstanceMolarity(*m_aminoAcids, tissue, molarity1, molarity1); - //Lymph + // Lymph lymph->GetSubstanceQuantity(*m_aminoAcids)->GetMolarity().Set(molarity1); lymph->GetSubstanceQuantity(*m_aminoAcids)->Balance(BalanceLiquidBy::Molarity); @@ -582,7 +581,7 @@ void BioGearsSubstances::InitializeLiquidCompartmentNonGases() molarity1.SetValue(2 * (1.2), AmountPerVolumeUnit::mmol_Per_L); molarity2.SetValue(0.0001, AmountPerVolumeUnit::mmol_Per_L); SetSubstanceMolarity(*m_calcium, tissue, molarity1, molarity2); - //Lymph + // Lymph lymph->GetSubstanceQuantity(*m_calcium)->GetMolarity().Set(molarity1); lymph->GetSubstanceQuantity(*m_calcium)->Balance(BalanceLiquidBy::Molarity); // Set Urine @@ -617,7 +616,7 @@ void BioGearsSubstances::InitializeLiquidCompartmentNonGases() molarity1.SetValue(102.0, AmountPerVolumeUnit::mmol_Per_L); molarity2.SetValue(4.5, AmountPerVolumeUnit::mmol_Per_L); SetSubstanceMolarity(*m_chloride, tissue, molarity1, molarity2); - //Lymph + // Lymph lymph->GetSubstanceQuantity(*m_chloride)->GetMolarity().Set(molarity1); lymph->GetSubstanceQuantity(*m_chloride)->Balance(BalanceLiquidBy::Molarity); // CREATININE // @@ -648,35 +647,35 @@ void BioGearsSubstances::InitializeLiquidCompartmentNonGases() subQ->GetConcentration().Set(concentration); subQ->Balance(BalanceLiquidBy::Concentration); // Tissue - //molarity1.SetValue(0.044, AmountPerVolumeUnit::mmol_Per_L); + // molarity1.SetValue(0.044, AmountPerVolumeUnit::mmol_Per_L); molarity1.SetValue(0.106, AmountPerVolumeUnit::mmol_Per_L); SetSubstanceMolarity(*m_creatinine, tissue, molarity1); - //Lymph + // Lymph lymph->GetSubstanceQuantity(*m_creatinine)->GetMolarity().Set(molarity1); lymph->GetSubstanceQuantity(*m_creatinine)->Balance(BalanceLiquidBy::Molarity); // EPINEPHRINE // // Initializing to artificial plasma concentration because BG plasma is not totally correct - //double hematocritGuess = 0.45; + // double hematocritGuess = 0.45; concentration.SetValue(0.034, MassPerVolumeUnit::ug_Per_L); SetSubstanceConcentration(*m_epi, vascular, concentration); // Tissue - molarity1.SetValue(1.8558e-7, AmountPerVolumeUnit::mmol_Per_L); //epinephrine: 183.2044 g/mol - //molarity1.SetValue(0, AmountPerVolumeUnit::mmol_Per_L); //epinephrine: 183.2044 g/mol + molarity1.SetValue(1.8558e-7, AmountPerVolumeUnit::mmol_Per_L); // epinephrine: 183.2044 g/mol + // molarity1.SetValue(0, AmountPerVolumeUnit::mmol_Per_L); //epinephrine: 183.2044 g/mol SetSubstanceMolarity(*m_epi, tissue, molarity1); - //Lymph + // Lymph lymph->GetSubstanceQuantity(*m_epi)->GetMolarity().Set(molarity1); lymph->GetSubstanceQuantity(*m_epi)->Balance(BalanceLiquidBy::Molarity); // GLUCAGON // - concentration.SetValue(0.079, MassPerVolumeUnit::ug_Per_L); //We want 70 pg/mL, but it dips in stabilization, so set it higher + concentration.SetValue(0.079, MassPerVolumeUnit::ug_Per_L); // We want 70 pg/mL, but it dips in stabilization, so set it higher SetSubstanceConcentration(*m_glucagon, vascular, concentration); // Tissue molarity1.SetValue(0.0, AmountPerVolumeUnit::mmol_Per_L); molarity2.SetValue(0.0, AmountPerVolumeUnit::mmol_Per_L); SetSubstanceMolarity(*m_glucagon, tissue, molarity1, molarity2); - //Lymph - //Don't set since none in tissue and it's too large to diffuse from bloodstream + // Lymph + // Don't set since none in tissue and it's too large to diffuse from bloodstream // GLUCOSE // concentration.SetValue(90, MassPerVolumeUnit::mg_Per_dL); @@ -700,7 +699,7 @@ void BioGearsSubstances::InitializeLiquidCompartmentNonGases() lymph->GetSubstanceQuantity(*m_glucose)->Balance(BalanceLiquidBy::Molarity); // INSULIN // - concentration.SetValue(0.85, MassPerVolumeUnit::ug_Per_L); //118.1 pmol/L is desired (.6859 ug/L), was .85 because of stabilization dip, but it seems okay now + concentration.SetValue(0.85, MassPerVolumeUnit::ug_Per_L); // 118.1 pmol/L is desired (.6859 ug/L), was .85 because of stabilization dip, but it seems okay now SetSubstanceConcentration(*m_insulin, vascular, concentration); // None in Urine leftBowmansCapsules->GetSubstanceQuantity(*m_insulin)->SetToZero(); @@ -714,7 +713,7 @@ void BioGearsSubstances::InitializeLiquidCompartmentNonGases() molarity1.SetValue(0.0, AmountPerVolumeUnit::mmol_Per_L); molarity2.SetValue(0.0, AmountPerVolumeUnit::mmol_Per_L); SetSubstanceMolarity(*m_insulin, tissue, molarity1, molarity2); - //Lymph--Don't set since there is none in tissue and it's too large to diffuse from bloodstream + // Lymph--Don't set since there is none in tissue and it's too large to diffuse from bloodstream // KETONES // concentration.SetValue(9.19, MassPerVolumeUnit::mg_Per_L); @@ -739,7 +738,7 @@ void BioGearsSubstances::InitializeLiquidCompartmentNonGases() // Tissue molarity1.SetValue(0.09, AmountPerVolumeUnit::mmol_Per_L); SetSubstanceMolarity(*m_ketones, tissue, molarity1); - //Lymph + // Lymph lymph->GetSubstanceQuantity(*m_ketones)->GetMolarity().Set(molarity1); lymph->GetSubstanceQuantity(*m_ketones)->Balance(BalanceLiquidBy::Molarity); @@ -747,7 +746,7 @@ void BioGearsSubstances::InitializeLiquidCompartmentNonGases() concentration.SetValue(80.0, MassPerVolumeUnit::mg_Per_L); molarity1.SetValue(concentration.GetValue(MassPerVolumeUnit::g_Per_L) / m_lactate->GetMolarMass(MassPerAmountUnit::g_Per_mol), AmountPerVolumeUnit::mol_Per_L); SetSubstanceConcentration(*m_lactate, vascular, concentration); - //set in tubules zero in urine + // set in tubules zero in urine concentration.SetValue(1.5, MassPerVolumeUnit::g_Per_L); subQ = leftTubules->GetSubstanceQuantity(*m_lactate); subQ->GetConcentration().Set(concentration); @@ -756,14 +755,14 @@ void BioGearsSubstances::InitializeLiquidCompartmentNonGases() subQ->GetConcentration().Set(concentration); subQ->Balance(BalanceLiquidBy::Concentration); bladder->GetSubstanceQuantity(*m_lactate)->SetToZero(); - //Clear Lactate out of the Ureter to initialize for Gluconeogenesis + // Clear Lactate out of the Ureter to initialize for Gluconeogenesis leftUreter->GetSubstanceQuantity(*m_lactate)->SetToZero(); rightUreter->GetSubstanceQuantity(*m_lactate)->SetToZero(); // Tissue SetSubstanceMolarity(*m_lactate, tissue, molarity1, molarity1); - //set muscle tissue lactate to higher value --> creates gradient from muscle to blood that causes lactate transfer to blood at same rate that - //lactate is produced basally in muscles and same rate that kidneys filter lactate. Net result is stable lactate blood concentration - double lactateGradient_mg_Per_L = 10.0; //Produces 7 mg/min lactate transport, equal to basal tissue production + // set muscle tissue lactate to higher value --> creates gradient from muscle to blood that causes lactate transfer to blood at same rate that + // lactate is produced basally in muscles and same rate that kidneys filter lactate. Net result is stable lactate blood concentration + double lactateGradient_mg_Per_L = 10.0; // Produces 7 mg/min lactate transport, equal to basal tissue production double lactateExtracellular_mg_Per_L = molarity1.GetValue(AmountPerVolumeUnit::mol_Per_L) * m_lactate->GetMolarMass(MassPerAmountUnit::g_Per_mol) * 1000. + lactateGradient_mg_Per_L; double lactateIntracellular_mg_Per_L = lactateExtracellular_mg_Per_L + lactateGradient_mg_Per_L; SELiquidSubstanceQuantity* muscleExtraLactate = m_data.GetCompartments().GetExtracellularFluid(*m_data.GetCompartments().GetTissueCompartment(BGE::TissueCompartment::Muscle)).GetSubstanceQuantity(*m_lactate); @@ -772,7 +771,7 @@ void BioGearsSubstances::InitializeLiquidCompartmentNonGases() muscleIntraLactate->GetConcentration().SetValue(lactateIntracellular_mg_Per_L, MassPerVolumeUnit::mg_Per_L); muscleExtraLactate->Balance(BalanceLiquidBy::Concentration); muscleIntraLactate->Balance(BalanceLiquidBy::Concentration); - //Lymph + // Lymph lymph->GetSubstanceQuantity(*m_lactate)->GetMolarity().Set(molarity1); lymph->GetSubstanceQuantity(*m_lactate)->Balance(BalanceLiquidBy::Molarity); @@ -805,7 +804,7 @@ void BioGearsSubstances::InitializeLiquidCompartmentNonGases() molarity1.SetValue(4.5, AmountPerVolumeUnit::mmol_Per_L); molarity2.SetValue(110, AmountPerVolumeUnit::mmol_Per_L); SetSubstanceMolarity(*m_potassium, tissue, molarity1, molarity2); - //Lymph + // Lymph lymph->GetSubstanceQuantity(*m_potassium)->GetMolarity().Set(molarity1); lymph->GetSubstanceQuantity(*m_potassium)->Balance(BalanceLiquidBy::Molarity); @@ -838,7 +837,7 @@ void BioGearsSubstances::InitializeLiquidCompartmentNonGases() molarity1.SetValue(145, AmountPerVolumeUnit::mmol_Per_L); molarity2.SetValue(15, AmountPerVolumeUnit::mmol_Per_L); SetSubstanceMolarity(*m_sodium, tissue, molarity1, molarity2); - //Lymph + // Lymph lymph->GetSubstanceQuantity(*m_sodium)->GetMolarity().Set(molarity1); lymph->GetSubstanceQuantity(*m_sodium)->Balance(BalanceLiquidBy::Molarity); @@ -856,7 +855,7 @@ void BioGearsSubstances::InitializeLiquidCompartmentNonGases() // Tissue molarity1.SetValue(concentration.GetValue(MassPerVolumeUnit::g_Per_L) / m_triacylglycerol->GetMolarMass(MassPerAmountUnit::g_Per_mol), AmountPerVolumeUnit::mol_Per_L); SetSubstanceMolarity(*m_triacylglycerol, tissue, molarity1, molarity1); - //Lymph + // Lymph lymph->GetSubstanceQuantity(*m_triacylglycerol)->GetMolarity().Set(molarity1); lymph->GetSubstanceQuantity(*m_triacylglycerol)->Balance(BalanceLiquidBy::Molarity); // TAG can't cross blood-brain barrier, so no TAG there @@ -896,41 +895,41 @@ void BioGearsSubstances::InitializeLiquidCompartmentNonGases() // Tissue molarity1.SetValue(4.8, AmountPerVolumeUnit::mmol_Per_L); SetSubstanceMolarity(*m_urea, tissue, molarity1); - //Lymph + // Lymph lymph->GetSubstanceQuantity(*m_urea)->GetMolarity().Set(molarity1); lymph->GetSubstanceQuantity(*m_urea)->Balance(BalanceLiquidBy::Molarity); - //BLOOD COMPONENTS// - //Initialize Blood Type - //RBC + // BLOOD COMPONENTS// + // Initialize Blood Type + // RBC double rbc_ct_per_uL = 5280000.0; double antigens_per_rbc = 2000000.0; - double rbc_concentration_g_Per_dL = 14.256; //Compounds spreadsheet + double rbc_concentration_g_Per_dL = 14.256; // Compounds spreadsheet concentration.SetValue(rbc_concentration_g_Per_dL, MassPerVolumeUnit::g_Per_dL); SetSubstanceConcentration(*m_RBC, vascular, concentration); SEScalarMassPerVolume A_concentration; SEScalarMassPerVolume B_concentration; - if (m_data.GetPatient().GetBloodType() == CDM::enumBloodType::A) { - A_concentration.SetValue(23.0, MassPerVolumeUnit::mg_Per_L); //Compounds spreadsheet + if (m_data.GetPatient().GetBloodType() == SEBloodType::A) { + A_concentration.SetValue(23.0, MassPerVolumeUnit::mg_Per_L); // Compounds spreadsheet B_concentration.SetValue(0.0, MassPerVolumeUnit::mg_Per_L); - } else if (m_data.GetPatient().GetBloodType() == CDM::enumBloodType::B) { + } else if (m_data.GetPatient().GetBloodType() == SEBloodType::B) { A_concentration.SetValue(0.0, MassPerVolumeUnit::mg_Per_L); B_concentration.SetValue(19.0, MassPerVolumeUnit::mg_Per_L); - } else if (m_data.GetPatient().GetBloodType() == CDM::enumBloodType::O) { + } else if (m_data.GetPatient().GetBloodType() == SEBloodType::O) { A_concentration.SetValue(0.0, MassPerVolumeUnit::mg_Per_L); B_concentration.SetValue(0.0, MassPerVolumeUnit::mg_Per_L); - } else if (m_data.GetPatient().GetBloodType() == CDM::enumBloodType::AB) { + } else if (m_data.GetPatient().GetBloodType() == SEBloodType::AB) { A_concentration.SetValue(11.5, MassPerVolumeUnit::mg_Per_L); B_concentration.SetValue(9.5, MassPerVolumeUnit::mg_Per_L); } SetSubstanceConcentration(*m_AntigenA, vascular, A_concentration); SetSubstanceConcentration(*m_AntigenB, vascular, B_concentration); - //WBC + // WBC molarity1.SetValue(7000.0, AmountPerVolumeUnit::ct_Per_uL); SetSubstanceMolarity(*m_WBC, vascular, molarity1); - //Platelets + // Platelets molarity1.SetValue(300000.0, AmountPerVolumeUnit::ct_Per_uL); SetSubstanceMolarity(*m_platelets, vascular, molarity1); } @@ -946,9 +945,9 @@ void BioGearsSubstances::InitializeLiquidCompartmentNonGases() //------------------------------------------------------------------------------- void BioGearsSubstances::SetLiquidCompartmentNonGasesForStarvation(double time_h) { - //This function copies InitializeLiquidCompartmentNonGases() in form and is called - //from Tissue::SetStarvationState() to configure blood and tissue concentrations during - //the Starvation condition (urine compartments are not currently considered) + // This function copies InitializeLiquidCompartmentNonGases() in form and is called + // from Tissue::SetStarvationState() to configure blood and tissue concentrations during + // the Starvation condition (urine compartments are not currently considered) const std::vector& vascular = m_data.GetCompartments().GetVascularLeafCompartments(); const std::vector& tissue = m_data.GetCompartments().GetTissueLeafCompartments(); @@ -961,7 +960,7 @@ void BioGearsSubstances::SetLiquidCompartmentNonGasesForStarvation(double time_h SETissueCompartment* brain = m_data.GetCompartments().GetTissueCompartment(BGE::TissueCompartment::Brain); // AMINOACIDS // - //Probably sholdn't be messed with; see elia1984mineral that says total protein stays ~constant + // Probably sholdn't be messed with; see elia1984mineral that says total protein stays ~constant /* concentration.SetValue(50.0, MassPerVolumeUnit::mg_Per_dL); SetSubstanceConcentration(*m_aminoAcids, vascular, concentration); @@ -971,7 +970,7 @@ void BioGearsSubstances::SetLiquidCompartmentNonGasesForStarvation(double time_h */ // GLUCAGON // - //Not modified since it will react to glucose quickly + // Not modified since it will react to glucose quickly /* concentration.SetValue(0.079, MassPerVolumeUnit::ug_Per_L); //We want 70 pg/mL, but it dips in stabilization, so set it higher SetSubstanceConcentration(*m_glucagon, vascular, concentration); @@ -998,7 +997,7 @@ void BioGearsSubstances::SetLiquidCompartmentNonGasesForStarvation(double time_h SetSubstanceMolarity(*m_glucose, tissue, molarity1, molarity1); // INSULIN // - //Not modified since it reacts to glucose quickly + // Not modified since it reacts to glucose quickly /* concentration.SetValue(0.85, MassPerVolumeUnit::ug_Per_L); //118.1 pmol/L is desired (.6859 ug/L), but it dips during stabilization, so start higher SetSubstanceConcentration(*m_insulin, vascular, concentration); @@ -1026,7 +1025,7 @@ void BioGearsSubstances::SetLiquidCompartmentNonGasesForStarvation(double time_h SetSubstanceMolarity(*m_ketones, tissue, molarity1, molarity1); // LACTATE // - //Modified to match engine state in order to provide adequate substrate for gluconeogenesis + // Modified to match engine state in order to provide adequate substrate for gluconeogenesis concentration.SetValue(32.5, MassPerVolumeUnit::mg_Per_dL); molarity1.SetValue(concentration.GetValue(MassPerVolumeUnit::g_Per_L) / m_lactate->GetMolarMass(MassPerAmountUnit::g_Per_mol), AmountPerVolumeUnit::mol_Per_L); @@ -1036,7 +1035,7 @@ void BioGearsSubstances::SetLiquidCompartmentNonGasesForStarvation(double time_h SetSubstanceMolarity(*m_lactate, tissue, molarity1, molarity1); // TRIACYLGLYCEROL // - //Not modified. \cite zauner2000resting shows it not changing much from basal levels, but since we don't model fatty acids, we'll see it rise over time. + // Not modified. \cite zauner2000resting shows it not changing much from basal levels, but since we don't model fatty acids, we'll see it rise over time. /* concentration.SetValue(75.0, MassPerVolumeUnit::mg_Per_dL); SetSubstanceConcentration(*m_triacylglycerol, vascular, concentration); @@ -1053,7 +1052,7 @@ void BioGearsSubstances::SetLiquidCompartmentNonGasesForStarvation(double time_h */ // IONS // - //Not modified, but \cite elia1984mineral has good data for Na, K, Ca, and Cl (they don't change much during 4 day starvation) + // Not modified, but \cite elia1984mineral has good data for Na, K, Ca, and Cl (they don't change much during 4 day starvation) } //------------------------------------------------------------------------------- bool BioGearsSubstances::LoadSubstanceDirectory() @@ -1061,23 +1060,23 @@ bool BioGearsSubstances::LoadSubstanceDirectory() if (!SESubstanceManager::LoadSubstanceDirectory()) return false; - m_O2 = GetSubstance("Oxygen"); - m_CO = GetSubstance("CarbonMonoxide"); - m_CO2 = GetSubstance("CarbonDioxide"); - m_N2 = GetSubstance("Nitrogen"); - m_Hb = GetSubstance("Hemoglobin"); - m_HbO2 = GetSubstance("Oxyhemoglobin"); - m_HbCO2 = GetSubstance("Carbaminohemoglobin"); - m_HbCO = GetSubstance("Carboxyhemoglobin"); - m_HbO2CO2 = GetSubstance("OxyCarbaminohemoglobin"); - m_HCO3 = GetSubstance("Bicarbonate"); - m_epi = GetSubstance("Epinephrine"); - - m_platelets = GetSubstance("Platelet"); - m_AntigenA = GetSubstance("Antigen_A"); - m_AntigenB = GetSubstance("Antigen_B"); - m_RBC = GetSubstance("RedBloodCell"); - m_WBC = GetSubstance("WhiteBloodCell"); + m_O2 = GetSubstance(StandardSubstances::Oxygen); + m_CO = GetSubstance(StandardSubstances::CarbonMonoxide); + m_CO2 = GetSubstance(StandardSubstances::CarbonDioxide); + m_N2 = GetSubstance(StandardSubstances::Nitrogen); + m_Hb = GetSubstance(StandardSubstances::Hemoglobin); + m_HbO2 = GetSubstance(StandardSubstances::Oxyhemoglobin); + m_HbCO2 = GetSubstance(StandardSubstances::Carbaminohemoglobin); + m_HbCO = GetSubstance(StandardSubstances::Carboxyhemoglobin); + m_HbO2CO2 = GetSubstance(StandardSubstances::OxyCarbaminohemoglobin); + m_HCO3 = GetSubstance(StandardSubstances::Bicarbonate); + m_epi = GetSubstance(StandardSubstances::Epinephrine); + + m_platelets = GetSubstance(StandardSubstances::Platelet); + m_AntigenA = GetSubstance(StandardSubstances::Antigen_A); + m_AntigenB = GetSubstance(StandardSubstances::Antigen_B); + m_RBC = GetSubstance(StandardSubstances::RedBloodCell); + m_WBC = GetSubstance(StandardSubstances::WhiteBloodCell); bool substancesAreMissing = false; if (m_O2 == nullptr) { @@ -1133,21 +1132,21 @@ bool BioGearsSubstances::LoadSubstanceDirectory() || m_HbCO2 == nullptr || m_HbCO == nullptr || m_HbO2CO2 == nullptr || m_epi == nullptr || m_HCO3 == nullptr) return false; - m_albumin = GetSubstance("Albumin"); - m_aminoAcids = GetSubstance("AminoAcids"); - m_calcium = GetSubstance("Calcium"); - m_chloride = GetSubstance("Chloride"); - m_creatinine = GetSubstance("Creatinine"); - m_globulin = GetSubstance("Globulin"); - m_glucagon = GetSubstance("Glucagon"); - m_glucose = GetSubstance("Glucose"); - m_insulin = GetSubstance("Insulin"); - m_ketones = GetSubstance("Ketones"); - m_lactate = GetSubstance("Lactate"); - m_potassium = GetSubstance("Potassium"); - m_sodium = GetSubstance("Sodium"); - m_triacylglycerol = GetSubstance("Triacylglycerol"); - m_urea = GetSubstance("Urea"); + m_albumin = GetSubstance(StandardSubstances::Albumin); + m_aminoAcids = GetSubstance(StandardSubstances::AminoAcids); + m_calcium = GetSubstance(StandardSubstances::Calcium); + m_chloride = GetSubstance(StandardSubstances::Chloride); + m_creatinine = GetSubstance(StandardSubstances::Creatinine); + m_globulin = GetSubstance(StandardSubstances::Globulin); + m_glucagon = GetSubstance(StandardSubstances::Glucagon); + m_glucose = GetSubstance(StandardSubstances::Glucose); + m_insulin = GetSubstance(StandardSubstances::Insulin); + m_ketones = GetSubstance(StandardSubstances::Ketones); + m_lactate = GetSubstance(StandardSubstances::Lactate); + m_potassium = GetSubstance(StandardSubstances::Potassium); + m_sodium = GetSubstance(StandardSubstances::Sodium); + m_triacylglycerol = GetSubstance(StandardSubstances::Triacylglycerol); + m_urea = GetSubstance(StandardSubstances::Urea); if (m_albumin == nullptr) { Error("Albumin Definition not found"); @@ -1222,7 +1221,7 @@ void BioGearsSubstances::AddActiveSubstance(SESubstance& substance) return; // If its already active, don't do anything SESubstanceManager::AddActiveSubstance(substance); - if (substance.GetState() == CDM::enumSubstanceState::Gas) + if (substance.GetState() == SESubstanceState::Gas) m_data.GetCompartments().AddGasCompartmentSubstance(substance); m_data.GetCompartments().AddLiquidCompartmentSubstance(substance); @@ -1233,9 +1232,36 @@ void BioGearsSubstances::AddActiveSubstance(SESubstance& substance) } } //------------------------------------------------------------------------------- +SESubstance* BioGearsSubstances::AddActiveSubstance(SESubstanceDefinition const& definition) +{ + if (IsActive(definition)) + return GetSubstance(definition.Name); // If its already active, don't do anything + + auto substance = SESubstanceManager::AddActiveSubstance(definition); + switch (definition.State) { + case SESubstanceState::Gas: + m_data.GetCompartments().AddGasCompartmentSubstance(*substance); + break; + case SESubstanceState::Liquid: + m_data.GetCompartments().AddLiquidCompartmentSubstance(*substance); + break; + default: + //TODO: SOlid and Molecular Substances Hopefully no more swollowing legos + break; + } + + if (definition == *m_CO) // We need to put HbCO in the system if CO is in the system + { + m_isCOActive = true; + AddActiveSubstance(*m_HbCO); + return m_CO; + } + return substance; +} +//------------------------------------------------------------------------------- bool BioGearsSubstances::IsActive(const SESubstance& sub) const { - if (&sub == m_CO) + if (sub == *m_CO) return m_isCOActive; return SESubstanceManager::IsActive(sub); } @@ -1253,13 +1279,13 @@ void BioGearsSubstances::CalculateGenericClearance(double volumeCleared_mL, SELi SELiquidSubstanceQuantity* subQ = cmpt.GetSubstanceQuantity(sub); if (subQ == nullptr) throw CommonDataModelException(std::string { "No Substance Quantity found for substance " } + sub.GetName()); - //GetMass and Concentration from the compartment + // GetMass and Concentration from the compartment double mass_ug = subQ->GetMass(MassUnit::ug); double concentration_ug_Per_mL = subQ->GetConcentration(MassPerVolumeUnit::ug_Per_mL); - //Calculate Mass Cleared + // Calculate Mass Cleared double MassCleared_ug = volumeCleared_mL * concentration_ug_Per_mL; - //Ensure mass does not become negative + // Ensure mass does not become negative mass_ug -= MassCleared_ug; if (mass_ug < 0) { mass_ug = 0; @@ -1293,7 +1319,7 @@ void BioGearsSubstances::CalculateGenericClearance(double VolumeCleared_mL, SETi SELiquidSubstanceQuantity* subQ = m_data.GetCompartments().GetIntracellularFluid(tissue).GetSubstanceQuantity(sub); if (subQ == nullptr) throw CommonDataModelException(std::string { "No Substance Quantity found for substance" } + sub.GetName()); - //GetMass and Concentration from the compartment + // GetMass and Concentration from the compartment double mass_ug = subQ->GetMass(MassUnit::ug); double concentration_ug_Per_mL; SEScalarMassPerVolume concentration; @@ -1304,9 +1330,9 @@ void BioGearsSubstances::CalculateGenericClearance(double VolumeCleared_mL, SETi concentration_ug_Per_mL = subQ->GetConcentration(MassPerVolumeUnit::ug_Per_mL); } - //Calculate Mass Cleared + // Calculate Mass Cleared double MassCleared_ug = VolumeCleared_mL * concentration_ug_Per_mL; - //Ensure mass does not become negative + // Ensure mass does not become negative mass_ug -= MassCleared_ug; if (mass_ug < 0) { mass_ug = 0; @@ -1342,7 +1368,7 @@ void BioGearsSubstances::CalculateGenericExcretion(double VascularFlow_mL_Per_s, concentration_ug_Per_mL = subQ->GetConcentration(MassPerVolumeUnit::ug_Per_mL); } - double MassExcreted_ug = VascularFlow_mL_Per_s * concentration_ug_Per_mL * timestep_s * 0.5 * FractionExcreted; //0.5 is the tuning parameter to remove the correct percentage. + double MassExcreted_ug = VascularFlow_mL_Per_s * concentration_ug_Per_mL * timestep_s * 0.5 * FractionExcreted; // 0.5 is the tuning parameter to remove the correct percentage. double mass_ug = subQ->GetMass().GetValue(MassUnit::ug); mass_ug = subQ->GetMass().GetValue(MassUnit::ug) - MassExcreted_ug; @@ -1565,7 +1591,7 @@ const SizeIndependentDepositionEfficencyCoefficient& BioGearsSubstances::GetSize double sumAlveoli = 0.; double aerodynamicDiameter; for (int j = 0; j < numPerRegion; j++) { - aerodynamicDiameter = concentrations.GetLength()[i] + stepSize * j; //Start at the bottom of the bin and march towards the top minus one step + aerodynamicDiameter = concentrations.GetLength()[i] + stepSize * j; // Start at the bottom of the bin and march towards the top minus one step if (aerodynamicDiameter == 0) continue; double inspirFrac = 1 - 0.5 * (1 - 1 / (1 + 0.00076 * std::pow(aerodynamicDiameter, 2.8))); diff --git a/projects/biogears/libBiogears/src/engine/Controller/Scenario/BioGearsScenario.cpp b/projects/biogears/libBiogears/src/engine/Controller/Scenario/BioGearsScenario.cpp index 3a1cb777c..7d82bc5d0 100644 --- a/projects/biogears/libBiogears/src/engine/Controller/Scenario/BioGearsScenario.cpp +++ b/projects/biogears/libBiogears/src/engine/Controller/Scenario/BioGearsScenario.cpp @@ -13,7 +13,7 @@ specific language governing permissions and limitations under the License. #include #include -namespace BGE = mil::tatrc::physiology::biogears; + namespace biogears { BioGearsScenario::BioGearsScenario(SESubstanceManager& subMgr) diff --git a/projects/biogears/libBiogears/src/engine/Controller/Scenario/BioGearsScenarioExec.cpp b/projects/biogears/libBiogears/src/engine/Controller/Scenario/BioGearsScenarioExec.cpp index 65103509a..70dbd729e 100644 --- a/projects/biogears/libBiogears/src/engine/Controller/Scenario/BioGearsScenarioExec.cpp +++ b/projects/biogears/libBiogears/src/engine/Controller/Scenario/BioGearsScenarioExec.cpp @@ -17,7 +17,8 @@ specific language governing permissions and limitations under the License. #include #include -namespace BGE = mil::tatrc::physiology::biogears; +#include "io/cdm/Scenario.h" + namespace biogears { BioGearsScenarioExec::BioGearsScenarioExec(PhysiologyEngine& engine) @@ -75,7 +76,12 @@ bool BioGearsScenarioExec::Execute(const std::string& scenarioFile, const std::s return false; } BioGearsScenario scenario(m_Engine.GetSubstanceManager()); - scenario.Load(*sceData); + io::Scenario::UnMarshall(*sceData, scenario); + try { + io::Scenario::UnMarshall(*sceData, scenario); + } catch (CommonDataModelException /* ex*/) { + return false; + } std::string rFile = resultsFile; bool success = SEScenarioExec::Execute(scenario, rFile, cExec); diff --git a/projects/biogears/libBiogears/src/engine/Controller/Scenario/BioGearsScenarioInitialParameters.cpp b/projects/biogears/libBiogears/src/engine/Controller/Scenario/BioGearsScenarioInitialParameters.cpp index da1340cd4..81b8140e5 100644 --- a/projects/biogears/libBiogears/src/engine/Controller/Scenario/BioGearsScenarioInitialParameters.cpp +++ b/projects/biogears/libBiogears/src/engine/Controller/Scenario/BioGearsScenarioInitialParameters.cpp @@ -16,7 +16,8 @@ specific language governing permissions and limitations under the License. #include #include -namespace BGE = mil::tatrc::physiology::biogears; +#include "io/biogears/BioGears.h" +#include "io/biogears/BioGearsConfiguration.h" namespace biogears { BioGearsScenarioInitialParameters::BioGearsScenarioInitialParameters(SESubstanceManager& subMgr) @@ -40,6 +41,6 @@ const BioGearsConfiguration* BioGearsScenarioInitialParameters::GetConfiguration } void BioGearsScenarioInitialParameters::SetConfiguration(const BioGearsConfiguration& config) { - CDM_COPY((&config), (&GetConfiguration())); + CDM_BIOGEARS_ENGINE_CONFIGURATION_COPY(BioGearsConfiguration, config, *dynamic_cast(m_Configuration)); } } \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/engine/Equipment/AnesthesiaMachine.cpp b/projects/biogears/libBiogears/src/engine/Equipment/AnesthesiaMachine.cpp index c1b67c501..2d7bc3603 100644 --- a/projects/biogears/libBiogears/src/engine/Equipment/AnesthesiaMachine.cpp +++ b/projects/biogears/libBiogears/src/engine/Equipment/AnesthesiaMachine.cpp @@ -12,8 +12,13 @@ specific language governing permissions and limitations under the License. #include +#include "io/biogears/BioGearsEquipment.h" +#include "io/cdm/Anesthesia.h" +#include "io/cdm/Property.h" + #include #include +#include #include #include #include @@ -24,10 +29,11 @@ specific language governing permissions and limitations under the License. #include #include #include +#include #include #include -namespace BGE = mil::tatrc::physiology::biogears; + namespace biogears { /* @@ -43,19 +49,24 @@ auto AnesthesiaMachine::make_unique(BioGears& bg) -> std::unique_ptrGetVolume().SetValue(0.1, VolumeUnit::L); m_nSelector->GetNextVolume().SetValue(0.1, VolumeUnit::L); - SetConnection(CDM::enumAnesthesiaMachineConnection::Off); + SetConnection(SEAnesthesiaMachineConnection::Off); GetInletFlow().SetValue(5.0, VolumePerTimeUnit::L_Per_min); GetRespiratoryRate().SetValue(12.0, FrequencyUnit::Per_min); GetPositiveEndExpiredPressure().SetValue(1.0, PressureUnit::cmH2O); GetInspiratoryExpiratoryRatio().SetValue(0.5); GetOxygenFraction().SetValue(0.5); - SetOxygenSource(CDM::enumAnesthesiaMachineOxygenSource::Wall); - SetPrimaryGas(CDM::enumAnesthesiaMachinePrimaryGas::Nitrogen); + SetOxygenSource(SEAnesthesiaMachineOxygenSource::Wall); + SetPrimaryGas(SEAnesthesiaMachinePrimaryGas::Nitrogen); GetVentilatorPressure().SetValue(12.0, PressureUnit::cmH2O); GetOxygenBottleOne().GetVolume().SetValue(660.0, VolumeUnit::L); GetOxygenBottleTwo().GetVolume().SetValue(660.0, VolumeUnit::L); GetReliefValvePressure().SetValue(100.0, PressureUnit::cmH2O); - m_inhaling = true; - m_inspirationTime.SetValue(0.0, TimeUnit::s); - m_O2InletVolumeFraction.SetValue(0.0); - m_totalBreathingCycleTime.SetValue(0.0, TimeUnit::s); - m_currentbreathingCycleTime.SetValue(0.0, TimeUnit::s); + m_Inhaling = true; + m_InspirationTime.SetValue(0.0, TimeUnit::s); + m_OxygenInletVolumeFraction.SetValue(0.0); + m_TotalBreathingCycleTime.SetValue(0.0, TimeUnit::s); + m_CurrentBreathingCycleTime.SetValue(0.0, TimeUnit::s); StateChange(); - //The combined respiratory/AM circuit must be brought to a steady state before it can be used. Otherwise, the first few patient breaths go to charging the ventilator compliance - //element, which negatively affects the lung volume. Run through five cycles to be safe. + // The combined respiratory/AM circuit must be brought to a steady state before it can be used. Otherwise, the first few patient breaths go to charging the ventilator compliance + // element, which negatively affects the lung volume. Run through five cycles to be safe. SEFluidCircuitCalculator AmCalculator(FlowComplianceUnit::L_Per_cmH2O, VolumePerTimeUnit::L_Per_s, FlowInertanceUnit::cmH2O_s2_Per_L, PressureUnit::cmH2O, VolumeUnit::L, FlowResistanceUnit::cmH2O_s_Per_L, GetLogger()); SEFluidCircuit& RespiratoryAnesthesiaCombined = m_data.GetCircuits().GetRespiratoryAndAnesthesiaMachineCircuit(); for (unsigned int loops = 0; loops < static_cast(60.0 / m_dt_s); loops++) { @@ -126,39 +137,11 @@ void AnesthesiaMachine::Initialize() AmCalculator.Process(RespiratoryAnesthesiaCombined, m_dt_s); AmCalculator.PostProcess(RespiratoryAnesthesiaCombined); } - //Restore cycle tracking parameters to their initial values - m_inhaling = true; - m_inspirationTime.SetValue(0.0, TimeUnit::s); - m_totalBreathingCycleTime.SetValue(0.0, TimeUnit::s); - m_currentbreathingCycleTime.SetValue(0.0, TimeUnit::s); -} - -bool AnesthesiaMachine::Load(const CDM::BioGearsAnesthesiaMachineData& in) -{ - if (!SEAnesthesiaMachine::Load(in)) - return false; - BioGearsSystem::LoadState(); - m_inhaling = in.Inhaling(); - m_currentbreathingCycleTime.Load(in.CurrentBreathingCycleTime()); - m_inspirationTime.Load(in.InspirationTime()); - m_O2InletVolumeFraction.Load(in.OxygenInletVolumeFraction()); - m_totalBreathingCycleTime.Load(in.TotalBreathingCycleTime()); - return true; -} -CDM::BioGearsAnesthesiaMachineData* AnesthesiaMachine::Unload() const -{ - CDM::BioGearsAnesthesiaMachineData* data = new CDM::BioGearsAnesthesiaMachineData(); - Unload(*data); - return data; -} -void AnesthesiaMachine::Unload(CDM::BioGearsAnesthesiaMachineData& data) const -{ - SEAnesthesiaMachine::Unload(data); - data.Inhaling(m_inhaling); - data.CurrentBreathingCycleTime(std::unique_ptr(m_currentbreathingCycleTime.Unload())); - data.InspirationTime(std::unique_ptr(m_inspirationTime.Unload())); - data.OxygenInletVolumeFraction(std::unique_ptr(m_O2InletVolumeFraction.Unload())); - data.TotalBreathingCycleTime(std::unique_ptr(m_totalBreathingCycleTime.Unload())); + // Restore cycle tracking parameters to their initial values + m_Inhaling = true; + m_InspirationTime.SetValue(0.0, TimeUnit::s); + m_TotalBreathingCycleTime.SetValue(0.0, TimeUnit::s); + m_CurrentBreathingCycleTime.SetValue(0.0, TimeUnit::s); } //-------------------------------------------------------------------------------------------------- @@ -211,9 +194,9 @@ void AnesthesiaMachine::SetUp() void AnesthesiaMachine::StateChange() { - if (HasLeftChamber() && GetLeftChamber().GetState() == CDM::enumOnOff::On && GetLeftChamber().HasSubstance()) + if (HasLeftChamber() && GetLeftChamber().GetState() == SEOnOff::On && GetLeftChamber().HasSubstance()) m_Substances.AddActiveSubstance(*m_LeftChamber->GetSubstance()); - if (HasRightChamber() && GetRightChamber().GetState() == CDM::enumOnOff::On && GetRightChamber().HasSubstance()) + if (HasRightChamber() && GetRightChamber().GetState() == SEOnOff::On && GetRightChamber().HasSubstance()) m_Substances.AddActiveSubstance(*m_RightChamber->GetSubstance()); } @@ -229,24 +212,24 @@ void AnesthesiaMachine::StateChange() /// If the enum is set to tube, then the machine is connected to the tube /// If the enum is set to off, the airway mode is set to free. //-------------------------------------------------------------------------------------------------- -void AnesthesiaMachine::SetConnection(CDM::enumAnesthesiaMachineConnection::value c) +void AnesthesiaMachine::SetConnection(SEAnesthesiaMachineConnection c) { if (m_Connection == c) return; // No Change // Update the BioGears airway mode when this changes SEAnesthesiaMachine::SetConnection(c); - if (c == CDM::enumAnesthesiaMachineConnection::Mask && m_data.GetIntubation() == CDM::enumOnOff::Off) { - m_data.SetAirwayMode(CDM::enumBioGearsAirwayMode::AnesthesiaMachine); + if (c == SEAnesthesiaMachineConnection::Mask && m_data.GetIntubation() == SEOnOff::Off) { + m_data.SetAirwayMode(SEBioGearsAirwayMode::AnesthesiaMachine); return; - } else if (c == CDM::enumAnesthesiaMachineConnection::Tube && m_data.GetIntubation() == CDM::enumOnOff::On) { - m_data.SetAirwayMode(CDM::enumBioGearsAirwayMode::AnesthesiaMachine); + } else if (c == SEAnesthesiaMachineConnection::Tube && m_data.GetIntubation() == SEOnOff::On) { + m_data.SetAirwayMode(SEBioGearsAirwayMode::AnesthesiaMachine); return; - } else if (c == CDM::enumAnesthesiaMachineConnection::Mask && m_data.GetIntubation() == CDM::enumOnOff::On) + } else if (c == SEAnesthesiaMachineConnection::Mask && m_data.GetIntubation() == SEOnOff::On) Error("Connection failed : Cannot apply anesthesia machine mask if patient is intubated."); - else if (c == CDM::enumAnesthesiaMachineConnection::Tube && m_data.GetIntubation() == CDM::enumOnOff::Off) + else if (c == SEAnesthesiaMachineConnection::Tube && m_data.GetIntubation() == SEOnOff::Off) Error("Connection failed : Cannot apply anesthesia machine to tube if patient is not intubated."); // Make sure we are active to make sure we go back to free - m_data.SetAirwayMode(CDM::enumBioGearsAirwayMode::Free); + m_data.SetAirwayMode(SEBioGearsAirwayMode::Free); } //-------------------------------------------------------------------------------------------------- @@ -260,7 +243,7 @@ void AnesthesiaMachine::SetConnection(CDM::enumAnesthesiaMachineConnection::valu void AnesthesiaMachine::InvalidateConnection() { // Set airway mode to free - m_data.SetAirwayMode(CDM::enumBioGearsAirwayMode::Free); + m_data.SetAirwayMode(SEBioGearsAirwayMode::Free); // THEN invalidate SEAnesthesiaMachine::InvalidateConnection(); } @@ -276,31 +259,31 @@ void AnesthesiaMachine::InvalidateConnection() void AnesthesiaMachine::SetConnection() { switch (m_data.GetAirwayMode()) { - case CDM::enumBioGearsAirwayMode::Free: - //Basically a full leak to ground + case SEBioGearsAirwayMode::Free: + // Basically a full leak to ground m_pAnesthesiaConnectionToEnvironment->GetNextResistance().SetValue(m_dSwitchClosedResistance_cmH2O_s_Per_L, FlowResistanceUnit::cmH2O_s_Per_L); break; - case CDM::enumBioGearsAirwayMode::AnesthesiaMachine: - if (m_Connection == CDM::enumAnesthesiaMachineConnection::Mask) { - if (m_data.GetIntubation() == CDM::enumOnOff::On) // Somebody intubated while we had the mask on + case SEBioGearsAirwayMode::AnesthesiaMachine: + if (m_Connection == SEAnesthesiaMachineConnection::Mask) { + if (m_data.GetIntubation() == SEOnOff::On) // Somebody intubated while we had the mask on { Info("Anesthesia Machine has been disconnected due to an intubation."); - m_data.SetAirwayMode(CDM::enumBioGearsAirwayMode::Free); + m_data.SetAirwayMode(SEBioGearsAirwayMode::Free); return; } - //Keep the baseline resistance to ground = an open switch - //Leaks handled later:L); - } else if (m_Connection == CDM::enumAnesthesiaMachineConnection::Tube) { - if (m_data.GetIntubation() == CDM::enumOnOff::Off) // Somebody removed intubated while we were connected to it + // Keep the baseline resistance to ground = an open switch + // Leaks handled later:L); + } else if (m_Connection == SEAnesthesiaMachineConnection::Tube) { + if (m_data.GetIntubation() == SEOnOff::Off) // Somebody removed intubated while we were connected to it { Info("Anesthesia Machine has been disconnected removal of intubation."); - m_data.SetAirwayMode(CDM::enumBioGearsAirwayMode::Free); + m_data.SetAirwayMode(SEBioGearsAirwayMode::Free); return; } - //Keep the baseline resistance to ground = an open switch - //Leaks handled later:L); + // Keep the baseline resistance to ground = an open switch + // Leaks handled later:L); } break; default: @@ -326,10 +309,10 @@ void AnesthesiaMachine::PreProcess() ProcessConfiguration(*m_data.GetActions().GetAnesthesiaMachineActions().GetConfiguration()); m_data.GetActions().GetAnesthesiaMachineActions().RemoveConfiguration(); } - //Do nothing if the machine is off and not initialized - if (GetConnection() == CDM::enumAnesthesiaMachineConnection::Off) { - m_inhaling = true; - m_currentbreathingCycleTime.SetValue(0.0, TimeUnit::s); + // Do nothing if the machine is off and not initialized + if (GetConnection() == SEAnesthesiaMachineConnection::Off) { + m_Inhaling = true; + m_CurrentBreathingCycleTime.SetValue(0.0, TimeUnit::s); return; } @@ -353,7 +336,7 @@ void AnesthesiaMachine::PreProcess() //-------------------------------------------------------------------------------------------------- void AnesthesiaMachine::Process() { - if (GetConnection() != CDM::enumAnesthesiaMachineConnection::Off) { + if (GetConnection() != SEAnesthesiaMachineConnection::Off) { CalculateScrubber(); } } @@ -418,12 +401,12 @@ void AnesthesiaMachine::CalculateGasSource() double dInletflow = GetInletFlow().GetValue(VolumePerTimeUnit::L_Per_min); m_pGasSourceToGasInlet->GetNextFlowSource().SetValue(dInletflow, VolumePerTimeUnit::L_Per_min); - //For Exhaust to balance volume properly + // For Exhaust to balance volume properly m_pSelectorToEnvironment->GetNextFlowSource().SetValue(dInletflow, VolumePerTimeUnit::L_Per_min); double LeftInhaledAgentVolumeFraction = 0.0; double RightInhaledAgentVolumeFraction = 0.0; - //Vaporizer Failure + // Vaporizer Failure double VaporizerFailureSeverity = 0.0; if (m_data.GetActions().GetAnesthesiaMachineActions().HasVaporizerFailure()) { @@ -431,13 +414,13 @@ void AnesthesiaMachine::CalculateGasSource() } // Substances are vaporized in the left and right chambers - if (GetLeftChamber().GetState() == CDM::enumOnOff::On && GetLeftChamber().HasSubstance()) { + if (GetLeftChamber().GetState() == SEOnOff::On && GetLeftChamber().HasSubstance()) { SEGasSubstanceQuantity* gasSrcSubQ = m_gasSource->GetSubstanceQuantity(*GetLeftChamber().GetSubstance()); LeftInhaledAgentVolumeFraction = GetLeftChamber().GetSubstanceFraction().GetValue(); LeftInhaledAgentVolumeFraction = LeftInhaledAgentVolumeFraction * (1 - VaporizerFailureSeverity); gasSrcSubQ->GetVolumeFraction().SetValue(LeftInhaledAgentVolumeFraction); } - if (GetRightChamber().GetState() == CDM::enumOnOff::On && GetRightChamber().HasSubstance()) { + if (GetRightChamber().GetState() == SEOnOff::On && GetRightChamber().HasSubstance()) { SEGasSubstanceQuantity* gasSrcSubQ = m_gasSource->GetSubstanceQuantity(*GetRightChamber().GetSubstance()); RightInhaledAgentVolumeFraction = GetRightChamber().GetSubstanceFraction().GetValue(); RightInhaledAgentVolumeFraction = RightInhaledAgentVolumeFraction * (1 - VaporizerFailureSeverity); @@ -455,34 +438,34 @@ void AnesthesiaMachine::CalculateGasSource() Warning(ss.str()); } - //Check the O2 Source - //Note: You're only allowed to use one at a time - if (GetOxygenSource() == CDM::enumAnesthesiaMachineOxygenSource::Wall) { + // Check the O2 Source + // Note: You're only allowed to use one at a time + if (GetOxygenSource() == SEAnesthesiaMachineOxygenSource::Wall) { if (m_actions->HasOxygenWallPortPressureLoss()) { AM_O2Fraction = 0.0; /// \todo put these messages into a verbose for debugging - //Info("Wall port pressure loss."); + // Info("Wall port pressure loss."); } - } else if (GetOxygenSource() == CDM::enumAnesthesiaMachineOxygenSource::BottleOne || GetOxygenSource() == CDM::enumAnesthesiaMachineOxygenSource::BottleTwo) { + } else if (GetOxygenSource() == SEAnesthesiaMachineOxygenSource::BottleOne || GetOxygenSource() == SEAnesthesiaMachineOxygenSource::BottleTwo) { if (m_actions->HasOxygenTankPressureLoss()) { AM_O2Fraction = 0.0; - //Info("Oxygen tank pressure loss."); + // Info("Oxygen tank pressure loss."); } } - //Check if the inlet bottle is empty - if (GetOxygenSource() == CDM::enumAnesthesiaMachineOxygenSource::BottleOne) { + // Check if the inlet bottle is empty + if (GetOxygenSource() == SEAnesthesiaMachineOxygenSource::BottleOne) { if (GetOxygenBottleOne().GetVolume().GetValue(VolumeUnit::L) <= 0.0) { AM_O2Fraction = 0.0; - //Info("Oxygen bottle 1 empty"); + // Info("Oxygen bottle 1 empty"); } - } else if (GetOxygenSource() == CDM::enumAnesthesiaMachineOxygenSource::BottleTwo) { + } else if (GetOxygenSource() == SEAnesthesiaMachineOxygenSource::BottleTwo) { if (GetOxygenBottleTwo().GetVolume().GetValue(VolumeUnit::L) <= 0.0) { AM_O2Fraction = 0.0; - //Info("Oxygen bottle 2 empty"); + // Info("Oxygen bottle 2 empty"); } } - m_O2InletVolumeFraction.SetValue(AM_O2Fraction); + m_OxygenInletVolumeFraction.SetValue(AM_O2Fraction); // If there is any fraction left over, then it will be filled in with nitrogen or ambient air double RemainingVolumeFraction = 1.0 - (AM_O2Fraction + LeftInhaledAgentVolumeFraction + RightInhaledAgentVolumeFraction); @@ -491,7 +474,7 @@ void AnesthesiaMachine::CalculateGasSource() double dCO2VolumeFraction = 0.0; double dN2VolumeFraction = 0.0; - if (GetPrimaryGas() == CDM::enumAnesthesiaMachinePrimaryGas::Air) { + if (GetPrimaryGas() == SEAnesthesiaMachinePrimaryGas::Air) { /// \todo loop over all ambient substances and set each volume fraction // For now we set O2, CO2, and N2 in the anesthesia machine dO2VolumeFraction = RemainingVolumeFraction * m_ambientO2->GetVolumeFraction().GetValue(); @@ -529,24 +512,24 @@ void AnesthesiaMachine::CalculateSourceStatus() dFlow_LPerS = m_pGasSourceToGasInlet->GetFlow(VolumePerTimeUnit::L_Per_s); } - if (GetOxygenSource() == CDM::enumAnesthesiaMachineOxygenSource::BottleOne) { + if (GetOxygenSource() == SEAnesthesiaMachineOxygenSource::BottleOne) { double dBottle1Volume_L = GetOxygenBottleOne().GetVolume().GetValue(VolumeUnit::L); if (dBottle1Volume_L > 0.0) { - dBottle1Volume_L -= m_dt_s * dFlow_LPerS * m_O2InletVolumeFraction.GetValue(); - } else if (dBottle1Volume_L <= 0.0) //Empty + dBottle1Volume_L -= m_dt_s * dFlow_LPerS * m_OxygenInletVolumeFraction.GetValue(); + } else if (dBottle1Volume_L <= 0.0) // Empty { /// \event %AnesthesiaMachine: Oxygen bottle 1 is exhausted. There is no longer any oxygen to provide via the anesthesia machine. - SetEvent(CDM::enumAnesthesiaMachineEvent::OxygenBottle1Exhausted, true, m_data.GetSimulationTime()); + SetEvent(SEAnesthesiaMachineEvent::OxygenBottle1Exhausted, true, m_data.GetSimulationTime()); dBottle1Volume_L = 0.0; } GetOxygenBottleOne().GetVolume().SetValue(dBottle1Volume_L, VolumeUnit::L); - } else if (GetOxygenSource() == CDM::enumAnesthesiaMachineOxygenSource::BottleTwo) { + } else if (GetOxygenSource() == SEAnesthesiaMachineOxygenSource::BottleTwo) { double dBottle2Volume_L = GetOxygenBottleTwo().GetVolume().GetValue(VolumeUnit::L); if (dBottle2Volume_L > 0.0) { - dBottle2Volume_L -= m_dt_s * dFlow_LPerS * m_O2InletVolumeFraction.GetValue(); + dBottle2Volume_L -= m_dt_s * dFlow_LPerS * m_OxygenInletVolumeFraction.GetValue(); } else if (dBottle2Volume_L <= 0.0) { /// \event %AnesthesiaMachine: Oxygen bottle 2 is exhausted. There is no longer any oxygen to provide via the anesthesia machine. - SetEvent(CDM::enumAnesthesiaMachineEvent::OxygenBottle2Exhausted, true, m_data.GetSimulationTime()); + SetEvent(SEAnesthesiaMachineEvent::OxygenBottle2Exhausted, true, m_data.GetSimulationTime()); dBottle2Volume_L = 0.0; } GetOxygenBottleTwo().GetVolume().SetValue(dBottle2Volume_L, VolumeUnit::L); @@ -565,12 +548,12 @@ void AnesthesiaMachine::CalculateSourceStatus() //-------------------------------------------------------------------------------------------------- void AnesthesiaMachine::CalculateEquipmentLeak() { - //Note: You should be able to stack failures, if you're so inclined + // Note: You should be able to stack failures, if you're so inclined - if (m_data.GetAirwayMode() == CDM::enumBioGearsAirwayMode::Free) { + if (m_data.GetAirwayMode() == SEBioGearsAirwayMode::Free) { return; - } else if (m_data.GetAirwayMode() == CDM::enumBioGearsAirwayMode::AnesthesiaMachine) { - if (m_Connection == CDM::enumAnesthesiaMachineConnection::Tube) { + } else if (m_data.GetAirwayMode() == SEBioGearsAirwayMode::AnesthesiaMachine) { + if (m_Connection == SEAnesthesiaMachineConnection::Tube) { if (m_actions->HasTubeCuffLeak() || m_actions->HasYPieceDisconnect()) { double CuffLeakSeverity = 0.0; double YPieceDisconnectSeverity = 0.0; @@ -583,7 +566,7 @@ void AnesthesiaMachine::CalculateEquipmentLeak() YPieceDisconnectSeverity = m_actions->GetYPieceDisconnect()->GetSeverity().GetValue(); } - //Combine the severities + // Combine the severities TotalSeverity = CuffLeakSeverity + YPieceDisconnectSeverity; if (TotalSeverity > 1.0) { TotalSeverity = 1.0; @@ -592,7 +575,7 @@ void AnesthesiaMachine::CalculateEquipmentLeak() double dResistance = GeneralMath::ResistanceFunction(10.0, m_dValveClosedResistance_cmH2O_s_Per_L, m_dValveOpenResistance_cmH2O_s_Per_L, TotalSeverity); m_pAnesthesiaConnectionToEnvironment->GetNextResistance().SetValue(dResistance, FlowResistanceUnit::cmH2O_s_Per_L); } - } else if (m_Connection == CDM::enumAnesthesiaMachineConnection::Mask) { + } else if (m_Connection == SEAnesthesiaMachineConnection::Mask) { if (m_actions->HasMaskLeak() || m_actions->HasYPieceDisconnect()) { double MaskLeakSeverity = 0.0; double YPieceDisconnectSeverity = 0.0; @@ -605,7 +588,7 @@ void AnesthesiaMachine::CalculateEquipmentLeak() YPieceDisconnectSeverity = m_actions->GetYPieceDisconnect()->GetSeverity().GetValue(); } - //Combine the severities + // Combine the severities TotalSeverity = MaskLeakSeverity + YPieceDisconnectSeverity; if (TotalSeverity > 1.0) { TotalSeverity = 1.0; @@ -632,13 +615,13 @@ void AnesthesiaMachine::CalculateEquipmentLeak() //-------------------------------------------------------------------------------------------------- void AnesthesiaMachine::CalculateValveResistances() { - //Assume there's no leak or obstruction + // Assume there's no leak or obstruction double dInspValveOpenResistance = m_dValveOpenResistance_cmH2O_s_Per_L; double dInspValveClosedResistance = m_pInspiratoryLimbToYPiece->GetNextResistance(FlowResistanceUnit::cmH2O_s_Per_L); double dExpValveOpenResistance = m_dValveOpenResistance_cmH2O_s_Per_L; double dExpValveClosedResistance = m_pYPieceToExpiratoryLimb->GetNextResistance(FlowResistanceUnit::cmH2O_s_Per_L); - //Handle leaks and obstructions + // Handle leaks and obstructions if (m_actions->HasInspiratoryValveLeak()) { double severity = m_actions->GetInspiratoryValveLeak()->GetSeverity().GetValue(); dInspValveOpenResistance = GeneralMath::ResistanceFunction(10.0, dInspValveClosedResistance, dInspValveOpenResistance, severity); @@ -655,8 +638,8 @@ void AnesthesiaMachine::CalculateValveResistances() dExpValveClosedResistance = GeneralMath::ResistanceFunction(10.0, dExpValveOpenResistance, dExpValveClosedResistance, severity); } - //Set the value based on where we are in the cycle - if (m_inhaling) { + // Set the value based on where we are in the cycle + if (m_Inhaling) { m_pInspiratoryLimbToYPiece->GetNextResistance().SetValue(dInspValveClosedResistance, FlowResistanceUnit::cmH2O_s_Per_L); m_pYPieceToExpiratoryLimb->GetNextResistance().SetValue(dExpValveOpenResistance, FlowResistanceUnit::cmH2O_s_Per_L); } else { @@ -678,9 +661,9 @@ void AnesthesiaMachine::CalculateValveResistances() //-------------------------------------------------------------------------------------------------- void AnesthesiaMachine::CalculateVentilator() { - //Calculate the driver pressure + // Calculate the driver pressure double dDriverPressure = 1033.23; - if (m_inhaling) { + if (m_Inhaling) { dDriverPressure = GetVentilatorPressure(PressureUnit::cmH2O); } else { dDriverPressure = GetPositiveEndExpiredPressure(PressureUnit::cmH2O); @@ -703,30 +686,29 @@ void AnesthesiaMachine::CalculateVentilator() //-------------------------------------------------------------------------------------------------- void AnesthesiaMachine::CalculateCyclePhase() { - //Determine where we are in the cycle - m_currentbreathingCycleTime.IncrementValue(m_dt_s, TimeUnit::s); - if (m_currentbreathingCycleTime.GetValue(TimeUnit::s) > m_totalBreathingCycleTime.GetValue(TimeUnit::s)) //End of the cycle + // Determine where we are in the cycle + m_CurrentBreathingCycleTime.IncrementValue(m_dt_s, TimeUnit::s); + if (m_CurrentBreathingCycleTime.GetValue(TimeUnit::s) > m_TotalBreathingCycleTime.GetValue(TimeUnit::s)) // End of the cycle { - m_totalBreathingCycleTime.SetValue(0.0, TimeUnit::s); - m_currentbreathingCycleTime.SetValue(0.0, TimeUnit::s); + m_TotalBreathingCycleTime.SetValue(0.0, TimeUnit::s); + m_CurrentBreathingCycleTime.SetValue(0.0, TimeUnit::s); double dVentilationFrequency_PerMin = GetRespiratoryRate(FrequencyUnit::Per_min); if (dVentilationFrequency_PerMin > 0) { - m_totalBreathingCycleTime.SetValue(60.0 / dVentilationFrequency_PerMin, TimeUnit::s); //Total time of one breathing cycle + m_TotalBreathingCycleTime.SetValue(60.0 / dVentilationFrequency_PerMin, TimeUnit::s); // Total time of one breathing cycle } double IERatio = GetInspiratoryExpiratoryRatio().GetValue(); - m_inspirationTime.SetValue(IERatio * m_totalBreathingCycleTime.GetValue(TimeUnit::s) / (1.0 + IERatio), TimeUnit::s); + m_InspirationTime.SetValue(IERatio * m_TotalBreathingCycleTime.GetValue(TimeUnit::s) / (1.0 + IERatio), TimeUnit::s); } - if (m_currentbreathingCycleTime.GetValue(TimeUnit::s) < m_inspirationTime.GetValue(TimeUnit::s)) //Inspiration + if (m_CurrentBreathingCycleTime.GetValue(TimeUnit::s) < m_InspirationTime.GetValue(TimeUnit::s)) // Inspiration { - m_inhaling = true; - } else //Expiration + m_Inhaling = true; + } else // Expiration { - m_inhaling = false; + m_Inhaling = false; } - } //-------------------------------------------------------------------------------------------------- @@ -739,19 +721,19 @@ void AnesthesiaMachine::CalculateCyclePhase() //-------------------------------------------------------------------------------------------------- void AnesthesiaMachine::CheckReliefValve() { - //Set the Pressure Source based on the setting + // Set the Pressure Source based on the setting double dValvePressure_cmH2O = GetReliefValvePressure(PressureUnit::cmH2O); m_pEnvironmentToReliefValve->GetNextPressureSource().SetValue(dValvePressure_cmH2O, PressureUnit::cmH2O); - //Check to see if it reached the pressure threshold - if (!IsEventActive(CDM::enumAnesthesiaMachineEvent::ReliefValveActive) && m_pSelectorToReliefValve->GetNextValve() == CDM::enumOpenClosed::Closed) { + // Check to see if it reached the pressure threshold + if (!IsEventActive(SEAnesthesiaMachineEvent::ReliefValveActive) && m_pSelectorToReliefValve->GetNextValve() == SEOpenClosed::Closed) { /// \event %AnesthesiaMachine: Relief Valve is active. The pressure setting has been exceeded. - SetEvent(CDM::enumAnesthesiaMachineEvent::ReliefValveActive, true, m_data.GetSimulationTime()); - } else if (IsEventActive(CDM::enumAnesthesiaMachineEvent::ReliefValveActive) && m_pSelectorToReliefValve->GetNextValve() == CDM::enumOpenClosed::Open) { - SetEvent(CDM::enumAnesthesiaMachineEvent::ReliefValveActive, false, m_data.GetSimulationTime()); + SetEvent(SEAnesthesiaMachineEvent::ReliefValveActive, true, m_data.GetSimulationTime()); + } else if (IsEventActive(SEAnesthesiaMachineEvent::ReliefValveActive) && m_pSelectorToReliefValve->GetNextValve() == SEOpenClosed::Open) { + SetEvent(SEAnesthesiaMachineEvent::ReliefValveActive, false, m_data.GetSimulationTime()); } - //Always try to let it run without the relief valve operational (i.e. closed (i.e. allowing flow)), otherwise it will always stay shorted - m_pSelectorToReliefValve->SetNextValve(CDM::enumOpenClosed::Open); + // Always try to let it run without the relief valve operational (i.e. closed (i.e. allowing flow)), otherwise it will always stay shorted + m_pSelectorToReliefValve->SetNextValve(SEOpenClosed::Open); } } \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/engine/Equipment/ECG.cpp b/projects/biogears/libBiogears/src/engine/Equipment/ECG.cpp index 93735746f..e6beb71aa 100644 --- a/projects/biogears/libBiogears/src/engine/Equipment/ECG.cpp +++ b/projects/biogears/libBiogears/src/engine/Equipment/ECG.cpp @@ -11,16 +11,19 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include -#include -#include -#include +#include "io/cdm/ElectroCardioGram.h" +#include "io/cdm/Property.h" +#include + #include +#include #include #include +#include +#include -#include #include -namespace BGE = mil::tatrc::physiology::biogears; +#include namespace biogears { /* @@ -39,20 +42,20 @@ ECG::ECG(BioGears& bg) , m_data(bg) , m_Waveforms(bg.GetLogger()) { - Clear(); + Invalidate(); } ECG::~ECG() { - Clear(); + Invalidate(); } //-------------------------------------------------------------------------------------------------- /// \brief Cleans up any memory this class is responsible for //-------------------------------------------------------------------------------------------------- -void ECG::Clear() +void ECG::Invalidate() { - SEElectroCardioGram::Clear(); + SEElectroCardioGram::Invalidate(); } //-------------------------------------------------------------------------------------------------- @@ -72,20 +75,22 @@ void ECG::Initialize() m_HeartRhythmTime.SetValue(0, TimeUnit::s); m_HeartRhythmPeriod.SetValue(0, TimeUnit::s); - CDM_COPY(m_data.GetConfiguration().GetECGInterpolator(), (&m_Waveforms)); + + CDM_ELECTRO_CARDIOGRAM_COPY(ElectroCardioGramInterpolator, *m_data.GetConfiguration().GetECGInterpolator(), m_Waveforms) + // You can uncomment this code to compare the original waveform to the interpolated waveform and make sure you are capturing the data properly - /* Code to write out the ECG data in a format easy to view in plotting tools - std::vector original_s = m_Waveforms.GetWaveform(3, CDM::enumHeartRhythm::NormalSinus).GetData().GetTime(); - std::vector original_mV = m_Waveforms.GetWaveform(3, CDM::enumHeartRhythm::NormalSinus).GetData().GetElectricPotential(); - DataTrack Original; + /* Code to write out the ECG data in a format easy to view in plotting tools + std::vector original_s = m_Waveforms.GetWaveform(3, SEHeartRhythm::NormalSinus).GetData().GetTime(); + std::vector original_mV = m_Waveforms.GetWaveform(3, SEHeartRhythm::NormalSinus).GetData().GetElectricPotential(); + DataTrack Original; for (size_t i = 0; i < original_s.size(); i++) Original.Track("Original_ECG",original_s[i], original_mV[i]); Original.WriteTrackToFile("OriginalECG.csv"); */ m_Waveforms.Interpolate(m_data.GetTimeStep()); /* Code to write out the Interpolated ECG data in a format easy to view in plotting tools - std::vector interpolated_s = m_Waveforms.GetWaveform(3, CDM::enumHeartRhythm::NormalSinus).GetData().GetTime(); - std::vector interpolated_mV = m_Waveforms.GetWaveform(3, CDM::enumHeartRhythm::NormalSinus).GetData().GetElectricPotential(); + std::vector interpolated_s = m_Waveforms.GetWaveform(3, SEHeartRhythm::NormalSinus).GetData().GetTime(); + std::vector interpolated_mV = m_Waveforms.GetWaveform(3, SEHeartRhythm::NormalSinus).GetData().GetElectricPotential(); DataTrack Interpolated; for (size_t i = 0; i < interpolated_s.size(); i++) Interpolated.Track("Interpolated_ECG", interpolated_s[i], interpolated_mV[i]); @@ -94,30 +99,6 @@ void ECG::Initialize() m_Waveforms.SetLeadElectricPotential(3, GetLead3ElectricPotential()); } -bool ECG::Load(const CDM::BioGearsElectroCardioGramData& in) -{ - if (!SEElectroCardioGram::Load(in)) - return false; - BioGearsSystem::LoadState(); - m_HeartRhythmTime.Load(in.HeartRythmTime()); - m_HeartRhythmPeriod.Load(in.HeartRythmPeriod()); - m_Waveforms.Load(in.Waveforms()); - m_Waveforms.SetLeadElectricPotential(3, GetLead3ElectricPotential()); - return true; -} -CDM::BioGearsElectroCardioGramData* ECG::Unload() const -{ - CDM::BioGearsElectroCardioGramData* data = new CDM::BioGearsElectroCardioGramData(); - Unload(*data); - return data; -} -void ECG::Unload(CDM::BioGearsElectroCardioGramData& data) const -{ - SEElectroCardioGram::Unload(data); - data.HeartRythmTime(std::unique_ptr(m_HeartRhythmTime.Unload())); - data.HeartRythmPeriod(std::unique_ptr(m_HeartRhythmPeriod.Unload())); - data.Waveforms(std::unique_ptr(m_Waveforms.Unload())); -} void ECG::SetUp() { @@ -158,8 +139,8 @@ void ECG::Process() m_HeartRhythmPeriod.SetValue(1 / m_data.GetCardiovascular().GetHeartRate(FrequencyUnit::Per_s), TimeUnit::s); // Currently we have one data set for all currently supported Heart Rhythms // Eventually we will support multiple rhythmic data - if (m_data.GetCardiovascular().GetHeartRhythm() == CDM::enumHeartRhythm::NormalSinus) - m_Waveforms.StartNewCycle(CDM::enumHeartRhythm::NormalSinus); + if (m_data.GetCardiovascular().GetHeartRhythm() == SEHeartRhythm::NormalSinus) + m_Waveforms.StartNewCycle(SEHeartRhythm::NormalSinus); else { m_ss << m_data.GetCardiovascular().GetHeartRhythm() << " is not a supported Heart Rhythm for ECG"; Error(m_ss); diff --git a/projects/biogears/libBiogears/src/engine/Equipment/Inhaler.cpp b/projects/biogears/libBiogears/src/engine/Equipment/Inhaler.cpp index 91339092c..5b6357b9f 100644 --- a/projects/biogears/libBiogears/src/engine/Equipment/Inhaler.cpp +++ b/projects/biogears/libBiogears/src/engine/Equipment/Inhaler.cpp @@ -22,9 +22,10 @@ specific language governing permissions and limitations under the License. #include #include -#include #include -namespace BGE = mil::tatrc::physiology::biogears; +#include + +#include "io/cdm/Inhaler.h" namespace biogears { /* @@ -32,33 +33,31 @@ namespace biogears { Constructors ======================== */ - auto Inhaler::make_unique(BioGears& bg) -> std::unique_ptr { return std::unique_ptr(new Inhaler(bg)); } - +//-------------------------------------------------------------------------------------------------- Inhaler::Inhaler(BioGears& bg) : SEInhaler(bg.GetSubstances()) , m_data(bg) { - Clear(); + Invalidate(); } - +//-------------------------------------------------------------------------------------------------- Inhaler::~Inhaler() { - Clear(); + Invalidate(); } - -void Inhaler::Clear() +//-------------------------------------------------------------------------------------------------- +void Inhaler::Invalidate() { - SEInhaler::Clear(); + SEInhaler::Invalidate(); m_Mouthpiece = nullptr; m_AerosolMouthpiece = nullptr; m_AmbientEnv = nullptr; m_InhalerDrug = nullptr; } - //-------------------------------------------------------------------------------------------------- /// \brief /// Initializes system properties to valid homeostatic values. @@ -69,24 +68,6 @@ void Inhaler::Initialize() m_InhalerDrug = nullptr; } -bool Inhaler::Load(const CDM::BioGearsInhalerData& in) -{ - if (!SEInhaler::Load(in)) - return false; - BioGearsSystem::LoadState(); - return true; -} -CDM::BioGearsInhalerData* Inhaler::Unload() const -{ - CDM::BioGearsInhalerData* data = new CDM::BioGearsInhalerData(); - Unload(*data); - return data; -} -void Inhaler::Unload(CDM::BioGearsInhalerData& data) const -{ - SEInhaler::Unload(data); -} - void Inhaler::SetUp() { // Time step - used by inhaler timer @@ -96,7 +77,7 @@ void Inhaler::SetUp() m_Mouthpiece = m_data.GetCompartments().GetGasCompartment(BGE::InhalerCompartment::Mouthpiece); m_AerosolMouthpiece = m_data.GetCompartments().GetLiquidCompartment(BGE::InhalerCompartment::Mouthpiece); - if (m_State == CDM::enumOnOff::On) { + if (m_State == SEOnOff::On) { if (m_Substance == nullptr) { Fatal("State is on, but without a substance"); } else { @@ -125,7 +106,7 @@ void Inhaler::SetUp() void Inhaler::PreProcess() { if (m_data.GetActions().GetInhalerActions().HasConfiguration()) { - CDM::enumOnOff::value state = GetState(); + SEOnOff state = GetState(); SEInhalerConfiguration* config = m_data.GetActions().GetInhalerActions().GetConfiguration(); ProcessConfiguration(*config); m_data.GetActions().GetInhalerActions().RemoveConfiguration(); @@ -145,24 +126,24 @@ void Inhaler::PreProcess() } // ### HANDLE INHALER-BASED UPDATES - if (m_State == CDM::enumOnOff::On) { + if (m_State == SEOnOff::On) { // Check to see if there is a substantial mass of substance on the inhaler node. // If not, we'll disconnect the inhaler. double dCInhalerSubstanceMass_ug = m_InhalerDrug->GetMass(MassUnit::ug); if (SEScalar::IsZero(dCInhalerSubstanceMass_ug, 1e-7)) { Info("Inhaler removed!"); m_InhalerDrug = nullptr; - m_State = CDM::enumOnOff::Off; - m_data.SetAirwayMode(CDM::enumBioGearsAirwayMode::Free); + m_State = SEOnOff::Off; + m_data.SetAirwayMode(SEBioGearsAirwayMode::Free); } } } +//-------------------------------------------------------------------------------------------------- void Inhaler::StateChange() { SEInhaler::StateChange(); } - //-------------------------------------------------------------------------------------------------- /// \brief /// Administer Substance Using Inhaler @@ -174,12 +155,11 @@ void Inhaler::StateChange() /// \details /// This method initializes substance values in the inhaler when actuated. It is called once /// per actuation. -//-------------------------------------------------------------------------------------------------- void Inhaler::Administer() { // Check to see if the inhaler is already on. We should not run this method unless the // inhaler is currently off and about to be activated. - if (m_State == CDM::enumOnOff::On) { + if (m_State == SEOnOff::On) { /// \error: Already processing a Substance Inhalation, ignoring this command. Error("Already processing a Substance Inhalation, ignoring this command"); return; @@ -187,8 +167,8 @@ void Inhaler::Administer() // Alert the user that the inhaler is actuated Info("Inhaler actuated!"); - m_State = CDM::enumOnOff::On; - m_data.SetAirwayMode(CDM::enumBioGearsAirwayMode::Inhaler); + m_State = SEOnOff::On; + m_data.SetAirwayMode(SEBioGearsAirwayMode::Inhaler); // Initialize pressure in the inhaler node to ambient double dAmbientPressure = m_AmbientEnv->GetPressure(PressureUnit::cmH2O); @@ -244,7 +224,6 @@ void Inhaler::Administer() } m_InhalerDrug->Balance(BalanceLiquidBy::Mass); } - //-------------------------------------------------------------------------------------------------- /// \brief /// Inhaler system process function @@ -255,7 +234,6 @@ void Inhaler::Administer() void Inhaler::Process() { } - //-------------------------------------------------------------------------------------------------- /// \brief /// Inhaler system postprocess function @@ -266,4 +244,5 @@ void Inhaler::Process() void Inhaler::PostProcess() { } +//-------------------------------------------------------------------------------------------------- } \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/engine/Systems/BloodChemistry.cpp b/projects/biogears/libBiogears/src/engine/Systems/BloodChemistry.cpp index 2e854f59e..1b7531b9a 100644 --- a/projects/biogears/libBiogears/src/engine/Systems/BloodChemistry.cpp +++ b/projects/biogears/libBiogears/src/engine/Systems/BloodChemistry.cpp @@ -27,6 +27,7 @@ specific language governing permissions and limitations under the License. #include #include #include +#include #include #include #include @@ -34,10 +35,11 @@ specific language governing permissions and limitations under the License. #include #include #include -#include #include #include -namespace BGE = mil::tatrc::physiology::biogears; + +#include "io/cdm/Physiology.h" +#include "io/cdm/Property.h" #pragma warning(disable : 4786) #pragma warning(disable : 4275) @@ -51,17 +53,17 @@ BloodChemistry::BloodChemistry(BioGears& bg) : SEBloodChemistrySystem(bg.GetLogger()) , m_data(bg) { - Clear(); + Invalidate(); } BloodChemistry::~BloodChemistry() { - Clear(); + Invalidate(); } -void BloodChemistry::Clear() +void BloodChemistry::Invalidate() { - SEBloodChemistrySystem::Clear(); + SEBloodChemistrySystem::Invalidate(); m_aorta = nullptr; m_aortaO2 = nullptr; m_aortaCO2 = nullptr; @@ -92,8 +94,8 @@ void BloodChemistry::Clear() m_venaCavaSodium = nullptr; m_venaCavaTriacylglycerol = nullptr; m_venaCavaUrea = nullptr; - m_ArterialOxygen_mmHg.Reset(); - m_ArterialCarbonDioxide_mmHg.Reset(); + m_ArterialOxygenAverage_mmHg.Reset(); + m_ArterialCarbonDioxideAverage_mmHg.Reset(); m_donorRBC_ct = 0.0; m_patientRBC_ct = 0.0; @@ -103,7 +105,7 @@ void BloodChemistry::Clear() m_4Agglutinate_ct = 0.0; m_RemovedRBC_ct = 0.0; - //radiation model parameters, first sets are growing within the marrow and thymus + // radiation model parameters, first sets are growing within the marrow and thymus m_progenitorLymphocytes_ct = 0.0; m_progenitorLymphocytes_wd_ct = 0.0; m_progenitorLymphocytes_d_ct = 0.0; @@ -113,11 +115,10 @@ void BloodChemistry::Clear() m_maturingLymphocytes_d_ct = 0.0; m_maturingLymphocytes_hd_ct = 0.0; - //circulating counts + // circulating counts m_Lymphocytes_ct = 0.0; m_Lymphocytes_d_ct = 0.0; m_Lymphocytes_hd_ct = 0.0; - } //-------------------------------------------------------------------------------------------------- @@ -133,13 +134,13 @@ void BloodChemistry::Initialize() GetVolumeFractionNeutralPhospholipidInPlasma().SetValue(0.0013); GetPhosphate().SetValue(1.1, AmountPerVolumeUnit::mmol_Per_L); GetStrongIonDifference().SetValue(40.5, AmountPerVolumeUnit::mmol_Per_L); - GetTotalBilirubin().SetValue(0.70, MassPerVolumeUnit::mg_Per_dL); //Reference range is 0.2-1.0 - GetLymphocyteCellCount().SetValue(1.9e9, AmountPerVolumeUnit::ct_Per_L); //Reference range is 1.3-3.5e9 per liter - GetNeutrophilCellCount().SetValue(3.0e9, AmountPerVolumeUnit::ct_Per_L); //Reference range is 1.5-3.8e9 per liter - //Note that RedBloodCellAcetylcholinesterase is initialized in Drugs file because Drugs is processed before Blood Chemistry + GetTotalBilirubin().SetValue(0.70, MassPerVolumeUnit::mg_Per_dL); // Reference range is 0.2-1.0 + GetLymphocyteCellCount().SetValue(1.9e9, AmountPerVolumeUnit::ct_Per_L); // Reference range is 1.3-3.5e9 per liter + GetNeutrophilCellCount().SetValue(3.0e9, AmountPerVolumeUnit::ct_Per_L); // Reference range is 1.5-3.8e9 per liter + // Note that RedBloodCellAcetylcholinesterase is initialized in Drugs file because Drugs is processed before Blood Chemistry GetInflammatoryResponse().Initialize(); - m_ArterialOxygen_mmHg.Sample(m_aortaO2->GetPartialPressure(PressureUnit::mmHg)); - m_ArterialCarbonDioxide_mmHg.Sample(m_aortaCO2->GetPartialPressure(PressureUnit::mmHg)); + m_ArterialOxygenAverage_mmHg.Sample(m_aortaO2->GetPartialPressure(PressureUnit::mmHg)); + m_ArterialCarbonDioxideAverage_mmHg.Sample(m_aortaCO2->GetPartialPressure(PressureUnit::mmHg)); GetCarbonMonoxideSaturation().SetValue(0); GetViralLoad().SetValue(0.0, AmountPerVolumeUnit::ct_Per_uL); @@ -153,7 +154,7 @@ void BloodChemistry::Initialize() m_4Agglutinate_ct = 0.0; m_RemovedRBC_ct = 0.0; - //radiation model parameters, first sets are growing within the marrow and thymus + // radiation model parameters, first sets are growing within the marrow and thymus m_progenitorLymphocytes_ct = 1.0; m_progenitorLymphocytes_wd_ct = 0.0; m_progenitorLymphocytes_d_ct = 0.0; @@ -163,97 +164,17 @@ void BloodChemistry::Initialize() m_maturingLymphocytes_d_ct = 0.0; m_maturingLymphocytes_hd_ct = 0.0; - //circulating counts + // circulating counts m_Lymphocytes_ct = 1.0; m_Lymphocytes_d_ct = 0.0; m_Lymphocytes_hd_ct = 0.0; - //absorbed set to zero + // absorbed set to zero m_radAbsorbed_Gy = 0.0; - //m_data.GetDataTrack().Probe("m_progenitorLymphocytes_ct ", m_progenitorLymphocytes_ct); - //m_data.GetDataTrack().Probe("m_progenitorLymphocytes_wd_ct ", m_progenitorLymphocytes_wd_ct); - //m_data.GetDataTrack().Probe("m_progenitorLymphocytes_d_ct ", m_progenitorLymphocytes_d_ct); - //m_data.GetDataTrack().Probe("m_progenitorLymphocytes_hd_ct ", m_progenitorLymphocytes_hd_ct); - //m_data.GetDataTrack().Probe("m_maturingLymphocytes_ct ", m_maturingLymphocytes_ct); - //m_data.GetDataTrack().Probe("m_maturingLymphocytes_d_ct ", m_maturingLymphocytes_d_ct); - //m_data.GetDataTrack().Probe("m_maturingLymphocytes_hd_ct ", m_maturingLymphocytes_hd_ct); - //m_data.GetDataTrack().Probe("m_Lymphocytes_ct ", m_Lymphocytes_ct); - //m_data.GetDataTrack().Probe("m_Lymphocytes_d_ct ", m_Lymphocytes_d_ct); - //m_data.GetDataTrack().Probe("m_Lymphocytes_hd_ct ", m_Lymphocytes_hd_ct); - //m_data.GetDataTrack().Probe("m_radAbsorbed_Gy ", m_radAbsorbed_Gy); - Process(); // Calculate the initial system values } -bool BloodChemistry::Load(const CDM::BioGearsBloodChemistrySystemData& in) -{ - if (!SEBloodChemistrySystem::Load(in)) - return false; - m_ArterialOxygen_mmHg.Load(in.ArterialOxygenAverage_mmHg()); - m_ArterialCarbonDioxide_mmHg.Load(in.ArterialCarbonDioxideAverage_mmHg()); - m_RhFactorMismatch_ct = in.RhFactorMismatch_ct(); - m_RhTransfusionReactionVolume_mL = in.RhTransfusionReactionVolume_mL(); - m_donorRBC_ct = in.DonorRBC_ct(); - m_patientRBC_ct = in.PatientRBC_ct(); - m_2Agglutinate_ct = in.TwoCellAgglutinates_ct(); - m_p3Agglutinate_ct = in.ThreeCellPatAgglutinates_ct(); - m_d3Agglutinate_ct = in.ThreeCellDonAgglutinates_ct(); - m_4Agglutinate_ct = in.FourCellAgglutinates_ct(); - m_RemovedRBC_ct = in.RemovedRBC_ct(); - - //radiation model values - m_progenitorLymphocytes_ct = in.progenitorLymphocytes(); - m_progenitorLymphocytes_wd_ct = in.progenitorLymphocytes_wd(); - m_progenitorLymphocytes_d_ct = in.progenitorLymphocytes_d(); - m_progenitorLymphocytes_hd_ct = in.progenitorLymphocytes_hd(); - m_maturingLymphocytes_ct = in.maturingLymphocytes(); - m_maturingLymphocytes_d_ct = in.maturingLymphocytes_d(); - m_maturingLymphocytes_hd_ct = in.maturingLymphocytes_hd(); - m_Lymphocytes_ct = in.Lymphocytes(); - m_Lymphocytes_d_ct = in.Lymphocytes_d(); - m_Lymphocytes_hd_ct = in.Lymphocytes_hd(); - m_radAbsorbed_Gy = in.RadiationAbsorbed(); - - BioGearsSystem::LoadState(); - - return true; -} -CDM::BioGearsBloodChemistrySystemData* BloodChemistry::Unload() const -{ - CDM::BioGearsBloodChemistrySystemData* data = new CDM::BioGearsBloodChemistrySystemData(); - Unload(*data); - return data; -} -void BloodChemistry::Unload(CDM::BioGearsBloodChemistrySystemData& data) const -{ - SEBloodChemistrySystem::Unload(data); - data.ArterialOxygenAverage_mmHg(std::unique_ptr(m_ArterialOxygen_mmHg.Unload())); - data.ArterialCarbonDioxideAverage_mmHg(std::unique_ptr(m_ArterialCarbonDioxide_mmHg.Unload())); - data.RhFactorMismatch_ct(m_RhFactorMismatch_ct); - data.RhTransfusionReactionVolume_mL(m_RhTransfusionReactionVolume_mL); - data.DonorRBC_ct(m_donorRBC_ct); - data.PatientRBC_ct(m_patientRBC_ct); - data.TwoCellAgglutinates_ct(m_2Agglutinate_ct); - data.ThreeCellPatAgglutinates_ct(m_p3Agglutinate_ct); - data.ThreeCellDonAgglutinates_ct(m_d3Agglutinate_ct); - data.FourCellAgglutinates_ct(m_4Agglutinate_ct); - data.RemovedRBC_ct(m_RemovedRBC_ct); - - //radiation model values - data.progenitorLymphocytes(m_progenitorLymphocytes_ct); - data.progenitorLymphocytes_wd(m_progenitorLymphocytes_wd_ct); - data.progenitorLymphocytes_d(m_progenitorLymphocytes_d_ct); - data.progenitorLymphocytes_hd(m_progenitorLymphocytes_hd_ct); - data.maturingLymphocytes(m_maturingLymphocytes_ct); - data.maturingLymphocytes_d(m_maturingLymphocytes_d_ct); - data.maturingLymphocytes_hd(m_maturingLymphocytes_hd_ct); - data.Lymphocytes(m_Lymphocytes_ct); - data.Lymphocytes_d(m_Lymphocytes_d_ct); - data.Lymphocytes_hd(m_Lymphocytes_hd_ct); - data.RadiationAbsorbed(m_radAbsorbed_Gy); -} - //-------------------------------------------------------------------------------------------------- /// \brief /// Initializes parameters for BloodChemistry Class @@ -276,7 +197,7 @@ void BloodChemistry::SetUp() m_dt_s = m_data.GetTimeStep().GetValue(TimeUnit::s); m_dt_hr = m_data.GetTimeStep().GetValue(TimeUnit::hr); - //Substance + // Substance SESubstance* albumin = &m_data.GetSubstances().GetAlbumin(); SESubstance* aminoAcids = &m_data.GetSubstances().GetAminoAcids(); SESubstance* bicarbonate = &m_data.GetSubstances().GetHCO3(); @@ -289,7 +210,7 @@ void BloodChemistry::SetUp() SESubstance* insulin = &m_data.GetSubstances().GetInsulin(); SESubstance* ketones = &m_data.GetSubstances().GetKetones(); SESubstance* lactate = &m_data.GetSubstances().GetLactate(); - m_Ondansetron = m_data.GetSubstances().GetSubstance("Ondansetron"); + m_Ondansetron = m_data.GetSubstances().GetSubstance(StandardSubstances::Ondansetron); SESubstance* potassium = &m_data.GetSubstances().GetPotassium(); SESubstance* rbc = &m_data.GetSubstances().GetRBC(); SESubstance* sodium = &m_data.GetSubstances().GetSodium(); @@ -370,7 +291,7 @@ void BloodChemistry::PreProcess() //-------------------------------------------------------------------------------------------------- void BloodChemistry::Process() { - //Push the compartment values of O2 and CO2 partial pressures on the corresponding system data. + // Push the compartment values of O2 and CO2 partial pressures on the corresponding system data. GetOxygenSaturation().Set(m_aortaO2->GetSaturation()); GetOxygenVenousSaturation().Set(m_venaCavaO2->GetSaturation()); GetCarbonDioxideSaturation().Set(m_aortaCO2->GetSaturation()); @@ -401,7 +322,7 @@ void BloodChemistry::Process() GetHemoglobinContent().SetValue(totalHemoglobinO2Hemoglobin_g, MassUnit::g); if (totalHemoglobinO2Hemoglobin_g < (13.0 * m_data.GetPatient().GetBloodVolumeBaseline(VolumeUnit::dL))) { // 13.5 g/dL is considered low Hb content - double hemoglobinIncrease_g = (0.63 / 86400.0) * m_data.GetTimeStep().GetValue(TimeUnit::s); //0.63 g Hb per day (in seconds is 86400) + double hemoglobinIncrease_g = (0.63 / 86400.0) * m_data.GetTimeStep().GetValue(TimeUnit::s); // 0.63 g Hb per day (in seconds is 86400) m_venaCava->GetSubstanceQuantity(m_data.GetSubstances().GetHb())->GetMass().IncrementValue(hemoglobinIncrease_g, MassUnit::g); } m_HbLostToUrine_g = GetHemoglobinContent().GetValue(MassUnit::g); @@ -410,7 +331,7 @@ void BloodChemistry::Process() SESubstance& rbc = m_data.GetSubstances().GetRBC(); double TotalBloodVolume_mL = m_data.GetCardiovascular().GetBloodVolume(VolumeUnit::mL); - if (m_data.GetPatient().IsEventActive(CDM::enumPatientEvent::HemolyticTransfusionReaction)) { + if (m_data.GetPatient().IsEventActive(SEPatientEventType::HemolyticTransfusionReaction)) { if (GetRhTransfusionReactionVolume().GetValue(VolumeUnit::uL) > 0) { CalculateHemolyticTransfusionReaction(true); } else { @@ -418,7 +339,7 @@ void BloodChemistry::Process() } } - //set white blood cell count + // set white blood cell count const double wbcCount_ct_Per_uL = m_venaCava->GetSubstanceQuantity(m_data.GetSubstances().GetWBC())->GetMolarity(AmountPerVolumeUnit::ct_Per_uL); GetWhiteBloodCellCount().SetValue(wbcCount_ct_Per_uL, AmountPerVolumeUnit::ct_Per_uL); @@ -428,7 +349,7 @@ void BloodChemistry::Process() GetHematocrit().SetValue((RedBloodCellVolume_mL / TotalBloodVolume_mL)); // Yes, we are giving GetRedBloodCellCount a concentration, because that is what it is, but clinically, it is known as RedBloodCellCount GetRedBloodCellCount().SetValue(RedBloodCellCount_ct / m_data.GetCardiovascular().GetBloodVolume(VolumeUnit::uL), AmountPerVolumeUnit::ct_Per_uL); - GetPlasmaVolume().SetValue(TotalBloodVolume_mL - RedBloodCellVolume_mL, VolumeUnit::mL); //Look into changing to account for platelets and wbc too + GetPlasmaVolume().SetValue(TotalBloodVolume_mL - RedBloodCellVolume_mL, VolumeUnit::mL); // Look into changing to account for platelets and wbc too // Concentrations double albuminConcentration_ug_Per_mL = m_venaCavaAlbumin->GetConcentration(MassPerVolumeUnit::ug_Per_mL); @@ -455,9 +376,9 @@ void BloodChemistry::Process() m_data.GetSubstances().GetTriacylglycerol().GetBloodConcentration().Set(m_venaCavaTriacylglycerol->GetConcentration()); m_data.GetSubstances().GetUrea().GetBloodConcentration().Set(m_venaCavaUrea->GetConcentration()); - double otherIons_mmol_Per_L = -5.4; //Na, K, and Cl baseline concentrations give SID = 45.83, we assume baseline SID = 40.5, thus "other ions" (i.e. Mg, Ca, Ketones) make up -5.3 mmol_Per_L equivalent of charge + double otherIons_mmol_Per_L = -5.4; // Na, K, and Cl baseline concentrations give SID = 45.83, we assume baseline SID = 40.5, thus "other ions" (i.e. Mg, Ca, Ketones) make up -5.3 mmol_Per_L equivalent of charge double strongIonDifference_mmol_Per_L = m_venaCavaSodium->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) + m_venaCavaPotassium->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) - (m_venaCavaChloride->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) + (m_venaCavaLactate->GetMolarity(AmountPerVolumeUnit::mmol_Per_L))) + otherIons_mmol_Per_L; - //GetStrongIonDifference().SetValue(strongIonDifference_mmol_Per_L, AmountPerVolumeUnit::mmol_Per_L); + // GetStrongIonDifference().SetValue(strongIonDifference_mmol_Per_L, AmountPerVolumeUnit::mmol_Per_L); // Calculate pH GetArterialBloodPH().Set(m_aorta->GetPH()); @@ -482,7 +403,7 @@ void BloodChemistry::Process() double shunt = shuntFlow_mL_Per_min / totalFlow_mL_Per_min; GetShuntFraction().SetValue(shunt); - //Throw events if levels are low/high + // Throw events if levels are low/high CheckBloodSubstanceLevels(); // Total up all active substances @@ -518,19 +439,19 @@ void BloodChemistry::PostProcess() /// Computes the physiological impact of acute radiation exposure. /// /// \details -/// Computes the bone marrow impacts due to radiation exposure in a human. This impact will be +/// Computes the bone marrow impacts due to radiation exposure in a human. This impact will be /// reflected in the complete blood count. We are mechanistically modeling bone marrow lymphopoiesis -/// The other cell types are going to be scaled on this model in an appropriate way. Enums that impact +/// The other cell types are going to be scaled on this model in an appropriate way. Enums that impact /// the patient will be flagged in a separate function //-------------------------------------------------------------------------------------------------- void BloodChemistry::AcuteRadiationSyndrome() { - //make sure we have the appropriate action: + // make sure we have the appropriate action: if (!m_PatientActions->HasRadiationAbsorbedDose()) { return; } - //N is the exposed dose, consistent with the paper we are basing this on + // N is the exposed dose, consistent with the paper we are basing this on auto radDose = m_PatientActions->GetRadiationAbsorbedDose()->GetDose().GetValue(EnergyPerMassUnit::J_Per_kg); const double maxWorkRate_W = m_Patient->GetMaxWorkRate().GetValue(PowerUnit::W); const double basalMetabolicRate_kcal_Per_day = m_Patient->GetBasalMetabolicRate().GetValue(PowerUnit::kcal_Per_day); @@ -539,10 +460,9 @@ void BloodChemistry::AcuteRadiationSyndrome() const double kcal_Per_day_Per_Watt = 20.6362855; double EnergyIncrement_kcal_Per_day = 0.0; - - //define parameters - //control parameters - const double alpha_Per_Day = 0.8 / 86400.0; //scale to our timescale + // define parameters + // control parameters + const double alpha_Per_Day = 0.8 / 86400.0; // scale to our timescale const double gamma_Per_Day = 0.8 / 86400.0; const double delta_Per_Day = 0.1 / 86400.0; const double kappa_Per_Day = 0.4 / 86400.0; @@ -552,30 +472,30 @@ void BloodChemistry::AcuteRadiationSyndrome() const double phi = 1.01; double speed = 5.0; - //neutrophil delay - const double delay = 3600.0; //one hour delay + // neutrophil delay + const double delay = 3600.0; // one hour delay - //radiobiological paramters + // radiobiological paramters const double D1_J_Per_Kg = 1.4; const double Dc_J_Per_Kg = 0.5; const double Dm1_J_Per_Kg = 13.0; const double D2_J_Per_Kg = 1.4; const double Dm2_J_Per_Kg = 13.0; - const double D3_J_Per_Kg = 0.9; //this value has been adjusted for physiological response + const double D3_J_Per_Kg = 0.9; // this value has been adjusted for physiological response const double Dm3_J_Per_Kg = 6.5; const double v1_Per_Day = 0.6 / 86400.0; - const double vc_Per_Day = 0.6 / 86400.0; //this one isn't defined in the literature + const double vc_Per_Day = 0.6 / 86400.0; // this one isn't defined in the literature const double v2_Per_Day = 7.0 / 86400.0; - const double xhat = 1.936e9; //average number of lympohocytes - const double neutrophilhat = 4.0e9; //average number of neutrophiles per liter - const double nu_Per_Day = (v2_Per_Day * phi) / v1_Per_Day; //capital gamma in the model + const double xhat = 1.936e9; // average number of lympohocytes + const double neutrophilhat = 4.0e9; // average number of neutrophiles per liter + const double nu_Per_Day = (v2_Per_Day * phi) / v1_Per_Day; // capital gamma in the model - //neutrophil/lymphocyte count (want this to be nondimensional for now): + // neutrophil/lymphocyte count (want this to be nondimensional for now): double neutrophilAmount = GetNeutrophilCellCount().GetValue(AmountPerVolumeUnit::ct_Per_L) / neutrophilhat; double lymphoAmount = GetLymphocyteCellCount().GetValue(AmountPerVolumeUnit::ct_Per_L) / xhat; double diff = 0.0; - //rho is a ratio of d1 and dm1... + // rho is a ratio of d1 and dm1... double rho1 = (Dm1_J_Per_Kg / (D1_J_Per_Kg - 1)); double rho2 = (Dm2_J_Per_Kg / (D2_J_Per_Kg - 1)); double rho3 = (Dm3_J_Per_Kg / (D3_J_Per_Kg - 1)); @@ -587,12 +507,12 @@ void BloodChemistry::AcuteRadiationSyndrome() double radiationRate_Per_dt = radiationRate_Per_s * m_dt_s; if (m_radAbsorbed_Gy >= radDose) { - radiationRate_Per_dt = 0.0; //turn off the exposure once the action has been reached + radiationRate_Per_dt = 0.0; // turn off the exposure once the action has been reached } - //solve the system - - //simplify the calculation: + // solve the system + + // simplify the calculation: auto mu1 = sigma1 * (m_progenitorLymphocytes_ct + m_progenitorLymphocytes_wd_ct + phi * m_progenitorLymphocytes_d_ct + nu_Per_Day * m_progenitorLymphocytes_hd_ct); auto mu2 = sigma2 * (m_maturingLymphocytes_ct + phi * m_maturingLymphocytes_d_ct + nu_Per_Day * m_maturingLymphocytes_hd_ct); auto mu3 = sigma3 * (m_Lymphocytes_ct + phi * m_Lymphocytes_d_ct + nu_Per_Day * m_Lymphocytes_hd_ct); @@ -608,21 +528,20 @@ void BloodChemistry::AcuteRadiationSyndrome() m_maturingLymphocytes_d_ct += m_dt_s * speed * ((radiationRate_Per_dt / D2_J_Per_Kg) * (1 / (1 + rho1)) * m_maturingLymphocytes_ct - v1_Per_Day * m_maturingLymphocytes_d_ct); m_maturingLymphocytes_hd_ct += m_dt_s * speed * ((radiationRate_Per_dt / Dm2_J_Per_Kg) * (rho1 / (1 + rho1)) * m_maturingLymphocytes_ct - v2_Per_Day * m_maturingLymphocytes_hd_ct); - //circulating counts + // circulating counts m_Lymphocytes_ct += m_dt_s * speed * (delta_Per_Day * m_maturingLymphocytes_ct - kappa_Per_Day * m_Lymphocytes_ct - (radiationRate_Per_dt / D3_J_Per_Kg) * m_Lymphocytes_ct); m_Lymphocytes_d_ct += m_dt_s * speed * ((radiationRate_Per_dt / D3_J_Per_Kg) * (1 / (1 + rho1)) * m_Lymphocytes_ct - v1_Per_Day * m_Lymphocytes_d_ct); m_Lymphocytes_hd_ct += m_dt_s * speed * ((radiationRate_Per_dt / Dm3_J_Per_Kg) * (rho1 / (1 + rho1)) * m_Lymphocytes_ct - v2_Per_Day * m_Lymphocytes_hd_ct); - GetLymphocyteCellCount().SetValue(m_Lymphocytes_ct * xhat, AmountPerVolumeUnit::ct_Per_L); //Reference range is 1.3-3.5e9 per liter, scaling back to get a count + GetLymphocyteCellCount().SetValue(m_Lymphocytes_ct * xhat, AmountPerVolumeUnit::ct_Per_L); // Reference range is 1.3-3.5e9 per liter, scaling back to get a count if (m_data.GetSimulationTime().GetValue(TimeUnit::s) > delay) { - //scale neutrophils super simple exponential, using hr timestep to slow things down + // scale neutrophils super simple exponential, using hr timestep to slow things down diff = m_dt_hr * (neutrophilAmount - lymphoAmount); - GetNeutrophilCellCount().IncrementValue(-diff * neutrophilhat, AmountPerVolumeUnit::ct_Per_L ); + GetNeutrophilCellCount().IncrementValue(-diff * neutrophilhat, AmountPerVolumeUnit::ct_Per_L); } - - //thermal effects due to lymphocyt changes, scale based upon damaged lymphocyte + // thermal effects due to lymphocyt changes, scale based upon damaged lymphocyte BLIM(m_Lymphocytes_ct, 0, 1); metabolicStress = std::pow(m_Lymphocytes_ct, 2) - 2 * m_Lymphocytes_ct + 1; EnergyIncrement_kcal_Per_day = m_dt_s * (basalMetabolicRate_kcal_Per_day + metabolicStress * maxWorkRate_W * kcal_Per_day_Per_Watt - currentMetabolicRate_kcal_Per_day) * 0.0002; @@ -630,22 +549,21 @@ void BloodChemistry::AcuteRadiationSyndrome() m_data.GetEnergy().GetTotalMetabolicRate().IncrementValue(EnergyIncrement_kcal_Per_day, PowerUnit::kcal_Per_day); m_data.GetEnergy().GetExerciseEnergyDemand().IncrementValue(EnergyIncrement_kcal_Per_day, PowerUnit::kcal_Per_day); - - //increment the exposure variable: + // increment the exposure variable: m_radAbsorbed_Gy += radiationRate_Per_dt; - //testing probes - //m_data.GetDataTrack().Probe("m_progenitorLymphocytes_ct ", m_progenitorLymphocytes_ct); - //m_data.GetDataTrack().Probe("m_progenitorLymphocytes_wd_ct ", m_progenitorLymphocytes_wd_ct); - //m_data.GetDataTrack().Probe("m_progenitorLymphocytes_d_ct ", m_progenitorLymphocytes_d_ct); - //m_data.GetDataTrack().Probe("m_progenitorLymphocytes_hd_ct ", m_progenitorLymphocytes_hd_ct); - //m_data.GetDataTrack().Probe("m_maturingLymphocytes_ct ", m_maturingLymphocytes_ct); - //m_data.GetDataTrack().Probe("m_maturingLymphocytes_d_ct ", m_maturingLymphocytes_d_ct); - //m_data.GetDataTrack().Probe("m_maturingLymphocytes_hd_ct ", m_maturingLymphocytes_hd_ct); - //m_data.GetDataTrack().Probe("m_Lymphocytes_ct ", m_Lymphocytes_ct); - //m_data.GetDataTrack().Probe("m_Lymphocytes_d_ct ", m_Lymphocytes_d_ct); - //m_data.GetDataTrack().Probe("m_Lymphocytes_hd_ct ", m_Lymphocytes_hd_ct); - //m_data.GetDataTrack().Probe("m_radAbsorbed_Gy ", m_radAbsorbed_Gy); + // testing probes + // m_data.GetDataTrack().Probe("m_progenitorLymphocytes_ct ", m_progenitorLymphocytes_ct); + // m_data.GetDataTrack().Probe("m_progenitorLymphocytes_wd_ct ", m_progenitorLymphocytes_wd_ct); + // m_data.GetDataTrack().Probe("m_progenitorLymphocytes_d_ct ", m_progenitorLymphocytes_d_ct); + // m_data.GetDataTrack().Probe("m_progenitorLymphocytes_hd_ct ", m_progenitorLymphocytes_hd_ct); + // m_data.GetDataTrack().Probe("m_maturingLymphocytes_ct ", m_maturingLymphocytes_ct); + // m_data.GetDataTrack().Probe("m_maturingLymphocytes_d_ct ", m_maturingLymphocytes_d_ct); + // m_data.GetDataTrack().Probe("m_maturingLymphocytes_hd_ct ", m_maturingLymphocytes_hd_ct); + // m_data.GetDataTrack().Probe("m_Lymphocytes_ct ", m_Lymphocytes_ct); + // m_data.GetDataTrack().Probe("m_Lymphocytes_d_ct ", m_Lymphocytes_d_ct); + // m_data.GetDataTrack().Probe("m_Lymphocytes_hd_ct ", m_Lymphocytes_hd_ct); + // m_data.GetDataTrack().Probe("m_radAbsorbed_Gy ", m_radAbsorbed_Gy); } //-------------------------------------------------------------------------------------------------- /// \brief @@ -657,75 +575,73 @@ void BloodChemistry::AcuteRadiationSyndrome() //-------------------------------------------------------------------------------------------------- void BloodChemistry::CheckRadiationSymptoms() { - //get lymphocyte value: - double lymph_ct_Per_L = GetLymphocyteCellCount().GetValue(AmountPerVolumeUnit::ct_Per_L); - const double xhat_ct_Per_L = 1.936e9; //average number of lympohocytes - - //mild - if (0.5 < lymph_ct_Per_L / xhat_ct_Per_L && lymph_ct_Per_L / xhat_ct_Per_L < 0.6) { - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::MildDiarrhea, true, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::MildHeadache, true, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::SevereDiarrhea, false, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::SevereHeadache, false, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::Nausea, true, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::Vomiting, false, m_data.GetSimulationTime()); - } - - //severe - if (lymph_ct_Per_L / xhat_ct_Per_L < 0.4) { - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::MildDiarrhea, false, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::MildHeadache, false, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::SevereDiarrhea, true, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::SevereHeadache, true, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::Nausea, false, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::Vomiting, true, m_data.GetSimulationTime()); - - } + // get lymphocyte value: + double lymph_ct_Per_L = GetLymphocyteCellCount().GetValue(AmountPerVolumeUnit::ct_Per_L); + const double xhat_ct_Per_L = 1.936e9; // average number of lympohocytes + + // mild + if (0.5 < lymph_ct_Per_L / xhat_ct_Per_L && lymph_ct_Per_L / xhat_ct_Per_L < 0.6) { + m_data.GetPatient().SetEvent(SEPatientEventType::MildDiarrhea, true, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::MildHeadache, true, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::SevereDiarrhea, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::SevereHeadache, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::Nausea, true, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::Vomiting, false, m_data.GetSimulationTime()); + } + + // severe + if (lymph_ct_Per_L / xhat_ct_Per_L < 0.4) { + m_data.GetPatient().SetEvent(SEPatientEventType::MildDiarrhea, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::MildHeadache, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::SevereDiarrhea, true, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::SevereHeadache, true, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::Nausea, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::Vomiting, true, m_data.GetSimulationTime()); + } +} - } +//-------------------------------------------------------------------------------------------------- +/// \brief +/// Checks the blood substance levels and set ebola specific events. +/// +/// \details +/// Checks the Viral load levels to determine patient events. +/// These events are specific to radiation exposure but should expanded to be more general +//-------------------------------------------------------------------------------------------------- +void BloodChemistry::CheckViralSymptoms() +{ + // get lymphocyte value: + double viralLoad = GetViralLoad().GetValue(AmountPerVolumeUnit::ct_Per_uL); + double ondansetron_mg_Per_L = 0.0; + if (m_data.GetSubstances().IsActive(*m_Ondansetron)) { + ondansetron_mg_Per_L = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Aorta)->GetSubstanceQuantity(*m_Ondansetron)->GetConcentration().GetValue(MassPerVolumeUnit::mg_Per_L); + } + // mild + if (2 < viralLoad && viralLoad < 9 && ondansetron_mg_Per_L < 0.1) { + m_data.GetPatient().SetEvent(SEPatientEventType::MildDiarrhea, true, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::MildHeadache, true, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::SevereDiarrhea, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::SevereHeadache, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::Nausea, true, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::Vomiting, false, m_data.GetSimulationTime()); + } + + // severe + if (viralLoad > 10.0 && ondansetron_mg_Per_L < 0.1) { + m_data.GetPatient().SetEvent(SEPatientEventType::MildDiarrhea, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::MildHeadache, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::SevereDiarrhea, true, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::SevereHeadache, true, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::Nausea, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::Vomiting, true, m_data.GetSimulationTime()); + } + if (ondansetron_mg_Per_L > 0.1) { + m_data.GetPatient().SetEvent(SEPatientEventType::Vomiting, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::Nausea, false, m_data.GetSimulationTime()); + } +} //-------------------------------------------------------------------------------------------------- - /// \brief - /// Checks the blood substance levels and set ebola specific events. - /// - /// \details - /// Checks the Viral load levels to determine patient events. - /// These events are specific to radiation exposure but should expanded to be more general - //-------------------------------------------------------------------------------------------------- - void BloodChemistry::CheckViralSymptoms() - { - //get lymphocyte value: - double viralLoad = GetViralLoad().GetValue(AmountPerVolumeUnit::ct_Per_uL); - double ondansetron_mg_Per_L = 0.0; - if (m_data.GetSubstances().IsActive(*m_Ondansetron)) { - ondansetron_mg_Per_L = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Aorta)->GetSubstanceQuantity(*m_Ondansetron)->GetConcentration().GetValue(MassPerVolumeUnit::mg_Per_L); - } - //mild - if (2 < viralLoad && viralLoad < 9 && ondansetron_mg_Per_L < 0.1) { - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::MildDiarrhea, true, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::MildHeadache, true, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::SevereDiarrhea, false, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::SevereHeadache, false, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::Nausea, true, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::Vomiting, false, m_data.GetSimulationTime()); - } - - //severe - if (viralLoad > 10.0 && ondansetron_mg_Per_L < 0.1) { - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::MildDiarrhea, false, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::MildHeadache, false, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::SevereDiarrhea, true, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::SevereHeadache, true, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::Nausea, false, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::Vomiting, true, m_data.GetSimulationTime()); - } - if (ondansetron_mg_Per_L > 0.1) { - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::Vomiting, false, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::Nausea, false, m_data.GetSimulationTime()); - } - } - - //-------------------------------------------------------------------------------------------------- /// \brief /// Checks the blood substance (oxygen, carbon dioxide, glucose, etc.) levels and sets events. /// @@ -737,21 +653,21 @@ void BloodChemistry::CheckRadiationSymptoms() void BloodChemistry::CheckBloodSubstanceLevels() { SEPatient& patient = m_data.GetPatient(); - double hypoxiaFlag = 65.0; //Arterial O2 Partial Pressure in mmHg \cite Pierson2000Pathophysiology + double hypoxiaFlag = 65.0; // Arterial O2 Partial Pressure in mmHg \cite Pierson2000Pathophysiology double hypoxiaIrreversible = 15.0; // \cite hobler1973HypoxemiaCardiacOutput double hypoglycemiaLevel_mg_Per_dL = 70; double hypoglycemicShockLevel_mg_Per_dL = 50; double hypoglycemicComaLevel_mg_Per_dL = 20; - double hyperglycemiaLevel_mg_Per_dL = 140; //anything over 140 is considered abnormal, especially during a fasting state + double hyperglycemiaLevel_mg_Per_dL = 140; // anything over 140 is considered abnormal, especially during a fasting state double lacticAcidosisLevel_mg_Per_dL = 44; double ketoacidosisLevel_mg_Per_dL = 122; - m_ArterialOxygen_mmHg.Sample(m_aortaO2->GetPartialPressure(PressureUnit::mmHg)); - m_ArterialCarbonDioxide_mmHg.Sample(m_aortaCO2->GetPartialPressure(PressureUnit::mmHg)); - //Only check these at the end of a cardiac cycle and reset at start of cardiac cycle - if (patient.IsEventActive(CDM::enumPatientEvent::StartOfCardiacCycle)) { - double arterialOxygen_mmHg = m_ArterialOxygen_mmHg.Value(); - double arterialCarbonDioxide_mmHg = m_ArterialCarbonDioxide_mmHg.Value(); + m_ArterialOxygenAverage_mmHg.Sample(m_aortaO2->GetPartialPressure(PressureUnit::mmHg)); + m_ArterialCarbonDioxideAverage_mmHg.Sample(m_aortaCO2->GetPartialPressure(PressureUnit::mmHg)); + // Only check these at the end of a cardiac cycle and reset at start of cardiac cycle + if (patient.IsEventActive(SEPatientEventType::StartOfCardiacCycle)) { + double arterialOxygen_mmHg = m_ArterialOxygenAverage_mmHg.Value(); + double arterialCarbonDioxide_mmHg = m_ArterialCarbonDioxideAverage_mmHg.Value(); if (m_data.GetState() > EngineState::InitialStabilization) { // Don't throw events if we are initializing // hypercapnia check @@ -759,145 +675,145 @@ void BloodChemistry::CheckBloodSubstanceLevels() double carbonDioxideToxicity = 80.0; // \cite labertsen1971CarbonDioxideToxicity if (arterialCarbonDioxide_mmHg >= hypercapniaFlag) { /// \event Patient: Hypercapnia. The carbon dioxide partial pressure has risen above 60 mmHg. The patient is now hypercapnic. - patient.SetEvent(CDM::enumPatientEvent::Hypercapnia, true, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::Hypercapnia, true, m_data.GetSimulationTime()); if (arterialCarbonDioxide_mmHg > carbonDioxideToxicity) { m_ss << "Arterial Carbon Dioxide partial pressure is " << arterialCarbonDioxide_mmHg << ". This is beyond 80 mmHg triggering extreme Hypercapnia, patient is in an irreversible state."; Warning(m_ss); /// \irreversible The carbon dioxide partial pressure is greater than 80 mmHg. if (!m_PatientActions->HasOverride()) { - patient.SetEvent(CDM::enumPatientEvent::IrreversibleState, true, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::IrreversibleState, true, m_data.GetSimulationTime()); } else { - if (m_PatientActions->GetOverride()->GetOverrideConformance() == CDM::enumOnOff::On) { - patient.SetEvent(CDM::enumPatientEvent::IrreversibleState, true, m_data.GetSimulationTime()); + if (m_PatientActions->GetOverride()->GetOverrideConformance() == SEOnOff::On) { + patient.SetEvent(SEPatientEventType::IrreversibleState, true, m_data.GetSimulationTime()); } } } - } else if (patient.IsEventActive(CDM::enumPatientEvent::Hypercapnia) && arterialCarbonDioxide_mmHg < (hypercapniaFlag - 3)) { + } else if (patient.IsEventActive(SEPatientEventType::Hypercapnia) && arterialCarbonDioxide_mmHg < (hypercapniaFlag - 3)) { /// \event Patient: End Hypercapnia. The carbon dioxide partial pressure has fallen below 57 mmHg. The patient is no longer considered to be hypercapnic. /// This event is triggered if the patient was hypercapnic and is now considered to be recovered. - patient.SetEvent(CDM::enumPatientEvent::Hypercapnia, false, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::Hypercapnia, false, m_data.GetSimulationTime()); } // hypoxia check if (arterialOxygen_mmHg <= hypoxiaFlag) { /// \event Patient: Hypoxia Event. The oxygen partial pressure has fallen below 65 mmHg, indicating that the patient is hypoxic. - patient.SetEvent(CDM::enumPatientEvent::Hypoxia, true, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::Hypoxia, true, m_data.GetSimulationTime()); if (arterialOxygen_mmHg < hypoxiaIrreversible) { m_ss << "Arterial Oxygen partial pressure is " << arterialOxygen_mmHg << ". This is below 15 mmHg triggering extreme Hypoxia, patient is in an irreversible state."; Warning(m_ss); /// \irreversible Arterial oxygen partial pressure has been critically reduced to below 15 mmHg. if (!m_PatientActions->HasOverride()) { - patient.SetEvent(CDM::enumPatientEvent::IrreversibleState, true, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::IrreversibleState, true, m_data.GetSimulationTime()); } else { - if (m_PatientActions->GetOverride()->GetOverrideConformance() == CDM::enumOnOff::On) { - patient.SetEvent(CDM::enumPatientEvent::IrreversibleState, true, m_data.GetSimulationTime()); + if (m_PatientActions->GetOverride()->GetOverrideConformance() == SEOnOff::On) { + patient.SetEvent(SEPatientEventType::IrreversibleState, true, m_data.GetSimulationTime()); } } } } else if (arterialOxygen_mmHg > (hypoxiaFlag + 3)) { /// \event Patient: End Hypoxia Event. The oxygen partial pressure has rise above 68 mmHg. If this occurs when the patient is hypoxic, it will reverse the hypoxic event. /// The patient is no longer considered to be hypoxic. - patient.SetEvent(CDM::enumPatientEvent::Hypoxia, false, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::Hypoxia, false, m_data.GetSimulationTime()); } - //glucose checks + // glucose checks - //hypoglycemia + // hypoglycemia if (m_venaCavaGlucose->GetConcentration(MassPerVolumeUnit::mg_Per_dL) < hypoglycemiaLevel_mg_Per_dL) { - patient.SetEvent(CDM::enumPatientEvent::Hypoglycemia, true, m_data.GetSimulationTime()); - } else if (patient.IsEventActive(CDM::enumPatientEvent::Hypoglycemia) && m_venaCavaGlucose->GetConcentration(MassPerVolumeUnit::mg_Per_dL) > hypoglycemiaLevel_mg_Per_dL + 5) { - patient.SetEvent(CDM::enumPatientEvent::Hypoglycemia, false, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::Hypoglycemia, true, m_data.GetSimulationTime()); + } else if (patient.IsEventActive(SEPatientEventType::Hypoglycemia) && m_venaCavaGlucose->GetConcentration(MassPerVolumeUnit::mg_Per_dL) > hypoglycemiaLevel_mg_Per_dL + 5) { + patient.SetEvent(SEPatientEventType::Hypoglycemia, false, m_data.GetSimulationTime()); } - //hypoglycemic shock + // hypoglycemic shock if (m_venaCavaGlucose->GetConcentration(MassPerVolumeUnit::mg_Per_dL) < hypoglycemicShockLevel_mg_Per_dL) { - patient.SetEvent(CDM::enumPatientEvent::HypoglycemicShock, true, m_data.GetSimulationTime()); - } else if (patient.IsEventActive(CDM::enumPatientEvent::HypoglycemicShock) && m_venaCavaGlucose->GetConcentration(MassPerVolumeUnit::mg_Per_dL) > hypoglycemicShockLevel_mg_Per_dL + 5) { - patient.SetEvent(CDM::enumPatientEvent::HypoglycemicShock, false, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::HypoglycemicShock, true, m_data.GetSimulationTime()); + } else if (patient.IsEventActive(SEPatientEventType::HypoglycemicShock) && m_venaCavaGlucose->GetConcentration(MassPerVolumeUnit::mg_Per_dL) > hypoglycemicShockLevel_mg_Per_dL + 5) { + patient.SetEvent(SEPatientEventType::HypoglycemicShock, false, m_data.GetSimulationTime()); } - //hypoglycemic coma - currently commented out until glucose balancing and nutrient consumption refined + // hypoglycemic coma - currently commented out until glucose balancing and nutrient consumption refined /*if (m_venaCavaGlucose->GetConcentration(MassPerVolumeUnit::mg_Per_dL) < hypoglycemicComaLevel_mg_Per_dL) { - patient.SetEvent(CDM::enumPatientEvent::HypoglycemicComa, true, m_data.GetSimulationTime()); - } else if (patient.IsEventActive(CDM::enumPatientEvent::HypoglycemicComa) && m_venaCavaGlucose->GetConcentration(MassPerVolumeUnit::mg_Per_dL) > hypoglycemicComaLevel_mg_Per_dL + 3) { - patient.SetEvent(CDM::enumPatientEvent::HypoglycemicComa, false, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::HypoglycemicComa, true, m_data.GetSimulationTime()); + } else if (patient.IsEventActive(SEPatientEventType::HypoglycemicComa) && m_venaCavaGlucose->GetConcentration(MassPerVolumeUnit::mg_Per_dL) > hypoglycemicComaLevel_mg_Per_dL + 3) { + patient.SetEvent(SEPatientEventType::HypoglycemicComa, false, m_data.GetSimulationTime()); }*/ - //hyperglycemia + // hyperglycemia if (m_venaCavaGlucose->GetConcentration(MassPerVolumeUnit::mg_Per_dL) > hyperglycemiaLevel_mg_Per_dL) { - patient.SetEvent(CDM::enumPatientEvent::Hyperglycemia, true, m_data.GetSimulationTime()); - } else if (patient.IsEventActive(CDM::enumPatientEvent::Hyperglycemia) && m_venaCavaGlucose->GetConcentration(MassPerVolumeUnit::mg_Per_dL) < hypoglycemicShockLevel_mg_Per_dL - 10) { - patient.SetEvent(CDM::enumPatientEvent::Hyperglycemia, false, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::Hyperglycemia, true, m_data.GetSimulationTime()); + } else if (patient.IsEventActive(SEPatientEventType::Hyperglycemia) && m_venaCavaGlucose->GetConcentration(MassPerVolumeUnit::mg_Per_dL) < hypoglycemicShockLevel_mg_Per_dL - 10) { + patient.SetEvent(SEPatientEventType::Hyperglycemia, false, m_data.GetSimulationTime()); } - //lactate check + // lactate check if (m_venaCavaLactate->GetConcentration(MassPerVolumeUnit::mg_Per_dL) > lacticAcidosisLevel_mg_Per_dL) { - patient.SetEvent(CDM::enumPatientEvent::LacticAcidosis, true, m_data.GetSimulationTime()); - } else if (patient.IsEventActive(CDM::enumPatientEvent::LacticAcidosis) && m_venaCavaLactate->GetConcentration(MassPerVolumeUnit::mg_Per_dL) < lacticAcidosisLevel_mg_Per_dL - 5) { - patient.SetEvent(CDM::enumPatientEvent::LacticAcidosis, false, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::LacticAcidosis, true, m_data.GetSimulationTime()); + } else if (patient.IsEventActive(SEPatientEventType::LacticAcidosis) && m_venaCavaLactate->GetConcentration(MassPerVolumeUnit::mg_Per_dL) < lacticAcidosisLevel_mg_Per_dL - 5) { + patient.SetEvent(SEPatientEventType::LacticAcidosis, false, m_data.GetSimulationTime()); } - //ketones check + // ketones check if (m_venaCavaKetones->GetConcentration(MassPerVolumeUnit::mg_Per_dL) > ketoacidosisLevel_mg_Per_dL) { - patient.SetEvent(CDM::enumPatientEvent::Ketoacidosis, true, m_data.GetSimulationTime()); - } else if (patient.IsEventActive(CDM::enumPatientEvent::Ketoacidosis) && m_venaCavaKetones->GetConcentration(MassPerVolumeUnit::mg_Per_dL) < ketoacidosisLevel_mg_Per_dL - 5) { - patient.SetEvent(CDM::enumPatientEvent::Ketoacidosis, false, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::Ketoacidosis, true, m_data.GetSimulationTime()); + } else if (patient.IsEventActive(SEPatientEventType::Ketoacidosis) && m_venaCavaKetones->GetConcentration(MassPerVolumeUnit::mg_Per_dL) < ketoacidosisLevel_mg_Per_dL - 5) { + patient.SetEvent(SEPatientEventType::Ketoacidosis, false, m_data.GetSimulationTime()); } - //sodium check - //Mild and severe hyponatremia + // sodium check + // Mild and severe hyponatremia if (m_venaCavaSodium->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) < 136.0) { - patient.SetEvent(CDM::enumPatientEvent::MildHyponatremia, true, m_data.GetSimulationTime()); - } else if (patient.IsEventActive(CDM::enumPatientEvent::MildHyponatremia) && m_venaCavaSodium->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) > 137.0) { - patient.SetEvent(CDM::enumPatientEvent::MildHyponatremia, false, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::MildHyponatremia, true, m_data.GetSimulationTime()); + } else if (patient.IsEventActive(SEPatientEventType::MildHyponatremia) && m_venaCavaSodium->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) > 137.0) { + patient.SetEvent(SEPatientEventType::MildHyponatremia, false, m_data.GetSimulationTime()); } if (m_venaCavaSodium->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) < 120.0) { - patient.SetEvent(CDM::enumPatientEvent::SevereHyponatremia, true, m_data.GetSimulationTime()); - } else if (patient.IsEventActive(CDM::enumPatientEvent::SevereHyponatremia) && m_venaCavaSodium->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) > 121.0) { - patient.SetEvent(CDM::enumPatientEvent::SevereHyponatremia, false, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::SevereHyponatremia, true, m_data.GetSimulationTime()); + } else if (patient.IsEventActive(SEPatientEventType::SevereHyponatremia) && m_venaCavaSodium->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) > 121.0) { + patient.SetEvent(SEPatientEventType::SevereHyponatremia, false, m_data.GetSimulationTime()); } - //Mild and severe hypernatremia + // Mild and severe hypernatremia if (m_venaCavaSodium->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) > 148.0) { - patient.SetEvent(CDM::enumPatientEvent::MildHypernatremia, true, m_data.GetSimulationTime()); - } else if (patient.IsEventActive(CDM::enumPatientEvent::MildHypernatremia) && m_venaCavaSodium->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) < 147.0) { - patient.SetEvent(CDM::enumPatientEvent::MildHypernatremia, false, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::MildHypernatremia, true, m_data.GetSimulationTime()); + } else if (patient.IsEventActive(SEPatientEventType::MildHypernatremia) && m_venaCavaSodium->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) < 147.0) { + patient.SetEvent(SEPatientEventType::MildHypernatremia, false, m_data.GetSimulationTime()); } if (m_venaCavaSodium->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) > 160.0) { - patient.SetEvent(CDM::enumPatientEvent::SevereHypernatremia, true, m_data.GetSimulationTime()); - } else if (patient.IsEventActive(CDM::enumPatientEvent::SevereHypernatremia) && m_venaCavaSodium->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) < 159.0) { - patient.SetEvent(CDM::enumPatientEvent::SevereHypernatremia, false, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::SevereHypernatremia, true, m_data.GetSimulationTime()); + } else if (patient.IsEventActive(SEPatientEventType::SevereHypernatremia) && m_venaCavaSodium->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) < 159.0) { + patient.SetEvent(SEPatientEventType::SevereHypernatremia, false, m_data.GetSimulationTime()); } - //potassium check - //mild and severe hypokalemia + // potassium check + // mild and severe hypokalemia if (m_venaCavaPotassium->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) < 3.2) { - patient.SetEvent(CDM::enumPatientEvent::MildHypokalemia, true, m_data.GetSimulationTime()); - } else if (patient.IsEventActive(CDM::enumPatientEvent::MildHypokalemia) && m_venaCavaSodium->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) > 3.3) { - patient.SetEvent(CDM::enumPatientEvent::MildHypokalemia, false, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::MildHypokalemia, true, m_data.GetSimulationTime()); + } else if (patient.IsEventActive(SEPatientEventType::MildHypokalemia) && m_venaCavaSodium->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) > 3.3) { + patient.SetEvent(SEPatientEventType::MildHypokalemia, false, m_data.GetSimulationTime()); } if (m_venaCavaPotassium->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) < 2.5) { - patient.SetEvent(CDM::enumPatientEvent::SevereHypokalemia, true, m_data.GetSimulationTime()); - } else if (patient.IsEventActive(CDM::enumPatientEvent::SevereHypokalemia) && m_venaCavaSodium->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) > 2.6) { - patient.SetEvent(CDM::enumPatientEvent::SevereHypokalemia, false, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::SevereHypokalemia, true, m_data.GetSimulationTime()); + } else if (patient.IsEventActive(SEPatientEventType::SevereHypokalemia) && m_venaCavaSodium->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) > 2.6) { + patient.SetEvent(SEPatientEventType::SevereHypokalemia, false, m_data.GetSimulationTime()); } - //mild and severe hyperkalemia + // mild and severe hyperkalemia if (m_venaCavaPotassium->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) > 5.5) { - patient.SetEvent(CDM::enumPatientEvent::MildHyperkalemia, true, m_data.GetSimulationTime()); - } else if (patient.IsEventActive(CDM::enumPatientEvent::MildHyperkalemia) && m_venaCavaSodium->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) < 5.6) { - patient.SetEvent(CDM::enumPatientEvent::MildHyperkalemia, false, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::MildHyperkalemia, true, m_data.GetSimulationTime()); + } else if (patient.IsEventActive(SEPatientEventType::MildHyperkalemia) && m_venaCavaSodium->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) < 5.6) { + patient.SetEvent(SEPatientEventType::MildHyperkalemia, false, m_data.GetSimulationTime()); } if (m_venaCavaPotassium->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) > 6.2) { - patient.SetEvent(CDM::enumPatientEvent::SevereHyperkalemia, true, m_data.GetSimulationTime()); - } else if (patient.IsEventActive(CDM::enumPatientEvent::SevereHyperkalemia) && m_venaCavaSodium->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) < 6.1) { - patient.SetEvent(CDM::enumPatientEvent::SevereHyperkalemia, false, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::SevereHyperkalemia, true, m_data.GetSimulationTime()); + } else if (patient.IsEventActive(SEPatientEventType::SevereHyperkalemia) && m_venaCavaSodium->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) < 6.1) { + patient.SetEvent(SEPatientEventType::SevereHyperkalemia, false, m_data.GetSimulationTime()); } } - m_ArterialOxygen_mmHg.Reset(); - m_ArterialCarbonDioxide_mmHg.Reset(); + m_ArterialOxygenAverage_mmHg.Reset(); + m_ArterialCarbonDioxideAverage_mmHg.Reset(); } if (m_data.GetState() > EngineState::InitialStabilization) { // Don't throw events if we are initializing @@ -908,18 +824,18 @@ void BloodChemistry::CheckBloodSubstanceLevels() // and from data presented in @cite purins2012brain and @cite doppenberg1998determination. if (m_brainO2->GetPartialPressure(PressureUnit::mmHg) < 19.0) { /// \event Patient: Brain Oxygen Deficit Event. The oxygen partial pressure in the brain has dropped to a dangerously low level. - patient.SetEvent(CDM::enumPatientEvent::BrainOxygenDeficit, true, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::BrainOxygenDeficit, true, m_data.GetSimulationTime()); // Irreversible damage occurs if the deficit has gone on too long - if (patient.GetEventDuration(CDM::enumPatientEvent::BrainOxygenDeficit, TimeUnit::s) > 1800.) { - m_ss << "Brain Oxygen partial pressure is " << m_brainO2->GetPartialPressure(PressureUnit::mmHg) << " and has been below the danger threshold for " << patient.GetEventDuration(CDM::enumPatientEvent::BrainOxygenDeficit, TimeUnit::s) << " seconds. Damage is irreversible."; + if (patient.GetEventDuration(SEPatientEventType::BrainOxygenDeficit, TimeUnit::s) > 1800.) { + m_ss << "Brain Oxygen partial pressure is " << m_brainO2->GetPartialPressure(PressureUnit::mmHg) << " and has been below the danger threshold for " << patient.GetEventDuration(SEPatientEventType::BrainOxygenDeficit, TimeUnit::s) << " seconds. Damage is irreversible."; Warning(m_ss); /// \irreversible Brain oxygen pressure has been dangerously low for more than 30 minutes. if (!m_PatientActions->HasOverride()) { - patient.SetEvent(CDM::enumPatientEvent::IrreversibleState, true, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::IrreversibleState, true, m_data.GetSimulationTime()); } else { - if (m_PatientActions->GetOverride()->GetOverrideConformance() == CDM::enumOnOff::On) { - patient.SetEvent(CDM::enumPatientEvent::IrreversibleState, true, m_data.GetSimulationTime()); + if (m_PatientActions->GetOverride()->GetOverrideConformance() == SEOnOff::On) { + patient.SetEvent(SEPatientEventType::IrreversibleState, true, m_data.GetSimulationTime()); } } } @@ -927,56 +843,56 @@ void BloodChemistry::CheckBloodSubstanceLevels() // If the O2 tension is below a critical threshold, the irreversible damage occurs more quickly if (m_brainO2->GetPartialPressure(PressureUnit::mmHg) < 10.0) { /// \event Patient: Critical Brain Oxygen Deficit Event. The oxygen partial pressure in the brain has dropped to a critically low level. - patient.SetEvent(CDM::enumPatientEvent::CriticalBrainOxygenDeficit, true, m_data.GetSimulationTime()); - } else if (patient.IsEventActive(CDM::enumPatientEvent::CriticalBrainOxygenDeficit) && m_brainO2->GetPartialPressure(PressureUnit::mmHg) > 12.0) { + patient.SetEvent(SEPatientEventType::CriticalBrainOxygenDeficit, true, m_data.GetSimulationTime()); + } else if (patient.IsEventActive(SEPatientEventType::CriticalBrainOxygenDeficit) && m_brainO2->GetPartialPressure(PressureUnit::mmHg) > 12.0) { /// \event Patient: End Brain Oxygen Deficit Event. The oxygen partial pressure has risen above 12 mmHg in the brain. If this occurs when the patient has a critical brain oxygen deficit event, it will reverse the event. /// The brain is not in a critical oxygen deficit. - patient.SetEvent(CDM::enumPatientEvent::CriticalBrainOxygenDeficit, false, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::CriticalBrainOxygenDeficit, false, m_data.GetSimulationTime()); } // Irreversible damage occurs if the critical deficit has gone on too long - if (patient.IsEventActive(CDM::enumPatientEvent::CriticalBrainOxygenDeficit) && patient.GetEventDuration(CDM::enumPatientEvent::CriticalBrainOxygenDeficit, TimeUnit::s) > 600.) { - m_ss << "Brain Oxygen partial pressure is " << m_brainO2->GetPartialPressure(PressureUnit::mmHg) << " and has been below the critical threshold for " << patient.GetEventDuration(CDM::enumPatientEvent::CriticalBrainOxygenDeficit, TimeUnit::s) << " seconds. Damage is irreversible."; + if (patient.IsEventActive(SEPatientEventType::CriticalBrainOxygenDeficit) && patient.GetEventDuration(SEPatientEventType::CriticalBrainOxygenDeficit, TimeUnit::s) > 600.) { + m_ss << "Brain Oxygen partial pressure is " << m_brainO2->GetPartialPressure(PressureUnit::mmHg) << " and has been below the critical threshold for " << patient.GetEventDuration(SEPatientEventType::CriticalBrainOxygenDeficit, TimeUnit::s) << " seconds. Damage is irreversible."; Warning(m_ss); /// \irreversible Brain oxygen pressure has been critically low for more than 10 minutes. if (!m_PatientActions->HasOverride()) { - patient.SetEvent(CDM::enumPatientEvent::IrreversibleState, true, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::IrreversibleState, true, m_data.GetSimulationTime()); } else { - if (m_PatientActions->GetOverride()->GetOverrideConformance() == CDM::enumOnOff::On) { - patient.SetEvent(CDM::enumPatientEvent::IrreversibleState, true, m_data.GetSimulationTime()); + if (m_PatientActions->GetOverride()->GetOverrideConformance() == SEOnOff::On) { + patient.SetEvent(SEPatientEventType::IrreversibleState, true, m_data.GetSimulationTime()); } } } } else if (m_brainO2->GetPartialPressure(PressureUnit::mmHg) > 23.0) { /// \event Patient: End Brain Oxygen Deficit Event. The oxygen partial pressure has risen above 25 mmHg in the brain. If this occurs when the patient has a brain oxygen deficit event, it will reverse the event. /// The brain is getting oxygen. - patient.SetEvent(CDM::enumPatientEvent::BrainOxygenDeficit, false, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::BrainOxygenDeficit, false, m_data.GetSimulationTime()); // The critical deficit event is also set to false just in case there is an unrealistically rapid transition in oxygen partial pressure. - patient.SetEvent(CDM::enumPatientEvent::CriticalBrainOxygenDeficit, false, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::CriticalBrainOxygenDeficit, false, m_data.GetSimulationTime()); } - //Myocardium Oxygen Check + // Myocardium Oxygen Check if (m_myocardiumO2->GetPartialPressure(PressureUnit::mmHg) < 5) { /// \event Patient: The heart is not receiving enough oxygen. Coronary arteries should dilate to increase blood flow to the heart. - patient.SetEvent(CDM::enumPatientEvent::MyocardiumOxygenDeficit, true, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::MyocardiumOxygenDeficit, true, m_data.GetSimulationTime()); - if (patient.GetEventDuration(CDM::enumPatientEvent::MyocardiumOxygenDeficit, TimeUnit::s) > 2400) // \cite murry1986preconditioning + if (patient.GetEventDuration(SEPatientEventType::MyocardiumOxygenDeficit, TimeUnit::s) > 2400) // \cite murry1986preconditioning { - m_ss << "Myocardium oxygen partial pressure is " << m_myocardiumO2->GetPartialPressure(PressureUnit::mmHg) << " and has been sustained for " << patient.GetEventDuration(CDM::enumPatientEvent::MyocardiumOxygenDeficit, TimeUnit::s) << "patient heart muscle has experienced necrosis and is in an irreversible state."; + m_ss << "Myocardium oxygen partial pressure is " << m_myocardiumO2->GetPartialPressure(PressureUnit::mmHg) << " and has been sustained for " << patient.GetEventDuration(SEPatientEventType::MyocardiumOxygenDeficit, TimeUnit::s) << "patient heart muscle has experienced necrosis and is in an irreversible state."; Warning(m_ss); /// \irreversible Heart has not been receiving enough oxygen for more than 40 min. if (!m_PatientActions->HasOverride()) { - patient.SetEvent(CDM::enumPatientEvent::IrreversibleState, true, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::IrreversibleState, true, m_data.GetSimulationTime()); } else { - if (m_PatientActions->GetOverride()->GetOverrideConformance() == CDM::enumOnOff::On) { - patient.SetEvent(CDM::enumPatientEvent::IrreversibleState, true, m_data.GetSimulationTime()); + if (m_PatientActions->GetOverride()->GetOverrideConformance() == SEOnOff::On) { + patient.SetEvent(SEPatientEventType::IrreversibleState, true, m_data.GetSimulationTime()); } } } } else if (m_myocardiumO2->GetPartialPressure(PressureUnit::mmHg) > 8) { /// \event Patient: End Myocardium Oxygen Event. The heart is now receiving enough oxygen. If this occurs when the patient has a heart oxygen deficit event, it will reverse the event. /// The brain is getting oxygen. - patient.SetEvent(CDM::enumPatientEvent::MyocardiumOxygenDeficit, false, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::MyocardiumOxygenDeficit, false, m_data.GetSimulationTime()); } } } @@ -991,14 +907,14 @@ void BloodChemistry::CheckBloodSubstanceLevels() //-------------------------------------------------------------------------------------------------- bool BloodChemistry::CalculateComprehensiveMetabolicPanel(SEComprehensiveMetabolicPanel& cmp) { - //for now the units on this are going to be hardcoded to be consistent with our validation data + // for now the units on this are going to be hardcoded to be consistent with our validation data /// \todo: update this to take in generic units, then allow the user to configure units on data call in the API or scenario files cmp.Reset(); double Albumin_g_Per_dL = m_data.GetSubstances().GetAlbumin().GetBloodConcentration(MassPerVolumeUnit::g_Per_dL); cmp.GetAlbumin().SetValue(Albumin_g_Per_dL, MassPerVolumeUnit::g_Per_dL); - //cmp.GetALP().SetValue(); - //cmp.GetALT().SetValue(); - //cmp.GetAST().SetValue(); + // cmp.GetALP().SetValue(); + // cmp.GetALT().SetValue(); + // cmp.GetAST().SetValue(); double BUN_mg_Per_dL = GetBloodUreaNitrogenConcentration(MassPerVolumeUnit::mg_Per_dL); cmp.GetBUN().SetValue(BUN_mg_Per_dL, MassPerVolumeUnit::mg_Per_dL); cmp.GetCalcium().Set(m_data.GetSubstances().GetCalcium().GetBloodConcentration()); @@ -1014,7 +930,7 @@ bool BloodChemistry::CalculateComprehensiveMetabolicPanel(SEComprehensiveMetabol cmp.GetPotassium().SetValue(K_mmol_Per_L, AmountPerVolumeUnit::mmol_Per_L); double Sodium_mmol_Per_L = m_data.GetSubstances().GetSodium().GetBloodConcentration(MassPerVolumeUnit::g_Per_L) / m_data.GetSubstances().GetSodium().GetMolarMass(MassPerAmountUnit::g_Per_mmol); cmp.GetSodium().SetValue(Sodium_mmol_Per_L, AmountPerVolumeUnit::mmol_Per_L); - //cmp.GetTotalBelirubin().SetValue(); + // cmp.GetTotalBelirubin().SetValue(); double TotalProtein_g_Per_dL = GetTotalProteinConcentration(MassPerVolumeUnit::g_Per_dL); cmp.GetTotalProtein().SetValue(TotalProtein_g_Per_dL, MassPerVolumeUnit::g_Per_dL); return true; @@ -1057,17 +973,17 @@ bool BloodChemistry::CalculateCompleteBloodCount(SECompleteBloodCount& cbc) cbc.GetLymphocyteCellCount().SetValue(GetLymphocyteCellCount().GetValue(AmountPerVolumeUnit::ct_Per_uL), AmountPerVolumeUnit::ct_Per_uL); cbc.GetPlateletCount().SetValue(325000, AmountPerVolumeUnit::ct_Per_uL); // Hardcoded for now, don't support PlateletCount yet cbc.GetMeanCorpuscularHemoglobin().SetValue(m_data.GetConfiguration().GetMeanCorpuscularHemoglobin(MassPerAmountUnit::pg_Per_ct), MassPerAmountUnit::pg_Per_ct); - cbc.GetMeanCorpuscularHemoglobinConcentration().SetValue(m_data.GetSubstances().GetHb().GetBloodConcentration(MassPerVolumeUnit::g_Per_dL) / GetHematocrit().GetValue(), MassPerVolumeUnit::g_Per_dL); //Average range should be 32-36 g/dL. (https://en.wikipedia.org/wiki/Mean_corpuscular_hemoglobin_concentration) + cbc.GetMeanCorpuscularHemoglobinConcentration().SetValue(m_data.GetSubstances().GetHb().GetBloodConcentration(MassPerVolumeUnit::g_Per_dL) / GetHematocrit().GetValue(), MassPerVolumeUnit::g_Per_dL); // Average range should be 32-36 g/dL. (https://en.wikipedia.org/wiki/Mean_corpuscular_hemoglobin_concentration) cbc.GetMeanCorpuscularVolume().SetValue(m_data.GetConfiguration().GetMeanCorpuscularVolume(VolumeUnit::uL), VolumeUnit::uL); - cbc.GetNeutrophilCount().SetValue(GetNeutrophilCellCount().GetValue(AmountPerVolumeUnit::ct_Per_uL), AmountPerVolumeUnit::ct_Per_uL); ///\TODO: update with correct data + cbc.GetNeutrophilCount().SetValue(GetNeutrophilCellCount().GetValue(AmountPerVolumeUnit::ct_Per_uL), AmountPerVolumeUnit::ct_Per_uL); ///\TODO: update with correct data double rbcCount_ct_Per_uL = m_venaCava->GetSubstanceQuantity(m_data.GetSubstances().GetRBC())->GetMolarity(AmountPerVolumeUnit::ct_Per_uL); cbc.GetRedBloodCellCount().SetValue(rbcCount_ct_Per_uL, AmountPerVolumeUnit::ct_Per_uL); - double wbcCount_ct_Per_uL = m_venaCava->GetSubstanceQuantity(m_data.GetSubstances().GetWBC())->GetMolarity(AmountPerVolumeUnit::ct_Per_uL); //m_data.GetSubstances().GetWBC().GetCellCount(AmountPerVolumeUnit::ct_Per_uL); + double wbcCount_ct_Per_uL = m_venaCava->GetSubstanceQuantity(m_data.GetSubstances().GetWBC())->GetMolarity(AmountPerVolumeUnit::ct_Per_uL); // m_data.GetSubstances().GetWBC().GetCellCount(AmountPerVolumeUnit::ct_Per_uL); cbc.GetWhiteBloodCellCount().SetValue(wbcCount_ct_Per_uL, AmountPerVolumeUnit::ct_Per_uL); return true; } -//Stub for Coagulation SOFA calculation for when we model platelet count more accurately +// Stub for Coagulation SOFA calculation for when we model platelet count more accurately SEScalar& BloodChemistry::CalculateCoagulationSOFA() { SEScalar* sofa = new SEScalar(); @@ -1083,18 +999,16 @@ SEScalar& BloodChemistry::CalculateCoagulationSOFA() //-------------------------------------------------------------------------------------------------- bool BloodChemistry::CalculateProthrombinTime(SEProthrombinTime& ptt) { - //super basic scaling as a function of viral load - ///\todo: make this a function of actual coagulation substances + // super basic scaling as a function of viral load + ///\todo: make this a function of actual coagulation substances double viralLoad = GetViralLoad().GetValue(AmountPerVolumeUnit::ct_Per_uL); - ptt.GetInternationalNormalizedRatio().Set(0.9); //average value + ptt.GetInternationalNormalizedRatio().Set(0.9); // average value if (viralLoad > ZERO_APPROX) { if (viralLoad > 1 && viralLoad < 3) { ptt.GetInternationalNormalizedRatio().Set(1.3); - } - else if (3 < viralLoad && viralLoad < 7) { + } else if (3 < viralLoad && viralLoad < 7) { ptt.GetInternationalNormalizedRatio().Set(1.9); - } - else if (7 < viralLoad) { + } else if (7 < viralLoad) { ptt.GetInternationalNormalizedRatio().Set(2.5); } } @@ -1138,20 +1052,20 @@ void BloodChemistry::CalculateHemolyticTransfusionReaction(bool rhMismatch) } if (!rhMismatch) { - if (m_data.GetPatient().GetBloodType() == (CDM::enumBloodType::O)) { + if (m_data.GetPatient().GetBloodType() == (SEBloodType::O)) { donorAntigen_ct = AntA_initial_ct + AntB_initial_ct; patientAntigen_ct = 0.0; - } else if (m_data.GetPatient().GetBloodType() == (CDM::enumBloodType::A)) { + } else if (m_data.GetPatient().GetBloodType() == (SEBloodType::A)) { donorAntigen_ct = AntB_initial_ct; patientAntigen_ct = AntA_initial_ct; - } else if (m_data.GetPatient().GetBloodType() == (CDM::enumBloodType::B)) { + } else if (m_data.GetPatient().GetBloodType() == (SEBloodType::B)) { donorAntigen_ct = AntA_initial_ct; patientAntigen_ct = AntB_initial_ct; } } else { double newBloodVolume_uL = GetRhTransfusionReactionVolume().GetValue(VolumeUnit::uL) - (m_RhTransfusionReactionVolume_mL * 1000.0); LLIM(newBloodVolume_uL, 0.0); - donorAntigen_ct = m_RhFactorMismatch_ct + (antigens_per_rbc * 5280000.0 * newBloodVolume_uL); //value based on BioGears baseline molarity for rbc in ct/uL + donorAntigen_ct = m_RhFactorMismatch_ct + (antigens_per_rbc * 5280000.0 * newBloodVolume_uL); // value based on BioGears baseline molarity for rbc in ct/uL patientAntigen_ct = 0.0; } @@ -1163,18 +1077,18 @@ void BloodChemistry::CalculateHemolyticTransfusionReaction(bool rhMismatch) double HealExp = 1.0 - (patientRBC / (5280000.0 * 4800000.0)); // uL of blood at steady state times ct/uL of rbc BLIM(HealExp, 0.0, 1.0); double HealFactor = std::pow(5.0, HealExp); - double RBC_birth = HealFactor * m_data.GetSubstances().GetRBC().GetClearance().GetCellBirthRate().GetValue(FrequencyUnit::Per_s); //per s(increased by factor of 10) - double RBC_death = m_data.GetSubstances().GetRBC().GetClearance().GetCellDeathRate(FrequencyUnit::Per_s); //per s + double RBC_birth = HealFactor * m_data.GetSubstances().GetRBC().GetClearance().GetCellBirthRate().GetValue(FrequencyUnit::Per_s); // per s(increased by factor of 10) + double RBC_death = m_data.GetSubstances().GetRBC().GetClearance().GetCellDeathRate(FrequencyUnit::Per_s); // per s - //Surface Area of rbc stacked, based on surface area of cylinders + // Surface Area of rbc stacked, based on surface area of cylinders double sa1 = 1.3e-6; // SA of 1 cell | | double sa2 = 1.9e-6; // SA of 2 cell | || | double sa3 = 2.4e-6; // SA of 3 cell | || || | double antpercm2 = antigens_per_rbc / sa1; double aggpercm2 = agglutinin_per_rbc / sa1; - double D1 = 1.4e-11; //cm2 per s and is diffusion coefficient of one rbc - double R1 = 3.5e-4; //cm and is radius of one rbc + double D1 = 1.4e-11; // cm2 per s and is diffusion coefficient of one rbc + double R1 = 3.5e-4; // cm and is radius of one rbc double R2 = R1 * cbrt(2); double R3 = R1 * cbrt(3); double D2 = (D1 * R1) / (R2); @@ -1187,13 +1101,13 @@ void BloodChemistry::CalculateHemolyticTransfusionReaction(bool rhMismatch) double agg3 = (aggpercm2 * sa3); double ant3 = (antpercm2 * sa3); - double timedelay = 1e-4; //tuning factor for timing of response, increasing does more agglutination, play with this + double timedelay = 1e-4; // tuning factor for timing of response, increasing does more agglutination, play with this double tuning11 = timedelay / ((agg1 + ant1) * (agg1 + ant1)); double tuning12 = timedelay / ((agg1 + ant1) * (agg2 + ant2)); double tuning22 = timedelay / ((agg2 + ant2) * (agg2 + ant2)); double tuning13 = timedelay / ((agg1 + ant1) * (agg3 + ant3)); - //Agglutinate Probabilities + // Agglutinate Probabilities double oneK1 = tuning11 * ((2.0 * D1) * (2.0 * R1)) / (4.0 * D1 * R1); double twoK1 = tuning12 * ((D1 + D2) * (R1 + R2)) / (4.0 * D1 * R1); double twoK2 = tuning22 * ((D2 + D2) * (R2 + R2)) / (4.0 * D1 * R1); @@ -1219,11 +1133,11 @@ void BloodChemistry::CalculateHemolyticTransfusionReaction(bool rhMismatch) m_4Agglutinate_ct = newC4RBC; LLIM(m_4Agglutinate_ct, 0.0); if ((m_donorRBC_ct + m_2Agglutinate_ct + m_d3Agglutinate_ct) == 0.0) { - patient.SetEvent(CDM::enumPatientEvent::HemolyticTransfusionReaction, false, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::HemolyticTransfusionReaction, false, m_data.GetSimulationTime()); } // Agglutination and cell death will likewise release items the blood cells were carrying into the blood stream and make them less useful to the body - //The tuning parameters below tune the physiological response of HTR through hemoglobin removal (cleared renally), lowering of blood oxygen, and increase in metabolic demand + // The tuning parameters below tune the physiological response of HTR through hemoglobin removal (cleared renally), lowering of blood oxygen, and increase in metabolic demand double effectTune_Hb = 1.1; double oxygenTune = 50000.0; double metabolismTune = 750.0; @@ -1237,7 +1151,7 @@ void BloodChemistry::CalculateHemolyticTransfusionReaction(bool rhMismatch) double liveDonorCell_pct = 1.0 - deadDonorCells_pct; double livePatientCell_pct = 1.0 - deadPatientCells_pct; - double deadCells_percent = ((newAggglutinates * 4.0) / TotalRBC); //4.0 cells in a "stable" agglutinate + double deadCells_percent = ((newAggglutinates * 4.0) / TotalRBC); // 4.0 cells in a "stable" agglutinate BLIM(deadCells_percent, 0.0, 1.0); double liveCells_percent = (1.0 - (deadCells_percent)); double Hb_percent = (1.0 - (deadCells_percent * effectTune_Hb)); @@ -1272,24 +1186,24 @@ void BloodChemistry::CalculateHemolyticTransfusionReaction(bool rhMismatch) compt->GetSubstanceQuantity(RBC_substance)->GetMolarity().SetValue(compt->GetSubstanceQuantity(RBC_substance)->GetMolarity().GetValue(AmountPerVolumeUnit::ct_Per_uL) * liveCells_percent, AmountPerVolumeUnit::ct_Per_uL); compt->GetSubstanceQuantity(RBC_substance)->Balance(BalanceLiquidBy::Molarity); - if (m_data.GetPatient().GetBloodType() == (CDM::enumBloodType::O)) { + if (m_data.GetPatient().GetBloodType() == (SEBloodType::O)) { compt->GetSubstanceQuantity(AntigenA_substance)->GetMass().SetValue(compt->GetSubstanceQuantity(AntigenA_substance)->GetMass(MassUnit::ug) * liveDonorCell_pct, MassUnit::ug); compt->GetSubstanceQuantity(AntigenB_substance)->GetMass().SetValue(compt->GetSubstanceQuantity(AntigenB_substance)->GetMass(MassUnit::ug) * liveDonorCell_pct, MassUnit::ug); compt->GetSubstanceQuantity(AntigenA_substance)->Balance(BalanceLiquidBy::Mass); compt->GetSubstanceQuantity(AntigenB_substance)->Balance(BalanceLiquidBy::Mass); - } else if (m_data.GetPatient().GetBloodType() == (CDM::enumBloodType::A)) { + } else if (m_data.GetPatient().GetBloodType() == (SEBloodType::A)) { compt->GetSubstanceQuantity(AntigenA_substance)->GetMass().SetValue(compt->GetSubstanceQuantity(AntigenA_substance)->GetMass(MassUnit::ug) * livePatientCell_pct, MassUnit::ug); compt->GetSubstanceQuantity(AntigenB_substance)->GetMass().SetValue(compt->GetSubstanceQuantity(AntigenB_substance)->GetMass(MassUnit::ug) * liveDonorCell_pct, MassUnit::ug); compt->GetSubstanceQuantity(AntigenA_substance)->Balance(BalanceLiquidBy::Mass); compt->GetSubstanceQuantity(AntigenB_substance)->Balance(BalanceLiquidBy::Mass); - } else if (m_data.GetPatient().GetBloodType() == (CDM::enumBloodType::B)) { + } else if (m_data.GetPatient().GetBloodType() == (SEBloodType::B)) { compt->GetSubstanceQuantity(AntigenA_substance)->GetMass().SetValue(compt->GetSubstanceQuantity(AntigenA_substance)->GetMass(MassUnit::ug) * liveDonorCell_pct, MassUnit::ug); compt->GetSubstanceQuantity(AntigenB_substance)->GetMass().SetValue(compt->GetSubstanceQuantity(AntigenB_substance)->GetMass(MassUnit::ug) * livePatientCell_pct, MassUnit::ug); compt->GetSubstanceQuantity(AntigenA_substance)->Balance(BalanceLiquidBy::Mass); compt->GetSubstanceQuantity(AntigenB_substance)->Balance(BalanceLiquidBy::Mass); } } - double MetabolismAfterHTR = m_data.GetEnergy().GetTotalMetabolicRate().GetValue(PowerUnit::W); //used (primarily) for core temp increase + double MetabolismAfterHTR = m_data.GetEnergy().GetTotalMetabolicRate().GetValue(PowerUnit::W); // used (primarily) for core temp increase MetabolismAfterHTR += metabolicIncrease; m_data.GetEnergy().GetTotalMetabolicRate().SetValue(MetabolismAfterHTR, PowerUnit::W); @@ -1326,34 +1240,34 @@ void BloodChemistry::ManageSIRS() { SEThermalCircuitPath* coreCompliance = m_data.GetCircuits().GetInternalTemperatureCircuit().GetPath(BGE::InternalTemperaturePath::InternalCoreToGround); - //Physiological response + // Physiological response SESubstance& wbcBaseline = m_data.GetSubstances().GetWBC(); double tissueIntegrity = m_InflammatoryResponse->GetTissueIntegrity().GetValue(); double neutrophilActive = m_InflammatoryResponse->GetNeutrophilActive().GetValue(); - //Set pathological effects, starting with updating white blood cell count. Scaled down to get max levels around 25-30k ct_Per_uL + // Set pathological effects, starting with updating white blood cell count. Scaled down to get max levels around 25-30k ct_Per_uL double wbcCount_ct_Per_uL = m_venaCava->GetSubstanceQuantity(m_data.GetSubstances().GetWBC())->GetMolarity(AmountPerVolumeUnit::ct_Per_uL); double wbcAbsolute_ct_Per_uL = wbcCount_ct_Per_uL * (1.0 + neutrophilActive / 0.25); m_venaCava->GetSubstanceQuantity(m_data.GetSubstances().GetWBC())->GetMolarity().SetValue(wbcAbsolute_ct_Per_uL, AmountPerVolumeUnit::ct_Per_uL); GetWhiteBloodCellCount().SetValue(wbcAbsolute_ct_Per_uL, AmountPerVolumeUnit::ct_Per_uL); - //Use the tissue integrity output from the inflammation model to track other Systemic Inflammatory metrics. These relationships were all - //empirically determined to time symptom onset (i.e. temperature > 38 degC) with the appropriate stage of sepsis + // Use the tissue integrity output from the inflammation model to track other Systemic Inflammatory metrics. These relationships were all + // empirically determined to time symptom onset (i.e. temperature > 38 degC) with the appropriate stage of sepsis double sigmoidInput = 1.0 - tissueIntegrity; - //Respiration effects--Done in Respiratory system + // Respiration effects--Done in Respiratory system - //Temperature (fever) effects -- Accounted for by Energy::UpdateHeatResistance, which accounts for altered skin blood flow + // Temperature (fever) effects -- Accounted for by Energy::UpdateHeatResistance, which accounts for altered skin blood flow - //Bilirubin counts (measure of liver perfusion) + // Bilirubin counts (measure of liver perfusion) const double baselineBilirubin_mg_Per_dL = 0.70; - const double maxBilirubin_mg_Per_dL = 26.0; //Not a physiologal max, but Jones2009Sequential (SOFA score) gives max score when total bilirubin > 12 mg/dL - const double halfMaxWBC = 0.85; //White blood cell fraction that causes half-max bilirubin concentration. Set well above 0.5 becuase this is a later sign of shock - const double shapeParam = 10.0; //Empirically determined to make sure we get above 12 mg/dL (severe liver damage) before wbc maxes out + const double maxBilirubin_mg_Per_dL = 26.0; // Not a physiologal max, but Jones2009Sequential (SOFA score) gives max score when total bilirubin > 12 mg/dL + const double halfMaxWBC = 0.85; // White blood cell fraction that causes half-max bilirubin concentration. Set well above 0.5 becuase this is a later sign of shock + const double shapeParam = 10.0; // Empirically determined to make sure we get above 12 mg/dL (severe liver damage) before wbc maxes out double totalBilirubin_mg_Per_dL = GeneralMath::LogisticFunction(maxBilirubin_mg_Per_dL, halfMaxWBC, shapeParam, sigmoidInput) + baselineBilirubin_mg_Per_dL; GetTotalBilirubin().SetValue(totalBilirubin_mg_Per_dL, MassPerVolumeUnit::mg_Per_dL); - double basalTissueEnergyDemand_W = m_Patient->GetBasalMetabolicRate(PowerUnit::W) * 0.8; //Discounting the 20% used by brain + double basalTissueEnergyDemand_W = m_Patient->GetBasalMetabolicRate(PowerUnit::W) * 0.8; // Discounting the 20% used by brain const double maxDeficitMultiplier = 0.35; double energyDeficit_W = basalTissueEnergyDemand_W * maxDeficitMultiplier * std::pow(sigmoidInput, 2.0) / (std::pow(sigmoidInput, 2.0) + 0.5 * 0.5); m_data.GetEnergy().GetEnergyDeficit().SetValue(energyDeficit_W, PowerUnit::W); @@ -1375,208 +1289,236 @@ void BloodChemistry::ManageSIRS() //-------------------------------------------------------------------------------------------------- void BloodChemistry::InflammatoryResponse() { - std::vector sources = m_InflammatoryResponse->GetInflammationSources(); + std::vector sources = m_InflammatoryResponse->GetInflammationSources(); double burnTotalBodySurfaceAreaIntensity = 0.0; double ebolaTemp = 0.0; + double fractureSeverity = 0.0; + + /* + m_data.GetDataTrack().Probe("macrophages ", m_InflammatoryResponse->GetMacrophageActive().GetValue()); + m_data.GetDataTrack().Probe("neutrophils ", m_InflammatoryResponse->GetNeutrophilActive().GetValue()); + m_data.GetDataTrack().Probe("trauma ", m_InflammatoryResponse->GetTrauma().GetValue()); + */ if (m_data.GetActions().GetPatientActions().HasInfection()) { - if (std::find(sources.begin(), sources.end(), CDM::enumInflammationSource::Infection) == sources.end()) { + if (std::find(sources.begin(), sources.end(), SEInflammationSource::Infection) == sources.end()) { double initialPathogen = 0.0; switch (m_data.GetActions().GetPatientActions().GetInfection()->GetSeverity()) { - case CDM::enumInfectionSeverity::Mild: + case SEInfectionSeverity::Mild: initialPathogen = 1.0e6; break; - case CDM::enumInfectionSeverity::Moderate: + case SEInfectionSeverity::Moderate: initialPathogen = 5.0e6; break; - case CDM::enumInfectionSeverity::Severe: + case SEInfectionSeverity::Severe: initialPathogen = 2.5e7; break; default: - initialPathogen = 1.0e6; //Default to very mild infection + initialPathogen = 1.0e6; // Default to very mild infection } m_InflammatoryResponse->GetLocalPathogen().SetValue(initialPathogen); - m_InflammatoryResponse->SetActiveTLR(CDM::enumOnOff::On); - m_InflammatoryResponse->GetInflammationSources().push_back(CDM::enumInflammationSource::Infection); + m_InflammatoryResponse->SetActiveTLR(SEOnOff::On); + m_InflammatoryResponse->GetInflammationSources().push_back(SEInflammationSource::Infection); } } if (m_data.GetActions().GetPatientActions().HasEbola()) { - if (std::find(sources.begin(), sources.end(), CDM::enumInflammationSource::Ebola) == sources.end()) { + if (std::find(sources.begin(), sources.end(), SEInflammationSource::Ebola) == sources.end()) { double initialPathogen = 0.0; switch (m_data.GetActions().GetPatientActions().GetEbola()->GetSeverity()) { - case CDM::enumInfectionSeverity::Mild: + case SEInfectionSeverity::Mild: initialPathogen = 1.0e6; break; - case CDM::enumInfectionSeverity::Moderate: + case SEInfectionSeverity::Moderate: initialPathogen = 5.0e6; break; - case CDM::enumInfectionSeverity::Severe: + case SEInfectionSeverity::Severe: initialPathogen = 8.0e6; break; default: - initialPathogen = 1.0e6; //Default to very mild infection + initialPathogen = 1.0e6; // Default to very mild infection } m_InflammatoryResponse->GetLocalPathogen().SetValue(initialPathogen); - m_InflammatoryResponse->SetActiveTLR(CDM::enumOnOff::On); - m_InflammatoryResponse->GetInflammationSources().push_back(CDM::enumInflammationSource::Ebola); + m_InflammatoryResponse->SetActiveTLR(SEOnOff::On); + m_InflammatoryResponse->GetInflammationSources().push_back(SEInflammationSource::Ebola); } } // mapping severity of the ebola infection to a tuning parameter to change inflammation dynamics if (m_data.GetActions().GetPatientActions().HasEbola()) { switch (m_data.GetActions().GetPatientActions().GetEbola()->GetSeverity()) { - case CDM::enumInfectionSeverity::Mild: + case SEInfectionSeverity::Mild: ebolaTemp = 0.1; break; - case CDM::enumInfectionSeverity::Moderate: + case SEInfectionSeverity::Moderate: ebolaTemp = 0.15; break; - case CDM::enumInfectionSeverity::Severe: + case SEInfectionSeverity::Severe: ebolaTemp = 0.2; break; + default: + break; } - m_InflammatoryResponse->GetTrauma().SetValue(ebolaTemp); //This causes inflammatory mediators (particulalary IL-6) to peak around 4 hrs at levels similar to those induced by pathogen + m_InflammatoryResponse->GetTrauma().SetValue(ebolaTemp); // This causes inflammatory mediators (particulalary IL-6) to peak around 4 hrs at levels similar to those induced by pathogen } if (m_data.GetActions().GetPatientActions().HasBurnWound()) { burnTotalBodySurfaceAreaIntensity = m_data.GetActions().GetPatientActions().GetBurnWound()->GetBurnIntensity(); - if (std::find(sources.begin(), sources.end(), CDM::enumInflammationSource::Burn) == sources.end()) { - m_InflammatoryResponse->GetTrauma().SetValue(burnTotalBodySurfaceAreaIntensity); //This causes inflammatory mediators (particulalary IL-6) to peak around 4 hrs at levels similar to those induced by pathogen - m_InflammatoryResponse->GetInflammationSources().push_back(CDM::enumInflammationSource::Burn); + if (std::find(sources.begin(), sources.end(), SEInflammationSource::Burn) == sources.end()) { + m_InflammatoryResponse->GetTrauma().SetValue(burnTotalBodySurfaceAreaIntensity); // This causes inflammatory mediators (particulalary IL-6) to peak around 4 hrs at levels similar to those induced by pathogen + m_InflammatoryResponse->GetInflammationSources().push_back(SEInflammationSource::Burn); } } if (m_data.GetActions().GetPatientActions().HasHemorrhage()) { - if (std::find(sources.begin(), sources.end(), CDM::enumInflammationSource::Hemorrhage) == sources.end()) { + if (std::find(sources.begin(), sources.end(), SEInflammationSource::Hemorrhage) == sources.end()) { m_InflammatoryResponse->GetTrauma().SetValue(1.0); m_InflammatoryResponse->GetAutonomicResponseLevel().SetValue(1.0); - m_InflammatoryResponse->GetInflammationSources().push_back(CDM::enumInflammationSource::Hemorrhage); + m_InflammatoryResponse->GetInflammationSources().push_back(SEInflammationSource::Hemorrhage); } } + if (m_data.GetActions().GetPatientActions().HasFracture()) { + SEFracture* fracture = m_data.GetActions().GetPatientActions().GetFracture(); + SEFracturedBone bone = fracture->GetFracturedBone(); + SEFractureType type = fracture->GetFractureType(); + SESide side = fracture->GetSide(); + double fractureSeverity = fracture->GetSeverity().GetValue(); - //Perform this check after looking for inflammatory actions (otherwise we'll never process) + m_InflammatoryResponse->GetTrauma().SetValue(fractureSeverity); + m_InflammatoryResponse->GetAutonomicResponseLevel().SetValue(fractureSeverity); + m_InflammatoryResponse->GetInflammationSources().push_back(SEInflammationSource::Fracture); + } + + // Perform this check after looking for inflammatory actions (otherwise we'll never process) if (!m_InflammatoryResponse->HasInflammationSources()) { return; } //------------------Previous State-------------------------------------- - double PT = 0.0, MT = 0.0, NT = 0.0, B = 0.0, PB = 0.0, MR = 0.0, MA = 0.0, NR = 0.0, NA = 0.0, ER = 0.0, EA = 0.0, eNOS = 0.0, iNOSd = 0.0, iNOS = 0.0, NO3 = 0.0, NO = 0.0, I6 = 0.0, I10 = 0.0, I12 = 0.0, TNF = 0.0, TI = 0.0, TR = 0.0, R = 0.0, A = 0.0, CA = 0.0, iTime = 0.0; - PT = m_InflammatoryResponse->GetLocalPathogen().GetValue(); //Local tissue pathogen - MT = m_InflammatoryResponse->GetLocalMacrophage().GetValue(); //Local tissue macrophages - NT = m_InflammatoryResponse->GetLocalNeutrophil().GetValue(); //Local tissue neutrophil - B = m_InflammatoryResponse->GetLocalBarrier().GetValue(); //Local tissue barrier integrity - CDM::enumOnOff::value TLR = m_InflammatoryResponse->GetActiveTLR(); //Toll-like receptors: When active, promote degradation of local tissue barrier integrity - PB = m_InflammatoryResponse->GetBloodPathogen().GetValue(); //Pathogen that has passed through local tissue barrier into bloodstream - MR = m_InflammatoryResponse->GetMacrophageResting().GetValue(); //Resting blood macrophages - MA = m_InflammatoryResponse->GetMacrophageActive().GetValue(); //Active blood macrophages - NR = m_InflammatoryResponse->GetNeutrophilResting().GetValue(); //Resting blood neutrophils - NA = m_InflammatoryResponse->GetNeutrophilActive().GetValue(); //Active blood neutrophils - eNOS = m_InflammatoryResponse->GetConstitutiveNOS().GetValue(); //Blood nitrogen oxide synthase (constituitive) - iNOSd = m_InflammatoryResponse->GetInducibleNOSPre().GetValue(); //Blood nitrogen oxide synthase (pre-inducible) - iNOS = m_InflammatoryResponse->GetInducibleNOS().GetValue(); //Blood nitrogen oxide syntase (induced) - NO3 = m_InflammatoryResponse->GetNitrate().GetValue(); //Blood nitrate--product of NO (unstable radical) - NO = m_InflammatoryResponse->GetNitricOxide().GetValue(); //Blood nitric oxide - I6 = m_InflammatoryResponse->GetInterleukin6().GetValue(); //Blood interleukin-6 - I10 = m_InflammatoryResponse->GetInterleukin10().GetValue(); //Blood interleukin-10 - I12 = m_InflammatoryResponse->GetInterleukin12().GetValue(); //Blood interleukin-12 - TNF = m_InflammatoryResponse->GetTumorNecrosisFactor().GetValue(); //Blood tumor-necrosis factor - CA = m_InflammatoryResponse->GetCatecholamines().GetValue(); - A = m_InflammatoryResponse->GetAutonomicResponseLevel().GetValue(); - TI = m_InflammatoryResponse->GetTissueIntegrity().GetValue(); //Global tissue integrity - TR = m_InflammatoryResponse->GetTrauma().GetValue(); //Trauma - iTime = m_InflammatoryResponse->GetInflammationTime(TimeUnit::hr); + auto R = 0.0; + auto PT = m_InflammatoryResponse->GetLocalPathogen().GetValue(); // Local tissue pathogen + auto MT = m_InflammatoryResponse->GetLocalMacrophage().GetValue(); // Local tissue macrophages + auto NT = m_InflammatoryResponse->GetLocalNeutrophil().GetValue(); // Local tissue neutrophil + auto B = m_InflammatoryResponse->GetLocalBarrier().GetValue(); // Local tissue barrier integrity + auto TLR = m_InflammatoryResponse->GetActiveTLR(); // Toll-like receptors: When active, promote degradation of local tissue barrier integrity + auto PB = m_InflammatoryResponse->GetBloodPathogen().GetValue(); // Pathogen that has passed through local tissue barrier into bloodstream + auto MR = m_InflammatoryResponse->GetMacrophageResting().GetValue(); // Resting blood macrophages + auto MA = m_InflammatoryResponse->GetMacrophageActive().GetValue(); // Active blood macrophages + auto NR = m_InflammatoryResponse->GetNeutrophilResting().GetValue(); // Resting blood neutrophils + auto NA = m_InflammatoryResponse->GetNeutrophilActive().GetValue(); // Active blood neutrophils + auto eNOS = m_InflammatoryResponse->GetConstitutiveNOS().GetValue(); // Blood nitrogen oxide synthase (constituitive) + auto iNOSd = m_InflammatoryResponse->GetInducibleNOSPre().GetValue(); // Blood nitrogen oxide synthase (pre-inducible) + auto iNOS = m_InflammatoryResponse->GetInducibleNOS().GetValue(); // Blood nitrogen oxide syntase (induced) + auto NO3 = m_InflammatoryResponse->GetNitrate().GetValue(); // Blood nitrate--product of NO (unstable radical) + auto NO = m_InflammatoryResponse->GetNitricOxide().GetValue(); // Blood nitric oxide + auto I6 = m_InflammatoryResponse->GetInterleukin6().GetValue(); // Blood interleukin-6 + auto I10 = m_InflammatoryResponse->GetInterleukin10().GetValue(); // Blood interleukin-10 + auto I12 = m_InflammatoryResponse->GetInterleukin12().GetValue(); // Blood interleukin-12 + auto TNF = m_InflammatoryResponse->GetTumorNecrosisFactor().GetValue(); // Blood tumor-necrosis factor + auto CA = m_InflammatoryResponse->GetCatecholamines().GetValue(); + auto A = m_InflammatoryResponse->GetAutonomicResponseLevel().GetValue(); + auto TI = m_InflammatoryResponse->GetTissueIntegrity().GetValue(); // Global tissue integrity + auto TR = m_InflammatoryResponse->GetTrauma().GetValue(); // Trauma + auto iTime = m_InflammatoryResponse->GetInflammationTime(TimeUnit::hr); //------------------------------Model Parameters----------------------------- - double scale = 1.0; //This parameter can be set very high to investigate state equation trajectores (i.e. set to 60 to simulate 30 hrs in 30 min). Note that there is no guarantee of validity of other BG outputs + double scale = 1.0; // This parameter can be set very high to investigate state equation trajectores (i.e. set to 60 to simulate 30 hrs in 30 min). Note that there is no guarantee of validity of other BG outputs //----Tissue parameters are taken from Dominguez2017Mathematical; kap = growth rate, psi = degradation rate, eps = inhibition, del = decay (other params defined) - //Tissue pathogen - double thetaP = 1.35e-4; //Rate of bacteria translocation from tissue to blood + // Tissue pathogen + double thetaP = 1.35e-4; // Rate of bacteria translocation from tissue to blood double epsPB = 3.1, psiPM = 6.3e-3, psiPN = 6.1e-4, kapP = 0.6; - double uP = 3.7e4; //Saturation constant for bacteria - //Tissue macrophage - double Mv = 3.0e-1; //Resting macrophage pool + double uP = 3.7e4; // Saturation constant for bacteria + // Tissue macrophage + double Mv = 3.0e-1; // Resting macrophage pool double delM = 6.4e-5, epsMB = 3.6e1; - double beta = 2.6e-2; //Activation of macrophages - //Tissue neutrophil - double Nv = 1e8; //Resting neutrophil pool + double beta = 2.6e-2; // Activation of macrophages + // Tissue neutrophil + double Nv = 1e8; // Resting neutrophil pool double delN = 6.1e-2, epsNB = 3.6e1, epsNM = 1.6e-1; - double alpha = 6.975e-7; //Activation of neutrophils - //Local barrier + double alpha = 6.975e-7; // Activation of neutrophils + // Local barrier double kapB = 4.6e-2, epsBP = 2.6e1, psiBP = 1.4e-1, psiBN = 4.0e-8; - //TLR switch + // TLR switch double pUpper = 2.0e6; double pLower = 1.0e3; //--Blood parameters are from Chow2005Diverse; kYZ = effect of Z on Y, xYZ = amount of Z to bring effect to half its max - //Blood Source terms + // Blood Source terms double sM = 1.0, sN = 1.0, s6 = 0.001, s10 = 0.01; - //Blood Pathogen parameters - double kPN = 5.8; //Phagocytic effect of activated neutrophils on pathogen, determined empirically - double xPN = 0.5; //Level of pathogen that brings elimination of P by neutrophils to 50% of max - double kPS = 6.9e3; //Background immune response to pathogen in blood - double xPS = 1.3e4; //Saturation of background immune response - //Trauma decay - double kTr = 0.0; //Base value--will be adjusted during burn/hemorrhage (see below) + // Blood Pathogen parameters + double kPN = 5.8; // Phagocytic effect of activated neutrophils on pathogen, determined empirically + double xPN = 0.5; // Level of pathogen that brings elimination of P by neutrophils to 50% of max + double kPS = 6.9e3; // Background immune response to pathogen in blood + double xPS = 1.3e4; // Saturation of background immune response + // Trauma decay + double kTr = 0.0; // Base value--will be adjusted during burn/hemorrhage (see below) double xTr = 0.67; - //Volume and blood pressure effect - double fB = 0.0; //0 except during hemorrhage - //Macrophage interaction - double kML = 1.01e2, kMTR = 0.04, kM6 = 0.1, kMB = 0.0495, kMR = 0.05, kMD = 0.05, xML = 37.5, xMD = 0.75, xMTNF = 0.4, xM6 = 1.0, xM10 = 0.297, xMCA = 0.9; //Note xMD was 1.0 for burn, see if this messes things up - //Activate macrophage interactions + // Volume and blood pressure effect + double fB = 0.0; // 0 except during hemorrhage + // Macrophage interaction + double kML = 1.01e2, kMTR = 0.04, kM6 = 0.1, kMB = 0.0495, kMR = 0.05, kMD = 0.05, xML = 37.5, xMD = 0.75, xMTNF = 0.4, xM6 = 1.0, xM10 = 0.297, xMCA = 0.9; // Note xMD was 1.0 for burn, see if this messes things up + // Activate macrophage interactions double kMANO = 0.2, kMA = 0.2; - //Neutrophil interactions -- kN6 and kNTNF tuned for infection - double kNL = 3.375e1, kNTNF = 0.4, kN6 = 1.5, kNB = 0.1, kND = 0.05, kNTR = 0.02, kNTGF = 0.1, kNR = 0.05, kNNO = 0.4, kNA = 0.5, xNL = 56.25, xNTNF = 2.0, xN6 = 1.0, xND = 0.4, xN10 = 0.2; //xND was 0.4 for burn - //Inducible nitric oxide synthase + // Neutrophil interactions -- kN6 and kNTNF tuned for infection + double kNL = 3.375e1, kNTNF = 0.4, kN6 = 1.5, kNB = 0.1, kND = 0.05, kNTR = 0.02, kNTGF = 0.1, kNR = 0.05, kNNO = 0.4, kNA = 0.5, xNL = 56.25, xNTNF = 2.0, xN6 = 1.0, xND = 0.4, xN10 = 0.2; // xND was 0.4 for burn + // Inducible nitric oxide synthase double kINOSN = 1.5, kINOSM = 0.1, kINOSEC = 0.1, kINOS6 = 2.0, kINOSd = 0.05, kINOS = 0.101, xINOS10 = 0.1, xINOSTNF = 0.05, xINOS6 = 0.1, xINOSNO = 0.3; - //Constituitive nitric oxide synthase + // Constituitive nitric oxide synthase double kENOS = 4.0, kENOSEC = 0.05, xENOSTNF = 0.4, xENOSL = 1.015, xENOSTR = 0.1; - //Nitric oxide + // Nitric oxide double kNO3 = 0.46, kNOMA = 2.0; - //TNF + // TNF double kTNFN = 2.97, kTNFM = 0.1, kTNF = 1.4, xTNF6 = 0.059, xTNF10 = 0.079; - //IL6 + // IL6 double k6M = 3.03, k6TNF = 1.0, k62 = 3.4, k6NO = 2.97, k6 = 0.7, k6N = 0.2, x610 = 0.1782, x6TNF = 0.1, x66 = 0.5, x6NO = 0.4, h66 = 1.0; - //IL10 + // IL10 double k10MA = 0.1, k10N = 0.1, k10A = 62.87, k10TNF = 1.485, k106 = 0.051, k10 = 0.35, k10R = 0.1, x10TNF = 0.05, x1012 = 0.01, x106 = 0.08; - //CA + // CA double kCA = 0.1, kCATR = 0.16; - //IL12 + // IL12 double k12M = 0.303, k12 = 0.05, x12TNF = 0.2, x126 = 0.2, x1210 = 0.2525; - //Autonomic response - double kAuto = 0.0, xAuto = 1.15; //Base value--will be adjusted during burn/hemorrhage (see below) - //Damage + // Autonomic response + double kAuto = 0.0, xAuto = 1.15; // Base value--will be adjusted during burn/hemorrhage (see below) + // Damage double kD6 = 0.125, kD = 0.15, kDB = 0.02, xD6 = 0.85, xDNO = 0.5, hD6 = 6.0; - double kDTR = 0.0; //This is a base value that will be adjusted as a function of type and severity of trauma - double tiMin = 0.2; //Minimum tissue integrity allowed + double kDTR = 0.0; // This is a base value that will be adjusted as a function of type and severity of trauma + double tiMin = 0.2; // Minimum tissue integrity allowed - //Antibiotic effects + // Antibiotic effects double antibacterialEffect = m_data.GetDrugs().GetAntibioticActivity().GetValue(); //------------------Inflammation source specific modifications and/or actions -------------------------------- + if (m_InflammatoryResponse->HasInflammationSource(SEInflammationSource::Fracture)) { + // Parameters modified to recreate trends for inflammatory response to bone fracture + kTr = 2.0 * iTime / (xTr * xTr); + kDTR = 0.5*fractureSeverity; + kAuto = 2.0 * iTime / (xAuto * xAuto); + kD = 0.05; + k6 = 1.25; + } if (burnTotalBodySurfaceAreaIntensity != 0) { - //Burns inflammation happens on a differnt time scale. These parameters were tuned for infecton--return to nominal values - kDTR = 11.0 * burnTotalBodySurfaceAreaIntensity; //We assume that larger burns inflict damage more rapidly - kTr = 0.25 / burnTotalBodySurfaceAreaIntensity; //We assume that larger burns take longer for trauma to resolve - tiMin = 0.008; //Promotes faster damage accumulation + // Burns inflammation happens on a differnt time scale. These parameters were tuned for infecton--return to nominal values + kDTR = 11.0 * burnTotalBodySurfaceAreaIntensity; // We assume that larger burns inflict damage more rapidly + kTr = 0.25 / burnTotalBodySurfaceAreaIntensity; // We assume that larger burns take longer for trauma to resolve + tiMin = 0.008; // Promotes faster damage accumulation kD6 = 0.3, xD6 = 0.25, kD = 0.1, kNTNF = 0.2, kN6 = 0.557, hD6 = 4, h66 = 4.0, x1210 = 0.049; scale = 1.0; } - if (m_InflammatoryResponse->HasInflammationSource(CDM::enumInflammationSource::Ebola)) { - //for ebola we assume the patient has been incubating for 8 days, after this time inflammation will occur on a rapid time scale. These parameters were tuned for infecton--return to nominal values - //kapP *= ebolaTemp; - //thetaP *= 0.1; - double kPS = 6.9e1; //reduce Background immune response to pathogen in blood for ebola + if (m_InflammatoryResponse->HasInflammationSource(SEInflammationSource::Ebola)) { + // for ebola we assume the patient has been incubating for 8 days, after this time inflammation will occur on a rapid time scale. These parameters were tuned for infecton--return to nominal values + // kapP *= ebolaTemp; + // thetaP *= 0.1; + double kPS = 6.9e1; // reduce Background immune response to pathogen in blood for ebola scale = 1.0; } if (PB > ZERO_APPROX) { ManageSIRS(); } - if (m_InflammatoryResponse->HasInflammationSource(CDM::enumInflammationSource::Hemorrhage)) { + if (m_InflammatoryResponse->HasInflammationSource(SEInflammationSource::Hemorrhage)) { double volumeEffect = m_data.GetCardiovascular().GetBloodVolume(VolumeUnit::mL) / m_data.GetPatient().GetBloodVolumeBaseline(VolumeUnit::mL); volumeEffect = std::min(volumeEffect, 1.0); if (volumeEffect < 1.0) { fB = std::pow(1.0 - volumeEffect, 4.0); } - //These parameters are 'as is' from Chow2005Shock (kTr and kAuto depend on duration of inflammation). These parameters are w/ respect to mice. - /// \ ToDo: Investigate whether these parameters can be further optimized for humans + // These parameters are 'as is' from Chow2005Shock (kTr and kAuto depend on duration of inflammation). These parameters are w/ respect to mice. + /// \ ToDo: Investigate whether these parameters can be further optimized for humans kTr = 2.0 * iTime / (xTr * xTr); kDTR = 0.05; kAuto = 2.0 * iTime / (xAuto * xAuto); @@ -1584,26 +1526,26 @@ void BloodChemistry::InflammatoryResponse() } //---------------------State equations---------------------------------------------- - //Differential containers + // Differential containers double dPT = 0.0, dMT = 0.0, dNT = 0.0, dBT = 0.0, dPB = 0.0, dMR = 0.0, dMA = 0.0, dNR = 0.0, dNA = 0.0, dER = 0.0, dEA = 0.0, dENOS = 0.0, dINOSd = 0.0, dINOS = 0.0, dNO3 = 0.0, dI6 = 0.0, dI10 = 0.0, dI12 = 0.0, dTNF = 0.0, dTI = 0.0, dTR = 0.0, dB = 0.0, dCA = 0.0, dA = 0.0; - //TLR state depends on the last TLR state and the tissue pathogen populaton + // TLR state depends on the last TLR state and the tissue pathogen populaton if (PT > pUpper) { - R = 1.0; //TLR always active if pathogen above max threshold - TLR = CDM::enumOnOff::On; + R = 1.0; // TLR always active if pathogen above max threshold + TLR = SEOnOff::On; } else if (PT > pLower) { - if (TLR == CDM::enumOnOff::On) { - R = 1.0; //If pathogen between min/max threshold, it remains at its previous values + if (TLR == SEOnOff::On) { + R = 1.0; // If pathogen between min/max threshold, it remains at its previous values } else { R = 0.0; } } else { - R = 0.0; //If pathogen below min threshold, it is always inactive - TLR = CDM::enumOnOff::Off; + R = 0.0; // If pathogen below min threshold, it is always inactive + TLR = SEOnOff::Off; } - //Process equations + // Process equations dPT = (kapP / uP) * PT * (1.0 - PT) - thetaP * PT / (1.0 + epsPB * B) - psiPN * NT * PT - psiPM * MT * PT; if (PT < ZERO_APPROX) { - //Make sure when we get close to P = 0 that we don't take too big a step and pull a negative P for next iteration + // Make sure when we get close to P = 0 that we don't take too big a step and pull a negative P for next iteration PT = 0.0; dPT = 0.0; } @@ -1611,7 +1553,7 @@ void BloodChemistry::InflammatoryResponse() dNT = alpha * R * Nv / ((1.0 + epsNB * B) * (1.0 + epsNM * MT)) - delN * NT; dB = kapB / (1.0 + epsBP * R) * B * (1.0 - B) - psiBP * R * B - psiBN * NT * B; dPB = (kapP - antibacterialEffect) * PB + thetaP * PT / (1.0 + epsPB * B) - kPS * PB / (xPS + PB) - kPN * NA * GeneralMath::HillActivation(PB, xPN, 2.0); - dTR = -kTr * TR; //This is assumed to be the driving force for burn + dTR = -kTr * TR; // This is assumed to be the driving force for burn dMR = -((kML * GeneralMath::HillActivation(PB, xML, 2.0) + kMD * GeneralMath::HillActivation(1.0 - TI, xMD, 4.0)) * (GeneralMath::HillActivation(TNF, xMTNF, 2.0) + kM6 * GeneralMath::HillActivation(I6, xM6, 2.0)) + kMTR * TR + kMB * fB) * MR * GeneralMath::HillInhibition(I10, xM10, 2.0) - kMR * (MR - sM); dMA = ((kML * GeneralMath::HillActivation(PB, xML, 2.0) + kMD * GeneralMath::HillActivation(1.0 - TI, xMD, 4.0)) * (GeneralMath::HillActivation(TNF, xMTNF, 2.0) + kM6 * GeneralMath::HillActivation(I6, xM6, 2.0)) + kMTR * TR + kMB * fB) * MR * GeneralMath::HillInhibition(I10, xM10, 2.0) - kMA * MA; dNR = -(kNL * GeneralMath::HillActivation(PB, xNL, 2.0) + kNTNF * xNTNF * GeneralMath::HillActivation(TNF, xNTNF, 1.0) + kN6 * std::pow(xN6, 2.0) * GeneralMath::HillActivation(I6, xN6, 2.0) + kND * std::pow(xND, 2.0) * GeneralMath::HillActivation(1.0 - TI, xND, 2.0) + kNTR * TR + kNB * fB) * GeneralMath::HillInhibition(I10, xN10, 2.0) * NR - kNR * (NR - sN); @@ -1650,23 +1592,23 @@ void BloodChemistry::InflammatoryResponse() m_InflammatoryResponse->GetCatecholamines().IncrementValue(dCA * m_dt_hr * scale); m_InflammatoryResponse->GetAutonomicResponseLevel().IncrementValue(dA * m_dt_hr * scale); m_InflammatoryResponse->GetTissueIntegrity().IncrementValue(dTI * m_dt_hr * scale); - NO = iNOS * (1.0 + kNOMA * (m_InflammatoryResponse->GetMacrophageActive().GetValue() + m_InflammatoryResponse->GetNeutrophilActive().GetValue())) + eNOS; //Algebraic relationship, not differential + NO = iNOS * (1.0 + kNOMA * (m_InflammatoryResponse->GetMacrophageActive().GetValue() + m_InflammatoryResponse->GetNeutrophilActive().GetValue())) + eNOS; // Algebraic relationship, not differential m_InflammatoryResponse->GetNitricOxide().SetValue(NO); m_InflammatoryResponse->SetActiveTLR(TLR); m_InflammatoryResponse->GetInflammationTime().IncrementValue(m_dt_hr, TimeUnit::hr); - //for now viral and bacterial infections will be handeled the same way + // for now viral and bacterial infections will be handeled the same way GetViralLoad().SetValue(m_InflammatoryResponse->GetBloodPathogen().GetValue(), AmountPerVolumeUnit::ct_Per_uL); //------------------------Check to see if infection-induced inflammation has resolved sufficient to eliminate action----------------------- - //Note that even though we remove the infection, we leave the inflammation source active. This is because we want the inflammation markers + // Note that even though we remove the infection, we leave the inflammation source active. This is because we want the inflammation markers // to return to normal, baseline values. - const double bloodPathogenLimit = 1.0e-5; //This is 1e-4 % of approximate max blood pathogen that model can eliminate withoug antibiotics - const double tissuePathogenLimit = 1.0; //This is 1e-4 % of the initial value for a mild infection + const double bloodPathogenLimit = 1.0e-5; // This is 1e-4 % of approximate max blood pathogen that model can eliminate withoug antibiotics + const double tissuePathogenLimit = 1.0; // This is 1e-4 % of the initial value for a mild infection if ((PT < tissuePathogenLimit) && (PB < bloodPathogenLimit) && (m_data.GetActions().GetPatientActions().HasInfection())) { m_data.GetActions().GetPatientActions().RemoveInfection(); } - //We could put a check here to see if all inflammation states are back to baseline and then remove it from the sources vector - //However, I think this would only happen over an extremely long run, and so it does not seem likely to be a major need. + // We could put a check here to see if all inflammation states are back to baseline and then remove it from the sources vector + // However, I think this would only happen over an extremely long run, and so it does not seem likely to be a major need. } //-------------------------------------------------------------------------------------------------- /// \brief @@ -1729,16 +1671,16 @@ void BloodChemistry::ProcessOverride() void BloodChemistry::OverrideControlLoop() { auto override = m_data.GetActions().GetPatientActions().GetOverride(); - constexpr double maxArtPHOverride = 14.0; //Arterial pH - constexpr double minArtPHOverride = 0.0; //Arterial pH - constexpr double maxVenPHOverride = 14.0; //Venous pH - constexpr double minVenPHOverride = 0.0; //Venous pH - constexpr double maxCO2SaturationOverride = 1.0; //Carbon Dioxide Saturation - constexpr double minCO2SaturationOverride = 0.0; //Carbon Dioxide Saturation - constexpr double maxCOSaturationOverride = 1.0; //Carbon Monoxide Saturation - constexpr double minCOSaturationOverride = 0.0; //Carbon Monoxide Saturation - constexpr double maxO2SaturationOverride = 1.0; //Oxygen Saturation - constexpr double minO2SaturationOverride = 0.0; //Oxygen Saturation + constexpr double maxArtPHOverride = 14.0; // Arterial pH + constexpr double minArtPHOverride = 0.0; // Arterial pH + constexpr double maxVenPHOverride = 14.0; // Venous pH + constexpr double minVenPHOverride = 0.0; // Venous pH + constexpr double maxCO2SaturationOverride = 1.0; // Carbon Dioxide Saturation + constexpr double minCO2SaturationOverride = 0.0; // Carbon Dioxide Saturation + constexpr double maxCOSaturationOverride = 1.0; // Carbon Monoxide Saturation + constexpr double minCOSaturationOverride = 0.0; // Carbon Monoxide Saturation + constexpr double maxO2SaturationOverride = 1.0; // Oxygen Saturation + constexpr double minO2SaturationOverride = 0.0; // Oxygen Saturation constexpr double maxPhosphateOverride = 1000.0; // mmol/mL constexpr double minPhosphateOverride = 0.0; // mmol/mL constexpr double maxTotalBilirubinOverride = 500.0; // mg/dL @@ -1754,18 +1696,18 @@ void BloodChemistry::OverrideControlLoop() constexpr double maxSodiumConcentrationOverride = 500.0; // mg/mL constexpr double minSodiumConcentrationOverride = 0.0; // mg/mL - double currentArtPHOverride = GetArterialBloodPH().GetValue(); //Current Arterial pH, value gets changed in next check - double currentVenPHOverride = GetVenousBloodPH().GetValue(); //Current Venous pH, value gets changed in next check - double currentCO2SaturationOverride = 0.0; //value gets changed in next check - double currentCOSaturationOverride = 0.0; //value gets changed in next check - double currentO2SaturationOverride = 0.0; //value gets changed in next check - double currentPhosphateOverride = 0.0; //value gets changed in next check - double currentTotalBilirubinOverride = 0.0; //value gets changed in next check - double currentCalciumConcentrationOverride = 0.0; //value gets changed in next check - double currentGlucoseConcentrationOverride = 0.0; //value gets changed in next check - double currentLactateConcentrationOverride = 0.0; //value gets changed in next check - double currentPotassiumConcentrationOverride = 0.0; //value gets changed in next check - double currentSodiumConcentrationOverride = 0.0; //value gets changed in next check + double currentArtPHOverride = GetArterialBloodPH().GetValue(); // Current Arterial pH, value gets changed in next check + double currentVenPHOverride = GetVenousBloodPH().GetValue(); // Current Venous pH, value gets changed in next check + double currentCO2SaturationOverride = 0.0; // value gets changed in next check + double currentCOSaturationOverride = 0.0; // value gets changed in next check + double currentO2SaturationOverride = 0.0; // value gets changed in next check + double currentPhosphateOverride = 0.0; // value gets changed in next check + double currentTotalBilirubinOverride = 0.0; // value gets changed in next check + double currentCalciumConcentrationOverride = 0.0; // value gets changed in next check + double currentGlucoseConcentrationOverride = 0.0; // value gets changed in next check + double currentLactateConcentrationOverride = 0.0; // value gets changed in next check + double currentPotassiumConcentrationOverride = 0.0; // value gets changed in next check + double currentSodiumConcentrationOverride = 0.0; // value gets changed in next check if (override->HasArterialPHOverride()) { currentArtPHOverride = override->GetArterialPHOverride().GetValue(); @@ -1804,65 +1746,65 @@ void BloodChemistry::OverrideControlLoop() currentSodiumConcentrationOverride = override->GetSodiumConcentrationOverride(MassPerVolumeUnit::mg_Per_mL); } - if ((currentArtPHOverride < minArtPHOverride || currentArtPHOverride > maxArtPHOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentArtPHOverride < minArtPHOverride || currentArtPHOverride > maxArtPHOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Arterial Blood pH Override (BloodChemistry) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentVenPHOverride < minVenPHOverride || currentVenPHOverride > maxVenPHOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentVenPHOverride < minVenPHOverride || currentVenPHOverride > maxVenPHOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Venous Blood pH (BloodChemistry) Override set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentCO2SaturationOverride < minCO2SaturationOverride || currentCO2SaturationOverride > maxCO2SaturationOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentCO2SaturationOverride < minCO2SaturationOverride || currentCO2SaturationOverride > maxCO2SaturationOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "CO2 Saturation (BloodChemistry) Override set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentCOSaturationOverride < minCOSaturationOverride || currentCOSaturationOverride > maxCOSaturationOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentCOSaturationOverride < minCOSaturationOverride || currentCOSaturationOverride > maxCOSaturationOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "CO Saturation (BloodChemistry) Override set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentO2SaturationOverride < minO2SaturationOverride || currentO2SaturationOverride > maxO2SaturationOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentO2SaturationOverride < minO2SaturationOverride || currentO2SaturationOverride > maxO2SaturationOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Oxygen Saturation (BloodChemistry) Override set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentPhosphateOverride < minPhosphateOverride || currentPhosphateOverride > maxPhosphateOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentPhosphateOverride < minPhosphateOverride || currentPhosphateOverride > maxPhosphateOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Phosphate (BloodChemistry) Override set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentTotalBilirubinOverride < minTotalBilirubinOverride || currentTotalBilirubinOverride > maxTotalBilirubinOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentTotalBilirubinOverride < minTotalBilirubinOverride || currentTotalBilirubinOverride > maxTotalBilirubinOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Total Bilirubin (BloodChemistry) Override set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentCalciumConcentrationOverride < minCalciumConcentrationOverride || currentCalciumConcentrationOverride > maxCalciumConcentrationOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentCalciumConcentrationOverride < minCalciumConcentrationOverride || currentCalciumConcentrationOverride > maxCalciumConcentrationOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Calcium Concentration (BloodChemistry) Override set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentGlucoseConcentrationOverride < minGlucoseConcentrationOverride || currentGlucoseConcentrationOverride > maxGlucoseConcentrationOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentGlucoseConcentrationOverride < minGlucoseConcentrationOverride || currentGlucoseConcentrationOverride > maxGlucoseConcentrationOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Glucose Concentration (BloodChemistry) Override set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentLactateConcentrationOverride < minLactateConcentrationOverride || currentLactateConcentrationOverride > maxLactateConcentrationOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentLactateConcentrationOverride < minLactateConcentrationOverride || currentLactateConcentrationOverride > maxLactateConcentrationOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Lactate Concentration (BloodChemistry) Override set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentPotassiumConcentrationOverride < minPotassiumConcentrationOverride || currentPotassiumConcentrationOverride > maxPotassiumConcentrationOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentPotassiumConcentrationOverride < minPotassiumConcentrationOverride || currentPotassiumConcentrationOverride > maxPotassiumConcentrationOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Potassium Concentration (BloodChemistry) Override set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentSodiumConcentrationOverride < minSodiumConcentrationOverride || currentSodiumConcentrationOverride > maxSodiumConcentrationOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentSodiumConcentrationOverride < minSodiumConcentrationOverride || currentSodiumConcentrationOverride > maxSodiumConcentrationOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Sodium Concentration (BloodChemistry) Override set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } } } diff --git a/projects/biogears/libBiogears/src/engine/Systems/Cardiovascular.cpp b/projects/biogears/libBiogears/src/engine/Systems/Cardiovascular.cpp index 2acf42d4f..04c595120 100644 --- a/projects/biogears/libBiogears/src/engine/Systems/Cardiovascular.cpp +++ b/projects/biogears/libBiogears/src/engine/Systems/Cardiovascular.cpp @@ -14,6 +14,8 @@ specific language governing permissions and limitations under the License. #include #include #include +#include +#include #include #include #include @@ -49,7 +51,9 @@ specific language governing permissions and limitations under the License. #include #include -namespace BGE = mil::tatrc::physiology::biogears; + +#include "io/cdm/Physiology.h" +#include "io/cdm/Property.h" namespace biogears { auto Cardiovascular::make_unique(BioGears& bg) -> std::unique_ptr @@ -63,18 +67,18 @@ Cardiovascular::Cardiovascular(BioGears& bg) , m_circuitCalculator(FlowComplianceUnit::mL_Per_mmHg, VolumePerTimeUnit::mL_Per_s, FlowInertanceUnit::mmHg_s2_Per_mL, PressureUnit::mmHg, VolumeUnit::mL, FlowResistanceUnit::mmHg_s_Per_mL, bg.GetLogger()) , m_transporter(VolumePerTimeUnit::mL_Per_s, VolumeUnit::mL, MassUnit::ug, MassPerVolumeUnit::ug_Per_mL, bg.GetLogger()) { - Clear(); + Invalidate(); m_TuningFile = ""; } Cardiovascular::~Cardiovascular() { - Clear(); + Invalidate(); } -void Cardiovascular::Clear() +void Cardiovascular::Invalidate() { - SECardiovascularSystem::Clear(); + SECardiovascularSystem::Invalidate(); m_patient = nullptr; m_CirculatoryCircuit = nullptr; @@ -160,20 +164,20 @@ void Cardiovascular::Initialize() { BioGearsSystem::Initialize(); - m_HeartRhythm = CDM::enumHeartRhythm::NormalSinus; + m_HeartRhythm = SEHeartRhythm::NormalSinus; m_StartSystole = true; m_HeartFlowDetected = false; - m_CardiacCyclePeriod_s = 0.8; //seconds per beat + m_CardiacCyclePeriod_s = 0.8; // seconds per beat m_CardiacCycleDiastolicVolume_mL = 0.0; m_CardiacCycleStrokeVolume_mL = 0; m_CurrentCardiacCycleDuration_s = 0; - //Heart Elastance Parameters + // Heart Elastance Parameters m_LeftHeartElastance_mmHg_Per_mL = 0.0; m_LeftHeartElastanceMax_mmHg_Per_mL = m_data.GetConfiguration().GetLeftHeartElastanceMaximum(FlowElastanceUnit::mmHg_Per_mL); m_LeftHeartElastanceMin_mmHg_Per_mL = m_data.GetConfiguration().GetLeftHeartElastanceMinimum(FlowElastanceUnit::mmHg_Per_mL); - m_LeftHeartElastanceModifier = 1.0; //Utilized for reducing the maximum elastance to represent left ventricular systolic dysfunction + m_LeftHeartElastanceModifier = 1.0; // Utilized for reducing the maximum elastance to represent left ventricular systolic dysfunction m_RightHeartElastance_mmHg_Per_mL = 0.0; m_RightHeartElastanceMax_mmHg_Per_mL = m_data.GetConfiguration().GetRightHeartElastanceMaximum(FlowElastanceUnit::mmHg_Per_mL); m_RightHeartElastanceMin_mmHg_Per_mL = m_data.GetConfiguration().GetRightHeartElastanceMinimum(FlowElastanceUnit::mmHg_Per_mL); @@ -184,7 +188,7 @@ void Cardiovascular::Initialize() m_CompressionRatio = 0.0; m_CompressionPeriod_s = 0.0; - //Initialize system data based on patient file inputs + // Initialize system data based on patient file inputs GetBloodVolume().Set(m_patient->GetBloodVolumeBaseline()); GetTotalBloodVolumeLost().SetValue(0.0, VolumeUnit::mL); m_CardiacCycleAortaPressureHigh_mmHg = m_patient->GetSystolicArterialPressureBaseline(PressureUnit::mmHg); @@ -227,7 +231,7 @@ void Cardiovascular::Initialize() double systemicVascularResistance_mmHg_s_Per_mL = (GetMeanArterialPressure().GetValue(PressureUnit::mmHg) - GetMeanCentralVenousPressure().GetValue(PressureUnit::mmHg)) / GetCardiacOutput().GetValue(VolumePerTimeUnit::mL_Per_s); GetSystemicVascularResistance().SetValue(systemicVascularResistance_mmHg_s_Per_mL, FlowResistanceUnit::mmHg_s_Per_mL); - //This is not part of stabilization due to not knowing when we hit the patient parameters with a circuit configuration + // This is not part of stabilization due to not knowing when we hit the patient parameters with a circuit configuration TuneCircuit(); systemicVascularResistance_mmHg_s_Per_mL = (GetMeanArterialPressure().GetValue(PressureUnit::mmHg) - GetMeanCentralVenousPressure().GetValue(PressureUnit::mmHg)) / GetCardiacOutput().GetValue(VolumePerTimeUnit::mL_Per_s); GetSystemicVascularResistance().SetValue(systemicVascularResistance_mmHg_s_Per_mL, FlowResistanceUnit::mmHg_s_Per_mL); @@ -235,111 +239,14 @@ void Cardiovascular::Initialize() m_RightHeartElastanceMax_mmHg_Per_mL = m_data.GetConfiguration().GetRightHeartElastanceMaximum(FlowElastanceUnit::mmHg_Per_mL); m_patient->GetBloodVolumeBaseline().Set(GetBloodVolume()); - m_OverrideLHEMin_Conformant_mmHg = m_data.GetConfiguration().GetLeftHeartElastanceMinimum(FlowElastanceUnit::mmHg_Per_mL); //m_patient->GetSystolicArterialPressureBaseline(PressureUnit::mmHg); - m_OverrideRHEMin_Conformant_mmHg = m_data.GetConfiguration().GetRightHeartElastanceMinimum(FlowElastanceUnit::mmHg_Per_mL); //m_patient->GetDiastolicArterialPressureBaseline(PressureUnit::mmHg); + m_OverrideLHEMin_Conformant_mmHg = m_data.GetConfiguration().GetLeftHeartElastanceMinimum(FlowElastanceUnit::mmHg_Per_mL); // m_patient->GetSystolicArterialPressureBaseline(PressureUnit::mmHg); + m_OverrideRHEMin_Conformant_mmHg = m_data.GetConfiguration().GetRightHeartElastanceMinimum(FlowElastanceUnit::mmHg_Per_mL); // m_patient->GetDiastolicArterialPressureBaseline(PressureUnit::mmHg); m_OverrideLHEMax_Conformant_mmHg = m_LeftHeartElastanceMax_mmHg_Per_mL; m_OverrideRHEMax_Conformant_mmHg = m_RightHeartElastanceMax_mmHg_Per_mL; m_overrideTime_s = 0.0; } -bool Cardiovascular::Load(const CDM::BioGearsCardiovascularSystemData& in) -{ - if (!SECardiovascularSystem::Load(in)) - return false; - - m_StartSystole = in.StartSystole(); - m_HeartFlowDetected = in.HeartFlowDetected(); - m_EnterCardiacArrest = in.EnterCardiacArrest(); - m_CardiacCyclePeriod_s = in.CardiacCyclePeriod_s(); - m_CurrentCardiacCycleDuration_s = in.CurrentCardiacCycleDuration_s(); - m_LeftHeartElastanceModifier = in.LeftHeartElastanceModifier(); - m_LeftHeartElastance_mmHg_Per_mL = in.LeftHeartElastance_mmHg_Per_mL(); - m_LeftHeartElastanceMax_mmHg_Per_mL = in.LeftHeartElastanceMax_mmHg_Per_mL(); - m_LeftHeartElastanceMin_mmHg_Per_mL = in.LeftHeartElastanceMin_mmHg_Per_mL(); - m_RightHeartElastance_mmHg_Per_mL = in.RightHeartElastance_mmHg_Per_mL(); - m_RightHeartElastanceMax_mmHg_Per_mL = in.RightHeartElastanceMax_mmHg_Per_mL(); - m_RightHeartElastanceMin_mmHg_Per_mL = in.RightHeartElastanceMin_mmHg_Per_mL(); - - //need to initialize these on a state load or there is an nan error that pops up, - ///todo: might want to revisit the override functionality to properly do this - m_OverrideLHEMax_Conformant_mmHg = m_LeftHeartElastanceMax_mmHg_Per_mL; - m_OverrideRHEMax_Conformant_mmHg = m_RightHeartElastanceMax_mmHg_Per_mL; - m_OverrideLHEMin_Conformant_mmHg = m_LeftHeartElastanceMin_mmHg_Per_mL; - m_OverrideRHEMin_Conformant_mmHg = m_RightHeartElastanceMin_mmHg_Per_mL; - - - m_CompressionTime_s = in.CompressionTime_s(); - m_CompressionRatio = in.CompressionRatio(); - m_CompressionPeriod_s = in.CompressionPeriod_s(); - - m_CurrentCardiacCycleTime_s = in.CurrentCardiacCycleTime_s(); - m_CardiacCycleDiastolicVolume_mL = in.CardiacCycleDiastolicVolume_mL(); - m_CardiacCycleAortaPressureLow_mmHg = in.CardiacCycleAortaPressureLow_mmHg(); - m_CardiacCycleAortaPressureHigh_mmHg = in.CardiacCycleAortaPressureHigh_mmHg(); - m_CardiacCyclePulmonaryArteryPressureLow_mmHg = in.CardiacCyclePulmonaryArteryPressureLow_mmHg(); - m_CardiacCyclePulmonaryArteryPressureHigh_mmHg = in.CardiacCyclePulmonaryArteryPressureHigh_mmHg(); - m_LastCardiacCycleMeanArterialCO2PartialPressure_mmHg = in.LastCardiacCycleMeanArterialCO2PartialPressure_mmHg(); - m_CardiacCycleStrokeVolume_mL = in.CardiacCycleStrokeVolume_mL(); - - m_CardiacCycleArterialPressure_mmHg.Load(in.CardiacCycleArterialPressure_mmHg()); - m_CardiacCycleArterialCO2PartialPressure_mmHg.Load(in.CardiacCycleArterialCO2PartialPressure_mmHg()); - m_CardiacCyclePulmonaryCapillariesWedgePressure_mmHg.Load(in.CardiacCyclePulmonaryCapillariesWedgePressure_mmHg()); - m_CardiacCyclePulmonaryCapillariesFlow_mL_Per_s.Load(in.CardiacCyclePulmonaryCapillariesFlow_mL_Per_s()); - m_CardiacCyclePulmonaryShuntFlow_mL_Per_s.Load(in.CardiacCyclePulmonaryShuntFlow_mL_Per_s()); - m_CardiacCyclePulmonaryArteryPressure_mmHg.Load(in.CardiacCyclePulmonaryArteryPressure_mmHg()); - m_CardiacCycleCentralVenousPressure_mmHg.Load(in.CardiacCycleCentralVenousPressure_mmHg()); - m_CardiacCycleSkinFlow_mL_Per_s.Load(in.CardiacCycleSkinFlow_mL_Per_s()); - - BioGearsSystem::LoadState(); - return true; -} -CDM::BioGearsCardiovascularSystemData* Cardiovascular::Unload() const -{ - CDM::BioGearsCardiovascularSystemData* data = new CDM::BioGearsCardiovascularSystemData(); - Unload(*data); - return data; -} -void Cardiovascular::Unload(CDM::BioGearsCardiovascularSystemData& data) const -{ - SECardiovascularSystem::Unload(data); - - data.StartSystole(m_StartSystole); - data.HeartFlowDetected(m_HeartFlowDetected); - data.EnterCardiacArrest(m_EnterCardiacArrest); - data.CardiacCyclePeriod_s(m_CardiacCyclePeriod_s); - data.CurrentCardiacCycleDuration_s(m_CurrentCardiacCycleDuration_s); - data.LeftHeartElastance_mmHg_Per_mL(m_LeftHeartElastance_mmHg_Per_mL); - data.LeftHeartElastanceModifier(m_LeftHeartElastanceModifier); - data.LeftHeartElastanceMax_mmHg_Per_mL(m_LeftHeartElastanceMax_mmHg_Per_mL); - data.LeftHeartElastanceMin_mmHg_Per_mL(m_LeftHeartElastanceMin_mmHg_Per_mL); - data.RightHeartElastance_mmHg_Per_mL(m_RightHeartElastance_mmHg_Per_mL); - data.RightHeartElastanceMax_mmHg_Per_mL(m_RightHeartElastanceMax_mmHg_Per_mL); - data.RightHeartElastanceMin_mmHg_Per_mL(m_RightHeartElastanceMin_mmHg_Per_mL); - - data.CompressionTime_s(m_CompressionTime_s); - data.CompressionRatio(m_CompressionRatio); - data.CompressionPeriod_s(m_CompressionPeriod_s); - - data.CurrentCardiacCycleTime_s(m_CurrentCardiacCycleTime_s); - data.CardiacCycleDiastolicVolume_mL(m_CardiacCycleDiastolicVolume_mL); - data.CardiacCycleAortaPressureLow_mmHg(m_CardiacCycleAortaPressureLow_mmHg); - data.CardiacCycleAortaPressureHigh_mmHg(m_CardiacCycleAortaPressureHigh_mmHg); - data.CardiacCyclePulmonaryArteryPressureLow_mmHg(m_CardiacCyclePulmonaryArteryPressureLow_mmHg); - data.CardiacCyclePulmonaryArteryPressureHigh_mmHg(m_CardiacCyclePulmonaryArteryPressureHigh_mmHg); - data.LastCardiacCycleMeanArterialCO2PartialPressure_mmHg(m_LastCardiacCycleMeanArterialCO2PartialPressure_mmHg); - data.CardiacCycleStrokeVolume_mL(m_CardiacCycleStrokeVolume_mL); - - data.CardiacCycleArterialPressure_mmHg(std::unique_ptr(m_CardiacCycleArterialPressure_mmHg.Unload())); - data.CardiacCycleArterialCO2PartialPressure_mmHg(std::unique_ptr(m_CardiacCycleArterialCO2PartialPressure_mmHg.Unload())); - data.CardiacCyclePulmonaryCapillariesWedgePressure_mmHg(std::unique_ptr(m_CardiacCyclePulmonaryCapillariesWedgePressure_mmHg.Unload())); - data.CardiacCyclePulmonaryCapillariesFlow_mL_Per_s(std::unique_ptr(m_CardiacCyclePulmonaryCapillariesFlow_mL_Per_s.Unload())); - data.CardiacCyclePulmonaryShuntFlow_mL_Per_s(std::unique_ptr(m_CardiacCyclePulmonaryShuntFlow_mL_Per_s.Unload())); - data.CardiacCyclePulmonaryArteryPressure_mmHg(std::unique_ptr(m_CardiacCyclePulmonaryArteryPressure_mmHg.Unload())); - data.CardiacCycleCentralVenousPressure_mmHg(std::unique_ptr(m_CardiacCycleCentralVenousPressure_mmHg.Unload())); - data.CardiacCycleSkinFlow_mL_Per_s(std::unique_ptr(m_CardiacCycleSkinFlow_mL_Per_s.Unload())); -} - //-------------------------------------------------------------------------------------------------- /// \brief /// Initializes parameters for Cardiovascular Class @@ -354,10 +261,10 @@ void Cardiovascular::SetUp() m_minIndividialSystemicResistance__mmHg_s_Per_mL = 0.1; m_OverrideHR_Conformant_Per_min = m_patient->GetHeartRateBaseline(FrequencyUnit::Per_min); - //Circuits + // Circuits m_CirculatoryCircuit = &m_data.GetCircuits().GetActiveCardiovascularCircuit(); m_CirculatoryGraph = &m_data.GetCompartments().GetActiveCardiovascularGraph(); - //Compartments + // Compartments m_Aorta = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Aorta); m_AortaCO2 = m_Aorta->GetSubstanceQuantity(m_data.GetSubstances().GetCO2()); m_Brain = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Brain); @@ -371,10 +278,10 @@ void Cardiovascular::SetUp() m_Pericardium = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Pericardium); m_LeftHeart = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::LeftHeart); m_RightHeart = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::RightHeart); - //Nodes + // Nodes m_MainPulmonaryArteries = m_CirculatoryCircuit->GetNode(BGE::CardiovascularNode::MainPulmonaryArteries); m_LeftAtrium1 = m_CirculatoryCircuit->GetNode(BGE::CardiovascularNode::LeftAtrium1); - //Paths + // Paths m_LeftPulmonaryArteriesToVeins = m_CirculatoryCircuit->GetPath(BGE::CardiovascularPath::LeftPulmonaryArteriesToLeftPulmonaryVeins); m_LeftPulmonaryArteriesToCapillaries = m_CirculatoryCircuit->GetPath(BGE::CardiovascularPath::LeftPulmonaryArteriesToLeftPulmonaryCapillaries); m_RightPulmonaryArteriesToVeins = m_CirculatoryCircuit->GetPath(BGE::CardiovascularPath::RightPulmonaryArteriesToRightPulmonaryVeins); @@ -429,27 +336,29 @@ void Cardiovascular::SetUp() SEFluidCircuitNode* aorta = m_CirculatoryCircuit->GetNode(BGE::CardiovascularNode::Aorta1); SEFluidCircuitNode* ground = m_CirculatoryCircuit->GetNode(BGE::CardiovascularNode::Ground); - //Cache resistance paths that will be affected by nervous feedback. We exclude cerebral because we do not want those paths pushed on to systemic paths vector. This way, cerebral - //paths won't be affected by drugs. + // Cache resistance paths that will be affected by nervous feedback. We exclude cerebral because we do not want those paths pushed on to systemic paths vector. This way, cerebral + // paths won't be affected by drugs. for (SEFluidCircuitPath* path : m_CirculatoryCircuit->GetPaths()) { if (&path->GetSourceNode() == aorta && path->HasResistanceBaseline()) { if (&path->GetTargetNode() != ground && path->HasCardiovascularRegion()) { - CDM::enumResistancePathType region = path->GetCardiovascularRegion(); + SEResistancePathType region = path->GetCardiovascularRegion(); switch (region) { - case CDM::enumResistancePathType::Cerebral: + case SEResistancePathType::Cerebral: continue; - case CDM::enumResistancePathType::Extrasplanchnic: + case SEResistancePathType::Extrasplanchnic: m_extrasplanchnicResistancePaths.push_back(path); break; - case CDM::enumResistancePathType::Muscle: + case SEResistancePathType::Muscle: m_muscleResistancePaths.push_back(path); break; - case CDM::enumResistancePathType::Myocardium: + case SEResistancePathType::Myocardium: m_myocardiumResistancePaths.push_back(path); break; - case CDM::enumResistancePathType::Splanchnic: + case SEResistancePathType::Splanchnic: m_splanchnicResistancePaths.push_back(path); break; + default: + break; } m_systemicResistancePaths.push_back(path); venousNodes.push_back(&path->GetTargetNode()); @@ -461,24 +370,25 @@ void Cardiovascular::SetUp() if (&path->GetSourceNode() == node) { if (path->HasResistanceBaseline() && &path->GetTargetNode() != ground) { if (path->HasCardiovascularRegion()) { - CDM::enumResistancePathType region = path->GetCardiovascularRegion(); + SEResistancePathType region = path->GetCardiovascularRegion(); switch (region) { - case CDM::enumResistancePathType::Extrasplanchnic: + case SEResistancePathType::Extrasplanchnic: m_extrasplanchnicResistancePaths.push_back(path); break; - case CDM::enumResistancePathType::Muscle: + case SEResistancePathType::Muscle: m_muscleResistancePaths.push_back(path); break; - case CDM::enumResistancePathType::Myocardium: + case SEResistancePathType::Myocardium: m_myocardiumResistancePaths.push_back(path); break; - case CDM::enumResistancePathType::Splanchnic: + case SEResistancePathType::Splanchnic: m_splanchnicResistancePaths.push_back(path); break; - case CDM::enumResistancePathType::Cerebral: - m_cerebralResistancePaths.push_back(path); + case SEResistancePathType::Cerebral: + m_cerebralResistancePaths.push_back(path); + break; + default: break; - } } m_systemicResistancePaths.push_back(path); @@ -497,7 +407,7 @@ void Cardiovascular::SetUp() m_splanchnicResistancePaths.push_back(path); } - //Since we have cerbral circuit defined separately, we can add cerebral resistance paths here + // Since we have cerbral circuit defined separately, we can add cerebral resistance paths here if (m_data.GetConfiguration().IsCerebralEnabled()) { for (auto path : m_data.GetCircuits().GetCerebralCircuit().GetPaths()) { if (path->HasCardiovascularRegion()) { @@ -645,7 +555,7 @@ void Cardiovascular::ChronicAnemia() //-------------------------------------------------------------------------------------------------- void Cardiovascular::ChronicHeartFailure() { - //Decrease left heart contractility + // Decrease left heart contractility m_LeftHeartElastanceModifier = 0.2; } @@ -673,8 +583,8 @@ void Cardiovascular::ChronicPericardialEffusion() deltaVolume_mL = 0.0; } - //Just throw this all on at once - //Only do this for a single time-step! + // Just throw this all on at once + // Only do this for a single time-step! m_pGndToPericardium->GetNextFlowSource().SetValue(deltaVolume_mL / m_dT_s, VolumePerTimeUnit::mL_Per_s); } @@ -695,7 +605,7 @@ void Cardiovascular::ChronicRenalStenosis() if (LeftOcclusionFraction < 0.0) { /// \error Cannot specify left occlusion fraction less than zero - Error("Cannot specify left occlusion fraction less than zero. Renal resistances remain unchanged."); //Specify resistance is the same in error + Error("Cannot specify left occlusion fraction less than zero. Renal resistances remain unchanged."); // Specify resistance is the same in error return; } @@ -717,13 +627,13 @@ void Cardiovascular::ChronicRenalStenosis() return; } - //Aorta1ToAfferentArteriole paths are equivalent to the renal artery in BioGears. Resistance increases on these paths to represent renal arterial stenosis + // Aorta1ToAfferentArteriole paths are equivalent to the renal artery in BioGears. Resistance increases on these paths to represent renal arterial stenosis double currentLeftResistance_mmHg_s_Per_mL = m_leftRenalArteryPath->GetResistanceBaseline(FlowResistanceUnit::mmHg_s_Per_mL); double currentRightResistance_mmHg_s_Per_mL = m_rightRenalArteryPath->GetResistanceBaseline(FlowResistanceUnit::mmHg_s_Per_mL); - //The base resistance is a tuned parameter that allows for adequate flow reduction to the kidneys with the logarithmic functional form chosen + // The base resistance is a tuned parameter that allows for adequate flow reduction to the kidneys with the logarithmic functional form chosen double baseResistance_mmHg_s_Per_mL = 10.0; - //Open resistance indicates a completely occluded artery. This value is 100 mmHg/mL/s for the cardiovascular circuit. + // Open resistance indicates a completely occluded artery. This value is 100 mmHg/mL/s for the cardiovascular circuit. double openResistance_mmHg_s_Per_mL = m_data.GetConfiguration().GetCardiovascularOpenResistance(FlowResistanceUnit::mmHg_s_Per_mL); double newLeftResistance_mmHg_s_Per_mL = GeneralMath::ResistanceFunction(baseResistance_mmHg_s_Per_mL, openResistance_mmHg_s_Per_mL, currentLeftResistance_mmHg_s_Per_mL, LeftOcclusionFraction); @@ -782,7 +692,7 @@ void Cardiovascular::PostProcess() && m_data.GetState() == EngineState::Active) { SEOverride* override = m_data.GetActions().GetPatientActions().GetOverride(); if (override->HasCardiovascularOverride() - && override->GetOverrideConformance() == CDM::enumOnOff::Off) { + && override->GetOverrideConformance() == SEOnOff::Off) { ProcessOverride(); } } @@ -902,7 +812,7 @@ void Cardiovascular::CalculateVitalSigns() // Check for hypovolemic shock /// \event Patient: Hypovolemic Shock: blood volume below 70% of its normal value if (GetBloodVolume().GetValue(VolumeUnit::mL) <= (m_data.GetConfiguration().GetMinimumBloodVolumeFraction() * m_patient->GetBloodVolumeBaseline(VolumeUnit::mL))) { - m_patient->SetEvent(CDM::enumPatientEvent::HypovolemicShock, true, m_data.GetSimulationTime()); + m_patient->SetEvent(SEPatientEventType::HypovolemicShock, true, m_data.GetSimulationTime()); /// \event Patient: blood loss below 60%, irreversible state enacted // @cite champion2003profile @@ -911,72 +821,72 @@ void Cardiovascular::CalculateVitalSigns() Warning(m_ss); /// \irreversible Over half the patients blood volume has been lost. if (!m_PatientActions->HasOverride()) { - m_patient->SetEvent(CDM::enumPatientEvent::IrreversibleState, true, m_data.GetSimulationTime()); + m_patient->SetEvent(SEPatientEventType::IrreversibleState, true, m_data.GetSimulationTime()); } else { - if (m_PatientActions->GetOverride()->GetOverrideConformance() == CDM::enumOnOff::On) { - m_patient->SetEvent(CDM::enumPatientEvent::IrreversibleState, true, m_data.GetSimulationTime()); + if (m_PatientActions->GetOverride()->GetOverrideConformance() == SEOnOff::On) { + m_patient->SetEvent(SEPatientEventType::IrreversibleState, true, m_data.GetSimulationTime()); } } } } else { - m_patient->SetEvent(CDM::enumPatientEvent::HypovolemicShock, false, m_data.GetSimulationTime()); + m_patient->SetEvent(SEPatientEventType::HypovolemicShock, false, m_data.GetSimulationTime()); } - //Check for cardiogenic shock + // Check for cardiogenic shock if (GetCardiacIndex().GetValue(VolumePerTimeAreaUnit::L_Per_min_m2) < 2.2 && GetSystolicArterialPressure(PressureUnit::mmHg) < 90.0 && GetPulmonaryCapillariesWedgePressure(PressureUnit::mmHg) > 15.0) { /// \event Patient: Cardiogenic Shock: Cardiac Index has fallen below 2.2 L/min-m^2, Systolic Arterial Pressure is below 90 mmHg, and Pulmonary Capillary Wedge Pressure is above 15.0. /// \cite dhakam2008review - m_patient->SetEvent(CDM::enumPatientEvent::CardiogenicShock, true, m_data.GetSimulationTime()); + m_patient->SetEvent(SEPatientEventType::CardiogenicShock, true, m_data.GetSimulationTime()); } else { - m_patient->SetEvent(CDM::enumPatientEvent::CardiogenicShock, false, m_data.GetSimulationTime()); + m_patient->SetEvent(SEPatientEventType::CardiogenicShock, false, m_data.GetSimulationTime()); } - //Check for Tachycardia, Bradycardia, and asystole + // Check for Tachycardia, Bradycardia, and asystole /// \event Patient: Tachycardia: heart rate exceeds 100 beats per minute. This state is alleviated if it decreases below 90. if (GetHeartRate().GetValue(FrequencyUnit::Per_min) < 90) - m_patient->SetEvent(CDM::enumPatientEvent::Tachycardia, false, m_data.GetSimulationTime()); + m_patient->SetEvent(SEPatientEventType::Tachycardia, false, m_data.GetSimulationTime()); if (GetHeartRate().GetValue(FrequencyUnit::Per_min) > 100) - m_patient->SetEvent(CDM::enumPatientEvent::Tachycardia, true, m_data.GetSimulationTime()); + m_patient->SetEvent(SEPatientEventType::Tachycardia, true, m_data.GetSimulationTime()); /// \event Patient: Bradycardia: heart rate falls below 60 beats per minute. This state is alleviated if it increases above 65. if (GetHeartRate().GetValue(FrequencyUnit::Per_min) < 60) - m_patient->SetEvent(CDM::enumPatientEvent::Bradycardia, true, m_data.GetSimulationTime()); + m_patient->SetEvent(SEPatientEventType::Bradycardia, true, m_data.GetSimulationTime()); if (GetHeartRate().GetValue(FrequencyUnit::Per_min) > 65) - m_patient->SetEvent(CDM::enumPatientEvent::Bradycardia, false, m_data.GetSimulationTime()); + m_patient->SetEvent(SEPatientEventType::Bradycardia, false, m_data.GetSimulationTime()); if (GetHeartRate().GetValue(FrequencyUnit::Per_min) > 30) { - if (GetHeartRhythm() != CDM::enumHeartRhythm::Asystole) { - m_patient->SetEvent(CDM::enumPatientEvent::Asystole, false, m_data.GetSimulationTime()); + if (GetHeartRhythm() != SEHeartRhythm::Asystole) { + m_patient->SetEvent(SEPatientEventType::Asystole, false, m_data.GetSimulationTime()); } } ///\event Patient: Asystole: Heart Rate has fallen below minimum value and is being set to 0. // @cite guinness2005lowest if (GetHeartRate().GetValue(FrequencyUnit::Per_min) < 27) { if (!m_PatientActions->HasOverride()) { - m_patient->SetEvent(CDM::enumPatientEvent::Asystole, true, m_data.GetSimulationTime()); - SetHeartRhythm(CDM::enumHeartRhythm::Asystole); + m_patient->SetEvent(SEPatientEventType::Asystole, true, m_data.GetSimulationTime()); + SetHeartRhythm(SEHeartRhythm::Asystole); } else { - if (m_PatientActions->GetOverride()->GetOverrideConformance() == CDM::enumOnOff::On) { - m_patient->SetEvent(CDM::enumPatientEvent::Asystole, true, m_data.GetSimulationTime()); - SetHeartRhythm(CDM::enumHeartRhythm::Asystole); + if (m_PatientActions->GetOverride()->GetOverrideConformance() == SEOnOff::On) { + m_patient->SetEvent(SEPatientEventType::Asystole, true, m_data.GetSimulationTime()); + SetHeartRhythm(SEHeartRhythm::Asystole); } } } } // Irreversible state if asystole persists. - if (GetHeartRhythm() == CDM::enumHeartRhythm::Asystole) { - m_patient->SetEvent(CDM::enumPatientEvent::Asystole, true, m_data.GetSimulationTime()); + if (GetHeartRhythm() == SEHeartRhythm::Asystole) { + m_patient->SetEvent(SEPatientEventType::Asystole, true, m_data.GetSimulationTime()); /// \event Patient: Irreversible State: heart has been in asystole for over 45 min: - if (m_patient->GetEventDuration(CDM::enumPatientEvent::Asystole, TimeUnit::s) > 2700.0) // \cite: Zijlmans2002EpilepticSeizuresAsystole + if (m_patient->GetEventDuration(SEPatientEventType::Asystole, TimeUnit::s) > 2700.0) // \cite: Zijlmans2002EpilepticSeizuresAsystole { - m_ss << "Asystole has occurred for " << m_patient->GetEventDuration(CDM::enumPatientEvent::Asystole, TimeUnit::s) << " seconds, patient is in irreversible state."; + m_ss << "Asystole has occurred for " << m_patient->GetEventDuration(SEPatientEventType::Asystole, TimeUnit::s) << " seconds, patient is in irreversible state."; Warning(m_ss); /// \irreversible Heart has been in asystole for over 45 min if (!m_PatientActions->HasOverride()) { - m_patient->SetEvent(CDM::enumPatientEvent::IrreversibleState, true, m_data.GetSimulationTime()); + m_patient->SetEvent(SEPatientEventType::IrreversibleState, true, m_data.GetSimulationTime()); } else { - if (m_PatientActions->GetOverride()->GetOverrideConformance() == CDM::enumOnOff::On) { - m_patient->SetEvent(CDM::enumPatientEvent::IrreversibleState, true, m_data.GetSimulationTime()); + if (m_PatientActions->GetOverride()->GetOverrideConformance() == SEOnOff::On) { + m_patient->SetEvent(SEPatientEventType::IrreversibleState, true, m_data.GetSimulationTime()); } } } @@ -985,7 +895,7 @@ void Cardiovascular::CalculateVitalSigns() // Compute blood volume double blood_mL = 0; for (SELiquidCompartment* cmpt : m_data.GetCompartments().GetVascularLeafCompartments()) { - if (cmpt->HasVolume() && cmpt != m_Pericardium) //Don't include pericardium + if (cmpt->HasVolume() && cmpt != m_Pericardium) // Don't include pericardium { blood_mL += cmpt->GetVolume(VolumeUnit::mL); } @@ -1090,6 +1000,7 @@ void Cardiovascular::ProcessActions() { TraumaticBrainInjury(); Hemorrhage(); + Amputation(); PericardialEffusion(); CPR(); CardiacArrest(); @@ -1109,22 +1020,22 @@ void Cardiovascular::TraumaticBrainInjury() if (!m_data.GetActions().GetPatientActions().HasBrainInjury()) return; - //Grab info about the injury + // Grab info about the injury SEBrainInjury* b = m_data.GetActions().GetPatientActions().GetBrainInjury(); double severity = b->GetSeverity().GetValue(); SEFluidCircuitPath* brainToSpinal = m_CirculatoryCircuit->GetPath(BGE::CerebralPath::CerebralArteries2ToSpinalFluid); - //Interpolate linearly between multipliers of 1 (for severity of 0) to max (for severity of 1) - //These multipliers are chosen to result in ICP > 25 mmHg and CBF < 1.8 mL/s + // Interpolate linearly between multipliers of 1 (for severity of 0) to max (for severity of 1) + // These multipliers are chosen to result in ICP > 25 mmHg and CBF < 1.8 mL/s double usMult = GeneralMath::LinearInterpolator(0, 1, 1, 4.87814, severity); double dsMult = GeneralMath::LinearInterpolator(0, 1, 1, 30.7993, severity); - //We don't want to shoot the resistances up to their new values in a single time step because this causes very sharp changes in cerebral metrics - //Use a simple proportional control to ramp up to target resistances. Time constant determined empirically based on previous baselines - double timeConstant_s = 300.0 * severity; //Otherwise the low severity scenarios go too slowly + // We don't want to shoot the resistances up to their new values in a single time step because this causes very sharp changes in cerebral metrics + // Use a simple proportional control to ramp up to target resistances. Time constant determined empirically based on previous baselines + double timeConstant_s = 300.0 * severity; // Otherwise the low severity scenarios go too slowly if (severity < ZERO_APPROX) { - timeConstant_s = 300.0; //This function should not get evaluated once the TBI is removed, but put this here just in case something changes so we don't get a divide by 0 NaN + timeConstant_s = 300.0; // This function should not get evaluated once the TBI is removed, but put this here just in case something changes so we don't get a divide by 0 NaN } double targetUpstream = m_pBrainResistanceUpstream->GetResistanceBaseline(FlowResistanceUnit::mmHg_s_Per_mL) * usMult; double lastUpstream = m_pBrainResistanceUpstream->GetResistance(FlowResistanceUnit::mmHg_s_Per_mL); @@ -1164,7 +1075,7 @@ void Cardiovascular::Hemorrhage() std::string tournCmpt; SEFluidCircuitPath* targetPath = nullptr; - //Values for tracking physiological metrics + // Values for tracking physiological metrics double resistance = 0.0; double locationPressure_mmHg = 0.0; double TotalLossRate_mL_Per_s = 0.0; @@ -1186,7 +1097,7 @@ void Cardiovascular::Hemorrhage() locationPressure_mmHg = targetPath->GetSourceNode().GetPressure(PressureUnit::mmHg); bleedRate_mL_Per_s = targetHemorrhage->GetInitialRate().GetValue(VolumePerTimeUnit::mL_Per_s); - //enforce strict restictions on bleed rate for circuit stability + // enforce strict restictions on bleed rate for circuit stability if (bleedRate_mL_Per_s > m_data.GetCardiovascular().GetCardiacOutput(VolumePerTimeUnit::mL_Per_s)) { std::stringstream err; err << "bleed rate (mL/s): " << bleedRate_mL_Per_s << " is higher than the cardiac output (mL/s): (" @@ -1217,14 +1128,14 @@ void Cardiovascular::Hemorrhage() bleedoutTime = (bloodVolume_mL - (0.5 * baselineBloodVolume_mL)) / TotalLossRate_mL_Per_s * (1.0 / 60.0); } - //We already filtered tourniquet actions during Action Loading to make sure that we do not have a tourniquet that A) Aligns with a non-existent hemorrhage - //or B) refers to an incompatible compartments. We are therefore safe to loop through this map without further checks. + // We already filtered tourniquet actions during Action Loading to make sure that we do not have a tourniquet that A) Aligns with a non-existent hemorrhage + // or B) refers to an incompatible compartments. We are therefore safe to loop through this map without further checks. for (auto tPair : tourniquets) { tournCmpt = tPair.first; tourniquet = tPair.second; - CDM::enumTourniquetApplicationLevel::value tLevel = tourniquet->GetTourniquetLevel(); - //Take advantage of the fact that extremities are all named as Aorta1ToLeftArm1 and LeftArm1ToLeftArm2 + auto tLevel = tourniquet->GetTourniquetLevel(); + // Take advantage of the fact that extremities are all named as Aorta1ToLeftArm1 and LeftArm1ToLeftArm2 std::string supplyPathName = "Aorta1To" + tournCmpt + "1"; std::string returnPathName = tournCmpt + "1To" + tournCmpt + "2"; SEFluidCircuitPath* supplyPath = m_CirculatoryCircuit->GetPath(supplyPathName); @@ -1233,14 +1144,14 @@ void Cardiovascular::Hemorrhage() const double returnBaseResistance = returnPath->GetResistanceBaseline(FlowResistanceUnit::mmHg_s_Per_mL); double tResModifier; switch (tLevel) { - case CDM::enumTourniquetApplicationLevel::Applied: + case SETourniquetApplicationType::Applied: tResModifier = 100.0; break; - case CDM::enumTourniquetApplicationLevel::Misapplied: - tResModifier = 3.0; //Slow blood flow, but don't stop entirely + case SETourniquetApplicationType::Misapplied: + tResModifier = 3.0; // Slow blood flow, but don't stop entirely break; - case CDM::enumTourniquetApplicationLevel::None: - //This case shouldn't get hit because "None" deactivates tourniquet, but account for it just in case + case SETourniquetApplicationType::NotApplied: + // This case shouldn't get hit because "None" deactivates tourniquet, but account for it just in case default: tResModifier = 1.0; } @@ -1261,6 +1172,112 @@ void Cardiovascular::Hemorrhage() m_patient->GetWeight().SetValue(patientMass_kg, MassUnit::kg); } +//-------------------------------------------------------------------------------------------------- +/// \brief +/// The amputation function simulates an amputation from a specified compartment +/// \details +/// The cardiovascular circuit has paths from each compartment to ground (initially open) that represent +/// bleeding sites. When an amputation is activated, the compartment determines the blood flow at the +/// at the amputation site. +/// A resistance is set to avoid blood flow returning to the rest of the body. +/// The capacitance is set at the amputation site to increase the blood flow out of the amputation site. +/// Edit about future changes +//-------------------------------------------------------------------------------------------------- +void Cardiovascular::Amputation() +{ + /// \todo Enforce limits and remove fatal errors. + SEAmputation* targetAmputation; + std::string ampCmpt; + SEFluidCircuitPath* resistancePath = nullptr; + + SEFluidCircuitPath* targetPath = nullptr; + std::string weightPointer; + // Values for tracking physiological metrics + double resistance = 0.0; + double locationPressure_mmHg = 0.0; + double TotalLossRate_mL_Per_s = 0.0; + double probabilitySurvival = 0.0; + double bleedoutTime = 0.0; + double bleedRate_mL_Per_s = 0.0; + double drugFlowResistance = 0.0; + const double bloodVolume_mL = GetBloodVolume(VolumeUnit::mL); + const double baselineBloodVolume_mL = m_patient->GetBloodVolumeBaseline(VolumeUnit::mL); + + const std::map& amps = m_data.GetActions().GetPatientActions().GetAmputations(); + + for (auto amp : amps) { + targetAmputation = amp.second; + ampCmpt = targetAmputation->GetCompartment(); + weightPointer = targetAmputation->GetWeightPercent(); + double patientMass_kg = m_patient->GetWeight(MassUnit::kg); + if (weightPointer == "WeightNotLost") { + + if (ampCmpt == "RightLeg" || ampCmpt == "LeftLeg") { + if (m_patient->GetSex() == SESex::Male) { + m_patient->GetWeight().SetValue(patientMass_kg*0.8332, MassUnit::kg); + } else if (m_patient->GetSex() == SESex::Female) { + m_patient->GetWeight().SetValue(patientMass_kg * 0.8157, MassUnit::kg); + } + } else if (ampCmpt == "RightArm" || ampCmpt == "LeftArm") { + if (m_patient->GetSex() == SESex::Male) { + m_patient->GetWeight().SetValue(patientMass_kg * 0.9423, MassUnit::kg); + } else if (m_patient->GetSex() == SESex::Female) { + m_patient->GetWeight().SetValue(patientMass_kg * 0.953, MassUnit::kg); + } + } + targetAmputation->SetWeightPercent("WeightLost"); + } + + targetPath = m_CirculatoryCircuit->GetPath(ampCmpt + "Bleed"); + + locationPressure_mmHg = targetPath->GetSourceNode().GetPressure(PressureUnit::mmHg); + if (ampCmpt == "RightLeg" || ampCmpt == "LeftLeg") { + bleedRate_mL_Per_s = 350.0; + } + else if (ampCmpt == "RightArm" || ampCmpt == "LeftArm") { + bleedRate_mL_Per_s = 138.0; + } + + double newRes = (locationPressure_mmHg / bleedRate_mL_Per_s); + LLIM(newRes, 0.0001); + + targetAmputation->GetBleedResistance().SetValue(newRes, FlowResistanceUnit::mmHg_s_Per_mL); + + resistance = targetAmputation->GetBleedResistance().GetValue(FlowResistanceUnit::mmHg_s_Per_mL); + + // Use hemorrhage flow modifier to affect hemorrhage resistance path, negative modifier INCREASES resistance thus DECREASES flow out of body + // Then set to resistance path AND next resistance to ensure stacked effect over time + drugFlowResistance = resistance * (1 - m_data.GetDrugs().GetHemorrhageChange().GetValue()); + targetAmputation->GetBleedResistance().SetValue(drugFlowResistance, FlowResistanceUnit::mmHg_s_Per_mL); + targetPath->GetNextResistance().SetValue(drugFlowResistance, FlowResistanceUnit::mmHg_s_Per_mL); + + //Set other values in circuit + + targetPath->GetCapacitance().SetValue(100000, FlowComplianceUnit::mL_Per_mmHg); + resistancePath = m_CirculatoryCircuit->GetPath(ampCmpt + "1To" + ampCmpt + "2"); + resistancePath->GetNextResistance().SetValue(100000, FlowResistanceUnit::mmHg_s_Per_mL); + + TotalLossRate_mL_Per_s += targetPath->GetFlow(VolumePerTimeUnit::mL_Per_s); + double bloodLossIncrement_mL = targetPath->GetFlow(VolumePerTimeUnit::mL_Per_s) * m_dT_s; + GetTotalBloodVolumeLost().IncrementValue(bloodLossIncrement_mL, VolumeUnit::mL); + bleedoutTime = (bloodVolume_mL - (0.5 * baselineBloodVolume_mL)) / TotalLossRate_mL_Per_s * (1.0 / 60.0); + } + + /* + Stub to try to calculate a probability of survival based on the bleeding rate and approximate time to bleed out. + if (bleedoutTime!=0) + probabilitySurvival = 100.0-100.0*(0.9127*exp(-0.008*bleedoutTime)); //relationship from Table 5 in champion2003profile + */ + + // Mass lost based on blood only (adjustment has not been made for body weight) + double bloodDensity_kg_Per_mL = m_data.GetBloodChemistry().GetBloodDensity(MassPerVolumeUnit::kg_Per_mL); + double massLost_kg = TotalLossRate_mL_Per_s * bloodDensity_kg_Per_mL * m_dT_s; + double patientMass_kg = m_patient->GetWeight(MassUnit::kg); + patientMass_kg -= massLost_kg; + + m_patient->GetWeight().SetValue(patientMass_kg, MassUnit::kg); + +} //-------------------------------------------------------------------------------------------------- /// \brief @@ -1273,7 +1290,7 @@ void Cardiovascular::Hemorrhage() //-------------------------------------------------------------------------------------------------- void Cardiovascular::PericardialEffusion() { - //We need to do this here because the circuit needs to be processed to modify the compliance pressure based on the volume change + // We need to do this here because the circuit needs to be processed to modify the compliance pressure based on the volume change if (m_data.GetConditions().HasChronicPericardialEffusion() && !m_data.GetActions().GetPatientActions().HasPericardialEffusion()) { PericardialEffusionPressureApplication(); } @@ -1291,7 +1308,7 @@ void Cardiovascular::PericardialEffusion() double effusionRate_mL_Per_s = m_data.GetActions().GetPatientActions().GetPericardialEffusion()->GetEffusionRate().GetValue(VolumePerTimeUnit::mL_Per_s); if (effusionRate_mL_Per_s <= 0.1 && effusionRate_mL_Per_s > 0.0) { - //Slow effusion + // Slow effusion complianceSlopeParameter = 0.4; complianceCurveParameter = 0.55; } else if (effusionRate_mL_Per_s > 0.1 && effusionRate_mL_Per_s < 1.0) { @@ -1315,7 +1332,7 @@ void Cardiovascular::PericardialEffusion() flowToPericardium_mL_per_s = m_pGndToPericardium->GetNextFlow(VolumePerTimeUnit::mL_Per_s); flowCubed_mL3_Per_s3 = flowToPericardium_mL_per_s * flowToPericardium_mL_per_s * flowToPericardium_mL_per_s; - //Variable compliance calculation + // Variable compliance calculation if (flowCubed_mL3_Per_s3 < 0.0001) { compliance_mL_Per_mmHg = m_pPericardiumToGnd->GetNextCompliance().GetValue(FlowComplianceUnit::mL_Per_mmHg); } else { @@ -1366,7 +1383,7 @@ void Cardiovascular::CPR() // Call for chest compression with an effective heart rhythm // In the future we may allow compressions on a beating heart, but that will require extensive testing // to evaluate the hemodynamic stability. - if (!m_patient->IsEventActive(CDM::enumPatientEvent::CardiacArrest)) { + if (!m_patient->IsEventActive(SEPatientEventType::CardiacArrest)) { Warning("CPR attempted on beating heart. Action ignored."); m_data.GetActions().GetPatientActions().RemoveChestCompression(); return; @@ -1409,7 +1426,7 @@ void Cardiovascular::CalculateAndSetCPRcompressionForce() double compressionForceMax_N = 500.0; // The maximum allowed compression force (corresponds to 1.0 when force scale is used) double compressionForceMin_N = 0.0; // The minimum allowed compression force - if (m_CompressionRatio > 0.0) //Force scale + if (m_CompressionRatio > 0.0) // Force scale { // Bell curve shaping parameters double c = -10; // Defines the start and stop of the force bell curve given the period @@ -1427,7 +1444,7 @@ void Cardiovascular::CalculateAndSetCPRcompressionForce() m_CompressionRatio = 0.0; m_CompressionPeriod_s = 0.0; } - } else //Explicit force + } else // Explicit force { compressionForce_N = m_data.GetActions().GetPatientActions().GetChestCompressionForce()->GetForce().GetValue(ForceUnit::N); } @@ -1473,11 +1490,11 @@ void Cardiovascular::CardiacArrest() m_EnterCardiacArrest = true; } else { m_data.GetActions().GetPatientActions().RemoveCardiacArrest(); - m_patient->SetEvent(CDM::enumPatientEvent::CardiacArrest, false, m_data.GetSimulationTime()); - m_patient->SetEvent(CDM::enumPatientEvent::Asystole, false, m_data.GetSimulationTime()); + m_patient->SetEvent(SEPatientEventType::CardiacArrest, false, m_data.GetSimulationTime()); + m_patient->SetEvent(SEPatientEventType::Asystole, false, m_data.GetSimulationTime()); m_EnterCardiacArrest = false; m_StartSystole = true; - SetHeartRhythm(CDM::enumHeartRhythm::NormalSinus); + SetHeartRhythm(SEHeartRhythm::NormalSinus); GetHeartRate().SetValue(m_patient->GetHeartRateBaseline().GetValue(FrequencyUnit::Per_min), FrequencyUnit::Per_min); m_CurrentCardiacCycleDuration_s = 1. / m_patient->GetHeartRateBaseline().GetValue(FrequencyUnit::Per_s); m_CardiacCyclePeriod_s = .0; @@ -1497,9 +1514,9 @@ void Cardiovascular::PericardialEffusionPressureApplication() { double intrapericardialPressure_mmHg = m_Pericardium->GetPressure(PressureUnit::mmHg); - double pressureResponseFraction = 0.4; //Tuning the pressure applied to the heart + double pressureResponseFraction = 0.4; // Tuning the pressure applied to the heart - //Set the pressure on the right and left heart from the pericardium pressure + // Set the pressure on the right and left heart from the pericardium pressure m_pRightHeartToGnd->GetPressureSourceBaseline().SetValue(pressureResponseFraction * intrapericardialPressure_mmHg, PressureUnit::mmHg); m_pLeftHeartToGnd->GetPressureSourceBaseline().SetValue(pressureResponseFraction * intrapericardialPressure_mmHg, PressureUnit::mmHg); } @@ -1524,8 +1541,8 @@ void Cardiovascular::PericardialEffusionPressureApplication() void Cardiovascular::HeartDriver() { // Reset start cardiac cycle event if it was activated by BeginCardiacCycle() last time step - if (m_patient->IsEventActive(CDM::enumPatientEvent::StartOfCardiacCycle)) - m_patient->SetEvent(CDM::enumPatientEvent::StartOfCardiacCycle, false, m_data.GetSimulationTime()); + if (m_patient->IsEventActive(SEPatientEventType::StartOfCardiacCycle)) + m_patient->SetEvent(SEPatientEventType::StartOfCardiacCycle, false, m_data.GetSimulationTime()); // m_StartSystole is set to true at the end of a cardiac cycle in order to setup the next cardiac cycle. // After the next cycle is prepared in BeginCardiacCycle, m_StartSystole is seet back to false. @@ -1534,13 +1551,13 @@ void Cardiovascular::HeartDriver() // If any system set the rhythm to asystole (or other rhythms in the future) then trip the cardiac arrest flag so that we can deal with it at the top of the next cardiac cycle // This prevents the heart from stopping in the middle of a contraction. - if (GetHeartRhythm() == CDM::enumHeartRhythm::Asystole) + if (GetHeartRhythm() == SEHeartRhythm::Asystole) m_EnterCardiacArrest = true; - if (!m_patient->IsEventActive(CDM::enumPatientEvent::CardiacArrest)) { + if (!m_patient->IsEventActive(SEPatientEventType::CardiacArrest)) { if (m_CurrentCardiacCycleTime_s + m_dT_s > m_CardiacCyclePeriod_s) { m_StartSystole = true; // A new cardiac cycle will begin next time step - m_CurrentCardiacCycleDuration_s += (m_CardiacCyclePeriod_s - m_CurrentCardiacCycleTime_s); //Add leftover time to current duration so Calc Heart Rate has an accuracte notion of how long this cycle lasted + m_CurrentCardiacCycleDuration_s += (m_CardiacCyclePeriod_s - m_CurrentCardiacCycleTime_s); // Add leftover time to current duration so Calc Heart Rate has an accuracte notion of how long this cycle lasted } AdjustVascularTone(); CalculateHeartElastance(); @@ -1570,7 +1587,7 @@ void Cardiovascular::HeartDriver() //-------------------------------------------------------------------------------------------------- void Cardiovascular::BeginCardiacCycle() { - m_patient->SetEvent(CDM::enumPatientEvent::StartOfCardiacCycle, true, m_data.GetSimulationTime()); + m_patient->SetEvent(SEPatientEventType::StartOfCardiacCycle, true, m_data.GetSimulationTime()); // Changes to the heart rate and other hemodynamic parameters are applied at the top of the cardiac cycle. // Parameters cannot change during the cardiac cycle because the heart beat is modeled as a changing compliance. @@ -1593,11 +1610,11 @@ void Cardiovascular::BeginCardiacCycle() double diastolicOverride_mmHg = GetDiastolicArterialPressure().GetValue(PressureUnit::mmHg); double HeartDriverFrequency_Per_Min = m_patient->GetHeartRateBaseline(FrequencyUnit::Per_min); - if (m_data.GetActions().GetPatientActions().HasOverride() && m_data.GetActions().GetPatientActions().GetOverride()->GetOverrideConformance() == CDM::enumOnOff::On) { + if (m_data.GetActions().GetPatientActions().HasOverride() && m_data.GetActions().GetPatientActions().GetOverride()->GetOverrideConformance() == SEOnOff::On) { SEOverride* override = m_data.GetActions().GetPatientActions().GetOverride(); m_OverrideOnOffCheck = true; m_overrideTime_s += m_data.GetTimeStep().GetValue(TimeUnit::s); - //Blood pressure override processing + // Blood pressure override processing if (override->HasSystolicArterialPressureOverride()) { systolicOverride_mmHg = override->GetSystolicArterialPressureOverride().GetValue(PressureUnit::mmHg); } @@ -1620,7 +1637,7 @@ void Cardiovascular::BeginCardiacCycle() if (systolicOverride_mmHg < diastolicOverride_mmHg) { Fatal("Systolic and Diastolic Pressure Override Values Do Not Make Sense!"); } - //Apply blood pressure overrides incrementally + // Apply blood pressure overrides incrementally const double bpChange_Per_timestep = 0.005; if (systolicOverride_mmHg > GetSystolicArterialPressure(PressureUnit::mmHg)) { m_LeftHeartElastanceMin_mmHg_Per_mL *= 1. - (0.25 * bpChange_Per_timestep); @@ -1640,7 +1657,7 @@ void Cardiovascular::BeginCardiacCycle() m_RightHeartElastanceMin_mmHg_Per_mL *= 1. + bpChange_Per_timestep; m_RightHeartElastanceMax_mmHg_Per_mL *= 1. - bpChange_Per_timestep; } - //Heart rate override + // Heart rate override if (override->HasHeartRateOverride()) { HeartDriverFrequency_Per_Min = m_OverrideHR_Conformant_Per_min; const double HRoverride_Per_min = m_data.GetActions().GetPatientActions().GetOverride()->GetHeartRateOverride(FrequencyUnit::Per_min); @@ -1648,9 +1665,9 @@ void Cardiovascular::BeginCardiacCycle() HeartDriverFrequency_Per_Min += HeartDriverIncrease_Per_min; } } else { - //No conformant override present + // No conformant override present if (m_OverrideOnOffCheck) { - //Was there an override that was deactivated? If so, gradually move back to cv model output + // Was there an override that was deactivated? If so, gradually move back to cv model output if (m_overrideTime_s > 0.0) { m_LeftHeartElastanceMin_mmHg_Per_mL = ((m_LeftHeartElastanceMin_mmHg_Per_mL) + m_OverrideLHEMin_Conformant_mmHg) / 2.; m_RightHeartElastanceMin_mmHg_Per_mL = ((m_RightHeartElastanceMin_mmHg_Per_mL) + m_OverrideRHEMin_Conformant_mmHg) / 2.; @@ -1661,7 +1678,7 @@ void Cardiovascular::BeginCardiacCycle() m_OverrideOnOffCheck = false; } } - //Only apply nervous heart rate scale if no override is present + // Only apply nervous heart rate scale if no override is present if (m_data.GetNervous().HasHeartRateScale()) { HeartDriverFrequency_Per_Min *= (m_data.GetNervous().GetHeartRateScale().GetValue()); } @@ -1675,12 +1692,12 @@ void Cardiovascular::BeginCardiacCycle() BLIM(HeartDriverFrequency_Per_Min, m_data.GetPatient().GetHeartRateMinimum(FrequencyUnit::Per_min), m_data.GetPatient().GetHeartRateMaximum(FrequencyUnit::Per_min)); m_OverrideHR_Conformant_Per_min = HeartDriverFrequency_Per_Min; - //Apply heart failure effects + // Apply heart failure effects m_LeftHeartElastanceMax_mmHg_Per_mL *= m_LeftHeartElastanceModifier; // Now set the cardiac cycle period and the cardiac arrest event if applicable if (m_EnterCardiacArrest) { - m_patient->SetEvent(CDM::enumPatientEvent::CardiacArrest, true, m_data.GetSimulationTime()); + m_patient->SetEvent(SEPatientEventType::CardiacArrest, true, m_data.GetSimulationTime()); m_CardiacCyclePeriod_s = 1.0e9; RecordAndResetCardiacCycle(); GetHeartRate().SetValue(0.0, FrequencyUnit::Per_min); @@ -1713,7 +1730,7 @@ void Cardiovascular::BeginCardiacCycle() //-------------------------------------------------------------------------------------------------- void Cardiovascular::CalculateHeartElastance() { - //Shape parameters, used to define double hill functional form of the elastance + // Shape parameters, used to define double hill functional form of the elastance double alpha1 = 0.303; double alpha2 = 0.508; double n1 = 1.32; @@ -1746,30 +1763,30 @@ void Cardiovascular::MetabolicToneResponse() metabolicFraction = TMR_kcal_Per_day / m_patient->GetBasalMetabolicRate(PowerUnit::kcal_Per_day); } - //We skip this functionality when we are at basal conditions or there is a burn present. Burns cause hypothermia, - //but that should be accompanied by an increase in systemic resistance. The code below is more applicable to exercise - //conditions (in which systemic resistance decreases) and as such causes poor behavior when modeling burns. Future work - //should address the difference between metabolic disturbances caused by exercise and those caused by hypothermia. + // We skip this functionality when we are at basal conditions or there is a burn present. Burns cause hypothermia, + // but that should be accompanied by an increase in systemic resistance. The code below is more applicable to exercise + // conditions (in which systemic resistance decreases) and as such causes poor behavior when modeling burns. Future work + // should address the difference between metabolic disturbances caused by exercise and those caused by hypothermia. if (metabolicFraction == 1.0 || m_data.GetActions().GetPatientActions().HasBurnWound()) return; - double coreTemp_degC = m_data.GetEnergy().GetCoreTemperature(TemperatureUnit::C); //Resting: 37.0 degC - double coreTempSet_degC = m_data.GetConfiguration().GetCoreTemperatureHigh(TemperatureUnit::C); //37.1 degC + double coreTemp_degC = m_data.GetEnergy().GetCoreTemperature(TemperatureUnit::C); // Resting: 37.0 degC + double coreTempSet_degC = m_data.GetConfiguration().GetCoreTemperatureHigh(TemperatureUnit::C); // 37.1 degC double coreTempDelta_degC = std::max(coreTemp_degC - coreTempSet_degC, 0.0); - coreTempDelta_degC = std::min(coreTempDelta_degC, 1.0); //A 1 degree increase in core temperature is the where the cardiovascular response on resistances is capped - //The skin multiplier is used to increase the skin blood flow resistance, effectively reducing the skin blood flow leading to less heat transfered from core to skin. + coreTempDelta_degC = std::min(coreTempDelta_degC, 1.0); // A 1 degree increase in core temperature is the where the cardiovascular response on resistances is capped + // The skin multiplier is used to increase the skin blood flow resistance, effectively reducing the skin blood flow leading to less heat transfered from core to skin. double skinMultiplier = 1.0 / std::max((coreTemp_degC - 35.0), 0.001); - double coreTempLow_degC = m_data.GetConfiguration().GetCoreTemperatureLow(TemperatureUnit::C); //36.8 degC + double coreTempLow_degC = m_data.GetConfiguration().GetCoreTemperatureLow(TemperatureUnit::C); // 36.8 degC /// \cite talebipour2006sauna - double tempMultiplier = 1.0 - 0.4 * std::min(coreTempDelta_degC, 1.0); //Approximate 40% reduction in peripheral resistance due to core temperature rise of 1 degree. + double tempMultiplier = 1.0 - 0.4 * std::min(coreTempDelta_degC, 1.0); // Approximate 40% reduction in peripheral resistance due to core temperature rise of 1 degree. double exerciseModifier = 1.0; - //The metabolic modifier is used as a tuned response to represent cardiovascular resistance effects during exercise + // The metabolic modifier is used as a tuned response to represent cardiovascular resistance effects during exercise double sp0 = 1.5; double divisor = 7.0; double exerciseDeltaFactor = 1.0; if (m_data.GetActions().GetPatientActions().HasExercise()) { - //Only change this value if exercise is active (per comment above) -- otherwise this modifier can increase during hypothermia, causing incorrect decease in peripheral resistance + // Only change this value if exercise is active (per comment above) -- otherwise this modifier can increase during hypothermia, causing incorrect decease in peripheral resistance exerciseModifier = (sp0 * metabolicFraction + (divisor - sp0)) / divisor; exerciseDeltaFactor = 2.0; } @@ -1777,12 +1794,12 @@ void Cardiovascular::MetabolicToneResponse() double metabolicRateMeanArterialPressureDelta_mmHg = exerciseDeltaFactor * (0.05 * metabolicFraction - 0.05) * m_data.GetPatient().GetMeanArterialPressureBaseline(PressureUnit::mmHg); m_data.GetEnergy().GetExerciseMeanArterialPressureDelta().SetValue(metabolicRateMeanArterialPressureDelta_mmHg, PressureUnit::mmHg); - //Reducing resistances scaling with metabolic rate increase and changes in core temperature + // Reducing resistances scaling with metabolic rate increase and changes in core temperature double resistanceNew__mmHg_s_Per_mL = 0.0; double complianceNew_mL_Per_mmHg = 0.0; for (SEFluidCircuitPath* musclePath : m_muscleResistancePaths) { - resistanceNew__mmHg_s_Per_mL = (1.0 / exerciseModifier) * (1.0 / exerciseModifier) * musclePath->GetNextResistance(FlowResistanceUnit::mmHg_s_Per_mL); //biggest change in muscle + resistanceNew__mmHg_s_Per_mL = (1.0 / exerciseModifier) * (1.0 / exerciseModifier) * musclePath->GetNextResistance(FlowResistanceUnit::mmHg_s_Per_mL); // biggest change in muscle if (resistanceNew__mmHg_s_Per_mL < m_minIndividialSystemicResistance__mmHg_s_Per_mL) { resistanceNew__mmHg_s_Per_mL = m_minIndividialSystemicResistance__mmHg_s_Per_mL; } @@ -1812,10 +1829,10 @@ void Cardiovascular::MetabolicToneResponse() //-------------------------------------------------------------------------------------------------- void Cardiovascular::TuneCircuit() { - DataTrack circuitTrk{m_Logger}; + DataTrack circuitTrk { m_Logger }; std::ofstream circuitFile; - DataTrack cerebralTrk{m_Logger}; + DataTrack cerebralTrk { m_Logger }; std::ofstream cerebralFile; bool success = false; @@ -1830,10 +1847,10 @@ void Cardiovascular::TuneCircuit() double pressuretolerance = 0.01; double stabPercentTolerance = 0.25; double stabCheckTime_s = 15.0; - double srGain = 0.01; //Systemic is sensitive - double acGain1 = 0.06; //Gains are empirical - double acGain2 = 0.02; //Gains are empirical - double vrGain = 0.06; //Gains are empirical + double srGain = 0.01; // Systemic is sensitive + double acGain1 = 0.06; // Gains are empirical + double acGain2 = 0.02; // Gains are empirical + double vrGain = 0.06; // Gains are empirical bool stable; double map_mmHg = 0, tgt_map_mmHg = 0; @@ -1856,7 +1873,7 @@ void Cardiovascular::TuneCircuit() m_circuitCalculator.Process(*m_CirculatoryCircuit, m_dT_s); CalculateVitalSigns(); m_circuitCalculator.PostProcess(*m_CirculatoryCircuit); - //return; //Skip stabelization for debugging + // return; //Skip stabelization for debugging map_mmHg = GetMeanArterialPressure(PressureUnit::mmHg); systolic_mmHg = GetSystolicArterialPressure(PressureUnit::mmHg); @@ -1890,9 +1907,9 @@ void Cardiovascular::TuneCircuit() tgt_cardiacOutput_mL_Per_min = cardiacOutput_mL_Per_min; stableCO = false; } - //bool stableMeanCVP = true; - //if (GeneralMath::PercentDifference(tgt_meanCVP_mmHg, meanCVP_mmHg) > 0.25) - // { stableTime_s = 0; tgt_meanCVP_mmHg = meanCVP_mmHg; stableMeanCVP = false; } + // bool stableMeanCVP = true; + // if (GeneralMath::PercentDifference(tgt_meanCVP_mmHg, meanCVP_mmHg) > 0.25) + // { stableTime_s = 0; tgt_meanCVP_mmHg = meanCVP_mmHg; stableMeanCVP = false; } bool stableBloodVol = true; if (GeneralMath::PercentDifference(tgt_blood_mL, blood_mL) > stabPercentTolerance) { stableTime_s = 0; @@ -1937,7 +1954,7 @@ void Cardiovascular::TuneCircuit() double diastolicError_mmHg = diastolicTarget_mmHg - diastolic_mmHg; if (stable) { // Compute the pressure errors - if (std::abs(systolicError_mmHg / systolicTarget_mmHg) < pressuretolerance && std::abs(diastolicError_mmHg / diastolicTarget_mmHg) < pressuretolerance) //relative error check + if (std::abs(systolicError_mmHg / systolicTarget_mmHg) < pressuretolerance && std::abs(diastolicError_mmHg / diastolicTarget_mmHg) < pressuretolerance) // relative error check { success = true; break; // We met our patient parameters @@ -1992,13 +2009,13 @@ void Cardiovascular::TuneCircuit() continue; bloodVolumeBaseline_mL += c->GetVolume(VolumeUnit::mL); c->Balance(BalanceLiquidBy::Concentration); - //skip the pericardium since it's not connected to the circulation - if (m_CirculatoryGraph->GetCompartment(c->GetName()) == nullptr && c->GetName()!="Pericardium") - Info(std::string{ "Cardiovascular Graph does not have cmpt " } + c->GetName()); + // skip the pericardium since it's not connected to the circulation + if (m_CirculatoryGraph->GetCompartment(c->GetName()) == nullptr && c->GetName() != "Pericardium") + Info(std::string { "Cardiovascular Graph does not have cmpt " } + c->GetName()); if (c->HasSubstanceQuantity(m_data.GetSubstances().GetHb())) // Unit testing does not have any Hb - m_data.GetSaturationCalculator().CalculateBloodGasDistribution(*c); //so don't do this if we don't have Hb + m_data.GetSaturationCalculator().CalculateBloodGasDistribution(*c); // so don't do this if we don't have Hb } - //We need to reset the blood volume baseline because it might have changed during circuit stabilization + // We need to reset the blood volume baseline because it might have changed during circuit stabilization m_data.GetPatient().GetBloodVolumeBaseline().SetValue(bloodVolumeBaseline_mL, VolumeUnit::mL); for (SELiquidCompartment* c : m_data.GetCompartments().GetUrineLeafCompartments()) { if (!c->HasVolume()) @@ -2092,7 +2109,7 @@ void Cardiovascular::AdjustVascularTone() { /// \todo Add dilation (decreased resistance) to myocardium supply path if myocardium oxygen deficit event is active. - //The Efferent response adjusts the systemic resistances and compliances according to the multiplier calculated in Nervous.cpp + // The Efferent response adjusts the systemic resistances and compliances according to the multiplier calculated in Nervous.cpp double UpdatedResistance_mmHg_s_Per_mL = 0.0; double UpdatedCompliance_mL_Per_mmHg = 0.0; double totalComplianceChange_mL_Per_mmHg = 0.0; @@ -2150,25 +2167,25 @@ void Cardiovascular::AdjustVascularTone() } } - //The drug response adjusts the systemic resistances according to the mean arterial pressure change calculated in Drugs.cpp + // The drug response adjusts the systemic resistances according to the mean arterial pressure change calculated in Drugs.cpp double ResistanceChange = 0.0; if (m_data.GetDrugs().HasMeanBloodPressureChange()) { double TuningParameter = 5.0; double CardiacOutput_mL_Per_s = GetCardiacOutput(VolumePerTimeUnit::mL_Per_s); if (CardiacOutput_mL_Per_s != 0.0) { ResistanceChange = m_data.GetDrugs().GetMeanBloodPressureChange(PressureUnit::mmHg) / GetCardiacOutput(VolumePerTimeUnit::mL_Per_s); - if (m_data.GetSubstances().IsActive(*m_data.GetSubstances().GetSubstance("Sarin"))) { - ResistanceChange *= -1.0; //oppose the effect for sarin + if (m_data.GetSubstances().IsActive(*m_data.GetSubstances().GetSubstance(StandardSubstances::Sarin))) { + ResistanceChange *= -1.0; // oppose the effect for sarin } } if (ResistanceChange < 0.0) - TuningParameter = 0.8; //1.2; + TuningParameter = 0.8; // 1.2; ResistanceChange *= TuningParameter; } - //Drug effects on arterial pressure occur by increasing the systemic vascular resistance. This occurs every time step by updating the next flow resistance. - //These effects are applied in HeartDriver() since its functionality is called every time step. + // Drug effects on arterial pressure occur by increasing the systemic vascular resistance. This occurs every time step by updating the next flow resistance. + // These effects are applied in HeartDriver() since its functionality is called every time step. if (std::abs(ResistanceChange) > ZERO_APPROX) { for (SEFluidCircuitPath* Path : m_systemicResistancePaths) { if (!Path->HasNextResistance()) @@ -2198,13 +2215,13 @@ void Cardiovascular::CalculateHeartRate() double HeartRate_Per_s = 0.0; if (m_data.GetActions().GetPatientActions().HasOverride() && m_data.GetActions().GetPatientActions().GetOverride()->HasHeartRateOverride() - && m_data.GetActions().GetPatientActions().GetOverride()->GetOverrideConformance() == CDM::enumOnOff::Off) { + && m_data.GetActions().GetPatientActions().GetOverride()->GetOverrideConformance() == SEOnOff::Off) { HeartRate_Per_s = m_data.GetActions().GetPatientActions().GetOverride()->GetHeartRateOverride(FrequencyUnit::Per_s); } else { HeartRate_Per_s = 1.0 / (m_CurrentCardiacCycleDuration_s - m_dT_s); } GetHeartRate().SetValue(HeartRate_Per_s * 60.0, FrequencyUnit::Per_min); - m_CurrentCardiacCycleDuration_s = 0.0; //Incremented each time step in HeartDriver + m_CurrentCardiacCycleDuration_s = 0.0; // Incremented each time step in HeartDriver } SEScalar& Cardiovascular::CalculateCardiovascularSOFA() @@ -2212,10 +2229,10 @@ SEScalar& Cardiovascular::CalculateCardiovascularSOFA() SEScalar* sofa = new SEScalar(); double sofaScore = 0.0; const double meanPressure = GetMeanArterialPressure(PressureUnit::mmHg); - SESubstance* norEpi = m_data.GetSubstances().GetSubstance("Norepinephrine"); + SESubstance* norEpi = m_data.GetSubstances().GetSubstance(StandardSubstances::Norepinephrine); std::map infusionMap = m_data.GetActions().GetPatientActions().GetSubstanceInfusions(); if (meanPressure >= 70.0) { - //Normal, leave sofaScore = 0 + // Normal, leave sofaScore = 0 } else if (m_data.GetSubstances().IsActive(*norEpi) && infusionMap.find(norEpi) != infusionMap.end()) { SESubstanceInfusion* norEpiInfusion = infusionMap.at(norEpi); const double infusionRate_ug_Per_kg_min = norEpiInfusion->GetRate().GetValue(VolumePerTimeUnit::mL_Per_min) * norEpiInfusion->GetConcentration().GetValue(MassPerVolumeUnit::ug_Per_mL) / m_data.GetPatient().GetWeight(MassUnit::kg); @@ -2225,7 +2242,7 @@ SEScalar& Cardiovascular::CalculateCardiovascularSOFA() sofaScore = 4.0; } } else { - //MAP < 70, but we aren't giving catecholamines yet + // MAP < 70, but we aren't giving catecholamines yet sofaScore = 1.0; } sofa->SetValue(sofaScore); @@ -2261,7 +2278,7 @@ void Cardiovascular::ProcessOverride() GetMeanArterialPressure().SetValue(override->GetMAPOverride(PressureUnit::mmHg), PressureUnit::mmHg); } if (override->HasHeartRateOverride()) { - if (override->GetOverrideConformance() == CDM::enumOnOff::Off) { + if (override->GetOverrideConformance() == SEOnOff::Off) { GetHeartRate().SetValue(override->GetHeartRateOverride(FrequencyUnit::Per_min), FrequencyUnit::Per_min); } } @@ -2278,28 +2295,28 @@ void Cardiovascular::OverrideControlLoop() { auto override = m_data.GetActions().GetPatientActions().GetOverride(); - constexpr double maxBloodVolumeOverride = 25.0; //L - constexpr double minBloodVolumeOverride = 0.0; //L - constexpr double maxCardiacOutput = 100.0; //L/min - constexpr double minCardiacOutput = 0.0; //L/min - constexpr double maxDiastolicArtPressureOverride = 200.0; //mmHg - constexpr double minDiastolicArtPressureOverride = 0.0; //mmHg - constexpr double maxMAPOverride = 105.0; //mmHg - constexpr double minMAPOverride = 60.0; //mmHg - const double maxHROverride = m_data.GetPatient().GetHeartRateMaximum(FrequencyUnit::Per_min); //bpm, max estimate of patient's max age related heart is [220-age_yr] so override provides a huge buffer above this estimate - const double minHROverride = m_data.GetPatient().GetHeartRateMinimum(FrequencyUnit::Per_min); //bpm - constexpr double maxHeartStrokeVolumeOverride = 5000.0; //mL - constexpr double minHeartStrokeVolumeOverride = 0.0; //mL - constexpr double maxSystolicArtPressureOverride = 300.0; //mmHg - constexpr double minSystolicArtPressureOverride = 0.0; //mmHg - - double currentBloodVolumeOverride = 0.0; //value gets changed in next check - double currentCardiacOutput = 0.0; //value gets changed in next check - double currentDiastolicArtPressureOverride = 0.0; //value gets changed in next check - double currentMAPOverride = 85.0; //Average MAP, value gets changed in next check - double currentHROverride = 80.0; //Average HR, value gets changed in next check - double currentHeartStrokeVolumeOverride = 0.0; //value gets changed in next check - double currentSystolicArtPressureOverride = 0.0; //value gets changed in next check + constexpr double maxBloodVolumeOverride = 25.0; // L + constexpr double minBloodVolumeOverride = 0.0; // L + constexpr double maxCardiacOutput = 100.0; // L/min + constexpr double minCardiacOutput = 0.0; // L/min + constexpr double maxDiastolicArtPressureOverride = 200.0; // mmHg + constexpr double minDiastolicArtPressureOverride = 0.0; // mmHg + constexpr double maxMAPOverride = 105.0; // mmHg + constexpr double minMAPOverride = 60.0; // mmHg + const double maxHROverride = m_data.GetPatient().GetHeartRateMaximum(FrequencyUnit::Per_min); // bpm, max estimate of patient's max age related heart is [220-age_yr] so override provides a huge buffer above this estimate + const double minHROverride = m_data.GetPatient().GetHeartRateMinimum(FrequencyUnit::Per_min); // bpm + constexpr double maxHeartStrokeVolumeOverride = 5000.0; // mL + constexpr double minHeartStrokeVolumeOverride = 0.0; // mL + constexpr double maxSystolicArtPressureOverride = 300.0; // mmHg + constexpr double minSystolicArtPressureOverride = 0.0; // mmHg + + double currentBloodVolumeOverride = 0.0; // value gets changed in next check + double currentCardiacOutput = 0.0; // value gets changed in next check + double currentDiastolicArtPressureOverride = 0.0; // value gets changed in next check + double currentMAPOverride = 85.0; // Average MAP, value gets changed in next check + double currentHROverride = 80.0; // Average HR, value gets changed in next check + double currentHeartStrokeVolumeOverride = 0.0; // value gets changed in next check + double currentSystolicArtPressureOverride = 0.0; // value gets changed in next check if (override->HasBloodVolumeOverride()) { currentBloodVolumeOverride = override->GetBloodVolumeOverride(VolumeUnit::L); @@ -2323,40 +2340,40 @@ void Cardiovascular::OverrideControlLoop() currentSystolicArtPressureOverride = override->GetSystolicArterialPressureOverride(PressureUnit::mmHg); } - if ((currentBloodVolumeOverride < minBloodVolumeOverride || currentBloodVolumeOverride > maxBloodVolumeOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentBloodVolumeOverride < minBloodVolumeOverride || currentBloodVolumeOverride > maxBloodVolumeOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Blood Volume Override (Cardiovascular) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentCardiacOutput < minCardiacOutput || currentCardiacOutput > maxCardiacOutput) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentCardiacOutput < minCardiacOutput || currentCardiacOutput > maxCardiacOutput) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Cardiac Output Override (Cardiovascular) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentDiastolicArtPressureOverride < minDiastolicArtPressureOverride || currentDiastolicArtPressureOverride > maxDiastolicArtPressureOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentDiastolicArtPressureOverride < minDiastolicArtPressureOverride || currentDiastolicArtPressureOverride > maxDiastolicArtPressureOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Diastolic Arterial Pressure Override (Cardiovascular) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentMAPOverride < minMAPOverride || currentMAPOverride > maxMAPOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentMAPOverride < minMAPOverride || currentMAPOverride > maxMAPOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Mean Arterial Pressure Override (Cardiovascular) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentHROverride < minHROverride || currentHROverride > maxHROverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentHROverride < minHROverride || currentHROverride > maxHROverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Heart Rate (Cardiovascular) Override set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentHeartStrokeVolumeOverride < minHeartStrokeVolumeOverride || currentHeartStrokeVolumeOverride > maxHeartStrokeVolumeOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentHeartStrokeVolumeOverride < minHeartStrokeVolumeOverride || currentHeartStrokeVolumeOverride > maxHeartStrokeVolumeOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Heart Stroke Volume Override (Cardiovascular) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentSystolicArtPressureOverride < minSystolicArtPressureOverride || currentSystolicArtPressureOverride > maxSystolicArtPressureOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentSystolicArtPressureOverride < minSystolicArtPressureOverride || currentSystolicArtPressureOverride > maxSystolicArtPressureOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Systolic Arterial Pressure Override (Cardiovascular) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } return; } diff --git a/projects/biogears/libBiogears/src/engine/Systems/Diffusion.cpp b/projects/biogears/libBiogears/src/engine/Systems/Diffusion.cpp index b56e6a1e1..ec0264b50 100644 --- a/projects/biogears/libBiogears/src/engine/Systems/Diffusion.cpp +++ b/projects/biogears/libBiogears/src/engine/Systems/Diffusion.cpp @@ -41,14 +41,14 @@ void DiffusionCalculator::Initialize(SESubstanceManager& subMgr) //Drugs are handled by ActiveDrugs vector in SubManager continue; } - if (sub->GetState() == CDM::enumSubstanceState::Gas) { + if (sub->GetState() == SESubstanceState::Gas) { m_InstantDiffusionSubstances.emplace_back(sub); continue; } if (sub->HasMaximumDiffusionFlux()) { m_FacilitatedDiffusionSubstances.emplace_back(sub); } else { - if (sub->GetMolarMass(MassPerAmountUnit::g_Per_mol) < 1000.0 && sub->GetName() != "Bicarbonate" && sub->GetClassification() != CDM::enumSubstanceClass::WholeBlood) { + if (sub->GetMolarMass(MassPerAmountUnit::g_Per_mol) < 1000.0 && sub->GetName() != StandardSubstances::Bicarbonate && sub->GetClassification() != SESubstanceClass::WholeBlood) { //We elect not to transport HCO3 with simple diffusion because it is a charged substance. We also need to filter out blood antigens m_SimpleDiffusionSubstances.emplace_back(sub); } @@ -206,7 +206,7 @@ void DiffusionCalculator::CalculateLinearDiffusionMethods() rowNumber = 0; for (auto simpleSub : m_SimpleDiffusionSubstances) { massToMoveVE_ug = DeltaMassSimpleVE_ug(rowNumber, colNumber); - massToMoveEI_ug = simpleSub->GetClassification() == CDM::enumSubstanceClass::Ion ? 0.0 : DeltaMassSimpleEI_ug(rowNumber, colNumber); + massToMoveEI_ug = simpleSub->GetClassification() == SESubstanceClass::Ion ? 0.0 : DeltaMassSimpleEI_ug(rowNumber, colNumber); vascularSubQ = diffSet.vascular->GetSubstanceQuantity(*simpleSub); extracellularSubQ = diffSet.extracellular->GetSubstanceQuantity(*simpleSub); intracellularSubQ = diffSet.intracellular->GetSubstanceQuantity(*simpleSub); @@ -248,7 +248,7 @@ void DiffusionCalculator::CalculateLinearDiffusionMethods() //Extracellular->Intracellular transport of ions happens in Tissue::CoupledIonTransport //We do need to diffuse extracellular ion mass that transfers with vascular, but we do not want to balance yet //Ion balance on both extra and intra happens in CoupledIonTransport - if (simpleSub->GetClassification() == CDM::enumSubstanceClass::Ion) { + if (simpleSub->GetClassification() == SESubstanceClass::Ion) { vascularSubQ->Balance(BalanceLiquidBy::Mass); rowNumber++; continue; @@ -275,7 +275,7 @@ void DiffusionCalculator::CalculateNonLinearDiffusionMethods() for (auto diffSet : m_DiffusionSets) { CalculateActiveIonDiffusion(diffSet); for (auto facilitatedSub : m_FacilitatedDiffusionSubstances) { - if (facilitatedSub->GetName() == "Triacylglycerol" && diffSet.vascular->GetName() == BGE::VascularCompartment::Brain) + if (facilitatedSub->GetName() == StandardSubstances::Triacylglycerol && diffSet.vascular->GetName() == BGE::VascularCompartment::Brain) continue; double massToAreaCoefficient_cm2_Per_g = 1.0; /// \todo Define relationship between tissue mass and membrane area. double capCoverage_cm2 = massToAreaCoefficient_cm2_Per_g * diffSet.tissue->GetTotalMass(MassUnit::g); diff --git a/projects/biogears/libBiogears/src/engine/Systems/Drugs.cpp b/projects/biogears/libBiogears/src/engine/Systems/Drugs.cpp index 1be5cc05a..f1eee532a 100644 --- a/projects/biogears/libBiogears/src/engine/Systems/Drugs.cpp +++ b/projects/biogears/libBiogears/src/engine/Systems/Drugs.cpp @@ -11,7 +11,12 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Actions.h" +#include "io/cdm/PatientActions.h" +#include "io/cdm/Physiology.h" + #include +#include #include #include #include @@ -46,7 +51,6 @@ specific language governing permissions and limitations under the License. #include #include -namespace BGE = mil::tatrc::physiology::biogears; namespace std { template class std::map; @@ -64,17 +68,17 @@ Drugs::Drugs(BioGears& bg) : SEDrugSystem(bg.GetLogger()) , m_data(bg) { - Clear(); + Invalidate(); } Drugs::~Drugs() { - Clear(); + Invalidate(); } -void Drugs::Clear() +void Drugs::Invalidate() { - SEDrugSystem::Clear(); + SEDrugSystem::Invalidate(); m_aortaVascular = nullptr; m_venaCavaVascular = nullptr; m_muscleIntracellular = nullptr; @@ -83,7 +87,7 @@ void Drugs::Clear() m_IVToVenaCava = nullptr; m_Sarin = nullptr; m_Pralidoxime = nullptr; - DELETE_MAP_SECOND(m_BolusAdministrations); + DELETE_MAP_OF_POINTERS(m_BolusAdministrations); } //-------------------------------------------------------------------------------------------------- @@ -106,91 +110,14 @@ void Drugs::Initialize() GetTidalVolumeChange().SetValue(0.0, VolumeUnit::mL); GetTubularPermeabilityChange().SetValue(0); GetCentralNervousResponse().SetValue(0.0); - m_data.GetBloodChemistry().GetRedBloodCellAcetylcholinesterase().SetValue(8.0 * 1e-9, AmountPerVolumeUnit::mol_Per_L); //Need to initialize here since Drugs processed before BloodChemistry - m_data.GetBloodChemistry().GetHemoglobinLostToUrine().SetValue(0.0, MassUnit::g); //Need to initialize here since Drugs processed before BloodChemistry + m_data.GetBloodChemistry().GetRedBloodCellAcetylcholinesterase().SetValue(8.0 * 1e-9, AmountPerVolumeUnit::mol_Per_L); // Need to initialize here since Drugs processed before BloodChemistry + m_data.GetBloodChemistry().GetHemoglobinLostToUrine().SetValue(0.0, MassUnit::g); // Need to initialize here since Drugs processed before BloodChemistry m_data.GetBloodChemistry().GetRhTransfusionReactionVolume().SetValue(0.0, VolumeUnit::uL); m_SarinRbcAcetylcholinesteraseComplex_nM = 0.0; m_AgedRbcAcetylcholinesterase_nM = 0.0; } -bool Drugs::Load(const CDM::BioGearsDrugSystemData& in) -{ - if (!SEDrugSystem::Load(in)) - return false; - - m_SarinRbcAcetylcholinesteraseComplex_nM = in.SarinRbcAcetylcholinesteraseComplex_nM(); - m_AgedRbcAcetylcholinesterase_nM = in.AgedRbcAcetylcholinesterase_nM(); - - BioGearsSystem::LoadState(); - - for (const CDM::SubstanceBolusStateData& bData : in.BolusAdministration()) { - SESubstance* sub = m_data.GetSubstances().GetSubstance(bData.Substance()); - if (sub == nullptr) { - /// \error Error: Unable to find substance for IV bolus administration - m_ss << "Unable to find substance " << bData.Substance(); - Error(m_ss.str(), "Drugs::Load::BolusAdministration"); - return false; - } - SESubstanceBolusState* bolusState = new SESubstanceBolusState(*sub); - m_BolusAdministrations[sub] = bolusState; - bolusState->Load(bData); - } - - for (const CDM::TransmucosalStateData& otData : in.TransmucosalStates()) { - SESubstance* sub = m_data.GetSubstances().GetSubstance(otData.Substance()); - if (sub == nullptr) { - m_ss << "Unable to find subtance " << otData.Substance(); - Error(m_ss.str(), "Drugs::Load::OralAdministration"); - return false; - } - SETransmucosalState* otState = new SETransmucosalState(*sub); - m_TransmucosalStates[sub] = otState; - otState->Load(otData); - } - - for (const CDM::NasalStateData& nData : in.NasalStates()) { - SESubstance* sub = m_data.GetSubstances().GetSubstance(nData.Substance()); - if (sub == nullptr) { - m_ss << "Unable to find subtance " << nData.Substance(); - Error(m_ss.str(), "Drugs::Load::NasalAdministration"); - return false; - } - SENasalState* nState = new SENasalState(*sub); - m_NasalStates[sub] = nState; - nState->Load(nData); - } - - return true; -} -CDM::BioGearsDrugSystemData* Drugs::Unload() const -{ - CDM::BioGearsDrugSystemData* data = new CDM::BioGearsDrugSystemData(); - Unload(*data); - return data; -} -void Drugs::Unload(CDM::BioGearsDrugSystemData& data) const -{ - SEDrugSystem::Unload(data); - data.SarinRbcAcetylcholinesteraseComplex_nM(m_SarinRbcAcetylcholinesteraseComplex_nM); - data.AgedRbcAcetylcholinesterase_nM(m_AgedRbcAcetylcholinesterase_nM); - - for (auto itr : m_BolusAdministrations) { - if (itr.second != nullptr) - data.BolusAdministration().push_back(std::unique_ptr(itr.second->Unload())); - } - - for (auto itr : m_TransmucosalStates) { - if (itr.second != nullptr) - data.TransmucosalStates().push_back(std::unique_ptr(itr.second->Unload())); - } - - for (auto itr : m_NasalStates) { - if (itr.second != nullptr) - data.NasalStates().push_back(std::unique_ptr(itr.second->Unload())); - } -} - //-------------------------------------------------------------------------------------------------- /// \brief /// Initializes parameters for the Drugs Class @@ -209,11 +136,11 @@ void Drugs::SetUp() m_liverVascular = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Liver); m_liverTissue = m_data.GetCompartments().GetTissueCompartment(BGE::TissueCompartment::Liver); m_IVToVenaCava = m_data.GetCircuits().GetCardiovascularCircuit().GetPath(BGE::CardiovascularPath::IVToVenaCava); - //Need to set up pointers for Sarin and Pralidoxime to handle nerve agent events since they use a different method to calculate effects - m_Sarin = m_data.GetSubstances().GetSubstance("Sarin"); - m_Pralidoxime = m_data.GetSubstances().GetSubstance("Pralidoxime"); - m_Atropine = m_data.GetSubstances().GetSubstance("Atropine"); - DELETE_MAP_SECOND(m_BolusAdministrations); + // Need to set up pointers for Sarin and Pralidoxime to handle nerve agent events since they use a different method to calculate effects + m_Sarin = m_data.GetSubstances().GetSubstance(StandardSubstances::Sarin); + m_Pralidoxime = m_data.GetSubstances().GetSubstance(StandardSubstances::Pralidoxime); + m_Atropine = m_data.GetSubstances().GetSubstance(StandardSubstances::Atropine); + DELETE_MAP_OF_POINTERS(m_BolusAdministrations); } //-------------------------------------------------------------------------------------------------- @@ -283,7 +210,7 @@ void Drugs::PostProcess() //-------------------------------------------------------------------------------------------------- void Drugs::AdministerSubstanceBolus() { - //Need to loop over Bolus Dose Objects + // Need to loop over Bolus Dose Objects const std::map& boluses = m_data.GetActions().GetPatientActions().GetSubstanceBoluses(); if (boluses.empty()) return; @@ -296,7 +223,7 @@ void Drugs::AdministerSubstanceBolus() double dose_mL; double concentration_ugPermL; double massIncrement_ug = 0; - double administrationTime_s = 10.0; //Default if not supplied by action + double administrationTime_s = 10.0; // Default if not supplied by action for (auto b : boluses) { sub = b.first; @@ -314,13 +241,13 @@ void Drugs::AdministerSubstanceBolus() } switch (bolus->GetAdminRoute()) { - case CDM::enumBolusAdministration::Intraarterial: + case SEBolusAdministration::Intraarterial: subQ = m_aortaVascular->GetSubstanceQuantity(*sub); break; - case CDM::enumBolusAdministration::Intravenous: + case SEBolusAdministration::Intravenous: subQ = m_venaCavaVascular->GetSubstanceQuantity(*sub); break; - case CDM::enumBolusAdministration::Intramuscular: + case SEBolusAdministration::Intramuscular: subQ = m_muscleIntracellular->GetSubstanceQuantity(*sub); break; default: @@ -360,7 +287,7 @@ void Drugs::AdministerSubstanceBolus() //-------------------------------------------------------------------------------------------------- void Drugs::AdministerSubstanceInfusion() { - //Note: Currently, user removes state by setting the infusion rate of the drug in question to 0.0 + // Note: Currently, user removes state by setting the infusion rate of the drug in question to 0.0 const std::map& infusions = m_data.GetActions().GetPatientActions().GetSubstanceInfusions(); if (infusions.empty()) return; @@ -436,7 +363,7 @@ void Drugs::AdministerSubstanceNasal() SENasalState* nState = m_NasalStates[nSub]; if (nState == nullptr) { - //If it doesn't exist yet, make a new model state for the substance and initialize it + // If it doesn't exist yet, make a new model state for the substance and initialize it nState = new SENasalState(*nSub); if (!nState->Initialize(nDose->GetDose())) { Error("SENasalState::Probable vector length mismatch"); @@ -446,27 +373,27 @@ void Drugs::AdministerSubstanceNasal() double newNasalDose_mg = nDose->GetDose().GetValue(MassUnit::mg); double transconst = 1.0; - double carrier = 1.8*(0.0000000001); //1.0; + double carrier = 1.8 * (0.0000000001); // 1.0; double absconst = 13.2; double degredation = 20.0; - //Rate constants in 1/s - const double nasalk1 = transconst*(0.00000001736111); //translocation rate constant of unreleased substance from the anterior to the posterior section - const double nasalk2 = carrier*(1000000); // rate constant of release from drug carrier in anterior section - const double nasalk3 = transconst*(0.00000001736111); // translocation rate constant of released substance from the anterior to the posterior section - const double nasalk4 = absconst*(0.000173); // absorption rate constant in anterior section + // Rate constants in 1/s + const double nasalk1 = transconst * (0.00000001736111); // translocation rate constant of unreleased substance from the anterior to the posterior section + const double nasalk2 = carrier * (1000000); // rate constant of release from drug carrier in anterior section + const double nasalk3 = transconst * (0.00000001736111); // translocation rate constant of released substance from the anterior to the posterior section + const double nasalk4 = absconst * (0.000173); // absorption rate constant in anterior section const double nasalk5 = 0.000000011575; // translocation rate constant of unreleased substance from the posterior to the gastrointestinal section - const double nasalk6 = carrier*(1000000); // rate constant of release from drug carrier in posterior section - const double nasalk7 = transconst*(0.00000011575); // translocation rate constant of released substance from the posterior to the gastrointestinal section - const double nasalk8 = absconst*(0.0000260); // absorption rate constant in posterior section - const double nasalk9 = carrier*(1000000); // rate constant of release from drug carrier in gastrointestinal section - const double nasalk10 = absconst*(0.0000000027); // absorption rate constant in gastrointestinal section - const double nasalk11 = degredation*(0.0001); // rate constant of released drug degradation in anterior section - const double nasalk12 = degredation*(0.0001); // rate constant of released drug degradation in posterior section - const double nasalk13 = degredation*(0.00001); // rate constant of released drug degradation in gastrointestinal section + const double nasalk6 = carrier * (1000000); // rate constant of release from drug carrier in posterior section + const double nasalk7 = transconst * (0.00000011575); // translocation rate constant of released substance from the posterior to the gastrointestinal section + const double nasalk8 = absconst * (0.0000260); // absorption rate constant in posterior section + const double nasalk9 = carrier * (1000000); // rate constant of release from drug carrier in gastrointestinal section + const double nasalk10 = absconst * (0.0000000027); // absorption rate constant in gastrointestinal section + const double nasalk11 = degredation * (0.0001); // rate constant of released drug degradation in anterior section + const double nasalk12 = degredation * (0.0001); // rate constant of released drug degradation in posterior section + const double nasalk13 = degredation * (0.00001); // rate constant of released drug degradation in gastrointestinal section const double nasalk14 = 0.000027777; // transit rate constant of unreleased drug through gastrointestinal section const double nasalk15 = 0.000027777; // transit rate constant of released drug through gastrointestinal section - //Initial Drug Distribution + // Initial Drug Distribution std::vector unrelMass = nState->GetUnreleasedNasalMasses(MassUnit::mg); std::vector relMass = nState->GetReleasedNasalMasses(MassUnit::mg); @@ -483,15 +410,15 @@ void Drugs::AdministerSubstanceNasal() double nasalGastroUnreleasedInitial_mg = unrelMass[2]; // initial amount of unreleased drug in gastrointestinal section double nasalGastroReleasedInitial_mg = relMass[2]; // initial amount of released drug in gastrointestinal section - //Intermediate Values - const double nasalAlpha = nasalk1 + nasalk2; //alpha - const double nasalBeta = nasalk5 + nasalk6; //beta - const double nasalGamma = nasalk9 + nasalk14; //gamma - const double nasalDelta = nasalk3 + nasalk4 + nasalk11; //delta - const double nasalEpsilon = nasalk7 + nasalk8 + nasalk12; //epsilon - const double nasalOmega = nasalk10 + nasalk13 + nasalk15; //omega + // Intermediate Values + const double nasalAlpha = nasalk1 + nasalk2; // alpha + const double nasalBeta = nasalk5 + nasalk6; // beta + const double nasalGamma = nasalk9 + nasalk14; // gamma + const double nasalDelta = nasalk3 + nasalk4 + nasalk11; // delta + const double nasalEpsilon = nasalk7 + nasalk8 + nasalk12; // epsilon + const double nasalOmega = nasalk10 + nasalk13 + nasalk15; // omega - //Differential Equation Solution Constants + // Differential Equation Solution Constants const double nasalC1 = (nasalk1 * nasalAnteriorUnreleasedInitial_mg) / (nasalBeta - nasalAlpha); const double nasalC2 = nasalPosteriorUnreleasedInitial_mg - nasalC1; const double nasalC3 = (nasalk5 * nasalC1) / (nasalGamma - nasalAlpha); @@ -511,14 +438,14 @@ void Drugs::AdministerSubstanceNasal() const double nasalCp2 = nasalPosteriorReleasedInitial_mg - nasalC7 - nasalC8 - nasalC9; const double nasalCp3 = nasalGastroReleasedInitial_mg - nasalC10 - nasalC11 - nasalC12 - nasalC13 - nasalC14; - //Amounts of Unreleased Drug - ODE style + // Amounts of Unreleased Drug - ODE style double dNasal_Anterior_Unreleased_Per_dt = -nasalAlpha * unrelMass[0]; unrelMass[0] += (dNasal_Anterior_Unreleased_Per_dt * m_dt_s); double dNasal_Posterior_Unreleased_Per_dt = (nasalk1 * unrelMass[0]) - (nasalBeta * unrelMass[1]); unrelMass[1] += (dNasal_Posterior_Unreleased_Per_dt * m_dt_s); double dNasal_Gastro_Unreleased_Per_dt = (nasalk5 * unrelMass[1]) - (nasalGamma * unrelMass[2]); unrelMass[2] += (dNasal_Gastro_Unreleased_Per_dt * m_dt_s); - //Amounts of Released Drug - ODE style + // Amounts of Released Drug - ODE style double dNasal_Anterior_Released_Per_dt = (nasalk2 * unrelMass[0]) - (nasalDelta * relMass[0]); relMass[0] += (dNasal_Anterior_Released_Per_dt * m_dt_s); double dNasal_Posterior_Released_Per_dt = (nasalk6 * unrelMass[1]) + (nasalk3 * relMass[0]) - (nasalEpsilon * relMass[1]); @@ -531,11 +458,11 @@ void Drugs::AdministerSubstanceNasal() nState->SetReleasedNasalMasses(relMass, MassUnit::mg); nDose->GetDose().SetValue(0.0, MassUnit::mg); // Once dose is distributed in model, set initial dose to zero. This allows for multiple doses. - //Rate of systemic absorption of the intact drug + // Rate of systemic absorption of the intact drug const double nasalSystemicAbsorptionRate_mg_Per_s = (nasalk4 * relMass[0]) + (nasalk8 * relMass[1]) + (nasalk10 * relMass[2]); // mg/s double totalDose_mg = unrelMass[0] + unrelMass[1] + unrelMass[2] + relMass[0] + relMass[1] + relMass[2]; - //Systemic bioavailability of the intact drug + // Systemic bioavailability of the intact drug const double nasalBioavailability = (nasalk4 * (nasalC5 / (nasalAlpha + nasalC6 / nasalDelta)) + nasalk8 * (nasalC7 / nasalAlpha + nasalC8 / nasalBeta + nasalC9 / nasalDelta + nasalCp2 / nasalEpsilon) + nasalk10 * (nasalC10 / nasalAlpha + nasalC11 / nasalBeta + nasalC12 / nasalGamma + nasalC13 / nasalDelta + nasalC14 / nasalEpsilon + nasalCp3 / nasalOmega)) / totalDose_mg; m_venaCavaVascular->GetSubstanceQuantity(*nSub)->GetMass().IncrementValue(nasalSystemicAbsorptionRate_mg_Per_s * m_dt_s, MassUnit::mg); @@ -561,7 +488,7 @@ void Drugs::AdministerSubstanceNasal() //-------------------------------------------------------------------------------------------------- void Drugs::AdministerSubstanceOral() { - //Need to loop over oral dose Objects + // Need to loop over oral dose Objects const std::map& oralDoses = m_data.GetActions().GetPatientActions().GetSubstanceOralDoses(); if (oralDoses.empty()) return; @@ -573,49 +500,49 @@ void Drugs::AdministerSubstanceOral() for (auto od : oralDoses) { sub = od.first; oDose = od.second; - if (oDose->GetAdminRoute() == CDM::enumOralAdministration::Transmucosal) { - //Drug is being given transmucosally--get oral transmucosal (OT) state for this substance if it already exists + if (oDose->GetAdminRoute() == SEOralAdministrationType::Transmucosal) { + // Drug is being given transmucosally--get oral transmucosal (OT) state for this substance if it already exists SETransmucosalState* otState = m_TransmucosalStates[sub]; if (otState == nullptr) { - //If it doesn't exist yet, make a new model state for the substance and initialize it + // If it doesn't exist yet, make a new model state for the substance and initialize it otState = new SETransmucosalState(*sub); if (!otState->Initialize(oDose->GetDose())) { Error("SEOralTransmucosalState::Probable vector length mismatch"); } m_TransmucosalStates[sub] = otState; - //Every OT state needs to initialize a GI absorption model state to account for drug that is swallowed. - //Clearly we are assuming that there is not already an active pill of the same substance already present in the GI (seems like a safe assumption). + // Every OT state needs to initialize a GI absorption model state to account for drug that is swallowed. + // Clearly we are assuming that there is not already an active pill of the same substance already present in the GI (seems like a safe assumption). m_data.GetGastrointestinal().NewDrugTransitState(sub); if (!m_data.GetGastrointestinal().GetDrugTransitState(sub)->Initialize(oDose->GetDose(), oDose->GetAdminRoute())) { Error("SEGastrointestinalSystem::SEDrugAbsorptionTransitModelState: Probably vector length mismatch"); } } - //Process the transmucosal model for this substance--the function returns the total amount of drug remaining in the oral mucosal layers and mouth + // Process the transmucosal model for this substance--the function returns the total amount of drug remaining in the oral mucosal layers and mouth double massRemaining_ug = OralTransmucosalModel(sub, otState); - //If 99.9% of the original dose has been removed from model (either through absorption or swallowing), deactivate the action and remove it - // from the TransmucosalStates map. This will not effect the GI Transit state--drug in GI will still be processed. + // If 99.9% of the original dose has been removed from model (either through absorption or swallowing), deactivate the action and remove it + // from the TransmucosalStates map. This will not effect the GI Transit state--drug in GI will still be processed. if (massRemaining_ug < 0.001 * oDose->GetDose().GetValue(MassUnit::ug)) { deactiveSubs.emplace_back(sub); } } else { - //Oral dose is being given as a pill--initiate a GI absorption model state for it if it doesn't already exist. + // Oral dose is being given as a pill--initiate a GI absorption model state for it if it doesn't already exist. if (m_data.GetGastrointestinal().GetDrugTransitState(sub) == nullptr) { m_data.GetGastrointestinal().NewDrugTransitState(sub); if (!m_data.GetGastrointestinal().GetDrugTransitState(sub)->Initialize(oDose->GetDose(), oDose->GetAdminRoute())) { Error("SEGastrointestinalSystem::SEDrugAbsorptionTransitModelState: Probably vector length mismatch"); } } else { - //If the drug already has as an existing GI state, that means we are repeat dosing. Get the drug state and add the new dose to the stomach + // If the drug already has as an existing GI state, that means we are repeat dosing. Get the drug state and add the new dose to the stomach m_data.GetGastrointestinal().GetDrugTransitState(sub)->IncrementStomachSolidMass(oDose->GetDose().GetValue(MassUnit::mg), MassUnit::mg); } - //We can remove the action right away because the GI will keep processing the drug once the transit model state is initiated - //By deactivating the Oral Dose action right away, we will be able to detect repeat dose actions + // We can remove the action right away because the GI will keep processing the drug once the transit model state is initiated + // By deactivating the Oral Dose action right away, we will be able to detect repeat dose actions deactiveSubs.emplace_back(sub); } } for (auto deSub : deactiveSubs) { - if (oralDoses.at(deSub)->GetAdminRoute() == CDM::enumOralAdministration::Transmucosal) { - m_TransmucosalStates.erase(deSub); //This removes both key and element, which I think is the behavior that we want + if (oralDoses.at(deSub)->GetAdminRoute() == SEOralAdministrationType::Transmucosal) { + m_TransmucosalStates.erase(deSub); // This removes both key and element, which I think is the behavior that we want } m_data.GetActions().GetPatientActions().RemoveSubstanceOralDose(*deSub); } @@ -636,7 +563,7 @@ void Drugs::AdministerSubstanceCompoundInfusion() return; SEPatient& patient = m_data.GetPatient(); - const CDM::enumBloodType::value patientBloodType = patient.GetBloodType(); + const SEBloodType patientBloodType = patient.GetBloodType(); SESubstanceCompoundInfusion* infusion; const SESubstanceCompound* compound; SELiquidSubstanceQuantity* subQ; @@ -673,10 +600,10 @@ void Drugs::AdministerSubstanceCompoundInfusion() double massIncrement_ug = volumeToAdminister_mL * component.GetConcentration(MassPerVolumeUnit::ug_Per_mL); subQ->GetMass().IncrementValue(massIncrement_ug, MassUnit::ug); - //Blood Transfusion// - if (component.GetSubstance().GetName() == "RedBloodCell") { - /* - //Transfusiuon-Associated Circulatory Overload (TACO) CHECK + // Blood Transfusion// + if (component.GetSubstance().Name == StandardSubstances::RedBloodCell) { + /* + //Transfusiuon-Associated Circulatory Overload (TACO) CHECK if (totalRate_mL_Per_s >= 3) { // Rate should not exceed 2 mL/s plus a 50% deviation to be safe (little diagnostic research on the topic/underreported but common reaction) std::stringstream ss; ss << "Patient is experiencing Transfusion Associated Circulatory Overload (TACO) due to greater than reccomended infusion rate"; @@ -684,9 +611,9 @@ void Drugs::AdministerSubstanceCompoundInfusion() } */ - //Check for HTR - SESubstance* m_AntigenA = m_data.GetSubstances().GetSubstance("Antigen_A"); - SESubstance* m_AntigenB = m_data.GetSubstances().GetSubstance("Antigen_B"); + // Check for HTR + SESubstance* m_AntigenA = m_data.GetSubstances().GetSubstance(StandardSubstances::Antigen_A); + SESubstance* m_AntigenB = m_data.GetSubstances().GetSubstance(StandardSubstances::Antigen_B); const double AntigenA_ct_Per_uL = m_venaCavaVascular->GetSubstanceQuantity(*m_AntigenA)->GetMolarity(AmountPerVolumeUnit::ct_Per_uL); const double AntigenB_ct_Per_uL = m_venaCavaVascular->GetSubstanceQuantity(*m_AntigenB)->GetMolarity(AmountPerVolumeUnit::ct_Per_uL); @@ -694,13 +621,13 @@ void Drugs::AdministerSubstanceCompoundInfusion() // First check for AB type since AB is a universal acceptor // Second check for O type acceptor and ANY antigen presence since it would cause a reaction // Last check for A and B presence because if one or the either, both should not be present or else reaction - if (patientBloodType != (CDM::enumBloodType::AB)) { - if (patientBloodType == CDM::enumBloodType::O) { + if (patientBloodType != (SEBloodType::AB)) { + if (patientBloodType == SEBloodType::O) { if (AntigenA_ct_Per_uL > 0 || AntigenB_ct_Per_uL > 0) { - patient.SetEvent(CDM::enumPatientEvent::HemolyticTransfusionReaction, true, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::HemolyticTransfusionReaction, true, m_data.GetSimulationTime()); } } else if (AntigenA_ct_Per_uL > 0 && AntigenB_ct_Per_uL > 0) { - patient.SetEvent(CDM::enumPatientEvent::HemolyticTransfusionReaction, true, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::HemolyticTransfusionReaction, true, m_data.GetSimulationTime()); } } @@ -711,12 +638,12 @@ void Drugs::AdministerSubstanceCompoundInfusion() } } - if (!patient.IsEventActive(CDM::enumPatientEvent::HemolyticTransfusionReaction) && !patient.GetBloodRh() && compound->GetRhFactor()) { + if (!patient.IsEventActive(SEPatientEventType::HemolyticTransfusionReaction) && !patient.GetBloodRh() && compound->GetRhFactor()) { m_data.GetBloodChemistry().GetRhTransfusionReactionVolume().IncrementValue(volumeToAdminister_mL, VolumeUnit::mL); - patient.SetEvent(CDM::enumPatientEvent::HemolyticTransfusionReaction, true, m_data.GetSimulationTime()); + patient.SetEvent(SEPatientEventType::HemolyticTransfusionReaction, true, m_data.GetSimulationTime()); } - if (compound->GetName() == "Saline" || compound->GetName() == "RingersLactate" || compound->GetName() == "Antibiotic") //Note: Saline and ringers lactate have different densities than pure water + if (compound->GetName() == StandardSubstances::Saline || compound->GetName() == StandardSubstances::RingersLactate || compound->GetName() == "Antibiotic") // Note: Saline and ringers lactate have different densities than pure water { SEScalarTemperature& ambientTemp = m_data.GetEnvironment().GetConditions().GetAmbientTemperature(); SEScalarMassPerVolume densityFluid; @@ -763,19 +690,19 @@ void Drugs::CalculatePartitionCoefficients() double EquationPartC = 0; double PartitionCoefficient = 0; double TissueToPlasmaProteinRatio = 0; - //Red blood cell constants for estimation of acidic phospholipid association constant (bases and zwitterions) + // Red blood cell constants for estimation of acidic phospholipid association constant (bases and zwitterions) double rbcNeutralLipids = 0.0012; double rbcNeutralPhospholipids = 0.0033; double rbcIntracellularWater = 0.603; double rbcAcidicPhospholipids = 0.57; - double rbcIntracellularPH = 7.2; //See Poulin2011Predictive:Part5 + double rbcIntracellularPH = 7.2; // See Poulin2011Predictive:Part5 double rbcPHEffects = 0.0; - //Constansts for zwitterions + // Constansts for zwitterions double hematocrit = m_data.GetBloodChemistry().GetHematocrit().GetValue(); double bloodPlasmaUnboundRatio = 0.0; double AcidicPhospholipidAssociation = 0.0; - //Loop over tissue nodes + // Loop over tissue nodes for (SETissueCompartment* tissue : m_data.GetCompartments().GetTissueLeafCompartments()) { if (!tissue->HasMatrixVolume()) { continue; @@ -783,7 +710,7 @@ void Drugs::CalculatePartitionCoefficients() SELiquidCompartment& ExtracellularFluid = m_data.GetCompartments().GetExtracellularFluid(*tissue); SELiquidCompartment& IntracellularFluid = m_data.GetCompartments().GetIntracellularFluid(*tissue); - //Loop over substances + // Loop over substances for (SESubstance* sub : m_data.GetCompartments().GetLiquidCompartmentSubstances()) { if (!sub->HasPK()) continue; @@ -791,19 +718,19 @@ void Drugs::CalculatePartitionCoefficients() continue; SESubstancePhysicochemical& pk = sub->GetPK().GetPhysicochemicals(); - CDM::enumSubstanceIonicState::value IonicState = pk.GetIonicState(); + SESubstanceIonicState IonicState = pk.GetIonicState(); double pKA1 = pk.GetPrimaryPKA().GetValue(); - double pKA2 = 0.0; //Only for zwitterions - double P = exp(log(10) * pk.GetLogP().GetValue()); //Getting P from logP value + double pKA2 = 0.0; // Only for zwitterions + double P = exp(log(10) * pk.GetLogP().GetValue()); // Getting P from logP value if (tissue == m_fatTissue) { P = 1.115 * pk.GetLogP().GetValue() - 1.35; P = exp(log(10) * P); } - if (pk.GetBindingProtein() == CDM::enumSubstanceBindingProtein::AAG) { + if (pk.GetBindingProtein() == SESubstanceBindingProtein::AAG) { TissueToPlasmaProteinRatio = tissue->GetTissueToPlasmaAlphaAcidGlycoproteinRatio().GetValue(); - } else if (pk.GetBindingProtein() == CDM::enumSubstanceBindingProtein::Albumin) { + } else if (pk.GetBindingProtein() == SESubstanceBindingProtein::Albumin) { TissueToPlasmaProteinRatio = tissue->GetTissueToPlasmaAlbuminRatio().GetValue(); - } else if (pk.GetBindingProtein() == CDM::enumSubstanceBindingProtein::Lipoprotein) { + } else if (pk.GetBindingProtein() == SESubstanceBindingProtein::Lipoprotein) { TissueToPlasmaProteinRatio = tissue->GetTissueToPlasmaLipoproteinRatio().GetValue(); } else { /// \error Fatal: Binding Protein not supported @@ -814,28 +741,28 @@ void Drugs::CalculatePartitionCoefficients() ss << tissue->GetName(); Fatal(ss); } - //Choose correct set of equations to use given the ionic state of the drug + // Choose correct set of equations to use given the ionic state of the drug switch (IonicState) { - case CDM::enumSubstanceIonicState::Base: + case SESubstanceIonicState::Base: PHEffectPower = pKA1 - IntracellularPH; IntracellularPHEffects = 1.0 + std::pow(10.0, PHEffectPower); PHEffectPower = pKA1 - PlasmaPH; PlasmaPHEffects = 1.0 + std::pow(10.0, PHEffectPower); - //Method of Rogers/Rowland requires an estimate for association constant of bases with acidic phospholipids. This value can be estimated using blood/plasma_unbound partition coefficient - bloodPlasmaUnboundRatio = (pk.GetBloodPlasmaRatio().GetValue() - (1.0 - hematocrit)) / (hematocrit * pk.GetFractionUnboundInPlasma().GetValue()); //See Hinderling1997Red: Kb/p = Ke/pu * fu * hematocrit + (1- hematocrit) - //Recycle equation part A,B,C for determination of acidic phospholipid association + // Method of Rogers/Rowland requires an estimate for association constant of bases with acidic phospholipids. This value can be estimated using blood/plasma_unbound partition coefficient + bloodPlasmaUnboundRatio = (pk.GetBloodPlasmaRatio().GetValue() - (1.0 - hematocrit)) / (hematocrit * pk.GetFractionUnboundInPlasma().GetValue()); // See Hinderling1997Red: Kb/p = Ke/pu * fu * hematocrit + (1- hematocrit) + // Recycle equation part A,B,C for determination of acidic phospholipid association rbcPHEffects = 1.0 + std::pow(10.0, (pKA1 - rbcIntracellularPH)); EquationPartA = (rbcPHEffects * rbcIntracellularWater) / PlasmaPHEffects; EquationPartB = (P * rbcNeutralLipids + (0.3 * P + 0.7) * rbcNeutralPhospholipids) / PlasmaPHEffects; EquationPartC = PlasmaPHEffects / (rbcAcidicPhospholipids * IntracellularPHEffects); AcidicPhospholipidAssociation = (bloodPlasmaUnboundRatio - EquationPartA - EquationPartB) * EquationPartC; - LLIM(AcidicPhospholipidAssociation, 0.0); //Poulin2011Predictive:Part5 notes that in corner cases this value can become negative and should be set to 0 - //Now calculate features of partition coefficient + LLIM(AcidicPhospholipidAssociation, 0.0); // Poulin2011Predictive:Part5 notes that in corner cases this value can become negative and should be set to 0 + // Now calculate features of partition coefficient EquationPartA = (IntracellularPHEffects * IntracellularFluid.GetWaterVolumeFraction().GetValue()) / PlasmaPHEffects; EquationPartB = AcidicPhospholipidAssociation * tissue->GetAcidicPhospohlipidConcentration().GetValue(MassPerMassUnit::mg_Per_g) * IntracellularPHEffects / PlasmaPHEffects; EquationPartC = (P * tissue->GetNeutralLipidsVolumeFraction().GetValue() + (0.3 * P + 0.7) * tissue->GetNeutralPhospholipidsVolumeFraction().GetValue()) / PlasmaPHEffects; break; - case CDM::enumSubstanceIonicState::Acid: + case SESubstanceIonicState::Acid: PHEffectPower = IntracellularPH - pKA1; IntracellularPHEffects = 1.0 + std::pow(10.0, PHEffectPower); PHEffectPower = PlasmaPH - pKA1; @@ -845,7 +772,7 @@ void Drugs::CalculatePartitionCoefficients() / PlasmaPHEffects; EquationPartC = ((1.0 / pk.GetFractionUnboundInPlasma().GetValue()) - 1.0 - ((P * NeutralLipidInPlasmaVolumeFraction + (0.3 * P + 0.7) * NeutralPhosphoLipidInPlasmaVolumeFraction) / PlasmaPHEffects)) * TissueToPlasmaProteinRatio; break; - case CDM::enumSubstanceIonicState::WeakBase: + case SESubstanceIonicState::WeakBase: PHEffectPower = pKA1 - IntracellularPH; IntracellularPHEffects = 1.0 + std::pow(10.0, PHEffectPower); PHEffectPower = pKA1 - PlasmaPH; @@ -855,7 +782,7 @@ void Drugs::CalculatePartitionCoefficients() / PlasmaPHEffects; EquationPartC = ((1.0 / pk.GetFractionUnboundInPlasma().GetValue()) - 1.0 - ((P * NeutralLipidInPlasmaVolumeFraction + (0.3 * P + 0.7) * NeutralPhosphoLipidInPlasmaVolumeFraction) / PlasmaPHEffects)) * TissueToPlasmaProteinRatio; break; - case CDM::enumSubstanceIonicState::Zwitterion: + case SESubstanceIonicState::Zwitterion: if (!pk.HasSecondaryPKA()) { std::stringstream ss; ss << "A zwitterion requires two acid dissociation constants to calculate partition coefficients: Substance = "; @@ -863,25 +790,25 @@ void Drugs::CalculatePartitionCoefficients() Fatal(ss); } pKA2 = pk.GetSecondaryPKA().GetValue(); - //Using std::min/max below to make sure that more acidic and more basic pKa's are applied in proper place + // Using std::min/max below to make sure that more acidic and more basic pKa's are applied in proper place PlasmaPHEffects = 1.0 + std::pow(10.0, PlasmaPH - std::min(pKA1, pKA2)) + std::pow(10.0, std::max(pKA1, pKA2) - PlasmaPH); IntracellularPHEffects = 1.0 + std::pow(10.0, IntracellularPH - std::min(pKA1, pKA2)) + std::pow(10.0, std::max(pKA1, pKA2) - IntracellularPH); - //Method of Rogers/Rowland requires an estimate for association constant of zwitterions with acidic phospholipids. This value can be estimated using blood/plasma_unbound partition coefficient - bloodPlasmaUnboundRatio = (pk.GetBloodPlasmaRatio().GetValue() - (1.0 - hematocrit)) / (hematocrit * pk.GetFractionUnboundInPlasma().GetValue()); //See Hinderling1997Red: Kb/p = Ke/pu * fu * hematocrit + (1- hematocrit) - //Recycle equation part A,B,C for determination of acidic phospholipid association + // Method of Rogers/Rowland requires an estimate for association constant of zwitterions with acidic phospholipids. This value can be estimated using blood/plasma_unbound partition coefficient + bloodPlasmaUnboundRatio = (pk.GetBloodPlasmaRatio().GetValue() - (1.0 - hematocrit)) / (hematocrit * pk.GetFractionUnboundInPlasma().GetValue()); // See Hinderling1997Red: Kb/p = Ke/pu * fu * hematocrit + (1- hematocrit) + // Recycle equation part A,B,C for determination of acidic phospholipid association rbcPHEffects = 1.0 + std::pow(10.0, rbcIntracellularPH - std::min(pKA1, pKA2)) + std::pow(10.0, std::max(pKA1, pKA2) - rbcIntracellularPH); EquationPartA = (rbcPHEffects * rbcIntracellularWater) / PlasmaPHEffects; EquationPartB = (P * rbcNeutralLipids + (0.3 * P + 0.7) * rbcNeutralPhospholipids) / PlasmaPHEffects; EquationPartC = PlasmaPHEffects / (rbcAcidicPhospholipids * rbcPHEffects); AcidicPhospholipidAssociation = (bloodPlasmaUnboundRatio - EquationPartA - EquationPartB) * EquationPartC; - LLIM(AcidicPhospholipidAssociation, 0.0); //Poulin2011Predictive:Part5 notes that in corner cases this value can become negative and should be set to 0 - //Now calculate features of partition coefficient + LLIM(AcidicPhospholipidAssociation, 0.0); // Poulin2011Predictive:Part5 notes that in corner cases this value can become negative and should be set to 0 + // Now calculate features of partition coefficient EquationPartA = (IntracellularPHEffects * IntracellularFluid.GetWaterVolumeFraction().GetValue()) / PlasmaPHEffects; EquationPartB = (AcidicPhospholipidAssociation * tissue->GetAcidicPhospohlipidConcentration().GetValue(MassPerMassUnit::mg_Per_g) * std::pow(10.0, std::max(pKA1, pKA2) - IntracellularPH) + std::pow(10.0, IntracellularPH - std::min(pKA1, pKA2))) / PlasmaPHEffects; EquationPartC = (P * tissue->GetNeutralLipidsVolumeFraction().GetValue() + (0.3 * P + 0.7) * tissue->GetNeutralPhospholipidsVolumeFraction().GetValue()) / PlasmaPHEffects; break; default: - //Neutral ion + // Neutral ion IntracellularPHEffects = 1.0; PlasmaPHEffects = 1.0; EquationPartA = IntracellularPHEffects * IntracellularFluid.GetWaterVolumeFraction().GetValue() / PlasmaPHEffects; @@ -889,7 +816,7 @@ void Drugs::CalculatePartitionCoefficients() / PlasmaPHEffects; EquationPartC = ((1.0 / pk.GetFractionUnboundInPlasma().GetValue()) - 1.0 - ((P * NeutralLipidInPlasmaVolumeFraction + (0.3 * P + 0.7) * NeutralPhosphoLipidInPlasmaVolumeFraction) / PlasmaPHEffects)) * TissueToPlasmaProteinRatio; } - //Calculate the partition coefficient and set it on the substance compartment effects + // Calculate the partition coefficient and set it on the substance compartment effects PartitionCoefficient = EquationPartA + ExtracellularFluid.GetWaterVolumeFraction().GetValue() + EquationPartB + EquationPartC; PartitionCoefficient = PartitionCoefficient * pk.GetFractionUnboundInPlasma().GetValue() / pk.GetBloodPlasmaRatio().GetValue(); sub->GetPK().GetTissueKinetics(tissue->GetName()).GetPartitionCoefficient().SetValue(PartitionCoefficient); @@ -941,16 +868,16 @@ void Drugs::CalculateDrugEffects() double effect = 0.0; double antibioticEffect_Per_hr = 0.0; - //Naloxone reversal--we will need to get more generic with this code if we add other reversal agents - SESubstance* m_Naloxone = m_data.GetSubstances().GetSubstance("Naloxone"); + // Naloxone reversal--we will need to get more generic with this code if we add other reversal agents + SESubstance* m_Naloxone = m_data.GetSubstances().GetSubstance(StandardSubstances::Naloxone); double inhibitorConcentration_ug_Per_mL = 0.0; - double inhibitorConstant_ug_Per_mL = 1.0; //Can't initialize to 0 lest we divide by 0. Won't matter what it is when there is no inhibitor because this will get mulitplied by 0 anyway + double inhibitorConstant_ug_Per_mL = 1.0; // Can't initialize to 0 lest we divide by 0. Won't matter what it is when there is no inhibitor because this will get mulitplied by 0 anyway if (m_data.GetSubstances().IsActive(*m_Naloxone)) { inhibitorConstant_ug_Per_mL = m_Naloxone->GetPD().GetCentralNervousModifier().GetEC50().GetValue(MassPerVolumeUnit::ug_Per_mL); inhibitorConcentration_ug_Per_mL = m_Naloxone->GetEffectSiteConcentration(MassPerVolumeUnit::ug_Per_mL); } - //Loop over substances + // Loop over substances for (SESubstance* sub : m_data.GetSubstances().GetActiveDrugs()) { if (!sub->HasPD()) continue; @@ -960,33 +887,33 @@ void Drugs::CalculateDrugEffects() shapeParameter = pd.GetEMaxShapeParameter().GetValue(); auto modifiers = pd.GetPharmacodynamicModifiers(); - //Loop over all pharmacodynamic modifiers for substance and add them overall effect for each property - for (auto mod : modifiers) { - eMax = mod.second->GetEMax().GetValue(); - ec50_ug_Per_mL = mod.second->GetEC50(MassPerVolumeUnit::ug_Per_mL); + // Loop over all pharmacodynamic modifiers for substance and add them overall effect for each property + for (auto& [key,modifier ] : modifiers) { + eMax = modifier->GetEMax().GetValue(); + ec50_ug_Per_mL = modifier->GetEC50(MassPerVolumeUnit::ug_Per_mL); if (std::abs(eMax) < ZERO_APPROX) { - continue; //If no effect (i.e. eMax = 0), move on to next effect. Save some time and also don't run risk of dividing by 0 somewhere since non-defined EC50s are set to 0 + continue; // If no effect (i.e. eMax = 0), move on to next effect. Save some time and also don't run risk of dividing by 0 somewhere since non-defined EC50s are set to 0 } - if (sub->GetClassification() == CDM::enumSubstanceClass::Opioid) { + if (sub->GetClassification() == SESubstanceClass::Opioid) { effect = eMax * std::pow(effectSiteConcentration_ug_Per_mL, shapeParameter) / (std::pow(ec50_ug_Per_mL, shapeParameter) * (std::pow(1.0 + (inhibitorConcentration_ug_Per_mL / inhibitorConstant_ug_Per_mL), shapeParameter)) + std::pow(effectSiteConcentration_ug_Per_mL, shapeParameter)); - } else if (sub->GetName() == "Sarin") { - effect = 0.8 * (m_RbcAcetylcholinesteraseFractionInhibited); //0.8 is a tuning factor, validated by patient expected physiological response + } else if (sub->GetName() == StandardSubstances::Sarin) { + effect = 0.8 * (m_RbcAcetylcholinesteraseFractionInhibited); // 0.8 is a tuning factor, validated by patient expected physiological response } else { effect = eMax * std::pow(effectSiteConcentration_ug_Per_mL, shapeParameter) / (std::pow(effectSiteConcentration_ug_Per_mL, shapeParameter) + std::pow(ec50_ug_Per_mL, shapeParameter)); } - effects_unitless[mod.first] += effect; + effects_unitless[key] += effect; } - //Antibiotic Effects -- Do not evaluate unless the patient has inflammation casued by infection - if (m_data.GetBloodChemistry().GetInflammatoryResponse().HasInflammationSource(CDM::enumInflammationSource::Infection)) { + // Antibiotic Effects -- Do not evaluate unless the patient has inflammation casued by infection + if (m_data.GetBloodChemistry().GetInflammatoryResponse().HasInflammationSource(SEInflammationSource::Infection)) { double minimumInhibitoryConcentration_ug_Per_mL = m_data.GetActions().GetPatientActions().GetInfection()->GetMinimumInhibitoryConcentration().GetValue(MassPerVolumeUnit::ug_Per_mL); - if (sub->GetClassification() == CDM::enumSubstanceClass::Antibiotic) { + if (sub->GetClassification() == SESubstanceClass::Antibiotic) { ///\ @cite Regoes2004Pharmacodynamics // The model cited above parameterizes antibacterial activity by the maximum growth rate of the pathogen (kMax), the minimum growth rate exerted by the antibiotic (kMin < 0) // and a shape parameter. The input to the function is the ratio of free antibiotic concentration to pathogen MIC. The EC50 value for this - //curve is the ratio -kMin / kMax. This structure imposes a net growth rate of 0 when antibiotic concentration = MIC (very useful result). - //This means that we will not use the EC50 value given in antibiotic sub xml files, but it also reduces the amount of parameter guesswork we do. - //For now, the max pathogen growth rate is constant (see BloodChemistry). If that changes, we need to make sure that this function is aware. + // curve is the ratio -kMin / kMax. This structure imposes a net growth rate of 0 when antibiotic concentration = MIC (very useful result). + // This means that we will not use the EC50 value given in antibiotic sub xml files, but it also reduces the amount of parameter guesswork we do. + // For now, the max pathogen growth rate is constant (see BloodChemistry). If that changes, we need to make sure that this function is aware. double growthMax_Per_hr = 0.6; double growthMin_Per_hr = growthMax_Per_hr - pd.GetAntibacterialEffect(FrequencyUnit::Per_hr); if (growthMin_Per_hr > 0.0) { @@ -1006,13 +933,13 @@ void Drugs::CalculateDrugEffects() } } - //Translate Diastolic and Systolic Pressure to pulse pressure and mean pressure + // Translate Diastolic and Systolic Pressure to pulse pressure and mean pressure double systolicBaseline_mmHg = patient.GetSystolicArterialPressureBaseline(PressureUnit::mmHg); double diastolicBaseline_mmHg = patient.GetDiastolicArterialPressureBaseline(PressureUnit::mmHg); double deltaMeanPressure_mmHg = (2.0 * diastolicBaseline_mmHg * effects_unitless["DiastolicPressure"] + systolicBaseline_mmHg * effects_unitless["SystolicPressure"]) / 3; double deltaPulsePressure_mmHg = (systolicBaseline_mmHg * effects_unitless["SystolicPressure"] - diastolicBaseline_mmHg * effects_unitless["DiastolicPressure"]); - //Set values on the CDM System Values + // Set values on the CDM System Values GetBronchodilationLevel().SetValue(effects_unitless["Bronchodilation"]); GetCentralNervousResponse().SetValue(effects_unitless["CentralNervous"]); GetFeverChange().SetValue(-37.0 * effects_unitless["Fever"], TemperatureUnit::C); @@ -1029,48 +956,48 @@ void Drugs::CalculateDrugEffects() GetAntibioticActivity().SetValue(antibioticEffect_Per_hr); //! - //! TODO: minor patch to fix sarin pupil effects, logic is a bit wrong - //! - //! The next section of code is being saved 2022-01-19 To review reintroduction of the Sarin Gas Curve. - //! Cumulitive applications of PupilSizeResponseLevel tended to Zero in most senarios making the - //! PupilaryResponse less then useful. - - //Assume drugs affecing pupil behavior do so equally on left/right sides (this might need to be deleted, logic is all wrong) - //const SEPupillaryResponse& leftPupillaryResponse = m_data.GetNervous().GetLeftEyePupillaryResponse(); - //const SEPupillaryResponse& rightPupillaryResponse = m_data.GetNervous().GetRightEyePupillaryResponse(); - //double leftPupilReactivityResponseLevel = leftPupillaryResponse.GetReactivityModifier() * effects_unitless["PupilReactivity"]; - //double rightPupilReactivityResponseLevel = rightPupillaryResponse.GetReactivityModifier() * effects_unitless["PupilReactivity"]; - //double leftPupilSizeResponseLevel = leftPupillaryResponse.GetSizeModifier() * effects_unitless["PupilSize"]; - //double rightPupilSizeResponseLevel = rightPupillaryResponse.GetSizeModifier() * effects_unitless["PupilSize"]; - - //We need to handle Sarin pupil effects (if Sarin is active) separately because technically they stem from contact and not systemic levels, meaning that they - //do not depend on the Sarin plasma concentration in the same way as other PD effects. We still perform the calculation here because - //we cannot "contact" the eye, but scale them differently. Sarin pupil effects are large and fast, so it's reasonable to - //overwrite other drug pupil effects (and we probably aren't modeling opioid addicts inhaling Sarin) - // - //if (m_data.GetSubstances().IsActive(*m_data.GetSubstances().GetSubstance("Sarin"))) { - // leftPupilSizeResponseLevel = GeneralMath::LogisticFunction(-1, 0.0475, 250, m_data.GetSubstances().GetSubstance("Sarin")->GetPlasmaConcentration(MassPerVolumeUnit::ug_Per_L)); - // rightPupilSizeResponseLevel = leftPupilSizeResponseLevel; - //} + //! TODO: minor patch to fix sarin pupil effects, logic is a bit wrong + //! + //! The next section of code is being saved 2022-01-19 To review reintroduction of the Sarin Gas Curve. + //! Cumulitive applications of PupilSizeResponseLevel tended to Zero in most senarios making the + //! PupilaryResponse less then useful. + + // Assume drugs affecing pupil behavior do so equally on left/right sides (this might need to be deleted, logic is all wrong) + // const SEPupillaryResponse& leftPupillaryResponse = m_data.GetNervous().GetLeftEyePupillaryResponse(); + // const SEPupillaryResponse& rightPupillaryResponse = m_data.GetNervous().GetRightEyePupillaryResponse(); + // double leftPupilReactivityResponseLevel = leftPupillaryResponse.GetReactivityModifier() * effects_unitless["PupilReactivity"]; + // double rightPupilReactivityResponseLevel = rightPupillaryResponse.GetReactivityModifier() * effects_unitless["PupilReactivity"]; + // double leftPupilSizeResponseLevel = leftPupillaryResponse.GetSizeModifier() * effects_unitless["PupilSize"]; + // double rightPupilSizeResponseLevel = rightPupillaryResponse.GetSizeModifier() * effects_unitless["PupilSize"]; + + // We need to handle Sarin pupil effects (if Sarin is active) separately because technically they stem from contact and not systemic levels, meaning that they + // do not depend on the Sarin plasma concentration in the same way as other PD effects. We still perform the calculation here because + // we cannot "contact" the eye, but scale them differently. Sarin pupil effects are large and fast, so it's reasonable to + // overwrite other drug pupil effects (and we probably aren't modeling opioid addicts inhaling Sarin) + // + // if (m_data.GetSubstances().IsActive(*m_data.GetSubstances().GetSubstance(StandardSubstances::Sarin))) { + // leftPupilSizeResponseLevel = GeneralMath::LogisticFunction(-1, 0.0475, 250, m_data.GetSubstances().GetSubstance(StandardSubstances::Sarin)->GetPlasmaConcentration(MassPerVolumeUnit::ug_Per_L)); + // rightPupilSizeResponseLevel = leftPupilSizeResponseLevel; + // } ////Bound pupil modifiers - //BLIM(leftPupilReactivityResponseLevel, -1, 1); - //BLIM(rightPupilReactivityResponseLevel, -1, 1); - //BLIM(leftPupilSizeResponseLevel, -1, 1); - //BLIM(rightPupilSizeResponseLevel, -1, 1); + // BLIM(leftPupilReactivityResponseLevel, -1, 1); + // BLIM(rightPupilReactivityResponseLevel, -1, 1); + // BLIM(leftPupilSizeResponseLevel, -1, 1); + // BLIM(rightPupilSizeResponseLevel, -1, 1); m_data.GetNervous().GetLeftEyePupillaryResponse().GetReactivityModifier().SetValue(effects_unitless["PupilReactivity"]); m_data.GetNervous().GetRightEyePupillaryResponse().GetReactivityModifier().SetValue(effects_unitless["PupilReactivity"]); m_data.GetNervous().GetLeftEyePupillaryResponse().GetSizeModifier().SetValue(effects_unitless["PupilSize"]); m_data.GetNervous().GetRightEyePupillaryResponse().GetSizeModifier().SetValue(effects_unitless["PupilSize"]); - //m_data.GetNervous().GetLeftEyePupillaryResponse().GetReactivityModifier().SetValue(leftPupilReactivityResponseLevel); - //m_data.GetNervous().GetLeftEyePupillaryResponse().GetSizeModifier().SetValue(leftPupilSizeResponseLevel); - //m_data.GetNervous().GetRightEyePupillaryResponse().GetReactivityModifier().SetValue(rightPupilReactivityResponseLevel); - //m_data.GetNervous().GetRightEyePupillaryResponse().GetSizeModifier().SetValue(rightPupilSizeResponseLevel); + // m_data.GetNervous().GetLeftEyePupillaryResponse().GetReactivityModifier().SetValue(leftPupilReactivityResponseLevel); + // m_data.GetNervous().GetLeftEyePupillaryResponse().GetSizeModifier().SetValue(leftPupilSizeResponseLevel); + // m_data.GetNervous().GetRightEyePupillaryResponse().GetReactivityModifier().SetValue(rightPupilReactivityResponseLevel); + // m_data.GetNervous().GetRightEyePupillaryResponse().GetSizeModifier().SetValue(rightPupilSizeResponseLevel); - //Account for cardiovascular override actions + // Account for cardiovascular override actions if (m_data.GetActions().GetPatientActions().HasOverride() - && m_data.GetActions().GetPatientActions().GetOverride()->GetOverrideConformance() == CDM::enumOnOff::Off) { + && m_data.GetActions().GetPatientActions().GetOverride()->GetOverrideConformance() == SEOnOff::Off) { if (m_data.GetActions().GetPatientActions().GetOverride()->HasMAPOverride()) { GetMeanBloodPressureChange().SetValue(0.0, PressureUnit::mmHg); } @@ -1101,7 +1028,7 @@ void Drugs::CalculatePlasmaSubstanceConcentration() for (SESubstance* sub : m_data.GetSubstances().GetActiveDrugs()) { //--Assume that vena cava concentration is representative blood average (this is what we do in BloodChemistry) - - double bloodPlasmaRatio = 1.0; //Assume equal distribution for subs without a defined BP ratio + double bloodPlasmaRatio = 1.0; // Assume equal distribution for subs without a defined BP ratio double massInBlood_ug = 0.0; if (sub->GetPK().GetPhysicochemicals().HasBloodPlasmaRatio()) { bloodPlasmaRatio = sub->GetPK().GetPhysicochemicals().GetBloodPlasmaRatio().GetValue(); @@ -1109,17 +1036,17 @@ void Drugs::CalculatePlasmaSubstanceConcentration() if (sub->HasMassInBlood()) { massInBlood_ug = sub->GetMassInBlood(MassUnit::ug); } - //Set blood concentration for substances with PK + // Set blood concentration for substances with PK sub->GetBloodConcentration().SetValue(massInBlood_ug / bloodVolume_mL, MassPerVolumeUnit::ug_Per_mL); - //Set plasma concentration assuming K_bp = Cb/Cp ---> Cp = Cb/K_bp + // Set plasma concentration assuming K_bp = Cb/Cp ---> Cp = Cb/K_bp double plasmaConcentration_ug_Per_mL = massInBlood_ug / bloodVolume_mL / bloodPlasmaRatio; sub->GetPlasmaConcentration().SetValue(plasmaConcentration_ug_Per_mL, MassPerVolumeUnit::ug_Per_mL); - //Increment area under curve--should be done for subs w/ PK + // Increment area under curve--should be done for subs w/ PK double deltaT_s = m_data.GetTimeStep().GetValue(TimeUnit::s); sub->GetAreaUnderCurve().IncrementValue(plasmaConcentration_ug_Per_mL * deltaT_s, TimeMassPerVolumeUnit::s_ug_Per_mL); - //Get substance PD Data if it exists, including rate constant describing transfer to effect compartment and previous effect site concentration + // Get substance PD Data if it exists, including rate constant describing transfer to effect compartment and previous effect site concentration if (sub->HasPD()) { SESubstancePharmacodynamics& pd = sub->GetPD(); rate_Per_s = pd.GetEffectSiteRateConstant(FrequencyUnit::Per_s); @@ -1130,18 +1057,18 @@ void Drugs::CalculatePlasmaSubstanceConcentration() effectConcentration = sub->GetEffectSiteConcentration(MassPerVolumeUnit::ug_Per_mL); - //If a substance has rate constant set to 0, no effect concentration is needed. Just use plasma concentration as before + // If a substance has rate constant set to 0, no effect concentration is needed. Just use plasma concentration as before if (rate_Per_s == 0) { effectConcentration = sub->GetPlasmaConcentration(MassPerVolumeUnit::ug_Per_mL); } else { - //For drugs with effect site rate constant, use first order difference equation to calculate transfer at next time step + // For drugs with effect site rate constant, use first order difference equation to calculate transfer at next time step effectConcentration += (pd.GetEffectSiteRateConstant(FrequencyUnit::Per_s)) * m_dt_s * (sub->GetPlasmaConcentration(MassPerVolumeUnit::ug_Per_mL) - effectConcentration); } - //Store effect site concentration for use in CalculateDrugEffects function + // Store effect site concentration for use in CalculateDrugEffects function sub->GetEffectSiteConcentration().SetValue(effectConcentration, MassPerVolumeUnit::ug_Per_mL); } - if (sub->GetName() == "Sarin" && (m_data.GetSubstances().IsActive(*m_Sarin))) + if (sub->GetName() == StandardSubstances::Sarin && (m_data.GetSubstances().IsActive(*m_Sarin))) SarinKinetics(); } } @@ -1172,30 +1099,30 @@ void Drugs::CalculateSubstanceClearance() continue; SESubstanceClearance& clearance = sub->GetClearance(); - //Renal Volume Cleared - Clearance happens through the renal system + // Renal Volume Cleared - Clearance happens through the renal system RenalVolumeCleared_mL = (clearance.GetRenalClearance().GetValue(VolumePerTimeMassUnit::mL_Per_s_kg) * PatientWeight_kg * m_dt_s); - //Intrinsic Clearance + // Intrinsic Clearance IntrinsicClearance_mLPersPerkg = clearance.GetIntrinsicClearance().GetValue(VolumePerTimeMassUnit::mL_Per_s_kg); FractionUnboundInPlasma = clearance.GetFractionUnboundInPlasma().GetValue(); - //Hepatic Clearance + // Hepatic Clearance double LiverVascularFlow_mL_Per_s = m_liverVascular->GetInFlow().GetValue(VolumePerTimeUnit::mL_Per_s); HepaticClearance_mLPers = (LiverVascularFlow_mL_Per_s * FractionUnboundInPlasma * IntrinsicClearance_mLPersPerkg * PatientWeight_kg) / (LiverVascularFlow_mL_Per_s + (FractionUnboundInPlasma * IntrinsicClearance_mLPersPerkg * PatientWeight_kg)); HepaticVolumeCleared_mL = HepaticClearance_mLPers * m_dt_s; - //Systemic Clearance + // Systemic Clearance TotalVolumeCleared_mL = clearance.GetSystemicClearance().GetValue(VolumePerTimeMassUnit::mL_Per_s_kg) * PatientWeight_kg * m_dt_s; OtherSystemicVolumeCleared_mL = TotalVolumeCleared_mL - RenalVolumeCleared_mL - HepaticVolumeCleared_mL; // The following makes it so that you cannot have more than the total systemic clearance for the substance. LLIM(OtherSystemicVolumeCleared_mL, 0.); - //Hepatic Clearance + // Hepatic Clearance m_data.GetSubstances().CalculateGenericClearance(HepaticVolumeCleared_mL, *m_liverTissue, *sub); - //Systemic Clearance + // Systemic Clearance m_data.GetSubstances().CalculateGenericClearance(OtherSystemicVolumeCleared_mL, *m_venaCavaVascular, *sub); - //Hepatic Excretion + // Hepatic Excretion m_data.GetSubstances().CalculateGenericExcretion(LiverVascularFlow_mL_Per_s, *m_liverTissue, *sub, clearance.GetFractionExcretedInFeces().GetValue(), m_dt_s); } } @@ -1212,27 +1139,27 @@ void Drugs::CalculateSubstanceClearance() //-------------------------------------------------------------------------------------------------- void Drugs::SarinKinetics() { - //Get Sarin and Pralidoxime (if active) concentrations and convert units to nM (units that all the rate equations are in) + // Get Sarin and Pralidoxime (if active) concentrations and convert units to nM (units that all the rate equations are in) double SarinConcentration_g_Per_L = m_Sarin->GetPlasmaConcentration(MassPerVolumeUnit::g_Per_L); double SarinMolarMass_g_Per_umol = m_Sarin->GetMolarMass(MassPerAmountUnit::g_Per_umol); double SarinConcentration_nM = SarinConcentration_g_Per_L / SarinMolarMass_g_Per_umol * 1000; double PralidoximeConcentration_nM = 0.0; double PralidoximeMolarMass_g_Per_umol = m_Pralidoxime->GetMolarMass(MassPerAmountUnit::g_Per_umol); double PralidoximeConcentration_g_Per_L = 0.0; - if ((m_data.GetSubstances().IsActive(*m_Pralidoxime)) && (m_Pralidoxime->HasPlasmaConcentration())) //Substance can get flagged active w/ null plasma concentration so need to check both for stabilization step + if ((m_data.GetSubstances().IsActive(*m_Pralidoxime)) && (m_Pralidoxime->HasPlasmaConcentration())) // Substance can get flagged active w/ null plasma concentration so need to check both for stabilization step { PralidoximeConcentration_g_Per_L = m_Pralidoxime->GetPlasmaConcentration(MassPerVolumeUnit::g_Per_L); PralidoximeConcentration_nM = PralidoximeConcentration_g_Per_L / PralidoximeMolarMass_g_Per_umol * 1000; } - //Get RBC-AChE concentration and create copies of all concentrations so that they are not overwritten in the rate equations + // Get RBC-AChE concentration and create copies of all concentrations so that they are not overwritten in the rate equations double RbcAcetylcholinesterase_nM = m_data.GetBloodChemistry().GetRedBloodCellAcetylcholinesterase(AmountPerVolumeUnit::mol_Per_L) * 1e9; double RbcAche_nM = RbcAcetylcholinesterase_nM; double SarinRbcAche_nM = m_SarinRbcAcetylcholinesteraseComplex_nM; double AgedSarin_nM = m_AgedRbcAcetylcholinesterase_nM; const double BaselineRbcAcetylcholinesterase_nM = 8.0; - //Rate constants + // Rate constants const double RateRbcAcheInhibition_per_nM_s = 4.50e-4; /// \cite gupta2009handbook \cite rodriguez2015model const double RateRbcAcheAging_per_s = 4.83e-5; /// \cite gupta2009handbook \cite rodriguez2015model const double RateRbcAcheSynthesis_nM_per_s = 8 * (9.33e-5); /// \cite grob1958effects @@ -1240,10 +1167,10 @@ void Drugs::SarinKinetics() const double RatePralidoximeReversal_per_s = 0.7 * (4.22e-3); /// \cite rodriguez2015model const double PralidoximeDissociationConstant_nM = 27630.0; /// \cite rodriguez2015model - //Michaelis-Menten expression for rate of pralidoxime interaction with bound sarin/rbc-ache complex + // Michaelis-Menten expression for rate of pralidoxime interaction with bound sarin/rbc-ache complex double PralidoximeReversal = RatePralidoximeReversal_per_s * m_SarinRbcAcetylcholinesteraseComplex_nM * PralidoximeConcentration_nM / (PralidoximeDissociationConstant_nM + PralidoximeConcentration_nM); ///\cite rodriguez2015model - //Kinetic model equations adapted from + // Kinetic model equations adapted from ///\cite rodriguez2015model and \cite gupta2009handbook RbcAche_nM += m_dt_s * (-RateRbcAcheInhibition_per_nM_s * SarinConcentration_nM * RbcAcetylcholinesterase_nM - RateRbcAcheDegredation_per_s * RbcAcetylcholinesterase_nM + RateRbcAcheSynthesis_nM_per_s + PralidoximeReversal); SarinRbcAche_nM += m_dt_s * (RateRbcAcheInhibition_per_nM_s * SarinConcentration_nM * RbcAcetylcholinesterase_nM - RateRbcAcheAging_per_s * m_SarinRbcAcetylcholinesteraseComplex_nM - PralidoximeReversal); @@ -1252,7 +1179,7 @@ void Drugs::SarinKinetics() PralidoximeConcentration_nM = -PralidoximeReversal; m_RbcAcetylcholinesteraseFractionInhibited = 1 - RbcAche_nM / BaselineRbcAcetylcholinesterase_nM; - //Update values for next time step + // Update values for next time step m_Sarin->GetPlasmaConcentration().SetValue(SarinConcentration_nM / 1000.0 * SarinMolarMass_g_Per_umol, MassPerVolumeUnit::g_Per_L); m_data.GetBloodChemistry().GetRedBloodCellAcetylcholinesterase().SetValue(RbcAche_nM * 1e-9, AmountPerVolumeUnit::mol_Per_L); m_SarinRbcAcetylcholinesteraseComplex_nM = SarinRbcAche_nM; @@ -1280,28 +1207,28 @@ void Drugs::SarinKinetics() //-------------------------------------------------------------------------------------------------- double Drugs::OralTransmucosalModel(const SESubstance* sub, SETransmucosalState* ot) { - //Concentrations from last time step--set to 0 and then check if they exist because on the first time step after admin so we don't pull a null pointer + // Concentrations from last time step--set to 0 and then check if they exist because on the first time step after admin so we don't pull a null pointer double plasmaConcentration_ug_Per_mL = 0.0; if (sub->HasPlasmaConcentration()) { plasmaConcentration_ug_Per_mL = sub->GetPlasmaConcentration(MassPerVolumeUnit::ug_Per_mL); } - //Physiochemical constants + // Physiochemical constants const double subLogP = sub->GetPK()->GetPhysicochemicals()->GetLogP(); const double fracUnbound_plasma = sub->GetPK()->GetPhysicochemicals()->GetFractionUnboundInPlasma(); const double subPka = sub->GetPK()->GetPhysicochemicals()->GetPrimaryPKA(); const double subBloodPlasmaRatio = sub->GetPK()->GetPhysicochemicals()->GetBloodPlasmaRatio(); const double molarMass_g_Per_mol = sub->GetMolarMass(MassPerAmountUnit::g_Per_mol); - //Defining mass transfer rates to stomach here so that we can accout for both routes if need be - double rateSwallowedDrugToStomach_ug_Per_s = 0.0; //Transmucosal route - double rateDrugDissolutionInStomach_ug_Per_s = 0.0; //Gastrointestinal route - //Characteristic mouth parameters - const double salivaThickness_cm = 30.0e-4; //Tuned to get dissolution of OTFC in right time frame + // Defining mass transfer rates to stomach here so that we can accout for both routes if need be + double rateSwallowedDrugToStomach_ug_Per_s = 0.0; // Transmucosal route + double rateDrugDissolutionInStomach_ug_Per_s = 0.0; // Gastrointestinal route + // Characteristic mouth parameters + const double salivaThickness_cm = 30.0e-4; // Tuned to get dissolution of OTFC in right time frame const double buccalSA_cm2 = 60.0; const double buccalThickness_cm = 450.0e-4; //@cite Xia2015Development const double buccalH_cm = buccalThickness_cm / 6.0; - const double buccalLaminaThickness_cm = buccalH_cm; //This ensures that our mesh points are equally spaced + const double buccalLaminaThickness_cm = buccalH_cm; // This ensures that our mesh points are equally spaced const double volumeSaliva_mL = 1.0; //@cite Xia2015Development - const double volumeBuccalSlice_mL = buccalH_cm * buccalSA_cm2; //volume of the Nth epithelial layer + const double volumeBuccalSlice_mL = buccalH_cm * buccalSA_cm2; // volume of the Nth epithelial layer const double volumeBuccalLamina_mL = buccalLaminaThickness_cm * buccalSA_cm2; const double bloodSupplyBuccal_mL_Per_s = 2.4 / 60.0 * buccalSA_cm2; // @cite Sattar2014, buccal blood supply = 2.4 mL/min/cm2 const double tongueSA_cm2 = 25.0; //@cite Xia2015Development @@ -1312,13 +1239,13 @@ double Drugs::OralTransmucosalModel(const SESubstance* sub, SETransmucosalState* const double volumeTongueLamina_mL = tongueLaminaThickness_cm * tongueSA_cm2; const double bloodSupplyTongue_mL_Per_s = 1.0 / 60.0 * tongueSA_cm2; - //Assumed substance particle paramters (for Noyes-Whitney equation) + // Assumed substance particle paramters (for Noyes-Whitney equation) const double rho_g_Per_mL = 1.2; const double sol_ug_Per_mL = 200.0; const double radius_cm = 5.0e-4; - //Derived physiochemical data - const double Kp_SalivaToEpithelium = 2.12 * std::exp(0.523 * subLogP); //Relationship from Xia2015Development + // Derived physiochemical data + const double Kp_SalivaToEpithelium = 2.12 * std::exp(0.523 * subLogP); // Relationship from Xia2015Development const double fracUnbound_tis = 1.0 / Kp_SalivaToEpithelium; double Diff_Mucosa_cm2_Per_s; if (subLogP < 3.0) { @@ -1327,32 +1254,32 @@ double Drugs::OralTransmucosalModel(const SESubstance* sub, SETransmucosalState* } else { Diff_Mucosa_cm2_Per_s = std::pow(10.0, -5.9514); } - const double Diff_Saliva_cm2_Per_s = 8.0e-6; //Tuned to fentanyl response - //Rate constants - const double kSwallow_mL_Per_s = 0.55 / 60; //Tuned so that 75% of fentanyl dose is swallowed, value is consistent with rate of saliva production between 0.36 and 0.5 mL/min (@cite Xia2015Development @cite Sattar2014) - const double kDis_mL_Per_s_g = 3.0 * Diff_Saliva_cm2_Per_s / (rho_g_Per_mL * radius_cm * salivaThickness_cm); //Noyes-Whitney equation + const double Diff_Saliva_cm2_Per_s = 8.0e-6; // Tuned to fentanyl response + // Rate constants + const double kSwallow_mL_Per_s = 0.55 / 60; // Tuned so that 75% of fentanyl dose is swallowed, value is consistent with rate of saliva production between 0.36 and 0.5 mL/min (@cite Xia2015Development @cite Sattar2014) + const double kDis_mL_Per_s_g = 3.0 * Diff_Saliva_cm2_Per_s / (rho_g_Per_mL * radius_cm * salivaThickness_cm); // Noyes-Whitney equation const double dT_s = m_data.GetTimeStep().GetValue(TimeUnit::s); - //Values from last time step + // Values from last time step double mouthMass_ug = ot->GetMouthSolidMass().GetValue(MassUnit::ug); if (mouthMass_ug < ZERO_APPROX) { - mouthMass_ug = 0.0; //Make sure we don't take too big of a step near 0 and pull a negative mass + mouthMass_ug = 0.0; // Make sure we don't take too big of a step near 0 and pull a negative mass } double salivaConcentration_ug_Per_mL = ot->GetSalivaConcentration().GetValue(MassPerVolumeUnit::ug_Per_mL); std::vector buccalCon = ot->GetBuccalConcentrations(MassPerVolumeUnit::ug_Per_mL); std::vector sublingualCon = ot->GetSublingualConcentrations(MassPerVolumeUnit::ug_Per_mL); - //Figure out total mass of drug in mouth--will use this check if it safe to remove substance admin action + // Figure out total mass of drug in mouth--will use this check if it safe to remove substance admin action double totalTransmucosalMass_ug = mouthMass_ug + salivaConcentration_ug_Per_mL * volumeSaliva_mL; - totalTransmucosalMass_ug += volumeTongueSlice_mL * std::accumulate(sublingualCon.begin(), sublingualCon.end(), 0.0); //can pull volume out and add concentrations because volumes for all sublingual slices are equal - totalTransmucosalMass_ug += volumeBuccalSlice_mL * std::accumulate(buccalCon.begin(), buccalCon.end(), 0.0); //can pull volume out and add concentrations because volumes for all buccal slices are equal - //Differential containers--could update this to Eigen implementation + totalTransmucosalMass_ug += volumeTongueSlice_mL * std::accumulate(sublingualCon.begin(), sublingualCon.end(), 0.0); // can pull volume out and add concentrations because volumes for all sublingual slices are equal + totalTransmucosalMass_ug += volumeBuccalSlice_mL * std::accumulate(buccalCon.begin(), buccalCon.end(), 0.0); // can pull volume out and add concentrations because volumes for all buccal slices are equal + // Differential containers--could update this to Eigen implementation std::vector dBuccalMass(buccalCon.size()); std::vector dSublingualMass(sublingualCon.size()); - //Intermediate expressions -- makes typing out equations easier + // Intermediate expressions -- makes typing out equations easier double rateMassDissolutionInMouth_ug_Per_s = (kDis_mL_Per_s_g / 1.0e6) * mouthMass_ug * (sol_ug_Per_mL - salivaConcentration_ug_Per_mL); rateSwallowedDrugToStomach_ug_Per_s = kSwallow_mL_Per_s * salivaConcentration_ug_Per_mL; double scaleBuccal_Per_s = Diff_Mucosa_cm2_Per_s / (buccalH_cm * buccalH_cm); double scaleTongue_Per_s = Diff_Mucosa_cm2_Per_s / (tongueH_cm * tongueH_cm); - //Figure out how to distribute mass in saliva and unbound in upper layers in buccal and sublingual + // Figure out how to distribute mass in saliva and unbound in upper layers in buccal and sublingual double totalMassSalivaInterface = salivaConcentration_ug_Per_mL * volumeSaliva_mL + fracUnbound_tis * buccalCon[0] * volumeBuccalSlice_mL + fracUnbound_tis * sublingualCon[0] * volumeTongueSlice_mL; double volumeSum_mL = volumeSaliva_mL + volumeBuccalSlice_mL + volumeTongueSlice_mL; double salivaMassNext = totalMassSalivaInterface * (volumeSaliva_mL / volumeSum_mL); @@ -1361,17 +1288,17 @@ double Drugs::OralTransmucosalModel(const SESubstance* sub, SETransmucosalState* double deltaMassSaliva = salivaConcentration_ug_Per_mL * volumeSaliva_mL - salivaMassNext; double deltaMassBuccal = fracUnbound_tis * buccalCon[0] * volumeBuccalSlice_mL - buccalMassNext; double deltaMassTongue = fracUnbound_tis * sublingualCon[0] * volumeTongueSlice_mL - tongueMassNext; - //Differential Expressions + // Differential Expressions double dm_MassMouth = -rateMassDissolutionInMouth_ug_Per_s; double dmSaliva = rateMassDissolutionInMouth_ug_Per_s - rateSwallowedDrugToStomach_ug_Per_s; - //Buccal epithelial layer + // Buccal epithelial layer dBuccalMass[0] = -scaleBuccal_Per_s * fracUnbound_tis * (buccalCon[0] - buccalCon[1]) * volumeBuccalSlice_mL; dBuccalMass[1] = scaleBuccal_Per_s * fracUnbound_tis * (buccalCon[0] - 2 * buccalCon[1] + buccalCon[2]) * volumeBuccalSlice_mL; dBuccalMass[2] = scaleBuccal_Per_s * fracUnbound_tis * (buccalCon[1] - 2 * buccalCon[2] + buccalCon[3]) * volumeBuccalSlice_mL; dBuccalMass[3] = scaleBuccal_Per_s * fracUnbound_tis * (buccalCon[2] - 2 * buccalCon[3] + buccalCon[4]) * volumeBuccalSlice_mL; dBuccalMass[4] = scaleBuccal_Per_s * fracUnbound_tis * (buccalCon[3] - 2 * buccalCon[4] + buccalCon[5]) * volumeBuccalSlice_mL; dBuccalMass[5] = scaleBuccal_Per_s * fracUnbound_tis * (buccalCon[4] - 2 * buccalCon[5] + buccalCon[6]) * volumeBuccalSlice_mL; - //Buccal Lamina propria layer + // Buccal Lamina propria layer dBuccalMass[6] = scaleBuccal_Per_s * fracUnbound_tis * (buccalCon[5] - buccalCon[6]) * volumeBuccalLamina_mL - bloodSupplyBuccal_mL_Per_s * subBloodPlasmaRatio * (fracUnbound_tis * buccalCon[6] / fracUnbound_plasma - plasmaConcentration_ug_Per_mL); ////Sublingual epithelial layer dSublingualMass[0] = -scaleTongue_Per_s * fracUnbound_tis * (sublingualCon[0] - sublingualCon[1]) * volumeTongueSlice_mL; @@ -1380,12 +1307,12 @@ double Drugs::OralTransmucosalModel(const SESubstance* sub, SETransmucosalState* dSublingualMass[3] = scaleTongue_Per_s * fracUnbound_tis * (sublingualCon[2] - 2 * sublingualCon[3] + sublingualCon[4]) * volumeTongueSlice_mL; dSublingualMass[4] = scaleTongue_Per_s * fracUnbound_tis * (sublingualCon[3] - 2 * sublingualCon[4] + sublingualCon[5]) * volumeTongueSlice_mL; dSublingualMass[5] = scaleTongue_Per_s * fracUnbound_tis * (sublingualCon[4] - 2 * sublingualCon[5] + sublingualCon[6]) * volumeTongueSlice_mL; - //Sublingual Lamina propria layer + // Sublingual Lamina propria layer dSublingualMass[6] = scaleTongue_Per_s * fracUnbound_tis * (sublingualCon[5] - sublingualCon[6]) * volumeTongueLamina_mL - bloodSupplyTongue_mL_Per_s * subBloodPlasmaRatio * (fracUnbound_tis * sublingualCon[6] / fracUnbound_plasma - plasmaConcentration_ug_Per_mL); - //Put substance in circulation + // Put substance in circulation double massIntoVasculature = bloodSupplyBuccal_mL_Per_s * subBloodPlasmaRatio * (fracUnbound_tis * buccalCon[6] / fracUnbound_plasma - plasmaConcentration_ug_Per_mL) + bloodSupplyTongue_mL_Per_s * subBloodPlasmaRatio * (fracUnbound_tis * sublingualCon[6] / fracUnbound_plasma - plasmaConcentration_ug_Per_mL); m_venaCavaVascular->GetSubstanceQuantity(*sub)->GetMass().IncrementValue(massIntoVasculature * dT_s, MassUnit::ug); - //Update states + // Update states ot->GetMouthSolidMass().IncrementValue(dm_MassMouth * dT_s, MassUnit::ug); ot->GetSalivaConcentration().IncrementValue((1.0 / volumeSaliva_mL) * (dmSaliva * dT_s - deltaMassSaliva), MassPerVolumeUnit::ug_Per_mL); buccalCon[0] += (1.0 / volumeBuccalSlice_mL) * (dBuccalMass[0] * dT_s - deltaMassBuccal); @@ -1399,10 +1326,10 @@ double Drugs::OralTransmucosalModel(const SESubstance* sub, SETransmucosalState* ot->SetBuccalConcentrations(buccalCon, MassPerVolumeUnit::ug_Per_mL); ot->SetSublingualConcentrations(sublingualCon, MassPerVolumeUnit::ug_Per_mL); - //Put swallowed drug in GI transit model as dissolved drug in stomach + // Put swallowed drug in GI transit model as dissolved drug in stomach m_data.GetGastrointestinal().GetDrugTransitState(sub)->IncrementStomachDissolvedMass(rateSwallowedDrugToStomach_ug_Per_s * dT_s, MassUnit::ug); - //Return the amount of mass remaining in the transmucosal layers and mouth + // Return the amount of mass remaining in the transmucosal layers and mouth return totalTransmucosalMass_ug; } }; diff --git a/projects/biogears/libBiogears/src/engine/Systems/Endocrine.cpp b/projects/biogears/libBiogears/src/engine/Systems/Endocrine.cpp index d9595eab9..cd175d3a5 100644 --- a/projects/biogears/libBiogears/src/engine/Systems/Endocrine.cpp +++ b/projects/biogears/libBiogears/src/engine/Systems/Endocrine.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Physiology.h" + #include #include #include @@ -30,7 +32,7 @@ specific language governing permissions and limitations under the License. #include #include -namespace BGE = mil::tatrc::physiology::biogears; + namespace biogears { auto Endocrine::make_unique(BioGears& bg) -> std::unique_ptr @@ -42,17 +44,17 @@ Endocrine::Endocrine(BioGears& bg) : SEEndocrineSystem(bg.GetLogger()) , m_data(bg) { - Clear(); + Invalidate(); } Endocrine::~Endocrine() { - Clear(); + Invalidate(); } -void Endocrine::Clear() +void Endocrine::Invalidate() { - SEEndocrineSystem::Clear(); + SEEndocrineSystem::Invalidate(); m_AortaGlucose = nullptr; m_AortaEpinephrine = nullptr; m_SplanchnicInsulin = nullptr; @@ -67,24 +69,6 @@ void Endocrine::Initialize() BioGearsSystem::Initialize(); } -bool Endocrine::Load(const CDM::BioGearsEndocrineSystemData& in) -{ - if (!SEEndocrineSystem::Load(in)) - return false; - BioGearsSystem::LoadState(); - return true; -} -CDM::BioGearsEndocrineSystemData* Endocrine::Unload() const -{ - CDM::BioGearsEndocrineSystemData* data = new CDM::BioGearsEndocrineSystemData(); - Unload(*data); - return data; -} -void Endocrine::Unload(CDM::BioGearsEndocrineSystemData& data) const -{ - SEEndocrineSystem::Unload(data); -} - void Endocrine::SetUp() { m_dt_s = m_data.GetTimeStep().GetValue(TimeUnit::s); @@ -387,15 +371,15 @@ void Endocrine::OverrideControlLoop() currentGlucagonSynthesisOverride = override->GetGlucagonSynthesisRateOverride(AmountPerTimeUnit::pmol_Per_min); } - if ((currentInsulinSynthesisOverride < minInsulinSynthesisOverride || currentInsulinSynthesisOverride > maxInsulinSynthesisOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentInsulinSynthesisOverride < minInsulinSynthesisOverride || currentInsulinSynthesisOverride > maxInsulinSynthesisOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Insulin Synthesis Rate Override (Endocrine) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentGlucagonSynthesisOverride < minGlucagonSynthesisOverride || currentGlucagonSynthesisOverride > maxGlucagonSynthesisOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentGlucagonSynthesisOverride < minGlucagonSynthesisOverride || currentGlucagonSynthesisOverride > maxGlucagonSynthesisOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Glucagon Synthesis Rate Override (Endocrine) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } return; } diff --git a/projects/biogears/libBiogears/src/engine/Systems/Energy.cpp b/projects/biogears/libBiogears/src/engine/Systems/Energy.cpp index e992e4843..36a7dbb75 100644 --- a/projects/biogears/libBiogears/src/engine/Systems/Energy.cpp +++ b/projects/biogears/libBiogears/src/engine/Systems/Energy.cpp @@ -11,9 +11,13 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Physiology.h" +#include "io/cdm/Property.h" + #include #include #include +#include #include #include #include @@ -49,7 +53,6 @@ specific language governing permissions and limitations under the License. #include #include -namespace BGE = mil::tatrc::physiology::biogears; namespace biogears { auto Energy::make_unique(BioGears& bg) -> std::unique_ptr @@ -62,17 +65,17 @@ Energy::Energy(BioGears& bg) , m_data(bg) , m_circuitCalculator(GetLogger()) { - Clear(); + Invalidate(); } Energy::~Energy() { - Clear(); + Invalidate(); } -void Energy::Clear() +void Energy::Invalidate() { - SEEnergySystem::Clear(); + SEEnergySystem::Invalidate(); m_Patient = nullptr; m_PatientActions = nullptr; m_AortaHCO3 = nullptr; @@ -102,7 +105,7 @@ void Energy::Initialize() BioGearsSystem::Initialize(); GetTotalMetabolicRate().Set(m_Patient->GetBasalMetabolicRate()); - //Initialization of other system variables + // Initialization of other system variables /// \cite herman2008physics GetCoreTemperature().SetValue(37.0, TemperatureUnit::C); GetSkinTemperatureTorso().SetValue(34.4, TemperatureUnit::C); @@ -127,43 +130,14 @@ void Energy::Initialize() GetPotassiumLostToSweat().SetValue(0.0, MassUnit::mg); GetSodiumLostToSweat().SetValue(0.0, MassUnit::mg); - //Running average quantities used to trigger events - m_BloodpH.Sample(7.4); //Initialize - m_BicarbonateMolarity_mmol_Per_L.Sample(24.0); //Initialize + // Running average quantities used to trigger events + m_BloodpH.Sample(7.4); // Initialize + m_BicarbonateMolarity_mmol_Per_L.Sample(24.0); // Initialize m_previousWeightPack_kg = 0.0; m_packOn = false; } -bool Energy::Load(const CDM::BioGearsEnergySystemData& in) -{ - if (!SEEnergySystem::Load(in)) { - return false; - } - - m_BloodpH.Load(in.BloodpH()); - m_BicarbonateMolarity_mmol_Per_L.Load(in.BicarbonateMolarity_mmol_Per_L()); - m_packOn = in.PackOn(); - m_previousWeightPack_kg = in.PreviousWeightPack_kg(); - BioGearsSystem::LoadState(); - return true; -} -CDM::BioGearsEnergySystemData* Energy::Unload() const -{ - CDM::BioGearsEnergySystemData* data = new CDM::BioGearsEnergySystemData(); - Unload(*data); - return data; -} -void Energy::Unload(CDM::BioGearsEnergySystemData& data) const -{ - SEEnergySystem::Unload(data); - - data.BloodpH(std::unique_ptr(m_BloodpH.Unload())); - data.BicarbonateMolarity_mmol_Per_L(std::unique_ptr(m_BicarbonateMolarity_mmol_Per_L.Unload())); - data.PackOn(m_packOn); - data.PreviousWeightPack_kg(m_previousWeightPack_kg); -} - //-------------------------------------------------------------------------------------------------- /// \brief /// Initializes the energy specific quantities @@ -184,11 +158,11 @@ void Energy::SetUp() m_SkinSodium = m_data.GetCompartments().GetLiquidCompartment(BGE::ExtravascularCompartment::SkinExtracellular)->GetSubstanceQuantity(m_data.GetSubstances().GetSodium()); m_SkinChloride = m_data.GetCompartments().GetLiquidCompartment(BGE::ExtravascularCompartment::SkinExtracellular)->GetSubstanceQuantity(m_data.GetSubstances().GetChloride()); m_SkinPotassium = m_data.GetCompartments().GetLiquidCompartment(BGE::ExtravascularCompartment::SkinExtracellular)->GetSubstanceQuantity(m_data.GetSubstances().GetPotassium()); - //Circuit elements - //Circuits + // Circuit elements + // Circuits m_TemperatureCircuit = &m_data.GetCircuits().GetTemperatureCircuit(); m_InternalTemperatureCircuit = &m_data.GetCircuits().GetInternalTemperatureCircuit(); - //Nodes + // Nodes m_coreNode = m_InternalTemperatureCircuit->GetNode(BGE::InternalTemperatureNode::InternalCore); m_skinNodes.clear(); m_skinNodes.push_back(m_InternalTemperatureCircuit->GetNode(BGE::InternalTemperatureNode::InternalTorsoSkin)); @@ -197,7 +171,7 @@ void Energy::SetUp() m_skinNodes.push_back(m_InternalTemperatureCircuit->GetNode(BGE::InternalTemperatureNode::InternalRightArmSkin)); m_skinNodes.push_back(m_InternalTemperatureCircuit->GetNode(BGE::InternalTemperatureNode::InternalLeftLegSkin)); m_skinNodes.push_back(m_InternalTemperatureCircuit->GetNode(BGE::InternalTemperatureNode::InternalRightLegSkin)); - //Paths + // Paths m_temperatureGroundToCorePath = m_InternalTemperatureCircuit->GetPath(BGE::InternalTemperaturePath::GroundToInternalCore); m_skinExtravascularToSweatingGroundPath = m_data.GetCircuits().GetActiveCardiovascularCircuit().GetPath(BGE::TissuePath::SkinSweating); m_coreToSkinPaths.clear(); @@ -229,7 +203,7 @@ void Energy::PreProcess() m_data.GetDataTrack().Probe("CTSresistance", m_Test); CalculateSweatRate(); UpdateHeatResistance(); - //ManageEnergyDeficit(); + // ManageEnergyDeficit(); Exercise(); } @@ -265,7 +239,7 @@ void Energy::Exercise() if (m_PatientActions->HasExercise()) { switch (exercise->GetExerciseType()) { case SEExercise::GENERIC: { - //Model Code + // Model Code SEExercise::SEGeneric genericEx = exercise->GetGenericExercise(); if (genericEx.Intensity.IsValid()) { exerciseIntensity = genericEx.Intensity.GetValue(); @@ -276,7 +250,7 @@ void Energy::Exercise() exerciseIntensity = 1; Warning("Desired work rate over max work rate. Desired work rate can be a value between 0 and 1200 W. Proceeding with max work rate."); } - genericEx.DesiredWorkRate.Clear(); + genericEx.DesiredWorkRate.Invalidate(); } else { Warning("Generic Exercise call with no severity. Action ignored."); } @@ -284,7 +258,7 @@ void Energy::Exercise() break; } case SEExercise::RUNNING: { - //Model Code + // Model Code SEExercise::SERunning runningEx = exercise->GetRunningExercise(); speedRun_m_Per_s = runningEx.SpeedRun.GetValue(LengthPerTimeUnit::m_Per_s); const double speedRun_mph = speedRun_m_Per_s * 2.23694; @@ -307,7 +281,7 @@ void Energy::Exercise() break; } case SEExercise::CYCLING: { - //Model Code + // Model Code SEExercise::SECycling cyclingEx = exercise->GetCyclingExercise(); cadenceCycle_Per_Min = cyclingEx.CadenceCycle.GetValue(FrequencyUnit::Per_min); powerCycle_W = cyclingEx.PowerCycle.GetValue(PowerUnit::W); @@ -330,7 +304,7 @@ void Energy::Exercise() break; } case SEExercise::STRENGTH_TRAINING: { - //Model Code + // Model Code SEExercise::SEStrengthTraining strengthEx = exercise->GetStrengthExercise(); weightStrength_kg = strengthEx.WeightStrength.GetValue(MassUnit::kg); repetitionsStrength_number = strengthEx.RepsStrength.GetValue(); @@ -341,7 +315,7 @@ void Energy::Exercise() break; } case SEExercise::NONE: - //No actual exercise - included to extend "full range of switch possibilities" + // No actual exercise - included to extend "full range of switch possibilities" break; } @@ -441,52 +415,52 @@ void Energy::CalculateVitalSigns() GetSkinTemperature().SetValue(meanSkinTemp_degC, TemperatureUnit::C); std::stringstream ss; - //Hypothermia check + // Hypothermia check double coreTempIrreversible_degC = 15.0; /// \cite Stocks2004HumanPhysiologicalResponseCold - if (coreTemperature_degC > 32.0 && coreTemperature_degC < 35.0 ) /// \cite mallet2001hypothermia + if (coreTemperature_degC > 32.0 && coreTemperature_degC < 35.0) /// \cite mallet2001hypothermia { /// \event Patient: Core temperature has fallen below 35 degrees Celsius. Patient is hypothermic. - m_Patient->SetEvent(CDM::enumPatientEvent::MildHypothermia, true, m_data.GetSimulationTime()); - m_Patient->SetEvent(CDM::enumPatientEvent::ModerateHypothermia, false, m_data.GetSimulationTime()); - m_Patient->SetEvent(CDM::enumPatientEvent::SevereHypothermia, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::MildHypothermia, true, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::ModerateHypothermia, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::SevereHypothermia, false, m_data.GetSimulationTime()); } if (coreTemperature_degC > 28.2 && coreTemperature_degC < 31.5) /// \cite mallet2001hypothermia { /// \event Patient: Core temperature has fallen below 35 degrees Celsius. Patient is hypothermic. - m_Patient->SetEvent(CDM::enumPatientEvent::MildHypothermia, false, m_data.GetSimulationTime()); - m_Patient->SetEvent(CDM::enumPatientEvent::SevereHypothermia, false, m_data.GetSimulationTime()); - m_Patient->SetEvent(CDM::enumPatientEvent::ModerateHypothermia, true, m_data.GetSimulationTime()); - } + m_Patient->SetEvent(SEPatientEventType::MildHypothermia, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::SevereHypothermia, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::ModerateHypothermia, true, m_data.GetSimulationTime()); + } if (coreTemperature_degC < 28.0) /// \cite mallet2001hypothermia { - m_Patient->SetEvent(CDM::enumPatientEvent::MildHypothermia, false, m_data.GetSimulationTime()); - m_Patient->SetEvent(CDM::enumPatientEvent::ModerateHypothermia, false, m_data.GetSimulationTime()); - m_Patient->SetEvent(CDM::enumPatientEvent::SevereHypothermia, true, m_data.GetSimulationTime()); - } - /// \irreversible State: Core temperature has fallen below 20 degrees Celsius. + m_Patient->SetEvent(SEPatientEventType::MildHypothermia, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::ModerateHypothermia, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::SevereHypothermia, true, m_data.GetSimulationTime()); + } + /// \irreversible State: Core temperature has fallen below 20 degrees Celsius. if (coreTemperature_degC < coreTempIrreversible_degC) { ss << "Core temperature is " << coreTemperature_degC << ". This is below 15 degrees C, patient is experiencing extreme hypothermia."; Warning(ss); if (!m_PatientActions->HasOverride()) { - m_Patient->SetEvent(CDM::enumPatientEvent::IrreversibleState, true, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::IrreversibleState, true, m_data.GetSimulationTime()); } else { - if (m_PatientActions->GetOverride()->GetOverrideConformance() == CDM::enumOnOff::On) { - m_Patient->SetEvent(CDM::enumPatientEvent::IrreversibleState, true, m_data.GetSimulationTime()); + if (m_PatientActions->GetOverride()->GetOverrideConformance() == SEOnOff::On) { + m_Patient->SetEvent(SEPatientEventType::IrreversibleState, true, m_data.GetSimulationTime()); } } - } - - if (m_Patient->IsEventActive(CDM::enumPatientEvent::MildHypothermia) && coreTemperature_degC > 35.2) { - m_Patient->SetEvent(CDM::enumPatientEvent::MildHypothermia, false, m_data.GetSimulationTime()); } - //Hyperthermia check + + if (m_Patient->IsEventActive(SEPatientEventType::MildHypothermia) && coreTemperature_degC > 35.2) { + m_Patient->SetEvent(SEPatientEventType::MildHypothermia, false, m_data.GetSimulationTime()); + } + // Hyperthermia check if (coreTemperature_degC > 38.8) // Note: Hyperthermia threshold varies; we'll use 38.8 { /// \event Patient: Core temperature has exceeded 38.8 degrees Celsius. Patient is hyperthermic. - m_Patient->SetEvent(CDM::enumPatientEvent::Hyperthermia, true, m_data.GetSimulationTime()); - } else if (m_Patient->IsEventActive(CDM::enumPatientEvent::Hyperthermia) && coreTemperature_degC < 38.0) { - m_Patient->SetEvent(CDM::enumPatientEvent::Hyperthermia, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::Hyperthermia, true, m_data.GetSimulationTime()); + } else if (m_Patient->IsEventActive(SEPatientEventType::Hyperthermia) && coreTemperature_degC < 38.0) { + m_Patient->SetEvent(SEPatientEventType::Hyperthermia, false, m_data.GetSimulationTime()); } /// \todo Move to blood chemistry @@ -498,8 +472,8 @@ void Energy::CalculateVitalSigns() double lowPh = 6.5; // \cite Edge2006AcidosisConscious m_BloodpH.Sample(m_data.GetBloodChemistry().GetArterialBloodPH().GetValue()); m_BicarbonateMolarity_mmol_Per_L.Sample(m_AortaHCO3->GetMolarity(AmountPerVolumeUnit::mmol_Per_L)); - //Only check these at the end of a cardiac cycle and reset at start of cardiac cycle - if (m_Patient->IsEventActive(CDM::enumPatientEvent::StartOfCardiacCycle)) { + // Only check these at the end of a cardiac cycle and reset at start of cardiac cycle + if (m_Patient->IsEventActive(SEPatientEventType::StartOfCardiacCycle)) { double bloodPH = m_BloodpH.Value(); double bloodBicarbonate_mmol_Per_L = m_BicarbonateMolarity_mmol_Per_L.Value(); @@ -513,20 +487,20 @@ void Energy::CalculateVitalSigns() ss << " Arterial blood PH is " << bloodPH << ". This is below 6.5, patient is experiencing extreme metabolic acidosis and is in an irreversible state."; Warning(ss); if (!m_PatientActions->HasOverride()) { - m_Patient->SetEvent(CDM::enumPatientEvent::IrreversibleState, true, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::IrreversibleState, true, m_data.GetSimulationTime()); } else { - if (m_PatientActions->GetOverride()->GetOverrideConformance() == CDM::enumOnOff::On) { - m_Patient->SetEvent(CDM::enumPatientEvent::IrreversibleState, true, m_data.GetSimulationTime()); + if (m_PatientActions->GetOverride()->GetOverrideConformance() == SEOnOff::On) { + m_Patient->SetEvent(SEPatientEventType::IrreversibleState, true, m_data.GetSimulationTime()); } } } else if (bloodPH > 7.38 && bloodBicarbonate_mmol_Per_L > 23.0) { /// \event The patient has exited the state state of metabolic acidosis - m_Patient->SetEvent(CDM::enumPatientEvent::MetabolicAcidosis, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::MetabolicAcidosis, false, m_data.GetSimulationTime()); } if (bloodPH > 7.45 && bloodBicarbonate_mmol_Per_L > 26.0) { /// \event The patient is in a state of metabolic alkalosis - m_Patient->SetEvent(CDM::enumPatientEvent::MetabolicAlkalosis, true, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::MetabolicAlkalosis, true, m_data.GetSimulationTime()); } /// \irreversible State: arterial blood pH has increased above 8.5. @@ -534,17 +508,17 @@ void Energy::CalculateVitalSigns() ss << " Arterial blood PH is " << bloodPH << ". This is above 8.5, patient is experiencing extreme metabolic Alkalosis and is in an irreversible state."; Warning(ss); if (!m_PatientActions->HasOverride()) { - m_Patient->SetEvent(CDM::enumPatientEvent::IrreversibleState, true, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::IrreversibleState, true, m_data.GetSimulationTime()); } else { - if (m_PatientActions->GetOverride()->GetOverrideConformance() == CDM::enumOnOff::On) { - m_Patient->SetEvent(CDM::enumPatientEvent::IrreversibleState, true, m_data.GetSimulationTime()); + if (m_PatientActions->GetOverride()->GetOverrideConformance() == SEOnOff::On) { + m_Patient->SetEvent(SEPatientEventType::IrreversibleState, true, m_data.GetSimulationTime()); } } } else if (bloodPH < 7.42 && bloodBicarbonate_mmol_Per_L < 25.0) { /// \event The patient has exited the state of metabolic alkalosis - m_Patient->SetEvent(CDM::enumPatientEvent::MetabolicAlkalosis, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::MetabolicAlkalosis, false, m_data.GetSimulationTime()); } } // Reset the running averages. Why do we need running averages here? Does the aorta pH fluctuate that much? @@ -569,19 +543,19 @@ void Energy::CalculateMetabolicHeatGeneration() double coreTemperature_degC = m_coreNode->GetTemperature(TemperatureUnit::C); double coreTemperatureLow_degC = m_data.GetConfiguration().GetCoreTemperatureLow(TemperatureUnit::C); double coreTemperatureLowDelta_degC = m_data.GetConfiguration().GetDeltaCoreTemperatureLow(TemperatureUnit::C); - double coreTemperatureHigh_degC = 40.0; //TODO: This should use the config property why doesn't it? + double coreTemperatureHigh_degC = 40.0; // TODO: This should use the config property why doesn't it? double totalMetabolicRateNew_Kcal_Per_day = 0.0; double totalMetabolicRateNew_W = 0.0; - //The summit metabolism is the maximum amount of power the human body can generate due to shivering/response to the cold. + // The summit metabolism is the maximum amount of power the human body can generate due to shivering/response to the cold. double summitMetabolism_W = 21.0 * std::pow(m_Patient->GetWeight(MassUnit::kg), 0.75); /// \cite herman2008physics double currentMetabolicRate_kcal_Per_day = GetTotalMetabolicRate().GetValue(PowerUnit::kcal_Per_day); double basalMetabolicRate_kcal_Per_day = m_Patient->GetBasalMetabolicRate().GetValue(PowerUnit::kcal_Per_day); double basalMetabolicRate_W = m_Patient->GetBasalMetabolicRate().GetValue(PowerUnit::W); - if (coreTemperature_degC < 34.0) //Hypothermic state inducing metabolic depression (decline of metabolic heat generation) + if (coreTemperature_degC < 34.0) // Hypothermic state inducing metabolic depression (decline of metabolic heat generation) { double tot_W = GetTotalMetabolicRate().GetValue(PowerUnit::W); - double scaleMR = 0.00001; // need the scaling factor to reduce the rate of decrease + double scaleMR = 0.00001; // need the scaling factor to reduce the rate of decrease totalMetabolicRateNew_W = tot_W - tot_W * scaleMR * (1 - std::pow(0.94, 34.0 - coreTemperature_degC)); // if we are below basal rate, then the rate of decrease needs to dimish much slower @@ -590,26 +564,26 @@ void Energy::CalculateMetabolicHeatGeneration() totalMetabolicRateNew_W = tot_W - tot_W * scaleMR * (1 - std::pow(0.94, 34.0 - coreTemperature_degC)); } - //tot_W *= std::pow(0.94, 34.0 - coreTemperature_degC); - //totalMetabolicRateNew_W = summitMetabolism_W * std::pow(0.94, 34.0 - coreTemperature_degC); //The metabolic heat generated will drop by 6% for every degree below 34 C + // tot_W *= std::pow(0.94, 34.0 - coreTemperature_degC); + // totalMetabolicRateNew_W = summitMetabolism_W * std::pow(0.94, 34.0 - coreTemperature_degC); //The metabolic heat generated will drop by 6% for every degree below 34 C GetTotalMetabolicRate().SetValue(totalMetabolicRateNew_W, PowerUnit::W); /// \cite mallet2002hypothermia - } else if (coreTemperature_degC >= 34.0 && coreTemperature_degC < 36.8) //Patient is increasing heat generation via shivering. This caps out at the summit metabolism + } else if (coreTemperature_degC >= 34.0 && coreTemperature_degC < 36.8) // Patient is increasing heat generation via shivering. This caps out at the summit metabolism { - m_Patient->SetEvent(CDM::enumPatientEvent::Shivering, true, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::Shivering, true, m_data.GetSimulationTime()); double basalMetabolicRate_W = m_Patient->GetBasalMetabolicRate(PowerUnit::W); - double scaleMR = 0.1; //scaling factor to validate metabolic rate during shivering, the old model was far too rapid + double scaleMR = 0.1; // scaling factor to validate metabolic rate during shivering, the old model was far too rapid totalMetabolicRateNew_W = basalMetabolicRate_W + (summitMetabolism_W - basalMetabolicRate_W) * scaleMR * (coreTemperatureLow_degC - coreTemperature_degC) / coreTemperatureLowDelta_degC; - totalMetabolicRateNew_W = std::min(totalMetabolicRateNew_W, summitMetabolism_W); //Bounded at the summit metabolism so further heat generation doesn't continue for continue drops below 34 C. + totalMetabolicRateNew_W = std::min(totalMetabolicRateNew_W, summitMetabolism_W); // Bounded at the summit metabolism so further heat generation doesn't continue for continue drops below 34 C. GetTotalMetabolicRate().SetValue(totalMetabolicRateNew_W, PowerUnit::W); - } else if (coreTemperature_degC >= 36.8 && coreTemperature_degC < 40 && !m_PatientActions->HasExercise()) //Basic Metabolic rate + } else if (coreTemperature_degC >= 36.8 && coreTemperature_degC < 40 && !m_PatientActions->HasExercise()) // Basic Metabolic rate { double TotalMetabolicRateSetPoint_kcal_Per_day = basalMetabolicRate_kcal_Per_day; - double MetabolicRateGain = 0.0001; //Used to ramp the metabolic rate from its current value to the basal value if the patient meets the basal criteria + double MetabolicRateGain = 0.0001; // Used to ramp the metabolic rate from its current value to the basal value if the patient meets the basal criteria double TotalMetabolicRateProduced_kcal_Per_day = currentMetabolicRate_kcal_Per_day + MetabolicRateGain * (TotalMetabolicRateSetPoint_kcal_Per_day - currentMetabolicRate_kcal_Per_day); GetTotalMetabolicRate().SetValue(TotalMetabolicRateProduced_kcal_Per_day, PowerUnit::kcal_Per_day); - } else if (coreTemperature_degC > 40.0 && !m_PatientActions->HasExercise()) //Core temperature greater than 40.0. If not exercising, then the hyperthermia leads to increased metabolism + } else if (coreTemperature_degC > 40.0 && !m_PatientActions->HasExercise()) // Core temperature greater than 40.0. If not exercising, then the hyperthermia leads to increased metabolism { - totalMetabolicRateNew_Kcal_Per_day = basalMetabolicRate_kcal_Per_day * std::pow(1.11, coreTemperature_degC - coreTemperatureHigh_degC); //The metabolic heat generated will increase by 11% for every degree above 40.0 C + totalMetabolicRateNew_Kcal_Per_day = basalMetabolicRate_kcal_Per_day * std::pow(1.11, coreTemperature_degC - coreTemperatureHigh_degC); // The metabolic heat generated will increase by 11% for every degree above 40.0 C GetTotalMetabolicRate().SetValue(totalMetabolicRateNew_Kcal_Per_day, PowerUnit::kcal_Per_day); /// \cite pate2001thermal } @@ -737,7 +711,7 @@ void Energy::UpdateHeatResistance() double weightedAvgSegmentedTemperature_C = normalSkinTemperature_C; double burnTemperature = GetBurnSkinTemperature().GetValue(TemperatureUnit::C); SEThermalCircuitPath* metabolicHeatPath; - if (m_data.GetBloodChemistry().GetInflammatoryResponse().HasInflammationSource(CDM::enumInflammationSource::Burn)) { + if (m_data.GetBloodChemistry().GetInflammatoryResponse().HasInflammationSource(SEInflammationSource::Burn)) { SEBurnWound* burnAction = m_data.GetActions().GetPatientActions().GetBurnWound(); std::vector burnComptVector = burnAction->GetCompartments(); // Check if burn is on specific compartment. Skip head since burns cannot currently be initialized on the head @@ -788,19 +762,63 @@ void Energy::UpdateHeatResistance() alphaScale = lastAlpha + rampGain * (targetAlpha - lastAlpha); } } + if (m_data.GetBloodChemistry().GetInflammatoryResponse().HasInflammationSource(SEInflammationSource::Fracture)) { + SEThermalCircuitPath* fractureHeatPath; + SEFracture* fracture = m_data.GetActions().GetPatientActions().GetFracture(); + SEFracturedBone bone = fracture->GetFracturedBone(); + SEFractureType type = fracture->GetFractureType(); + SESide side = fracture->GetSide(); + + bool isFractureValid = true; + + double typeThermalEffect = 0.0; + + // Only support comminuted for now + switch (type) { + case SEFractureType::Comminuted: + typeThermalEffect = 0.3; + break; + default: + typeThermalEffect = 0.2; + break; + } + + switch (bone) { + case SEFracturedBone::Radius: + if (side == SESide::Left) { + fractureHeatPath = m_InternalTemperatureCircuit->GetPath(BGE::InternalTemperaturePath::GroundToInternalLeftArmSkin); + } else if (side == SESide::Right) { + fractureHeatPath = m_InternalTemperatureCircuit->GetPath(BGE::InternalTemperaturePath::GroundToInternalRightArmSkin); + } + break; + case SEFracturedBone::Tibia: + if (side == SESide::Left) { + fractureHeatPath = m_InternalTemperatureCircuit->GetPath(BGE::InternalTemperaturePath::GroundToInternalLeftLegSkin); + } else if (side == SESide::Right) { + fractureHeatPath = m_InternalTemperatureCircuit->GetPath(BGE::InternalTemperaturePath::GroundToInternalRightLegSkin); + } + default: + isFractureValid = false; + break; + } + if (isFractureValid) { + double currHeat = fractureHeatPath->GetHeatSource().GetValue(PowerUnit::J_Per_s); + fractureHeatPath->GetNextHeatSource().IncrementValue(currHeat * 0.1 * (typeThermalEffect), PowerUnit::J_Per_s); + } + } // The heat transfer resistance from the core to the skin is inversely proportional to the skin blood flow. // When skin blood flow increases, then heat transfer resistance decreases leading to more heat transfer from core to skin. // The opposite occurs for skin blood flow decrease. double coreToSkinResistance_K_Per_W = 1.0 / (alphaScale * bloodDensity_kg_Per_m3 * bloodSpecificHeat_J_Per_K_kg * segmentedSkinBloodFlows[index]); - + coreToSkinResistance_K_Per_W = BLIM(coreToSkinResistance_K_Per_W, 0.0001, 20.0); coreToSkinPath->GetNextResistance().SetValue(coreToSkinResistance_K_Per_W, HeatResistanceUnit::K_Per_W); index += 1; } if (isAnySegmentBurned) { // Tracking the burned skin temperature as a function of time after burn initiated SEBurnWound* burnAction = m_data.GetActions().GetPatientActions().GetBurnWound(); - double timeSinceBurn = m_data.GetSimulationTime().GetValue() - burnAction->GetTimeOfBurn(); + double timeSinceBurn = m_data.GetSimulationTime().GetValue() - burnAction->GetTimeOfBurn(); if (timeSinceBurn != 0.0) { double t = timeSinceBurn; double burnTemperature = (30.3 * std::exp(-1.0 * std::pow(t - 7.81, 2) / 11.7)) + GetSkinTemperature(TemperatureUnit::C); @@ -827,11 +845,11 @@ void Energy::CalculateBasalMetabolicRate() double PatientAge_yr = patient.GetAge(TimeUnit::yr); double PatientHeight_cm = patient.GetHeight(LengthUnit::cm); - //The basal metabolic rate is determined from the Harris-Benedict formula, with differences dependent on sex, age, height and mass + // The basal metabolic rate is determined from the Harris-Benedict formula, with differences dependent on sex, age, height and mass /// \cite roza1984metabolic double patientBMR_kcal_Per_day = 0.0; - if (patient.GetGender() == CDM::enumSex::Male) { - patientBMR_kcal_Per_day = 88.632 + 13.397 * PatientMass_kg + 4.799 * PatientHeight_cm - 5.677 * PatientAge_yr; + if (patient.GetSex() == SESex::Male) { + patientBMR_kcal_Per_day = 88.362 + 13.397 * PatientMass_kg + 4.799 * PatientHeight_cm - 5.677 * PatientAge_yr; } else { patientBMR_kcal_Per_day = 447.593 + 9.247 * PatientMass_kg + 3.098 * PatientHeight_cm - 4.330 * PatientAge_yr; } @@ -860,10 +878,10 @@ void Energy::CalculateBasalMetabolicRate() void Energy::ManageEnergyDeficit() { if (m_PatientActions->HasHemorrhage()) { - double basalTissueEnergyDemand_W = m_Patient->GetBasalMetabolicRate(PowerUnit::W) * 0.8; //We say in tissue that say brain takes up 20%, and we just care about the other tissues for this process + double basalTissueEnergyDemand_W = m_Patient->GetBasalMetabolicRate(PowerUnit::W) * 0.8; // We say in tissue that say brain takes up 20%, and we just care about the other tissues for this process double volFraction = m_data.GetCardiovascular().GetBloodVolume(VolumeUnit::mL) / m_Patient->GetBloodVolumeBaseline(VolumeUnit::mL); ULIM(volFraction, 1.0); - double minVolFraction = 0.5; //i.e. half of blood volume lost + double minVolFraction = 0.5; // i.e. half of blood volume lost double maxDeficitMultiplier = 0.5; double energyDeficit_W = basalTissueEnergyDemand_W * GeneralMath::LinearInterpolator(1.0, minVolFraction, 0.0, maxDeficitMultiplier, volFraction); GetEnergyDeficit().SetValue(energyDeficit_W, PowerUnit::W); @@ -945,22 +963,22 @@ void Energy::OverrideControlLoop() constexpr double maxAcheivedExerciseOverride = 100; constexpr double minAcheivedExerciseOverride = 0; - constexpr double maxCoreTempOverride = 200.0; //degC - constexpr double minCoreTempOverride = 0.0; //degC + constexpr double maxCoreTempOverride = 200.0; // degC + constexpr double minCoreTempOverride = 0.0; // degC constexpr double maxCreatinineOverride = 100.0; // mol_Per_s constexpr double minCreatinineOverride = 0.0; // mol_Per_s - constexpr double maxExerciseMAPOverride = 200.0; //mmHg - constexpr double minExerciseMAPOverride = 0.0; //mmHg + constexpr double maxExerciseMAPOverride = 200.0; // mmHg + constexpr double minExerciseMAPOverride = 0.0; // mmHg constexpr double maxFatigueOverride = 100.0; constexpr double minFatigueOverride = 0.0; - constexpr double maxLactateOverride = 200.0; //mol per s - constexpr double minLactateOverride = 0.0; //mol per s - constexpr double maxSkinTempOverride = 200.0; //degC - constexpr double minSkinTempOverride = 0.0; //degC + constexpr double maxLactateOverride = 200.0; // mol per s + constexpr double minLactateOverride = 0.0; // mol per s + constexpr double maxSkinTempOverride = 200.0; // degC + constexpr double minSkinTempOverride = 0.0; // degC constexpr double maxSweatRateOverride = 50.0; // g per s constexpr double minSweatRateOverride = 0.0; // g per s - constexpr double maxTotalMetabolicOverride = 5000.0; //kcal/day - constexpr double minTotalMetabolicOverride = 0.0; //kcal/day + constexpr double maxTotalMetabolicOverride = 5000.0; // kcal/day + constexpr double minTotalMetabolicOverride = 0.0; // kcal/day constexpr double maxTotalWorkOverride = 100.0; constexpr double minTotalWorkOverride = 0.0; constexpr double maxSodiumSweatOverride = 500.0; // g @@ -970,20 +988,20 @@ void Energy::OverrideControlLoop() constexpr double maxChlorideSweatOverride = 500.0; // g constexpr double minChlorideSweatOverride = 0.0; // g - double currentAcheivedExerciseOverride = 0; //gets changed in next step - double currentCoreTempOverride = 0; //gets changed in next step - double currentCreatinineOverride = 0; //gets changed in next step - double currentExerciseMAPOverride = 0; //gets changed in next step - double currentFatigueOverride = 0; //gets changed in next step - double currentLactateOverride = 0; //gets changed in next step - double currentSkinTempOverride = 0; //gets changed in next step - double currentSweatRateOverride = 0; //gets changed in next step - double currentTotalMetabolicOverride = 0; //gets changed in next step - double currentTotalWorkOverride = 0; //gets changed in next step - double currentSodiumSweatOverride = 0.0; //gets changed in next step - double currentPotassiumSweatOverride = 0.0; //gets changed in next step - - double currentChlorideSweatOverride = 0.0; //gets changed in next step + double currentAcheivedExerciseOverride = 0; // gets changed in next step + double currentCoreTempOverride = 0; // gets changed in next step + double currentCreatinineOverride = 0; // gets changed in next step + double currentExerciseMAPOverride = 0; // gets changed in next step + double currentFatigueOverride = 0; // gets changed in next step + double currentLactateOverride = 0; // gets changed in next step + double currentSkinTempOverride = 0; // gets changed in next step + double currentSweatRateOverride = 0; // gets changed in next step + double currentTotalMetabolicOverride = 0; // gets changed in next step + double currentTotalWorkOverride = 0; // gets changed in next step + double currentSodiumSweatOverride = 0.0; // gets changed in next step + double currentPotassiumSweatOverride = 0.0; // gets changed in next step + + double currentChlorideSweatOverride = 0.0; // gets changed in next step if (override->HasAchievedExerciseLevelOverride()) { currentAcheivedExerciseOverride = override->GetAchievedExerciseLevelOverride().GetValue(); @@ -1027,94 +1045,94 @@ void Energy::OverrideControlLoop() if ((currentAcheivedExerciseOverride < minAcheivedExerciseOverride || currentAcheivedExerciseOverride > maxAcheivedExerciseOverride) - && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Achieved Exercise Override (Energy) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } if ((currentCoreTempOverride < minCoreTempOverride || currentCoreTempOverride > maxCoreTempOverride) - && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Core Temperature Override (Energy) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } if ((currentCreatinineOverride < minCreatinineOverride || currentCreatinineOverride > maxCreatinineOverride) - && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Creatinine Override (Energy) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } if ((currentExerciseMAPOverride < minExerciseMAPOverride || currentExerciseMAPOverride > maxExerciseMAPOverride) - && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Exercise Mean Arterial Pressure Delta Override (Energy) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } if ((currentFatigueOverride < minFatigueOverride || currentFatigueOverride > maxFatigueOverride) - && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Fatigue Override (Energy) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } if ((currentLactateOverride < minLactateOverride || currentLactateOverride > maxLactateOverride) - && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Lactate Production Override (Energy) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } if ((currentSkinTempOverride < minSkinTempOverride || currentSkinTempOverride > maxSkinTempOverride) - && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Skin Temperature Override (Energy) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } if ((currentSweatRateOverride < minSweatRateOverride || currentSweatRateOverride > maxSweatRateOverride) - && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Sweat Rate Override (Energy) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } if ((currentTotalMetabolicOverride < minTotalMetabolicOverride || currentTotalMetabolicOverride > maxTotalMetabolicOverride) - && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Total Metabolic Rate Override (Energy) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } if ((currentTotalWorkOverride < minTotalWorkOverride || currentTotalWorkOverride > maxTotalWorkOverride) - && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Total Work Rate Override (Energy) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } if ((currentSodiumSweatOverride < minSodiumSweatOverride || currentSodiumSweatOverride > maxSodiumSweatOverride) - && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Sodium Lost to Sweat Override (Energy) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } if ((currentPotassiumSweatOverride < minPotassiumSweatOverride || currentPotassiumSweatOverride > maxPotassiumSweatOverride) - && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Potassium Lost to Sweat Override (Energy) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } if ((currentChlorideSweatOverride < minChlorideSweatOverride || currentChlorideSweatOverride > maxChlorideSweatOverride) - && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Chloride Lost to Sweat Override (Energy) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } return; } diff --git a/projects/biogears/libBiogears/src/engine/Systems/Environment.cpp b/projects/biogears/libBiogears/src/engine/Systems/Environment.cpp index aead329fa..a59f5f506 100644 --- a/projects/biogears/libBiogears/src/engine/Systems/Environment.cpp +++ b/projects/biogears/libBiogears/src/engine/Systems/Environment.cpp @@ -41,7 +41,9 @@ specific language governing permissions and limitations under the License. #include #include -namespace BGE = mil::tatrc::physiology::biogears; + +#include "io/cdm/Environment.h" +#include "io/biogears/BioGearsEnvironment.h" namespace biogears { auto Environment::make_unique(BioGears& bg) -> std::unique_ptr @@ -53,17 +55,17 @@ Environment::Environment(BioGears& bg) : SEEnvironment(bg.GetSubstances()) , m_data(bg) { - Clear(); + Invalidate(); } Environment::~Environment() { - Clear(); + Invalidate(); } -void Environment::Clear() +void Environment::Invalidate() { - SEEnvironment::Clear(); + SEEnvironment::Invalidate(); m_Patient = nullptr; m_PatientActions = nullptr; m_EnvironmentActions = nullptr; @@ -110,27 +112,6 @@ void Environment::Initialize() m_PatientEquivalentDiameter_m = std::pow(Convert(patientMass_g / patientDensity_g_Per_mL, VolumeUnit::mL, VolumeUnit::m3) / (pi * patientHeight_m), 0.5); } -bool Environment::Load(const CDM::BioGearsEnvironmentData& in) -{ - if (!SEEnvironment::Load(in)) - return false; - BioGearsSystem::LoadState(); - m_PatientEquivalentDiameter_m = in.PatientEquivalentDiameter_m(); - StateChange(); - return true; -} -CDM::BioGearsEnvironmentData* Environment::Unload() const -{ - CDM::BioGearsEnvironmentData* data = new CDM::BioGearsEnvironmentData(); - Unload(*data); - return data; -} -void Environment::Unload(CDM::BioGearsEnvironmentData& data) const -{ - SEEnvironment::Unload(data); - data.PatientEquivalentDiameter_m(m_PatientEquivalentDiameter_m); -} - void Environment::SetUp() { // Patient and Actions @@ -189,7 +170,7 @@ void Environment::SetUp() /// \details /// This is called any time the environment change action/condition. It sets the ambient node /// values needed for the fluid systems. -//-------------------------------------------------------------------------------------------------- + void Environment::StateChange() { using namespace std::string_literals; @@ -227,14 +208,19 @@ void Environment::StateChange() // Add aerosols to the environment for (auto s : GetConditions().GetAmbientAerosols()) { - SESubstance& sub = s->GetSubstance(); - if (!sub.HasAerosolization()) { - Error("Ignoring environment aerosol as it does not have any aerosol data : "s + sub.GetName()); + auto sub = s->GetSubstance(); + if (!sub.Aerosolization.IsValid()) { + Error("Ignoring environment aerosol as it does not have any aerosol data : "s + sub.Name); continue; } m_data.GetSubstances().AddActiveSubstance(sub); SELiquidSubstanceQuantity* subQ = m_AmbientAerosols->GetSubstanceQuantity(sub); - subQ->GetConcentration().Set(s->GetConcentration()); + if (subQ) { + subQ->GetConcentration().Set(s->GetConcentration()); + } else { + Error("aerosol "s + sub.Name + " is not present in AmbientAerosols"s); + continue; + } } } @@ -350,10 +336,10 @@ void Environment::ProcessActions() //Set the temperature source to zero m_ActiveTemperaturePath->GetNextTemperatureSource().SetValue(0.0, TemperatureUnit::K); //Open the switch - m_ActiveSwitchPath->SetNextSwitch(CDM::enumOpenClosed::Open); + m_ActiveSwitchPath->SetNextSwitch(SEOpenClosed::Open); //Check for actions that modify environment resistances - if (m_data.GetBloodChemistry().GetInflammatoryResponse().HasInflammationSource(CDM::enumInflammationSource::Burn)) { + if (m_data.GetBloodChemistry().GetInflammatoryResponse().HasInflammationSource(SEInflammationSource::Burn)) { //In the event of a burn, modify the skin to clothing, clothing to enclosure (radiation), and clothing to environment (convection) //paths based on the burn surface area fraction. Reducing skin to clothing resistance assumes that burn patient will have large //surface area uncovered. We calculate change in evaporative resistance in CalcEvaporation since that involves adjustment of funtion level parameters @@ -386,7 +372,7 @@ void Environment::ProcessActions() const double burnRampGain = 1.0e-5; for (SEThermalCircuitPath* skinToClothing : m_SkinToClothingPaths) { double burnSurfaceAreaFraction = 0.0; - if (m_data.GetBloodChemistry().GetInflammatoryResponse().HasInflammationSource(CDM::enumInflammationSource::Burn)) { + if (m_data.GetBloodChemistry().GetInflammatoryResponse().HasInflammationSource(SEInflammationSource::Burn)) { SEBurnWound* burnAction = m_data.GetActions().GetPatientActions().GetBurnWound(); std::vector burnComptVector = burnAction->GetCompartments(); // Check if burn is on specific compartment. Skip head since burns cannot currently be initialized on the head @@ -528,7 +514,7 @@ void Environment::ProcessActions() m_ActiveTemperaturePath->GetNextTemperatureSource().SetValue(dAppliedTemperature_K, TemperatureUnit::K); //Close the switch - m_ActiveSwitchPath->SetNextSwitch(CDM::enumOpenClosed::Closed); + m_ActiveSwitchPath->SetNextSwitch(SEOpenClosed::Closed); } } @@ -583,7 +569,7 @@ void Environment::CalculateSupplementalValues() m_dHeatOfVaporizationOfWater_J_Per_kg = dHeatOfVaporizationOfWater_JPerMol / 0.0180153; //1 mol of water = 0.0180153 kg //Water convective heat transfer properties - if (GetConditions().GetSurroundingType() == CDM::enumSurroundingType::Water) { + if (GetConditions().GetSurroundingType() == SESurroundingType::Water) { double dWaterTemperature_C = GetConditions().GetAmbientTemperature(TemperatureUnit::C); double dT = Convert(dWaterTemperature_C, TemperatureUnit::C, TemperatureUnit::K) / 298.15; @@ -604,7 +590,7 @@ void Environment::CalculateSupplementalValues() //-------------------------------------------------------------------------------------------------- void Environment::CalculateRadiation() { - if (GetConditions().GetSurroundingType() == CDM::enumSurroundingType::Water) { + if (GetConditions().GetSurroundingType() == SESurroundingType::Water) { //Submerged - therefore, no radiation //Invalidate the coefficient @@ -663,7 +649,7 @@ void Environment::CalculateConvection() { double dConvectiveHeatTransferCoefficient_WPerM2_K = 0.0; - if (GetConditions().GetSurroundingType() == CDM::enumSurroundingType::Water) { + if (GetConditions().GetSurroundingType() == SESurroundingType::Water) { //Submerged - therefore, convection is most important double dClothingTemperature_K = m_ClothingNode->GetTemperature().GetValue(TemperatureUnit::K); double dWaterTemperature_K = GetConditions().GetAmbientTemperature(TemperatureUnit::K); @@ -721,7 +707,7 @@ void Environment::CalculateConvection() //-------------------------------------------------------------------------------------------------- void Environment::CalculateEvaporation() { - if (GetConditions().GetSurroundingType() == CDM::enumSurroundingType::Water) { + if (GetConditions().GetSurroundingType() == SESurroundingType::Water) { //Submerged - therefore, no evaporation //Invalidate the coefficient GetEvaporativeHeatTranferCoefficient().Invalidate(); @@ -757,12 +743,12 @@ void Environment::CalculateEvaporation() double skinWettednessDiffusion = 0.06; auto& inflamationSources = m_data.GetBloodChemistry().GetInflammatoryResponse().GetInflammationSources(); - auto burn_inflamation = std::find(inflamationSources.begin(), inflamationSources.end(), CDM::enumInflammationSource::Burn); + auto burn_inflamation = std::find(inflamationSources.begin(), inflamationSources.end(), SEInflammationSource::Burn); if (burn_inflamation != inflamationSources.end()) { if (m_data.GetActions().GetPatientActions().HasBurnWound()) { bool isBurnWoundLocal = false; double localBurnIntensity = 0.0; - if (m_data.GetBloodChemistry().GetInflammatoryResponse().HasInflammationSource(CDM::enumInflammationSource::Burn)) { + if (m_data.GetBloodChemistry().GetInflammatoryResponse().HasInflammationSource(SEInflammationSource::Burn)) { SEBurnWound* burnAction = m_data.GetActions().GetPatientActions().GetBurnWound(); std::vector burnComptVector = burnAction->GetCompartments(); // Check if burn is on specific compartment. Skip head since burns cannot currently be initialized on the head diff --git a/projects/biogears/libBiogears/src/engine/Systems/Gastrointestinal.cpp b/projects/biogears/libBiogears/src/engine/Systems/Gastrointestinal.cpp index 9aa5d1b8b..f03792ad8 100644 --- a/projects/biogears/libBiogears/src/engine/Systems/Gastrointestinal.cpp +++ b/projects/biogears/libBiogears/src/engine/Systems/Gastrointestinal.cpp @@ -11,6 +11,10 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/PatientNutrition.h" +#include "io/cdm/Physiology.h" +#include "io/cdm/Physiology.h" + #include #include #include @@ -30,12 +34,11 @@ specific language governing permissions and limitations under the License. #include #include -namespace BGE = mil::tatrc::physiology::biogears; #pragma warning(disable : 4786) #pragma warning(disable : 4275) -//#define logMeal +// #define logMeal namespace std { template class map; } @@ -50,7 +53,7 @@ Gastrointestinal::Gastrointestinal(BioGears& bg) : SEGastrointestinalSystem(bg.GetLogger()) , m_data(bg) { - Clear(); + Invalidate(); /* Move to a unit test SENutrition one(m_Logger); SENutrition two(m_Logger); @@ -66,12 +69,12 @@ Gastrointestinal::Gastrointestinal(BioGears& bg) Gastrointestinal::~Gastrointestinal() { - Clear(); + Invalidate(); } -void Gastrointestinal::Clear() +void Gastrointestinal::Invalidate() { - SEGastrointestinalSystem::Clear(); + SEGastrointestinalSystem::Invalidate(); } //-------------------------------------------------------------------------------------------------- @@ -85,7 +88,7 @@ void Gastrointestinal::Initialize() if (m_data.GetConfiguration().HasDefaultStomachContents()) { // We are going to initialize the body with 2 meals so we process the default meal twice // 1 meal about 5hrs ago, and one meal at the start of the scenario - CDM_COPY((m_data.GetConfiguration().GetDefaultStomachContents()), (&GetStomachContents())); + CDM_PATIENT_NUTRITION_COPY(Nutrition, *m_data.GetConfiguration().GetDefaultStomachContents(), GetStomachContents()); m_data.GetPatient().GetWeight().IncrementValue(m_StomachContents->GetWeight(MassUnit::g), MassUnit::g); } // Cache off the initial Gut masses so we can reset back to them after stabilization @@ -97,39 +100,6 @@ void Gastrointestinal::Initialize() m_InitialSubstanceMasses_ug[m_SmallIntestineChymeUrea] = m_SmallIntestineChymeUrea->GetMass(MassUnit::ug); } -bool Gastrointestinal::Load(const CDM::BioGearsGastrointestinalSystemData& in) -{ - if (!SEGastrointestinalSystem::Load(in)) - return false; - BioGearsSystem::LoadState(); - - //Loading drug absorption/transit model states here (rather than SE side) because we want to map them to an SESubstance already defined in Sub Manager - for (auto transitData : in.DrugTransitStates()) { - SESubstance* sub = m_data.GetSubstances().GetSubstance(transitData.Substance()); - if (sub == nullptr) { - m_ss << "Unable to find substance" << transitData.Substance(); - Error(m_ss.str(), "Gastrointestinal: Load Transit Model"); - return false; - } - NewDrugTransitState(sub); - GetDrugTransitState(sub)->Load(transitData); - } - - m_DecrementNutrients = true; - return true; -} - -CDM::BioGearsGastrointestinalSystemData* Gastrointestinal::Unload() const -{ - CDM::BioGearsGastrointestinalSystemData* data = new CDM::BioGearsGastrointestinalSystemData(); - Unload(*data); - return data; -} -void Gastrointestinal::Unload(CDM::BioGearsGastrointestinalSystemData& data) const -{ - SEGastrointestinalSystem::Unload(data); -} - void Gastrointestinal::SetUp() { m_ConsumeRate = false; @@ -166,13 +136,13 @@ void Gastrointestinal::SetUp() // [0] = Stomach, [1] = Duodenum, [2] = Jejunum1, [3] = Jejunum2, [4] = Ileum1, [5] = Ileum2, [6] = Ileum3, [7] = Cecum, [8] = Colon // Stomach does not need every parameter (vol, SA), in which case we leave the value as 0 // Parameters obtained from Yang2016Application - m_TransitPH = { 3.1, 5.7, 5.8, 6.2, 6.6, 6.9, 7.4, 6.4, 6.8 }; //Stomach, duodenum, jejunum1/2 set to be halfway between fasted/fed states - m_TransitSurfaceArea_cm2 = { 0.0, 19995., 77482., 69217., 60952., 52171., 43906., 1964., 2961. }; //surface area of each segment, accounting for villi - m_TransitVolume_mL = { 50.0, 48., 175., 140., 109., 79., 56., 53., 57. }; //volume of each segment - m_TransitRate_Per_s = { 2.0 / 3600.0, 3.846 / 3600., 1.053 / 3600., 1.316 / 3600., 1.695 / 3600., 2.326 / 3600., 3.226 / 3600., 0.222 / 3600., 0.074 / 3600. }; //transit rate constant in units 1/s - m_TransitBileSalts_mM = { 0.0, 8.6, 7.25, 6.245, 4.375, 3.575, 0.435, 0., 0. }; //avg between fasted and fed states - //One exception--stomach has no enterocyte layer, so this vector is only length 8 (same length as GetEnteroycyteMasses returns) - m_EnterocyteVolumeFraction = { 7.7e-4, 1.9e-3, 1.9e-3, 1.4e-3, 1.4e-3, 1.4e-3, 4.0e-4, 8.5e-4 }; //volume of enterocyte as fraction of total body weight (assuming density = 1 g /mL) + m_TransitPH = { 3.1, 5.7, 5.8, 6.2, 6.6, 6.9, 7.4, 6.4, 6.8 }; // Stomach, duodenum, jejunum1/2 set to be halfway between fasted/fed states + m_TransitSurfaceArea_cm2 = { 0.0, 19995., 77482., 69217., 60952., 52171., 43906., 1964., 2961. }; // surface area of each segment, accounting for villi + m_TransitVolume_mL = { 50.0, 48., 175., 140., 109., 79., 56., 53., 57. }; // volume of each segment + m_TransitRate_Per_s = { 2.0 / 3600.0, 3.846 / 3600., 1.053 / 3600., 1.316 / 3600., 1.695 / 3600., 2.326 / 3600., 3.226 / 3600., 0.222 / 3600., 0.074 / 3600. }; // transit rate constant in units 1/s + m_TransitBileSalts_mM = { 0.0, 8.6, 7.25, 6.245, 4.375, 3.575, 0.435, 0., 0. }; // avg between fasted and fed states + // One exception--stomach has no enterocyte layer, so this vector is only length 8 (same length as GetEnteroycyteMasses returns) + m_EnterocyteVolumeFraction = { 7.7e-4, 1.9e-3, 1.9e-3, 1.4e-3, 1.4e-3, 1.4e-3, 4.0e-4, 8.5e-4 }; // volume of enterocyte as fraction of total body weight (assuming density = 1 g /mL) } //-------------------------------------------------------------------------------------------------- @@ -188,7 +158,7 @@ void Gastrointestinal::AtSteadyState() { if (m_data.GetState() == EngineState::AtInitialStableState) { /* - // Apply our conditions + // Apply our conditions if (m_data.GetConditions().HasConsumeMeal()) { SEMeal& meal = m_data.GetConditions().GetConsumeMeal()->GetMeal(); @@ -204,7 +174,12 @@ void Gastrointestinal::AtSteadyState() // Remove the default meal weight from the patient m_data.GetPatient().GetWeight().IncrementValue(-m_StomachContents->GetWeight(MassUnit::g), MassUnit::g); // Overwrite meal contents into our stomach - CDM_COPY((&meal), (m_StomachContents)); + + + auto* bind = (meal)->Unload(); + (m_StomachContents)->Load(*bind); + delete bind; + if (!m_StomachContents->HasWater() || m_StomachContents->GetWater().IsZero()) m_StomachContents->GetWater().SetValue(m_secretionRate_mL_Per_s*m_dT_s, VolumeUnit::mL);//Add a time steps' worth of water if empty // Increase our weight by the meal @@ -255,7 +230,7 @@ void Gastrointestinal::AtSteadyState() Info(m_ss); } #endif - // Flip it back to not decrement since we are still in stabilization + // Flip it back to not decrement since we are still in stabilization m_DecrementNutrients = false; // Based on flow, take off mass from GutChyme and put that mass throughout the body (CV/Tissues) AbsorbMeal(meal.GetElapsedTime(TimeUnit::min)); @@ -315,7 +290,7 @@ void Gastrointestinal::PreProcess() m_data.GetPatient().GetWeight().IncrementValue(c->GetNutrition().GetWeight(MassUnit::kg), MassUnit::kg); m_data.GetActions().GetPatientActions().RemoveConsumeNutrients(); } - //GastricSecretion(m_dT_s); // Move some water from the Gut EV fluids to the Stomach + // GastricSecretion(m_dT_s); // Move some water from the Gut EV fluids to the Stomach DigestNutrient(); } else { // Reset the Gut Chyme substance to their original values @@ -339,7 +314,7 @@ void Gastrointestinal::GastricSecretion(double duration_s) { // Increase the water in the stomach by the flow rate // Take it out of the tissue at the same rate it's being added to the stomach - //There is a compliance, so the volume will be modified accordingly + // There is a compliance, so the volume will be modified accordingly m_GutE3ToGroundPath->GetNextFlowSource().SetValue(m_secretionRate_mL_Per_s, VolumePerTimeUnit::mL_Per_s); m_StomachContents->GetWater().IncrementValue(m_secretionRate_mL_Per_s * duration_s, VolumeUnit::mL); } @@ -356,49 +331,49 @@ void Gastrointestinal::GastricSecretion(double duration_s) void Gastrointestinal::DigestNutrient() { double temp_mg; - //enzyme parameters for each nutrient: + // enzyme parameters for each nutrient: /// \cite gangadharan2009biochemical - //https://www.wolframalpha.com/input/?i=plot+p%3D4.11*x%2F(3.076+%2B+x)+for+x%3D7,35 + // https://www.wolframalpha.com/input/?i=plot+p%3D4.11*x%2F(3.076+%2B+x)+for+x%3D7,35 double vmaxCarbohydrate_mg_Per_min = 7.11; double kmCarbohydrate_mg = 3.076; /// \cite ohta1986purification - //https://www.wolframalpha.com/input/?i=plot+p%3D7.1*x%2F(0.71+%2B+x)+for+x%3D0,15 + // https://www.wolframalpha.com/input/?i=plot+p%3D7.1*x%2F(0.71+%2B+x)+for+x%3D0,15 double vmaxProtein_mg_Per_min = 7.1; double kmProtein_mg = 0.71; /// \cite botham1997lipolysis - //https://www.wolframalpha.com/input/?i=plot+p%3D3.40*x%2F(0.34+%2B+x)+for+x%3D0,15 + // https://www.wolframalpha.com/input/?i=plot+p%3D3.40*x%2F(0.34+%2B+x)+for+x%3D0,15 double vmaxFat_mg_Per_min = 3.40; double kmFat_mg = 0.34; - //because the stomach node is not a liquid node we compute a "concentration" from an assumed resting volume - double stomachVolume_mL = 1000.0; //average resting volume, can change between 20mL-4L so large range here - double digestedAmount = 0.0; //a temp file to compute digested amount of calcium, sodium, other ions or - double totalCheck = 0.0; //a check to make sure we have enough "stuff" to move + // because the stomach node is not a liquid node we compute a "concentration" from an assumed resting volume + double stomachVolume_mL = 1000.0; // average resting volume, can change between 20mL-4L so large range here + double digestedAmount = 0.0; // a temp file to compute digested amount of calcium, sodium, other ions or + double totalCheck = 0.0; // a check to make sure we have enough "stuff" to move double proteinConcentration_mg_Per_mL = m_StomachContents->GetProtein(MassUnit::mg) / stomachVolume_mL; double fatConcentration_mg_Per_mL = m_StomachContents->GetFat(MassUnit::mg) / stomachVolume_mL; double carbConcentration_mg_Per_mL = m_StomachContents->GetCarbohydrate(MassUnit::mg) / stomachVolume_mL; - //compute conversion rate (enzyme kinetics based on total meal in stomach): + // compute conversion rate (enzyme kinetics based on total meal in stomach): double glucoseProduct_mg_Per_min = vmaxCarbohydrate_mg_Per_min * (carbConcentration_mg_Per_mL) / (kmCarbohydrate_mg + carbConcentration_mg_Per_mL); double aminoAcidsProduct_mg_Per_min = vmaxProtein_mg_Per_min * (proteinConcentration_mg_Per_mL) / (kmProtein_mg + proteinConcentration_mg_Per_mL); double triacylglycerolProduct_mg_Per_min = vmaxFat_mg_Per_min * (fatConcentration_mg_Per_mL) / (kmFat_mg + fatConcentration_mg_Per_mL); - //compute mass depleted in stomach + // compute mass depleted in stomach double carbMassDepleted_mg = glucoseProduct_mg_Per_min * m_dT_s; //*(1 / 60.0); double proteinMassDepleted_mg = aminoAcidsProduct_mg_Per_min * m_dT_s; //*(1 / 60.0); double fatMassDepleted_mg = triacylglycerolProduct_mg_Per_min * m_dT_s; //*(1 / 60.0); - //decrement stomach contents and place into small intestine: - //carbs + // decrement stomach contents and place into small intestine: + // carbs if (m_StomachContents->GetCarbohydrate().GetValue(MassUnit::mg) > ZERO_APPROX) { if (m_StomachContents->GetCarbohydrate(MassUnit::mg) > carbMassDepleted_mg) { m_StomachContents->GetCarbohydrate().IncrementValue(-carbMassDepleted_mg, MassUnit::mg); m_SmallIntestineChymeGlucose->GetMass().IncrementValue(carbMassDepleted_mg, MassUnit::mg); } else { - //otherwise just empty the remaining contents + // otherwise just empty the remaining contents temp_mg = std::max(m_StomachContents->GetCarbohydrate(MassUnit::mg), 0.0); m_StomachContents->GetCarbohydrate().IncrementValue(-temp_mg, MassUnit::mg); m_SmallIntestineChymeGlucose->GetMass().IncrementValue(temp_mg, MassUnit::mg); @@ -406,7 +381,7 @@ void Gastrointestinal::DigestNutrient() m_SmallIntestineChymeGlucose->Balance(BalanceLiquidBy::Mass); } - //protein + // protein if (m_StomachContents->GetProtein().GetValue(MassUnit::mg) > ZERO_APPROX) { if (m_StomachContents->GetProtein(MassUnit::mg) > proteinMassDepleted_mg) { m_StomachContents->GetProtein().IncrementValue(-proteinMassDepleted_mg, MassUnit::mg); @@ -419,7 +394,7 @@ void Gastrointestinal::DigestNutrient() m_SmallIntestineChymeAminoAcids->Balance(BalanceLiquidBy::Mass); } - //fat + // fat if (m_StomachContents->GetFat().GetValue(MassUnit::mg) > ZERO_APPROX) { if (m_StomachContents->GetFat(MassUnit::mg) > fatMassDepleted_mg) { m_StomachContents->GetFat().IncrementValue(-fatMassDepleted_mg, MassUnit::mg); @@ -432,8 +407,8 @@ void Gastrointestinal::DigestNutrient() m_SmallIntestineChymeTriacylglycerol->Balance(BalanceLiquidBy::Mass); } - //handle transfer of remaining substances: - //calcium + // handle transfer of remaining substances: + // calcium if (m_StomachContents->HasCalcium()) { totalCheck = m_StomachContents->GetCalcium(MassUnit::mg); digestedAmount = m_CalciumDigestionRate.GetValue(MassPerTimeUnit::mg_Per_s) * m_dT_s; @@ -443,13 +418,13 @@ void Gastrointestinal::DigestNutrient() m_ss << "Digested " << digestedAmount << "(g) of Calcium"; Info(m_ss); #endif - m_StomachContents->GetCalcium().IncrementValue(-digestedAmount, (const MassUnit&)MassUnit::g); //TODO: DEBUG THIS + m_StomachContents->GetCalcium().IncrementValue(-digestedAmount, (const MassUnit&)MassUnit::g); // TODO: DEBUG THIS m_SmallIntestineChymeCalcium->GetMass().IncrementValue(digestedAmount, MassUnit::mg); m_SmallIntestineChymeCalcium->Balance(BalanceLiquidBy::Mass); } } - //sodium + // sodium if (m_StomachContents->HasSodium()) { // Sodium rate is a function of the concentration of sodium in the stomach, so do this before we do water totalCheck = m_StomachContents->GetSodium(MassUnit::g); double digestedNa_g = (totalCheck / m_StomachContents->GetWater(VolumeUnit::mL)) @@ -505,36 +480,36 @@ void Gastrointestinal::DigestNutrient() void Gastrointestinal::AbsorbNutrients() { - //parameters for sodium absorption + // parameters for sodium absorption double sodiumAbsorptionVmax_g_Per_h = 9.0; - double sodiumAbsorptionKm_g = 2.0; //https://www.wolframalpha.com/input/?i=plot+p%3D10.0*x%2F(2.0+%2B+x)+for+x%3D0,15 + double sodiumAbsorptionKm_g = 2.0; // https://www.wolframalpha.com/input/?i=plot+p%3D10.0*x%2F(2.0+%2B+x)+for+x%3D0,15 double sodiumAbsorption_g_Per_h = 0.0; double sodiumAbsorbed_g = 0.0; double smallIntestineVolume_mL = m_SmallIntestineChyme->GetVolume(VolumeUnit::mL); - //parameters for nutrient absorption: + // parameters for nutrient absorption: double glucoseAbsorbed_g = 0.0; double aminoAcidAbsorbed_g = 0.0; double tempAbsorbed_g = 0.0; double intestineFatAbsorption_mg_Per_s = (0.019) * 100.0; // This is scaled from rat data, 1 g avg rat meal to 30g average human meal in fat. /// \cite aberdeen1960concurrent double triacylglycerolAbsorbed_mg = intestineFatAbsorption_mg_Per_s * m_dT_s; - //access the chyme mass of our nutrients: + // access the chyme mass of our nutrients: double massNutrients_g = std::max(std::max(m_SmallIntestineChymeAminoAcids->GetMass().GetValue(MassUnit::g), m_SmallIntestineChymeGlucose->GetMass().GetValue(MassUnit::g)), std::max(m_SmallIntestineChymeAminoAcids->GetMass().GetValue(MassUnit::g), m_SmallIntestineChymeTriacylglycerol->GetMass().GetValue(MassUnit::g))); - //compute the hill function sodium absorption + // compute the hill function sodium absorption sodiumAbsorption_g_Per_h = sodiumAbsorptionVmax_g_Per_h * (massNutrients_g / (sodiumAbsorptionKm_g + massNutrients_g)); - //compute mass moved: + // compute mass moved: sodiumAbsorbed_g = sodiumAbsorption_g_Per_h * (1.0 / 3600.0) * m_dT_s; - //compute nutrient absorption from new absorbed values (same co-transporter assumption here): + // compute nutrient absorption from new absorbed values (same co-transporter assumption here): glucoseAbsorbed_g = 2.0 * sodiumAbsorbed_g; aminoAcidAbsorbed_g = sodiumAbsorbed_g; - //move nutrients, glucose + // move nutrients, glucose if (m_SmallIntestineChymeGlucose->GetMass().GetValue(MassUnit::mg) > ZERO_APPROX) { if (m_SmallIntestineChymeGlucose->GetMass().GetValue(MassUnit::g) > glucoseAbsorbed_g && m_SmallIntestineChymeSodium->GetMass().GetValue(MassUnit::g) > sodiumAbsorbed_g) { m_SmallIntestineChymeSodium->GetMass().IncrementValue(-sodiumAbsorbed_g, MassUnit::g); @@ -545,7 +520,7 @@ void Gastrointestinal::AbsorbNutrients() } } - //protein + // protein if (m_SmallIntestineChymeAminoAcids->GetMass().GetValue(MassUnit::mg) > ZERO_APPROX) { if (m_SmallIntestineChymeAminoAcids->GetMass().GetValue(MassUnit::g) > aminoAcidAbsorbed_g && m_SmallIntestineChymeSodium->GetMass().GetValue(MassUnit::g) > sodiumAbsorbed_g) { m_SmallIntestineChymeSodium->GetMass().IncrementValue(-sodiumAbsorbed_g, MassUnit::g); @@ -556,7 +531,7 @@ void Gastrointestinal::AbsorbNutrients() } } - //fat + // fat if (m_SmallIntestineChymeTriacylglycerol->GetMass().GetValue(MassUnit::mg) > ZERO_APPROX) { if (m_SmallIntestineChymeTriacylglycerol->GetMass().GetValue(MassUnit::mg) > triacylglycerolAbsorbed_mg) { m_SmallIntestineChymeTriacylglycerol->GetMass().IncrementValue(-triacylglycerolAbsorbed_mg, MassUnit::mg); @@ -567,12 +542,12 @@ void Gastrointestinal::AbsorbNutrients() } } - //compute absorption rate as a function of volume in intestine - double absorptionRate_mL_Per_min = 0.0; //3.3; // Average water absorption rate Peronnet + // compute absorption rate as a function of volume in intestine + double absorptionRate_mL_Per_min = 0.0; // 3.3; // Average water absorption rate Peronnet absorptionRate_mL_Per_min = GeneralMath::LogisticFunction(13, 500, 0.007, smallIntestineVolume_mL); double absorbedVolume_mL = absorptionRate_mL_Per_min / 60.0 * m_dT_s; - //move fluid + // move fluid if (m_data.GetState() == EngineState::Active) { // Don't Remove volume while stabilizing if (smallIntestineVolume_mL > absorbedVolume_mL) { m_GItoCVPath->GetNextFlowSource().SetValue(absorptionRate_mL_Per_min, VolumePerTimeUnit::mL_Per_min); @@ -580,11 +555,11 @@ void Gastrointestinal::AbsorbNutrients() } }; - //only move sodium independently if it wasn't moved through the co-transporter + // only move sodium independently if it wasn't moved through the co-transporter if (sodiumAbsorbed_g < ZERO_APPROX) { double ionMassMoved_mg = m_SmallIntestineChymeSodium->GetConcentration().GetValue(MassPerVolumeUnit::mg_Per_mL) * absorbedVolume_mL; - //substance connect ions to flow rate when nutrients aren't present, needs to have volume present + // substance connect ions to flow rate when nutrients aren't present, needs to have volume present if (m_SmallIntestineChymeSodium->GetMass().GetValue(MassUnit::mg) > ionMassMoved_mg && m_SmallIntestineChyme->GetVolume(VolumeUnit::mL) > absorbedVolume_mL) { m_SmallIntestineChymeSodium->GetMass().IncrementValue(-ionMassMoved_mg, MassUnit::mg); m_SmallIntestineVascularSodium->GetMass().IncrementValue(ionMassMoved_mg, MassUnit::mg); @@ -594,7 +569,7 @@ void Gastrointestinal::AbsorbNutrients() } double ionCalciumMassMoved_mg = m_SmallIntestineChymeCalcium->GetConcentration().GetValue(MassPerVolumeUnit::mg_Per_mL) * absorbedVolume_mL; - //Move calcium regardless + // Move calcium regardless if (m_SmallIntestineChymeCalcium->GetMass().GetValue(MassUnit::mg) > ionCalciumMassMoved_mg) { m_SmallIntestineChymeCalcium->GetMass().IncrementValue(-ionCalciumMassMoved_mg, MassUnit::mg); m_SmallIntestineVascularCalcium->GetMass().IncrementValue(ionCalciumMassMoved_mg, MassUnit::mg); @@ -632,7 +607,7 @@ void Gastrointestinal::AbsorbNutrients(double duration_s) double siVolume_mL = m_SmallIntestineChyme->GetVolume().GetValue(VolumeUnit::mL); if (siVolume_mL <= 0) { absorptionRate_mL_Per_min = 0; // No volume, no flow - } else if (absorbedVolume_mL > siVolume_mL) { //Only take what we have + } else if (absorbedVolume_mL > siVolume_mL) { // Only take what we have absorbedVolume_mL = siVolume_mL; absorptionRate_mL_Per_min = 60 * (absorbedVolume_mL / duration_s); } @@ -647,9 +622,9 @@ void Gastrointestinal::AbsorbNutrients(double duration_s) } GetChymeAbsorptionRate().SetValue(absorptionRate_mL_Per_min, VolumePerTimeUnit::mL_Per_min); - //This will move substances + // This will move substances m_GItoCVPath->GetNextFlowSource().SetValue(absorptionRate_mL_Per_min, VolumePerTimeUnit::mL_Per_min); - //Need to manually remove volume, since there isn't a compliance + // Need to manually remove volume, since there isn't a compliance m_GItoCVPath->GetSourceNode().GetNextVolume().IncrementValue(-absorptionRate_mL_Per_min / 60.0 * m_dT_s, VolumeUnit::mL); } @@ -664,24 +639,24 @@ void Gastrointestinal::AbsorbNutrients(double duration_s) //-------------------------------------------------------------------------------------------------- void Gastrointestinal::ChymeSecretion() { - //sigmoidal secretion as a function of nutrient content in the chyme + // sigmoidal secretion as a function of nutrient content in the chyme double sodiumSecretionVmax_g_Per_h = 5.0; double sodiumSecretionKm_g = 0.2; double sodiumSecretion_g_Per_h = 0.0; double sodiumSecreted_g = 0.0; double temp_g = 0.0; - //access the chyme mass of our nutrients: + // access the chyme mass of our nutrients: double massNutrients_g = std::max(std::max(m_SmallIntestineChymeAminoAcids->GetMass().GetValue(MassUnit::g), m_SmallIntestineChymeGlucose->GetMass().GetValue(MassUnit::g)), m_SmallIntestineChymeAminoAcids->GetMass().GetValue(MassUnit::g)); - //compute the secretion of salt into the intestine: + // compute the secretion of salt into the intestine: sodiumSecretion_g_Per_h = sodiumSecretionVmax_g_Per_h * (massNutrients_g / (sodiumSecretionKm_g + massNutrients_g)); - //compute mass moved: + // compute mass moved: sodiumSecreted_g = sodiumSecretion_g_Per_h * (1.0 / 3600.0) * m_dT_s; - //move sodium from vascular into the chyme compartment + // move sodium from vascular into the chyme compartment if (sodiumSecreted_g > 0.0) { if (m_SmallIntestineVascularSodium->GetMass().GetValue(MassUnit::g) > sodiumSecreted_g) { m_SmallIntestineVascularSodium->GetMass().IncrementValue(-sodiumSecreted_g, MassUnit::g); @@ -731,7 +706,7 @@ void Gastrointestinal::AbsorbMeal(double duration_min) SEScalarVolume absorbedVolume; absorbedVolume.SetValue(absorbedVolume_mL, VolumeUnit::mL); -//m_data.GetCircuits().DistributeVolume(absorbedVolume); +// m_data.GetCircuits().DistributeVolume(absorbedVolume); #ifdef logMeal double newtotVol_mL = m_data.GetBloodChemistry()->GetExtravascularFluidVolume()->GetValue(VolumeUnit::mL); newtotVol_mL += m_data.GetCardiovascular()->GetBloodVolume()->GetValue(VolumeUnit::mL); @@ -852,83 +827,83 @@ void Gastrointestinal::ProcessDrugCAT() cat = catState.second; //-----------------------------Model Parameters---------------------------------------- - //GI + // GI const double villousBloodFlow_mL_Per_s = 5.0; const double fBlood = 1.0 / 8.0; - const double bodyMass_g = m_data.GetPatient().GetWeight(MassUnit::g); //Used to estimate enterocyte volume, assuming density 1.0 g/mL - //Physiochemical data + const double bodyMass_g = m_data.GetPatient().GetWeight(MassUnit::g); // Used to estimate enterocyte volume, assuming density 1.0 g/mL + // Physiochemical data const SESubstancePhysicochemical* subData = sub->GetPK()->GetPhysicochemicals(); - const CDM::enumSubstanceIonicState ionState = sub->GetPK()->GetPhysicochemicals()->GetIonicState(); + const SESubstanceIonicState ionState = sub->GetPK()->GetPhysicochemicals()->GetIonicState(); const double hydrogenBondCount = subData->GetHydrogenBondCount(); const double polarSurfaceArea = subData->GetPolarSurfaceArea(); const double logP = subData->GetLogP(); const double pKa = subData->GetPrimaryPKA(); - double pKa2 = 0; //Only used for Zwitterions--can't set const because we need to reset it in switch/case below + double pKa2 = 0; // Only used for Zwitterions--can't set const because we need to reset it in switch/case below const double molarMass_g_Per_mol = sub->GetMolarMass(MassPerAmountUnit::g_Per_mol); - double gutKP = 1.0; //First time step, we won't have the tissue kinetics defined yet + double gutKP = 1.0; // First time step, we won't have the tissue kinetics defined yet if (sub->GetPK()->HasTissueKinetics()) { if (sub->GetPK()->GetTissueKinetics(BGE::TissueCompartment::Gut)->HasPartitionCoefficient()) { gutKP = sub->GetPK()->GetTissueKinetics(BGE::TissueCompartment::Gut)->GetPartitionCoefficient(); } } double fMetabolized = 0.0; - if (sub->GetName() == "Fentanyl") { - fMetabolized = 0.20; //If more drugs needs this we can think about adding it to substance clearance schema + if (sub->GetName() == StandardSubstances::Fentanyl) { + fMetabolized = 0.20; // If more drugs needs this we can think about adding it to substance clearance schema } - //Dissolution data - const double particleRadius_cm = 5.0e-4; //default for now - const double subDensity_g_Per_mL = 1.0; //default for now - const double diffCoeff_cm2_Per_s = 9.9e-5 * std::pow(molarMass_g_Per_mol, -0.453); //Ando2015New + // Dissolution data + const double particleRadius_cm = 5.0e-4; // default for now + const double subDensity_g_Per_mL = 1.0; // default for now + const double diffCoeff_cm2_Per_s = 9.9e-5 * std::pow(molarMass_g_Per_mol, -0.453); // Ando2015New const double diffusionLayer_cm = 30.0e-4; - const double dissolutionCoeff_mL_Per_s_ug = 3.0 * diffCoeff_cm2_Per_s / (subDensity_g_Per_mL * particleRadius_cm * diffusionLayer_cm) * 1.e-6; //Noyes-Whitney coefficient, 1e-6 factor converts g to ug basis - //Permeability and solubility--Use relationship from Wolk2019Segmental (perm) and Yang2016Appliation (sol) - const double A = 3.67e-5, B = 3.45e-5, C = -1.04e-7, D = -5.48e-6, E = -2.3e-8, F = 1.46e-4; //Permeability constants - const double constTerms = A * logP + C * molarMass_g_Per_mol + D * hydrogenBondCount + E * polarSurfaceArea + F; //This part of permeability equation is constant across small intestine - const double solWaterStd_ug_Per_mL = 5.0e3; //Tuned do that dissolution of moxifloxacin happens in ~15 min - const double solubilityRatio = std::pow(10.0, 0.606 * logP + 2.234); //Yang2016Application - std::vector fracUnionized; //fraction of drug un-ionized in each GI compartment - std::vector permeability_cm_Per_s; //drug permeability in each GI compartment + const double dissolutionCoeff_mL_Per_s_ug = 3.0 * diffCoeff_cm2_Per_s / (subDensity_g_Per_mL * particleRadius_cm * diffusionLayer_cm) * 1.e-6; // Noyes-Whitney coefficient, 1e-6 factor converts g to ug basis + // Permeability and solubility--Use relationship from Wolk2019Segmental (perm) and Yang2016Appliation (sol) + const double A = 3.67e-5, B = 3.45e-5, C = -1.04e-7, D = -5.48e-6, E = -2.3e-8, F = 1.46e-4; // Permeability constants + const double constTerms = A * logP + C * molarMass_g_Per_mol + D * hydrogenBondCount + E * polarSurfaceArea + F; // This part of permeability equation is constant across small intestine + const double solWaterStd_ug_Per_mL = 5.0e3; // Tuned do that dissolution of moxifloxacin happens in ~15 min + const double solubilityRatio = std::pow(10.0, 0.606 * logP + 2.234); // Yang2016Application + std::vector fracUnionized; // fraction of drug un-ionized in each GI compartment + std::vector permeability_cm_Per_s; // drug permeability in each GI compartment std::vector solubility_ug_Per_mL; double fUnionized = 0.0; double solWaterAdjusted_ug_Per_mL = 0.0; double solBileSalts_ug_Per_mL = 0.0; double solubilityCapacity = 0.0; double ionTerm = 0.0; - //Zwitterion constant--our only Zwitterion is Moxifloxacin. If this changes, we need to make these values substance specific! See Langlois2004 for microconstant data + // Zwitterion constant--our only Zwitterion is Moxifloxacin. If this changes, we need to make these values substance specific! See Langlois2004 for microconstant data double logk11 = -7.46; //------------------------------Calculate location specific ionization, permeability, and solubility----------------------- std::vector::iterator phIt; std::vector::iterator solIt; for (phIt = m_TransitPH.begin(), solIt = m_TransitBileSalts_mM.begin(); phIt != m_TransitPH.end() && solIt != m_TransitBileSalts_mM.end(); ++phIt, ++solIt) { - //Permeability + // Permeability switch (ionState) { - case CDM::enumSubstanceIonicState::Acid: + case SESubstanceIonicState::Acid: ionTerm = 1.0 + std::pow(10.0, *phIt - pKa); break; - case CDM::enumSubstanceIonicState::WeakBase: - //Intentionally blank w/o break statement-->this way weak base and base flow to same place (same equation used) - case CDM::enumSubstanceIonicState::Base: + case SESubstanceIonicState::WeakBase: + // Intentionally blank w/o break statement-->this way weak base and base flow to same place (same equation used) + case SESubstanceIonicState::Base: ionTerm = 1.0 + std::pow(10.0, pKa - *phIt); break; - case CDM::enumSubstanceIonicState::Zwitterion: + case SESubstanceIonicState::Zwitterion: if (!subData->HasSecondaryPKA()) { std::stringstream ss; ss << "Gastrointestinal::ProcessCAT: Zwitterions needs two pKa's defined" << std::endl; Error(ss); } pKa2 = subData->GetSecondaryPKA(); - //This tells us what fraction is in the zwitterionic form (as opposed to fully deprotonated or fully protonated) + // This tells us what fraction is in the zwitterionic form (as opposed to fully deprotonated or fully protonated) ionTerm = (std::pow(10.0, -pKa - pKa2) + std::pow(10.0, -pKa - *phIt) + std::pow(10.0, -2 * (*phIt))) / (std::pow(10.0, logk11 - *phIt)); break; default: ionTerm = 1.0; } fracUnionized.push_back(1.0 / ionTerm); - permeability_cm_Per_s.push_back(constTerms + B * std::log10(1.0 / ionTerm)); //Note that this gives us a "stomach permeability" that we do not use - //Solubility--could look at Ando2015New for this as well + permeability_cm_Per_s.push_back(constTerms + B * std::log10(1.0 / ionTerm)); // Note that this gives us a "stomach permeability" that we do not use + // Solubility--could look at Ando2015New for this as well solWaterAdjusted_ug_Per_mL = std::pow(10.0, std::log10(solWaterStd_ug_Per_mL) + std::log10(ionTerm)); - //Using std sol instead of adjusting because there are some weird pH effects going on that need to be investigated further + // Using std sol instead of adjusting because there are some weird pH effects going on that need to be investigated further solubilityCapacity = solWaterStd_ug_Per_mL * (18.0 / molarMass_g_Per_mol) * 1.0e-6; solBileSalts_ug_Per_mL = solubilityRatio * solubilityCapacity * molarMass_g_Per_mol * (*solIt); solubility_ug_Per_mL.push_back(solWaterStd_ug_Per_mL + solBileSalts_ug_Per_mL); @@ -941,11 +916,11 @@ void Gastrointestinal::ProcessDrugCAT() double gutVasculatureConcentration_ug_Per_mL = 0.0; if (m_vSmallIntestine->HasSubstanceQuantity(*sub)) gutVasculatureConcentration_ug_Per_mL = m_vSmallIntestine->GetSubstanceQuantity(*sub)->GetConcentration(MassPerVolumeUnit::ug_Per_mL); - //Differential containers + // Differential containers std::vector dLumenSolidMass_ug_Per_s(lumenSolidMasses_ug.size()); std::vector dLumenDissolvedMass_ug_Per_s(lumenDissolvedMasses_ug.size()); std::vector dEnterocyteMass_ug_Per_s(enterocyteMasses_ug.size()); - //Intermediate values + // Intermediate values double solidDissolutionRate_ug_Per_s = 0.0; double permeationToEnterocyte_ug_Per_s = 0.0; double enterocyteToPortal_ug_Per_s = 0.0; @@ -955,13 +930,13 @@ void Gastrointestinal::ProcessDrugCAT() double totalMetabolized_ug_Per_s = 0.0; //---------------------------------State Equations------------------------------- - //Stomach--format of equations is different so needs to be separate + // Stomach--format of equations is different so needs to be separate solidDissolutionRate_ug_Per_s = dissolutionCoeff_mL_Per_s_ug * lumenSolidMasses_ug[0] * (solubility_ug_Per_mL[0] - lumenDissolvedMasses_ug[0] / m_TransitVolume_mL[0]); dLumenSolidMass_ug_Per_s[0] = -solidDissolutionRate_ug_Per_s - m_TransitRate_Per_s[0] * lumenSolidMasses_ug[0]; dLumenDissolvedMass_ug_Per_s[0] = solidDissolutionRate_ug_Per_s - m_TransitRate_Per_s[0] * lumenDissolvedMasses_ug[0]; - //Equations for all other compartments are identical, can be looped - size_t lumenPos; //Position in lumen compartment vectors: Start at 1 because we already did the stomach (element 0 in lumen vector) - size_t entPos; //Position in enterocyte vectors: Will start at 0 because it has no stomach component, it starts at duodenum + // Equations for all other compartments are identical, can be looped + size_t lumenPos; // Position in lumen compartment vectors: Start at 1 because we already did the stomach (element 0 in lumen vector) + size_t entPos; // Position in enterocyte vectors: Will start at 0 because it has no stomach component, it starts at duodenum for (lumenPos = 1, entPos = 0; lumenPos < lumenSolidMasses_ug.size() && entPos < enterocyteMasses_ug.size(); ++lumenPos, ++entPos) { solidDissolutionRate_ug_Per_s = dissolutionCoeff_mL_Per_s_ug * lumenSolidMasses_ug[lumenPos] * (solubility_ug_Per_mL[lumenPos] - lumenDissolvedMasses_ug[lumenPos] / m_TransitVolume_mL[lumenPos]); permeationToEnterocyte_ug_Per_s = permeability_cm_Per_s[lumenPos] * m_TransitSurfaceArea_cm2[lumenPos] * fracUnionized[lumenPos] * (lumenDissolvedMasses_ug[lumenPos] / m_TransitVolume_mL[lumenPos] - enterocyteMasses_ug[entPos] / (m_EnterocyteVolumeFraction[entPos] * bodyMass_g)); @@ -972,15 +947,15 @@ void Gastrointestinal::ProcessDrugCAT() totalMetabolized_ug_Per_s += massMetabolized_ug_Per_s; totalEffluxToPortal_ug_Per_s += (enterocyteToPortal_ug_Per_s - portalToEnterocyte_ug_Per_s); - //For solids: deltaM = rate influx from previous cmpt - rate efflux - rate solid dissolution + // For solids: deltaM = rate influx from previous cmpt - rate efflux - rate solid dissolution dLumenSolidMass_ug_Per_s[lumenPos] = lumenSolidMasses_ug[lumenPos - 1] * m_TransitRate_Per_s[lumenPos - 1] - lumenSolidMasses_ug[lumenPos] * m_TransitRate_Per_s[lumenPos] - solidDissolutionRate_ug_Per_s; - //For dissolved: deltaM = rate influx from previous compt + rate solid dissolution - rate efflux - rate permeated to enterocytes + // For dissolved: deltaM = rate influx from previous compt + rate solid dissolution - rate efflux - rate permeated to enterocytes dLumenDissolvedMass_ug_Per_s[lumenPos] = lumenDissolvedMasses_ug[lumenPos - 1] * m_TransitRate_Per_s[lumenPos - 1] + solidDissolutionRate_ug_Per_s - lumenDissolvedMasses_ug[lumenPos] * m_TransitRate_Per_s[lumenPos] - permeationToEnterocyte_ug_Per_s; - //For enterocyte: deltaM = rate permeation from lumen + rate influx from portal - rate efflux to portal - rate metabolized + // For enterocyte: deltaM = rate permeation from lumen + rate influx from portal - rate efflux to portal - rate metabolized dEnterocyteMass_ug_Per_s[entPos] = permeationToEnterocyte_ug_Per_s + portalToEnterocyte_ug_Per_s - enterocyteToPortal_ug_Per_s - massMetabolized_ug_Per_s; } - //Update states + // Update states const double dT_s = m_data.GetTimeStep().GetValue(TimeUnit::s); for (lumenPos = 0; lumenPos < lumenSolidMasses_ug.size(); ++lumenPos) { lumenSolidMasses_ug[lumenPos] += dLumenSolidMass_ug_Per_s[lumenPos] * dT_s; diff --git a/projects/biogears/libBiogears/src/engine/Systems/Hepatic.cpp b/projects/biogears/libBiogears/src/engine/Systems/Hepatic.cpp index f5be0e720..f5dc59fa8 100644 --- a/projects/biogears/libBiogears/src/engine/Systems/Hepatic.cpp +++ b/projects/biogears/libBiogears/src/engine/Systems/Hepatic.cpp @@ -12,6 +12,8 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/Physiology.h" + #include #include #include @@ -22,7 +24,7 @@ specific language governing permissions and limitations under the License. #include #include -namespace BGE = mil::tatrc::physiology::biogears; + namespace biogears { auto Hepatic::make_unique(BioGears& bg) -> std::unique_ptr @@ -34,17 +36,17 @@ Hepatic::Hepatic(BioGears& bg) : SEHepaticSystem(bg.GetLogger()) , m_data(bg) { - Clear(); + Invalidate(); } Hepatic::~Hepatic() { - Clear(); + Invalidate(); } -void Hepatic::Clear() +void Hepatic::Invalidate() { - SEHepaticSystem::Clear(); + SEHepaticSystem::Invalidate(); m_liverInsulin = nullptr; m_liverGlucagon = nullptr; m_liverVascularGlucose = nullptr; @@ -88,26 +90,6 @@ void Hepatic::Initialize() GetHepaticGluconeogenesisRate().SetValue(180, MassPerTimeUnit::g_Per_day); } -bool Hepatic::Load(const CDM::BioGearsHepaticSystemData& in) -{ - if (!SEHepaticSystem::Load(in)) - return false; - - BioGearsSystem::LoadState(); - - return true; -} -CDM::BioGearsHepaticSystemData* Hepatic::Unload() const -{ - CDM::BioGearsHepaticSystemData* data = new CDM::BioGearsHepaticSystemData(); - Unload(*data); - return data; -} -void Hepatic::Unload(CDM::BioGearsHepaticSystemData& data) const -{ - SEHepaticSystem::Unload(data); -} - //-------------------------------------------------------------------------------------------------- /// \brief /// Initializes parameters for the Hepatic Class diff --git a/projects/biogears/libBiogears/src/engine/Systems/Nervous.cpp b/projects/biogears/libBiogears/src/engine/Systems/Nervous.cpp index d90b7fa47..4fd602648 100644 --- a/projects/biogears/libBiogears/src/engine/Systems/Nervous.cpp +++ b/projects/biogears/libBiogears/src/engine/Systems/Nervous.cpp @@ -11,6 +11,8 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Physiology.h" + #include #include #include @@ -35,7 +37,7 @@ specific language governing permissions and limitations under the License. #include #include "biogears/math/angles.h" -namespace BGE = mil::tatrc::physiology::biogears; + #pragma warning(disable : 4786) #pragma warning(disable : 4275) @@ -51,17 +53,17 @@ Nervous::Nervous(BioGears& bg) : SENervousSystem(bg.GetLogger()) , m_data(bg) { - Clear(); + Invalidate(); } Nervous::~Nervous() { - Clear(); + Invalidate(); } -void Nervous::Clear() +void Nervous::Invalidate() { - SENervousSystem::Clear(); + SENervousSystem::Invalidate(); m_Patient = nullptr; m_Succinylcholine = nullptr; @@ -79,7 +81,7 @@ void Nervous::Initialize() BioGearsSystem::Initialize(); m_FeedbackActive = false; m_blockActive = false; - SetSleepState(CDM::enumSleepState::Awake); //patient always starts awake + SetSleepState(SESleepState::Awake); //patient always starts awake m_AfferentChemoreceptor_Hz = 3.55; m_AfferentPulmonaryStretchReceptor_Hz = 12.0; m_AorticBaroreceptorStrain = 0.04226; @@ -153,123 +155,6 @@ void Nervous::Initialize() } -bool Nervous::Load(const CDM::BioGearsNervousSystemData& in) -{ - if (!SENervousSystem::Load(in)) - return false; - BioGearsSystem::LoadState(); - // We assume state have to be after all stabilization - m_FeedbackActive = true; - - m_AfferentChemoreceptor_Hz = in.AfferentChemoreceptor_Hz(); - m_AfferentPulmonaryStretchReceptor_Hz = in.AfferentPulmonaryStrechReceptor_Hz(); - m_AorticBaroreceptorStrain = in.AorticBaroreceptorStrain(); - m_ArterialCarbonDioxideBaseline_mmHg = in.ArterialCarbonDioxideBaseline_mmHg(); - m_ArterialOxygenBaseline_mmHg = in.ArterialOxygenBaseline_mmHg(); - m_BaroreceptorOperatingPoint_mmHg = in.BaroreceptorOperatingPoint_mmHg(); - m_CardiopulmonaryInputBaseline_mmHg = in.CardiopulmonaryInputBaseline_mmHg(); - m_CardiopulmonaryInput_mmHg = in.CardiopulmonaryInput_mmHg(); - m_CarotidBaroreceptorStrain = in.CarotidBaroreceptorStrain(); - m_CentralFrequencyDelta_Per_min = in.CentralFrequencyDelta_Per_min(); - m_CentralPressureDelta_cmH2O = in.CentralPressureDelta_cmH2O(); - m_CerebralArteriesEffectors_Large.clear(); - for (auto effectorLarge : in.CerebralArteriesEffectors_Large()) { - m_CerebralArteriesEffectors_Large.push_back(effectorLarge); - } - m_CerebralArteriesEffectors_Small.clear(); - for (auto effectorSmall : in.CerebralArteriesEffectors_Small()) { - m_CerebralArteriesEffectors_Small.push_back(effectorSmall); - } - m_CerebralBloodFlowBaseline_mL_Per_s = in.CerebralBloodFlowBaseline_mL_Per_s(); - m_CerebralBloodFlowInput_mL_Per_s = in.CerebralBloodFlowInput_mL_Per_s(); - m_CerebralOxygenSaturationBaseline = in.CerebralOxygenSaturationBaseline(); - m_CerebralPerfusionPressureBaseline_mmHg = in.CerebralPerfusionPressureBaseline_mmHg(); - m_ChemoreceptorFiringRateSetPoint_Hz = in.ChemoreceptorFiringRateSetPoint_Hz(); - m_ComplianceModifier = in.ComplianceModifier(); - m_HeartElastanceModifier = in.HeartElastanceModifier(); - m_HeartOxygenBaseline = in.HeartOxygenBaseline(); - m_HeartRateModifierSympathetic = in.HeartRateModifierSympathetic(); - m_HeartRateModifierVagal = in.HeartRateModifierVagal(); - m_HypercapniaThresholdHeart = in.HypercapniaThresholdHeart(); - m_HypercapniaThresholdPeripheral = in.HypercapniaThresholdPeripheral(); - m_HypoxiaThresholdHeart = in.HypoxiaThresholdHeart(); - m_HypoxiaThresholdPeripheral = in.HypoxiaThresholdPeripheral(); - m_MeanLungVolume_L = in.MeanLungVolume_L(); - m_MuscleOxygenBaseline = in.MuscleOxygenBaseline(); - m_OxygenAutoregulatorHeart = in.OxygenAutoregulatorHeart(); - m_OxygenAutoregulatorMuscle = in.OxygenAutoregulatorMuscle(); - m_PeripheralBloodGasInteractionBaseline_Hz = in.ChemoreceptorPeripheralBloodGasInteractionBaseline_Hz(); - m_PeripheralFrequencyDelta_Per_min = in.PeripheralFrequencyDelta_Per_min(); - m_PeripheralPressureDelta_cmH2O = in.PeripheralPressureDelta_cmH2O(); - m_ResistanceModifierExtrasplanchnic = in.ResistanceModifierExtrasplanchnic(); - m_ResistanceModifierMuscle = in.ResistanceModifierMuscle(); - m_ResistanceModifierSplanchnic = in.ResistanceModifierSplanchnic(); - m_SympatheticPeripheralSignalBaseline_Hz = in.SympatheticPeripheralSignalBaseline(); - m_SympatheticSinoatrialSignalBaseline_Hz = in.SympatheticSinoatrialSignalBaseline(); - m_SympatheticPeripheralSignalFatigue = in.SympatheticPeripheralSignalFatigue(); - m_VagalSignalBaseline_Hz = in.VagalSignalBaseline(); - - return true; -} -CDM::BioGearsNervousSystemData* Nervous::Unload() const -{ - CDM::BioGearsNervousSystemData* data = new CDM::BioGearsNervousSystemData(); - Unload(*data); - return data; -} -void Nervous::Unload(CDM::BioGearsNervousSystemData& data) const -{ - SENervousSystem::Unload(data); - data.AfferentChemoreceptor_Hz(m_AfferentChemoreceptor_Hz); - data.AfferentPulmonaryStrechReceptor_Hz(m_AfferentPulmonaryStretchReceptor_Hz); - data.AorticBaroreceptorStrain(m_AorticBaroreceptorStrain); - data.AttentionLapses(m_AttentionLapses); - data.ArterialCarbonDioxideBaseline_mmHg(m_ArterialCarbonDioxideBaseline_mmHg); - data.ArterialOxygenBaseline_mmHg(m_ArterialOxygenBaseline_mmHg); - data.BaroreceptorOperatingPoint_mmHg(m_BaroreceptorOperatingPoint_mmHg); - data.BiologicalDebt(m_BiologicalDebt); - data.CardiopulmonaryInputBaseline_mmHg(m_CardiopulmonaryInputBaseline_mmHg); - data.CardiopulmonaryInput_mmHg(m_CardiopulmonaryInput_mmHg); - data.CarotidBaroreceptorStrain(m_CarotidBaroreceptorStrain); - data.CentralFrequencyDelta_Per_min(m_CentralFrequencyDelta_Per_min); - data.CentralPressureDelta_cmH2O(m_CentralPressureDelta_cmH2O); - for (auto eLarge : m_CerebralArteriesEffectors_Large) { - data.CerebralArteriesEffectors_Large().push_back(eLarge); - } - for (auto eSmall : m_CerebralArteriesEffectors_Small) { - data.CerebralArteriesEffectors_Small().push_back(eSmall); - } - - data.CerebralBloodFlowBaseline_mL_Per_s(m_CerebralBloodFlowBaseline_mL_Per_s); - data.CerebralBloodFlowInput_mL_Per_s(m_CerebralBloodFlowInput_mL_Per_s); - data.CerebralOxygenSaturationBaseline(m_CerebralOxygenSaturationBaseline); - data.CerebralPerfusionPressureBaseline_mmHg(m_CerebralPerfusionPressureBaseline_mmHg); - data.ChemoreceptorFiringRateSetPoint_Hz(m_ChemoreceptorFiringRateSetPoint_Hz); - data.ChemoreceptorPeripheralBloodGasInteractionBaseline_Hz(m_PeripheralBloodGasInteractionBaseline_Hz); - data.ComplianceModifier(m_ComplianceModifier); - data.HeartElastanceModifier(m_HeartElastanceModifier); - data.HeartOxygenBaseline(m_HeartOxygenBaseline); - data.HeartRateModifierSympathetic(m_HeartRateModifierSympathetic); - data.HeartRateModifierVagal(m_HeartRateModifierVagal); - data.HypercapniaThresholdHeart(m_HypercapniaThresholdHeart); - data.HypercapniaThresholdPeripheral(m_HypercapniaThresholdPeripheral); - data.HypoxiaThresholdHeart(m_HypoxiaThresholdHeart); - data.HypoxiaThresholdPeripheral(m_HypoxiaThresholdPeripheral); - data.MeanLungVolume_L(m_MeanLungVolume_L); - data.MuscleOxygenBaseline(m_MuscleOxygenBaseline); - data.OxygenAutoregulatorHeart(m_OxygenAutoregulatorHeart); - data.OxygenAutoregulatorMuscle(m_OxygenAutoregulatorMuscle); - data.PeripheralFrequencyDelta_Per_min(m_PeripheralFrequencyDelta_Per_min); - data.PeripheralPressureDelta_cmH2O(m_PeripheralPressureDelta_cmH2O); - data.ResistanceModifierExtrasplanchnic(m_ResistanceModifierExtrasplanchnic); - data.ResistanceModifierMuscle(m_ResistanceModifierMuscle); - data.ResistanceModifierSplanchnic(m_ResistanceModifierSplanchnic); - data.SympatheticPeripheralSignalBaseline(m_SympatheticPeripheralSignalBaseline_Hz); - data.SympatheticSinoatrialSignalBaseline(m_SympatheticSinoatrialSignalBaseline_Hz); - data.SympatheticPeripheralSignalFatigue(m_SympatheticPeripheralSignalFatigue); - data.VagalSignalBaseline(m_VagalSignalBaseline_Hz); -} - //-------------------------------------------------------------------------------------------------- /// \brief /// Initializes the nervous specific quantities @@ -280,10 +165,10 @@ void Nervous::Unload(CDM::BioGearsNervousSystemData& data) const void Nervous::SetUp() { m_dt_s = m_data.GetTimeStep().GetValue(TimeUnit::s); - m_Succinylcholine = m_data.GetSubstances().GetSubstance("Succinylcholine"); - m_Sarin = m_data.GetSubstances().GetSubstance("Sarin"); - m_Atropine = m_data.GetSubstances().GetSubstance("Atropine"); - m_Midazolam = m_data.GetSubstances().GetSubstance("Midazolam"); + m_Succinylcholine = m_data.GetSubstances().GetSubstance(StandardSubstances::Succinylcholine); + m_Sarin = m_data.GetSubstances().GetSubstance(StandardSubstances::Sarin); + m_Atropine = m_data.GetSubstances().GetSubstance(StandardSubstances::Atropine); + m_Midazolam = m_data.GetSubstances().GetSubstance(StandardSubstances::Midazolam); m_Patient = &m_data.GetPatient(); m_Drug = &m_data.GetDrugs(); @@ -426,7 +311,7 @@ void Nervous::CentralSignalProcess() const double xCO2SP = 0.25; const double tauIschemia = 30.0; const double tauCO2 = 20.0; - + // Exercise Signal Modifiers double fExerciseSympathetic = 0.0; @@ -507,7 +392,7 @@ void Nervous::CentralSignalProcess() //Model fatigue of sympathetic peripheral response during sepsis -- Future work should investigate relevance of fatigue in other scenarios //Currently applying only to the peripheral signal because the literature notes that vascular smooth muscle shows depressed responsiveness to sympathetic activiy, //(Sayk et al., 2008 and Brassard et al., 2016) which would inhibit ability to increase peripheral resistance - if (m_data.GetBloodChemistry().GetInflammatoryResponse().HasInflammationSource(CDM::enumInflammationSource::Infection)) { + if (m_data.GetBloodChemistry().GetInflammatoryResponse().HasInflammationSource(SEInflammationSource::Infection)) { double fatigueThreshold = 6.0; double fatigueTimeConstant_hr = 2.0; double dFatigueScale_hr = 0.0; @@ -671,7 +556,7 @@ void Nervous::BaroreceptorFeedback() painEffect = 0.5 * painVAS * m_BaroreceptorOperatingPoint_mmHg; } for (SESubstance* drug : m_data.GetSubstances().GetActiveDrugs()) { - if ((drug->GetClassification() == CDM::enumSubstanceClass::Anesthetic) || (drug->GetClassification() == CDM::enumSubstanceClass::Sedative) || (drug->GetClassification() == CDM::enumSubstanceClass::Opioid)) { + if ((drug->GetClassification() == SESubstanceClass::Anesthetic) || (drug->GetClassification() == SESubstanceClass::Sedative) || (drug->GetClassification() == SESubstanceClass::Opioid)) { drugEffect = m_data.GetDrugs().GetMeanBloodPressureChange(PressureUnit::mmHg); // / m_data.GetPatient().GetMeanArterialPressureBaseline(PressureUnit::mmHg); break; //Only want to apply the blood pressure change ONCE (In case there are multiple sedative/opioids/etc) @@ -732,7 +617,7 @@ void Nervous::BaroreceptorFeedback() //Update baroreceptor setpoint -- the study from which this time constant was obtained focused on hemorrhagic shock. The time scale is much different //than septic shock and so it is not clear how (or if) this value would change for sepsis. For now, we will track baroreceptor adaptation and sympathetic fatigue //separately. Future work should try to consolidate these two phenomena into a single model - if (m_data.GetState() > EngineState::SecondaryStabilization && !m_data.GetBloodChemistry().GetInflammatoryResponse().HasInflammationSource(CDM::enumInflammationSource::Infection)) { + if (m_data.GetState() > EngineState::SecondaryStabilization && !m_data.GetBloodChemistry().GetInflammatoryResponse().HasInflammationSource(SEInflammationSource::Infection)) { //Pruett2013Population assumes ~16 hr half-time for baroreceptor adaptation to new setpoint (They varied this parameter up to 1-2 days half-time) const double kAdapt_Per_hr = 0.042; const double dSetpointAdjust_mmHg_Per_hr = kAdapt_Per_hr * (systolicPressure_mmHg - m_BaroreceptorOperatingPoint_mmHg); @@ -1073,6 +958,13 @@ void Nervous::CheckPainStimulus() tempPainVAS += (traumaPain * susceptabilityMapping * PainBuffer) / (1 + exp(-m_painStimulusDuration_s + 4.0)); } + // determine pain response from inflammation caused by fracture + if (m_data.GetActions().GetPatientActions().HasFracture()) { + double traumaPain = m_data.GetActions().GetPatientActions().GetFracture()->GetSeverity().GetValue(); + traumaPain *= 20.0; + tempPainVAS += (traumaPain * susceptabilityMapping * PainBuffer) / (1 + exp(-m_painStimulusDuration_s + 4.0)); + } + //iterate over all locations to get a cumulative stimulus and buffer them for (auto pain : pains) { p = pain.second; @@ -1128,20 +1020,20 @@ void Nervous::CheckNervousStatus() if (icp_mmHg > 25.0) // \cite steiner2006monitoring { /// \event Patient: Intracranial Hypertension. The intracranial pressure has risen above 25 mmHg. - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::IntracranialHypertension, true, m_data.GetSimulationTime()); - } else if (m_data.GetPatient().IsEventActive(CDM::enumPatientEvent::IntracranialHypertension) && icp_mmHg < 23.0) { + m_data.GetPatient().SetEvent(SEPatientEventType::IntracranialHypertension, true, m_data.GetSimulationTime()); + } else if (m_data.GetPatient().IsEventActive(SEPatientEventType::IntracranialHypertension) && icp_mmHg < 23.0) { /// \event Patient: End Intracranial Hypertension. The intracranial pressure has fallen below 24 mmHg. - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::IntracranialHypertension, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::IntracranialHypertension, false, m_data.GetSimulationTime()); } //Intracranial Hypotension if (icp_mmHg < 7.0) // \cite steiner2006monitoring { /// \event Patient: Intracranial Hypotension. The intracranial pressure has fallen below 7 mmHg. - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::IntracranialHypotension, true, m_data.GetSimulationTime()); - } else if (m_data.GetPatient().IsEventActive(CDM::enumPatientEvent::IntracranialHypotension) && icp_mmHg > 7.5) { + m_data.GetPatient().SetEvent(SEPatientEventType::IntracranialHypotension, true, m_data.GetSimulationTime()); + } else if (m_data.GetPatient().IsEventActive(SEPatientEventType::IntracranialHypotension) && icp_mmHg > 7.5) { /// \event Patient: End Intracranial Hypotension. The intracranial pressure has risen above 7.5 mmHg. - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::IntracranialHypertension, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::IntracranialHypertension, false, m_data.GetSimulationTime()); } //---Check Sedatation / Agitation State and output a Richmond Agitation Sedation Scale (RASS) score @@ -1159,11 +1051,11 @@ void Nervous::CheckNervousStatus() /*if (m_Muscleintracellular.GetSubstanceQuantity(*m_Calcium)->GetConcentration(MassPerVolumeUnit::g_Per_L) < 1.0) { /// \event Patient: Patient is fasciculating due to calcium deficiency - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::Fasciculation, true, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::Fasciculation, true, m_data.GetSimulationTime()); } else if (m_Muscleintracellular.GetSubstanceQuantity(*m_Calcium)->GetConcentration(MassPerVolumeUnit::g_Per_L) > 3.0) { - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::Fasciculation, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::Fasciculation, false, m_data.GetSimulationTime()); }*/ //-----patient events due to Sarin-------------------------------------------------- @@ -1186,76 +1078,76 @@ void Nervous::CheckNervousStatus() //100% inhibition when, in actuality, a patient with 100% rbc-ache inhibition will likely survive (rbc-ache thought to act as a buffer //for neuromuscular ache) if (0.4 < RbcFractionInhibited && RbcFractionInhibited < 0.75) { - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::Fasciculation, true, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::Fasciculation, true, m_data.GetSimulationTime()); } if (RbcFractionInhibited < 0.38) { //Oscillations around 70% rbc-ache inhibition are highly unlikely but give some leeway for reversal just in case - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::Fasciculation, false, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::MildWeakness, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::Fasciculation, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::MildWeakness, false, m_data.GetSimulationTime()); } if (RbcFractionInhibited > 0.8 && !m_data.GetSubstances().IsActive(*m_Atropine)) { - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::Fasciculation, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::Fasciculation, false, m_data.GetSimulationTime()); } if (0.4 < RbcFractionInhibited && RbcFractionInhibited < 0.65) { - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::MildWeakness, true, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::ModerateWeakness, false, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::FlaccidParalysis, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::MildWeakness, true, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::ModerateWeakness, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::FlaccidParalysis, false, m_data.GetSimulationTime()); } if (0.7 < RbcFractionInhibited && RbcFractionInhibited < 0.85) { - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::ModerateWeakness, true, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::MildWeakness, false, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::FlaccidParalysis, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::ModerateWeakness, true, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::MildWeakness, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::FlaccidParalysis, false, m_data.GetSimulationTime()); } if (midazolam_mg_Per_L > 0.4) { //handle seizures in a special way to account for diazapam reversal agent - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::Seizures, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::Seizures, false, m_data.GetSimulationTime()); } if (0.8 < RbcFractionInhibited && RbcFractionInhibited < 0.88 && midazolam_mg_Per_L < 0.4) { - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::Seizures, true, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::Seizures, true, m_data.GetSimulationTime()); } if (RbcFractionInhibited > 0.9) { - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::FlaccidParalysis, true, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::Seizures, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::FlaccidParalysis, true, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::Seizures, false, m_data.GetSimulationTime()); } //Muscarinic/atropine patient events if (brainAtropine_mg_Per_L == 0) { if (0.2 < RbcFractionInhibited && RbcFractionInhibited < 0.45) { - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::Nausea, true, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::MildSecretions, true, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::MildDiaphoresis, true, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::Nausea, true, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::MildSecretions, true, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::MildDiaphoresis, true, m_data.GetSimulationTime()); } if (0.5 < RbcFractionInhibited && RbcFractionInhibited < 0.75) { - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::Nausea, false, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::Vomiting, true, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::MildSecretions, false, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::MildDiaphoresis, false, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::ModerateSecretions, true, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::ModerateDiaphoresis, true, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::Nausea, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::Vomiting, true, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::MildSecretions, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::MildDiaphoresis, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::ModerateSecretions, true, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::ModerateDiaphoresis, true, m_data.GetSimulationTime()); } if (RbcFractionInhibited > 0.8) { - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::FunctionalIncontinence, true, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::ModerateSecretions, false, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::ModerateDiaphoresis, false, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::SevereSecretions, true, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::Vomiting, false, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::SevereDiaphoresis, true, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::FunctionalIncontinence, true, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::ModerateSecretions, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::ModerateDiaphoresis, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::SevereSecretions, true, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::Vomiting, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::SevereDiaphoresis, true, m_data.GetSimulationTime()); } } } //Muscarinic reversals //use the brain intracellular compartment for atropine reference if (0.2 < brainAtropine_mg_Per_L && brainAtropine_mg_Per_L < 0.3) { - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::Nausea, false, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::MildSecretions, false, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::MildDiaphoresis, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::Nausea, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::MildSecretions, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::MildDiaphoresis, false, m_data.GetSimulationTime()); } if (0.4 < brainAtropine_mg_Per_L && brainAtropine_mg_Per_L < 0.5) { - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::Vomiting, false, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::ModerateSecretions, false, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::ModerateDiaphoresis, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::Vomiting, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::ModerateSecretions, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::ModerateDiaphoresis, false, m_data.GetSimulationTime()); } if (0.6 < brainAtropine_mg_Per_L) { - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::SevereSecretions, false, m_data.GetSimulationTime()); - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::SevereDiaphoresis, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::SevereSecretions, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::SevereDiaphoresis, false, m_data.GetSimulationTime()); } //----Fasciculations due to Succinylcholine administration.--------------------------------------------------- @@ -1269,9 +1161,9 @@ void Nervous::CheckNervousStatus() double neuromuscularBlockLevel = m_data.GetDrugs().GetNeuromuscularBlockLevel().GetValue(); if (m_data.GetSubstances().IsActive(*m_Succinylcholine) && (neuromuscularBlockLevel > 0.0)) { if ((neuromuscularBlockLevel < 0.9) && (!m_blockActive)) - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::Fasciculation, true, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::Fasciculation, true, m_data.GetSimulationTime()); else { - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::Fasciculation, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::Fasciculation, false, m_data.GetSimulationTime()); m_blockActive = true; } } @@ -1308,17 +1200,17 @@ void Nervous::SetPupilEffects() if (b->GetSeverity().GetValue() > 0) { double icp_mmHg = m_data.GetCardiovascular().GetIntracranialPressure().GetValue(PressureUnit::mmHg); - if (b->GetType() == CDM::enumBrainInjuryType::Diffuse) { + if (b->GetType() == SEBrainInjuryType::Diffuse) { //https://www.wolframalpha.com/input/?i=y%3D(1+%2F+(1+%2B+exp(-2.0*(x+-+24))))+from+18%3Cx%3C28 leftPupilSizeResponseLevel += (1 / (1 + exp(-2.0 * (icp_mmHg - 20)))); //https://www.wolframalpha.com/input/?i=y%3D-.001*pow(10,+.27*(x+-+15))+from+18%3Cx%3C28+and+-1%3Cy%3C0 leftPupilReactivityResponseLevel += -.001 * std::pow(10, .27 * (icp_mmHg - 13)); rightPupilSizeResponseLevel = leftPupilSizeResponseLevel; rightPupilReactivityResponseLevel = leftPupilReactivityResponseLevel; - } else if (b->GetType() == CDM::enumBrainInjuryType::LeftFocal) { + } else if (b->GetType() == SEBrainInjuryType::LeftFocal) { leftPupilSizeResponseLevel += (1 / (1 + exp(-2.0 * (icp_mmHg - 20)))); leftPupilReactivityResponseLevel += -.001 * std::pow(10, .27 * (icp_mmHg - 13)); - } else if (b->GetType() == CDM::enumBrainInjuryType::RightFocal) { + } else if (b->GetType() == SEBrainInjuryType::RightFocal) { rightPupilSizeResponseLevel += (1 / (1 + exp(-2.0 * (icp_mmHg - 20)))); rightPupilReactivityResponseLevel += -.001 * std::pow(10, .27 * (icp_mmHg - 13)); } @@ -1362,7 +1254,7 @@ bool Nervous::CalculatePsychomotorVigilanceTask(SEPsychomotorVigilanceTask& pvt) void Nervous::CalculateSleepEffects() { //Calculate wake/sleep ratio to determine parameter scaling - CDM::enumSleepState sleepState = GetSleepState(); + SESleepState sleepState = GetSleepState(); double sleepTime = GetSleepTime().GetValue(TimeUnit::min); //update value from last computation double wakeTime = GetWakeTime().GetValue(TimeUnit::min); //update value from last computation m_BiologicalDebt = GetBiologicalDebt().GetValue(); //update value from last computation @@ -1394,7 +1286,7 @@ void Nervous::CalculateSleepEffects() double count = 1.0; - if (sleepState == CDM::enumSleepState::Asleep) { + if (sleepState == SESleepState::Sleeping) { rwt *= rwSleepScale; rbt *= rbSleepScale; } @@ -1414,22 +1306,22 @@ void Nervous::CalculateSleepEffects() //lets try an improved scheme m_BiologicalDebt = m_BiologicalDebt + m_dt_s * 0.5*(k1 + k2); - if (sleepState == CDM::enumSleepState::Awake) { + if (sleepState == SESleepState::Awake) { wakeTime += (m_dt_s / 60); } - else if (sleepState == CDM::enumSleepState::Asleep) { + else if (sleepState == SESleepState::Sleeping) { sleepTime += (m_dt_s / 60); } //Calculate alertness metric - if(sleepRatio > 3.0 && sleepState == CDM::enumSleepState::Awake) { + if(sleepRatio > 3.0 && sleepState == SESleepState::Awake) { m_AttentionLapses = aSlope * m_TiredTime_hr + aIntercept; m_ReactionTime_s = rSlope * m_TiredTime_hr + rIntercept; m_TiredTime_hr += m_dt_s / 3600.0; } //reset if patient has had enough sleep, recovery requires 8 hours (in any combination) - if(sleepState > (420.0 * count) + m_data.GetPatient().GetSleepAmount(TimeUnit::min)) { + if (sleepRatio > (420.0 * count) + m_data.GetPatient().GetSleepAmount(TimeUnit::min)) { m_AttentionLapses = aIntercept; m_ReactionTime_s = rIntercept; count += 1.0; @@ -1457,11 +1349,11 @@ void biogears::Nervous::UpdateSleepState() { //update state from the action if (m_data.GetActions().GetPatientActions().HasSleepState() && m_data.GetActions().GetPatientActions().GetSleepState()->IsActive()) { - SetSleepState(CDM::enumSleepState::Asleep); + SetSleepState(SESleepState::Sleeping); return; } else { - SetSleepState(CDM::enumSleepState::Awake); + SetSleepState(SESleepState::Awake); } return; } diff --git a/projects/biogears/libBiogears/src/engine/Systems/Renal.cpp b/projects/biogears/libBiogears/src/engine/Systems/Renal.cpp index db12dd881..3a4ac4628 100644 --- a/projects/biogears/libBiogears/src/engine/Systems/Renal.cpp +++ b/projects/biogears/libBiogears/src/engine/Systems/Renal.cpp @@ -11,10 +11,14 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Physiology.h" +#include "io/cdm/Property.h" + #include #include #include #include +#include #include #include #include @@ -42,7 +46,6 @@ specific language governing permissions and limitations under the License. #include #include -namespace BGE = mil::tatrc::physiology::biogears; namespace biogears { auto Renal::make_unique(BioGears& bg) -> std::unique_ptr @@ -54,114 +57,114 @@ Renal::Renal(BioGears& bg) : SERenalSystem(bg.GetLogger()) , m_data(bg) { - Clear(); + Invalidate(); } Renal::~Renal() { - Clear(); + Invalidate(); } -void Renal::Clear() +void Renal::Invalidate() { - SERenalSystem::Clear(); + SERenalSystem::Invalidate(); - m_patient = nullptr; + m_Patient = nullptr; m_RenalCircuit = nullptr; - m_leftGlomerularNode = nullptr; - m_leftBowmansNode = nullptr; - m_leftPeritubularNode = nullptr; - m_leftTubulesNode = nullptr; - m_leftRenalArteryNode = nullptr; - m_rightGlomerularNode = nullptr; - m_rightBowmansNode = nullptr; - m_rightPeritubularNode = nullptr; - m_rightTubulesNode = nullptr; - m_rightRenalArteryNode = nullptr; - m_bladderNode = nullptr; - m_leftNetGlomerularCapillariesNode = nullptr; - m_leftNetBowmansCapsulesNode = nullptr; - m_leftNetPeritubularCapillariesNode = nullptr; - m_leftNetTubulesNode = nullptr; - m_rightNetGlomerularCapillariesNode = nullptr; - m_rightNetBowmansCapsulesNode = nullptr; - m_rightNetPeritubularCapillariesNode = nullptr; - m_rightNetTubulesNode = nullptr; - m_leftGlomerularOsmoticSourcePath = nullptr; - m_leftBowmansOsmoticSourcePath = nullptr; - m_leftReabsorptionResistancePath = nullptr; - m_leftTubulesOsmoticSourcePath = nullptr; - m_leftPeritubularOsmoticSourcePath = nullptr; - m_leftUreterPath = nullptr; - m_leftGlomerularFilterResistancePath = nullptr; - m_leftAfferentArteriolePath = nullptr; - m_rightReabsorptionResistancePath = nullptr; - m_rightGlomerularOsmoticSourcePath = nullptr; - m_rightBowmansOsmoticSourcePath = nullptr; - m_rightTubulesOsmoticSourcePath = nullptr; - m_rightPeritubularOsmoticSourcePath = nullptr; - m_rightUreterPath = nullptr; - m_rightGlomerularFilterResistancePath = nullptr; - m_rightAfferentArteriolePath = nullptr; - m_bladderToGroundPressurePath = nullptr; - m_urethraPath = nullptr; - m_leftTubulesPath = nullptr; - m_rightTubulesPath = nullptr; - m_leftEfferentArteriolePath = nullptr; - m_rightEfferentArteriolePath = nullptr; - - m_sodium = nullptr; - m_urea = nullptr; - m_glucose = nullptr; - m_lactate = nullptr; - m_potassium = nullptr; - m_aorta = nullptr; - m_venaCava = nullptr; - m_bladder = nullptr; - m_rightKidneyTissue = nullptr; - m_leftKidneyTissue = nullptr; - m_leftUreter = nullptr; - m_leftPeritubular = nullptr; - m_rightUreter = nullptr; - m_rightPeritubular = nullptr; - m_leftGlomerular = nullptr; - m_leftBowmans = nullptr; - m_rightGlomerular = nullptr; - m_rightBowmans = nullptr; - m_leftTubules = nullptr; - m_rightTubules = nullptr; - - m_aortaLactate = nullptr; - - m_leftPeritubularGlucose = nullptr; - m_leftPeritubularPotassium = nullptr; - m_leftUreterLactate = nullptr; - m_leftUreterPotassium = nullptr; - - m_rightPeritubularGlucose = nullptr; - m_rightPeritubularPotassium = nullptr; - m_rightUreterLactate = nullptr; - m_rightUreterPotassium = nullptr; - - m_bladderAlbumin = nullptr; - m_bladderGlucose = nullptr; - m_bladderPotassium = nullptr; - m_bladderSodium = nullptr; - m_bladderUrea = nullptr; - m_leftTubulesSodium = nullptr; - m_rightTubulesSodium = nullptr; - - m_leftKidneyIntracellularLactate = nullptr; - m_rightKidneyIntracellularLactate = nullptr; - - m_urineProductionRate_mL_Per_min_runningAvg.Reset(); - m_urineOsmolarity_mOsm_Per_L_runningAvg.Reset(); - m_sodiumExcretionRate_mg_Per_min_runningAvg.Reset(); - m_rightSodiumFlow_mg_Per_s_runningAvg.Reset(); - m_leftSodiumFlow_mg_Per_s_runningAvg.Reset(); - m_leftRenalArterialPressure_mmHg_runningAvg.Reset(); - m_rightRenalArterialPressure_mmHg_runningAvg.Reset(); - m_sodiumConcentration_mg_Per_mL_runningAvg.Reset(); + m_LeftGlomerularNode = nullptr; + m_LeftBowmansNode = nullptr; + m_LeftPeritubularNode = nullptr; + m_LeftTubulesNode = nullptr; + m_LeftRenalArteryNode = nullptr; + m_RightGlomerularNode = nullptr; + m_RightBowmansNode = nullptr; + m_RightPeritubularNode = nullptr; + m_RightTubulesNode = nullptr; + m_RightRenalArteryNode = nullptr; + m_BladderNode = nullptr; + m_LeftNetGlomerularCapillariesNode = nullptr; + m_LeftNetBowmansCapsulesNode = nullptr; + m_LeftNetPeritubularCapillariesNode = nullptr; + m_LeftNetTubulesNode = nullptr; + m_RightNetGlomerularCapillariesNode = nullptr; + m_RightNetBowmansCapsulesNode = nullptr; + m_RightNetPeritubularCapillariesNode = nullptr; + m_RightNetTubulesNode = nullptr; + m_LeftGlomerularOsmoticSourcePath = nullptr; + m_LeftBowmansOsmoticSourcePath = nullptr; + m_LeftReabsorptionResistancePath = nullptr; + m_LeftTubulesOsmoticSourcePath = nullptr; + m_LeftPeritubularOsmoticSourcePath = nullptr; + m_LeftUreterPath = nullptr; + m_LeftGlomerularFilterResistancePath = nullptr; + m_LeftAfferentArteriolePath = nullptr; + m_RightReabsorptionResistancePath = nullptr; + m_RightGlomerularOsmoticSourcePath = nullptr; + m_RightBowmansOsmoticSourcePath = nullptr; + m_RightTubulesOsmoticSourcePath = nullptr; + m_RightPeritubularOsmoticSourcePath = nullptr; + m_RightUreterPath = nullptr; + m_RightGlomerularFilterResistancePath = nullptr; + m_RightAfferentArteriolePath = nullptr; + m_BladderToGroundPressurePath = nullptr; + m_UrethraPath = nullptr; + m_LeftTubulesPath = nullptr; + m_RightTubulesPath = nullptr; + m_LeftEfferentArteriolePath = nullptr; + m_RightEfferentArteriolePath = nullptr; + + m_Sodium = nullptr; + m_Urea = nullptr; + m_Glucose = nullptr; + m_Lactate = nullptr; + m_Potassium = nullptr; + m_Aorta = nullptr; + m_VenaCava = nullptr; + m_Bladder = nullptr; + m_RightKidneyTissue = nullptr; + m_LeftKidneyTissue = nullptr; + m_LeftUreter = nullptr; + m_LeftPeritubular = nullptr; + m_RightUreter = nullptr; + m_RightPeritubular = nullptr; + m_LeftGlomerular = nullptr; + m_LeftBowmans = nullptr; + m_RightGlomerular = nullptr; + m_RightBowmans = nullptr; + m_LeftTubules = nullptr; + m_RightTubules = nullptr; + + m_AortaLactate = nullptr; + + m_LeftPeritubularGlucose = nullptr; + m_LeftPeritubularPotassium = nullptr; + m_LeftUreterLactate = nullptr; + m_LeftUreterPotassium = nullptr; + + m_RightPeritubularGlucose = nullptr; + m_RightPeritubularPotassium = nullptr; + m_RightUreterLactate = nullptr; + m_RightUreterPotassium = nullptr; + + m_BladderAlbumin = nullptr; + m_BladderGlucose = nullptr; + m_BladderPotassium = nullptr; + m_BladderSodium = nullptr; + m_BladderUrea = nullptr; + m_LeftTubulesSodium = nullptr; + m_RightTubulesSodium = nullptr; + + m_LeftKidneyIntracellularLactate = nullptr; + m_RightKidneyIntracellularLactate = nullptr; + + m_UrineProductionRate_mL_Per_min.Reset(); + m_UrineOsmolarity_mOsm_Per_L.Reset(); + m_SodiumExcretionRate_mg_Per_min.Reset(); + m_RightSodiumFlow_mg_Per_s.Reset(); + m_LeftSodiumFlow_mg_Per_s.Reset(); + m_LeftRenalArterialPressure_mmHg.Reset(); + m_RightRenalArterialPressure_mmHg.Reset(); + m_SodiumConcentration_mg_Per_mL.Reset(); } //-------------------------------------------------------------------------------------------------- @@ -173,12 +176,12 @@ void Renal::Initialize() BioGearsSystem::Initialize(); m_Urinating = false; - m_leftAfferentResistance_mmHg_s_Per_mL = m_leftAfferentArteriolePath->GetResistanceBaseline(FlowResistanceUnit::mmHg_s_Per_mL); - m_rightAfferentResistance_mmHg_s_Per_mL = m_rightAfferentArteriolePath->GetResistanceBaseline(FlowResistanceUnit::mmHg_s_Per_mL); - m_leftSodiumFlowSetPoint_mg_Per_s = 4.7; - m_rightSodiumFlowSetPoint_mg_Per_s = 4.7; + m_LeftAfferentResistance_mmHg_s_Per_mL = m_LeftAfferentArteriolePath->GetResistanceBaseline(FlowResistanceUnit::mmHg_s_Per_mL); + m_RightAfferentResistance_mmHg_s_Per_mL = m_RightAfferentArteriolePath->GetResistanceBaseline(FlowResistanceUnit::mmHg_s_Per_mL); + m_LeftSodiumFlowSetPoint_mg_Per_s = 4.7; + m_RightSodiumFlowSetPoint_mg_Per_s = 4.7; - //Initialize system data + // Initialize system data GetLeftGlomerularFluidPermeability().SetValue(m_data.GetConfiguration().GetLeftGlomerularFluidPermeabilityBaseline(VolumePerTimePressureAreaUnit::mL_Per_s_mmHg_m2), VolumePerTimePressureAreaUnit::mL_Per_s_mmHg_m2); GetLeftGlomerularFiltrationSurfaceArea().SetValue(m_data.GetConfiguration().GetLeftGlomerularFilteringSurfaceAreaBaseline(AreaUnit::m2), AreaUnit::m2); GetLeftTubularReabsorptionFluidPermeability().SetValue(m_data.GetConfiguration().GetLeftTubularReabsorptionFluidPermeabilityBaseline(VolumePerTimePressureAreaUnit::mL_Per_s_mmHg_m2), VolumePerTimePressureAreaUnit::mL_Per_s_mmHg_m2); @@ -193,43 +196,43 @@ void Renal::Initialize() GetGlomerularFiltrationRate().SetValue(180.0, VolumePerTimeUnit::L_Per_day); GetLeftBowmansCapsulesHydrostaticPressure().SetValue(18.0, PressureUnit::mmHg); - GetLeftBowmansCapsulesOsmoticPressure().SetValue(m_leftBowmansOsmoticSourcePath->GetPressureSourceBaseline().GetValue(PressureUnit::mmHg), PressureUnit::mmHg); + GetLeftBowmansCapsulesOsmoticPressure().SetValue(m_LeftBowmansOsmoticSourcePath->GetPressureSourceBaseline().GetValue(PressureUnit::mmHg), PressureUnit::mmHg); GetLeftGlomerularCapillariesHydrostaticPressure().SetValue(60.0, PressureUnit::mmHg); - GetLeftGlomerularCapillariesOsmoticPressure().SetValue(m_leftGlomerularOsmoticSourcePath->GetPressureSourceBaseline().GetValue(PressureUnit::mmHg), PressureUnit::mmHg); // circuit pressure source baseline + GetLeftGlomerularCapillariesOsmoticPressure().SetValue(m_LeftGlomerularOsmoticSourcePath->GetPressureSourceBaseline().GetValue(PressureUnit::mmHg), PressureUnit::mmHg); // circuit pressure source baseline GetLeftGlomerularFiltrationCoefficient().SetValue(12.5, VolumePerTimePressureUnit::mL_Per_min_mmHg); GetLeftGlomerularFiltrationRate().SetValue(90.0, VolumePerTimeUnit::L_Per_day); GetLeftNetFiltrationPressure().SetValue(10.0, PressureUnit::mmHg); GetLeftNetReabsorptionPressure().SetValue(10.0, PressureUnit::mmHg); GetLeftPeritubularCapillariesHydrostaticPressure().SetValue(13.0, PressureUnit::mmHg); - GetLeftPeritubularCapillariesOsmoticPressure().SetValue(m_leftPeritubularOsmoticSourcePath->GetPressureSourceBaseline().GetValue(PressureUnit::mmHg), PressureUnit::mmHg); + GetLeftPeritubularCapillariesOsmoticPressure().SetValue(m_LeftPeritubularOsmoticSourcePath->GetPressureSourceBaseline().GetValue(PressureUnit::mmHg), PressureUnit::mmHg); GetLeftReabsorptionFiltrationCoefficient().SetValue(12.4, VolumePerTimePressureUnit::mL_Per_min_mmHg); GetLeftReabsorptionRate().SetValue(62.0, VolumePerTimeUnit::mL_Per_min); GetLeftTubularHydrostaticPressure().SetValue(6.0, PressureUnit::mmHg); - GetLeftTubularOsmoticPressure().SetValue(m_leftTubulesOsmoticSourcePath->GetPressureSourceBaseline().GetValue(PressureUnit::mmHg), PressureUnit::mmHg); + GetLeftTubularOsmoticPressure().SetValue(m_LeftTubulesOsmoticSourcePath->GetPressureSourceBaseline().GetValue(PressureUnit::mmHg), PressureUnit::mmHg); GetLeftFiltrationFraction().SetValue(0.2); GetLeftReabsorptionRate().SetValue(62.0, VolumePerTimeUnit::mL_Per_min); GetLeftFiltrationFraction().SetValue(0.2); - GetLeftAfferentArterioleResistance().Set(m_leftAfferentArteriolePath->GetResistanceBaseline()); - GetLeftEfferentArterioleResistance().Set(m_leftEfferentArteriolePath->GetResistanceBaseline()); + GetLeftAfferentArterioleResistance().Set(m_LeftAfferentArteriolePath->GetResistanceBaseline()); + GetLeftEfferentArterioleResistance().Set(m_LeftEfferentArteriolePath->GetResistanceBaseline()); GetRightBowmansCapsulesHydrostaticPressure().SetValue(18.0, PressureUnit::mmHg); - GetRightBowmansCapsulesOsmoticPressure().SetValue(m_rightBowmansOsmoticSourcePath->GetPressureSourceBaseline().GetValue(PressureUnit::mmHg), PressureUnit::mmHg); + GetRightBowmansCapsulesOsmoticPressure().SetValue(m_RightBowmansOsmoticSourcePath->GetPressureSourceBaseline().GetValue(PressureUnit::mmHg), PressureUnit::mmHg); GetRightGlomerularCapillariesHydrostaticPressure().SetValue(60.0, PressureUnit::mmHg); - GetRightGlomerularCapillariesOsmoticPressure().SetValue(m_rightGlomerularOsmoticSourcePath->GetPressureSourceBaseline().GetValue(PressureUnit::mmHg), PressureUnit::mmHg); + GetRightGlomerularCapillariesOsmoticPressure().SetValue(m_RightGlomerularOsmoticSourcePath->GetPressureSourceBaseline().GetValue(PressureUnit::mmHg), PressureUnit::mmHg); GetRightGlomerularFiltrationCoefficient().SetValue(12.5, VolumePerTimePressureUnit::mL_Per_min_mmHg); GetRightGlomerularFiltrationRate().SetValue(90.0, VolumePerTimeUnit::L_Per_day); GetRightNetFiltrationPressure().SetValue(10.0, PressureUnit::mmHg); GetRightNetReabsorptionPressure().SetValue(10.0, PressureUnit::mmHg); GetRightPeritubularCapillariesHydrostaticPressure().SetValue(13.0, PressureUnit::mmHg); - GetRightPeritubularCapillariesOsmoticPressure().SetValue(m_rightPeritubularOsmoticSourcePath->GetPressureSourceBaseline().GetValue(PressureUnit::mmHg), PressureUnit::mmHg); + GetRightPeritubularCapillariesOsmoticPressure().SetValue(m_RightPeritubularOsmoticSourcePath->GetPressureSourceBaseline().GetValue(PressureUnit::mmHg), PressureUnit::mmHg); GetRightReabsorptionFiltrationCoefficient().SetValue(12.4, VolumePerTimePressureUnit::mL_Per_min_mmHg); GetRightTubularHydrostaticPressure().SetValue(6.0, PressureUnit::mmHg); - GetRightTubularOsmoticPressure().SetValue(m_rightTubulesOsmoticSourcePath->GetPressureSourceBaseline().GetValue(PressureUnit::mmHg), PressureUnit::mmHg); + GetRightTubularOsmoticPressure().SetValue(m_RightTubulesOsmoticSourcePath->GetPressureSourceBaseline().GetValue(PressureUnit::mmHg), PressureUnit::mmHg); GetRightFiltrationFraction().SetValue(0.2); GetRightReabsorptionRate().SetValue(62.0, VolumePerTimeUnit::mL_Per_min); GetRightFiltrationFraction().SetValue(0.2); - GetRightAfferentArterioleResistance().Set(m_rightAfferentArteriolePath->GetResistanceBaseline()); - GetRightEfferentArterioleResistance().Set(m_rightEfferentArteriolePath->GetResistanceBaseline()); + GetRightAfferentArterioleResistance().Set(m_RightAfferentArteriolePath->GetResistanceBaseline()); + GetRightEfferentArterioleResistance().Set(m_RightEfferentArteriolePath->GetResistanceBaseline()); GetRenalBloodFlow().SetValue(1132.0, VolumePerTimeUnit::mL_Per_min); GetRenalPlasmaFlow().SetValue(660.0, VolumePerTimeUnit::mL_Per_min); @@ -250,10 +253,10 @@ void Renal::Initialize() for (SESubstance* sub : m_data.GetSubstances().GetSubstances()) { CalculateFilterability(*sub); if (!sub->GetClearance().HasRenalDynamic()) - sub->GetClearance().SetRenalDynamic(RenalDynamic::Clearance); + sub->GetClearance().SetRenalDynamic(RenalDynamicsType::Clearance); if (!sub->GetClearance().HasRenalClearance()) sub->GetClearance().GetRenalClearance().SetValue(0.0, VolumePerTimeMassUnit::mL_Per_min_kg); - if (sub->GetClearance().GetRenalDynamic() == RenalDynamic::Regulation) { + if (sub->GetClearance().GetRenalDynamic() == RenalDynamicsType::Regulation) { sub->GetClearance().GetRenalFiltrationRate().SetValue(0.0, MassPerTimeUnit::g_Per_min); sub->GetClearance().GetRenalReabsorptionRate().SetValue(0.0, MassPerTimeUnit::g_Per_min); sub->GetClearance().GetRenalExcretionRate().SetValue(0.0, MassPerTimeUnit::g_Per_min); @@ -262,174 +265,125 @@ void Renal::Initialize() } } -bool Renal::Load(const CDM::BioGearsRenalSystemData& in) -{ - if (!SERenalSystem::Load(in)) - return false; - - m_Urinating = in.Urinating(); - m_leftAfferentResistance_mmHg_s_Per_mL = in.LeftAfferentResistance_mmHg_s_Per_mL(); - m_rightAfferentResistance_mmHg_s_Per_mL = in.RightAfferentResistance_mmHg_s_Per_mL(); - m_leftSodiumFlowSetPoint_mg_Per_s = in.LeftSodiumFlowSetPoint_mg_Per_s(); - m_rightSodiumFlowSetPoint_mg_Per_s = in.RightSodiumFlowSetPoint_mg_Per_s(); - - m_urineProductionRate_mL_Per_min_runningAvg.Load(in.UrineProductionRate_mL_Per_min()); - m_urineOsmolarity_mOsm_Per_L_runningAvg.Load(in.UrineOsmolarity_mOsm_Per_L()); - m_sodiumConcentration_mg_Per_mL_runningAvg.Load(in.SodiumConcentration_mg_Per_mL()); - m_sodiumExcretionRate_mg_Per_min_runningAvg.Load(in.SodiumExcretionRate_mg_Per_min()); - m_leftSodiumFlow_mg_Per_s_runningAvg.Load(in.LeftSodiumFlow_mg_Per_s()); - m_rightSodiumFlow_mg_Per_s_runningAvg.Load(in.RightSodiumFlow_mg_Per_s()); - m_leftRenalArterialPressure_mmHg_runningAvg.Load(in.LeftRenalArterialPressure_mmHg()); - m_rightRenalArterialPressure_mmHg_runningAvg.Load(in.RightRenalArterialPressure_mmHg()); - - BioGearsSystem::LoadState(); - return true; -} -CDM::BioGearsRenalSystemData* Renal::Unload() const -{ - CDM::BioGearsRenalSystemData* data = new CDM::BioGearsRenalSystemData(); - Unload(*data); - return data; -} -void Renal::Unload(CDM::BioGearsRenalSystemData& data) const -{ - SERenalSystem::Unload(data); - - data.Urinating(m_Urinating); - data.LeftAfferentResistance_mmHg_s_Per_mL(m_leftAfferentResistance_mmHg_s_Per_mL); - data.RightAfferentResistance_mmHg_s_Per_mL(m_rightAfferentResistance_mmHg_s_Per_mL); - data.LeftSodiumFlowSetPoint_mg_Per_s(m_leftSodiumFlowSetPoint_mg_Per_s); - data.RightSodiumFlowSetPoint_mg_Per_s(m_rightSodiumFlowSetPoint_mg_Per_s); - - data.UrineProductionRate_mL_Per_min(std::unique_ptr(m_urineProductionRate_mL_Per_min_runningAvg.Unload())); - data.UrineOsmolarity_mOsm_Per_L(std::unique_ptr(m_urineOsmolarity_mOsm_Per_L_runningAvg.Unload())); - data.SodiumConcentration_mg_Per_mL(std::unique_ptr(m_sodiumConcentration_mg_Per_mL_runningAvg.Unload())); - data.SodiumExcretionRate_mg_Per_min(std::unique_ptr(m_sodiumExcretionRate_mg_Per_min_runningAvg.Unload())); - data.LeftSodiumFlow_mg_Per_s(std::unique_ptr(m_leftSodiumFlow_mg_Per_s_runningAvg.Unload())); - data.RightSodiumFlow_mg_Per_s(std::unique_ptr(m_rightSodiumFlow_mg_Per_s_runningAvg.Unload())); - data.LeftRenalArterialPressure_mmHg(std::unique_ptr(m_leftRenalArterialPressure_mmHg_runningAvg.Unload())); - data.RightRenalArterialPressure_mmHg(std::unique_ptr(m_rightRenalArterialPressure_mmHg_runningAvg.Unload())); -} - void Renal::SetUp() { m_dt = m_data.GetTimeStep().GetValue(TimeUnit::s); - m_patient = &m_data.GetPatient(); - - //Substances - m_albumin = &m_data.GetSubstances().GetAlbumin(); - m_sodium = &m_data.GetSubstances().GetSodium(); - m_urea = &m_data.GetSubstances().GetUrea(); - m_glucose = &m_data.GetSubstances().GetGlucose(); - m_lactate = &m_data.GetSubstances().GetLactate(); - m_potassium = &m_data.GetSubstances().GetPotassium(); - - //Substance quantities - - //Compartments - m_aorta = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Aorta); - m_venaCava = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::VenaCava); - - m_leftKidneyTissue = m_data.GetCompartments().GetTissueCompartment(BGE::TissueCompartment::LeftKidney); - m_leftGlomerular = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::LeftGlomerularCapillaries); - m_leftPeritubular = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::LeftPeritubularCapillaries); - m_leftBowmans = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::LeftBowmansCapsules); - m_leftTubules = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::LeftTubules); - m_rightKidneyTissue = m_data.GetCompartments().GetTissueCompartment(BGE::TissueCompartment::RightKidney); - m_rightGlomerular = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::RightGlomerularCapillaries); - m_rightPeritubular = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::RightPeritubularCapillaries); - m_rightBowmans = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::RightBowmansCapsules); - m_rightTubules = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::RightTubules); - - m_bladder = m_data.GetCompartments().GetLiquidCompartment(BGE::UrineCompartment::Bladder); - m_leftUreter = m_data.GetCompartments().GetLiquidCompartment(BGE::UrineCompartment::LeftUreter); - m_rightUreter = m_data.GetCompartments().GetLiquidCompartment(BGE::UrineCompartment::RightUreter); - - //Configuration parameters - m_defaultOpenResistance_mmHg_s_Per_mL = m_data.GetConfiguration().GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL); - m_defaultClosedResistance_mmHg_s_Per_mL = m_data.GetConfiguration().GetDefaultClosedFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL); - m_maxLeftAfferentResistance_mmHg_s_Per_mL = m_data.GetConfiguration().GetMaximumAfferentResistance(FlowResistanceUnit::mmHg_s_Per_mL); - m_minLeftAfferentResistance_mmHg_s_Per_mL = m_data.GetConfiguration().GetMinimumAfferentResistance(FlowResistanceUnit::mmHg_s_Per_mL); - m_maxRightAfferentResistance_mmHg_s_Per_mL = m_data.GetConfiguration().GetMaximumAfferentResistance(FlowResistanceUnit::mmHg_s_Per_mL); - m_minRightAfferentResistance_mmHg_s_Per_mL = m_data.GetConfiguration().GetMinimumAfferentResistance(FlowResistanceUnit::mmHg_s_Per_mL); - m_sodiumPlasmaConcentrationSetpoint_mg_Per_mL = m_data.GetConfiguration().GetPlasmaSodiumConcentrationSetPoint(MassPerVolumeUnit::mg_Per_mL); + m_Patient = &m_data.GetPatient(); + + // Substances + m_Albumin = &m_data.GetSubstances().GetAlbumin(); + m_Sodium = &m_data.GetSubstances().GetSodium(); + m_Urea = &m_data.GetSubstances().GetUrea(); + m_Glucose = &m_data.GetSubstances().GetGlucose(); + m_Lactate = &m_data.GetSubstances().GetLactate(); + m_Potassium = &m_data.GetSubstances().GetPotassium(); + + // Substance quantities + + // Compartments + m_Aorta = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Aorta); + m_VenaCava = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::VenaCava); + + m_LeftKidneyTissue = m_data.GetCompartments().GetTissueCompartment(BGE::TissueCompartment::LeftKidney); + m_LeftGlomerular = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::LeftGlomerularCapillaries); + m_LeftPeritubular = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::LeftPeritubularCapillaries); + m_LeftBowmans = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::LeftBowmansCapsules); + m_LeftTubules = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::LeftTubules); + m_RightKidneyTissue = m_data.GetCompartments().GetTissueCompartment(BGE::TissueCompartment::RightKidney); + m_RightGlomerular = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::RightGlomerularCapillaries); + m_RightPeritubular = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::RightPeritubularCapillaries); + m_RightBowmans = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::RightBowmansCapsules); + m_RightTubules = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::RightTubules); + + m_Bladder = m_data.GetCompartments().GetLiquidCompartment(BGE::UrineCompartment::Bladder); + m_LeftUreter = m_data.GetCompartments().GetLiquidCompartment(BGE::UrineCompartment::LeftUreter); + m_RightUreter = m_data.GetCompartments().GetLiquidCompartment(BGE::UrineCompartment::RightUreter); + + // Configuration parameters + m_DefaultOpenResistance_mmHg_s_Per_mL = m_data.GetConfiguration().GetDefaultOpenFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL); + m_DefaultClosedResistance_mmHg_s_Per_mL = m_data.GetConfiguration().GetDefaultClosedFlowResistance(FlowResistanceUnit::mmHg_s_Per_mL); + m_MaxLeftAfferentResistance_mmHg_s_Per_mL = m_data.GetConfiguration().GetMaximumAfferentResistance(FlowResistanceUnit::mmHg_s_Per_mL); + m_MinLeftAfferentResistance_mmHg_s_Per_mL = m_data.GetConfiguration().GetMinimumAfferentResistance(FlowResistanceUnit::mmHg_s_Per_mL); + m_MaxRightAfferentResistance_mmHg_s_Per_mL = m_data.GetConfiguration().GetMaximumAfferentResistance(FlowResistanceUnit::mmHg_s_Per_mL); + m_MinRightAfferentResistance_mmHg_s_Per_mL = m_data.GetConfiguration().GetMinimumAfferentResistance(FlowResistanceUnit::mmHg_s_Per_mL); + m_SodiumPlasmaConcentrationSetpoint_mg_Per_mL = m_data.GetConfiguration().GetPlasmaSodiumConcentrationSetPoint(MassPerVolumeUnit::mg_Per_mL); m_CVOpenResistance_mmHg_s_Per_mL = m_data.GetConfiguration().GetCardiovascularOpenResistance(FlowResistanceUnit::mmHg_s_Per_mL); - m_baselinePotassiumConcentration_g_Per_dL = m_data.GetConfiguration().GetPeritubularPotassiumConcentrationSetPoint(MassPerVolumeUnit::g_Per_dL); - m_leftReabsorptionPermeabilitySetpoint_mL_Per_s_mmHg_m2 = m_data.GetConfiguration().GetLeftTubularReabsorptionFluidPermeabilityBaseline(VolumePerTimePressureAreaUnit::mL_Per_s_mmHg_m2); - m_rightReabsorptionPermeabilitySetpoint_mL_Per_s_mmHg_m2 = m_data.GetConfiguration().GetRightTubularReabsorptionFluidPermeabilityBaseline(VolumePerTimePressureAreaUnit::mL_Per_s_mmHg_m2); + m_BaselinePotassiumConcentration_g_Per_dL = m_data.GetConfiguration().GetPeritubularPotassiumConcentrationSetPoint(MassPerVolumeUnit::g_Per_dL); + m_LeftReabsorptionPermeabilitySetpoint_mL_Per_s_mmHg_m2 = m_data.GetConfiguration().GetLeftTubularReabsorptionFluidPermeabilityBaseline(VolumePerTimePressureAreaUnit::mL_Per_s_mmHg_m2); + m_RightReabsorptionPermeabilitySetpoint_mL_Per_s_mmHg_m2 = m_data.GetConfiguration().GetRightTubularReabsorptionFluidPermeabilityBaseline(VolumePerTimePressureAreaUnit::mL_Per_s_mmHg_m2); m_RenalCircuit = &m_data.GetCircuits().GetRenalCircuit(); - //Left - m_leftGlomerularNode = m_RenalCircuit->GetNode(BGE::RenalNode::LeftGlomerularCapillaries); - m_leftNetGlomerularCapillariesNode = m_RenalCircuit->GetNode(BGE::RenalNode::LeftNetGlomerularCapillaries); - m_leftBowmansNode = m_RenalCircuit->GetNode(BGE::RenalNode::LeftBowmansCapsules); - m_leftNetBowmansCapsulesNode = m_RenalCircuit->GetNode(BGE::RenalNode::LeftNetBowmansCapsules); - m_leftPeritubularNode = m_RenalCircuit->GetNode(BGE::RenalNode::LeftPeritubularCapillaries); - m_leftNetPeritubularCapillariesNode = m_RenalCircuit->GetNode(BGE::RenalNode::LeftNetPeritubularCapillaries); - m_leftTubulesNode = m_RenalCircuit->GetNode(BGE::RenalNode::LeftTubules); - m_leftNetTubulesNode = m_RenalCircuit->GetNode(BGE::RenalNode::LeftNetTubules); - m_leftRenalArteryNode = m_RenalCircuit->GetNode(BGE::RenalNode::LeftRenalArtery); - //Right - m_rightGlomerularNode = m_RenalCircuit->GetNode(BGE::RenalNode::RightGlomerularCapillaries); - m_rightNetGlomerularCapillariesNode = m_RenalCircuit->GetNode(BGE::RenalNode::RightNetGlomerularCapillaries); - m_rightBowmansNode = m_RenalCircuit->GetNode(BGE::RenalNode::RightBowmansCapsules); - m_rightNetBowmansCapsulesNode = m_RenalCircuit->GetNode(BGE::RenalNode::RightNetBowmansCapsules); - m_rightPeritubularNode = m_RenalCircuit->GetNode(BGE::RenalNode::RightPeritubularCapillaries); - m_rightNetPeritubularCapillariesNode = m_RenalCircuit->GetNode(BGE::RenalNode::RightNetPeritubularCapillaries); - m_rightTubulesNode = m_RenalCircuit->GetNode(BGE::RenalNode::RightTubules); - m_rightNetTubulesNode = m_RenalCircuit->GetNode(BGE::RenalNode::RightNetTubules); - m_rightRenalArteryNode = m_RenalCircuit->GetNode(BGE::RenalNode::RightRenalArtery); - //Individual - m_bladderNode = m_RenalCircuit->GetNode(BGE::RenalNode::Bladder); - //Left - m_leftGlomerularOsmoticSourcePath = m_RenalCircuit->GetPath(BGE::RenalPath::LeftGlomerularCapillariesToNetGlomerularCapillaries); - m_leftBowmansOsmoticSourcePath = m_RenalCircuit->GetPath(BGE::RenalPath::LeftBowmansCapsulesToNetBowmansCapsules); - m_leftReabsorptionResistancePath = m_RenalCircuit->GetPath(BGE::RenalPath::LeftNetTubulesToNetPeritubularCapillaries); - m_leftTubulesOsmoticSourcePath = m_RenalCircuit->GetPath(BGE::RenalPath::LeftTubulesToNetTubules); - m_leftPeritubularOsmoticSourcePath = m_RenalCircuit->GetPath(BGE::RenalPath::LeftPeritubularCapillariesToNetPeritubularCapillaries); - m_leftUreterPath = m_RenalCircuit->GetPath(BGE::RenalPath::LeftTubulesToUreter); - m_leftGlomerularFilterResistancePath = m_RenalCircuit->GetPath(BGE::RenalPath::LeftNetGlomerularCapillariesToNetBowmansCapsules); - m_leftAfferentArteriolePath = m_RenalCircuit->GetPath(BGE::RenalPath::LeftAfferentArterioleToGlomerularCapillaries); - m_leftTubulesPath = m_RenalCircuit->GetPath(BGE::RenalPath::LeftBowmansCapsulesToTubules); - m_leftEfferentArteriolePath = m_RenalCircuit->GetPath(BGE::RenalPath::LeftEfferentArterioleToPeritubularCapillaries); - - //Right - m_rightGlomerularOsmoticSourcePath = m_RenalCircuit->GetPath(BGE::RenalPath::RightGlomerularCapillariesToNetGlomerularCapillaries); - m_rightBowmansOsmoticSourcePath = m_RenalCircuit->GetPath(BGE::RenalPath::RightBowmansCapsulesToNetBowmansCapsules); - m_rightReabsorptionResistancePath = m_RenalCircuit->GetPath(BGE::RenalPath::RightNetTubulesToNetPeritubularCapillaries); - m_rightTubulesOsmoticSourcePath = m_RenalCircuit->GetPath(BGE::RenalPath::RightTubulesToNetTubules); - m_rightPeritubularOsmoticSourcePath = m_RenalCircuit->GetPath(BGE::RenalPath::RightPeritubularCapillariesToNetPeritubularCapillaries); - m_rightUreterPath = m_RenalCircuit->GetPath(BGE::RenalPath::RightTubulesToUreter); - m_rightGlomerularFilterResistancePath = m_RenalCircuit->GetPath(BGE::RenalPath::RightNetGlomerularCapillariesToNetBowmansCapsules); - m_rightAfferentArteriolePath = m_RenalCircuit->GetPath(BGE::RenalPath::RightAfferentArterioleToGlomerularCapillaries); - m_rightTubulesPath = m_RenalCircuit->GetPath(BGE::RenalPath::RightBowmansCapsulesToTubules); - m_rightEfferentArteriolePath = m_RenalCircuit->GetPath(BGE::RenalPath::RightEfferentArterioleToPeritubularCapillaries); - //Individual - m_bladderToGroundPressurePath = m_RenalCircuit->GetPath(BGE::RenalPath::BladderToGroundPressure); - m_urethraPath = m_RenalCircuit->GetPath(BGE::RenalPath::BladderToGroundUrinate); - - m_aortaLactate = m_aorta->GetSubstanceQuantity(*m_lactate); - - m_leftPeritubularGlucose = m_leftPeritubular->GetSubstanceQuantity(*m_glucose); - m_leftPeritubularPotassium = m_leftPeritubular->GetSubstanceQuantity(*m_potassium); - m_leftUreterLactate = m_leftUreter->GetSubstanceQuantity(*m_lactate); - m_leftUreterPotassium = m_leftUreter->GetSubstanceQuantity(*m_potassium); - - m_rightPeritubularGlucose = m_rightPeritubular->GetSubstanceQuantity(*m_glucose); - m_rightPeritubularPotassium = m_rightPeritubular->GetSubstanceQuantity(*m_potassium); - m_rightUreterLactate = m_rightUreter->GetSubstanceQuantity(*m_lactate); - m_rightUreterPotassium = m_rightUreter->GetSubstanceQuantity(*m_potassium); - - m_bladderAlbumin = m_bladder->GetSubstanceQuantity(*m_albumin); - m_bladderGlucose = m_bladder->GetSubstanceQuantity(*m_glucose); - m_bladderPotassium = m_bladder->GetSubstanceQuantity(*m_potassium); - m_bladderSodium = m_bladder->GetSubstanceQuantity(*m_sodium); - m_bladderUrea = m_bladder->GetSubstanceQuantity(*m_urea); - m_leftTubulesSodium = m_leftTubules->GetSubstanceQuantity(*m_sodium); - m_rightTubulesSodium = m_rightTubules->GetSubstanceQuantity(*m_sodium); - - m_leftKidneyIntracellularLactate = m_data.GetCompartments().GetIntracellularFluid(*m_leftKidneyTissue).GetSubstanceQuantity(*m_lactate); - m_rightKidneyIntracellularLactate = m_data.GetCompartments().GetIntracellularFluid(*m_rightKidneyTissue).GetSubstanceQuantity(*m_lactate); + // Left + m_LeftGlomerularNode = m_RenalCircuit->GetNode(BGE::RenalNode::LeftGlomerularCapillaries); + m_LeftNetGlomerularCapillariesNode = m_RenalCircuit->GetNode(BGE::RenalNode::LeftNetGlomerularCapillaries); + m_LeftBowmansNode = m_RenalCircuit->GetNode(BGE::RenalNode::LeftBowmansCapsules); + m_LeftNetBowmansCapsulesNode = m_RenalCircuit->GetNode(BGE::RenalNode::LeftNetBowmansCapsules); + m_LeftPeritubularNode = m_RenalCircuit->GetNode(BGE::RenalNode::LeftPeritubularCapillaries); + m_LeftNetPeritubularCapillariesNode = m_RenalCircuit->GetNode(BGE::RenalNode::LeftNetPeritubularCapillaries); + m_LeftTubulesNode = m_RenalCircuit->GetNode(BGE::RenalNode::LeftTubules); + m_LeftNetTubulesNode = m_RenalCircuit->GetNode(BGE::RenalNode::LeftNetTubules); + m_LeftRenalArteryNode = m_RenalCircuit->GetNode(BGE::RenalNode::LeftRenalArtery); + // Right + m_RightGlomerularNode = m_RenalCircuit->GetNode(BGE::RenalNode::RightGlomerularCapillaries); + m_RightNetGlomerularCapillariesNode = m_RenalCircuit->GetNode(BGE::RenalNode::RightNetGlomerularCapillaries); + m_RightBowmansNode = m_RenalCircuit->GetNode(BGE::RenalNode::RightBowmansCapsules); + m_RightNetBowmansCapsulesNode = m_RenalCircuit->GetNode(BGE::RenalNode::RightNetBowmansCapsules); + m_RightPeritubularNode = m_RenalCircuit->GetNode(BGE::RenalNode::RightPeritubularCapillaries); + m_RightNetPeritubularCapillariesNode = m_RenalCircuit->GetNode(BGE::RenalNode::RightNetPeritubularCapillaries); + m_RightTubulesNode = m_RenalCircuit->GetNode(BGE::RenalNode::RightTubules); + m_RightNetTubulesNode = m_RenalCircuit->GetNode(BGE::RenalNode::RightNetTubules); + m_RightRenalArteryNode = m_RenalCircuit->GetNode(BGE::RenalNode::RightRenalArtery); + // Individual + m_BladderNode = m_RenalCircuit->GetNode(BGE::RenalNode::Bladder); + // Left + m_LeftGlomerularOsmoticSourcePath = m_RenalCircuit->GetPath(BGE::RenalPath::LeftGlomerularCapillariesToNetGlomerularCapillaries); + m_LeftBowmansOsmoticSourcePath = m_RenalCircuit->GetPath(BGE::RenalPath::LeftBowmansCapsulesToNetBowmansCapsules); + m_LeftReabsorptionResistancePath = m_RenalCircuit->GetPath(BGE::RenalPath::LeftNetTubulesToNetPeritubularCapillaries); + m_LeftTubulesOsmoticSourcePath = m_RenalCircuit->GetPath(BGE::RenalPath::LeftTubulesToNetTubules); + m_LeftPeritubularOsmoticSourcePath = m_RenalCircuit->GetPath(BGE::RenalPath::LeftPeritubularCapillariesToNetPeritubularCapillaries); + m_LeftUreterPath = m_RenalCircuit->GetPath(BGE::RenalPath::LeftTubulesToUreter); + m_LeftGlomerularFilterResistancePath = m_RenalCircuit->GetPath(BGE::RenalPath::LeftNetGlomerularCapillariesToNetBowmansCapsules); + m_LeftAfferentArteriolePath = m_RenalCircuit->GetPath(BGE::RenalPath::LeftAfferentArterioleToGlomerularCapillaries); + m_LeftTubulesPath = m_RenalCircuit->GetPath(BGE::RenalPath::LeftBowmansCapsulesToTubules); + m_LeftEfferentArteriolePath = m_RenalCircuit->GetPath(BGE::RenalPath::LeftEfferentArterioleToPeritubularCapillaries); + + // Right + m_RightGlomerularOsmoticSourcePath = m_RenalCircuit->GetPath(BGE::RenalPath::RightGlomerularCapillariesToNetGlomerularCapillaries); + m_RightBowmansOsmoticSourcePath = m_RenalCircuit->GetPath(BGE::RenalPath::RightBowmansCapsulesToNetBowmansCapsules); + m_RightReabsorptionResistancePath = m_RenalCircuit->GetPath(BGE::RenalPath::RightNetTubulesToNetPeritubularCapillaries); + m_RightTubulesOsmoticSourcePath = m_RenalCircuit->GetPath(BGE::RenalPath::RightTubulesToNetTubules); + m_RightPeritubularOsmoticSourcePath = m_RenalCircuit->GetPath(BGE::RenalPath::RightPeritubularCapillariesToNetPeritubularCapillaries); + m_RightUreterPath = m_RenalCircuit->GetPath(BGE::RenalPath::RightTubulesToUreter); + m_RightGlomerularFilterResistancePath = m_RenalCircuit->GetPath(BGE::RenalPath::RightNetGlomerularCapillariesToNetBowmansCapsules); + m_RightAfferentArteriolePath = m_RenalCircuit->GetPath(BGE::RenalPath::RightAfferentArterioleToGlomerularCapillaries); + m_RightTubulesPath = m_RenalCircuit->GetPath(BGE::RenalPath::RightBowmansCapsulesToTubules); + m_RightEfferentArteriolePath = m_RenalCircuit->GetPath(BGE::RenalPath::RightEfferentArterioleToPeritubularCapillaries); + // Individual + m_BladderToGroundPressurePath = m_RenalCircuit->GetPath(BGE::RenalPath::BladderToGroundPressure); + m_UrethraPath = m_RenalCircuit->GetPath(BGE::RenalPath::BladderToGroundUrinate); + + m_AortaLactate = m_Aorta->GetSubstanceQuantity(*m_Lactate); + + m_LeftPeritubularGlucose = m_LeftPeritubular->GetSubstanceQuantity(*m_Glucose); + m_LeftPeritubularPotassium = m_LeftPeritubular->GetSubstanceQuantity(*m_Potassium); + m_LeftUreterLactate = m_LeftUreter->GetSubstanceQuantity(*m_Lactate); + m_LeftUreterPotassium = m_LeftUreter->GetSubstanceQuantity(*m_Potassium); + + m_RightPeritubularGlucose = m_RightPeritubular->GetSubstanceQuantity(*m_Glucose); + m_RightPeritubularPotassium = m_RightPeritubular->GetSubstanceQuantity(*m_Potassium); + m_RightUreterLactate = m_RightUreter->GetSubstanceQuantity(*m_Lactate); + m_RightUreterPotassium = m_RightUreter->GetSubstanceQuantity(*m_Potassium); + + m_BladderAlbumin = m_Bladder->GetSubstanceQuantity(*m_Albumin); + m_BladderGlucose = m_Bladder->GetSubstanceQuantity(*m_Glucose); + m_BladderPotassium = m_Bladder->GetSubstanceQuantity(*m_Potassium); + m_BladderSodium = m_Bladder->GetSubstanceQuantity(*m_Sodium); + m_BladderUrea = m_Bladder->GetSubstanceQuantity(*m_Urea); + m_LeftTubulesSodium = m_LeftTubules->GetSubstanceQuantity(*m_Sodium); + m_RightTubulesSodium = m_RightTubules->GetSubstanceQuantity(*m_Sodium); + + m_LeftKidneyIntracellularLactate = m_data.GetCompartments().GetIntracellularFluid(*m_LeftKidneyTissue).GetSubstanceQuantity(*m_Lactate); + m_RightKidneyIntracellularLactate = m_data.GetCompartments().GetIntracellularFluid(*m_RightKidneyTissue).GetSubstanceQuantity(*m_Lactate); } //-------------------------------------------------------------------------------------------------- @@ -456,9 +410,9 @@ void Renal::AtSteadyState() } if (m_data.GetState() == EngineState::AtSecondaryStableState) { - //We were letting the substances flow out to get the initial concentrations correct - //We want to do this out of the pressure source, not the urethra to ensure the flow bringing substances into the compartment is the same as the flow taking it out - //But now we're stable and want to start filling the bladder, so make substances stay in bladder as they come in with the fluid + // We were letting the substances flow out to get the initial concentrations correct + // We want to do this out of the pressure source, not the urethra to ensure the flow bringing substances into the compartment is the same as the flow taking it out + // But now we're stable and want to start filling the bladder, so make substances stay in bladder as they come in with the fluid SELiquidCompartmentGraph* renalGraph = &m_data.GetCompartments().GetRenalGraph(); SELiquidCompartmentGraph* combinedCardiovascularGraph = &m_data.GetCompartments().GetActiveCardiovascularGraph(); renalGraph->RemoveLink(BGE::UrineLink::BladderToGroundSource); @@ -499,7 +453,7 @@ void Renal::PreProcess() //-------------------------------------------------------------------------------------------------- void Renal::Process() { - //Circuit Processing is done on the entire circulatory circuit elsewhere + // Circuit Processing is done on the entire circulatory circuit elsewhere CalculateActiveTransport(); CalculateVitalSigns(); } @@ -514,7 +468,7 @@ void Renal::Process() //-------------------------------------------------------------------------------------------------- void Renal::PostProcess() { - //Circuit PostProcessing is done on the entire circulatory circuit elsewhere + // Circuit PostProcessing is done on the entire circulatory circuit elsewhere if (m_data.GetActions().GetPatientActions().HasOverride() && m_data.GetState() == EngineState::Active) { if (m_data.GetActions().GetPatientActions().GetOverride()->HasRenalOverride()) { @@ -534,11 +488,11 @@ void Renal::PostProcess() //-------------------------------------------------------------------------------------------------- void Renal::CalculateUltrafiltrationFeedback() { - //Tuning parameters + // Tuning parameters double glomerularOsmoticSensitivity = 1.0; double bowmansOsmoticSensitivity = 1.0; - //Get substances + // Get substances SEFluidCircuitPath* glomerularOsmoticSourcePath = nullptr; SEFluidCircuitPath* bowmansOsmoticSourcePath = nullptr; SEFluidCircuitPath* filterResistancePath = nullptr; @@ -546,30 +500,30 @@ void Renal::CalculateUltrafiltrationFeedback() double permeability_mL_Per_s_Per_mmHg_Per_m2 = 0.0; double surfaceArea_m2 = 0.0; - //Do it separate for both kidneys + // Do it separate for both kidneys for (unsigned int kidney = 0; kidney < 2; kidney++) { if (kidney == 0) { - //LEFT - filterResistancePath = m_leftGlomerularFilterResistancePath; + // LEFT + filterResistancePath = m_LeftGlomerularFilterResistancePath; permeability_mL_Per_s_Per_mmHg_Per_m2 = GetLeftGlomerularFluidPermeability().GetValue(VolumePerTimePressureAreaUnit::mL_Per_s_mmHg_m2); surfaceArea_m2 = GetLeftGlomerularFiltrationSurfaceArea().GetValue(AreaUnit::m2); - glomerularOsmoticSourcePath = m_leftGlomerularOsmoticSourcePath; - bowmansOsmoticSourcePath = m_leftBowmansOsmoticSourcePath; - glomerularCapillaries = m_leftGlomerular; + glomerularOsmoticSourcePath = m_LeftGlomerularOsmoticSourcePath; + bowmansOsmoticSourcePath = m_LeftBowmansOsmoticSourcePath; + glomerularCapillaries = m_LeftGlomerular; } else { - //RIGHT - filterResistancePath = m_rightGlomerularFilterResistancePath; + // RIGHT + filterResistancePath = m_RightGlomerularFilterResistancePath; permeability_mL_Per_s_Per_mmHg_Per_m2 = GetRightGlomerularFluidPermeability().GetValue(VolumePerTimePressureAreaUnit::mL_Per_s_mmHg_m2); surfaceArea_m2 = GetRightGlomerularFiltrationSurfaceArea().GetValue(AreaUnit::m2); - glomerularOsmoticSourcePath = m_rightGlomerularOsmoticSourcePath; - bowmansOsmoticSourcePath = m_rightBowmansOsmoticSourcePath; - glomerularCapillaries = m_rightGlomerular; + glomerularOsmoticSourcePath = m_RightGlomerularOsmoticSourcePath; + bowmansOsmoticSourcePath = m_RightBowmansOsmoticSourcePath; + glomerularCapillaries = m_RightGlomerular; } - //Set the filter resistance based on its physical properties - //This is the Capillary Filtration Coefficient + // Set the filter resistance based on its physical properties + // This is the Capillary Filtration Coefficient double filterResistance_mmHg_s_Per_mL = filterResistancePath->GetNextResistance().GetValue(FlowResistanceUnit::mmHg_s_Per_mL); if (permeability_mL_Per_s_Per_mmHg_Per_m2 != 0 && surfaceArea_m2 != 0) filterResistance_mmHg_s_Per_mL = 1 / (permeability_mL_Per_s_Per_mmHg_Per_m2 * surfaceArea_m2); @@ -581,12 +535,12 @@ void Renal::CalculateUltrafiltrationFeedback() filterResistancePath->GetNextResistance().SetValue(filterResistance_mmHg_s_Per_mL, FlowResistanceUnit::mmHg_s_Per_mL); glomerularCapillaries->GetSubstanceQuantity(m_data.GetSubstances().GetAlbumin())->GetConcentration(); - //Modify the pressure on both sides of the filter based on the protein (Albumin) concentration - //This is the osmotic pressure effect + // Modify the pressure on both sides of the filter based on the protein (Albumin) concentration + // This is the osmotic pressure effect ///\todo turn on colloid osmotic pressure once substances have been handled properly (and GI) // CACHE THIS SUBSTANCE QUANTITY IN SETUP CalculateColloidOsmoticPressure(glomerularCapillaries->GetSubstanceQuantity(m_data.GetSubstances().GetAlbumin())->GetConcentration(), glomerularOsmoticSourcePath->GetNextPressureSource()); - //CalculateColloidOsmoticPressure(bowmansNode->GetSubstanceQuantity(m_albumin)->GetNextConcentration(), bowmansOsmoticSourcePath->GetNextPressureSource()); + // CalculateColloidOsmoticPressure(bowmansNode->GetSubstanceQuantity(m_Albumin)->GetNextConcentration(), bowmansOsmoticSourcePath->GetNextPressureSource()); } } @@ -600,19 +554,19 @@ void Renal::CalculateUltrafiltrationFeedback() //-------------------------------------------------------------------------------------------------- void Renal::CalculateReabsorptionFeedback() { - //Tuning parameters + // Tuning parameters double peritubularOsmoticSensitivity = 1.0; double tubulesOsmoticSensitivity = 1.0; - //Determine the permeability - //Only allow water to be reabsorbed more easily - //adjust permeability base upon arterial pressure + // Determine the permeability + // Only allow water to be reabsorbed more easily + // adjust permeability base upon arterial pressure CalculateFluidPermeability(); - //Modify the permeability based on plasma sodium concentration - //This needs to come after CalculateFluidPermeability + // Modify the permeability based on plasma sodium concentration + // This needs to come after CalculateFluidPermeability CalculateOsmoreceptorFeedback(); - //Get substances + // Get substances SEFluidCircuitPath* peritubularOsmoticSourcePath = nullptr; SEFluidCircuitPath* tubulesOsmoticSourcePath = nullptr; SEFluidCircuitPath* filterResistancePath = nullptr; @@ -622,33 +576,33 @@ void Renal::CalculateReabsorptionFeedback() double permeability_mL_Per_s_Per_mmHg_Per_m2 = 0.0; double surfaceArea_m2 = 0.0; - //Do it separate for both kidneys + // Do it separate for both kidneys for (unsigned int kidney = 0; kidney < 2; kidney++) { if (kidney == 0) { - //LEFT - filterResistancePath = m_leftReabsorptionResistancePath; + // LEFT + filterResistancePath = m_LeftReabsorptionResistancePath; permeability_mL_Per_s_Per_mmHg_Per_m2 = GetLeftTubularReabsorptionFluidPermeability().GetValue(VolumePerTimePressureAreaUnit::mL_Per_s_mmHg_m2); surfaceArea_m2 = GetLeftTubularReabsorptionFiltrationSurfaceArea().GetValue(AreaUnit::m2); - peritubularOsmoticSourcePath = m_leftPeritubularOsmoticSourcePath; - tubulesOsmoticSourcePath = m_leftTubulesOsmoticSourcePath; - peritubularCapillaries = m_leftPeritubular; + peritubularOsmoticSourcePath = m_LeftPeritubularOsmoticSourcePath; + tubulesOsmoticSourcePath = m_LeftTubulesOsmoticSourcePath; + peritubularCapillaries = m_LeftPeritubular; renalInterstitial = m_data.GetCompartments().GetLiquidCompartment(BGE::ExtravascularCompartment::LeftKidneyExtracellular); } else { - //RIGHT - filterResistancePath = m_rightReabsorptionResistancePath; + // RIGHT + filterResistancePath = m_RightReabsorptionResistancePath; permeability_mL_Per_s_Per_mmHg_Per_m2 = GetRightTubularReabsorptionFluidPermeability().GetValue(VolumePerTimePressureAreaUnit::mL_Per_s_mmHg_m2); surfaceArea_m2 = GetRightTubularReabsorptionFiltrationSurfaceArea().GetValue(AreaUnit::m2); - peritubularOsmoticSourcePath = m_rightPeritubularOsmoticSourcePath; - tubulesOsmoticSourcePath = m_rightTubulesOsmoticSourcePath; - peritubularCapillaries = m_rightPeritubular; + peritubularOsmoticSourcePath = m_RightPeritubularOsmoticSourcePath; + tubulesOsmoticSourcePath = m_RightTubulesOsmoticSourcePath; + peritubularCapillaries = m_RightPeritubular; renalInterstitial = m_data.GetCompartments().GetLiquidCompartment(BGE::ExtravascularCompartment::RightKidneyExtracellular); } - //Set the filter resistance based on its physical properties - //This is the Capillary Filtration Coefficient - //We'll just assume this linear relationship for now + // Set the filter resistance based on its physical properties + // This is the Capillary Filtration Coefficient + // We'll just assume this linear relationship for now double filterResistance_mmHg_s_Per_mL = filterResistancePath->GetNextResistance().GetValue(FlowResistanceUnit::mmHg_s_Per_mL); if (permeability_mL_Per_s_Per_mmHg_Per_m2 != 0 && surfaceArea_m2 != 0) filterResistance_mmHg_s_Per_mL = 1 / (permeability_mL_Per_s_Per_mmHg_Per_m2 * surfaceArea_m2); @@ -656,14 +610,14 @@ void Renal::CalculateReabsorptionFeedback() filterResistance_mmHg_s_Per_mL = m_CVOpenResistance_mmHg_s_Per_mL; filterResistancePath->GetNextResistance().SetValue(filterResistance_mmHg_s_Per_mL, FlowResistanceUnit::mmHg_s_Per_mL); - //Modify the pressure on both sides of the filter based on the protein (Albumin) concentration - //This is the osmotic pressure effect + // Modify the pressure on both sides of the filter based on the protein (Albumin) concentration + // This is the osmotic pressure effect ///\todo turn on colloid osmotic pressure once substances have been handled properly (and GI) // CACHE THIS SUBSTANCE QUANTITY IN SETUP - //CalculateColloidOsmoticPressure(peritubularCapillaries->GetSubstanceQuantity(m_data.GetSubstances().GetAlbumin())->GetConcentration(), peritubularOsmoticSourcePath->GetNextPressureSource()); - //Since we're not modeling the interstitial space, we'll just always keep this side constant - //We just won't touch it and let it use the baseline value - //CalculateColloidOsmoticPressure(renalInterstitial->GetSubstanceQuantity(m_data.GetSubstances().GetAlbumin())->GetConcentration(), tubulesOsmoticSourcePath->GetNextPressureSource()); + // CalculateColloidOsmoticPressure(peritubularCapillaries->GetSubstanceQuantity(m_data.GetSubstances().GetAlbumin())->GetConcentration(), peritubularOsmoticSourcePath->GetNextPressureSource()); + // Since we're not modeling the interstitial space, we'll just always keep this side constant + // We just won't touch it and let it use the baseline value + // CalculateColloidOsmoticPressure(renalInterstitial->GetSubstanceQuantity(m_data.GetSubstances().GetAlbumin())->GetConcentration(), tubulesOsmoticSourcePath->GetNextPressureSource()); tubulesOsmoticSourcePath->GetNextPressureSource().SetValue(-15.0, PressureUnit::mmHg); } } @@ -680,7 +634,7 @@ void Renal::CalculateReabsorptionFeedback() //-------------------------------------------------------------------------------------------------- void Renal::CalculateGluconeogenesis() { - //Whatever Lactate shows up in the Ureter (i.e. what's excreted) is converted to Glucose and put in the TubularCapillaries (i.e. reabsorbed) + // Whatever Lactate shows up in the Ureter (i.e. what's excreted) is converted to Glucose and put in the TubularCapillaries (i.e. reabsorbed) SEFluidCircuitNode* tubulesNode = nullptr; SELiquidSubstanceQuantity* peritubularGlucose = nullptr; @@ -691,29 +645,29 @@ void Renal::CalculateGluconeogenesis() double totalLactateExcretionRate_mg_Per_s = 0.0; double lactateExcreted_mg = 0; - //Do it separate for both kidneys + // Do it separate for both kidneys for (unsigned int kidney = 0; kidney < 2; kidney++) { double glucoseReabsorptionMass_mg = 0.0; if (kidney == 0) { - //LEFT - ureterLactate = m_leftUreterLactate; - peritubularGlucose = m_leftPeritubularGlucose; + // LEFT + ureterLactate = m_LeftUreterLactate; + peritubularGlucose = m_LeftPeritubularGlucose; glucoseReabsorptionMass_mg = m_SubstanceTransport.leftGlucoseReabsorptionMass_mg; lactateExcreted_mg = m_SubstanceTransport.leftLactateExcretedMass_mg; } else { - //RIGHT - ureterLactate = m_rightUreterLactate; - peritubularGlucose = m_rightPeritubularGlucose; + // RIGHT + ureterLactate = m_RightUreterLactate; + peritubularGlucose = m_RightPeritubularGlucose; glucoseReabsorptionMass_mg = m_SubstanceTransport.rightGlucoseReabsorptionMass_mg; lactateExcreted_mg = m_SubstanceTransport.rightLactateExcretedMass_mg; } double reabsorptionRate_mg_Per_s = (lactateExcreted_mg + glucoseReabsorptionMass_mg) / m_dt; - //Convert 1-to-1 Lactate to Glucose and put in PeritubularCapillaries - //If Converted Glucose + Reabsorbed Glucose > TM, the difference is excreted as Lactate - if (!m_glucose->GetClearance().GetRenalTransportMaximum().IsInfinity()) { - double transportMaximum_mg_Per_s = m_glucose->GetClearance().GetRenalTransportMaximum(MassPerTimeUnit::mg_Per_s); + // Convert 1-to-1 Lactate to Glucose and put in PeritubularCapillaries + // If Converted Glucose + Reabsorbed Glucose > TM, the difference is excreted as Lactate + if (!m_Glucose->GetClearance().GetRenalTransportMaximum().IsInfinity()) { + double transportMaximum_mg_Per_s = m_Glucose->GetClearance().GetRenalTransportMaximum(MassPerTimeUnit::mg_Per_s); reabsorptionRate_mg_Per_s = std::min(reabsorptionRate_mg_Per_s, transportMaximum_mg_Per_s); } @@ -722,37 +676,37 @@ void Renal::CalculateGluconeogenesis() double lactateConverted_mg = massToMove_mg - glucoseReabsorptionMass_mg; lactateExcreted_mg = massToMove_mg - (lactateExcreted_mg + glucoseReabsorptionMass_mg); - //Increment & decrement + // Increment & decrement ureterLactate->GetMass().IncrementValue(-lactateConverted_mg, MassUnit::mg); peritubularGlucose->GetMass().IncrementValue(lactateConverted_mg, MassUnit::mg); - //Sometimes we pull everything out of the ureterNode, but get a super small negative mass - //Just make that super small negative mass zero + // Sometimes we pull everything out of the ureterNode, but get a super small negative mass + // Just make that super small negative mass zero if (ureterLactate->GetMass().IsNegative()) { ureterLactate->GetMass().SetValue(0.0, MassUnit::mg); } - //Calculate new concentrations + // Calculate new concentrations ureterLactate->Balance(BalanceLiquidBy::Mass); peritubularGlucose->Balance(BalanceLiquidBy::Mass); - //Set the substance output values + // Set the substance output values totalReabsorptionRate_mg_Per_s += reabsorptionRate_mg_Per_s; totalLactateExcretionRate_mg_Per_s += lactateExcreted_mg / m_dt; } - //Set the substance output values - m_lactate->GetClearance().GetRenalExcretionRate().SetValue(totalLactateExcretionRate_mg_Per_s, MassPerTimeUnit::mg_Per_s); + // Set the substance output values + m_Lactate->GetClearance().GetRenalExcretionRate().SetValue(totalLactateExcretionRate_mg_Per_s, MassPerTimeUnit::mg_Per_s); - double plasmaConcentration_mg_Per_mL = m_aortaLactate->GetConcentration().GetValue(MassPerVolumeUnit::mg_Per_mL); - double patientWeight_kg = m_patient->GetWeight(MassUnit::kg); - m_lactate->GetClearance().GetRenalClearance().SetValue(totalLactateExcretionRate_mg_Per_s / plasmaConcentration_mg_Per_mL / patientWeight_kg, VolumePerTimeMassUnit::mL_Per_s_kg); + double plasmaConcentration_mg_Per_mL = m_AortaLactate->GetConcentration().GetValue(MassPerVolumeUnit::mg_Per_mL); + double patientWeight_kg = m_Patient->GetWeight(MassUnit::kg); + m_Lactate->GetClearance().GetRenalClearance().SetValue(totalLactateExcretionRate_mg_Per_s / plasmaConcentration_mg_Per_mL / patientWeight_kg, VolumePerTimeMassUnit::mL_Per_s_kg); double singleExcreted_mg = totalLactateExcretionRate_mg_Per_s * m_dt * 0.5; // We are assuming the kidneys are each doing the same amount of work - m_leftKidneyIntracellularLactate->GetMassExcreted().IncrementValue(singleExcreted_mg, MassUnit::mg); - m_leftKidneyIntracellularLactate->GetMassCleared().IncrementValue(singleExcreted_mg, MassUnit::mg); - m_rightKidneyIntracellularLactate->GetMassExcreted().IncrementValue(singleExcreted_mg, MassUnit::mg); - m_rightKidneyIntracellularLactate->GetMassCleared().IncrementValue(singleExcreted_mg, MassUnit::mg); + m_LeftKidneyIntracellularLactate->GetMassExcreted().IncrementValue(singleExcreted_mg, MassUnit::mg); + m_LeftKidneyIntracellularLactate->GetMassCleared().IncrementValue(singleExcreted_mg, MassUnit::mg); + m_RightKidneyIntracellularLactate->GetMassExcreted().IncrementValue(singleExcreted_mg, MassUnit::mg); + m_RightKidneyIntracellularLactate->GetMassCleared().IncrementValue(singleExcreted_mg, MassUnit::mg); } //-------------------------------------------------------------------------------------------------- @@ -788,24 +742,24 @@ void Renal::CalculateActiveTransport() unsigned int i = 0; for (SESubstance* sub : m_data.GetCompartments().GetLiquidCompartmentSubstances()) { - if (sub->GetClassification()==mil::tatrc::physiology::datamodel::enumSubstanceClass::WholeBlood) { + if (sub->GetClassification() == SESubstanceClass::WholeBlood) { CalculateGolmerularReabsorption(*sub); } if (!sub->HasClearance()) continue; if (!sub->GetClearance().HasRenalDynamic()) continue; - if (sub->GetClearance().GetRenalDynamic() == RenalDynamic::Regulation) { - //This is the generic methodology + if (sub->GetClearance().GetRenalDynamic() == RenalDynamicsType::Regulation) { + // This is the generic methodology CalculateGlomerularTransport(*sub); CalculateReabsorptionTransport(*sub); - if (sub == m_potassium) { + if (sub == m_Potassium) { CalculateSecretion(); } CalculateExcretion(*sub); - } else if (sub->GetClearance().GetRenalDynamic() == RenalDynamic::Clearance) { - //This bypasses the generic methodology and just automatically clears + } else if (sub->GetClearance().GetRenalDynamic() == RenalDynamicsType::Clearance) { + // This bypasses the generic methodology and just automatically clears CalculateAutomaticClearance(*sub); } else { /// \error Fatal: Unrecognized renal clearance type @@ -813,7 +767,7 @@ void Renal::CalculateActiveTransport() } } - //Convert excreted Lactate to Glucose + // Convert excreted Lactate to Glucose CalculateGluconeogenesis(); } @@ -836,18 +790,18 @@ void Renal::CalculateGlomerularTransport(SESubstance& sub) double filtrationRate_mg_Per_s = 0.0; - //Do it separate for both kidneys + // Do it separate for both kidneys for (unsigned int kidney = 0; kidney < 2; kidney++) { if (kidney == 0) { - //LEFT - glomerular = m_leftGlomerular; - bowmans = m_leftBowmans; - filterResistancePath = m_leftGlomerularFilterResistancePath; + // LEFT + glomerular = m_LeftGlomerular; + bowmans = m_LeftBowmans; + filterResistancePath = m_LeftGlomerularFilterResistancePath; } else { - //RIGHT - glomerular = m_rightGlomerular; - bowmans = m_rightBowmans; - filterResistancePath = m_rightGlomerularFilterResistancePath; + // RIGHT + glomerular = m_RightGlomerular; + bowmans = m_RightBowmans; + filterResistancePath = m_RightGlomerularFilterResistancePath; } if (!sub.GetClearance().HasGlomerularFilterability()) { CalculateFilterability(sub); @@ -857,42 +811,42 @@ void Renal::CalculateGlomerularTransport(SESubstance& sub) SELiquidSubstanceQuantity* bowmansSubQ = bowmans->GetSubstanceQuantity(sub); SELiquidSubstanceQuantity* glomerularSubQ = glomerular->GetSubstanceQuantity(sub); - //Now do the transport + // Now do the transport double concentration_mg_Per_mL = glomerularSubQ->GetConcentration().GetValue(MassPerVolumeUnit::mg_Per_mL); double flow_mL_Per_s = filterResistancePath->GetNextFlow().GetValue(VolumePerTimeUnit::mL_Per_s); - //Don't allow back flow + // Don't allow back flow if (flow_mL_Per_s < 0.0) { continue; } - //Determine how much is unbound - i.e. available to move + // Determine how much is unbound - i.e. available to move double fractionUnbound = sub.GetClearance().GetFractionUnboundInPlasma().GetValue(); double massToMove_mg = concentration_mg_Per_mL * flow_mL_Per_s * m_dt * filterability * fractionUnbound; - //Make sure we don't try to move too much + // Make sure we don't try to move too much massToMove_mg = std::min(massToMove_mg, glomerularSubQ->GetMass().GetValue(MassUnit::mg)); - //Increment & decrement + // Increment & decrement glomerularSubQ->GetMass().IncrementValue(-massToMove_mg, MassUnit::mg); bowmansSubQ->GetMass().IncrementValue(massToMove_mg, MassUnit::mg); - //Sometimes we pull everything out of the Glomerular, but get a super small negative mass - //Just make that super small negative mass zero + // Sometimes we pull everything out of the Glomerular, but get a super small negative mass + // Just make that super small negative mass zero if (glomerularSubQ->GetMass().GetValue(MassUnit::mg) < 0.0) { glomerularSubQ->GetMass().SetValue(0.0, MassUnit::mg); } - //Calculate new concentrations + // Calculate new concentrations glomerularSubQ->Balance(BalanceLiquidBy::Mass); bowmansSubQ->Balance(BalanceLiquidBy::Mass); - //Set the substance output values + // Set the substance output values filtrationRate_mg_Per_s += massToMove_mg / m_dt; } - //Set the substance output values + // Set the substance output values sub.GetClearance().GetRenalFiltrationRate().SetValue(filtrationRate_mg_Per_s, MassPerTimeUnit::mg_Per_s); } @@ -918,26 +872,26 @@ void Renal::CalculateSecretion() for (unsigned int kidney = 0; kidney < 2; kidney++) { if (kidney == 0) { - //LEFT - ureterPotassium = m_leftUreterPotassium; - peritubularPotassium = m_leftPeritubularPotassium; - peritubularVolume_dL = m_leftPeritubular->GetVolume().GetValue(VolumeUnit::dL); + // LEFT + ureterPotassium = m_LeftUreterPotassium; + peritubularPotassium = m_LeftPeritubularPotassium; + peritubularVolume_dL = m_LeftPeritubular->GetVolume().GetValue(VolumeUnit::dL); } else { - //RIGHT - ureterPotassium = m_rightUreterPotassium; - peritubularPotassium = m_rightPeritubularPotassium; - peritubularVolume_dL = m_rightPeritubular->GetVolume().GetValue(VolumeUnit::dL); + // RIGHT + ureterPotassium = m_RightUreterPotassium; + peritubularPotassium = m_RightPeritubularPotassium; + peritubularVolume_dL = m_RightPeritubular->GetVolume().GetValue(VolumeUnit::dL); } - //grab current concentration and volume, + // grab current concentration and volume, potassiumConcentration_g_Per_dL = peritubularPotassium->GetConcentration().GetValue(MassPerVolumeUnit::g_Per_dL); - //only do if current levels of potassium are too high: - if (potassiumConcentration_g_Per_dL > m_baselinePotassiumConcentration_g_Per_dL) { - //calculate mass to move in mg: - massPotassiumToMove_mg = (potassiumConcentration_g_Per_dL - m_baselinePotassiumConcentration_g_Per_dL) * peritubularVolume_dL; + // only do if current levels of potassium are too high: + if (potassiumConcentration_g_Per_dL > m_BaselinePotassiumConcentration_g_Per_dL) { + // calculate mass to move in mg: + massPotassiumToMove_mg = (potassiumConcentration_g_Per_dL - m_BaselinePotassiumConcentration_g_Per_dL) * peritubularVolume_dL; - //Increment & decrement + // Increment & decrement peritubularPotassium->GetMass().IncrementValue(-massPotassiumToMove_mg, MassUnit::mg); ureterPotassium->GetMass().IncrementValue(massPotassiumToMove_mg, MassUnit::mg); @@ -945,7 +899,7 @@ void Renal::CalculateSecretion() if (peritubularPotassium->GetMass().IsNegative()) peritubularPotassium->GetMass().SetValue(0.0, MassUnit::mg); - //Calculate new concentrations + // Calculate new concentrations ureterPotassium->Balance(BalanceLiquidBy::Mass); peritubularPotassium->Balance(BalanceLiquidBy::Mass); } @@ -965,29 +919,29 @@ void Renal::CalculateSecretion() void Renal::CalculateFilterability(SESubstance& sub) { double molarMass_g_Per_mol = sub.GetMolarMass(MassPerAmountUnit::g_Per_mol); - //Determine the molecular radius using a best fit equation + // Determine the molecular radius using a best fit equation double molecularRadius_nm = 0.0348 * std::pow(molarMass_g_Per_mol, 0.4175); - //Determine how well this substance transports with respect to water - //There are three best fit curves that vary by molecule charge + // Determine how well this substance transports with respect to water + // There are three best fit curves that vary by molecule charge double filterability = 0.0; - //Everything below a certain size is 1.0, and everything above is 0.0 + // Everything below a certain size is 1.0, and everything above is 0.0 if (molecularRadius_nm < 1.8) { filterability = 1.0; } else if (molecularRadius_nm > 4.4) { filterability = 0.0; } else { switch (sub.GetClearance().GetChargeInBlood()) { - case CDM::enumCharge::Positive: + case SECharge::Positive: filterability = 0.0386 * std::pow(molecularRadius_nm, 4.0) - 0.431 * std::pow(molecularRadius_nm, 3.0) + 1.61 * std::pow(molecularRadius_nm, 2.0) - 2.6162 * molecularRadius_nm + 2.607; break; - case CDM::enumCharge::Neutral: + case SECharge::Neutral: filterability = -0.0908 * std::pow(molecularRadius_nm, 4.0) + 1.2135 * std::pow(molecularRadius_nm, 3.0) - 5.76 * std::pow(molecularRadius_nm, 2.0) + 11.013 * molecularRadius_nm - 6.2792; break; - case CDM::enumCharge::Negative: - //Subtracting 0.01 to account for not enough significant digits given by the best fit - tuned looking at data table from report and confirmed for Albumin + case SECharge::Negative: + // Subtracting 0.01 to account for not enough significant digits given by the best fit - tuned looking at data table from report and confirmed for Albumin filterability = 0.0616 * std::pow(molecularRadius_nm, 4.0) - 0.8781 * std::pow(molecularRadius_nm, 3.0) + 4.6699 * std::pow(molecularRadius_nm, 2.0) - 10.995 * molecularRadius_nm + 9.6959 - 0.01; break; @@ -996,10 +950,10 @@ void Renal::CalculateFilterability(SESubstance& sub) } } - //Bound it + // Bound it filterability = LIMIT(filterability, 0.0, 1.0); - //Set the substance output values + // Set the substance output values sub.GetClearance().GetGlomerularFilterability().SetValue(filterability); } @@ -1010,7 +964,7 @@ void Renal::CalculateFilterability(SESubstance& sub) /// \param sub Substance to be calculated /// /// \details -/// This function determines how much of a substance is reabsorbed each time step back into the vasculature. +/// This function determines how much of a substance is reabsorbed each time step back into the vasculature. /// Because of the way the generic substance transporter runs, it will move substance mass into some spaces /// it shouldn't be, this routine fixes this minor error. May get depricated in future re-design of the substance /// transporter. @@ -1022,27 +976,26 @@ void Renal::CalculateGolmerularReabsorption(SESubstance& sub) for (unsigned int kidney = 0; kidney < 2; kidney++) { if (kidney == 0) { - //LEFT - bowmansSubQ = m_leftTubules->GetSubstanceQuantity(sub); - glomerularSubQ = m_leftPeritubular->GetSubstanceQuantity(sub); - } - else { - //RIGHT - bowmansSubQ = m_rightTubules->GetSubstanceQuantity(sub); - glomerularSubQ = m_rightPeritubular->GetSubstanceQuantity(sub); + // LEFT + bowmansSubQ = m_LeftTubules->GetSubstanceQuantity(sub); + glomerularSubQ = m_LeftPeritubular->GetSubstanceQuantity(sub); + } else { + // RIGHT + bowmansSubQ = m_RightTubules->GetSubstanceQuantity(sub); + glomerularSubQ = m_RightPeritubular->GetSubstanceQuantity(sub); } - //we can assume the check for whole blood already happened in active transport routine + // we can assume the check for whole blood already happened in active transport routine - //Increment & decrement, again we are move all the mass from the bomans space, and moving it into the glomerular cappilaries + // Increment & decrement, again we are move all the mass from the bomans space, and moving it into the glomerular cappilaries bowmansSubQ->GetMass().IncrementValue(-bowmansSubQ->GetMass().GetValue(MassUnit::mg), MassUnit::mg); glomerularSubQ->GetMass().IncrementValue(bowmansSubQ->GetMass().GetValue(MassUnit::mg), MassUnit::mg); - //double check for negative mass + // double check for negative mass if (bowmansSubQ->GetMass().IsNegative()) bowmansSubQ->GetMass().SetValue(0.0, MassUnit::mg); - //Calculate new concentrations + // Calculate new concentrations bowmansSubQ->Balance(BalanceLiquidBy::Mass); glomerularSubQ->Balance(BalanceLiquidBy::Mass); } @@ -1062,101 +1015,101 @@ void Renal::CalculateGolmerularReabsorption(SESubstance& sub) //-------------------------------------------------------------------------------------------------- void Renal::CalculateReabsorptionTransport(SESubstance& sub) { - //Tuning parameters - //Lower number = more massed moved - //double permeabilitySensitivity = 1.0; + // Tuning parameters + // Lower number = more massed moved + // double permeabilitySensitivity = 1.0; SELiquidSubstanceQuantity* tubulesSubQ = nullptr; SELiquidSubstanceQuantity* peritubularSubQ = nullptr; SEFluidCircuitPath* reabsorptionResistancePath = nullptr; double totalReabsorptionRate_mg_Per_s = 0.0; - //We'll apply the factor to the effectively make the FiltrationFraction change by the same amount - //This is determined in Osmoreceptor Feedback + // We'll apply the factor to the effectively make the FiltrationFraction change by the same amount + // This is determined in Osmoreceptor Feedback double permeabilityModificationFactor = 1.0; - //Do it separate for both kidneys + // Do it separate for both kidneys for (unsigned int kidney = 0; kidney < 2; kidney++) { if (kidney == 0) { - //LEFT + // LEFT - tubulesSubQ = m_leftTubules->GetSubstanceQuantity(sub); - peritubularSubQ = m_leftPeritubular->GetSubstanceQuantity(sub); - reabsorptionResistancePath = m_leftReabsorptionResistancePath; - //Add a factor to make substances reabsorb more or less avidly - permeabilityModificationFactor = m_leftReabsorptionPermeabilityModificationFactor; + tubulesSubQ = m_LeftTubules->GetSubstanceQuantity(sub); + peritubularSubQ = m_LeftPeritubular->GetSubstanceQuantity(sub); + reabsorptionResistancePath = m_LeftReabsorptionResistancePath; + // Add a factor to make substances reabsorb more or less avidly + permeabilityModificationFactor = m_LeftReabsorptionPermeabilityModificationFactor; } else { - //RIGHT - tubulesSubQ = m_rightTubules->GetSubstanceQuantity(sub); - peritubularSubQ = m_rightPeritubular->GetSubstanceQuantity(sub); - reabsorptionResistancePath = m_rightReabsorptionResistancePath; - //Add a factor to make substances reabsorb more or less avidly - permeabilityModificationFactor = m_rightReabsorptionPermeabilityModificationFactor; + // RIGHT + tubulesSubQ = m_RightTubules->GetSubstanceQuantity(sub); + peritubularSubQ = m_RightPeritubular->GetSubstanceQuantity(sub); + reabsorptionResistancePath = m_RightReabsorptionResistancePath; + // Add a factor to make substances reabsorb more or less avidly + permeabilityModificationFactor = m_RightReabsorptionPermeabilityModificationFactor; } - //Now do the transport + // Now do the transport double concentration_mg_Per_mL = tubulesSubQ->GetConcentration().GetValue(MassPerVolumeUnit::mg_Per_mL); double flow_mL_Per_s = reabsorptionResistancePath->GetNextFlow().GetValue(VolumePerTimeUnit::mL_Per_s); - //Don't allow back flow + // Don't allow back flow if (flow_mL_Per_s < 0.0) { continue; } - //Get the ratio of how this substance moves with water flow + // Get the ratio of how this substance moves with water flow double massToMove_mg = 0.0; if (sub.GetClearance().GetRenalReabsorptionRatio().IsInfinity()) { - //Infinity, so move all the mass + // Infinity, so move all the mass massToMove_mg = tubulesSubQ->GetMass().GetValue(MassUnit::mg); - } else //Not Infinity + } else // Not Infinity { double reabsorptionRatio = sub.GetClearance().GetRenalReabsorptionRatio().GetValue(); double massModification = 1.0 / permeabilityModificationFactor; - //limit the ratio to 1 to allow for concentrated urine + // limit the ratio to 1 to allow for concentrated urine massModification = std::min(massModification, 1.0); massToMove_mg = concentration_mg_Per_mL * flow_mL_Per_s * m_dt * reabsorptionRatio * massModification; } - //Make sure we don't try to move too much + // Make sure we don't try to move too much massToMove_mg = std::min(massToMove_mg, tubulesSubQ->GetMass().GetValue(MassUnit::mg)); double reabsorptionRate_mg_Per_s = massToMove_mg / m_dt; - //Stay below the maximum allowable transport + // Stay below the maximum allowable transport if (!sub.GetClearance().GetRenalTransportMaximum().IsInfinity()) { double transportMaximum_mg_Per_s = sub.GetClearance().GetRenalTransportMaximum().GetValue(MassPerTimeUnit::mg_Per_s); reabsorptionRate_mg_Per_s = std::min(reabsorptionRate_mg_Per_s, transportMaximum_mg_Per_s); } - //Store information about glucose to be used later in Gluconeogenesis - if (&sub == m_glucose) { + // Store information about glucose to be used later in Gluconeogenesis + if (&sub == m_Glucose) { if (kidney == 0) { - //Left + // Left m_SubstanceTransport.leftGlucoseReabsorptionMass_mg = massToMove_mg; } else { - //Right + // Right m_SubstanceTransport.rightGlucoseReabsorptionMass_mg = massToMove_mg; } } - //Increment & decrement + // Increment & decrement tubulesSubQ->GetMass().IncrementValue(-massToMove_mg, MassUnit::mg); peritubularSubQ->GetMass().IncrementValue(massToMove_mg, MassUnit::mg); - //Sometimes we pull everything out of the Tubules, but get a super small negative mass - //Just make that super small negative mass zero + // Sometimes we pull everything out of the Tubules, but get a super small negative mass + // Just make that super small negative mass zero if (tubulesSubQ->GetMass().IsNegative()) tubulesSubQ->GetMass().SetValue(0.0, MassUnit::mg); - //Calculate new concentrations + // Calculate new concentrations tubulesSubQ->Balance(BalanceLiquidBy::Mass); peritubularSubQ->Balance(BalanceLiquidBy::Mass); - //Set the substance output values + // Set the substance output values totalReabsorptionRate_mg_Per_s += reabsorptionRate_mg_Per_s; } - //Set the substance output values + // Set the substance output values sub.GetClearance().GetRenalReabsorptionRate().SetValue(totalReabsorptionRate_mg_Per_s, MassPerTimeUnit::mg_Per_s); } @@ -1172,7 +1125,7 @@ void Renal::CalculateReabsorptionTransport(SESubstance& sub) //-------------------------------------------------------------------------------------------------- void Renal::CalculateExcretion(SESubstance& sub) { - //This will always be a time-step behind + // This will always be a time-step behind SELiquidCompartment* tubules = nullptr; SEFluidCircuitPath* excretionPath = nullptr; @@ -1180,30 +1133,30 @@ void Renal::CalculateExcretion(SESubstance& sub) for (unsigned int kidney = 0; kidney < 2; kidney++) { if (kidney == 0) { - //LEFT - tubules = m_leftTubules; - excretionPath = m_leftUreterPath; + // LEFT + tubules = m_LeftTubules; + excretionPath = m_LeftUreterPath; } else { - //RIGHT - tubules = m_rightTubules; - excretionPath = m_rightUreterPath; + // RIGHT + tubules = m_RightTubules; + excretionPath = m_RightUreterPath; } - //Note: this will be off a little because the concentration is a time-step behind - //We should use the "current" concentration and "next" flow, since that's what was just moved by the transporter + // Note: this will be off a little because the concentration is a time-step behind + // We should use the "current" concentration and "next" flow, since that's what was just moved by the transporter double tubulesConcentration_mg_Per_mL = tubules->GetSubstanceQuantity(sub)->GetConcentration().GetValue(MassPerVolumeUnit::mg_Per_mL); double excretionFlow_mL_Per_s = excretionPath->GetNextFlow().GetValue(VolumePerTimeUnit::mL_Per_s); double excretionRate_mg_Per_s = tubulesConcentration_mg_Per_mL * excretionFlow_mL_Per_s; - //Make sure it's not a super small negative number + // Make sure it's not a super small negative number totalExcretionRate_mg_Per_s += std::max(excretionRate_mg_Per_s, 0.0); - if (&sub == m_lactate) { + if (&sub == m_Lactate) { if (kidney == 0) { - //Left + // Left m_SubstanceTransport.leftLactateExcretedMass_mg = excretionRate_mg_Per_s * m_dt; } else { - //Right + // Right m_SubstanceTransport.rightLactateExcretedMass_mg = excretionRate_mg_Per_s * m_dt; } } @@ -1211,19 +1164,19 @@ void Renal::CalculateExcretion(SESubstance& sub) sub.GetClearance().GetRenalExcretionRate().SetValue(totalExcretionRate_mg_Per_s, MassPerTimeUnit::mg_Per_s); - double plasmaConcentration_mg_Per_mL = m_aorta->GetSubstanceQuantity(sub)->GetConcentration().GetValue(MassPerVolumeUnit::mg_Per_mL); - double patientWeight_kg = m_patient->GetWeight(MassUnit::kg); + double plasmaConcentration_mg_Per_mL = m_Aorta->GetSubstanceQuantity(sub)->GetConcentration().GetValue(MassPerVolumeUnit::mg_Per_mL); + double patientWeight_kg = m_Patient->GetWeight(MassUnit::kg); if (totalExcretionRate_mg_Per_s <= 0.0 || patientWeight_kg <= 0.0) { sub.GetClearance().GetRenalClearance().SetValue(0.0, VolumePerTimeMassUnit::mL_Per_s_kg); } else sub.GetClearance().GetRenalClearance().SetValue(totalExcretionRate_mg_Per_s / plasmaConcentration_mg_Per_mL / patientWeight_kg, VolumePerTimeMassUnit::mL_Per_s_kg); - //Set substance compartment effects - //Gluconeogenesis calculates it for Lactate later - if (&sub != m_lactate) { - SELiquidSubstanceQuantity* leftKidneySubQ = m_data.GetCompartments().GetIntracellularFluid(*m_leftKidneyTissue).GetSubstanceQuantity(sub); - SELiquidSubstanceQuantity* rightKidneySubQ = m_data.GetCompartments().GetIntracellularFluid(*m_rightKidneyTissue).GetSubstanceQuantity(sub); + // Set substance compartment effects + // Gluconeogenesis calculates it for Lactate later + if (&sub != m_Lactate) { + SELiquidSubstanceQuantity* leftKidneySubQ = m_data.GetCompartments().GetIntracellularFluid(*m_LeftKidneyTissue).GetSubstanceQuantity(sub); + SELiquidSubstanceQuantity* rightKidneySubQ = m_data.GetCompartments().GetIntracellularFluid(*m_RightKidneyTissue).GetSubstanceQuantity(sub); double singleExcreted_mg = totalExcretionRate_mg_Per_s * m_dt * 0.5; // We are assuming the kindneys are doing the same amount of work leftKidneySubQ->GetMassExcreted().IncrementValue(singleExcreted_mg, MassUnit::mg); @@ -1245,31 +1198,31 @@ void Renal::CalculateExcretion(SESubstance& sub) //-------------------------------------------------------------------------------------------------- void Renal::CalculateAutomaticClearance(SESubstance& sub) { - double patientWeight_kg = m_patient->GetWeight(MassUnit::kg); + double patientWeight_kg = m_Patient->GetWeight(MassUnit::kg); double renalVolumeCleared_mL = 0.0; SESubstanceClearance& clearance = sub.GetClearance(); if (clearance.GetRenalClearance().IsZero()) - return; //nothing to do + return; // nothing to do - //Renal Volume Cleared - Clearance happens through the renal system + // Renal Volume Cleared - Clearance happens through the renal system renalVolumeCleared_mL = (clearance.GetRenalClearance().GetValue(VolumePerTimeMassUnit::mL_Per_s_kg) * patientWeight_kg * m_dt) / 2; double massCleared_ug = 0.0; - //Right Kidney Clearance - m_data.GetSubstances().CalculateGenericClearance(renalVolumeCleared_mL, *m_rightKidneyTissue, sub, &m_spCleared); - massCleared_ug += m_spCleared.GetValue(MassUnit::ug); + // Right Kidney Clearance + m_data.GetSubstances().CalculateGenericClearance(renalVolumeCleared_mL, *m_RightKidneyTissue, sub, &m_SPCleared); + massCleared_ug += m_SPCleared.GetValue(MassUnit::ug); - //Left Kidney Clearance - m_data.GetSubstances().CalculateGenericClearance(renalVolumeCleared_mL, *m_leftKidneyTissue, sub, &m_spCleared); - massCleared_ug += m_spCleared.GetValue(MassUnit::ug); + // Left Kidney Clearance + m_data.GetSubstances().CalculateGenericClearance(renalVolumeCleared_mL, *m_LeftKidneyTissue, sub, &m_SPCleared); + massCleared_ug += m_SPCleared.GetValue(MassUnit::ug); - //Put it in the bladder - //We don't have to determine RenalClearance, because we just implement the already determined value - //We won't set the excretion, since we don't know filtration or reabsorption - SELiquidSubstanceQuantity* subQ = m_bladder->GetSubstanceQuantity(sub); + // Put it in the bladder + // We don't have to determine RenalClearance, because we just implement the already determined value + // We won't set the excretion, since we don't know filtration or reabsorption + SELiquidSubstanceQuantity* subQ = m_Bladder->GetSubstanceQuantity(sub); subQ->GetMass().IncrementValue(massCleared_ug, MassUnit::ug); subQ->Balance(BalanceLiquidBy::Mass); } @@ -1284,12 +1237,12 @@ void Renal::CalculateAutomaticClearance(SESubstance& sub) //-------------------------------------------------------------------------------------------------- void Renal::CalculateVitalSigns() { - //A lot of the system data has already been set elsewhere - //Set the stuff that was not + // A lot of the system data has already been set elsewhere + // Set the stuff that was not double hematocrit = m_data.GetBloodChemistry().GetHematocrit().GetValue(); - //Do it separate for both kidneys + // Do it separate for both kidneys for (unsigned int kidney = 0; kidney < 2; kidney++) { SEFluidCircuitPath* glomerularOsmoticSourcePath = nullptr; SEFluidCircuitPath* bowmansOsmoticSourcePath = nullptr; @@ -1309,23 +1262,23 @@ void Renal::CalculateVitalSigns() SEFluidCircuitNode* netTubulesNode = nullptr; if (kidney == 0) { - //LEFT - filterResistancePath = m_leftGlomerularFilterResistancePath; - glomerularOsmoticSourcePath = m_leftPeritubularOsmoticSourcePath; - bowmansOsmoticSourcePath = m_leftBowmansOsmoticSourcePath; - glomerularNode = m_leftGlomerularNode; - bowmansNode = m_leftBowmansNode; - netGlomerularCapillariesNode = m_leftNetGlomerularCapillariesNode; - netBowmansCapsulesNode = m_leftNetBowmansCapsulesNode; - netPeritubularNode = m_leftNetPeritubularCapillariesNode; - netTubulesNode = m_leftNetTubulesNode; - reabsorptionResistancePath = m_leftReabsorptionResistancePath; - peritubularOsmoticSourcePath = m_leftPeritubularOsmoticSourcePath; - tubulesOsmoticSourcePath = m_leftTubulesOsmoticSourcePath; - peritubularNode = m_leftPeritubularNode; - tubulesNode = m_leftTubulesNode; - afferentArteriolePath = m_leftAfferentArteriolePath; - efferentArteriolePath = m_leftEfferentArteriolePath; + // LEFT + filterResistancePath = m_LeftGlomerularFilterResistancePath; + glomerularOsmoticSourcePath = m_LeftPeritubularOsmoticSourcePath; + bowmansOsmoticSourcePath = m_LeftBowmansOsmoticSourcePath; + glomerularNode = m_LeftGlomerularNode; + bowmansNode = m_LeftBowmansNode; + netGlomerularCapillariesNode = m_LeftNetGlomerularCapillariesNode; + netBowmansCapsulesNode = m_LeftNetBowmansCapsulesNode; + netPeritubularNode = m_LeftNetPeritubularCapillariesNode; + netTubulesNode = m_LeftNetTubulesNode; + reabsorptionResistancePath = m_LeftReabsorptionResistancePath; + peritubularOsmoticSourcePath = m_LeftPeritubularOsmoticSourcePath; + tubulesOsmoticSourcePath = m_LeftTubulesOsmoticSourcePath; + peritubularNode = m_LeftPeritubularNode; + tubulesNode = m_LeftTubulesNode; + afferentArteriolePath = m_LeftAfferentArteriolePath; + efferentArteriolePath = m_LeftEfferentArteriolePath; GetLeftAfferentArterioleResistance().Set(afferentArteriolePath->GetNextResistance()); GetLeftEfferentArterioleResistance().Set(efferentArteriolePath->GetNextResistance()); @@ -1357,7 +1310,7 @@ void Renal::CalculateVitalSigns() filtrationCoefficient = GetLeftReabsorptionRate().GetValue(VolumePerTimeUnit::mL_Per_s) / GetLeftNetReabsorptionPressure().GetValue(PressureUnit::mmHg); GetLeftReabsorptionFiltrationCoefficient().SetValue(filtrationCoefficient, VolumePerTimePressureUnit::mL_Per_s_mmHg); - afferentArteriolePath = m_leftAfferentArteriolePath; + afferentArteriolePath = m_LeftAfferentArteriolePath; double renalBloodFlow_mL_Per_s = afferentArteriolePath->GetNextFlow().GetValue(VolumePerTimeUnit::mL_Per_s); double renalPlasmaFlow_mL_Per_s = renalBloodFlow_mL_Per_s * (1.0 - hematocrit); @@ -1367,23 +1320,23 @@ void Renal::CalculateVitalSigns() GetLeftFiltrationFraction().SetValue(filtrationFraction); } else { - //RIGHT - filterResistancePath = m_rightGlomerularFilterResistancePath; - glomerularOsmoticSourcePath = m_rightPeritubularOsmoticSourcePath; - bowmansOsmoticSourcePath = m_rightBowmansOsmoticSourcePath; - glomerularNode = m_rightGlomerularNode; - bowmansNode = m_rightBowmansNode; - netGlomerularCapillariesNode = m_rightNetGlomerularCapillariesNode; - netBowmansCapsulesNode = m_rightNetBowmansCapsulesNode; - netPeritubularNode = m_rightNetPeritubularCapillariesNode; - netTubulesNode = m_rightNetTubulesNode; - reabsorptionResistancePath = m_rightReabsorptionResistancePath; - peritubularOsmoticSourcePath = m_rightPeritubularOsmoticSourcePath; - tubulesOsmoticSourcePath = m_rightTubulesOsmoticSourcePath; - peritubularNode = m_rightPeritubularNode; - tubulesNode = m_rightTubulesNode; - afferentArteriolePath = m_rightAfferentArteriolePath; - efferentArteriolePath = m_rightEfferentArteriolePath; + // RIGHT + filterResistancePath = m_RightGlomerularFilterResistancePath; + glomerularOsmoticSourcePath = m_RightPeritubularOsmoticSourcePath; + bowmansOsmoticSourcePath = m_RightBowmansOsmoticSourcePath; + glomerularNode = m_RightGlomerularNode; + bowmansNode = m_RightBowmansNode; + netGlomerularCapillariesNode = m_RightNetGlomerularCapillariesNode; + netBowmansCapsulesNode = m_RightNetBowmansCapsulesNode; + netPeritubularNode = m_RightNetPeritubularCapillariesNode; + netTubulesNode = m_RightNetTubulesNode; + reabsorptionResistancePath = m_RightReabsorptionResistancePath; + peritubularOsmoticSourcePath = m_RightPeritubularOsmoticSourcePath; + tubulesOsmoticSourcePath = m_RightTubulesOsmoticSourcePath; + peritubularNode = m_RightPeritubularNode; + tubulesNode = m_RightTubulesNode; + afferentArteriolePath = m_RightAfferentArteriolePath; + efferentArteriolePath = m_RightEfferentArteriolePath; GetRightAfferentArterioleResistance().Set(afferentArteriolePath->GetNextResistance()); GetRightEfferentArterioleResistance().Set(efferentArteriolePath->GetNextResistance()); @@ -1415,7 +1368,7 @@ void Renal::CalculateVitalSigns() filtrationCoefficient = GetRightReabsorptionRate().GetValue(VolumePerTimeUnit::mL_Per_s) / GetRightNetReabsorptionPressure().GetValue(PressureUnit::mmHg); GetRightReabsorptionFiltrationCoefficient().SetValue(filtrationCoefficient, VolumePerTimePressureUnit::mL_Per_s_mmHg); - afferentArteriolePath = m_rightAfferentArteriolePath; + afferentArteriolePath = m_RightAfferentArteriolePath; double renalBloodFlow_mL_Per_s = afferentArteriolePath->GetNextFlow().GetValue(VolumePerTimeUnit::mL_Per_s); double renalPlasmaFlow_mL_Per_s = renalBloodFlow_mL_Per_s * (1.0 - hematocrit); double filtrationFraction = 0.0; @@ -1428,28 +1381,28 @@ void Renal::CalculateVitalSigns() if (m_data.GetActions().GetPatientActions().HasBurnWound() && (m_data.GetActions().GetPatientActions().GetBurnWound()->HasCompartment("Trunk"))) { double tissueIntegrity = m_data.GetBloodChemistry().GetInflammatoryResponse().GetTissueIntegrity().GetValue(); double bladderPressure = m_data.GetCircuits().GetRenalCircuit().GetNode(BGE::RenalNode::Bladder)->GetPressure().GetValue(PressureUnit::mmHg); - double bladderPressureMultiplier = (((-1.0 * tissueIntegrity) + 1.0) * 5.25) + 1.0; //Asymptotic relation to tissue integirty, max increase of 6.25 (5.25+1.0) + double bladderPressureMultiplier = (((-1.0 * tissueIntegrity) + 1.0) * 5.25) + 1.0; // Asymptotic relation to tissue integirty, max increase of 6.25 (5.25+1.0) GetBladderPressure().SetValue(bladderPressure * bladderPressureMultiplier, PressureUnit::mmHg); } GetGlomerularFiltrationRate().SetValue(GetLeftGlomerularFiltrationRate().GetValue(VolumePerTimeUnit::mL_Per_s) + GetRightGlomerularFiltrationRate().GetValue(VolumePerTimeUnit::mL_Per_s), VolumePerTimeUnit::mL_Per_s); - double renalBloodFlow_mL_Per_s = m_rightAfferentArteriolePath->GetNextFlow().GetValue(VolumePerTimeUnit::mL_Per_s) + m_leftAfferentArteriolePath->GetNextFlow().GetValue(VolumePerTimeUnit::mL_Per_s); + double renalBloodFlow_mL_Per_s = m_RightAfferentArteriolePath->GetNextFlow().GetValue(VolumePerTimeUnit::mL_Per_s) + m_LeftAfferentArteriolePath->GetNextFlow().GetValue(VolumePerTimeUnit::mL_Per_s); GetRenalBloodFlow().SetValue(renalBloodFlow_mL_Per_s, VolumePerTimeUnit::mL_Per_s); GetRenalPlasmaFlow().SetValue(renalBloodFlow_mL_Per_s * (1.0 - hematocrit), VolumePerTimeUnit::mL_Per_s); - double pressureDiff_mmHg = m_aorta->GetPressure(PressureUnit::mmHg) - m_venaCava->GetPressure(PressureUnit::mmHg); + double pressureDiff_mmHg = m_Aorta->GetPressure(PressureUnit::mmHg) - m_VenaCava->GetPressure(PressureUnit::mmHg); if (renalBloodFlow_mL_Per_s != 0.0) GetRenalVascularResistance().SetValue(pressureDiff_mmHg / renalBloodFlow_mL_Per_s, FlowResistanceUnit::mmHg_s_Per_mL); else GetRenalVascularResistance().SetValue(m_CVOpenResistance_mmHg_s_Per_mL, FlowResistanceUnit::mmHg_s_Per_mL); - //Do the urine specific values - GetUrineVolume().SetValue(m_bladderNode->GetNextVolume().GetValue(VolumeUnit::mL), VolumeUnit::mL); - double urineProductionRate_mL_Per_s = m_leftUreterPath->GetNextFlow().GetValue(VolumePerTimeUnit::mL_Per_s) + m_rightUreterPath->GetNextFlow().GetValue(VolumePerTimeUnit::mL_Per_s); + // Do the urine specific values + GetUrineVolume().SetValue(m_BladderNode->GetNextVolume().GetValue(VolumeUnit::mL), VolumeUnit::mL); + double urineProductionRate_mL_Per_s = m_LeftUreterPath->GetNextFlow().GetValue(VolumePerTimeUnit::mL_Per_s) + m_RightUreterPath->GetNextFlow().GetValue(VolumePerTimeUnit::mL_Per_s); GetUrineProductionRate().SetValue(urineProductionRate_mL_Per_s, VolumePerTimeUnit::mL_Per_s); - //Mean urine output -- tracks urine production w/ time-weighted parameter (larger number weights more recent values more heavily) + // Mean urine output -- tracks urine production w/ time-weighted parameter (larger number weights more recent values more heavily) const double sampleWeight = 0.05; double lastMeanUrineOutput_mL_Per_s = GetMeanUrineOutput(VolumePerTimeUnit::mL_Per_s); double dMeanUrineOutput_mL_Per_s_s = sampleWeight * (urineProductionRate_mL_Per_s - lastMeanUrineOutput_mL_Per_s); @@ -1457,20 +1410,20 @@ void Renal::CalculateVitalSigns() // Urine specific gravity is calculated by dividing the mass of all the substances in a fluid & the fluid itself by the weight of just the fluid SEScalarMass substanceMass; - for (SELiquidSubstanceQuantity* subQ : m_bladder->GetSubstanceQuantities()) { + for (SELiquidSubstanceQuantity* subQ : m_Bladder->GetSubstanceQuantities()) { if (subQ->HasMass()) substanceMass.Increment(subQ->GetMass()); } - //increment water mass onto substance mass to get total mass: + // increment water mass onto substance mass to get total mass: GeneralMath::CalculateSpecificGravity(substanceMass, GetUrineVolume(), GetUrineSpecificGravity()); // Urine osmolality is the osmotic pressure of sodium, glucose and urea over the weight of the fluid - - GeneralMath::CalculateOsmolality(m_bladderSodium->GetMolarity(), m_bladderPotassium->GetMolarity(), m_bladderGlucose->GetMolarity(), m_bladderUrea->GetMolarity(), GetUrineSpecificGravity(), GetUrineOsmolality()); - GeneralMath::CalculateOsmolarity(m_bladderSodium->GetMolarity(), m_bladderPotassium->GetMolarity(), m_bladderGlucose->GetMolarity(), m_bladderUrea->GetMolarity(), GetUrineOsmolarity()); - double urineUreaConcentration_g_Per_L = m_bladderUrea->GetConcentration(MassPerVolumeUnit::g_Per_L); - //2.14 = MW Urea(60) / MW N2 (2*14) + + GeneralMath::CalculateOsmolality(m_BladderSodium->GetMolarity(), m_BladderPotassium->GetMolarity(), m_BladderGlucose->GetMolarity(), m_BladderUrea->GetMolarity(), GetUrineSpecificGravity(), GetUrineOsmolality()); + GeneralMath::CalculateOsmolarity(m_BladderSodium->GetMolarity(), m_BladderPotassium->GetMolarity(), m_BladderGlucose->GetMolarity(), m_BladderUrea->GetMolarity(), GetUrineOsmolarity()); + double urineUreaConcentration_g_Per_L = m_BladderUrea->GetConcentration(MassPerVolumeUnit::g_Per_L); + // 2.14 = MW Urea(60) / MW N2 (2*14) GetUrineUreaNitrogenConcentration().SetValue(urineUreaConcentration_g_Per_L / 2.14, MassPerVolumeUnit::g_Per_L); double filtrationFraction = 0.0; @@ -1482,74 +1435,74 @@ void Renal::CalculateVitalSigns() // Only calculate the running average when not urinating, since the production rate shuts off during urination // This will keep the events from freaking out when urinating if (m_Urinating == false) { - m_urineProductionRate_mL_Per_min_runningAvg.Sample(Convert(urineProductionRate_mL_Per_s, VolumePerTimeUnit::mL_Per_s, VolumePerTimeUnit::mL_Per_min)); - m_urineOsmolarity_mOsm_Per_L_runningAvg.Sample(GetUrineOsmolarity(OsmolarityUnit::mOsm_Per_L)); - m_sodiumExcretionRate_mg_Per_min_runningAvg.Sample(m_sodium->GetClearance().GetRenalExcretionRate(MassPerTimeUnit::mg_Per_min)); + m_UrineProductionRate_mL_Per_min.Sample(Convert(urineProductionRate_mL_Per_s, VolumePerTimeUnit::mL_Per_s, VolumePerTimeUnit::mL_Per_min)); + m_UrineOsmolarity_mOsm_Per_L.Sample(GetUrineOsmolarity(OsmolarityUnit::mOsm_Per_L)); + m_SodiumExcretionRate_mg_Per_min.Sample(m_Sodium->GetClearance().GetRenalExcretionRate(MassPerTimeUnit::mg_Per_min)); } - //Only check these once each cardiac cycle (using running average for entire cycle) - //Otherwise, they could turn on and off like crazy as the flows fluctuate throughout the cycle - if (m_data.GetPatient().IsEventActive(CDM::enumPatientEvent::StartOfCardiacCycle) && m_Urinating == false) { + // Only check these once each cardiac cycle (using running average for entire cycle) + // Otherwise, they could turn on and off like crazy as the flows fluctuate throughout the cycle + if (m_data.GetPatient().IsEventActive(SEPatientEventType::StartOfCardiacCycle) && m_Urinating == false) { if (m_data.GetState() > EngineState::InitialStabilization) { // Don't throw events if we are initializing - //Handle Events + // Handle Events /// \cite lahav1992intermittent /// 2.5 mL/min - if (m_urineProductionRate_mL_Per_min_runningAvg.Value() > 2.5) { + if (m_UrineProductionRate_mL_Per_min.Value() > 2.5) { /// \event Patient: Diuresis. Occurs when the urine production rate double to around 2.5 ml/min. \cite lahav1992intermittent - m_patient->SetEvent(CDM::enumPatientEvent::Diuresis, true, m_data.GetSimulationTime()); - } else if (m_urineProductionRate_mL_Per_min_runningAvg.Value() < 1.0) { + m_Patient->SetEvent(SEPatientEventType::Diuresis, true, m_data.GetSimulationTime()); + } else if (m_UrineProductionRate_mL_Per_min.Value() < 1.0) { /// \event Patient: Ends when the urine production rate falls below 1.0 mL/min (near normal urine production). \cite lahav1992intermittent - m_patient->SetEvent(CDM::enumPatientEvent::Diuresis, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::Diuresis, false, m_data.GetSimulationTime()); } /// \cite valtin1995renal /// p. 116 /// urine osmolarity must be hyperosmotic relative to plasma and urine production rate must be less than 0.5 mL/min - if (m_urineProductionRate_mL_Per_min_runningAvg.Value() < 0.5 && m_urineOsmolarity_mOsm_Per_L_runningAvg.Value() > 280) { + if (m_UrineProductionRate_mL_Per_min.Value() < 0.5 && m_UrineOsmolarity_mOsm_Per_L.Value() > 280) { /// \event Patient: Antidiuresis occurs when urine production rate is less than 0.5 mL/min and the urine osmolarity is hyperosmotic to the plasma \cite valtin1995renal - m_patient->SetEvent(CDM::enumPatientEvent::Antidiuresis, true, m_data.GetSimulationTime()); - } else if ((m_urineProductionRate_mL_Per_min_runningAvg.Value() > 0.55 || m_urineOsmolarity_mOsm_Per_L_runningAvg.Value() < 275)) { + m_Patient->SetEvent(SEPatientEventType::Antidiuresis, true, m_data.GetSimulationTime()); + } else if ((m_UrineProductionRate_mL_Per_min.Value() > 0.55 || m_UrineOsmolarity_mOsm_Per_L.Value() < 275)) { /// \event Patient: Antidiuresis. Ends when urine production rate rises back above 0.55 mL/min or the urine osmolarity falls below that of the plasma \cite valtin1995renal - m_patient->SetEvent(CDM::enumPatientEvent::Antidiuresis, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::Antidiuresis, false, m_data.GetSimulationTime()); } /// \cite Zager1988HypoperfusionRate /// Computing percent decrease as (1-1.6/11.2)*100 = 85 percent decrease or 15% total flow (using 20ml/s as "normal" value, below 3ml/s): if (renalBloodFlow_mL_Per_s < 3.0) { /// \event Patient: hypoperfusion occurs when renal blood flow decreases below 3 ml/s - m_patient->SetEvent(CDM::enumPatientEvent::RenalHypoperfusion, true, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::RenalHypoperfusion, true, m_data.GetSimulationTime()); } else if (renalBloodFlow_mL_Per_s > 4.0) { /// \event Patient: hypoperfusion ends when blood flow recovers above 4 ml/s - m_patient->SetEvent(CDM::enumPatientEvent::RenalHypoperfusion, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::RenalHypoperfusion, false, m_data.GetSimulationTime()); } /// \cite moss2014hormonal /// 1:6 ratio for sodium excretion in pressure natriuresis in rats, validation for sodium excretion = 2.4 mg/min - //sub->GetClearance()->GetRenalExcretionRate().SetValue(excretionRate_mg_Per_s, MassPerTimeUnit::mg_Per_s); + // sub->GetClearance()->GetRenalExcretionRate().SetValue(excretionRate_mg_Per_s, MassPerTimeUnit::mg_Per_s); - if (m_sodiumExcretionRate_mg_Per_min_runningAvg.Value() > 14.4) { + if (m_SodiumExcretionRate_mg_Per_min.Value() > 14.4) { /// \event Patient: Natriuresis. Occurs when the sodium excretion rate rises above 14.4 mg/min \cite moss2013hormonal - m_patient->SetEvent(CDM::enumPatientEvent::Natriuresis, true, m_data.GetSimulationTime()); - } else if (m_sodiumExcretionRate_mg_Per_min_runningAvg.Value() < 14.0) { + m_Patient->SetEvent(SEPatientEventType::Natriuresis, true, m_data.GetSimulationTime()); + } else if (m_SodiumExcretionRate_mg_Per_min.Value() < 14.0) { /// \event Patient: Ends when the sodium excretion rate falls below 14.0 mg/min \cite moss2013hormonal - m_patient->SetEvent(CDM::enumPatientEvent::Natriuresis, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::Natriuresis, false, m_data.GetSimulationTime()); } - if (m_data.GetBloodChemistry().GetInflammatoryResponse().HasInflammationSource(CDM::enumInflammationSource::Infection)) { + if (m_data.GetBloodChemistry().GetInflammatoryResponse().HasInflammationSource(SEInflammationSource::Infection)) { double systolicBP = m_data.GetCardiovascular().GetSystolicArterialPressure(PressureUnit::mmHg); if (systolicBP <= 100.0 && GetMeanUrineOutput(VolumePerTimeUnit::mL_Per_min) <= 0.5) { - m_patient->SetEvent(CDM::enumPatientEvent::SevereSepsis, true, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::SevereSepsis, true, m_data.GetSimulationTime()); } - if (m_patient->IsEventActive(CDM::enumPatientEvent::SevereSepsis) && m_urineProductionRate_mL_Per_min_runningAvg.Value() >= 0.55 && systolicBP > 90.0) { - m_patient->SetEvent(CDM::enumPatientEvent::SevereSepsis, false, m_data.GetSimulationTime()); + if (m_Patient->IsEventActive(SEPatientEventType::SevereSepsis) && m_UrineProductionRate_mL_Per_min.Value() >= 0.55 && systolicBP > 90.0) { + m_Patient->SetEvent(SEPatientEventType::SevereSepsis, false, m_data.GetSimulationTime()); } } } - //reset at start of cardiac cycle - m_urineProductionRate_mL_Per_min_runningAvg.Reset(); - m_urineOsmolarity_mOsm_Per_L_runningAvg.Reset(); - m_sodiumExcretionRate_mg_Per_min_runningAvg.Reset(); + // reset at start of cardiac cycle + m_UrineProductionRate_mL_Per_min.Reset(); + m_UrineOsmolarity_mOsm_Per_L.Reset(); + m_SodiumExcretionRate_mg_Per_min.Reset(); } } @@ -1568,10 +1521,10 @@ void Renal::Urinate() double bladderMaxVolume_mL = 400.0; GetUrinationRate().SetValue(0.0, VolumePerTimeUnit::mL_Per_min); - //Check and see if the bladder is overfull or if there is an action called - if (m_bladderNode->GetNextVolume().GetValue(VolumeUnit::mL) > bladderMaxVolume_mL) { + // Check and see if the bladder is overfull or if there is an action called + if (m_BladderNode->GetNextVolume().GetValue(VolumeUnit::mL) > bladderMaxVolume_mL) { /// \event Patient: FunctionalIncontinence: The patient's bladder has reached a maximum - m_patient->SetEvent(CDM::enumPatientEvent::FunctionalIncontinence, true, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::FunctionalIncontinence, true, m_data.GetSimulationTime()); m_Urinating = true; } @@ -1580,35 +1533,35 @@ void Renal::Urinate() m_Urinating = true; } - //Now deal with the action + // Now deal with the action if (m_Urinating) { ////Stop urinating when the bladder volume drops below 1.0 mL - //if (m_bladderNode->GetNextVolume().GetValue(VolumeUnit::mL) < 1.0) { - // m_Urinating = false; - // //The urethra resistances will use the baselines value of an open switch to stop the flow + // if (m_BladderNode->GetNextVolume().GetValue(VolumeUnit::mL) < 1.0) { + // m_Urinating = false; + // //The urethra resistances will use the baselines value of an open switch to stop the flow // //Turn off the event - // if (m_patient->IsEventActive(CDM::enumPatientEvent::FunctionalIncontinence)) { - // m_patient->SetEvent(CDM::enumPatientEvent::FunctionalIncontinence, false, m_data.GetSimulationTime()); + // if (m_Patient->IsEventActive(SEPatientEventType::FunctionalIncontinence)) { + // m_Patient->SetEvent(SEPatientEventType::FunctionalIncontinence, false, m_data.GetSimulationTime()); // } //} else { // //Prevent anything from leaving except for what's in the bladder - // m_leftUreterPath->GetNextResistance().SetValue(m_defaultOpenResistance_mmHg_s_Per_mL, FlowResistanceUnit::mmHg_s_Per_mL); - // m_rightUreterPath->GetNextResistance().SetValue(m_defaultOpenResistance_mmHg_s_Per_mL, FlowResistanceUnit::mmHg_s_Per_mL); + // m_LeftUreterPath->GetNextResistance().SetValue(m_DefaultOpenResistance_mmHg_s_Per_mL, FlowResistanceUnit::mmHg_s_Per_mL); + // m_RightUreterPath->GetNextResistance().SetValue(m_DefaultOpenResistance_mmHg_s_Per_mL, FlowResistanceUnit::mmHg_s_Per_mL); // //Reduce the urethra resistance to urinate // //Use a urethra resistance based on the validated urination flow // //R = (4 mmHg - 0 mmHg) / 22 mL/s = 0.182 - // m_urethraPath->GetNextResistance().SetValue(0.01, FlowResistanceUnit::mmHg_s_Per_mL); //0.182 + // m_UrethraPath->GetNextResistance().SetValue(0.01, FlowResistanceUnit::mmHg_s_Per_mL); //0.182 //} - m_bladderNode->GetNextVolume().SetValue(1.0, VolumeUnit::mL); + m_BladderNode->GetNextVolume().SetValue(1.0, VolumeUnit::mL); for (auto sub : m_data.GetSubstances().GetActiveSubstances()) { - if (m_bladder->GetSubstanceQuantity(*sub)->GetMass(MassUnit::ug) > ZERO_APPROX) { - m_bladder->GetSubstanceQuantity(*sub)->Balance(BalanceLiquidBy::Concentration); + if (m_Bladder->GetSubstanceQuantity(*sub)->GetMass(MassUnit::ug) > ZERO_APPROX) { + m_Bladder->GetSubstanceQuantity(*sub)->Balance(BalanceLiquidBy::Concentration); } } m_Urinating = false; - GetUrinationRate().Set(m_urethraPath->GetNextFlow()); + GetUrinationRate().Set(m_UrethraPath->GetNextFlow()); } } @@ -1624,16 +1577,16 @@ void Renal::UpdateBladderVolume() { /// \todo Eventually replace this entire thing with a compliance and model peristaltic flow - //Manually modify the bladder volume based on flow - //This will work for both filling the bladder and urinating - double bladderFlow_mL_Per_s = m_bladderToGroundPressurePath->GetNextFlow(VolumePerTimeUnit::mL_Per_s); + // Manually modify the bladder volume based on flow + // This will work for both filling the bladder and urinating + double bladderFlow_mL_Per_s = m_BladderToGroundPressurePath->GetNextFlow(VolumePerTimeUnit::mL_Per_s); double volumeIncrement_mL = bladderFlow_mL_Per_s * m_dt; - double bladderVolume_mL = m_bladderNode->GetNextVolume().GetValue(VolumeUnit::mL) + volumeIncrement_mL; + double bladderVolume_mL = m_BladderNode->GetNextVolume().GetValue(VolumeUnit::mL) + volumeIncrement_mL; - //Don't let this get below zero during urination - //The urination action will catch it next time around, so this shouldn't be hit more than once (and likely never) + // Don't let this get below zero during urination + // The urination action will catch it next time around, so this shouldn't be hit more than once (and likely never) bladderVolume_mL = std::max(bladderVolume_mL, 0.0); - m_bladderNode->GetNextVolume().SetValue(bladderVolume_mL, VolumeUnit::mL); + m_BladderNode->GetNextVolume().SetValue(bladderVolume_mL, VolumeUnit::mL); } //-------------------------------------------------------------------------------------------------- @@ -1648,9 +1601,9 @@ void Renal::UpdateBladderVolume() //-------------------------------------------------------------------------------------------------- void Renal::CalculateColloidOsmoticPressure(SEScalarMassPerVolume& albuminConcentration, SEScalarPressure& osmoticPressure) { - //We're using the Landis-Pappenheimer Equation + // We're using the Landis-Pappenheimer Equation - //Assume a typical Albumin to total protein ratio + // Assume a typical Albumin to total protein ratio double totalProteinConentration_g_Per_dL = 1.6 * albuminConcentration.GetValue(MassPerVolumeUnit::g_Per_dL); double osmoticPressure_mmHg = 2.1 * totalProteinConentration_g_Per_dL + 0.16 * std::pow(totalProteinConentration_g_Per_dL, 2.0) + 0.009 * std::pow(totalProteinConentration_g_Per_dL, 3.0); osmoticPressure.SetValue(-osmoticPressure_mmHg, PressureUnit::mmHg); @@ -1676,46 +1629,46 @@ bool Renal::CalculateUrinalysis(SEUrinalysis& u) double urineOsm_Per_kg = GetUrineOsmolality(OsmolalityUnit::mOsm_Per_kg); if (m_data.GetBloodChemistry().GetHemoglobinLostToUrine(MassUnit::g) >= 5.0) { - u.SetColorResult(CDM::enumUrineColor::Pink); + u.SetColorResult(SEUrineColor::Pink); } else if (urineOsm_Per_kg <= 400) { // Need cite for this - u.SetColorResult(CDM::enumUrineColor::PaleYellow); + u.SetColorResult(SEUrineColor::PaleYellow); } else if (urineOsm_Per_kg > 400 && urineOsm_Per_kg <= 750) { - u.SetColorResult(CDM::enumUrineColor::Yellow); + u.SetColorResult(SEUrineColor::Yellow); } else { - u.SetColorResult(CDM::enumUrineColor::DarkYellow); + u.SetColorResult(SEUrineColor::DarkYellow); } - //u.SetApperanceResult(); - double bladder_glucose_mg_Per_dL = m_bladderGlucose->GetConcentration().GetValue(MassPerVolumeUnit::mg_Per_dL); + // u.SetApperanceResult(); + double bladder_glucose_mg_Per_dL = m_BladderGlucose->GetConcentration().GetValue(MassPerVolumeUnit::mg_Per_dL); if (bladder_glucose_mg_Per_dL >= 100.0) /// \cite roxe1990urinalysis - u.SetGlucoseResult(CDM::enumPresenceIndicator::Positive); + u.SetGlucoseResult(SEPresenceIndicator::Positive); else - u.SetGlucoseResult(CDM::enumPresenceIndicator::Negative); + u.SetGlucoseResult(SEPresenceIndicator::Negative); if (bladder_glucose_mg_Per_dL >= 5.0) /// \cite roxe1990urinalysis - u.SetKetoneResult(CDM::enumPresenceIndicator::Positive); + u.SetKetoneResult(SEPresenceIndicator::Positive); else - u.SetKetoneResult(CDM::enumPresenceIndicator::Negative); + u.SetKetoneResult(SEPresenceIndicator::Negative); - //u.SetBilirubinResult(); + // u.SetBilirubinResult(); u.GetSpecificGravityResult().Set(GetUrineSpecificGravity()); if (bladder_glucose_mg_Per_dL > 0.15 || m_data.GetBloodChemistry().GetHemoglobinLostToUrine(MassUnit::g) >= 5.0) /// \cite roxe1990urinalysis - u.SetBloodResult(CDM::enumPresenceIndicator::Positive); + u.SetBloodResult(SEPresenceIndicator::Positive); else - u.SetBloodResult(CDM::enumPresenceIndicator::Negative); + u.SetBloodResult(SEPresenceIndicator::Negative); - //u.GetPHResult().Set(); + // u.GetPHResult().Set(); if (bladder_glucose_mg_Per_dL > 30.0) /// \cite roxe1990urinalysis - u.SetProteinResult(CDM::enumPresenceIndicator::Positive); + u.SetProteinResult(SEPresenceIndicator::Positive); else - u.SetProteinResult(CDM::enumPresenceIndicator::Negative); + u.SetProteinResult(SEPresenceIndicator::Negative); - //u.SetUrobilinogen(); - //u.SetNitrite(); - //u.SetLeukocyteEsterase(); + // u.SetUrobilinogen(); + // u.SetNitrite(); + // u.SetLeukocyteEsterase(); // We do not support Microscopic analysis at this time @@ -1727,10 +1680,10 @@ SEScalar& Renal::CalculateRenalSOFA() SEScalar* sofa = new SEScalar(); double sofaScore = 0.0; const double urineOutput = GetMeanUrineOutput(VolumePerTimeUnit::mL_Per_day); - //Note--Renal SOFA score for levels 1 and 2 depends on creatinine levels, which we currently do not calculate. - //Thus, we only track the most severe SOFA scores. + // Note--Renal SOFA score for levels 1 and 2 depends on creatinine levels, which we currently do not calculate. + // Thus, we only track the most severe SOFA scores. if (urineOutput >= 500.0) { - //Normal, leave sofaScore = 0.0 + // Normal, leave sofaScore = 0.0 } else if (urineOutput >= 200.0) { sofaScore = 3.0; } else { @@ -1752,47 +1705,47 @@ SEScalar& Renal::CalculateRenalSOFA() //-------------------------------------------------------------------------------------------------- void Renal::CalculateOsmoreceptorFeedback() { - //Modify the reabsorption permeability based on plasma Sodium concentration - //Note: the permeability feedback due to local pressure change has already occurred + // Modify the reabsorption permeability based on plasma Sodium concentration + // Note: the permeability feedback due to local pressure change has already occurred - //Tuning parameters + // Tuning parameters double sodiumSensitivity = 10.0; double permeability_mL_Per_s_Per_mmHg_Per_m2 = 0.0; ///\todo get the aorta osmolarity instead of sodium concentration double sodiumConcentration_mg_Per_mL = m_data.GetSubstances().GetSodium().GetBloodConcentration().GetValue(MassPerVolumeUnit::mg_Per_mL); - sodiumConcentration_mg_Per_mL = m_sodiumConcentration_mg_Per_mL_runningAvg.Sample(sodiumConcentration_mg_Per_mL); + sodiumConcentration_mg_Per_mL = m_SodiumConcentration_mg_Per_mL.Sample(sodiumConcentration_mg_Per_mL); - //Do it separate for both kidneys + // Do it separate for both kidneys for (unsigned int kidney = 0; kidney < 2; kidney++) { if (kidney == 0) { - //LEFT + // LEFT permeability_mL_Per_s_Per_mmHg_Per_m2 = GetLeftTubularReabsorptionFluidPermeability(VolumePerTimePressureAreaUnit::mL_Per_s_mmHg_m2); - m_leftReabsorptionPermeabilityModificationFactor = std::pow(sodiumConcentration_mg_Per_mL, sodiumSensitivity) / std::pow(m_sodiumPlasmaConcentrationSetpoint_mg_Per_mL, sodiumSensitivity); + m_LeftReabsorptionPermeabilityModificationFactor = std::pow(sodiumConcentration_mg_Per_mL, sodiumSensitivity) / std::pow(m_SodiumPlasmaConcentrationSetpoint_mg_Per_mL, sodiumSensitivity); - if (m_patient->IsEventActive(CDM::enumPatientEvent::StartOfCardiacCycle)) { - permeability_mL_Per_s_Per_mmHg_Per_m2 *= m_leftReabsorptionPermeabilityModificationFactor; + if (m_Patient->IsEventActive(SEPatientEventType::StartOfCardiacCycle)) { + permeability_mL_Per_s_Per_mmHg_Per_m2 *= m_LeftReabsorptionPermeabilityModificationFactor; - //Modify reabsorption resistance + // Modify reabsorption resistance GetLeftTubularReabsorptionFluidPermeability().SetValue(permeability_mL_Per_s_Per_mmHg_Per_m2, VolumePerTimePressureAreaUnit::mL_Per_s_mmHg_m2); } } else { - //RIGHT + // RIGHT permeability_mL_Per_s_Per_mmHg_Per_m2 = GetRightTubularReabsorptionFluidPermeability(VolumePerTimePressureAreaUnit::mL_Per_s_mmHg_m2); - m_rightReabsorptionPermeabilityModificationFactor = std::pow(sodiumConcentration_mg_Per_mL, sodiumSensitivity) / std::pow(m_sodiumPlasmaConcentrationSetpoint_mg_Per_mL, sodiumSensitivity); - if (m_patient->IsEventActive(CDM::enumPatientEvent::StartOfCardiacCycle)) { - permeability_mL_Per_s_Per_mmHg_Per_m2 *= m_rightReabsorptionPermeabilityModificationFactor; + m_RightReabsorptionPermeabilityModificationFactor = std::pow(sodiumConcentration_mg_Per_mL, sodiumSensitivity) / std::pow(m_SodiumPlasmaConcentrationSetpoint_mg_Per_mL, sodiumSensitivity); + if (m_Patient->IsEventActive(SEPatientEventType::StartOfCardiacCycle)) { + permeability_mL_Per_s_Per_mmHg_Per_m2 *= m_RightReabsorptionPermeabilityModificationFactor; - //Modify reabsorption resistance + // Modify reabsorption resistance GetRightTubularReabsorptionFluidPermeability().SetValue(permeability_mL_Per_s_Per_mmHg_Per_m2, VolumePerTimePressureAreaUnit::mL_Per_s_mmHg_m2); } } } - if (m_patient->IsEventActive(CDM::enumPatientEvent::StartOfCardiacCycle)) { - m_sodiumConcentration_mg_Per_mL_runningAvg.Reset(); + if (m_Patient->IsEventActive(SEPatientEventType::StartOfCardiacCycle)) { + m_SodiumConcentration_mg_Per_mL.Reset(); } } @@ -1807,129 +1760,129 @@ void Renal::CalculateOsmoreceptorFeedback() //-------------------------------------------------------------------------------------------------- void Renal::CalculateTubuloglomerularFeedback() { - //Get substances and appropriate paths and node which will be utilized in this implementation + // Get substances and appropriate paths and node which will be utilized in this implementation SEFluidCircuitPath* tubulesPath = nullptr; SEFluidCircuitPath* afferentResistancePath = nullptr; SEFluidCircuitNode* renalArteryNode = nullptr; - //set sodium flow to initially be zero + // set sodium flow to initially be zero double sodiumFlow_mg_Per_s = 0.0; double sodiumFlowSetPoint_mg_Per_s = 0.0; double sodiumConcentration_mg_Per_mL = 0.0; double tubulesFlow_mL_Per_s = 0.0; - //set max/min afferent resistance to be zero initially + // set max/min afferent resistance to be zero initially double maxAfferentResistance_mmHg_s_Per_mL = 0.0; double minAfferentResistance_mmHg_s_Per_mL = 0.0; - //Do it separate for both kidneys + // Do it separate for both kidneys for (unsigned int kidney = 0; kidney < 2; kidney++) { if (kidney == 0) { - //LEFT - afferentResistancePath = m_leftAfferentArteriolePath; - tubulesPath = m_leftTubulesPath; + // LEFT + afferentResistancePath = m_LeftAfferentArteriolePath; + tubulesPath = m_LeftTubulesPath; - //set max/min afferent equal to the member variable - maxAfferentResistance_mmHg_s_Per_mL = m_maxLeftAfferentResistance_mmHg_s_Per_mL; - minAfferentResistance_mmHg_s_Per_mL = m_minLeftAfferentResistance_mmHg_s_Per_mL; + // set max/min afferent equal to the member variable + maxAfferentResistance_mmHg_s_Per_mL = m_MaxLeftAfferentResistance_mmHg_s_Per_mL; + minAfferentResistance_mmHg_s_Per_mL = m_MinLeftAfferentResistance_mmHg_s_Per_mL; - //Get the concentration and flow rate on tubules path to compute sodium flow rate - sodiumConcentration_mg_Per_mL = m_leftTubulesSodium->GetConcentration().GetValue(MassPerVolumeUnit::mg_Per_mL); + // Get the concentration and flow rate on tubules path to compute sodium flow rate + sodiumConcentration_mg_Per_mL = m_LeftTubulesSodium->GetConcentration().GetValue(MassPerVolumeUnit::mg_Per_mL); if (tubulesPath->HasNextFlow()) { tubulesFlow_mL_Per_s = tubulesPath->GetNextFlow().GetValue(VolumePerTimeUnit::mL_Per_s); } sodiumFlow_mg_Per_s = tubulesFlow_mL_Per_s * sodiumConcentration_mg_Per_mL; - //On the off chance it's negative (like the first time-step) don't do anything + // On the off chance it's negative (like the first time-step) don't do anything if (sodiumFlow_mg_Per_s < 0.0 && m_data.GetState() <= EngineState::InitialStabilization) continue; - //Keep a running average, so the resistance doesn't go crazy - sodiumFlow_mg_Per_s = m_leftSodiumFlow_mg_Per_s_runningAvg.Sample(sodiumFlow_mg_Per_s); + // Keep a running average, so the resistance doesn't go crazy + sodiumFlow_mg_Per_s = m_LeftSodiumFlow_mg_Per_s.Sample(sodiumFlow_mg_Per_s); // Save off the last set point from initial stabilization for use after stabilization - if (m_data.GetState() == EngineState::InitialStabilization && m_patient->IsEventActive(CDM::enumPatientEvent::StartOfCardiacCycle)) { - //Don't change the resistance - just figure out what it is - m_leftSodiumFlowSetPoint_mg_Per_s = sodiumFlow_mg_Per_s; + if (m_data.GetState() == EngineState::InitialStabilization && m_Patient->IsEventActive(SEPatientEventType::StartOfCardiacCycle)) { + // Don't change the resistance - just figure out what it is + m_LeftSodiumFlowSetPoint_mg_Per_s = sodiumFlow_mg_Per_s; } - sodiumFlowSetPoint_mg_Per_s = m_leftSodiumFlowSetPoint_mg_Per_s; + sodiumFlowSetPoint_mg_Per_s = m_LeftSodiumFlowSetPoint_mg_Per_s; } else { - //RIGHT - afferentResistancePath = m_rightAfferentArteriolePath; - tubulesPath = m_rightTubulesPath; + // RIGHT + afferentResistancePath = m_RightAfferentArteriolePath; + tubulesPath = m_RightTubulesPath; - maxAfferentResistance_mmHg_s_Per_mL = m_maxRightAfferentResistance_mmHg_s_Per_mL; - minAfferentResistance_mmHg_s_Per_mL = m_minRightAfferentResistance_mmHg_s_Per_mL; + maxAfferentResistance_mmHg_s_Per_mL = m_MaxRightAfferentResistance_mmHg_s_Per_mL; + minAfferentResistance_mmHg_s_Per_mL = m_MinRightAfferentResistance_mmHg_s_Per_mL; - //Get the concentration and flow rate on tubules path to compute sodium flow rate - sodiumConcentration_mg_Per_mL = m_rightTubulesSodium->GetConcentration().GetValue(MassPerVolumeUnit::mg_Per_mL); + // Get the concentration and flow rate on tubules path to compute sodium flow rate + sodiumConcentration_mg_Per_mL = m_RightTubulesSodium->GetConcentration().GetValue(MassPerVolumeUnit::mg_Per_mL); if (tubulesPath->HasNextFlow()) { tubulesFlow_mL_Per_s = tubulesPath->GetNextFlow().GetValue(VolumePerTimeUnit::mL_Per_s); } sodiumFlow_mg_Per_s = tubulesFlow_mL_Per_s * sodiumConcentration_mg_Per_mL; - //On the off chance it's negative (like the first time-step) don't do anything + // On the off chance it's negative (like the first time-step) don't do anything if (sodiumFlow_mg_Per_s < 0.0 && m_data.GetState() < EngineState::InitialStabilization) continue; - //Keep a running average, so the resistance doesn't go crazy - sodiumFlow_mg_Per_s = m_rightSodiumFlow_mg_Per_s_runningAvg.Sample(sodiumFlow_mg_Per_s); + // Keep a running average, so the resistance doesn't go crazy + sodiumFlow_mg_Per_s = m_RightSodiumFlow_mg_Per_s.Sample(sodiumFlow_mg_Per_s); // Save off the last set point from initial stabilization for use after stabilization - if (m_data.GetState() == EngineState::InitialStabilization && m_patient->IsEventActive(CDM::enumPatientEvent::StartOfCardiacCycle)) { - //Don't change the resistance - just figure out what it is - m_rightSodiumFlowSetPoint_mg_Per_s = sodiumFlow_mg_Per_s; + if (m_data.GetState() == EngineState::InitialStabilization && m_Patient->IsEventActive(SEPatientEventType::StartOfCardiacCycle)) { + // Don't change the resistance - just figure out what it is + m_RightSodiumFlowSetPoint_mg_Per_s = sodiumFlow_mg_Per_s; } - sodiumFlowSetPoint_mg_Per_s = m_rightSodiumFlowSetPoint_mg_Per_s; + sodiumFlowSetPoint_mg_Per_s = m_RightSodiumFlowSetPoint_mg_Per_s; } - if (m_patient->IsEventActive(CDM::enumPatientEvent::StartOfCardiacCycle)) { - //Us the "current" resistance, to continually drive towards the response we want - the next value is overwritten by the baseline during postprocess + if (m_Patient->IsEventActive(SEPatientEventType::StartOfCardiacCycle)) { + // Us the "current" resistance, to continually drive towards the response we want - the next value is overwritten by the baseline during postprocess double currentAfferentResistance_mmHg_s_Per_mL = afferentResistancePath->GetResistance().GetValue(FlowResistanceUnit::mmHg_s_Per_mL); double nextAfferentResistance_mmHg_s_Per_mL = afferentResistancePath->GetNextResistance().GetValue(FlowResistanceUnit::mmHg_s_Per_mL); - //Get the amount off we are from normal + // Get the amount off we are from normal double sodiumChange = sodiumFlow_mg_Per_s - sodiumFlowSetPoint_mg_Per_s; - //normalize to reduce how dramatic the changes are (may need to add a tuning factor) + // normalize to reduce how dramatic the changes are (may need to add a tuning factor) double sodiumChangeNormal = 0.0; - //First time through this will be zero + // First time through this will be zero if (sodiumFlowSetPoint_mg_Per_s > 0.0) { sodiumChangeNormal = sodiumChange / sodiumFlowSetPoint_mg_Per_s; } - //create control statement to drive resistance to get desired sodium flow rate, damping needed to get steady flow rate + // create control statement to drive resistance to get desired sodium flow rate, damping needed to get steady flow rate double dampingFactor = 0.001; if (m_data.GetState() < EngineState::Active) { - //Make the damping factor higher to get to homeostasis faster + // Make the damping factor higher to get to homeostasis faster dampingFactor = 0.005; } nextAfferentResistance_mmHg_s_Per_mL *= currentAfferentResistance_mmHg_s_Per_mL / nextAfferentResistance_mmHg_s_Per_mL + dampingFactor * sodiumChangeNormal; BLIM(nextAfferentResistance_mmHg_s_Per_mL, minAfferentResistance_mmHg_s_Per_mL, maxAfferentResistance_mmHg_s_Per_mL); if (kidney == 0) { - //LEFT - m_leftAfferentResistance_mmHg_s_Per_mL = nextAfferentResistance_mmHg_s_Per_mL; + // LEFT + m_LeftAfferentResistance_mmHg_s_Per_mL = nextAfferentResistance_mmHg_s_Per_mL; } else { - //RIGHT - m_rightAfferentResistance_mmHg_s_Per_mL = nextAfferentResistance_mmHg_s_Per_mL; + // RIGHT + m_RightAfferentResistance_mmHg_s_Per_mL = nextAfferentResistance_mmHg_s_Per_mL; } } - //set the resistance each time step: + // set the resistance each time step: if (kidney == 0) { - //LEFT - afferentResistancePath->GetNextResistance().SetValue(m_leftAfferentResistance_mmHg_s_Per_mL, FlowResistanceUnit::mmHg_s_Per_mL); + // LEFT + afferentResistancePath->GetNextResistance().SetValue(m_LeftAfferentResistance_mmHg_s_Per_mL, FlowResistanceUnit::mmHg_s_Per_mL); } else { - //RIGHT - afferentResistancePath->GetNextResistance().SetValue(m_rightAfferentResistance_mmHg_s_Per_mL, FlowResistanceUnit::mmHg_s_Per_mL); + // RIGHT + afferentResistancePath->GetNextResistance().SetValue(m_RightAfferentResistance_mmHg_s_Per_mL, FlowResistanceUnit::mmHg_s_Per_mL); } } - //reset sodium flow at start of cardiac cycle - if (m_patient->IsEventActive(CDM::enumPatientEvent::StartOfCardiacCycle)) { - m_leftSodiumFlow_mg_Per_s_runningAvg.Reset(); - m_rightSodiumFlow_mg_Per_s_runningAvg.Reset(); + // reset sodium flow at start of cardiac cycle + if (m_Patient->IsEventActive(SEPatientEventType::StartOfCardiacCycle)) { + m_LeftSodiumFlow_mg_Per_s.Reset(); + m_RightSodiumFlow_mg_Per_s.Reset(); } } @@ -1944,7 +1897,7 @@ void Renal::CalculateTubuloglomerularFeedback() //-------------------------------------------------------------------------------------------------- void Renal::CalculateFluidPermeability() { - //fit paramerters for the third order fit + // fit paramerters for the third order fit double a = 2.00943182e-06; double b = -8.09932500e-04; double c = 9.37727091e-02; @@ -1959,63 +1912,63 @@ void Renal::CalculateFluidPermeability() for (unsigned int kidney = 0; kidney < 2; kidney++) { if (kidney == 0) { - //LEFT + // LEFT permeability_mL_Per_s_mmHg_m2 = GetLeftTubularReabsorptionFluidPermeability(VolumePerTimePressureAreaUnit::mL_Per_s_mmHg_m2); - //get the renal arterial pressure: - leftArterialPressure_mmHg = m_leftRenalArteryNode->GetNextPressure().GetValue(PressureUnit::mmHg); + // get the renal arterial pressure: + leftArterialPressure_mmHg = m_LeftRenalArteryNode->GetNextPressure().GetValue(PressureUnit::mmHg); - //take a sample so that permeability doesn't go crazy: - leftArterialPressure_mmHg = m_leftRenalArterialPressure_mmHg_runningAvg.Sample(leftArterialPressure_mmHg); + // take a sample so that permeability doesn't go crazy: + leftArterialPressure_mmHg = m_LeftRenalArterialPressure_mmHg.Sample(leftArterialPressure_mmHg); - //compute desired permeability as a function of arterial pressure, else set as baseline - if (m_patient->IsEventActive(CDM::enumPatientEvent::StartOfCardiacCycle)) { + // compute desired permeability as a function of arterial pressure, else set as baseline + if (m_Patient->IsEventActive(SEPatientEventType::StartOfCardiacCycle)) { if (round(leftArterialPressure_mmHg) >= 80.0) { permeability_mL_Per_s_mmHg_m2 = a * std::pow(leftArterialPressure_mmHg, 2) + b * leftArterialPressure_mmHg + c; } else { - permeability_mL_Per_s_mmHg_m2 = m_leftReabsorptionPermeabilitySetpoint_mL_Per_s_mmHg_m2; + permeability_mL_Per_s_mmHg_m2 = m_LeftReabsorptionPermeabilitySetpoint_mL_Per_s_mmHg_m2; } } - //cap permeability to bound tubules reabsorption resistance: + // cap permeability to bound tubules reabsorption resistance: if (permeability_mL_Per_s_mmHg_m2 < 0.01) { permeability_mL_Per_s_mmHg_m2 = 0.01; } - //set the permeability (modifier should only change computed permeability if diuretics are circulating): + // set the permeability (modifier should only change computed permeability if diuretics are circulating): GetLeftTubularReabsorptionFluidPermeability().SetValue(tubularPermeabilityModifier * permeability_mL_Per_s_mmHg_m2, VolumePerTimePressureAreaUnit::mL_Per_s_mmHg_m2); } else { - //RIGHT + // RIGHT permeability_mL_Per_s_mmHg_m2 = GetRightTubularReabsorptionFluidPermeability(VolumePerTimePressureAreaUnit::mL_Per_s_mmHg_m2); - //get the renal arterial pressure: - rightArterialPressure_mmHg = m_rightRenalArteryNode->GetNextPressure().GetValue(PressureUnit::mmHg); + // get the renal arterial pressure: + rightArterialPressure_mmHg = m_RightRenalArteryNode->GetNextPressure().GetValue(PressureUnit::mmHg); - //take a sample so that permeability doesn't go crazy: - rightArterialPressure_mmHg = m_rightRenalArterialPressure_mmHg_runningAvg.Sample(rightArterialPressure_mmHg); + // take a sample so that permeability doesn't go crazy: + rightArterialPressure_mmHg = m_RightRenalArterialPressure_mmHg.Sample(rightArterialPressure_mmHg); - //compute desired permeability as a function of arterial pressure, else set as baseline - if (m_patient->IsEventActive(CDM::enumPatientEvent::StartOfCardiacCycle)) { + // compute desired permeability as a function of arterial pressure, else set as baseline + if (m_Patient->IsEventActive(SEPatientEventType::StartOfCardiacCycle)) { if (round(rightArterialPressure_mmHg) >= 80.0) { permeability_mL_Per_s_mmHg_m2 = a * std::pow(rightArterialPressure_mmHg, 2) + b * rightArterialPressure_mmHg + c; } else { - permeability_mL_Per_s_mmHg_m2 = m_rightReabsorptionPermeabilitySetpoint_mL_Per_s_mmHg_m2; + permeability_mL_Per_s_mmHg_m2 = m_RightReabsorptionPermeabilitySetpoint_mL_Per_s_mmHg_m2; } } - //cap permeability to bound tubules reabsorption resistance: + // cap permeability to bound tubules reabsorption resistance: if (permeability_mL_Per_s_mmHg_m2 < 0.01) { permeability_mL_Per_s_mmHg_m2 = 0.01; } - //set the permeability: + // set the permeability: GetRightTubularReabsorptionFluidPermeability().SetValue(tubularPermeabilityModifier * permeability_mL_Per_s_mmHg_m2, VolumePerTimePressureAreaUnit::mL_Per_s_mmHg_m2); } } - //reset average at start of cardiac cycle - if (m_patient->IsEventActive(CDM::enumPatientEvent::StartOfCardiacCycle)) { - m_leftRenalArterialPressure_mmHg_runningAvg.Reset(); - m_rightRenalArterialPressure_mmHg_runningAvg.Reset(); + // reset average at start of cardiac cycle + if (m_Patient->IsEventActive(SEPatientEventType::StartOfCardiacCycle)) { + m_LeftRenalArterialPressure_mmHg.Reset(); + m_RightRenalArterialPressure_mmHg.Reset(); } } @@ -2081,46 +2034,46 @@ void Renal::OverrideControlLoop() { auto override = m_data.GetActions().GetPatientActions().GetOverride(); - constexpr double maxLeftAAROverride = 1.0; //mmHg_min_Per_mL - constexpr double minLeftAAROverride = 0.0; //mmHg_min_Per_mL - constexpr double maxLeftGFROverride = 1000.0; //mL/min - constexpr double minLeftGFROverride = 0.0; //mL/min - constexpr double maxLeftReabsorRateOverride = 1000.0; //mL/min - constexpr double minLeftReabsorRateOverride = 0.0; //mL/min - constexpr double maxRenalBloodFlowOverride = 3000.0; //mL/min - constexpr double minRenalBloodFlowOverride = 0.0; //mL/min - constexpr double maxRenalPlasmaFlowOverride = 3000.0; //mL/min - constexpr double minRenalPlasmaFlowOverride = 0.0; //mL/min - constexpr double maxRightAAROverride = 1.0; //mmHg_min_Per_mL - constexpr double minRightAAROverride = 0.0; //mmHg_min_Per_mL - constexpr double maxRightGFROverride = 1000.0; //mL/min - constexpr double minRightGFROverride = 0.0; //mL/min - constexpr double maxRightReabsorRateOverride = 1000.0; //mL/min - constexpr double minRightReabsorRateOverride = 0.0; //mL/min - constexpr double maxUrinationRateOverride = 1000.0; //mL/min - constexpr double minUrinationRateOverride = 0.0; //mL/min - constexpr double maxUrineProductionOverride = 100.0; //mL/min - constexpr double minUrineProductionOverride = 0.0; //mL/min - constexpr double maxUrineOsmolalityOverride = 2000.0; //mOsm/kg - constexpr double minUrineOsmolalityOverride = 0.0; //mOsm/kg + constexpr double maxLeftAAROverride = 1.0; // mmHg_min_Per_mL + constexpr double minLeftAAROverride = 0.0; // mmHg_min_Per_mL + constexpr double maxLeftGFROverride = 1000.0; // mL/min + constexpr double minLeftGFROverride = 0.0; // mL/min + constexpr double maxLeftReabsorRateOverride = 1000.0; // mL/min + constexpr double minLeftReabsorRateOverride = 0.0; // mL/min + constexpr double maxRenalBloodFlowOverride = 3000.0; // mL/min + constexpr double minRenalBloodFlowOverride = 0.0; // mL/min + constexpr double maxRenalPlasmaFlowOverride = 3000.0; // mL/min + constexpr double minRenalPlasmaFlowOverride = 0.0; // mL/min + constexpr double maxRightAAROverride = 1.0; // mmHg_min_Per_mL + constexpr double minRightAAROverride = 0.0; // mmHg_min_Per_mL + constexpr double maxRightGFROverride = 1000.0; // mL/min + constexpr double minRightGFROverride = 0.0; // mL/min + constexpr double maxRightReabsorRateOverride = 1000.0; // mL/min + constexpr double minRightReabsorRateOverride = 0.0; // mL/min + constexpr double maxUrinationRateOverride = 1000.0; // mL/min + constexpr double minUrinationRateOverride = 0.0; // mL/min + constexpr double maxUrineProductionOverride = 100.0; // mL/min + constexpr double minUrineProductionOverride = 0.0; // mL/min + constexpr double maxUrineOsmolalityOverride = 2000.0; // mOsm/kg + constexpr double minUrineOsmolalityOverride = 0.0; // mOsm/kg constexpr double maxUrineVolumeOverride = 1000.0; // mL constexpr double minUrineVolumeOverride = 0.0; // mL constexpr double maxUrineUreaNitrogenOverride = 100.0; // g/L constexpr double minUrineUreaNitrogenOverride = 0.0; // g/L - double currentLeftAAROverride = 0.0; //value gets changed in next check - double currentLeftGFROverride = 0.0; //value gets changed in next check - double currentLeftReabsorRateOverride = 0.0; //value gets changed in next check - double currentRenalBloodFlowOverride = 0.0; //value gets changed in next check - double currentRenalPlasmaFlowOverride = 0.0; //value gets changed in next check - double currentRightAAROverride = 0.0; //value gets changed in next check - double currentRightGFROverride = 0.0; //value gets changed in next check - double currentRightReabsorRateOverride = 0.0; //value gets changed in next check - double currentUrinationRateOverride = 0.0; //value gets changed in next check - double currentUrineProductionOverride = 0.0; //value gets changed in next check - double currentUrineOsmolalityOverride = 0.0; //value gets changed in next check - double currentUrineVolumeOverride = 0.0; //value gets changed in next check - double currentUrineUreaNitrogenOverride = 0.0; //value gets changed in next check + double currentLeftAAROverride = 0.0; // value gets changed in next check + double currentLeftGFROverride = 0.0; // value gets changed in next check + double currentLeftReabsorRateOverride = 0.0; // value gets changed in next check + double currentRenalBloodFlowOverride = 0.0; // value gets changed in next check + double currentRenalPlasmaFlowOverride = 0.0; // value gets changed in next check + double currentRightAAROverride = 0.0; // value gets changed in next check + double currentRightGFROverride = 0.0; // value gets changed in next check + double currentRightReabsorRateOverride = 0.0; // value gets changed in next check + double currentUrinationRateOverride = 0.0; // value gets changed in next check + double currentUrineProductionOverride = 0.0; // value gets changed in next check + double currentUrineOsmolalityOverride = 0.0; // value gets changed in next check + double currentUrineVolumeOverride = 0.0; // value gets changed in next check + double currentUrineUreaNitrogenOverride = 0.0; // value gets changed in next check if (override->HasLeftAfferentArterioleResistanceOverride()) { currentLeftAAROverride = override->GetLeftAfferentArterioleResistanceOverride(FlowResistanceUnit::mmHg_min_Per_mL); @@ -2162,70 +2115,70 @@ void Renal::OverrideControlLoop() currentUrineUreaNitrogenOverride = override->GetUrineUreaNitrogenConcentrationOverride(MassPerVolumeUnit::g_Per_L); } - if ((currentLeftAAROverride < minLeftAAROverride || currentLeftAAROverride > maxLeftAAROverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentLeftAAROverride < minLeftAAROverride || currentLeftAAROverride > maxLeftAAROverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Left Afferent Arteriole Resistance Override (Renal) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentLeftGFROverride < minLeftGFROverride || currentLeftGFROverride > maxLeftGFROverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentLeftGFROverride < minLeftGFROverride || currentLeftGFROverride > maxLeftGFROverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Left Glomerular Filtration Rate Override (Renal) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentLeftReabsorRateOverride < minLeftReabsorRateOverride || currentLeftReabsorRateOverride > maxLeftReabsorRateOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentLeftReabsorRateOverride < minLeftReabsorRateOverride || currentLeftReabsorRateOverride > maxLeftReabsorRateOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Left Reabsorption Rate Override (Renal) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentRenalBloodFlowOverride < minRenalBloodFlowOverride || currentRenalBloodFlowOverride > maxRenalBloodFlowOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentRenalBloodFlowOverride < minRenalBloodFlowOverride || currentRenalBloodFlowOverride > maxRenalBloodFlowOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Renal Blood Flow (Renal) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentRenalPlasmaFlowOverride < minRenalPlasmaFlowOverride || currentRenalPlasmaFlowOverride > maxRenalPlasmaFlowOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentRenalPlasmaFlowOverride < minRenalPlasmaFlowOverride || currentRenalPlasmaFlowOverride > maxRenalPlasmaFlowOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Renal Plasma Flow Override (Renal) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentRightAAROverride < minRightAAROverride || currentRightAAROverride > maxRightAAROverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentRightAAROverride < minRightAAROverride || currentRightAAROverride > maxRightAAROverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Right Afferent Arteriole Resistance Override (Renal) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentRightGFROverride < minRightGFROverride || currentRightGFROverride > maxRightGFROverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentRightGFROverride < minRightGFROverride || currentRightGFROverride > maxRightGFROverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Right Glomerular Filtration Rate Override (Renal) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentRightReabsorRateOverride < minRightReabsorRateOverride || currentRightReabsorRateOverride > maxRightReabsorRateOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentRightReabsorRateOverride < minRightReabsorRateOverride || currentRightReabsorRateOverride > maxRightReabsorRateOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Right Reabsorption Rate Override (Renal) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentUrinationRateOverride < minUrinationRateOverride || currentUrinationRateOverride > maxUrinationRateOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentUrinationRateOverride < minUrinationRateOverride || currentUrinationRateOverride > maxUrinationRateOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Urination Rate Override (Renal) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentUrineProductionOverride < minUrineProductionOverride || currentUrineProductionOverride > maxUrineProductionOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentUrineProductionOverride < minUrineProductionOverride || currentUrineProductionOverride > maxUrineProductionOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Urine Production Rate Override (Renal) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentUrineOsmolalityOverride < minUrineOsmolalityOverride || currentUrineOsmolalityOverride > maxUrineOsmolalityOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentUrineOsmolalityOverride < minUrineOsmolalityOverride || currentUrineOsmolalityOverride > maxUrineOsmolalityOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Urine Osmolality Override (Renal) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentUrineVolumeOverride < minUrineVolumeOverride || currentUrineVolumeOverride > maxUrineVolumeOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentUrineVolumeOverride < minUrineVolumeOverride || currentUrineVolumeOverride > maxUrineVolumeOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Urine Volume Override (Renal) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentUrineUreaNitrogenOverride < minUrineUreaNitrogenOverride || currentUrineUreaNitrogenOverride > maxUrineUreaNitrogenOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentUrineUreaNitrogenOverride < minUrineUreaNitrogenOverride || currentUrineUreaNitrogenOverride > maxUrineUreaNitrogenOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Urine Urea Nitrogen Concentration Override (Renal) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } return; } diff --git a/projects/biogears/libBiogears/src/engine/Systems/Respiratory.cpp b/projects/biogears/libBiogears/src/engine/Systems/Respiratory.cpp index bddbb88d9..6ba2e6f31 100644 --- a/projects/biogears/libBiogears/src/engine/Systems/Respiratory.cpp +++ b/projects/biogears/libBiogears/src/engine/Systems/Respiratory.cpp @@ -12,6 +12,9 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/Physiology.h" +#include "io/cdm/Property.h" + #include #include #include @@ -48,7 +51,7 @@ specific language governing permissions and limitations under the License. #include #include -namespace BGE = mil::tatrc::physiology::biogears; + #ifdef _MSC_VER #pragma warning(disable : 4305 4244) // Disable some warning messages @@ -71,18 +74,18 @@ Respiratory::Respiratory(BioGears& bg) , m_GasTransporter(VolumePerTimeUnit::L_Per_s, VolumeUnit::L, VolumeUnit::L, NoUnit::unitless, GetLogger()) , m_AerosolTransporter(VolumePerTimeUnit::mL_Per_s, VolumeUnit::mL, MassUnit::ug, MassPerVolumeUnit::ug_Per_mL, GetLogger()) { - Clear(); + Invalidate(); m_TuningFile = ""; } Respiratory::~Respiratory() { - Clear(); + Invalidate(); } -void Respiratory::Clear() +void Respiratory::Invalidate() { - SERespiratorySystem::Clear(); + SERespiratorySystem::Invalidate(); m_Patient = nullptr; m_PatientActions = nullptr; @@ -99,6 +102,7 @@ void Respiratory::Clear() m_LeftLungExtravascular = nullptr; m_RightLungExtravascular = nullptr; m_Trachea = nullptr; + m_pleuralCavity = nullptr; m_AortaO2 = nullptr; m_AortaCO2 = nullptr; m_MechanicalVentilatorConnection = nullptr; @@ -143,8 +147,8 @@ void Respiratory::Clear() m_GroundToConnection = nullptr; m_BloodPHRunningAverage.Reset(); - m_ArterialO2Average_mmHg.Reset(); - m_ArterialCO2Average_mmHg.Reset(); + m_ArterialOxygenAverage_mmHg.Reset(); + m_ArterialCarbonDioxideAverage_mmHg.Reset(); m_OverrideRRBaseline_Per_min = 0.0; } @@ -177,6 +181,7 @@ void Respiratory::Initialize() m_DriverPressure_cmH2O = m_DefaultDrivePressure_cmH2O; m_DriverPressureMin_cmH2O = m_DefaultDrivePressure_cmH2O; + //The peak driver pressure is the pressure above the default pressure m_PeakRespiratoryDrivePressure_cmH2O = m_Patient->GetRespiratoryDriverAmplitudeBaseline(PressureUnit::cmH2O); m_ArterialO2PartialPressure_mmHg = m_AortaO2->GetPartialPressure(PressureUnit::mmHg); @@ -224,7 +229,7 @@ void Respiratory::Initialize() GetRespirationCyclePercentComplete().SetValue(0.0); GetRespirationDriverFrequency().SetValue(RespirationRate_Per_min, FrequencyUnit::Per_min); GetRespirationDriverPressure().SetValue(m_PeakRespiratoryDrivePressure_cmH2O, PressureUnit::cmH2O); - GetCarricoIndex().SetValue(m_data.GetBloodChemistry().GetArterialOxygenPressure(PressureUnit::mmHg) / m_data.GetEnvironment().GetConditions().GetAmbientGas(m_data.GetSubstances().GetO2()).GetFractionAmount().GetValue(), PressureUnit::mmHg); + GetCarricoIndex().SetValue(m_data.GetBloodChemistry().GetArterialOxygenPressure(PressureUnit::mmHg) / m_data.GetEnvironment().GetConditions().GetAmbientGas(m_data.GetSubstances().GetO2().GetDefinition()).GetFractionAmount().GetValue(), PressureUnit::mmHg); GetInspiratoryExpiratoryRatio().SetValue(0.5); GetMeanPleuralPressure().SetValue(AbsolutePleuralPressure_mmHg - EnvironmentPressure_mmHg, PressureUnit::mmHg); GetTotalAlveolarVentilation().SetValue(RespirationRate_Per_min * (TidalVolume_L - DeadSpace_L), VolumePerTimeUnit::L_Per_min); @@ -239,111 +244,6 @@ void Respiratory::Initialize() TuneCircuit(); } -bool Respiratory::Load(const CDM::BioGearsRespiratorySystemData& in) -{ - if (!SERespiratorySystem::Load(in)) - return false; - - m_InitialExpiratoryReserveVolume_L = in.InitialExpiratoryReserveVolume_L(); - m_InitialFunctionalResidualCapacity_L = in.InitialFunctionalResidualCapacity_L(); - m_InitialInspiratoryCapacity_L = in.InitialInspiratoryCapacity_L(); - m_InitialResidualVolume_L = in.InitialResidualVolume_L(); - - m_bNotBreathing = in.NotBreathing(); - m_TopBreathTotalVolume_L = in.TopBreathTotalVolume_L(); - m_TopBreathAlveoliVolume_L = in.TopBreathAlveoliVolume_L(); - m_TopBreathDeadSpaceVolume_L = in.TopBreathDeadSpaceVolume_L(); - m_TopBreathPleuralPressure_cmH2O = in.TopBreathPleuralPressure_cmH2O(); - m_LastCardiacCycleBloodPH = in.LastCardiacCycleBloodPH(); - m_PreviousTotalLungVolume_L = in.PreviousTotalLungVolume_L(); - m_BloodPHRunningAverage.Load(in.BloodPHRunningAverage()); - - m_BreathingCycle = in.BreathingCycle(); - m_ArterialO2PartialPressure_mmHg = in.ArterialOxygenPressure_mmHg(); - m_ArterialCO2PartialPressure_mmHg = in.ArterialCarbonDioxidePressure_mmHg(); - m_BreathingCycleTime_s = in.BreathingCycleTime_s(); - m_BreathTimeExhale_min = in.BreathTimeExhale_min(); - m_DefaultDrivePressure_cmH2O = in.DefaultDrivePressure_cmH2O(); - m_DriverPressure_cmH2O = in.DriverPressure_cmH2O(); - m_DriverPressureMin_cmH2O = in.DriverPressureMin_cmH2O(); - m_ElapsedBreathingCycleTime_min = in.ElapsedBreathingCycleTime_min(); - m_IEscaleFactor = in.IEscaleFactor(); - m_InstantaneousFunctionalResidualCapacity_L = in.InstantaneousFunctionalResidualCapacity_L(); - m_MaxDriverPressure_cmH2O = in.MaxDriverPressure_cmH2O(); - m_PeakRespiratoryDrivePressure_cmH2O = in.PeakRespiratoryDrivePressure_cmH2O(); - - m_VentilationFrequency_Per_min = in.VentilationFrequency_Per_min(); - m_ArterialO2Average_mmHg.Load(in.ArterialOxygenAverage_mmHg()); - m_ArterialCO2Average_mmHg.Load(in.ArterialCarbonDioxideAverage_mmHg()); - - m_ConsciousBreathing = in.ConsciousBreathing(); - m_ConsciousRespirationPeriod_s = in.ConsciousRespirationPeriod_s(); - m_ConsciousRespirationRemainingPeriod_s = in.ConsciousRespirationRemainingPeriod_s(); - m_ExpiratoryReserveVolumeFraction = in.ExpiratoryReserveVolumeFraction(); - m_InspiratoryCapacityFraction = in.InspiratoryCapacityFraction(); - m_ConsciousStartPressure_cmH2O = in.ConsciousStartPressure_cmH2O(); - m_ConsciousEndPressure_cmH2O = in.ConsciousEndPressure_cmH2O(); - - m_HadAirwayObstruction = in.HadAirwayObstruction(); - m_HadBronchoconstriction = in.HadBronchoconstriction(); - - BioGearsSystem::LoadState(); - return true; -} -CDM::BioGearsRespiratorySystemData* Respiratory::Unload() const -{ - CDM::BioGearsRespiratorySystemData* data = new CDM::BioGearsRespiratorySystemData(); - Unload(*data); - return data; -} -void Respiratory::Unload(CDM::BioGearsRespiratorySystemData& data) const -{ - SERespiratorySystem::Unload(data); - - data.InitialExpiratoryReserveVolume_L(m_InitialExpiratoryReserveVolume_L); - data.InitialFunctionalResidualCapacity_L(m_InitialFunctionalResidualCapacity_L); - data.InitialInspiratoryCapacity_L(m_InitialInspiratoryCapacity_L); - data.InitialResidualVolume_L(m_InitialResidualVolume_L); - - data.NotBreathing(m_bNotBreathing); - data.TopBreathTotalVolume_L(m_TopBreathTotalVolume_L); - data.TopBreathAlveoliVolume_L(m_TopBreathAlveoliVolume_L); - data.TopBreathDeadSpaceVolume_L(m_TopBreathDeadSpaceVolume_L); - data.TopBreathPleuralPressure_cmH2O(m_TopBreathPleuralPressure_cmH2O); - data.LastCardiacCycleBloodPH(m_LastCardiacCycleBloodPH); - data.PreviousTotalLungVolume_L(m_PreviousTotalLungVolume_L); - data.BloodPHRunningAverage(std::unique_ptr(m_BloodPHRunningAverage.Unload())); - - data.BreathingCycle(m_BreathingCycle); - data.ArterialOxygenPressure_mmHg(m_ArterialO2PartialPressure_mmHg); - data.ArterialCarbonDioxidePressure_mmHg(m_ArterialCO2PartialPressure_mmHg); - data.BreathingCycleTime_s(m_BreathingCycleTime_s); - data.BreathTimeExhale_min(m_BreathTimeExhale_min); - data.DefaultDrivePressure_cmH2O(m_DefaultDrivePressure_cmH2O); - data.DriverPressure_cmH2O(m_DriverPressure_cmH2O); - data.DriverPressureMin_cmH2O(m_DriverPressureMin_cmH2O); - data.ElapsedBreathingCycleTime_min(m_ElapsedBreathingCycleTime_min); - data.IEscaleFactor(m_IEscaleFactor); - data.InstantaneousFunctionalResidualCapacity_L(m_InstantaneousFunctionalResidualCapacity_L); - data.MaxDriverPressure_cmH2O(m_MaxDriverPressure_cmH2O); - data.PeakRespiratoryDrivePressure_cmH2O(m_PeakRespiratoryDrivePressure_cmH2O); - - data.VentilationFrequency_Per_min(m_VentilationFrequency_Per_min); - data.ArterialOxygenAverage_mmHg(std::unique_ptr(m_ArterialO2Average_mmHg.Unload())); - data.ArterialCarbonDioxideAverage_mmHg(std::unique_ptr(m_ArterialCO2Average_mmHg.Unload())); - - data.ConsciousBreathing(m_ConsciousBreathing); - data.ConsciousRespirationPeriod_s(m_ConsciousRespirationPeriod_s); - data.ConsciousRespirationRemainingPeriod_s(m_ConsciousRespirationRemainingPeriod_s); - data.ExpiratoryReserveVolumeFraction(m_ExpiratoryReserveVolumeFraction); - data.InspiratoryCapacityFraction(m_InspiratoryCapacityFraction); - data.ConsciousStartPressure_cmH2O(m_ConsciousStartPressure_cmH2O); - data.ConsciousEndPressure_cmH2O(m_ConsciousEndPressure_cmH2O); - - data.HadAirwayObstruction(m_HadAirwayObstruction); - data.HadBronchoconstriction(m_HadBronchoconstriction); -} - //-------------------------------------------------------------------------------------------------- /// \brief /// Initializes parameters for Respiratory Class @@ -380,6 +280,7 @@ void Respiratory::SetUp() m_LeftLung = m_data.GetCompartments().GetGasCompartment(BGE::PulmonaryCompartment::LeftLung); m_RightLung = m_data.GetCompartments().GetGasCompartment(BGE::PulmonaryCompartment::RightLung); m_Lungs = m_data.GetCompartments().GetGasCompartment(BGE::PulmonaryCompartment::Lungs); + m_pleuralCavity = m_data.GetCompartments().GetGasCompartment(BGE::PulmonaryCompartment::PleuralCavity); m_LeftLungExtravascular = m_data.GetCompartments().GetLiquidCompartment(BGE::ExtravascularCompartment::LeftLungIntracellular); m_RightLungExtravascular = m_data.GetCompartments().GetLiquidCompartment(BGE::ExtravascularCompartment::RightLungIntracellular); m_Trachea = m_data.GetCompartments().GetGasCompartment(BGE::PulmonaryCompartment::Trachea); @@ -534,7 +435,7 @@ void Respiratory::PreProcess() ConsciousRespiration(); NasalCannula(); MechanicalVentilation(); - + AdjustPleuralCavity(); RespiratoryDriver(); } @@ -743,7 +644,7 @@ void Respiratory::ProcessAerosolSubstances() // Apply the BronchioleModifier dilation effect // This is all just tuned to Albuterol - it'll work for other substances, and can be tuned using the other parameters (especially BronchioleModifier) - if (subQ->GetSubstance().GetState() == CDM::enumSubstanceState::Liquid) { + if (subQ->GetSubstance().GetState() == SESubstanceState::Liquid) { // Sum the Bronchiole Effects // Must be positive double bronchioleModifier = subQ->GetSubstance().GetAerosolization().GetBronchioleModifier().GetValue(); @@ -804,7 +705,7 @@ void Respiratory::MechanicalVentilation() if (m_data.GetActions().GetPatientActions().HasMechanicalVentilation()) { SEMechanicalVentilation* mv = m_data.GetActions().GetPatientActions().GetMechanicalVentilation(); // You only get here if action is On - m_data.SetAirwayMode(CDM::enumBioGearsAirwayMode::MechanicalVentilator); + m_data.SetAirwayMode(SEBioGearsAirwayMode::MechanicalVentilator); //Set the substance volume fractions ******************************************** std::vector gasFractions = mv->GetGasFractions(); @@ -856,9 +757,9 @@ void Respiratory::MechanicalVentilation() //Pressure is same as ambient m_GroundToConnection->GetNextPressureSource().SetValue(0.0, PressureUnit::cmH2O); } - } else if (m_data.GetAirwayMode() == CDM::enumBioGearsAirwayMode::MechanicalVentilator) { + } else if (m_data.GetAirwayMode() == SEBioGearsAirwayMode::MechanicalVentilator) { // Was just turned off - m_data.SetAirwayMode(CDM::enumBioGearsAirwayMode::Free); + m_data.SetAirwayMode(SEBioGearsAirwayMode::Free); } } @@ -875,7 +776,7 @@ void Respiratory::NasalCannula() if (m_data.GetActions().GetPatientActions().HasNasalCannula()) { SENasalCannula* nc = m_data.GetActions().GetPatientActions().GetNasalCannula(); // You only get here if action is On - m_data.SetAirwayMode(CDM::enumBioGearsAirwayMode::NasalCannula); + m_data.SetAirwayMode(SEBioGearsAirwayMode::NasalCannula); double flow_L_Per_min = 0.0; SEFluidCircuit* RespirationCircuit = &m_data.GetCircuits().GetActiveRespiratoryCircuit(); @@ -897,9 +798,9 @@ void Respiratory::NasalCannula() double tankResistance_cmH2O_s_Per_L = tankPressure_cmH2O / (flow_L_Per_min / 60.0); OxygenTankToNosepiece->GetNextResistance().SetValue(tankResistance_cmH2O_s_Per_L, FlowResistanceUnit::cmH2O_s_Per_L); - } else if (m_data.GetAirwayMode() == CDM::enumBioGearsAirwayMode::NasalCannula) { + } else if (m_data.GetAirwayMode() == SEBioGearsAirwayMode::NasalCannula) { // Was just turned off - m_data.SetAirwayMode(CDM::enumBioGearsAirwayMode::Free); + m_data.SetAirwayMode(SEBioGearsAirwayMode::Free); } } //-------------------------------------------------------------------------------------------------- @@ -918,14 +819,14 @@ void Respiratory::RespiratoryDriver() ///\ToDo: Running averages were mostly used for chemoreceptors that have been moved to Nervous. /// ToDo: However, they are still used in some calculations in CalculateVitals. Should we move/consolidate these? //Keep a running average of the Arterial Partial Pressures - m_ArterialO2Average_mmHg.Sample(m_AortaO2->GetPartialPressure(PressureUnit::mmHg)); - m_ArterialCO2Average_mmHg.Sample(m_AortaCO2->GetPartialPressure(PressureUnit::mmHg)); + m_ArterialOxygenAverage_mmHg.Sample(m_AortaO2->GetPartialPressure(PressureUnit::mmHg)); + m_ArterialCarbonDioxideAverage_mmHg.Sample(m_AortaCO2->GetPartialPressure(PressureUnit::mmHg)); //Reset at start of cardiac cycle - if (m_Patient->IsEventActive(CDM::enumPatientEvent::StartOfCardiacCycle)) { - m_ArterialO2PartialPressure_mmHg = m_ArterialO2Average_mmHg.Value(); - m_ArterialCO2PartialPressure_mmHg = m_ArterialCO2Average_mmHg.Value(); - m_ArterialO2Average_mmHg.Reset(); - m_ArterialCO2Average_mmHg.Reset(); + if (m_Patient->IsEventActive(SEPatientEventType::StartOfCardiacCycle)) { + m_ArterialO2PartialPressure_mmHg = m_ArterialOxygenAverage_mmHg.Value(); + m_ArterialCO2PartialPressure_mmHg = m_ArterialCarbonDioxideAverage_mmHg.Value(); + m_ArterialOxygenAverage_mmHg.Reset(); + m_ArterialCarbonDioxideAverage_mmHg.Reset(); } #ifdef TUNING @@ -997,7 +898,7 @@ void Respiratory::RespiratoryDriver() Apnea(); - if (m_data.GetAirwayMode() == CDM::enumBioGearsAirwayMode::AnesthesiaMachine || m_data.GetAirwayMode() == CDM::enumBioGearsAirwayMode::MechanicalVentilator) { + if (m_data.GetAirwayMode() == SEBioGearsAirwayMode::AnesthesiaMachine || m_data.GetAirwayMode() == SEBioGearsAirwayMode::MechanicalVentilator) { m_DriverPressure_cmH2O = m_DefaultDrivePressure_cmH2O; m_BreathingCycleTime_s = m_ElapsedBreathingCycleTime_min * 60.0; //Set driver cycle to match elapsed cycle (dictated by ventilator) so that when we turn machine off we re-start spontaneous breathing in a good place } @@ -1027,7 +928,7 @@ void Respiratory::ProcessDriverActions() { // Process Cardiac Arrest action double cardiacArrestEffect = 1.0; - if (m_Patient->IsEventActive(CDM::enumPatientEvent::CardiacArrest)) { + if (m_Patient->IsEventActive(SEPatientEventType::CardiacArrest)) { cardiacArrestEffect = 0.0; } //Process drug effects--adjust them based on neuromuscular block level @@ -1060,10 +961,10 @@ void Respiratory::ProcessDriverActions() auto& inflammation = m_data.GetBloodChemistry().GetInflammatoryResponse(); double baselineRR_Per_min = m_Patient->GetRespirationRateBaseline(FrequencyUnit::Per_min); double sigmoidInput = 1.0 - m_data.GetBloodChemistry().GetInflammatoryResponse().GetTissueIntegrity().GetValue(); - if (inflammation.HasInflammationSource(CDM::enumInflammationSource::Infection)) { + if (inflammation.HasInflammationSource(SEInflammationSource::Infection)) { infectionModifier = baselineRR_Per_min * std::pow(sigmoidInput, 2.0) / (std::pow(sigmoidInput, 2.0) + std::pow(0.4, 2)); } - if (inflammation.HasInflammationSource(CDM::enumInflammationSource::Hemorrhage)) { + if (inflammation.HasInflammationSource(SEInflammationSource::Hemorrhage)) { double volumeEffect = m_data.GetCardiovascular().GetBloodVolume(VolumeUnit::mL) / m_data.GetPatient().GetBloodVolumeBaseline(VolumeUnit::mL); volumeEffect = std::min(volumeEffect, 1.0); sigmoidInput = 1.0 - volumeEffect; @@ -1278,15 +1179,15 @@ void Respiratory::Intubation() } if (m_PatientActions->HasIntubation()) { - m_data.SetIntubation(CDM::enumOnOff::On); + m_data.SetIntubation(SEOnOff::On); SEIntubation* intubation = m_PatientActions->GetIntubation(); switch (intubation->GetType()) { - case CDM::enumIntubationType::Tracheal: { + case SEIntubationType::Tracheal: { // The proper way to intubate // Airway mode handles this case by default break; } - case CDM::enumIntubationType::Esophageal: { + case SEIntubationType::Esophageal: { // Allow air flow between Airway and Stomach ///\todo Make this a modifier (i.e. multiplier), instead of setting it directly m_MouthToStomach->GetNextResistance().SetValue(1.2, FlowResistanceUnit::cmH2O_s_Per_L); @@ -1295,11 +1196,11 @@ void Respiratory::Intubation() m_MouthToTrachea->GetNextResistance().SetValue(m_dDefaultOpenResistance_cmH2O_s_Per_L, FlowResistanceUnit::cmH2O_s_Per_L); break; } - case CDM::enumIntubationType::RightMainstem: { + case SEIntubationType::RightMainstem: { m_TracheaToLeftBronchi->GetNextResistance().SetValue(m_dRespOpenResistance_cmH2O_s_Per_L, FlowResistanceUnit::cmH2O_s_Per_L); break; } - case CDM::enumIntubationType::LeftMainstem: { + case SEIntubationType::LeftMainstem: { m_TracheaToRightBronchi->GetNextResistance().SetValue(m_dRespOpenResistance_cmH2O_s_Per_L, FlowResistanceUnit::cmH2O_s_Per_L); break; } @@ -1307,7 +1208,7 @@ void Respiratory::Intubation() break; } } else { - m_data.SetIntubation(CDM::enumOnOff::Off); + m_data.SetIntubation(SEOnOff::Off); } } @@ -1336,14 +1237,16 @@ void Respiratory::Pneumothorax() // Maximum flow resistance for the chest cavity or alveoli leak double dPneumoMaxFlowResistance_cmH2O_s_Per_L = m_dDefaultOpenResistance_cmH2O_s_Per_L; // Flow resistance for the decompression needle, if used - double dNeedleFlowResistance_cmH2O_s_Per_L = 15.0; + double dNeedleFlowResistance_cmH2O_s_Per_L = 15.0/13.0; + // Flow resistance for the chest tube, if used + double dChestTubeFlowResistance_cmH2O_s_Per_L = 15.0; // Increase in pleural pressure restricts blood return to heart. Model this by increasing vena cava->right heart resistance SEFluidCircuitPath* venousReturn = m_data.GetCircuits().GetCardiovascularCircuit().GetPath(BGE::CardiovascularPath::VenaCavaToRightAtrium1); double nextVenousResistance = venousReturn->GetResistanceBaseline(FlowResistanceUnit::mmHg_s_Per_mL); double normalPleuralPressure_mmHg = -4.2; double venousResistanceModifier = GeneralMath::LinearInterpolator(normalPleuralPressure_mmHg, 3.0, 1.0, 4.0, GetMeanPleuralPressure(PressureUnit::mmHg)); venousResistanceModifier = std::max(1.0, venousResistanceModifier); - nextVenousResistance *= venousResistanceModifier; + nextVenousResistance *= 2.1*venousResistanceModifier; venousReturn->GetNextResistance().SetValue(nextVenousResistance, FlowResistanceUnit::mmHg_s_Per_mL); if (m_PatientActions->HasLeftOpenTensionPneumothorax()) { @@ -1351,16 +1254,19 @@ void Respiratory::Pneumothorax() double severity = m_PatientActions->GetLeftOpenTensionPneumothorax()->GetSeverity().GetValue(); double resistance_cmH2O_s_Per_L = dPneumoMaxFlowResistance_cmH2O_s_Per_L; if (severity > 0.0 && !m_PatientActions->HasLeftChestOcclusiveDressing()) { - resistance_cmH2O_s_Per_L = dPneumoMinFlowResistance_cmH2O_s_Per_L / std::pow(severity, 2.0); + resistance_cmH2O_s_Per_L = -544.44 * severity + 554.44; //dPneumoMinFlowResistance_cmH2O_s_Per_L / std::pow(severity, 2.0); } resistance_cmH2O_s_Per_L = std::min(resistance_cmH2O_s_Per_L, dPneumoMaxFlowResistance_cmH2O_s_Per_L); m_EnvironmentToLeftChestLeak->GetNextResistance().SetValue(resistance_cmH2O_s_Per_L, FlowResistanceUnit::cmH2O_s_Per_L); if (severity == 0) { - m_EnvironmentToLeftChestLeak->SetNextValve(CDM::enumOpenClosed::Open); + m_EnvironmentToLeftChestLeak->SetNextValve(SEOpenClosed::Open); } if (m_PatientActions->HasLeftNeedleDecompression()) { DoLeftNeedleDecompression(dNeedleFlowResistance_cmH2O_s_Per_L); } + if (m_PatientActions->HasLeftChestTube()) { + DoLeftChestTube(dChestTubeFlowResistance_cmH2O_s_Per_L); + } } if (m_PatientActions->HasRightOpenTensionPneumothorax()) { @@ -1368,17 +1274,22 @@ void Respiratory::Pneumothorax() double severity = m_PatientActions->GetRightOpenTensionPneumothorax()->GetSeverity().GetValue(); double resistance_cmH2O_s_Per_L = dPneumoMaxFlowResistance_cmH2O_s_Per_L; if (severity > 0.0 && !m_PatientActions->HasRightChestOcclusiveDressing()) { - resistance_cmH2O_s_Per_L = dPneumoMinFlowResistance_cmH2O_s_Per_L / std::pow(severity, 2.0); + resistance_cmH2O_s_Per_L = -544.44 * severity + 554.44; //dPneumoMinFlowResistance_cmH2O_s_Per_L / std::pow(severity, 2.0); } resistance_cmH2O_s_Per_L = std::min(resistance_cmH2O_s_Per_L, dPneumoMaxFlowResistance_cmH2O_s_Per_L); m_EnvironmentToRightChestLeak->GetNextResistance().SetValue(resistance_cmH2O_s_Per_L, FlowResistanceUnit::cmH2O_s_Per_L); if (severity == 0) { - m_EnvironmentToRightChestLeak->SetNextValve(CDM::enumOpenClosed::Open); + m_EnvironmentToRightChestLeak->SetNextValve(SEOpenClosed::Open); } if (m_PatientActions->HasRightNeedleDecompression()) { DoRightNeedleDecompression(dNeedleFlowResistance_cmH2O_s_Per_L); } + + if (m_PatientActions->HasRightChestTube()) { + DoRightChestTube(dChestTubeFlowResistance_cmH2O_s_Per_L); + } + } if (m_PatientActions->HasLeftClosedTensionPneumothorax()) { @@ -1386,17 +1297,22 @@ void Respiratory::Pneumothorax() double severity = m_PatientActions->GetLeftClosedTensionPneumothorax()->GetSeverity().GetValue(); double resistance_cmH2O_s_Per_L = dPneumoMaxFlowResistance_cmH2O_s_Per_L; if (severity > 0.0) { - resistance_cmH2O_s_Per_L = dPneumoMinFlowResistance_cmH2O_s_Per_L / std::pow(severity, 2.0); + resistance_cmH2O_s_Per_L = -544.44 * severity + 554.44; //dPneumoMinFlowResistance_cmH2O_s_Per_L / std::pow(severity, 2.0); } resistance_cmH2O_s_Per_L = std::min(resistance_cmH2O_s_Per_L, dPneumoMaxFlowResistance_cmH2O_s_Per_L); m_LeftAlveoliLeakToLeftPleuralCavity->GetNextResistance().SetValue(resistance_cmH2O_s_Per_L, FlowResistanceUnit::cmH2O_s_Per_L); if (severity == 0) { - m_LeftAlveoliLeakToLeftPleuralCavity->SetNextValve(CDM::enumOpenClosed::Open); + m_LeftAlveoliLeakToLeftPleuralCavity->SetNextValve(SEOpenClosed::Open); } if (m_PatientActions->HasLeftNeedleDecompression()) { DoLeftNeedleDecompression(dNeedleFlowResistance_cmH2O_s_Per_L); } + + if (m_PatientActions->HasLeftChestTube()) { + DoLeftChestTube(dChestTubeFlowResistance_cmH2O_s_Per_L); + } + } if (m_PatientActions->HasRightClosedTensionPneumothorax()) { @@ -1404,35 +1320,40 @@ void Respiratory::Pneumothorax() double severity = m_PatientActions->GetRightClosedTensionPneumothorax()->GetSeverity().GetValue(); double resistance_cmH2O_s_Per_L = dPneumoMaxFlowResistance_cmH2O_s_Per_L; if (severity > 0.0) { - resistance_cmH2O_s_Per_L = dPneumoMinFlowResistance_cmH2O_s_Per_L / std::pow(severity, 2.0); + resistance_cmH2O_s_Per_L = -544.44 * severity + 554.44; //dPneumoMinFlowResistance_cmH2O_s_Per_L / std::pow(severity, 2.0); } resistance_cmH2O_s_Per_L = std::min(resistance_cmH2O_s_Per_L, dPneumoMaxFlowResistance_cmH2O_s_Per_L); m_RightAlveoliLeakToRightPleuralCavity->GetNextResistance().SetValue(resistance_cmH2O_s_Per_L, FlowResistanceUnit::cmH2O_s_Per_L); if (severity == 0) { - m_RightAlveoliLeakToRightPleuralCavity->SetNextValve(CDM::enumOpenClosed::Open); + m_RightAlveoliLeakToRightPleuralCavity->SetNextValve(SEOpenClosed::Open); } if (m_PatientActions->HasRightNeedleDecompression()) { DoRightNeedleDecompression(dNeedleFlowResistance_cmH2O_s_Per_L); } + if (m_PatientActions->HasRightChestTube()) { + DoRightChestTube(dChestTubeFlowResistance_cmH2O_s_Per_L); + } } //Check for interventions without insult if (!m_PatientActions->HasLeftClosedTensionPneumothorax() && !m_PatientActions->HasLeftOpenTensionPneumothorax()) { - if (m_PatientActions->HasLeftChestOcclusiveDressing() || m_PatientActions->HasLeftNeedleDecompression()) { + if (m_PatientActions->HasLeftChestOcclusiveDressing() || m_PatientActions->HasLeftNeedleDecompression() || m_PatientActions->HasLeftChestTube()) { /// \error Patient: Cannot perform an intervention if Tension Pneumothorax is not present on that side. Error("Cannot perform an intervention if Tension Pneumothorax is not present on that side."); m_PatientActions->RemoveLeftChestOcclusiveDressing(); m_PatientActions->RemoveLeftNeedleDecompression(); + m_PatientActions->RemoveLeftChestTube(); return; } } if (!m_PatientActions->HasRightClosedTensionPneumothorax() && !m_PatientActions->HasRightOpenTensionPneumothorax()) { - if (m_PatientActions->HasRightChestOcclusiveDressing() || m_PatientActions->HasRightNeedleDecompression()) { + if (m_PatientActions->HasRightChestOcclusiveDressing() || m_PatientActions->HasRightNeedleDecompression() || m_PatientActions->HasRightChestTube()) { /// \error Patient: Cannot perform an intervention if Tension Pneumothorax is not present on that side. Error("Cannot perform an intervention if Tension Pneumothorax is not present on that side."); m_PatientActions->RemoveRightChestOcclusiveDressing(); m_PatientActions->RemoveRightNeedleDecompression(); + m_PatientActions->RemoveRightChestTube(); return; } } @@ -1453,6 +1374,13 @@ void Respiratory::Pneumothorax() m_PatientActions->RemoveRightChestOcclusiveDressing(); return; } + if (m_PatientActions->HasChestTube()) { + /// \error Patient: can't process a chest occlusive dressing if no pneumothorax is present + Error("Cannot perform a Chest Tube intervention if Tension Pneumothorax is not present"); + m_PatientActions->RemoveLeftChestTube(); + m_PatientActions->RemoveRightChestTube(); + return; + } } } @@ -1551,6 +1479,24 @@ void Respiratory::ProcessConsciousRespiration(SEConsciousRespirationCommand& cmd } } +//-------------------------------------------------------------------------------------------------- +/// \brief +/// Right Side Needle Decompression +/// +/// \param dFlowResistance - Resistance value for air flow through the needle +/// +/// \details +/// Used for right side needle decompression. this is an intervention (action) used to treat right +/// side tension pneumothorax +//-------------------------------------------------------------------------------------------------- +void Respiratory::DoRightNeedleDecompression(double dFlowResistance) +{ + //Leak flow resistance that is scaled in proportion to Lung resistance, depending on severity + double dScalingFactor = 0.5; //Tuning parameter to allow gas flow due to needle decompression using lung resistance as reference + double dFlowResistanceRightNeedle = dScalingFactor * dFlowResistance; + m_RightPleuralCavityToEnvironment->GetNextResistance().SetValue(dFlowResistanceRightNeedle, FlowResistanceUnit::cmH2O_s_Per_L); +} + //-------------------------------------------------------------------------------------------------- /// \brief /// Left Side Needle Decompression @@ -1579,12 +1525,71 @@ void Respiratory::DoLeftNeedleDecompression(double dFlowResistance) /// Used for right side needle decompression. this is an intervention (action) used to treat right /// side tension pneumothorax //-------------------------------------------------------------------------------------------------- -void Respiratory::DoRightNeedleDecompression(double dFlowResistance) +void Respiratory::DoRightChestTube(double ctFlowResistance) { //Leak flow resistance that is scaled in proportion to Lung resistance, depending on severity double dScalingFactor = 0.5; //Tuning parameter to allow gas flow due to needle decompression using lung resistance as reference - double dFlowResistanceRightNeedle = dScalingFactor * dFlowResistance; + double dFlowResistanceRightNeedle = dScalingFactor * ctFlowResistance; m_RightPleuralCavityToEnvironment->GetNextResistance().SetValue(dFlowResistanceRightNeedle, FlowResistanceUnit::cmH2O_s_Per_L); + +} + +//-------------------------------------------------------------------------------------------------- +/// \brief +/// Left Side Needle Decompression +/// +/// \param dFlowResistance - Resistance value for air flow through the needle +/// +/// \details +/// Used for left side needle decompression. this is an intervention (action) used to treat left +/// side tension pneumothorax +//-------------------------------------------------------------------------------------------------- +void Respiratory::DoLeftChestTube(double ctFlowResistance) +{ + //Leak flow resistance that is scaled in proportion to Lung resistance, depending on severity + double dScalingFactor = 0.5; //Tuning parameter to allow gas flow due to needle decompression using lung resistance as reference + double dFlowResistanceLeftNeedle = dScalingFactor * ctFlowResistance; + m_LeftPleuralCavityToEnvironment->GetNextResistance().SetValue(dFlowResistanceLeftNeedle, FlowResistanceUnit::cmH2O_s_Per_L); +} + +//-------------------------------------------------------------------------------------------------- +/// \brief +/// adjust pleural cavity pressure after injury +/// +/// +/// \details +/// Need a way to return pressure after a surgical proceedure. Since we don't consider the biomechanics +/// of the lungs expansion reducing the volume in the pleural space after chest tube, we will +/// manually move volume to ground as a result of the proceedure +//-------------------------------------------------------------------------------------------------- +void Respiratory::AdjustPleuralCavity() +{ + if (m_PatientActions->HasRightChestTube()) { + + double cavityPressure = m_RightPleuralCavity->GetPressure().GetValue(PressureUnit::cmH2O); + + //lets reduce plueral pressure slowly + m_RightPleuralCavity->GetNextPressure().SetReadOnly(false); + m_RightPleuralCavity->GetNextVolume().SetReadOnly(false); + + if (m_RightPleuralCavity->GetVolume().GetValue(VolumeUnit::mL) > 550.0) { + m_RightPleuralCavity->GetNextVolume().DecrementValue(0.1, VolumeUnit::mL); + } + } + + if (m_PatientActions->HasLeftChestTube()) { + + double cavityPressure = m_LeftPleuralCavity->GetPressure().GetValue(PressureUnit::cmH2O); + + //lets reduce plueral pressure slowly + m_LeftPleuralCavity->GetNextPressure().SetReadOnly(false); + m_LeftPleuralCavity->GetNextVolume().SetReadOnly(false); + + if (m_LeftPleuralCavity->GetVolume().GetValue(VolumeUnit::mL) > 550.0) { + m_LeftPleuralCavity->GetNextVolume().DecrementValue(0.1, VolumeUnit::mL); + } + } + } //-------------------------------------------------------------------------------------------------- @@ -1812,28 +1817,28 @@ void Respiratory::CalculateVitalSigns() double arterialPartialPressureO2_mmHg = m_data.GetBloodChemistry().GetArterialOxygenPressure(PressureUnit::mmHg); double fractionInspiredO2 = 0.0; switch (m_data.GetAirwayMode()) { - case CDM::enumBioGearsAirwayMode::Free: - fractionInspiredO2 = m_data.GetEnvironment().GetConditions().GetAmbientGas(m_data.GetSubstances().GetO2()).GetFractionAmount().GetValue(); + case SEBioGearsAirwayMode::Free: + fractionInspiredO2 = m_data.GetEnvironment().GetConditions().GetAmbientGas(m_data.GetSubstances().GetO2().GetDefinition()).GetFractionAmount().GetValue(); break; - case CDM::enumBioGearsAirwayMode::AnesthesiaMachine: + case SEBioGearsAirwayMode::AnesthesiaMachine: fractionInspiredO2 = m_data.GetAnesthesiaMachine().GetOxygenFraction().GetValue(); break; - case CDM::enumBioGearsAirwayMode::MechanicalVentilator: + case SEBioGearsAirwayMode::MechanicalVentilator: fractionInspiredO2 = m_data.GetActions().GetPatientActions().GetMechanicalVentilation()->GetGasFraction(m_data.GetSubstances().GetO2()).GetFractionAmount().GetValue(); break; - case CDM::enumBioGearsAirwayMode::Inhaler: + case SEBioGearsAirwayMode::Inhaler: //Unclear what O2 fraction in an inhaler is, let this case flow into default for now. default: //Use environment as default - fractionInspiredO2 = fractionInspiredO2 = m_data.GetEnvironment().GetConditions().GetAmbientGas(m_data.GetSubstances().GetO2()).GetFractionAmount().GetValue(); + fractionInspiredO2 = fractionInspiredO2 = m_data.GetEnvironment().GetConditions().GetAmbientGas(m_data.GetSubstances().GetO2().GetDefinition()).GetFractionAmount().GetValue(); } GetCarricoIndex().SetValue(arterialPartialPressureO2_mmHg / fractionInspiredO2, PressureUnit::mmHg); /// \event Patient: Start of exhale/inhale - if (m_Patient->IsEventActive(CDM::enumPatientEvent::StartOfExhale)) - m_Patient->SetEvent(CDM::enumPatientEvent::StartOfExhale, false, m_data.GetSimulationTime()); - if (m_Patient->IsEventActive(CDM::enumPatientEvent::StartOfInhale)) - m_Patient->SetEvent(CDM::enumPatientEvent::StartOfInhale, false, m_data.GetSimulationTime()); + if (m_Patient->IsEventActive(SEPatientEventType::StartOfExhale)) + m_Patient->SetEvent(SEPatientEventType::StartOfExhale, false, m_data.GetSimulationTime()); + if (m_Patient->IsEventActive(SEPatientEventType::StartOfInhale)) + m_Patient->SetEvent(SEPatientEventType::StartOfInhale, false, m_data.GetSimulationTime()); //Record values at the breathing inflection points (i.e. switch between inhale and exhale) // Temporal tolerance to avoid accidental entry in the the inhalation and exhalation code blocks @@ -1844,13 +1849,13 @@ void Respiratory::CalculateVitalSigns() if (m_BreathingCycle && ((GetTotalLungVolume(VolumeUnit::L) - m_PreviousTotalLungVolume_L) > ZERO_APPROX) && (m_ElapsedBreathingCycleTime_min > dTimeTol)) { - m_Patient->SetEvent(CDM::enumPatientEvent::StartOfInhale, true, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::StartOfInhale, true, m_data.GetSimulationTime()); // Calculate Respiration Rate and track time and update cycle flag double RespirationRate_Per_min = 0.0; RespirationRate_Per_min = 1.0 / m_ElapsedBreathingCycleTime_min; if (m_data.GetActions().GetPatientActions().HasOverride() && m_data.GetActions().GetPatientActions().GetOverride()->HasRespirationRateOverride() - && m_data.GetActions().GetPatientActions().GetOverride()->GetOverrideConformance() == CDM::enumOnOff::Off) { + && m_data.GetActions().GetPatientActions().GetOverride()->GetOverrideConformance() == SEOnOff::Off) { RespirationRate_Per_min = m_data.GetActions().GetPatientActions().GetOverride()->GetRespirationRateOverride(FrequencyUnit::Per_min); } @@ -1897,9 +1902,10 @@ void Respiratory::CalculateVitalSigns() } else if (!m_BreathingCycle && (m_PreviousTotalLungVolume_L - GetTotalLungVolume(VolumeUnit::L) > ZERO_APPROX) && (m_ElapsedBreathingCycleTime_min > dTimeTol)) { - m_Patient->SetEvent(CDM::enumPatientEvent::StartOfExhale, true, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::StartOfExhale, true, m_data.GetSimulationTime()); m_BreathTimeExhale_min = m_ElapsedBreathingCycleTime_min; m_BreathingCycle = true; + m_TopBreathTotalVolume_L = GetTotalLungVolume(VolumeUnit::L); m_TopBreathAlveoliVolume_L = m_RightAlveoli->GetNextVolume().GetValue(VolumeUnit::L) + m_LeftAlveoli->GetNextVolume().GetValue(VolumeUnit::L); m_TopBreathDeadSpaceVolume_L = m_RightBronchi->GetNextVolume().GetValue(VolumeUnit::L) + m_LeftBronchi->GetNextVolume().GetValue(VolumeUnit::L) + m_Trachea->GetVolume(VolumeUnit::L); @@ -1909,24 +1915,24 @@ void Respiratory::CalculateVitalSigns() //Check for acute lung injury and acute respiratory distress if (GetCarricoIndex().GetValue(PressureUnit::mmHg) < 100.0) { /// \event Patient: Severe ARDS: Carrico Index is below 100 mmHg - m_Patient->SetEvent(CDM::enumPatientEvent::SevereAcuteRespiratoryDistress, true, m_data.GetSimulationTime()); /// \cite ranieriacute - m_Patient->SetEvent(CDM::enumPatientEvent::AcuteRespiratoryDistress, false, m_data.GetSimulationTime()); /// \cite ranieriacute - m_Patient->SetEvent(CDM::enumPatientEvent::AcuteLungInjury, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::SevereAcuteRespiratoryDistress, true, m_data.GetSimulationTime()); /// \cite ranieriacute + m_Patient->SetEvent(SEPatientEventType::AcuteRespiratoryDistress, false, m_data.GetSimulationTime()); /// \cite ranieriacute + m_Patient->SetEvent(SEPatientEventType::AcuteLungInjury, false, m_data.GetSimulationTime()); } else if (GetCarricoIndex().GetValue(PressureUnit::mmHg) < 200.0) { /// \event Patient: Acute Respiratory Distress: Carrico Index is below 200 mmHg - m_Patient->SetEvent(CDM::enumPatientEvent::AcuteRespiratoryDistress, true, m_data.GetSimulationTime()); /// \cite ranieriacute - m_Patient->SetEvent(CDM::enumPatientEvent::SevereAcuteRespiratoryDistress, false, m_data.GetSimulationTime()); - m_Patient->SetEvent(CDM::enumPatientEvent::AcuteLungInjury, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::AcuteRespiratoryDistress, true, m_data.GetSimulationTime()); /// \cite ranieriacute + m_Patient->SetEvent(SEPatientEventType::SevereAcuteRespiratoryDistress, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::AcuteLungInjury, false, m_data.GetSimulationTime()); } else if (GetCarricoIndex().GetValue(PressureUnit::mmHg) < 300.0) { /// \event Patient: Acute Lung Injury: Carrico Index is below 300 mmHg - m_Patient->SetEvent(CDM::enumPatientEvent::AcuteLungInjury, true, m_data.GetSimulationTime()); /// \cite ranieriacute - m_Patient->SetEvent(CDM::enumPatientEvent::SevereAcuteRespiratoryDistress, false, m_data.GetSimulationTime()); - m_Patient->SetEvent(CDM::enumPatientEvent::AcuteRespiratoryDistress, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::AcuteLungInjury, true, m_data.GetSimulationTime()); /// \cite ranieriacute + m_Patient->SetEvent(SEPatientEventType::SevereAcuteRespiratoryDistress, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::AcuteRespiratoryDistress, false, m_data.GetSimulationTime()); } else { /// \event Patient: End ARDS: Carrico Index is above 305 mmHg - m_Patient->SetEvent(CDM::enumPatientEvent::SevereAcuteRespiratoryDistress, false, m_data.GetSimulationTime()); - m_Patient->SetEvent(CDM::enumPatientEvent::AcuteRespiratoryDistress, false, m_data.GetSimulationTime()); - m_Patient->SetEvent(CDM::enumPatientEvent::AcuteLungInjury, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::SevereAcuteRespiratoryDistress, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::AcuteRespiratoryDistress, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::AcuteLungInjury, false, m_data.GetSimulationTime()); } } } @@ -1940,12 +1946,12 @@ void Respiratory::CalculateVitalSigns() } //at the end check to see if they are not breathing and update respiration rate, dont update if anesthesia machine is connected - if (m_bNotBreathing && m_data.GetAirwayMode() == CDM::enumBioGearsAirwayMode::Free) { + if (m_bNotBreathing && m_data.GetAirwayMode() == SEBioGearsAirwayMode::Free) { GetRespirationRate().SetValue(0.0, FrequencyUnit::Per_min); } //there is an issue with the driver logic where the elapsed breathing time doesn't update when you set anesthesia to zero - if (m_data.GetAirwayMode() == CDM::enumBioGearsAirwayMode::AnesthesiaMachine && m_data.GetAnesthesiaMachine().GetRespiratoryRate().GetValue() == 0) { + if (m_data.GetAirwayMode() == SEBioGearsAirwayMode::AnesthesiaMachine && m_data.GetAnesthesiaMachine().GetRespiratoryRate().GetValue() == 0) { GetRespirationRate().SetValue(0.0, FrequencyUnit::Per_min); } @@ -1957,7 +1963,7 @@ void Respiratory::CalculateVitalSigns() //Keep a running average of the pH m_BloodPHRunningAverage.Sample(m_data.GetBloodChemistry().GetArterialBloodPH().GetValue()); //Reset at start of cardiac cycle - if (m_Patient->IsEventActive(CDM::enumPatientEvent::StartOfCardiacCycle)) { + if (m_Patient->IsEventActive(SEPatientEventType::StartOfCardiacCycle)) { m_LastCardiacCycleBloodPH = m_BloodPHRunningAverage.Value(); m_BloodPHRunningAverage.Reset(); } @@ -1968,24 +1974,24 @@ void Respiratory::CalculateVitalSigns() if (GetRespirationRate().GetValue(FrequencyUnit::Per_min) < 8) { /// \event Patient: Bradypnea: Respiration rate is below 10 breaths per minute /// The patient has bradypnea. - m_Patient->SetEvent(CDM::enumPatientEvent::Bradypnea, true, m_data.GetSimulationTime()); /// \cite overdyk2007continuous + m_Patient->SetEvent(SEPatientEventType::Bradypnea, true, m_data.GetSimulationTime()); /// \cite overdyk2007continuous } else if (GetRespirationRate().GetValue(FrequencyUnit::Per_min) >= 10) // offset by 2 { /// \event Patient: End Bradypnea Event. The respiration rate has risen above 10. /// The patient is no longer considered to have bradypnea. - m_Patient->SetEvent(CDM::enumPatientEvent::Bradypnea, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::Bradypnea, false, m_data.GetSimulationTime()); } //Tachypnea if (GetRespirationRate().GetValue(FrequencyUnit::Per_min) > 20) { /// \event Patient: Tachypnea: Respiration rate is above 20 breaths per minute. /// The patient has tachypnea. - m_Patient->SetEvent(CDM::enumPatientEvent::Tachypnea, true, m_data.GetSimulationTime()); /// \cite - } else if (GetRespirationRate().GetValue(FrequencyUnit::Per_min) <= 18) // offset by 2 // && m_Patient->GetEventDuration(CDM::enumPatientEvent::Tachypnea, TimeUnit::s) > 5 for time based segmentation + m_Patient->SetEvent(SEPatientEventType::Tachypnea, true, m_data.GetSimulationTime()); /// \cite + } else if (GetRespirationRate().GetValue(FrequencyUnit::Per_min) <= 18) // offset by 2 // && m_Patient->GetEventDuration(SEPatientEventType::Tachypnea, TimeUnit::s) > 5 for time based segmentation { /// \event Patient: End Tachypnea Event. The respiration rate has fallen below 19.5. /// The patient is no longer considered to have tachypnea. - m_Patient->SetEvent(CDM::enumPatientEvent::Tachypnea, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::Tachypnea, false, m_data.GetSimulationTime()); } double highPh = 8.5; @@ -1994,7 +2000,7 @@ void Respiratory::CalculateVitalSigns() if (m_LastCardiacCycleBloodPH < 7.35 && m_ArterialCO2PartialPressure_mmHg > 47.0) { /// \event Patient: Respiratory Acidosis: event is triggered when blood pH is below 7.36 /// The patient has respiratory acidosis. - m_Patient->SetEvent(CDM::enumPatientEvent::RespiratoryAcidosis, true, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::RespiratoryAcidosis, true, m_data.GetSimulationTime()); /// \event Patient: arterial blood ph has dropped below 6.5. if (m_LastCardiacCycleBloodPH < lowPh) { @@ -2002,24 +2008,24 @@ void Respiratory::CalculateVitalSigns() Warning(ss); /// \irreversible Extreme respiratory Acidosis: blood pH below 6.5. if (!m_PatientActions->HasOverride()) { - m_Patient->SetEvent(CDM::enumPatientEvent::IrreversibleState, true, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::IrreversibleState, true, m_data.GetSimulationTime()); } else { - if (m_PatientActions->GetOverride()->GetOverrideConformance() == CDM::enumOnOff::On) { - m_Patient->SetEvent(CDM::enumPatientEvent::IrreversibleState, true, m_data.GetSimulationTime()); + if (m_PatientActions->GetOverride()->GetOverrideConformance() == SEOnOff::On) { + m_Patient->SetEvent(SEPatientEventType::IrreversibleState, true, m_data.GetSimulationTime()); } } } } else if (m_LastCardiacCycleBloodPH >= 7.38 && m_ArterialCO2PartialPressure_mmHg < 44.0) { /// \event Patient: End Respiratory Acidosis Event. The pH value has risen above 7.38. /// The patient is no longer considered to have respiratory acidosis. - m_Patient->SetEvent(CDM::enumPatientEvent::RespiratoryAcidosis, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::RespiratoryAcidosis, false, m_data.GetSimulationTime()); } ////Respiratory Alkalosis if (m_LastCardiacCycleBloodPH > 7.45 && m_ArterialCO2PartialPressure_mmHg < 37.0) { /// \event Patient: Respiratory Alkalosis: event is triggered when blood pH is above 7.45 /// The patient has respiratory alkalosis. - m_Patient->SetEvent(CDM::enumPatientEvent::RespiratoryAlkalosis, true, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::RespiratoryAlkalosis, true, m_data.GetSimulationTime()); /// \event Patient: arterial blood ph has gotten above 8.5. if (m_LastCardiacCycleBloodPH > highPh) { @@ -2027,17 +2033,17 @@ void Respiratory::CalculateVitalSigns() Warning(ss); /// \irreversible Extreme respiratory Alkalosis: blood pH above 8.5. if (!m_PatientActions->HasOverride()) { - m_Patient->SetEvent(CDM::enumPatientEvent::IrreversibleState, true, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::IrreversibleState, true, m_data.GetSimulationTime()); } else { - if (m_PatientActions->GetOverride()->GetOverrideConformance() == CDM::enumOnOff::On) { - m_Patient->SetEvent(CDM::enumPatientEvent::IrreversibleState, true, m_data.GetSimulationTime()); + if (m_PatientActions->GetOverride()->GetOverrideConformance() == SEOnOff::On) { + m_Patient->SetEvent(SEPatientEventType::IrreversibleState, true, m_data.GetSimulationTime()); } } } } else if (m_LastCardiacCycleBloodPH <= 7.43 && m_ArterialCO2PartialPressure_mmHg > 39.0) { /// \event Patient: End Respiratory Alkalosis Event. The pH value has has fallen below 7.45. /// The patient is no longer considered to have respiratory alkalosis. - m_Patient->SetEvent(CDM::enumPatientEvent::RespiratoryAlkalosis, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::RespiratoryAlkalosis, false, m_data.GetSimulationTime()); } } @@ -2425,7 +2431,7 @@ void Respiratory::ProcessOverride() GetPulmonaryResistance().SetValue(override->GetPulmonaryResistanceOverride(FlowResistanceUnit::cmH2O_s_Per_L), FlowResistanceUnit::cmH2O_s_Per_L); } if (override->HasRespirationRateOverride()) { - if (override->GetOverrideConformance() == CDM::enumOnOff::Off) { + if (override->GetOverrideConformance() == SEOnOff::Off) { GetRespirationRate().SetValue(override->GetRespirationRateOverride(FrequencyUnit::Per_min), FrequencyUnit::Per_min); } } @@ -2514,55 +2520,55 @@ void Respiratory::OverrideControlLoop() currentTotalPulmonaryVentilationOverride = override->GetTotalPulmonaryVentilationOverride(VolumePerTimeUnit::L_Per_min); } - if ((currentExpiratoryFlowOverride < minExpiratoryFlowOverride || currentExpiratoryFlowOverride > maxExpiratoryFlowOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentExpiratoryFlowOverride < minExpiratoryFlowOverride || currentExpiratoryFlowOverride > maxExpiratoryFlowOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Expiratory Flow Override (Respiratory) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentInspiratoryFlowOverride < minInspiratoryFlowOverride || currentInspiratoryFlowOverride > maxInspiratoryFlowOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentInspiratoryFlowOverride < minInspiratoryFlowOverride || currentInspiratoryFlowOverride > maxInspiratoryFlowOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Inspiratory Flow Override (Respiratory) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentPulmonaryComplianceOverride < minPulmonaryComplianceOverride || currentPulmonaryComplianceOverride > maxPulmonaryComplianceOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentPulmonaryComplianceOverride < minPulmonaryComplianceOverride || currentPulmonaryComplianceOverride > maxPulmonaryComplianceOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Pulmonary Compliance Override (Respiratory) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentPulmonaryResistanceOverride < minPulmonaryResistanceOverride || currentPulmonaryResistanceOverride > maxPulmonaryResistanceOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentPulmonaryResistanceOverride < minPulmonaryResistanceOverride || currentPulmonaryResistanceOverride > maxPulmonaryResistanceOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Pulmonary Resistance Override (Respiratory) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentRROverride < minRROverride || currentRROverride > maxRROverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentRROverride < minRROverride || currentRROverride > maxRROverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Respiration Rate Override (Respiratory) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentTVOverride < minTVOverride || currentTVOverride > maxTVOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentTVOverride < minTVOverride || currentTVOverride > maxTVOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Tidal Volume (Respiratory) Override set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentTargetPulmonaryVentilationOverride < minTargetPulmonaryVentilationOverride || currentTargetPulmonaryVentilationOverride > maxTargetPulmonaryVentilationOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentTargetPulmonaryVentilationOverride < minTargetPulmonaryVentilationOverride || currentTargetPulmonaryVentilationOverride > maxTargetPulmonaryVentilationOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Target Pulmonary Ventilation Override (Respiratory) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentTotalAlveolarVentilationOverride < minTotalAlveolarVentilationOverride || currentTotalAlveolarVentilationOverride > maxTotalAlveolarVentilationOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentTotalAlveolarVentilationOverride < minTotalAlveolarVentilationOverride || currentTotalAlveolarVentilationOverride > maxTotalAlveolarVentilationOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Total Alveolar Ventilation Override (Respiratory) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentTotalLungVolumeOverride < minTotalLungVolumeOverride || currentTotalLungVolumeOverride > maxTotalLungVolumeOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentTotalLungVolumeOverride < minTotalLungVolumeOverride || currentTotalLungVolumeOverride > maxTotalLungVolumeOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Total Lung Volume Override (Respiratory) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentTotalPulmonaryVentilationOverride < minTotalPulmonaryVentilationOverride || currentTotalPulmonaryVentilationOverride > maxTotalPulmonaryVentilationOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentTotalPulmonaryVentilationOverride < minTotalPulmonaryVentilationOverride || currentTotalPulmonaryVentilationOverride > maxTotalPulmonaryVentilationOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Total Pulmonary Ventilation Override (Respiratory) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } return; } diff --git a/projects/biogears/libBiogears/src/engine/Systems/Saturation.cpp b/projects/biogears/libBiogears/src/engine/Systems/Saturation.cpp index 84cd9748c..71b438985 100644 --- a/projects/biogears/libBiogears/src/engine/Systems/Saturation.cpp +++ b/projects/biogears/libBiogears/src/engine/Systems/Saturation.cpp @@ -146,15 +146,15 @@ SaturationCalculator::SaturationCalculator(BioGears& bg) void SaturationCalculator::Initialize(SESubstanceManager& substances) { m_Logger = substances.GetLogger(); - m_O2 = substances.GetSubstance("Oxygen"); - m_CO2 = substances.GetSubstance("CarbonDioxide"); - m_CO = substances.GetSubstance("CarbonMonoxide"); - m_Hb = substances.GetSubstance("Hemoglobin"); - m_HbO2 = substances.GetSubstance("Oxyhemoglobin"); - m_HbCO2 = substances.GetSubstance("Carbaminohemoglobin"); - m_HbCO = substances.GetSubstance("Carboxyhemoglobin"); - m_HbO2CO2 = substances.GetSubstance("OxyCarbaminohemoglobin"); - m_HCO3 = substances.GetSubstance("Bicarbonate"); + m_O2 = substances.GetSubstance(StandardSubstances::Oxygen); + m_CO2 = substances.GetSubstance(StandardSubstances::CarbonDioxide); + m_CO = substances.GetSubstance(StandardSubstances::CarbonMonoxide); + m_Hb = substances.GetSubstance(StandardSubstances::Hemoglobin); + m_HbO2 = substances.GetSubstance(StandardSubstances::Oxyhemoglobin); + m_HbCO2 = substances.GetSubstance(StandardSubstances::Carbaminohemoglobin); + m_HbCO = substances.GetSubstance(StandardSubstances::Carboxyhemoglobin); + m_HbO2CO2 = substances.GetSubstance(StandardSubstances::OxyCarbaminohemoglobin); + m_HCO3 = substances.GetSubstance(StandardSubstances::Bicarbonate); if (m_O2 == nullptr) Fatal("Oxygen Definition not found"); @@ -804,7 +804,7 @@ void SaturationCalculator::CalculateBloodGasDistribution(SELiquidCompartment& cm totalHbRelativeError = (resultantTotalHgb_mM - InputAmountTotalHb_mM) / InputAmountTotalHb_mM; //These shouldn't really happen unless we're at crazy extremes - if (!m_data.GetPatient().IsEventActive(CDM::enumPatientEvent::HemolyticTransfusionReaction)) { + if (!m_data.GetPatient().IsEventActive(SEPatientEventType::HemolyticTransfusionReaction)) { if (std::abs(totalCO2RelativeError) > tolerance && InputAmountTotalCO2_mM > approxZero) { resultantDissolvedCO2_mM += (InputAmountTotalCO2_mM - resultantTotalCO2_mM); errMsg << "Failure to conserve CO2 amount (GeneralMath:CalculateBloodGasDistribution);" diff --git a/projects/biogears/libBiogears/src/engine/Systems/Tissue.cpp b/projects/biogears/libBiogears/src/engine/Systems/Tissue.cpp index f80d2e6e1..08389297b 100644 --- a/projects/biogears/libBiogears/src/engine/Systems/Tissue.cpp +++ b/projects/biogears/libBiogears/src/engine/Systems/Tissue.cpp @@ -1,4 +1,4 @@ - /************************************************************************************** +/************************************************************************************** Copyright 2015 Applied Research Associates, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License @@ -11,9 +11,12 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include -//Standad Includes +#include "io/cdm/Physiology.h" +#include "io/cdm/Property.h" + +// Standad Includes #include -//Project Includes +// Project Includes #include #include #include @@ -57,15 +60,14 @@ specific language governing permissions and limitations under the License. #include #include #include -namespace BGE = mil::tatrc::physiology::biogears; #pragma warning(disable : 4786) #pragma warning(disable : 4275) -//#define PROBE_BLOOD_GASES +// #define PROBE_BLOOD_GASES #define GAS_ONLY_PRODCOM -namespace std{ +namespace std { template class map; template class map; template class map; @@ -85,17 +87,17 @@ Tissue::Tissue(BioGears& bg) : SETissueSystem(bg.GetLogger()) , m_data(bg) { - Clear(); + Invalidate(); } Tissue::~Tissue() { - Clear(); + Invalidate(); } -void Tissue::Clear() +void Tissue::Invalidate() { - SETissueSystem::Clear(); + SETissueSystem::Invalidate(); m_Albumin = nullptr; m_Glucose = nullptr; m_Triacylglycerol = nullptr; @@ -167,7 +169,7 @@ void Tissue::Initialize() GetCarbonDioxideProductionRate().SetValue(200.0, VolumePerTimeUnit::mL_Per_min); GetRespiratoryExchangeRatio().SetValue(0.8); - //Set baseline insulin and glucagon values after stabilization + // Set baseline insulin and glucagon values after stabilization GetLiverInsulinSetPoint().Set(m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Liver)->GetSubstanceQuantity(*m_Insulin)->GetMolarity()); GetLiverGlucagonSetPoint().Set(m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Liver)->GetSubstanceQuantity(*m_Glucagon)->GetConcentration()); GetMuscleInsulinSetPoint().Set(m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Muscle)->GetSubstanceQuantity(*m_Insulin)->GetMolarity()); @@ -175,48 +177,15 @@ void Tissue::Initialize() GetFatInsulinSetPoint().Set(m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Fat)->GetSubstanceQuantity(*m_Insulin)->GetMolarity()); GetFatGlucagonSetPoint().Set(m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Fat)->GetSubstanceQuantity(*m_Glucagon)->GetConcentration()); - //Set nutrient stores (also reset in AtSteadyState) + // Set nutrient stores (also reset in AtSteadyState) GetLiverGlycogen().SetValue(.065 * m_data.GetCompartments().GetTissueCompartment(BGE::TissueCompartment::Liver)->GetTotalMass(MassUnit::g), MassUnit::g); - GetMuscleGlycogen().SetValue(.02 * m_data.GetPatient().GetMuscleMass(MassUnit::g), MassUnit::g); //2% of muscle mass + GetMuscleGlycogen().SetValue(.02 * m_data.GetPatient().GetMuscleMass(MassUnit::g), MassUnit::g); // 2% of muscle mass GetStoredProtein().SetValue(110, MassUnit::g); //"Reusable" protein stores are usually about 1% of total body protein, ~110 g (https://www.nap.edu/read/10490/chapter/12#595) GetStoredFat().SetValue(m_data.GetPatient().GetWeight(MassUnit::g) * m_data.GetPatient().GetBodyFatFraction().GetValue(), MassUnit::g); GetDehydrationFraction().SetValue(0); } -bool Tissue::Load(const CDM::BioGearsTissueSystemData& in) -{ - if (!SETissueSystem::Load(in)) - return false; - - m_O2ConsumedRunningAverage_mL_Per_s.Load(in.O2ConsumedRunningAverage_mL_Per_s()); - m_CO2ProducedRunningAverage_mL_Per_s.Load(in.CO2ProducedRunningAverage_mL_Per_s()); - m_RespiratoryQuotientRunningAverage.Load(in.RespiratoryQuotientRunningAverage()); - m_RestingPatientMass_kg = in.RestingPatientMass_kg(); - m_RestingFluidMass_kg = in.RestingFluidMass_kg(); - m_FatigueRunningAverage.Load(in.FatigueRunningAverage()); - - BioGearsSystem::LoadState(); - return true; -} -CDM::BioGearsTissueSystemData* Tissue::Unload() const -{ - CDM::BioGearsTissueSystemData* data = new CDM::BioGearsTissueSystemData(); - Unload(*data); - return data; -} -void Tissue::Unload(CDM::BioGearsTissueSystemData& data) const -{ - SETissueSystem::Unload(data); - - data.O2ConsumedRunningAverage_mL_Per_s(std::unique_ptr(m_O2ConsumedRunningAverage_mL_Per_s.Unload())); - data.CO2ProducedRunningAverage_mL_Per_s(std::unique_ptr(m_CO2ProducedRunningAverage_mL_Per_s.Unload())); - data.RespiratoryQuotientRunningAverage(std::unique_ptr(m_RespiratoryQuotientRunningAverage.Unload())); - data.RestingPatientMass_kg(m_RestingPatientMass_kg); - data.RestingFluidMass_kg(m_RestingFluidMass_kg); - data.FatigueRunningAverage(std::unique_ptr(m_FatigueRunningAverage.Unload())); -} - //-------------------------------------------------------------------------------------------------- /// \brief /// Initializes the tissue specific quantities @@ -229,14 +198,14 @@ void Tissue::SetUp() m_Dt_s = m_data.GetTimeStep().GetValue(TimeUnit::s); m_Patient = &m_data.GetPatient(); - //Initialize the Diffusion calculator here because it depends on all tissues being fully defined. Placement here ensures that Diffusion gets set up - //correctly whether you are initializing a new engine or loading a state. + // Initialize the Diffusion calculator here because it depends on all tissues being fully defined. Placement here ensures that Diffusion gets set up + // correctly whether you are initializing a new engine or loading a state. m_data.GetDiffusionCalculator().Initialize(m_data.GetSubstances()); //"Reusable" protein stores are usually about 1% of total body protein, ~110 g (https://www.nap.edu/read/10490/chapter/12#595) m_maxProteinStorage_g = 110; - Tissue::m_hepaticO2Consumed_mol = 0; //Hepatic system will send O2/CO2 changes from lipogenesis/gluconeogenesis to Tissue to factor into O2 consumption/CO2 production outputs + Tissue::m_hepaticO2Consumed_mol = 0; // Hepatic system will send O2/CO2 changes from lipogenesis/gluconeogenesis to Tissue to factor into O2 consumption/CO2 production outputs Tissue::m_hepaticCO2Produced_mol = 0; m_PatientActions = &m_data.GetActions().GetPatientActions(); @@ -268,7 +237,7 @@ void Tissue::SetUp() m_FatGlucagon = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Fat)->GetSubstanceQuantity(*m_Glucagon); m_FatTAG = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Fat)->GetSubstanceQuantity(*m_Triacylglycerol); - //These were m_GutE1 and m_GutE1ToE3, respectively. These were compliance elements in old tissue circuits so I have changed them to their new names + // These were m_GutE1 and m_GutE1ToE3, respectively. These were compliance elements in old tissue circuits so I have changed them to their new names m_GutE3 = m_data.GetCircuits().GetActiveCardiovascularCircuit().GetNode(BGE::TissueNode::GutE3); m_GutE3ToGround = m_data.GetCircuits().GetActiveCardiovascularCircuit().GetPath(BGE::TissuePath::GutE3ToGround); @@ -296,7 +265,7 @@ void Tissue::SetUp() m_LeftPulmonaryCapillaries = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::LeftPulmonaryCapillaries); m_RightPulmonaryCapillaries = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::RightPulmonaryCapillaries); - //Store tissue-blood pairs + // Store tissue-blood pairs m_TissueToVascular.clear(); m_TissueToVascular[m_data.GetCompartments().GetTissueCompartment(BGE::TissueCompartment::Fat)] = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Fat); m_TissueToVascular[m_data.GetCompartments().GetTissueCompartment(BGE::TissueCompartment::Bone)] = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Bone); @@ -312,7 +281,7 @@ void Tissue::SetUp() m_TissueToVascular[m_data.GetCompartments().GetTissueCompartment(BGE::TissueCompartment::Skin)] = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Skin); m_TissueToVascular[m_data.GetCompartments().GetTissueCompartment(BGE::TissueCompartment::Spleen)] = m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Spleen); - //Store paths from vascular node to first extracellular node (i.e. vascular oncotic pressure source) + // Store paths from vascular node to first extracellular node (i.e. vascular oncotic pressure source) m_VascularCopPaths.clear(); m_VascularCopPaths[m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Fat)] = m_data.GetCircuits().GetActiveCardiovascularCircuit().GetPath(BGE::TissuePath::FatVToFatE1); m_VascularCopPaths[m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Bone)] = m_data.GetCircuits().GetActiveCardiovascularCircuit().GetPath(BGE::TissuePath::BoneVToBoneE1); @@ -330,9 +299,9 @@ void Tissue::SetUp() m_VascularCopPaths[m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Skin)] = m_data.GetCircuits().GetActiveCardiovascularCircuit().GetPath(BGE::TissuePath::SkinVToSkinE1); m_VascularCopPaths[m_data.GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Spleen)] = m_data.GetCircuits().GetActiveCardiovascularCircuit().GetPath(BGE::TissuePath::SpleenVToSpleenE1); - //In all likelihood will need a map at some point for capillary resistance paths (first extracellular node to second extracellular node) + // In all likelihood will need a map at some point for capillary resistance paths (first extracellular node to second extracellular node) - //Store paths from second extracellular node to third extracellular node (i.e. interstitial oncotic pressure source) + // Store paths from second extracellular node to third extracellular node (i.e. interstitial oncotic pressure source) m_InterstitialCopPaths.clear(); m_InterstitialCopPaths[m_data.GetCompartments().GetTissueCompartment(BGE::TissueCompartment::Fat)] = m_data.GetCircuits().GetActiveCardiovascularCircuit().GetPath(BGE::TissuePath::FatE2ToFatE3); m_InterstitialCopPaths[m_data.GetCompartments().GetTissueCompartment(BGE::TissueCompartment::Bone)] = m_data.GetCircuits().GetActiveCardiovascularCircuit().GetPath(BGE::TissuePath::BoneE2ToBoneE3); @@ -348,7 +317,7 @@ void Tissue::SetUp() m_InterstitialCopPaths[m_data.GetCompartments().GetTissueCompartment(BGE::TissueCompartment::Skin)] = m_data.GetCircuits().GetActiveCardiovascularCircuit().GetPath(BGE::TissuePath::SkinE2ToSkinE3); m_InterstitialCopPaths[m_data.GetCompartments().GetTissueCompartment(BGE::TissueCompartment::Spleen)] = m_data.GetCircuits().GetActiveCardiovascularCircuit().GetPath(BGE::TissuePath::SpleenE2ToSpleenE3); - //Store paths from extracellular space to intracellular space (i.e. flow source paths) + // Store paths from extracellular space to intracellular space (i.e. flow source paths) m_ExtraToIntraPaths.clear(); m_ExtraToIntraPaths[m_data.GetCompartments().GetTissueCompartment(BGE::TissueCompartment::Fat)] = m_data.GetCircuits().GetActiveCardiovascularCircuit().GetPath(BGE::TissuePath::FatE3ToFatI); m_ExtraToIntraPaths[m_data.GetCompartments().GetTissueCompartment(BGE::TissueCompartment::Bone)] = m_data.GetCircuits().GetActiveCardiovascularCircuit().GetPath(BGE::TissuePath::BoneE3ToBoneI); @@ -415,8 +384,8 @@ void Tissue::SetUp() m_leftLegDeltaResistance_mmHg_s_Per_mL = 0.0; m_rightLegDeltaResistance_mmHg_s_Per_mL = 0.0; m_trunkDeltaResistance_mmHg_s_Per_mL = 0.0; - //m_leftLungDeltaCompliance_mL_Per_mmHG = 0.0; - //m_rightLungDeltaCompliance_mL_Per_mmHG = 0.0; + // m_leftLungDeltaCompliance_mL_Per_mmHG = 0.0; + // m_rightLungDeltaCompliance_mL_Per_mmHG = 0.0; m_compartmentSyndromeCount = 0.0; m_baselineECFluidVolume_mL = 0.0; @@ -427,7 +396,7 @@ void Tissue::SetUp() m_rightLegEscharotomy = false; } -//#define logMeal +// #define logMeal void Tissue::AtSteadyState() { @@ -440,13 +409,13 @@ void Tissue::AtSteadyState() } if (m_data.GetState() == EngineState::AtSecondaryStableState && !m_data.GetConditions().HasStarvation()) { - //refill nutrient stores that were depleted during stabilization (should match SetUp) + // refill nutrient stores that were depleted during stabilization (should match SetUp) GetLiverGlycogen().SetValue(.065 * m_data.GetCompartments().GetTissueCompartment(BGE::TissueCompartment::Liver)->GetTotalMass(MassUnit::g), MassUnit::g); - GetMuscleGlycogen().SetValue(.02 * m_data.GetPatient().GetMuscleMass(MassUnit::g), MassUnit::g); //2% of muscle mass + GetMuscleGlycogen().SetValue(.02 * m_data.GetPatient().GetMuscleMass(MassUnit::g), MassUnit::g); // 2% of muscle mass GetStoredProtein().SetValue(110, MassUnit::g); GetStoredFat().SetValue(m_data.GetPatient().GetWeight(MassUnit::g) * m_data.GetPatient().GetBodyFatFraction().GetValue(), MassUnit::g); Info("Nutrient stores refilled after stabilization"); - //TEMPORARILY set to starved state + // TEMPORARILY set to starved state /* GetLiverGlycogen().SetValue(0, MassUnit::g); GetMuscleGlycogen().SetValue(0, MassUnit::g); @@ -472,39 +441,39 @@ void Tissue::SetStarvationState() double starvedTime_hr = m_data.GetConditions().GetStarvation()->GetTimeSinceMeal().GetValue(TimeUnit::hr); double totalMassLost_g = 0; - //Set new storage values + // Set new storage values - //Liver glycogen - //Based on engine runtime, lasts ~51 hours, decrease is nearly linear + // Liver glycogen + // Based on engine runtime, lasts ~51 hours, decrease is nearly linear double liverGlycogen_g = GeneralMath::LinearInterpolator(0, 51, .065 * m_data.GetCompartments().GetTissueCompartment(BGE::TissueCompartment::Liver)->GetTotalMass(MassUnit::g), 0, starvedTime_hr); - LLIM(liverGlycogen_g, 0); //can't have negative + LLIM(liverGlycogen_g, 0); // can't have negative GetLiverGlycogen().SetValue(liverGlycogen_g, MassUnit::g); totalMassLost_g += (.065 * m_data.GetCompartments().GetTissueCompartment(BGE::TissueCompartment::Liver)->GetTotalMass(MassUnit::g)) - liverGlycogen_g; - //Muscle glycogen - //Based on engine runtime, drops to ~425g after 76.4 hours, nearly linear + // Muscle glycogen + // Based on engine runtime, drops to ~425g after 76.4 hours, nearly linear double muscleGlycogen_g = GeneralMath::LinearInterpolator(0, 76.4, .02 * m_Patient->GetMuscleMass(MassUnit::g), 425, starvedTime_hr); - LLIM(muscleGlycogen_g, 0); //can't have negative + LLIM(muscleGlycogen_g, 0); // can't have negative GetMuscleGlycogen().SetValue(muscleGlycogen_g, MassUnit::g); totalMassLost_g += (.02 * m_Patient->GetMuscleMass(MassUnit::g)) - muscleGlycogen_g; - //Stored Protein - //Based on engine runtime, lasts ~45.5 hours, decrease is nearly linear + // Stored Protein + // Based on engine runtime, lasts ~45.5 hours, decrease is nearly linear double storedProtein_g = GeneralMath::LinearInterpolator(0, 45.5, 110, 0, starvedTime_hr); - LLIM(storedProtein_g, 0); //can't have negative + LLIM(storedProtein_g, 0); // can't have negative GetStoredProtein().SetValue(liverGlycogen_g, MassUnit::g); totalMassLost_g += (110) - storedProtein_g; - //Muscle Mass - //Drops at same rate as stored protein, but only after that is used up - //If they're starved so long they've used all of their protein, they're dead + // Muscle Mass + // Drops at same rate as stored protein, but only after that is used up + // If they're starved so long they've used all of their protein, they're dead double muscleMassDecrease_g = GeneralMath::LinearInterpolator(0, 45.5, 0, 110, starvedTime_hr); BLIM(muscleMassDecrease_g, 0, m_Patient->GetMuscleMass().GetValue(MassUnit::g)); m_Patient->GetMuscleMass().IncrementValue(-muscleMassDecrease_g, MassUnit::g); totalMassLost_g += muscleMassDecrease_g; - //Stored fat - //Based on engine runtime, drops ~521g in 96 hours, decrease is nearly linear + // Stored fat + // Based on engine runtime, drops ~521g in 96 hours, decrease is nearly linear double fat = GetStoredFat().GetValue(MassUnit::g); double fatMassDecrease_g = GeneralMath::LinearInterpolator(0, 96, 0, 521, starvedTime_hr); BLIM(fatMassDecrease_g, 0, GetStoredFat().GetValue(MassUnit::g)); @@ -512,7 +481,7 @@ void Tissue::SetStarvationState() fat = GetStoredFat().GetValue(MassUnit::g); totalMassLost_g += fatMassDecrease_g; - //Body weight and other patient parameters + // Body weight and other patient parameters double weight = m_Patient->GetWeight().GetValue(MassUnit::g); m_Patient->GetWeight().IncrementValue(-totalMassLost_g, MassUnit::g); weight = m_Patient->GetWeight().GetValue(MassUnit::g); @@ -521,9 +490,9 @@ void Tissue::SetStarvationState() double SiriBodyDensity_g_Per_cm3 = 4.95 / (m_Patient->GetBodyFatFraction().GetValue() + 4.50); double BrozekBodyDensity_g_Per_cm3 = 4.57 / (m_Patient->GetBodyFatFraction().GetValue() + 4.142); double bodyDensity_g_Per_cm3 = (SiriBodyDensity_g_Per_cm3 + BrozekBodyDensity_g_Per_cm3) / 2.0; - m_Patient->GetBodyDensity().SetValue(bodyDensity_g_Per_cm3, MassPerVolumeUnit::g_Per_cm3); //See BioGears::SetUpPatient() + m_Patient->GetBodyDensity().SetValue(bodyDensity_g_Per_cm3, MassPerVolumeUnit::g_Per_cm3); // See BioGears::SetUpPatient() - //Set new blood concentrations + // Set new blood concentrations m_data.GetSubstances().SetLiquidCompartmentNonGasesForStarvation(starvedTime_hr); } @@ -598,7 +567,7 @@ void Tissue::CalculateCompartmentalBurn() m_baselineECFluidVolume_mL = GetExtracellularFluidVolume().GetValue(VolumeUnit::mL); } - //Map the increased pressure in the muscle extracellular tissue compartment to the flow across the affected node + // Map the increased pressure in the muscle extracellular tissue compartment to the flow across the affected node SEFluidCircuit* activeCirculatoryCircuit = &m_data.GetCircuits().GetActiveCardiovascularCircuit(); SELiquidCompartment* muscleExtracellularCompartment = m_data.GetCompartments().GetLiquidCompartment(BGE::ExtravascularCompartment::MuscleExtracellular); SEEscharotomy* e; @@ -622,7 +591,7 @@ void Tissue::CalculateCompartmentalBurn() double burnTBSA = BurnAction->GetTotalBodySurfaceArea(); double burnIntensity = BurnAction->GetBurnIntensity(); std::vector burnComptVector = BurnAction->GetCompartments(); - double numBurnLocations = static_cast(burnComptVector.size()); //Currently assume tbsa is evenly spread across multiple locations; future update can correct this + double numBurnLocations = static_cast(burnComptVector.size()); // Currently assume tbsa is evenly spread across multiple locations; future update can correct this double tissueIntegrityPercent = m_data.GetBloodChemistry().GetInflammatoryResponse().GetTissueIntegrity().GetValue(); // As extracellular volume increases (particularly with fluid resuscitation), we would expect the resistance in the burned extremity to increase (less flow to extremity) @@ -640,7 +609,7 @@ void Tissue::CalculateCompartmentalBurn() } for (std::string burnCompt : burnComptVector) { // Per Compartment Affected - std::string comptSyndromePath = "Aorta1To"; //Affected resistance path based on burn compartment + std::string comptSyndromePath = "Aorta1To"; // Affected resistance path based on burn compartment muscleTissuePressure_mmHg = muscleExtracellularCompartment->GetPressure(PressureUnit::mmHg); muscleTissueVolume_mL = muscleExtracellularCompartment->GetVolume(VolumeUnit::mL); @@ -663,24 +632,24 @@ void Tissue::CalculateCompartmentalBurn() ULIM(burnSpread, 1.0); // 1.0 represents a full circumferential burn m_trunkDeltaResistance_mmHg_s_Per_mL += ((fluidCreepTuningFactor * burnSpread * deltaR_mmHg_s_Per_mL) / csTuningFactor); tunedDeltaR_mmHg_s_Per_mL = m_trunkDeltaResistance_mmHg_s_Per_mL; - if (activeCirculatoryCircuit->GetNode(targetNodeCardio)->GetPressure().GetValue(PressureUnit::mmHg) <= 24.0) { //Approx. 0.75% of normal pulse pressure, considered weak - m_Patient->SetEvent(CDM::enumPatientEvent::CompartmentSyndrome_Abdominal, true, m_data.GetSimulationTime()); + if (activeCirculatoryCircuit->GetNode(targetNodeCardio)->GetPressure().GetValue(PressureUnit::mmHg) <= 24.0) { // Approx. 0.75% of normal pulse pressure, considered weak + m_Patient->SetEvent(SEPatientEventType::CompartmentSyndromeAbdominal, true, m_data.GetSimulationTime()); m_compartmentSyndromeCount += 1.0; } - ///todo: test bladder pressure changes against renal functionality during burn + /// todo: test bladder pressure changes against renal functionality during burn // Change in bladder pressure for VIR testing. Needs to be tested to see how much it impacts burns in BG (ONLY ABDOMINAL CS) - //double bladderPressure = m_data.GetCircuits().GetRenalCircuit().GetNode(BGE::RenalNode::Bladder)->GetPressure().GetValue(PressureUnit::mmHg); - //double bladderPressureMultiplier = ((-1.0 * m_data.GetBloodChemistry().GetInflammatoryResponse().GetTissueIntegrity().GetValue() + 1.0) * 6.25); //Asymptotic relation to tissue integirty, max increase of 6.25 - //m_data.GetCircuits().GetRenalCircuit().GetNode(BGE::RenalNode::Bladder)->GetNextPressure().SetValue(bladderPressure * bladderPressureMultiplier, PressureUnit::mmHg); + // double bladderPressure = m_data.GetCircuits().GetRenalCircuit().GetNode(BGE::RenalNode::Bladder)->GetPressure().GetValue(PressureUnit::mmHg); + // double bladderPressureMultiplier = ((-1.0 * m_data.GetBloodChemistry().GetInflammatoryResponse().GetTissueIntegrity().GetValue() + 1.0) * 6.25); //Asymptotic relation to tissue integirty, max increase of 6.25 + // m_data.GetCircuits().GetRenalCircuit().GetNode(BGE::RenalNode::Bladder)->GetNextPressure().SetValue(bladderPressure * bladderPressureMultiplier, PressureUnit::mmHg); } else if (burnCompt == "LeftArm" && m_leftArmEscharotomy == false) { burnSpread = BurnAction->getTrunkBurnIntensity() / 0.09; // 0.09 refers to rule of nines maximum percent of tbsa allocated to location ULIM(burnSpread, 1.0); // 1.0 represents a full circumferential burn m_leftArmDeltaResistance_mmHg_s_Per_mL += ((fluidCreepTuningFactor * burnSpread * deltaR_mmHg_s_Per_mL) / csTuningFactor); tunedDeltaR_mmHg_s_Per_mL = m_leftArmDeltaResistance_mmHg_s_Per_mL; - if (activeCirculatoryCircuit->GetNode(targetNodeCardio)->GetPressure().GetValue(PressureUnit::mmHg) <= 24.0) { //Approx. 0.75% of normal pulse pressure - m_Patient->SetEvent(CDM::enumPatientEvent::CompartmentSyndrome_LeftArm, true, m_data.GetSimulationTime()); + if (activeCirculatoryCircuit->GetNode(targetNodeCardio)->GetPressure().GetValue(PressureUnit::mmHg) <= 24.0) { // Approx. 0.75% of normal pulse pressure + m_Patient->SetEvent(SEPatientEventType::CompartmentSyndromeLeftArm, true, m_data.GetSimulationTime()); m_compartmentSyndromeCount += 1.0; } } else if (burnCompt == "RightArm" && m_rightArmEscharotomy == false) { @@ -688,8 +657,8 @@ void Tissue::CalculateCompartmentalBurn() ULIM(burnSpread, 1.0); // 1.0 represents a full circumferential burn m_rightArmDeltaResistance_mmHg_s_Per_mL += ((fluidCreepTuningFactor * burnSpread * deltaR_mmHg_s_Per_mL) / csTuningFactor); tunedDeltaR_mmHg_s_Per_mL = m_rightArmDeltaResistance_mmHg_s_Per_mL; - if (activeCirculatoryCircuit->GetNode(targetNodeCardio)->GetPressure().GetValue(PressureUnit::mmHg) <= 24.0) { //Approx. 0.75% of normal pulse pressure - m_Patient->SetEvent(CDM::enumPatientEvent::CompartmentSyndrome_RightArm, true, m_data.GetSimulationTime()); + if (activeCirculatoryCircuit->GetNode(targetNodeCardio)->GetPressure().GetValue(PressureUnit::mmHg) <= 24.0) { // Approx. 0.75% of normal pulse pressure + m_Patient->SetEvent(SEPatientEventType::CompartmentSyndromeRightArm, true, m_data.GetSimulationTime()); m_compartmentSyndromeCount += 1.0; } } else if (burnCompt == "LeftLeg" && m_leftLegEscharotomy == false) { @@ -697,8 +666,8 @@ void Tissue::CalculateCompartmentalBurn() ULIM(burnSpread, 1.0); // 1.0 represents a full circumferential burn m_leftLegDeltaResistance_mmHg_s_Per_mL += ((fluidCreepTuningFactor * burnSpread * deltaR_mmHg_s_Per_mL) / csTuningFactor); tunedDeltaR_mmHg_s_Per_mL = m_leftLegDeltaResistance_mmHg_s_Per_mL; - if (activeCirculatoryCircuit->GetNode(targetNodeCardio)->GetPressure().GetValue(PressureUnit::mmHg) <= 24.0) { //Approx. 0.75% of normal pulse pressure - m_Patient->SetEvent(CDM::enumPatientEvent::CompartmentSyndrome_LeftLeg, true, m_data.GetSimulationTime()); + if (activeCirculatoryCircuit->GetNode(targetNodeCardio)->GetPressure().GetValue(PressureUnit::mmHg) <= 24.0) { // Approx. 0.75% of normal pulse pressure + m_Patient->SetEvent(SEPatientEventType::CompartmentSyndromeLeftLeg, true, m_data.GetSimulationTime()); m_compartmentSyndromeCount += 1.0; } } else if (burnCompt == "RightLeg" && m_rightLegEscharotomy == false) { @@ -706,8 +675,8 @@ void Tissue::CalculateCompartmentalBurn() ULIM(burnSpread, 1.0); // 1.0 represents a full circumferential burn m_rightLegDeltaResistance_mmHg_s_Per_mL += ((fluidCreepTuningFactor * burnSpread * deltaR_mmHg_s_Per_mL) / csTuningFactor); tunedDeltaR_mmHg_s_Per_mL = m_rightLegDeltaResistance_mmHg_s_Per_mL; - if (activeCirculatoryCircuit->GetNode(targetNodeCardio)->GetPressure().GetValue(PressureUnit::mmHg) <= 24.0) { //Approx. 0.75% of normal pulse pressure - m_Patient->SetEvent(CDM::enumPatientEvent::CompartmentSyndrome_RightLeg, true, m_data.GetSimulationTime()); + if (activeCirculatoryCircuit->GetNode(targetNodeCardio)->GetPressure().GetValue(PressureUnit::mmHg) <= 24.0) { // Approx. 0.75% of normal pulse pressure + m_Patient->SetEvent(SEPatientEventType::CompartmentSyndromeRightLeg, true, m_data.GetSimulationTime()); m_compartmentSyndromeCount += 1.0; } } else { @@ -720,9 +689,9 @@ void Tissue::CalculateCompartmentalBurn() } // Any "Per Burn" changes not affecting specific burn compartments would go below - ///todo: flag at the top to initizlie compliance lung changes + /// todo: flag at the top to initizlie compliance lung changes /*Compartment syndrome is known to cause decreased compliance in the lungs, though not touching the lungs still show this physiology effect, so this change has been left out for now - + //Respiratory circuit and path/node initialization SEFluidCircuit* activeRespiratoryCircuit = &m_data.GetCircuits().GetActiveRespiratoryCircuit(); SEFluidCircuitPath* targetPathRespRight = activeRespiratoryCircuit->GetPath(BGE::RespiratoryPath::RightAlveoliToRightPleuralConnection); @@ -752,7 +721,7 @@ void Tissue::CalculateCompartmentalBurn() targetPathRespLeft->GetNextCompliance().SetValue(targetPathRespLeft->GetNextCompliance(FlowComplianceUnit::mL_Per_mmHg) - (csComplianceTuningFactor*deltaCLeft_mL_Per_mmHG), FlowComplianceUnit::mL_Per_mmHg);*/ if (m_data.GetActions().GetPatientActions().HasEscharotomy()) { - //By placing within the Burn Check, an escharatomy will not happen without a burn; however, still needs to check for compartment compliance + // By placing within the Burn Check, an escharatomy will not happen without a burn; however, still needs to check for compartment compliance std::map vectorEscharotomies = m_data.GetActions().GetPatientActions().GetEscharotomies(); for (auto eschData : vectorEscharotomies) { e = eschData.second; @@ -764,44 +733,44 @@ void Tissue::CalculateCompartmentalBurn() return; } // Check to make sure escharotomy compartment matches compartment syndrome location - if (locale == "Trunk" && m_Patient->IsEventActive(CDM::enumPatientEvent::CompartmentSyndrome_Abdominal)) { + if (locale == "Trunk" && m_Patient->IsEventActive(SEPatientEventType::CompartmentSyndromeAbdominal)) { eschPath += "Muscle1"; releasedResistance = m_trunkDeltaResistance_mmHg_s_Per_mL; m_trunkDeltaResistance_mmHg_s_Per_mL = 0.0; - m_Patient->SetEvent(CDM::enumPatientEvent::CompartmentSyndrome_Abdominal, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::CompartmentSyndromeAbdominal, false, m_data.GetSimulationTime()); m_compartmentSyndromeCount -= 1.0; m_trunkEscharotomy = true; - } else if (locale == "LeftArm" && m_Patient->IsEventActive(CDM::enumPatientEvent::CompartmentSyndrome_LeftArm)) { + } else if (locale == "LeftArm" && m_Patient->IsEventActive(SEPatientEventType::CompartmentSyndromeLeftArm)) { eschPath += "LeftArm1"; releasedResistance = m_leftArmDeltaResistance_mmHg_s_Per_mL; m_leftArmDeltaResistance_mmHg_s_Per_mL = 0.0; - m_Patient->SetEvent(CDM::enumPatientEvent::CompartmentSyndrome_LeftArm, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::CompartmentSyndromeLeftArm, false, m_data.GetSimulationTime()); m_compartmentSyndromeCount -= 1.0; m_leftArmEscharotomy = true; - } else if (locale == "LeftLeg" && m_Patient->IsEventActive(CDM::enumPatientEvent::CompartmentSyndrome_LeftLeg)) { + } else if (locale == "LeftLeg" && m_Patient->IsEventActive(SEPatientEventType::CompartmentSyndromeLeftLeg)) { eschPath += "LeftLeg1"; releasedResistance = m_leftLegDeltaResistance_mmHg_s_Per_mL; m_leftLegDeltaResistance_mmHg_s_Per_mL = 0.0; - m_Patient->SetEvent(CDM::enumPatientEvent::CompartmentSyndrome_LeftLeg, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::CompartmentSyndromeLeftLeg, false, m_data.GetSimulationTime()); m_compartmentSyndromeCount -= 1.0; m_leftLegEscharotomy = true; - } else if (locale == "RightArm" && m_Patient->IsEventActive(CDM::enumPatientEvent::CompartmentSyndrome_RightArm)) { + } else if (locale == "RightArm" && m_Patient->IsEventActive(SEPatientEventType::CompartmentSyndromeRightArm)) { eschPath += "RightArm1"; releasedResistance = m_rightArmDeltaResistance_mmHg_s_Per_mL; m_rightArmDeltaResistance_mmHg_s_Per_mL = 0.0; - m_Patient->SetEvent(CDM::enumPatientEvent::CompartmentSyndrome_RightArm, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::CompartmentSyndromeRightArm, false, m_data.GetSimulationTime()); m_compartmentSyndromeCount -= 1.0; m_rightArmEscharotomy = true; - } else if (locale == "RightLeg" && m_Patient->IsEventActive(CDM::enumPatientEvent::CompartmentSyndrome_RightLeg)) { + } else if (locale == "RightLeg" && m_Patient->IsEventActive(SEPatientEventType::CompartmentSyndromeRightLeg)) { eschPath += "RightLeg1"; releasedResistance = m_rightLegDeltaResistance_mmHg_s_Per_mL; m_rightLegDeltaResistance_mmHg_s_Per_mL = 0.0; - m_Patient->SetEvent(CDM::enumPatientEvent::CompartmentSyndrome_RightLeg, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::CompartmentSyndromeRightLeg, false, m_data.GetSimulationTime()); m_compartmentSyndromeCount -= 1.0; m_rightLegEscharotomy = true; } else { Warning("There is no compartment syndrome where you wish to perform an escharotomy. Ignoring action request."); - //If we do not remove the action, it will check every time step for the compartment syndrome to match the escharotomy + // If we do not remove the action, it will check every time step for the compartment syndrome to match the escharotomy m_data.GetActions().GetPatientActions().RemoveEscharotomy(locale); return; } @@ -813,7 +782,7 @@ void Tissue::CalculateCompartmentalBurn() // Per Escharotomy - ///todo: If we implement lung changes as commented before, here would be the spot to reverse them, paying special note to not release all pressure if only one of multiple compartment syndromes were cared for + /// todo: If we implement lung changes as commented before, here would be the spot to reverse them, paying special note to not release all pressure if only one of multiple compartment syndromes were cared for /*double percentChestRelease = 1.0/m_compartmentSyndromeCount; //Assume equal effect of each compartment on lungs double rightReleasedLungCompliance = m_rightLungDeltaCompliance_mL_Per_mmHG / m_compartmentSyndromeCount; @@ -821,7 +790,7 @@ void Tissue::CalculateCompartmentalBurn() double leftReleasedLungCompliance = m_leftLungDeltaCompliance_mL_Per_mmHG / m_compartmentSyndromeCount; targetPathRespLeft->GetNextCompliance().SetValue((targetPathRespLeft->GetNextCompliance(FlowComplianceUnit::mL_Per_mmHg) - leftReleasedLungCompliance), FlowComplianceUnit::mL_Per_mmHg); - + m_rightLungDeltaCompliance_mL_Per_mmHG -= rightReleasedLungCompliance; m_leftLungDeltaCompliance_mL_Per_mmHG -= leftReleasedLungCompliance; m_compartmentSyndromeCount -= 1.0;*/ @@ -876,9 +845,9 @@ void Tissue::CalculatePulmonaryCapillarySubstanceTransfer() double RightLungRatio = m_Patient->GetRightLungRatio().GetValue(); double StandardDiffusingCapacityOfOxygen_mLPersPermmHg = (DiffusionSurfaceArea_cm2 * Configuration.GetStandardOxygenDiffusionCoefficient(AreaPerTimePressureUnit::cm2_Per_s_mmHg)) / Configuration.GetStandardDiffusionDistance(LengthUnit::cm); - double DiffusingCapacityPerSide_mLPerSPermmHg = 0.0; //Will be set according to standard value for each substance + double DiffusingCapacityPerSide_mLPerSPermmHg = 0.0; // Will be set according to standard value for each substance - //Decrease the diffusing capacity of oxygen if patient has acute respiratory distress + // Decrease the diffusing capacity of oxygen if patient has acute respiratory distress if (m_PatientActions->HasAcuteRespiratoryDistress()) { const double severity = m_PatientActions->GetAcuteRespiratoryDistress()->GetSeverity().GetValue(); const double diffusionCapacityReductionFactor = GeneralMath::LinearInterpolator(0.0, 1.0, 1.0, 15.0, severity); @@ -889,11 +858,11 @@ void Tissue::CalculatePulmonaryCapillarySubstanceTransfer() sub->GetAlveolarTransfer().SetValue(0, VolumePerTimeUnit::mL_Per_s); sub->GetDiffusingCapacity().SetValue(0, VolumePerTimePressureUnit::mL_Per_s_mmHg); - //Left Side Alveoli Transfer + // Left Side Alveoli Transfer DiffusingCapacityPerSide_mLPerSPermmHg = StandardDiffusingCapacityOfOxygen_mLPersPermmHg * (1 - RightLungRatio); AlveolarPartialPressureGradientDiffusion(*m_LeftAlveoli, *m_LeftPulmonaryCapillaries, *sub, DiffusingCapacityPerSide_mLPerSPermmHg, m_Dt_s); - //Right Side Alveoli Transfer + // Right Side Alveoli Transfer DiffusingCapacityPerSide_mLPerSPermmHg = StandardDiffusingCapacityOfOxygen_mLPersPermmHg * RightLungRatio; AlveolarPartialPressureGradientDiffusion(*m_RightAlveoli, *m_RightPulmonaryCapillaries, *sub, DiffusingCapacityPerSide_mLPerSPermmHg, m_Dt_s); @@ -919,19 +888,19 @@ void Tissue::CalculatePulmonaryCapillarySubstanceTransfer() //-------------------------------------------------------------------------------------------------- void Tissue::CalculateMetabolicConsumptionAndProduction(double time_s) { - //Inputs and outputs + // Inputs and outputs const double TMR_kcal_Per_s = m_data.GetEnergy().GetTotalMetabolicRate(PowerUnit::kcal_Per_s); const double BMR_kcal_Per_s = m_data.GetPatient().GetBasalMetabolicRate(PowerUnit::kcal_Per_s); const double baseEnergyRequested_kcal = BMR_kcal_Per_s * time_s; const double biologicalDebt = m_data.GetNervous().GetBiologicalDebt().GetValue(); - const double exerciseEnergyRequested_kcal = m_data.GetEnergy().GetExerciseEnergyDemand(PowerUnit::kcal_Per_s) * time_s; //Will get added to muscle in tissue loop below - const double otherEnergyDemandAboveBasal_kcal = std::max((TMR_kcal_Per_s - BMR_kcal_Per_s) * time_s * (1.0 - biologicalDebt) - exerciseEnergyRequested_kcal, 0.0); //Due to other factors like shivering -- will get split between muscles and fat stores in tissue loop below - const double hypoperfusionDeficit_kcal = m_data.GetEnergy().GetEnergyDeficit(PowerUnit::kcal_Per_s) * time_s; //Hypoperfusion deficit is "faux" energy value -- it makes system perceive an energy deficit and enter anaerobic production earlier during hemorrhage and sepsis - double brainNeededEnergy_kcal = .2 * baseEnergyRequested_kcal; //brain requires a roughly constant 20% of basal energy regardless of exercise \cite raichle2002appraising + const double exerciseEnergyRequested_kcal = m_data.GetEnergy().GetExerciseEnergyDemand(PowerUnit::kcal_Per_s) * time_s; // Will get added to muscle in tissue loop below + const double otherEnergyDemandAboveBasal_kcal = std::max((TMR_kcal_Per_s - BMR_kcal_Per_s) * time_s * (1.0 - biologicalDebt) - exerciseEnergyRequested_kcal, 0.0); // Due to other factors like shivering -- will get split between muscles and fat stores in tissue loop below + const double hypoperfusionDeficit_kcal = m_data.GetEnergy().GetEnergyDeficit(PowerUnit::kcal_Per_s) * time_s; // Hypoperfusion deficit is "faux" energy value -- it makes system perceive an energy deficit and enter anaerobic production earlier during hemorrhage and sepsis + double brainNeededEnergy_kcal = .2 * baseEnergyRequested_kcal; // brain requires a roughly constant 20% of basal energy regardless of exercise \cite raichle2002appraising double nonbrainNeededEnergy_kcal = 0.8 * baseEnergyRequested_kcal + hypoperfusionDeficit_kcal; - double totalEnergyRequested_kcal = brainNeededEnergy_kcal + nonbrainNeededEnergy_kcal + exerciseEnergyRequested_kcal + otherEnergyDemandAboveBasal_kcal; //Use to check math below + double totalEnergyRequested_kcal = brainNeededEnergy_kcal + nonbrainNeededEnergy_kcal + exerciseEnergyRequested_kcal + otherEnergyDemandAboveBasal_kcal; // Use to check math below double brainEnergyReduction = 0.0; - double totalEnergyRequested_kcal_Check = 0.0; //Add tissue values to this as we go and use to check our math later + double totalEnergyRequested_kcal_Check = 0.0; // Add tissue values to this as we go and use to check our math later double brainEnergyDeficit_kcal = 0; double nonbrainEnergyDeficit_kcal = 0; double totalO2Consumed_mol = 0; @@ -946,41 +915,41 @@ void Tissue::CalculateMetabolicConsumptionAndProduction(double time_s) double fatigueLevel = 0; static double totalFatConsumed_g = 0; - //Data + // Data double energyPerMolATP_kcal = m_data.GetConfiguration().GetEnergyPerATP(EnergyPerAmountUnit::kcal_Per_mol); - double ATP_Per_Glucose = 29.85; //The full aerobic glucose breakdown gives ~29.85 ATP, including inefficiencies \cite rich2003molecular + double ATP_Per_Glucose = 29.85; // The full aerobic glucose breakdown gives ~29.85 ATP, including inefficiencies \cite rich2003molecular double CO2_Per_Glucose = 6; double O2_Per_Glucose = 6; - double ATP_Per_Ketone = 24; //Assuming acetoacetate - double CO2_Per_Ketone = 6; //double check this, ketones consumed via citric acid cycle, so should be the same as glucose - double O2_Per_Ketone = 6; //Not sure about this either + double ATP_Per_Ketone = 24; // Assuming acetoacetate + double CO2_Per_Ketone = 6; // double check this, ketones consumed via citric acid cycle, so should be the same as glucose + double O2_Per_Ketone = 6; // Not sure about this either double ATP_Per_AA = 13; double CO2_Per_AA = 1.5; double Urea_Per_AA = .5; - double O2_Per_AA = 1.875; //assuming RQ is .8 for AA, this should be 1.875 + double O2_Per_AA = 1.875; // assuming RQ is .8 for AA, this should be 1.875 double ATP_Per_TAG = ATP_Per_TAG = 3 * 106 + 22; // Assuming triplamitin as predominant triglyceride: 106 ATP per palmitate (3), 22 ATP from glycerol \cite Lehninger Principles of BioChem double CO2_Per_TAG = 51; // From complete combustion of tripalmitin (C51H98O6) double O2_Per_TAG = 72.5; // From complete combustion of tripalmitin (C51H98O6) - double aerobic_ATP_Per_Glycogen = ATP_Per_Glucose + 1; //Since muscle glycogen is already phosphorylated, we get more ATP from it than when we split glucose by glycolysis \cite guyton2006medical p 904 + double aerobic_ATP_Per_Glycogen = ATP_Per_Glucose + 1; // Since muscle glycogen is already phosphorylated, we get more ATP from it than when we split glucose by glycolysis \cite guyton2006medical p 904 double anaerobic_ATP_Per_Glycogen = 3; double lactate_Per_Glycogen = 2; double anaerobic_ATP_Per_Glucose = 2; double lactate_Per_Glucose = 2; - double glucose_CellularEfficiency = energyPerMolATP_kcal * ATP_Per_Glucose / 686; //686 kcal/mol energy generated when burning glucose completely via bomb calorimeter \cite boron2012medical - double TAG_CellularEfficiency = energyPerMolATP_kcal * ATP_Per_TAG / (7554.0); //From NIST website (can't just assume you add 3 palmitins and a glycerol, not how bond enthalpy works) - double AA_CellularEfficiency = energyPerMolATP_kcal * ATP_Per_AA / 387.189; //Alanine heat of combustion is 1.62 MJ/mol \cite livesey1984energy - double ketones_CellularEfficiency = glucose_CellularEfficiency; //Assuming the same as glucose - double mandatoryMuscleAnaerobicFraction = 0.028; //There is always some anaerobic consumption in the body, particularly in muscle fibers with few mitochondria \cite boron2012medical + double glucose_CellularEfficiency = energyPerMolATP_kcal * ATP_Per_Glucose / 686; // 686 kcal/mol energy generated when burning glucose completely via bomb calorimeter \cite boron2012medical + double TAG_CellularEfficiency = energyPerMolATP_kcal * ATP_Per_TAG / (7554.0); // From NIST website (can't just assume you add 3 palmitins and a glycerol, not how bond enthalpy works) + double AA_CellularEfficiency = energyPerMolATP_kcal * ATP_Per_AA / 387.189; // Alanine heat of combustion is 1.62 MJ/mol \cite livesey1984energy + double ketones_CellularEfficiency = glucose_CellularEfficiency; // Assuming the same as glucose + double mandatoryMuscleAnaerobicFraction = 0.028; // There is always some anaerobic consumption in the body, particularly in muscle fibers with few mitochondria \cite boron2012medical double kcal_Per_day_Per_Watt = 20.6362855; double maxWorkRate_W = m_Patient->GetMaxWorkRate().GetValue(PowerUnit::W); - double sleepTime_min = m_data.GetNervous().GetSleepTime().GetValue(TimeUnit::min); //update value from last computation - double wakeTime_min = m_data.GetNervous().GetWakeTime().GetValue(TimeUnit::min); //update value from last computation + double sleepTime_min = m_data.GetNervous().GetSleepTime().GetValue(TimeUnit::min); // update value from last computation + double wakeTime_min = m_data.GetNervous().GetWakeTime().GetValue(TimeUnit::min); // update value from last computation double sleepRatio = wakeTime_min / sleepTime_min; - //Patients with COPD show higher levels of anaerobic metabolism \cite mathur1999cerebral \cite engelen2000factors + // Patients with COPD show higher levels of anaerobic metabolism \cite mathur1999cerebral \cite engelen2000factors if (m_data.GetConditions().HasChronicObstructivePulmonaryDisease()) { - mandatoryMuscleAnaerobicFraction *= 1.5; //50% increase + mandatoryMuscleAnaerobicFraction *= 1.5; // 50% increase } if (m_PatientActions->HasHemorrhage()) { @@ -989,16 +958,16 @@ void Tissue::CalculateMetabolicConsumptionAndProduction(double time_s) mandatoryMuscleAnaerobicFraction = 0.5 * bleedingRate_mL_Per_min / maxBleedingRate_mL_Per_min; } - //if a patient is sleep deprived scale back how much glucose the brain is using (7%) + // if a patient is sleep deprived scale back how much glucose the brain is using (7%) if (sleepRatio > 5.0) { brainEnergyReduction = 0.07 * brainNeededEnergy_kcal; brainNeededEnergy_kcal -= brainEnergyReduction; totalEnergyRequested_kcal -= brainEnergyReduction; } - //update the total energy requested equation with the new brain energy: + // update the total energy requested equation with the new brain energy: - //Reusable values for looping + // Reusable values for looping SELiquidCompartment* vascular; SELiquidSubstanceQuantity* TissueO2; SELiquidSubstanceQuantity* TissueCO2; @@ -1043,20 +1012,20 @@ void Tissue::CalculateMetabolicConsumptionAndProduction(double time_s) BloodFlowFraction = vascular->GetInFlow(VolumePerTimeUnit::mL_Per_min) / totalFlowRate_mL_Per_min; } - //First, we'll handle brain consumption/production, since it's special - //Brain can only consume glucose and ketones + // First, we'll handle brain consumption/production, since it's special + // Brain can only consume glucose and ketones if (tissue == m_BrainTissue) { - totalEnergyRequested_kcal_Check += brainNeededEnergy_kcal; //Increment now before we start change brain energy needed value below - //First, let's check to see how much TOTAL energy exists in the brain as intracellular glucose - //We take the values that represent the cell's [inefficient] ability to conserve energy in ATP and use the efficiency to quantify the energy lost as heat + totalEnergyRequested_kcal_Check += brainNeededEnergy_kcal; // Increment now before we start change brain energy needed value below + // First, let's check to see how much TOTAL energy exists in the brain as intracellular glucose + // We take the values that represent the cell's [inefficient] ability to conserve energy in ATP and use the efficiency to quantify the energy lost as heat double totalEnergyAsIntracellularBrainGlucose_kcal = (TissueGlucose->GetMolarity(AmountPerVolumeUnit::mol_Per_L) * TissueVolume_L) * ATP_Per_Glucose * energyPerMolATP_kcal / glucose_CellularEfficiency; - //If we have enough energy as glucose to meet the brain's energy request this timestep, consume it + // If we have enough energy as glucose to meet the brain's energy request this timestep, consume it if (totalEnergyAsIntracellularBrainGlucose_kcal >= brainNeededEnergy_kcal) { - //The actual work done by the cell only accounts for a fraction of this energy, the rest is heat + // The actual work done by the cell only accounts for a fraction of this energy, the rest is heat double glucoseToConsume_mol = glucose_CellularEfficiency * brainNeededEnergy_kcal / energyPerMolATP_kcal / ATP_Per_Glucose; - //Since all brain consumption is aerobic and so requires O2, check if there's enough + // Since all brain consumption is aerobic and so requires O2, check if there's enough if (TissueO2->GetMass(MassUnit::g) > glucoseToConsume_mol * O2_Per_Glucose * m_O2->GetMolarMass(MassPerAmountUnit::g_Per_mol)) { TissueGlucose->GetMass().IncrementValue(-glucoseToConsume_mol * m_Glucose->GetMolarMass(MassPerAmountUnit::g_Per_mol), MassUnit::g); TissueCO2->GetMass().IncrementValue(glucoseToConsume_mol * CO2_Per_Glucose * m_CO2->GetMolarMass(MassPerAmountUnit::g_Per_mol), MassUnit::g); @@ -1068,18 +1037,18 @@ void Tissue::CalculateMetabolicConsumptionAndProduction(double time_s) TissueGlucose->GetMass().IncrementValue(-glucoseToConsume_mol * m_Glucose->GetMolarMass(MassPerAmountUnit::g_Per_mol), MassUnit::g); TissueCO2->GetMass().IncrementValue(glucoseToConsume_mol * CO2_Per_Glucose * m_CO2->GetMolarMass(MassPerAmountUnit::g_Per_mol), MassUnit::g); TissueO2->GetMass().SetValue(0, MassUnit::g); - double totalEnergyUsed = glucoseToConsume_mol * ATP_Per_Glucose * energyPerMolATP_kcal / glucose_CellularEfficiency; //we consume glucose, but also generate heat + double totalEnergyUsed = glucoseToConsume_mol * ATP_Per_Glucose * energyPerMolATP_kcal / glucose_CellularEfficiency; // we consume glucose, but also generate heat brainNeededEnergy_kcal -= totalEnergyUsed; heatGenerated_kcal += totalEnergyUsed * (1 - glucose_CellularEfficiency); } totalO2Consumed_mol += glucoseToConsume_mol * O2_Per_Glucose; totalCO2Produced_mol += glucoseToConsume_mol * CO2_Per_Glucose; } - //Otherwise, consume what intracellular glucose is there and track the deficit + // Otherwise, consume what intracellular glucose is there and track the deficit else { double glucoseToConsume_mol = TissueGlucose->GetMolarity(AmountPerVolumeUnit::mol_Per_L) * TissueVolume_L; - //We're still limited by O2 + // We're still limited by O2 if (TissueO2->GetMass(MassUnit::g) > glucoseToConsume_mol * O2_Per_Glucose * m_O2->GetMolarMass(MassPerAmountUnit::g_Per_mol)) { TissueGlucose->GetMass().SetValue(0, MassUnit::g); TissueCO2->GetMass().IncrementValue(glucoseToConsume_mol * CO2_Per_Glucose * m_CO2->GetMolarMass(MassPerAmountUnit::g_Per_mol), MassUnit::g); @@ -1100,10 +1069,10 @@ void Tissue::CalculateMetabolicConsumptionAndProduction(double time_s) totalCO2Produced_mol += glucoseToConsume_mol * CO2_Per_Glucose; } - //If we still need energy in the brain, ketones have to cover it + // If we still need energy in the brain, ketones have to cover it double totalEnergyAsIntracellularBrainKetones_kcal = (TissueKetones->GetMolarity(AmountPerVolumeUnit::mol_Per_L) * TissueVolume_L) * ATP_Per_Ketone * energyPerMolATP_kcal / ketones_CellularEfficiency; - //If we still need brain energy and we have enough ketones to cover it + // If we still need brain energy and we have enough ketones to cover it if (brainNeededEnergy_kcal > 0 && totalEnergyAsIntracellularBrainKetones_kcal >= brainNeededEnergy_kcal) { double ketonesToConsume_mol = ketones_CellularEfficiency * brainNeededEnergy_kcal / energyPerMolATP_kcal / ATP_Per_Ketone; @@ -1125,7 +1094,7 @@ void Tissue::CalculateMetabolicConsumptionAndProduction(double time_s) totalO2Consumed_mol += ketonesToConsume_mol * O2_Per_Ketone; totalCO2Produced_mol += ketonesToConsume_mol * CO2_Per_Ketone; } - //Otherwise, consume the ketones in the brain and track the deficit + // Otherwise, consume the ketones in the brain and track the deficit else if (brainNeededEnergy_kcal > 0) { double ketonesToConsume_mol = TissueKetones->GetMolarity(AmountPerVolumeUnit::mol_Per_L) * TissueVolume_L; @@ -1149,23 +1118,23 @@ void Tissue::CalculateMetabolicConsumptionAndProduction(double time_s) totalCO2Produced_mol += ketonesToConsume_mol * CO2_Per_Ketone; } - brainEnergyDeficit_kcal = brainNeededEnergy_kcal > 0 ? brainNeededEnergy_kcal : 0; //Any needed energy we have left is a deficit + brainEnergyDeficit_kcal = brainNeededEnergy_kcal > 0 ? brainNeededEnergy_kcal : 0; // Any needed energy we have left is a deficit - //Useful debugging information - //m_data.GetDataTrack().Probe("BrainDeficitFraction", brainEnergyDeficit_kcal / (.2 * baseEnergyRequested_kcal)); + // Useful debugging information + // m_data.GetDataTrack().Probe("BrainDeficitFraction", brainEnergyDeficit_kcal / (.2 * baseEnergyRequested_kcal)); TissueGlucose->Balance(BalanceLiquidBy::Mass); TissueO2->Balance(BalanceLiquidBy::Mass); TissueCO2->Balance(BalanceLiquidBy::Mass); TissueKetones->Balance(BalanceLiquidBy::Mass); - continue; //nothing else to do for this tissue + continue; // nothing else to do for this tissue } - //Now do non-brain tissues, which can consume TAG, AA, and glucose (and glycogen for muscles) - //They can also consume ketones in some quantities, but we're not modeling that - //The muscles always have some level of anaerobic activity - //Additionally, the muscles perform all of the additional work from exercise + // Now do non-brain tissues, which can consume TAG, AA, and glucose (and glycogen for muscles) + // They can also consume ketones in some quantities, but we're not modeling that + // The muscles always have some level of anaerobic activity + // Additionally, the muscles perform all of the additional work from exercise double tissueNeededEnergy_kcal = nonbrainNeededEnergy_kcal * BloodFlowFraction; double muscleMandatoryAnaerobicNeededEnergy_kcal = 0; const double muscleExerciseFraction = 0.8; @@ -1175,32 +1144,32 @@ void Tissue::CalculateMetabolicConsumptionAndProduction(double time_s) muscleMandatoryAnaerobicNeededEnergy_kcal = mandatoryMuscleAnaerobicFraction * tissueNeededEnergy_kcal; tissueNeededEnergy_kcal -= muscleMandatoryAnaerobicNeededEnergy_kcal; tissueNeededEnergy_kcal += (muscleExerciseFraction * exerciseEnergyRequested_kcal); - tissueNeededEnergy_kcal += (0.5 * otherEnergyDemandAboveBasal_kcal); //Splitting "extra" demand evenly between muscles and fat for now + tissueNeededEnergy_kcal += (0.5 * otherEnergyDemandAboveBasal_kcal); // Splitting "extra" demand evenly between muscles and fat for now double creatinineProductionRate_mg_Per_s = 2.0e-5; /// \todo Creatinine production rate should be a function of muscle mass. intracellular.GetSubstanceQuantity(*m_Creatinine)->GetMass().IncrementValue(creatinineProductionRate_mg_Per_s * m_Dt_s, MassUnit::mg); } if (tissue->GetName() == BGE::TissueCompartment::Fat) { - tissueNeededEnergy_kcal += ((0.5 * otherEnergyDemandAboveBasal_kcal) + (fatExerciseFraction * exerciseEnergyRequested_kcal)); //Splitting "extra" demand evenly bewteen muscles and fat for now + tissueNeededEnergy_kcal += ((0.5 * otherEnergyDemandAboveBasal_kcal) + (fatExerciseFraction * exerciseEnergyRequested_kcal)); // Splitting "extra" demand evenly bewteen muscles and fat for now } totalEnergyRequested_kcal_Check += (tissueNeededEnergy_kcal + muscleMandatoryAnaerobicNeededEnergy_kcal); - //Start with AA, since obligatory protein loss is 30g/day minimum going up to 125g/day in starvation \cite guyton2006medical - //However, some of this consumption is due to gluconeogenesis (10-20 grams or so, see \cite garber1974hepatic) - //Use hormone factor (based on liver) to determine "how starved" you are and vary AA consumption linearly from 15 to 110 + // Start with AA, since obligatory protein loss is 30g/day minimum going up to 125g/day in starvation \cite guyton2006medical + // However, some of this consumption is due to gluconeogenesis (10-20 grams or so, see \cite garber1974hepatic) + // Use hormone factor (based on liver) to determine "how starved" you are and vary AA consumption linearly from 15 to 110 double localHormoneFactor = Hepatic::CalculateRelativeHormoneChange(GetLiverInsulinSetPoint().GetValue(AmountPerVolumeUnit::mmol_Per_L) * 1e9, GetLiverGlucagonSetPoint().GetValue(MassPerVolumeUnit::mg_Per_mL) * 1e9, vascular->GetSubstanceQuantity(*m_Insulin), vascular->GetSubstanceQuantity(*m_Glucagon), m_data); - BLIM(localHormoneFactor, -2, 0); //positive hormone factors mean we should consume the expected 30g/day + BLIM(localHormoneFactor, -2, 0); // positive hormone factors mean we should consume the expected 30g/day double AAConsumptionRate_g_Per_day = GeneralMath::LinearInterpolator(0, 2, 15, 110, -localHormoneFactor); double AAToConsume_mol = (AAConsumptionRate_g_Per_day * time_s * BloodFlowFraction) / (24 * 3600 * m_AminoAcids->GetMolarMass(MassPerAmountUnit::g_Per_mol)); - //See if we actually have enough AA to meet the request and carry it out + // See if we actually have enough AA to meet the request and carry it out double intracellularAA_mol = TissueAA->GetMolarity(AmountPerVolumeUnit::mol_Per_L) * TissueVolume_L; double AADeficit_mol = intracellularAA_mol - AAToConsume_mol; - //There wasn't enough; consume all intracellular AA and track deficit if desired + // There wasn't enough; consume all intracellular AA and track deficit if desired if (AADeficit_mol < 0) { - //AA consumption is aerobic + // AA consumption is aerobic if (TissueO2->GetMass(MassUnit::g) > intracellularAA_mol * O2_Per_AA * m_O2->GetMolarMass(MassPerAmountUnit::g_Per_mol)) { TissueAA->GetMass().SetValue(0, MassUnit::g); m_LiverExtracellular->GetSubstanceQuantity(*m_Urea)->GetMass().IncrementValue(intracellularAA_mol * Urea_Per_AA * m_Urea->GetMolarMass(MassPerAmountUnit::g_Per_mol), MassUnit::g); @@ -1224,9 +1193,9 @@ void Tissue::CalculateMetabolicConsumptionAndProduction(double time_s) totalCO2Produced_mol += AAActuallyConsumed_mol * CO2_Per_AA; } } - //There was enough; consume the required amount + // There was enough; consume the required amount else { - //AA consumption is aerobic + // AA consumption is aerobic if (TissueO2->GetMass(MassUnit::g) > AAToConsume_mol * O2_Per_AA * m_O2->GetMolarMass(MassPerAmountUnit::g_Per_mol)) { TissueAA->GetMass().IncrementValue(-AAToConsume_mol * m_AminoAcids->GetMolarMass(MassPerAmountUnit::g_Per_mol), MassUnit::g); m_LiverExtracellular->GetSubstanceQuantity(*m_Urea)->GetMass().IncrementValue(AAToConsume_mol * Urea_Per_AA * m_Urea->GetMolarMass(MassPerAmountUnit::g_Per_mol), MassUnit::g); @@ -1238,7 +1207,7 @@ void Tissue::CalculateMetabolicConsumptionAndProduction(double time_s) totalO2Consumed_mol += AAToConsume_mol * O2_Per_AA; totalCO2Produced_mol += AAToConsume_mol * CO2_Per_AA; } - //O2 is limiting + // O2 is limiting else { double AAActuallyConsumed_mol = TissueO2->GetMass(MassUnit::g) / m_O2->GetMolarMass(MassPerAmountUnit::g_Per_mol) / O2_Per_AA; TissueAA->GetMass().IncrementValue(-AAActuallyConsumed_mol * m_AminoAcids->GetMolarMass(MassPerAmountUnit::g_Per_mol), MassUnit::g); @@ -1253,22 +1222,22 @@ void Tissue::CalculateMetabolicConsumptionAndProduction(double time_s) } } - //Under aerobic conditions, muscles and other tissues burn intracellular FFA by B-oxidation - //When fat consumption is unlimited, glycogen is virtually unused, so limit the rate of fat consumption based on hormone factor - //When fat is completely unused, full glycogen stores last about 16 hours - //The rate should obviously vary between these endpoints, but we have to manage RQ and fat consumption, too - //We expect to consume 50-70 or so grams of fat per day, so mols of TAG should be on the order of 1.7e-8, ballpark - //For now, vary linearly between 0 and an empirically determined .001 that gives 60g/day fat consumption and lowers glycogen duration - //todo readdress this scaling with respect to exercise to try to make the respiratory quotient trend correctly + // Under aerobic conditions, muscles and other tissues burn intracellular FFA by B-oxidation + // When fat consumption is unlimited, glycogen is virtually unused, so limit the rate of fat consumption based on hormone factor + // When fat is completely unused, full glycogen stores last about 16 hours + // The rate should obviously vary between these endpoints, but we have to manage RQ and fat consumption, too + // We expect to consume 50-70 or so grams of fat per day, so mols of TAG should be on the order of 1.7e-8, ballpark + // For now, vary linearly between 0 and an empirically determined .001 that gives 60g/day fat consumption and lowers glycogen duration + // todo readdress this scaling with respect to exercise to try to make the respiratory quotient trend correctly double rateLimitingTuningFactor = GeneralMath::LinearInterpolator(0, 2, 0, .001, -localHormoneFactor); double usableEnergyAsTissueTAG_kcal = rateLimitingTuningFactor * (TissueTAG->GetMolarity(AmountPerVolumeUnit::mol_Per_L) * TissueVolume_L) * ATP_Per_TAG * energyPerMolATP_kcal / TAG_CellularEfficiency; - //If we have enough usable intracellular TAG to meet the request for this tissue + // If we have enough usable intracellular TAG to meet the request for this tissue if (tissueNeededEnergy_kcal > 0 && usableEnergyAsTissueTAG_kcal >= tissueNeededEnergy_kcal) { double TAGToConsume_mol = TAG_CellularEfficiency * tissueNeededEnergy_kcal / energyPerMolATP_kcal / ATP_Per_TAG; - //TAG consumption is aerobic + // TAG consumption is aerobic if (TissueO2->GetMass(MassUnit::g) > TAGToConsume_mol * O2_Per_TAG * m_O2->GetMolarMass(MassPerAmountUnit::g_Per_mol)) { TissueTAG->GetMass().IncrementValue(-TAGToConsume_mol * m_Triacylglycerol->GetMolarMass(MassPerAmountUnit::g_Per_mol), MassUnit::g); TissueCO2->GetMass().IncrementValue(TAGToConsume_mol * CO2_Per_TAG * m_CO2->GetMolarMass(MassPerAmountUnit::g_Per_mol), MassUnit::g); @@ -1290,13 +1259,13 @@ void Tissue::CalculateMetabolicConsumptionAndProduction(double time_s) totalO2Consumed_mol += TAGToConsume_mol * O2_Per_TAG; totalCO2Produced_mol += TAGToConsume_mol * CO2_Per_TAG; } - //If there's not enough, consume what we can + // If there's not enough, consume what we can else if (tissueNeededEnergy_kcal > 0 && usableEnergyAsTissueTAG_kcal > 0) { double TAGToConsume_mol = rateLimitingTuningFactor * TissueTAG->GetMolarity(AmountPerVolumeUnit::mol_Per_L) * TissueVolume_L; - //TAG consumption is aerobic + // TAG consumption is aerobic if (TissueO2->GetMass(MassUnit::g) > TAGToConsume_mol * O2_Per_TAG * m_O2->GetMolarMass(MassPerAmountUnit::g_Per_mol)) { - double massToConsume = ((TissueTAG->GetMolarity().GetValue(AmountPerVolumeUnit::mol_Per_L) * TissueVolume_L) - (TAGToConsume_mol * m_Triacylglycerol->GetMolarMass(MassPerAmountUnit::g_Per_mol))) < 0 ? TissueTAG->GetMass().GetValue(MassUnit::g) : (TAGToConsume_mol * m_Triacylglycerol->GetMolarMass(MassPerAmountUnit::g_Per_mol)); //Since we're using the tuning factor, we want to avoid setting to 0 in the wrong cases + double massToConsume = ((TissueTAG->GetMolarity().GetValue(AmountPerVolumeUnit::mol_Per_L) * TissueVolume_L) - (TAGToConsume_mol * m_Triacylglycerol->GetMolarMass(MassPerAmountUnit::g_Per_mol))) < 0 ? TissueTAG->GetMass().GetValue(MassUnit::g) : (TAGToConsume_mol * m_Triacylglycerol->GetMolarMass(MassPerAmountUnit::g_Per_mol)); // Since we're using the tuning factor, we want to avoid setting to 0 in the wrong cases TissueTAG->GetMass().IncrementValue(-massToConsume, MassUnit::g); TissueCO2->GetMass().IncrementValue(TAGToConsume_mol * CO2_Per_TAG * m_CO2->GetMolarMass(MassPerAmountUnit::g_Per_mol), MassUnit::g); TissueO2->GetMass().IncrementValue(-TAGToConsume_mol * O2_Per_TAG * m_O2->GetMolarMass(MassPerAmountUnit::g_Per_mol), MassUnit::g); @@ -1318,14 +1287,14 @@ void Tissue::CalculateMetabolicConsumptionAndProduction(double time_s) totalCO2Produced_mol += TAGToConsume_mol * CO2_Per_TAG; } - //Tissues can consume glucose aerobically via glycolysis and Citric Acid Cycle + // Tissues can consume glucose aerobically via glycolysis and Citric Acid Cycle double totalEnergyAsTissueIntracellularGlucose_kcal = (TissueGlucose->GetMolarity(AmountPerVolumeUnit::mol_Per_L) * TissueVolume_L) * ATP_Per_Glucose * energyPerMolATP_kcal / glucose_CellularEfficiency; - //If we have enough intracellular glucose to meet the request + // If we have enough intracellular glucose to meet the request if (tissueNeededEnergy_kcal > 0 && totalEnergyAsTissueIntracellularGlucose_kcal >= tissueNeededEnergy_kcal) { double glucoseToConsume_mol = glucose_CellularEfficiency * tissueNeededEnergy_kcal / energyPerMolATP_kcal / ATP_Per_Glucose; - //This is aerobic glucose consumption, so it's limited by O2 + // This is aerobic glucose consumption, so it's limited by O2 if (TissueO2->GetMass(MassUnit::g) > glucoseToConsume_mol * O2_Per_Glucose * m_O2->GetMolarMass(MassPerAmountUnit::g_Per_mol)) { TissueGlucose->GetMass().IncrementValue(-glucoseToConsume_mol * m_Glucose->GetMolarMass(MassPerAmountUnit::g_Per_mol), MassUnit::g); TissueCO2->GetMass().IncrementValue(glucoseToConsume_mol * CO2_Per_Glucose * m_CO2->GetMolarMass(MassPerAmountUnit::g_Per_mol), MassUnit::g); @@ -1345,11 +1314,11 @@ void Tissue::CalculateMetabolicConsumptionAndProduction(double time_s) totalO2Consumed_mol += glucoseToConsume_mol * O2_Per_Glucose; totalCO2Produced_mol += glucoseToConsume_mol * CO2_Per_Glucose; } - //If we don't have enough glucose + // If we don't have enough glucose else if (tissueNeededEnergy_kcal > 0) { double glucoseToConsume_mol = TissueGlucose->GetMolarity(AmountPerVolumeUnit::mol_Per_L) * TissueVolume_L; - //If we have enough O2 + // If we have enough O2 if (TissueO2->GetMass(MassUnit::g) > glucoseToConsume_mol * O2_Per_Glucose * m_O2->GetMolarMass(MassPerAmountUnit::g_Per_mol)) { TissueGlucose->GetMass().SetValue(0, MassUnit::g); TissueCO2->GetMass().IncrementValue(glucoseToConsume_mol * CO2_Per_Glucose * m_CO2->GetMolarMass(MassPerAmountUnit::g_Per_mol), MassUnit::g); @@ -1370,16 +1339,16 @@ void Tissue::CalculateMetabolicConsumptionAndProduction(double time_s) totalCO2Produced_mol += glucoseToConsume_mol * CO2_Per_Glucose; } - //The muscle compartment has its own stores of glycogen that it can consume aerobically + // The muscle compartment has its own stores of glycogen that it can consume aerobically if (tissueNeededEnergy_kcal > 0 && tissue == m_MuscleTissue) { double totalEnergyAsMuscleGlycogen_kcal = (GetMuscleGlycogen(MassUnit::g) / m_Glucose->GetMolarMass(MassPerAmountUnit::g_Per_mol)) * aerobic_ATP_Per_Glycogen * energyPerMolATP_kcal / glucose_CellularEfficiency; - //If we have enough energy as glycogen, consume it - //TODO Glycogen should be consumed at a particular rate, like AA + // If we have enough energy as glycogen, consume it + // TODO Glycogen should be consumed at a particular rate, like AA if (totalEnergyAsMuscleGlycogen_kcal >= tissueNeededEnergy_kcal) { double glycogenConsumed_mol = glucose_CellularEfficiency * tissueNeededEnergy_kcal / energyPerMolATP_kcal / aerobic_ATP_Per_Glycogen; - //If we have enough O2 + // If we have enough O2 if (TissueO2->GetMass(MassUnit::g) > glycogenConsumed_mol * O2_Per_Glucose * m_O2->GetMolarMass(MassPerAmountUnit::g_Per_mol)) { GetMuscleGlycogen().IncrementValue(-glycogenConsumed_mol * m_Glucose->GetMolarMass(MassPerAmountUnit::g_Per_mol), MassUnit::g); TissueCO2->GetMass().IncrementValue(glycogenConsumed_mol * CO2_Per_Glucose * m_CO2->GetMolarMass(MassPerAmountUnit::g_Per_mol), MassUnit::g); @@ -1399,11 +1368,11 @@ void Tissue::CalculateMetabolicConsumptionAndProduction(double time_s) totalO2Consumed_mol += glycogenConsumed_mol * O2_Per_Glucose; totalCO2Produced_mol += glycogenConsumed_mol * CO2_Per_Glucose; } - //Otherwise, consume what glycogen we can + // Otherwise, consume what glycogen we can else { double glycogenConsumed_mol = GetMuscleGlycogen(MassUnit::g) / m_Glucose->GetMolarMass(MassPerAmountUnit::g_Per_mol); - //If we have enough O2 + // If we have enough O2 if (TissueO2->GetMass(MassUnit::g) > glycogenConsumed_mol * O2_Per_Glucose * m_O2->GetMolarMass(MassPerAmountUnit::g_Per_mol)) { GetMuscleGlycogen().SetValue(0, MassUnit::g); TissueCO2->GetMass().IncrementValue(glycogenConsumed_mol * CO2_Per_Glucose * m_CO2->GetMolarMass(MassPerAmountUnit::g_Per_mol), MassUnit::g); @@ -1425,64 +1394,64 @@ void Tissue::CalculateMetabolicConsumptionAndProduction(double time_s) } } - //If all O2 is gone, energy can be gotten from glycolysis only, with the pyruvate products converted to lactate (i.e. anaerobic) - //Since this metabolic pathway doesn't have the inefficiency of oxidative phosphorylation and citric acid cycle, we won't use the efficiency value - //This means we won't generate heat, which is probably not accurate + // If all O2 is gone, energy can be gotten from glycolysis only, with the pyruvate products converted to lactate (i.e. anaerobic) + // Since this metabolic pathway doesn't have the inefficiency of oxidative phosphorylation and citric acid cycle, we won't use the efficiency value + // This means we won't generate heat, which is probably not accurate totalEnergyAsTissueIntracellularGlucose_kcal = (TissueGlucose->GetMolarity(AmountPerVolumeUnit::mol_Per_L) * TissueVolume_L) * anaerobic_ATP_Per_Glucose * energyPerMolATP_kcal; - //If we have enough intracellular glucose to meet the request + // If we have enough intracellular glucose to meet the request if (tissueNeededEnergy_kcal > 0 && totalEnergyAsTissueIntracellularGlucose_kcal >= tissueNeededEnergy_kcal) { double glucoseToConsume_mol = tissueNeededEnergy_kcal / energyPerMolATP_kcal / anaerobic_ATP_Per_Glucose; TissueGlucose->GetMass().IncrementValue(-glucoseToConsume_mol * m_Glucose->GetMolarMass(MassPerAmountUnit::g_Per_mol), MassUnit::g); TissueLactate->GetMass().IncrementValue(glucoseToConsume_mol * lactate_Per_Glucose * m_Lactate->GetMolarMass(MassPerAmountUnit::g_Per_mol), MassUnit::g); tissueNeededEnergy_kcal = 0; lactateProductionRate_mol_Per_s += glucoseToConsume_mol * lactate_Per_Glucose / time_s; - if (m_AnaerobicTissues.find(tissue->GetName()) == std::string::npos) //for tracking only + if (m_AnaerobicTissues.find(tissue->GetName()) == std::string::npos) // for tracking only m_AnaerobicTissues.append(std::string { tissue->GetName() } + " "); } - //If we'll use up all the glucose + // If we'll use up all the glucose else if (tissueNeededEnergy_kcal > 0) { double glucoseToConsume_mol = totalEnergyAsTissueIntracellularGlucose_kcal / energyPerMolATP_kcal / anaerobic_ATP_Per_Glucose; TissueGlucose->GetMass().SetValue(0, MassUnit::g); TissueLactate->GetMass().IncrementValue(glucoseToConsume_mol * lactate_Per_Glucose * m_Lactate->GetMolarMass(MassPerAmountUnit::g_Per_mol), MassUnit::g); tissueNeededEnergy_kcal -= glucoseToConsume_mol * anaerobic_ATP_Per_Glucose * energyPerMolATP_kcal; lactateProductionRate_mol_Per_s += glucoseToConsume_mol * lactate_Per_Glucose / time_s; - if (m_AnaerobicTissues.find(tissue->GetName()) == std::string::npos) //for tracking only + if (m_AnaerobicTissues.find(tissue->GetName()) == std::string::npos) // for tracking only m_AnaerobicTissues.append(std::string { tissue->GetName() } + " "); } - //Muscles can convert glycogen anaerobically, too - //Note anaerobic glycolysis is limited by low pH, a feedback mechanism that isn't modeled here at this time + // Muscles can convert glycogen anaerobically, too + // Note anaerobic glycolysis is limited by low pH, a feedback mechanism that isn't modeled here at this time if ((tissueNeededEnergy_kcal > 0 || muscleMandatoryAnaerobicNeededEnergy_kcal > 0) && tissue == m_MuscleTissue) { double energyAsMuscleGlycogen_kcal = (GetMuscleGlycogen(MassUnit::g) / m_Glucose->GetMolarMass(MassPerAmountUnit::g_Per_mol)) * anaerobic_ATP_Per_Glycogen * energyPerMolATP_kcal; - //If we have enough + // If we have enough if (energyAsMuscleGlycogen_kcal >= (tissueNeededEnergy_kcal + muscleMandatoryAnaerobicNeededEnergy_kcal)) { double glycogenConsumed_g = ((tissueNeededEnergy_kcal + muscleMandatoryAnaerobicNeededEnergy_kcal) / energyAsMuscleGlycogen_kcal) * GetMuscleGlycogen(MassUnit::g); double glycogenConsumed_mol = glycogenConsumed_g / m_Glucose->GetMolarMass(MassPerAmountUnit::g_Per_mol); GetMuscleGlycogen().IncrementValue(-glycogenConsumed_g, MassUnit::g); TissueLactate->GetMass().IncrementValue(glycogenConsumed_mol * lactate_Per_Glycogen * m_Lactate->GetMolarMass(MassPerAmountUnit::g_Per_mol), MassUnit::g); lactateProductionRate_mol_Per_s += glycogenConsumed_mol * lactate_Per_Glycogen / time_s; - if (m_AnaerobicTissues.find(tissue->GetName()) == std::string::npos && tissueNeededEnergy_kcal != 0) //for tracking only + if (m_AnaerobicTissues.find(tissue->GetName()) == std::string::npos && tissueNeededEnergy_kcal != 0) // for tracking only m_AnaerobicTissues.append(std::string { tissue->GetName() } + " "); muscleMandatoryAnaerobicNeededEnergy_kcal = 0; tissueNeededEnergy_kcal = 0; } - //If we still can't meet the energy request, we have an energy deficit + // If we still can't meet the energy request, we have an energy deficit else { double glycogenConsumed_mol = GetMuscleGlycogen(MassUnit::g) / m_Glucose->GetMolarMass(MassPerAmountUnit::g_Per_mol); GetMuscleGlycogen().SetValue(0, MassUnit::g); TissueLactate->GetMass().IncrementValue(glycogenConsumed_mol * lactate_Per_Glycogen * m_Lactate->GetMolarMass(MassPerAmountUnit::g_Per_mol), MassUnit::g); tissueNeededEnergy_kcal -= glycogenConsumed_mol * anaerobic_ATP_Per_Glycogen * energyPerMolATP_kcal; lactateProductionRate_mol_Per_s += glycogenConsumed_mol * lactate_Per_Glycogen / time_s; - if (m_AnaerobicTissues.find(tissue->GetName()) == std::string::npos && tissueNeededEnergy_kcal != 0) //for tracking only + if (m_AnaerobicTissues.find(tissue->GetName()) == std::string::npos && tissueNeededEnergy_kcal != 0) // for tracking only m_AnaerobicTissues.append(std::string { tissue->GetName() } + " "); - tissueNeededEnergy_kcal += muscleMandatoryAnaerobicNeededEnergy_kcal; //add the still-needed mandatory anaerobic energy back to muscle's needed energy for tracking of the deficit + tissueNeededEnergy_kcal += muscleMandatoryAnaerobicNeededEnergy_kcal; // add the still-needed mandatory anaerobic energy back to muscle's needed energy for tracking of the deficit } } // - //Balance everything + // Balance everything TissueO2->Balance(BalanceLiquidBy::Mass); TissueCO2->Balance(BalanceLiquidBy::Mass); TissueGlucose->Balance(BalanceLiquidBy::Mass); @@ -1493,10 +1462,10 @@ void Tissue::CalculateMetabolicConsumptionAndProduction(double time_s) TissueUrea->Balance(BalanceLiquidBy::Mass); intracellular.GetSubstanceQuantity(*m_Creatinine)->Balance(BalanceLiquidBy::Mass); - //If none of this met our energy needs, we have a deficit (fatigue) + // If none of this met our energy needs, we have a deficit (fatigue) nonbrainEnergyDeficit_kcal += (tissueNeededEnergy_kcal > 0 ? tissueNeededEnergy_kcal : 0); - } //end of the tissue loop + } // end of the tissue loop ////Debug Info: Make sure that the energy we used lines up with our demand -- allowing 1% tolerance on either side if ((m_data.GetState() >= EngineState::AtSecondaryStableState) && (totalEnergyRequested_kcal_Check < 0.99 * totalEnergyRequested_kcal || totalEnergyRequested_kcal_Check > 1.01 * totalEnergyRequested_kcal)) { @@ -1507,7 +1476,7 @@ void Tissue::CalculateMetabolicConsumptionAndProduction(double time_s) Error(ss); } - //Update outputs + // Update outputs totalO2Consumed_mol += m_hepaticO2Consumed_mol; totalCO2Produced_mol += m_hepaticCO2Produced_mol; oxygenConsumptionRate_g_Per_s = totalO2Consumed_mol * m_O2->GetMolarMass(MassPerAmountUnit::g_Per_mol) / time_s; @@ -1520,7 +1489,7 @@ void Tissue::CalculateMetabolicConsumptionAndProduction(double time_s) m_CO2ProducedRunningAverage_mL_Per_s.Sample(CO2Production_mL_Per_s); m_RespiratoryQuotientRunningAverage.Sample(respiratoryQuotient); - //Only record data every 50 steps for these to iron out noise + // Only record data every 50 steps for these to iron out noise int steps = static_cast(m_data.GetSimulationTime().GetValue(TimeUnit::s) / time_s); if (steps % 50 == 0) { GetOxygenConsumptionRate().SetValue(m_O2ConsumedRunningAverage_mL_Per_s.Value(), VolumePerTimeUnit::mL_Per_s); @@ -1532,9 +1501,9 @@ void Tissue::CalculateMetabolicConsumptionAndProduction(double time_s) m_RespiratoryQuotientRunningAverage.Reset(); } - //GetOxygenConsumptionRate().SetValue(O2Consumption_mL_Per_s, VolumePerTimeUnit::mL_Per_s); - //GetCarbonDioxideProductionRate().SetValue(CO2Production_mL_Per_s, VolumePerTimeUnit::mL_Per_s); - //GetRespiratoryExchangeRatio().SetValue(respiratoryQuotient); + // GetOxygenConsumptionRate().SetValue(O2Consumption_mL_Per_s, VolumePerTimeUnit::mL_Per_s); + // GetCarbonDioxideProductionRate().SetValue(CO2Production_mL_Per_s, VolumePerTimeUnit::mL_Per_s); + // GetRespiratoryExchangeRatio().SetValue(respiratoryQuotient); m_energy->GetLactateProductionRate().SetValue(lactateProductionRate_mol_Per_s, AmountPerTimeUnit::mol_Per_s); achievedWorkRate_W = (1 / m_Dt_s) * 3600 * 24 * (exerciseEnergyRequested_kcal - brainEnergyDeficit_kcal - nonbrainEnergyDeficit_kcal) / kcal_Per_day_Per_Watt; // Achieved exercise level is a measure of how closely a subject reaches a desired metabolic demand due to limitations. Not the actual intensity. @@ -1542,7 +1511,7 @@ void Tissue::CalculateMetabolicConsumptionAndProduction(double time_s) m_energy->GetTotalWorkRateLevel().SetValue(achievedWorkRate_W / maxWorkRate_W); auto exercise = m_PatientActions->GetExercise(); double intensity = exercise->GetGenericExercise().Intensity.GetValue(); - if (intensity > 1e-6) { //approx. zero + if (intensity > 1e-6) { // approx. zero m_energy->GetAchievedExerciseLevel().SetValue(achievedWorkRate_W / maxWorkRate_W / intensity); } else { m_energy->GetAchievedExerciseLevel().SetValue(0.0); @@ -1554,47 +1523,47 @@ void Tissue::CalculateMetabolicConsumptionAndProduction(double time_s) double fatigue = ((brainEnergyDeficit_kcal + nonbrainEnergyDeficit_kcal) / (baseEnergyRequested_kcal + exerciseEnergyRequested_kcal)); - //sample to set so that it doesn't log like crazy + // sample to set so that it doesn't log like crazy fatigue = m_FatigueRunningAverage.Sample(fatigue); /// \event Patient: Fatigue - Energy stores are sub-maximal, skip if beginning of cardiac cycle. - //if (!m_Patient->IsEventActive(CDM::enumPatientEvent::StartOfCardiacCycle)) { - // if (fatigue > 0.0035) { - // m_Patient->SetEvent(CDM::enumPatientEvent::Fatigue, true, m_data.GetSimulationTime()); - // } else if (fatigue < 0.000001) { - // m_Patient->SetEvent(CDM::enumPatientEvent::Fatigue, false, m_data.GetSimulationTime()); - // } - //} + // if (!m_Patient->IsEventActive(SEPatientEventType::StartOfCardiacCycle)) { + // if (fatigue > 0.0035) { + // m_Patient->SetEvent(SEPatientEventType::Fatigue, true, m_data.GetSimulationTime()); + // } else if (fatigue < 0.000001) { + // m_Patient->SetEvent(SEPatientEventType::Fatigue, false, m_data.GetSimulationTime()); + // } + // } m_energy->GetFatigueLevel().SetValue(fatigue); - //Update other patient parameters + // Update other patient parameters //\todo: make sure body weight decreases when CO2 is exhaled m_Patient->GetBodyFatFraction().SetValue(GetStoredFat().GetValue(MassUnit::g) / m_Patient->GetWeight().GetValue(MassUnit::g)); m_Patient->GetLeanBodyMass().SetValue(m_Patient->GetWeight().GetValue(MassUnit::g) - GetStoredFat().GetValue(MassUnit::g), MassUnit::g); double SiriBodyDensity_g_Per_cm3 = 4.95 / (m_Patient->GetBodyFatFraction().GetValue() + 4.50); double BrozekBodyDensity_g_Per_cm3 = 4.57 / (m_Patient->GetBodyFatFraction().GetValue() + 4.142); double bodyDensity_g_Per_cm3 = (SiriBodyDensity_g_Per_cm3 + BrozekBodyDensity_g_Per_cm3) / 2.0; - m_Patient->GetBodyDensity().SetValue(bodyDensity_g_Per_cm3, MassPerVolumeUnit::g_Per_cm3); //See BioGears::SetUpPatient() + m_Patient->GetBodyDensity().SetValue(bodyDensity_g_Per_cm3, MassPerVolumeUnit::g_Per_cm3); // See BioGears::SetUpPatient() - //Reset O2/CO2 member variables since they're static + // Reset O2/CO2 member variables since they're static m_hepaticCO2Produced_mol = 0; m_hepaticO2Consumed_mol = 0; - //reset average at beginning of cardiac cycle: - if (m_Patient->IsEventActive(CDM::enumPatientEvent::StartOfCardiacCycle)) { + // reset average at beginning of cardiac cycle: + if (m_Patient->IsEventActive(SEPatientEventType::StartOfCardiacCycle)) { m_FatigueRunningAverage.Reset(); m_FatigueRunningAverage.Reset(); } - //Useful debugging information - //m_data.GetDataTrack().Probe("InstantaneousBrainEnergyDeficit_kcal", brainEnergyDeficit_kcal); - //m_data.GetDataTrack().Probe("InstantaneousNonBrainEnergyDeficit_kcal", nonbrainEnergyDeficit_kcal); - //m_data.GetDataTrack().Probe("NonBrainDeficitFraction", nonbrainEnergyDeficit_kcal / (.8*baseEnergyRequested_kcal + exerciseEnergyRequested_kcal)); - //m_data.GetDataTrack().Probe("InstantaneousMetabolicHeatGenerated_kcal", heatGenerated_kcal); - //m_data.GetDataTrack().Probe("CumulativeTAGConsumed_g", totalFatConsumed_g); - - //Gives you an idea of what non-muscle compartments don't get enough O2 flow and is better than using Info every timestep - //Can remove once we get everything tuned adequately + // Useful debugging information + // m_data.GetDataTrack().Probe("InstantaneousBrainEnergyDeficit_kcal", brainEnergyDeficit_kcal); + // m_data.GetDataTrack().Probe("InstantaneousNonBrainEnergyDeficit_kcal", nonbrainEnergyDeficit_kcal); + // m_data.GetDataTrack().Probe("NonBrainDeficitFraction", nonbrainEnergyDeficit_kcal / (.8*baseEnergyRequested_kcal + exerciseEnergyRequested_kcal)); + // m_data.GetDataTrack().Probe("InstantaneousMetabolicHeatGenerated_kcal", heatGenerated_kcal); + // m_data.GetDataTrack().Probe("CumulativeTAGConsumed_g", totalFatConsumed_g); + + // Gives you an idea of what non-muscle compartments don't get enough O2 flow and is better than using Info every timestep + // Can remove once we get everything tuned adequately /* int steps = m_data.GetSimulationTime().GetValue(TimeUnit::s)/time_s; if (steps % 5000 == 0 && m_AnaerobicTissues.length() > 1) @@ -1620,7 +1589,7 @@ void Tissue::ProteinStorageAndRelease() double aminoAcidsBaseline_mg_Per_dL = 50; // \todo make this a CDM set point like glucose? - //Patients with diabetes type 2 show increased blood AA; allow for up to 30 mg/dL elevation in severe cases \cite guyton2006medical p989 + // Patients with diabetes type 2 show increased blood AA; allow for up to 30 mg/dL elevation in severe cases \cite guyton2006medical p989 if (m_data.GetConditions().HasDiabetesType2()) { if (m_data.GetConditions().GetDiabetesType2()->HasInsulinResistanceSeverity()) { double increasedAA_mg_Per_dL = GeneralMath::LinearInterpolator(0, 1, 0, 30, m_data.GetConditions().GetDiabetesType2()->GetInsulinResistanceSeverity().GetValue()); @@ -1630,27 +1599,27 @@ void Tissue::ProteinStorageAndRelease() double hormoneFactor = Hepatic::CalculateRelativeHormoneChange(GetMuscleInsulinSetPoint().GetValue(AmountPerVolumeUnit::mmol_Per_L) * 1e9, GetMuscleGlucagonSetPoint().GetValue(MassPerVolumeUnit::mg_Per_mL) * 1e9, m_MuscleInsulin, m_MuscleGlucagon, m_data); - //Guyton says protein blood concentrations should only rise 2-3 mg/dL even after eating because of absorption into tissues + // Guyton says protein blood concentrations should only rise 2-3 mg/dL even after eating because of absorption into tissues double proteinStorageLowerRate_g_Per_s = .3; double proteinStorageUpperRate_g_Per_s = .6; - //https://www.wolframalpha.com/input/?i=y%3D.3%2B.3%2F(1%2Be%5E(-6(x-1)))+from+0%3Cy%3C.6+and+0%3Cx%3C2 + // https://www.wolframalpha.com/input/?i=y%3D.3%2B.3%2F(1%2Be%5E(-6(x-1)))+from+0%3Cy%3C.6+and+0%3Cx%3C2 double proteinStorageRate_g_Per_s = proteinStorageLowerRate_g_Per_s + GeneralMath::LogisticFunction(proteinStorageUpperRate_g_Per_s - proteinStorageLowerRate_g_Per_s, 1, 6, hormoneFactor); - //Assume protein breakdown rates are similar to storage rates, maybe a bit slower; could be adjusted + // Assume protein breakdown rates are similar to storage rates, maybe a bit slower; could be adjusted double proteinBreakdownLowerRate_g_Per_s = .1; double proteinBreakdownUpperRate_g_Per_s = .2; - //https://www.wolframalpha.com/input/?i=y%3D.1%2B.1%2F(1%2Be%5E(-15(x-.75)))+from+0%3Cy%3C.2+and+0%3Cx%3C2 + // https://www.wolframalpha.com/input/?i=y%3D.1%2B.1%2F(1%2Be%5E(-15(x-.75)))+from+0%3Cy%3C.2+and+0%3Cx%3C2 double proteinBreakdownRate_g_Per_s = proteinBreakdownLowerRate_g_Per_s + GeneralMath::LogisticFunction(proteinBreakdownUpperRate_g_Per_s - proteinBreakdownLowerRate_g_Per_s, .75, 15, -hormoneFactor); - //Patients with COPD experience high protein turnover, so up the breakdown rate by a percentage \cite engelen2000enhanced + // Patients with COPD experience high protein turnover, so up the breakdown rate by a percentage \cite engelen2000enhanced if (m_data.GetConditions().HasChronicObstructivePulmonaryDisease()) { - proteinBreakdownRate_g_Per_s *= 1.13; //13% increase + proteinBreakdownRate_g_Per_s *= 1.13; // 13% increase } - //remove excess amino acids from blood and store in muscle while there's room - //Body mobilizes protein when glucagon dominates, but we'll have protein shift toward storage unless insulin drops significantly + // remove excess amino acids from blood and store in muscle while there's room + // Body mobilizes protein when glucagon dominates, but we'll have protein shift toward storage unless insulin drops significantly if (hormoneFactor >= -.2 && GetStoredProtein(MassUnit::g) < m_maxProteinStorage_g && m_MuscleAA->GetConcentration().GetValue(MassPerVolumeUnit::mg_Per_dL) > aminoAcidsBaseline_mg_Per_dL) { if (m_MuscleAA->GetMass(MassUnit::g) < proteinStorageRate_g_Per_s * m_Dt_s) { m_ss << "Not enough amino acids in blood to store!"; @@ -1661,28 +1630,28 @@ void Tissue::ProteinStorageAndRelease() m_MuscleAA->Balance(BalanceLiquidBy::Mass); } - //If we rise above 10% of protein storage, turn off the Muscle Catabolism event - if (m_Patient->IsEventActive(CDM::enumPatientEvent::MuscleCatabolism) && GetStoredProtein(MassUnit::g) > .1 * m_maxProteinStorage_g) { - m_Patient->SetEvent(CDM::enumPatientEvent::MuscleCatabolism, false, m_data.GetSimulationTime()); + // If we rise above 10% of protein storage, turn off the Muscle Catabolism event + if (m_Patient->IsEventActive(SEPatientEventType::MuscleCatabolism) && GetStoredProtein(MassUnit::g) > .1 * m_maxProteinStorage_g) { + m_Patient->SetEvent(SEPatientEventType::MuscleCatabolism, false, m_data.GetSimulationTime()); } } - //Remove amino acids from protein stores (or muscle if that's depleted) and dump into blood - //We don't dump AA into blood if blood concentration is already at basal level + // Remove amino acids from protein stores (or muscle if that's depleted) and dump into blood + // We don't dump AA into blood if blood concentration is already at basal level else if (hormoneFactor < 0 && m_MuscleAA->GetConcentration().GetValue(MassPerVolumeUnit::mg_Per_dL) < aminoAcidsBaseline_mg_Per_dL) { - //Muscle catabolism + // Muscle catabolism if (GetStoredProtein(MassUnit::g) < proteinBreakdownRate_g_Per_s * m_Dt_s) { - if (!m_Patient->IsEventActive(CDM::enumPatientEvent::MuscleCatabolism)) { - m_Patient->SetEvent(CDM::enumPatientEvent::MuscleCatabolism, true, m_data.GetSimulationTime()); + if (!m_Patient->IsEventActive(SEPatientEventType::MuscleCatabolism)) { + m_Patient->SetEvent(SEPatientEventType::MuscleCatabolism, true, m_data.GetSimulationTime()); } if (m_Patient->GetMuscleMass(MassUnit::g) < proteinBreakdownRate_g_Per_s * m_Dt_s) { m_ss << "The patient has consumed all of their body's amino acids. They've effectively starved."; Warning(m_ss); if (!m_PatientActions->HasOverride()) { - m_Patient->SetEvent(CDM::enumPatientEvent::IrreversibleState, true, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::IrreversibleState, true, m_data.GetSimulationTime()); } else { - if (m_PatientActions->GetOverride()->GetOverrideConformance() == CDM::enumOnOff::On) { - m_Patient->SetEvent(CDM::enumPatientEvent::IrreversibleState, true, m_data.GetSimulationTime()); + if (m_PatientActions->GetOverride()->GetOverrideConformance() == SEOnOff::On) { + m_Patient->SetEvent(SEPatientEventType::IrreversibleState, true, m_data.GetSimulationTime()); } } } else { @@ -1691,7 +1660,7 @@ void Tissue::ProteinStorageAndRelease() m_MuscleAA->Balance(BalanceLiquidBy::Mass); } } - //Temporary protein storage used + // Temporary protein storage used else { m_MuscleAA->GetMass().IncrementValue(proteinBreakdownRate_g_Per_s * m_Dt_s, MassUnit::g); GetStoredProtein().IncrementValue(-proteinBreakdownRate_g_Per_s * m_Dt_s, MassUnit::g); @@ -1716,56 +1685,56 @@ void Tissue::Dehydrate() SEScalarMassPerVolume density; GeneralMath::CalculateWaterDensity(m_data.GetEnergy().GetCoreTemperature(), density); - //dehydration determine patient weight loss due to water deficiency + // dehydration determine patient weight loss due to water deficiency double fractionalWeightLoss = dehydration->GetDehydrationFraction().GetValue(); - //Set tissue value on CDM + // Set tissue value on CDM GetDehydrationFraction().SetValue(fractionalWeightLoss); double patientMass_kg = m_Patient->GetWeight(MassUnit::kg); double waterReduction_L = patientMass_kg * fractionalWeightLoss / density.GetValue(MassPerVolumeUnit::kg_Per_L); - //from fraction that is water + // from fraction that is water double waterReductionFraction = waterReduction_L / m_data.GetTissue().GetTotalBodyFluidVolume(VolumeUnit::L); - //tracking fluid losses + // tracking fluid losses double temp_mL = 0.0; double totalFluidLoss_mL = 0.0; - //loop over extracellular fluid compartments and decrement + // loop over extracellular fluid compartments and decrement for (SETissueCompartment* tissue : m_data.GetCompartments().GetTissueLeafCompartments()) { - SELiquidCompartment& extracellularFluid = m_data.GetCompartments().GetExtracellularFluid(*tissue); //get the compartment - temp_mL = extracellularFluid.GetVolume().GetValue(VolumeUnit::mL); //pull the volume + SELiquidCompartment& extracellularFluid = m_data.GetCompartments().GetExtracellularFluid(*tissue); // get the compartment + temp_mL = extracellularFluid.GetVolume().GetValue(VolumeUnit::mL); // pull the volume totalFluidLoss_mL += temp_mL * waterReductionFraction; - extracellularFluid.GetVolume().SetValue(temp_mL * (1 - waterReductionFraction), VolumeUnit::mL); //set the total volume + extracellularFluid.GetVolume().SetValue(temp_mL * (1 - waterReductionFraction), VolumeUnit::mL); // set the total volume extracellularFluid.Balance(BalanceLiquidBy::Mass); - SELiquidCompartment& intracellularFluid = m_data.GetCompartments().GetIntracellularFluid(*tissue); //get the compartment - temp_mL = intracellularFluid.GetVolume().GetValue(VolumeUnit::mL); //pull the volume + SELiquidCompartment& intracellularFluid = m_data.GetCompartments().GetIntracellularFluid(*tissue); // get the compartment + temp_mL = intracellularFluid.GetVolume().GetValue(VolumeUnit::mL); // pull the volume totalFluidLoss_mL += temp_mL * waterReductionFraction; - intracellularFluid.GetVolume().SetValue(temp_mL * (1 - waterReductionFraction), VolumeUnit::mL); //set new volume + intracellularFluid.GetVolume().SetValue(temp_mL * (1 - waterReductionFraction), VolumeUnit::mL); // set new volume intracellularFluid.Balance(BalanceLiquidBy::Mass); } double blood_mL = 0.0; for (SELiquidCompartment* cmpt : m_data.GetCompartments().GetVascularLeafCompartments()) { if (!cmpt->HasVolume()) continue; - temp_mL = cmpt->GetVolume(VolumeUnit::mL); //pull the volume + temp_mL = cmpt->GetVolume(VolumeUnit::mL); // pull the volume totalFluidLoss_mL += temp_mL * waterReductionFraction; blood_mL += temp_mL; cmpt->GetVolume().SetValue(temp_mL * (1 - waterReductionFraction), VolumeUnit::mL); cmpt->Balance(BalanceLiquidBy::Mass); } - //set patient weight + // set patient weight double bloodDensity_kg_Per_mL = m_data.GetBloodChemistry().GetBloodDensity(MassPerVolumeUnit::kg_Per_mL); double bodyWeightLost_kg = bloodDensity_kg_Per_mL * totalFluidLoss_mL; patientMass_kg -= bodyWeightLost_kg; m_Patient->GetWeight().SetValue(patientMass_kg, MassUnit::kg); - //need to set blood volume here + // need to set blood volume here m_data.GetCardiovascular().GetBloodVolume().SetValue(blood_mL, VolumeUnit::mL); } @@ -1784,24 +1753,24 @@ void Tissue::FatStorageAndRelease() double hormoneFactor = Hepatic::CalculateRelativeHormoneChange(GetFatInsulinSetPoint().GetValue(AmountPerVolumeUnit::mmol_Per_L) * 1e9, GetFatGlucagonSetPoint().GetValue(MassPerVolumeUnit::mg_Per_mL) * 1e9, m_FatInsulin, m_FatGlucagon, m_data); - //Guyton says triglycerides in chylomicrons are clear from blood in "a few hours" with chylomicrons having half-life <1 hour - //Other sources show triglycerides returning to normal in ~4 hours after peak - //These values currently allow 75g of fat to be absorbed into bloodstream in ~4 hours, with all being stored in ~6 hours - //Peak triglyceride levels are about 5x normal, maybe too high + // Guyton says triglycerides in chylomicrons are clear from blood in "a few hours" with chylomicrons having half-life <1 hour + // Other sources show triglycerides returning to normal in ~4 hours after peak + // These values currently allow 75g of fat to be absorbed into bloodstream in ~4 hours, with all being stored in ~6 hours + // Peak triglyceride levels are about 5x normal, maybe too high double fatStorageLowerRate_g_Per_s = .004; double fatStorageUpperRate_g_Per_s = .012; - //https://www.wolframalpha.com/input/?i=y%3D.4%2B.8%2F(1%2Be%5E(-6(x-.5)))+from+0%3Cy%3C1.2+and+0%3Cx%3C2 + // https://www.wolframalpha.com/input/?i=y%3D.4%2B.8%2F(1%2Be%5E(-6(x-.5)))+from+0%3Cy%3C1.2+and+0%3Cx%3C2 double fatStorageRate_g_Per_s = fatStorageLowerRate_g_Per_s + GeneralMath::LogisticFunction(fatStorageUpperRate_g_Per_s - fatStorageLowerRate_g_Per_s, 1, 6, hormoneFactor); - //Assume fat release rates are similar to glycogen for now... but this could be revisited - double fatReleaseLowerRate_g_Per_s = .002546; //maxStoredProtein_g/ 12 * 3600 - double fatReleaseUpperRate_g_Per_s = .061111; //maxStoredProtein_g/ .5 * 3600 + // Assume fat release rates are similar to glycogen for now... but this could be revisited + double fatReleaseLowerRate_g_Per_s = .002546; // maxStoredProtein_g/ 12 * 3600 + double fatReleaseUpperRate_g_Per_s = .061111; // maxStoredProtein_g/ .5 * 3600 - //https://www.wolframalpha.com/input/?i=y%3D.002546%2B.058565%2F(1%2Be%5E(-15(x-.75)))+from+0%3Cy%3C.08+and+0%3Cx%3C2 + // https://www.wolframalpha.com/input/?i=y%3D.002546%2B.058565%2F(1%2Be%5E(-15(x-.75)))+from+0%3Cy%3C.08+and+0%3Cx%3C2 double fatReleaseRate_g_Per_s = fatReleaseLowerRate_g_Per_s + GeneralMath::LogisticFunction(fatReleaseUpperRate_g_Per_s - fatReleaseLowerRate_g_Per_s, .75, 15, -hormoneFactor); - //remove excess triacylglycerol from blood and store in fat tissue + // remove excess triacylglycerol from blood and store in fat tissue if (hormoneFactor >= -.2 && m_FatTAG->GetConcentration().GetValue(MassPerVolumeUnit::mg_Per_dL) > triacylglycerolBaseline_mg_Per_dL) { if (m_FatTAG->GetMass(MassUnit::g) < fatStorageRate_g_Per_s * m_Dt_s) { m_ss << "Not enough triacylglycerol in blood to store!"; @@ -1813,18 +1782,18 @@ void Tissue::FatStorageAndRelease() } } - //remove triacylglycerol from fat stores and dump into blood - //Guyton says during starvation (i.e. glucagon dominant times) triacylglycerol blood concentration can be 5-8x normal - //We won't continue to dump TAG into blood if blood concentration is already high, but we will try to maintain base level + // remove triacylglycerol from fat stores and dump into blood + // Guyton says during starvation (i.e. glucagon dominant times) triacylglycerol blood concentration can be 5-8x normal + // We won't continue to dump TAG into blood if blood concentration is already high, but we will try to maintain base level else if ((hormoneFactor < 0 && m_FatTAG->GetConcentration().GetValue(MassPerVolumeUnit::mg_Per_dL) < triacylglycerolBaseline_mg_Per_dL * 6.5) || m_FatTAG->GetConcentration().GetValue(MassPerVolumeUnit::mg_Per_dL) < triacylglycerolBaseline_mg_Per_dL) { if (GetStoredFat(MassUnit::g) < fatReleaseRate_g_Per_s * m_Dt_s) { m_ss << "The patient has consumed all of their body's fat. They've effectively starved."; Warning(m_ss); if (!m_PatientActions->HasOverride()) { - m_Patient->SetEvent(CDM::enumPatientEvent::IrreversibleState, true, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::IrreversibleState, true, m_data.GetSimulationTime()); } else { - if (m_PatientActions->GetOverride()->GetOverrideConformance() == CDM::enumOnOff::On) { - m_Patient->SetEvent(CDM::enumPatientEvent::IrreversibleState, true, m_data.GetSimulationTime()); + if (m_PatientActions->GetOverride()->GetOverrideConformance() == SEOnOff::On) { + m_Patient->SetEvent(SEPatientEventType::IrreversibleState, true, m_data.GetSimulationTime()); } } } else { @@ -1868,9 +1837,9 @@ void Tissue::CalculateVitals() GetDehydrationFraction().SetValue(dehydrationFraction); if (dehydrationFraction > 0.03) { /// \event Patient: Patient is dehydrated when 3% of body mass is lost due to fluid reduction - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::Dehydration, true, m_data.GetSimulationTime()); /// \cite who2005dehydration + m_data.GetPatient().SetEvent(SEPatientEventType::Dehydration, true, m_data.GetSimulationTime()); /// \cite who2005dehydration } else if (dehydrationFraction < 0.01) { - m_data.GetPatient().SetEvent(CDM::enumPatientEvent::Dehydration, false, m_data.GetSimulationTime()); + m_data.GetPatient().SetEvent(SEPatientEventType::Dehydration, false, m_data.GetSimulationTime()); } ///\TODO: check for patient thirst, when plasma osmolarity increases 3 percent \cite cheuvront2014dehydration @@ -1901,18 +1870,18 @@ void Tissue::CalculateVitals() //-------------------------------------------------------------------------------------------------- void Tissue::CheckGlycogenLevels() { - //liver glycogen + // liver glycogen if (GetLiverGlycogen().GetValue(MassUnit::g) < 1) { - m_Patient->SetEvent(CDM::enumPatientEvent::LiverGlycogenDepleted, true, m_data.GetSimulationTime()); - } else if (m_Patient->IsEventActive(CDM::enumPatientEvent::LiverGlycogenDepleted) && GetLiverGlycogen().GetValue(MassUnit::g) > 10) { - m_Patient->SetEvent(CDM::enumPatientEvent::LiverGlycogenDepleted, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::LiverGlycogenDepleted, true, m_data.GetSimulationTime()); + } else if (m_Patient->IsEventActive(SEPatientEventType::LiverGlycogenDepleted) && GetLiverGlycogen().GetValue(MassUnit::g) > 10) { + m_Patient->SetEvent(SEPatientEventType::LiverGlycogenDepleted, false, m_data.GetSimulationTime()); } - //muscle glycogen + // muscle glycogen if (GetMuscleGlycogen().GetValue(MassUnit::g) < 1) { - m_Patient->SetEvent(CDM::enumPatientEvent::MuscleGlycogenDepleted, true, m_data.GetSimulationTime()); - } else if (m_Patient->IsEventActive(CDM::enumPatientEvent::MuscleGlycogenDepleted) && GetMuscleGlycogen().GetValue(MassUnit::g) > 10) { - m_Patient->SetEvent(CDM::enumPatientEvent::MuscleGlycogenDepleted, false, m_data.GetSimulationTime()); + m_Patient->SetEvent(SEPatientEventType::MuscleGlycogenDepleted, true, m_data.GetSimulationTime()); + } else if (m_Patient->IsEventActive(SEPatientEventType::MuscleGlycogenDepleted) && GetMuscleGlycogen().GetValue(MassUnit::g) > 10) { + m_Patient->SetEvent(SEPatientEventType::MuscleGlycogenDepleted, false, m_data.GetSimulationTime()); } } @@ -1975,27 +1944,27 @@ void Tissue::AlveolarPartialPressureGradientDiffusion(SEGasCompartment& pulmonar double relativeDiffusionCoefficient = sub.GetRelativeDiffusionCoefficient().GetValue(); double DiffusedVolume_mL = PressureGradient_mmHg * DiffusingCapacityO2_mL_Per_s_mmHg * sub.GetRelativeDiffusionCoefficient().GetValue() * timestep_s; - //Get special diffused volume if sub is CO + // Get special diffused volume if sub is CO if (PressureGradient_mmHg > 0 && &sub == m_CO) // Wants to come into the blood { - DiffusedVolume_mL = PressureGradient_mmHg * DiffusingCapacityO2_mL_Per_s_mmHg * sub.GetRelativeDiffusionCoefficient().GetValue() * (1 / (5.404e-05 * vascular.GetSubstanceQuantity(*m_O2)->GetPartialPressure(PressureUnit::mmHg) + 0.02885)) * timestep_s; //Modify the relative diffusion coefficient + DiffusedVolume_mL = PressureGradient_mmHg * DiffusingCapacityO2_mL_Per_s_mmHg * sub.GetRelativeDiffusionCoefficient().GetValue() * (1 / (5.404e-05 * vascular.GetSubstanceQuantity(*m_O2)->GetPartialPressure(PressureUnit::mmHg) + 0.02885)) * timestep_s; // Modify the relative diffusion coefficient } double DiffusedMass_ug = DiffusedVolume_mL * sub.GetDensity(MassPerVolumeUnit::ug_Per_mL); - //Check to make sure we're not moving more than exists + // Check to make sure we're not moving more than exists if (DiffusedVolume_mL > 0) { - //It's moving from pulmonary to vascular + // It's moving from pulmonary to vascular double pVolume_mL = pSubQ->GetVolume(VolumeUnit::mL); if (DiffusedVolume_mL > pVolume_mL) { - //Move all we can + // Move all we can DiffusedVolume_mL = pVolume_mL; DiffusedMass_ug = DiffusedVolume_mL * sub.GetDensity(MassPerVolumeUnit::ug_Per_mL); } } else { - //It's moving from vascular to pulmonary + // It's moving from vascular to pulmonary double vMass_ug = vSubQ->GetMass(MassUnit::ug); if (-DiffusedMass_ug > vMass_ug) { - //Move all we can + // Move all we can DiffusedMass_ug = -vMass_ug; DiffusedVolume_mL = DiffusedMass_ug / sub.GetDensity(MassPerVolumeUnit::ug_Per_mL); } @@ -2036,7 +2005,7 @@ void Tissue::CalculateTissueFluidFluxes() double mOsmIntra = 0.0; double mOsmExtra = 0.0; double hydraulicConductivity_mL_Per_min_mM = 0.0; - double proteinIntra_mM = 112.0; //Need this to get osmotically stable cell with the desired ion concentrations + double proteinIntra_mM = 112.0; // Need this to get osmotically stable cell with the desired ion concentrations double intracellularVolumeBaseline_mL = 0.0; double intracellularVolume_mL = 0.0; @@ -2049,7 +2018,7 @@ void Tissue::CalculateTissueFluidFluxes() intracellularVolumeBaseline_mL = osmoticFlow->GetTargetNode().GetVolumeBaseline(VolumeUnit::mL); intracellularVolume_mL = intracellular.GetVolume(VolumeUnit::mL); - hydraulicConductivity_mL_Per_min_mM = 0.3 * tissue->GetTotalMass(MassUnit::kg); //Carlson has units of mL/min-kg-mmol --> multiply by tissue mass up front + hydraulicConductivity_mL_Per_min_mM = 0.3 * tissue->GetTotalMass(MassUnit::kg); // Carlson has units of mL/min-kg-mmol --> multiply by tissue mass up front naIntra_mM = intracellular.GetSubstanceQuantity(*m_Sodium)->GetMolarity(AmountPerVolumeUnit::mmol_Per_L); naExtra_mM = extracellular.GetSubstanceQuantity(*m_Sodium)->GetMolarity(AmountPerVolumeUnit::mmol_Per_L); @@ -2074,7 +2043,7 @@ void Tissue::CalculateTissueFluidFluxes() } } - //Test lung injury + // Test lung injury /*int steps = m_data.GetSimulationTime().GetValue(TimeUnit::s) / m_data.GetTimeStep().GetValue(TimeUnit::s); if (steps > 15000 && steps < 90000) { SETissueCompartment* lung = m_data.GetCompartments().GetTissueCompartment(BGE::TissueCompartment::LeftLung); @@ -2182,25 +2151,25 @@ void Tissue::OverrideControlLoop() { auto override = m_data.GetActions().GetPatientActions().GetOverride(); - constexpr double maxExtravascularFluidVolumeOverride = 1000.0; //L - constexpr double minExtravascularFluidVolumeOverride = 0.0; //L - constexpr double maxIntracellularFluidVolumeOverride = 1000.0; //L - constexpr double minIntracellularFluidVolumeOverride = 0.0; //L - constexpr double maxLiverGlycogenOverride = 1000.0; //g - constexpr double minLiverGlycogenOverride = 0.0; //g - constexpr double maxMuscleGlycogenOverride = 2000.0; //g - constexpr double minMuscleGlycogenOverride = 0.0; //g - constexpr double maxStoredProteinOverride = 5000.0; //g - constexpr double minStoredProteinOverride = 0.0; //g - constexpr double maxStoredFatOverride = 5000.0; //g - constexpr double minStoredFatOverride = 0.0; //g // Zero will cause irreversible state - - double currentExtravascularFluidVolumeOverride = 0.0; //value gets changed in next check - double currentIntracellularFluidVolumeOverride = 0.0; //value gets changed in next check - double currentLiverGlycogenOverride = 0.0; //value gets changed in next check - double currentMuscleGlycogenOverride = 0.0; //value gets changed in next check - double currentStoredProteinOverride = 0.0; //value gets changed in next check - double currentStoredFatOverride = 0.0; //value gets changed in next check + constexpr double maxExtravascularFluidVolumeOverride = 1000.0; // L + constexpr double minExtravascularFluidVolumeOverride = 0.0; // L + constexpr double maxIntracellularFluidVolumeOverride = 1000.0; // L + constexpr double minIntracellularFluidVolumeOverride = 0.0; // L + constexpr double maxLiverGlycogenOverride = 1000.0; // g + constexpr double minLiverGlycogenOverride = 0.0; // g + constexpr double maxMuscleGlycogenOverride = 2000.0; // g + constexpr double minMuscleGlycogenOverride = 0.0; // g + constexpr double maxStoredProteinOverride = 5000.0; // g + constexpr double minStoredProteinOverride = 0.0; // g + constexpr double maxStoredFatOverride = 5000.0; // g + constexpr double minStoredFatOverride = 0.0; // g // Zero will cause irreversible state + + double currentExtravascularFluidVolumeOverride = 0.0; // value gets changed in next check + double currentIntracellularFluidVolumeOverride = 0.0; // value gets changed in next check + double currentLiverGlycogenOverride = 0.0; // value gets changed in next check + double currentMuscleGlycogenOverride = 0.0; // value gets changed in next check + double currentStoredProteinOverride = 0.0; // value gets changed in next check + double currentStoredFatOverride = 0.0; // value gets changed in next check if (override->HasExtravascularFluidVolumeOverride()) { currentExtravascularFluidVolumeOverride = override->GetExtravascularFluidVolumeOverride(VolumeUnit::L); @@ -2221,35 +2190,35 @@ void Tissue::OverrideControlLoop() currentStoredFatOverride = override->GetStoredFatOverride(MassUnit::g); } - if ((currentExtravascularFluidVolumeOverride < minExtravascularFluidVolumeOverride || currentExtravascularFluidVolumeOverride > maxExtravascularFluidVolumeOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentExtravascularFluidVolumeOverride < minExtravascularFluidVolumeOverride || currentExtravascularFluidVolumeOverride > maxExtravascularFluidVolumeOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Extravascular Fluid Volume Override (Tissue) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentIntracellularFluidVolumeOverride < minIntracellularFluidVolumeOverride || currentIntracellularFluidVolumeOverride > maxIntracellularFluidVolumeOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentIntracellularFluidVolumeOverride < minIntracellularFluidVolumeOverride || currentIntracellularFluidVolumeOverride > maxIntracellularFluidVolumeOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Intracellular Fluid Volume Override (Tissue) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentLiverGlycogenOverride < minLiverGlycogenOverride || currentLiverGlycogenOverride > maxLiverGlycogenOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentLiverGlycogenOverride < minLiverGlycogenOverride || currentLiverGlycogenOverride > maxLiverGlycogenOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Liver Glycogen Override (Tissue) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentMuscleGlycogenOverride < minMuscleGlycogenOverride || currentMuscleGlycogenOverride > maxMuscleGlycogenOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentMuscleGlycogenOverride < minMuscleGlycogenOverride || currentMuscleGlycogenOverride > maxMuscleGlycogenOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Muscle Glycogen Override (Tissue) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentStoredProteinOverride < minStoredProteinOverride || currentStoredProteinOverride > maxStoredProteinOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentStoredProteinOverride < minStoredProteinOverride || currentStoredProteinOverride > maxStoredProteinOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Stored Protein Override (Tissue) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } - if ((currentStoredFatOverride < minStoredFatOverride || currentStoredFatOverride > maxStoredFatOverride) && (override->GetOverrideConformance() == CDM::enumOnOff::On)) { + if ((currentStoredFatOverride < minStoredFatOverride || currentStoredFatOverride > maxStoredFatOverride) && (override->GetOverrideConformance() == SEOnOff::On)) { m_ss << "Stored Fat Override (Tissue) set outside of bounds of validated parameter override. BioGears is no longer conformant."; Info(m_ss); - override->SetOverrideConformance(CDM::enumOnOff::Off); + override->SetOverrideConformance(SEOnOff::Off); } return; } diff --git a/projects/biogears/libBiogears/src/io/BioGearsDataModel.h b/projects/biogears/libBiogears/src/io/BioGearsDataModel.h index a6d14a427..c07ab9938 100644 --- a/projects/biogears/libBiogears/src/io/BioGearsDataModel.h +++ b/projects/biogears/libBiogears/src/io/BioGearsDataModel.h @@ -18,15 +18,15 @@ specific language governing permissions and limitations under the License. #include -#define CDM_BIOGEARS_DATA_UNMARSHAL_HELPER(xsd, func) \ +#define CDM_BIOGEARS_DATA_PTR_MARSHALL_HELPER(xsd, func) \ if (m_##func) { \ xsd.func(std::make_unique::type>()); \ - io::BiogearsDataModel::UnMarshall(*m_##func, xsd.func()); \ + io::BiogearsDataModel::Marshall(*m_##func, xsd.func()); \ } -#define CDM_OPTIONAL_BIOGEARS_DATA_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_OPTIONAL_BIOGEARS_DATA_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ - io::BiogearsDataModel::UnMarshall(*in.m_##func, out.func()); \ + io::BiogearsDataModel::Marshall(*in.m_##func, out.func()); \ } namespace biogears { @@ -37,27 +37,27 @@ namespace io { public: // template option template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); }; //---------------------------------------------------------------------------------- template - void BiogearsDataModel::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + void BiogearsDataModel::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) { if (!option_in.present()) { - out.Clear(); + out.Invalidate(); } else { - Marshall(option_in.get(), out); + UnMarshall(option_in.get(), out); } } //---------------------------------------------------------------------------------- template - void BiogearsDataModel::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void BiogearsDataModel::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); + Marshall(in, *item); option_out.set(*item); } } // Namespace IO diff --git a/projects/biogears/libBiogears/src/io/biogears/BioGears.cpp b/projects/biogears/libBiogears/src/io/biogears/BioGears.cpp index 24dd4a081..4831519dd 100644 --- a/projects/biogears/libBiogears/src/io/biogears/BioGears.cpp +++ b/projects/biogears/libBiogears/src/io/biogears/BioGears.cpp @@ -1,27 +1,83 @@ #include "BioGears.h" +#include "BioGearsEnvironment.h" +#include "BioGearsEquipment.h" +#include "BioGearsPhysiology.h" + +#include +#include + +#include #include #include #include #include +#include "io/biogears/BioGears.h" +#include "io/biogears/BioGearsConfiguration.h" +#include "io/biogears/BioGearsEnvironment.h" +#include "io/biogears/BioGearsEquipment.h" +#include "io/biogears/BioGearsPhysiology.h" +#include "io/cdm/Actions.h" +#include "io/cdm/Circuit.h" +#include "io/cdm/Compartment.h" +#include "io/cdm/Conditions.h" +#include "io/cdm/DataRequests.h" +#include "io/cdm/Patient.h" +#include "io/cdm/Property.h" +#include "io/cdm/Substance.h" + namespace biogears { namespace io { + std::unique_ptr BioGears::factory(CDM::SystemData const* systemData, biogears::BioGears& bgData) + { + try { + return BiogearsEnvironment::factory(systemData, bgData); + } catch (CommonDataModelException ex) { + try { + return BiogearsEquipment::factory(systemData, bgData); + } catch (CommonDataModelException ex) { + try { + return BiogearsPhysiology::factory(systemData, bgData); + } catch (CommonDataModelException ex) { + throw CommonDataModelException("BioGears::factory unsupported SystemData provided"); + } + } + } + } + std::unique_ptr BioGears::factory(const SESystem* data) + { + try { + return BiogearsEnvironment::factory(data); + } catch (CommonDataModelException ex) { + try { + return BiogearsEquipment::factory(data); + } catch (CommonDataModelException ex) { + try { + return BiogearsPhysiology::factory(data); + } catch (CommonDataModelException ex) { + throw CommonDataModelException("BioGears::factory unsupported SESystem provided"); + } + } + } + } // BioGears - void BioGears::Marshall(const CDM::BioGearsStateData& in, BioGearsEngine& out, const SEScalarTime* simTime) + void BioGears::UnMarshall(const CDM::BioGearsStateData& in, BioGearsEngine& out, const SEScalarTime* simTime) { auto requests = out.GetEngineTrack()->GetDataRequestManager().GetDataRequests(); auto resultsFile = out.GetEngineTrack()->GetDataRequestManager().GetResultsFilename(); std::vector> dataVector; for (auto& dr : requests) { - dataVector.emplace_back(dr->Unload()); + auto drData = std::make_unique(); + io::DataRequests::Marshall(*dr, *drData); + dataVector.emplace_back(std::move(drData)); } out.BioGears::SetUp(); out.m_EngineTrack = PhysiologyEngineTrack(out); out.m_DataTrack = &out.m_EngineTrack.GetDataTrack(); for (auto& data : dataVector) { - out.m_EngineTrack.GetDataRequestManager().CreateFromBind(*data, *out.m_Substances); + out.m_EngineTrack.GetDataRequestManager().CreateDataRequest(io::DataRequests::factory(data.get(), *out.m_Substances)); } out.m_EngineTrack.GetDataRequestManager().SetResultsFilename(resultsFile); out.m_ss.str(""); @@ -29,8 +85,8 @@ namespace io { out.m_State = EngineState::NotReady; - // if (in.DataRequests().present()) { - // out.m_EngineTrack.GetDataRequestManager().Clear(); + // if (in.DataRequests).present()) { + // out.m_EngineTrack.GetDataRequestManager().Invalidate(); // out.m_EngineTrack.GetDataRequestManager().Load(in.DataRequests().get(), *out.m_Substances); // out.m_EngineTrack.ForceConnection(); // I don't want to rest the file because I would loose all my data // } @@ -40,33 +96,40 @@ namespace io { out.m_SimulationTime->Set(*simTime); } else { if (in.SimulationTime().present()) { - out.m_CurrentTime->Load(in.SimulationTime().get()); - out.m_SimulationTime->Load(in.SimulationTime().get()); + io::Property::UnMarshall(in.SimulationTime(), *(out.m_CurrentTime)); + io::Property::UnMarshall(in.SimulationTime(), *(out.m_SimulationTime)); } else { out.m_CurrentTime->SetValue(0, TimeUnit::s); out.m_SimulationTime->SetValue(0, TimeUnit::s); } } - out.m_AirwayMode = in.AirwayMode(); - out.m_Intubation = in.Intubation(); + + io::BioGears::UnMarshall(in.AirwayMode(), out.m_AirwayMode); + io::Property::UnMarshall(in.Intubation(), out.m_Intubation); /// Patient // if (!in.Patient().present()) { throw biogears::CommonDataModelException("BioGearsState must have a patient"); - } else if (!out.m_Patient->Load(in.Patient().get())) { - throw biogears::CommonDataModelException("Error loading patient data"); + } else { + try { + io::Patient::UnMarshall(in.Patient().get(), *out.m_Patient); + } catch (CommonDataModelException ex) { + throw biogears::CommonDataModelException(std::string("Error loading patient data: ") + ex.what()); + } } // Conditions // - out.m_Conditions->Clear(); + out.m_Conditions->Invalidate(); for (const CDM::ConditionData& cData : in.Condition()) { - if (!out.m_Conditions->ProcessCondition(cData, out)) { + auto conditon = io::Conditions::factory(&cData, out.GetSubstanceManager()); + if (!out.m_Conditions->ProcessCondition(*conditon, out)) { throw biogears::CommonDataModelException("Unable to load condition"); } } // Actions // - out.m_Actions->Clear(); - for (const CDM::ActionData& cData : in.ActiveAction()) { - if (!out.m_Actions->ProcessAction(cData, out)) { + out.m_Actions->Invalidate(); + for (const CDM::ActionData& aData : in.ActiveAction()) { + auto action = io::Actions::factory(&aData, out.GetSubstanceManager()); + if (!out.m_Actions->ProcessAction(*action, out)) { throw biogears::CommonDataModelException("Unable to load action"); } } @@ -77,8 +140,10 @@ namespace io { sub = new SESubstance(out.GetLogger()); out.m_Substances->AddSubstance(*sub); } - if (!sub->Load(subData)) { - throw biogears::CommonDataModelException("Unable to load substance " + subData.Name()); + try { + io::Substance::UnMarshall(subData, *sub); + } catch (CommonDataModelException ex) { + throw biogears::CommonDataModelException("Unable to load substance " + subData.Name() + "\n\tReason: " + ex.what()); } out.m_Substances->AddActiveSubstance(*sub); } @@ -89,10 +154,13 @@ namespace io { cmpd = new SESubstanceCompound(out.GetLogger()); out.m_Substances->AddCompound(*cmpd); } - if (!cmpd->Load(cmpdData, *out.m_Substances)) { - throw biogears::CommonDataModelException("Unable to load compound " + cmpdData.Name()); + try { + io::Substance::UnMarshall(cmpdData, *out.m_Substances, *cmpd); + } catch (CommonDataModelException ex) { + throw biogears::CommonDataModelException("Unable to load compound " + cmpdData.Name() + "\n\tReason: " + ex.what()); } } + // Circuit Manager // if (!in.CircuitManager().present()) { throw biogears::CommonDataModelException("BioGearsState must have a circuit manager"); @@ -100,8 +168,12 @@ namespace io { const CDM::CircuitManagerData* cmptMgrData = dynamic_cast(&in.CircuitManager().get()); if (cmptMgrData == nullptr) { throw biogears::CommonDataModelException("BioGearsState must have a BioGears circuit manager"); - } else if (!out.m_Circuits->Load(*cmptMgrData)) { - throw biogears::CommonDataModelException("Error loading circuit manager data"); + } else { + try { + UnMarshall(*cmptMgrData, *out.m_Circuits); + } catch (biogears::CommonDataModelException ex) { + throw biogears::CommonDataModelException("BiogearsState Error loading circuit manager data"); + } } } // Compartment Manager // @@ -111,8 +183,12 @@ namespace io { const CDM::CompartmentManagerData* cmptMgrData = dynamic_cast(&in.CompartmentManager().get()); if (cmptMgrData == nullptr) { throw biogears::CommonDataModelException("BioGearsState must have a BioGears compartment manager"); - } else if (!out.m_Compartments->Load(*cmptMgrData, out.m_Circuits.get())) { - throw biogears::CommonDataModelException("Error loading compartment manager data"); + } else { + try { + UnMarshall(*cmptMgrData, *out.m_Compartments, out.m_Circuits.get()); + } catch (biogears::CommonDataModelException ex) { + throw biogears::CommonDataModelException("BiogearsState Error loading compartment manager data"); + } } } // Configuration // @@ -122,69 +198,510 @@ namespace io { const CDM::BioGearsConfigurationData* confData = dynamic_cast(&in.Configuration().get()); if (confData == nullptr) { throw biogears::CommonDataModelException("BioGearsState must have a BioGears configuration"); - } else if (!out.m_Config->Load(*confData)) { - throw biogears::CommonDataModelException("Error loading configuration data"); + } else { + try { + BiogearsEngineConfiguration::UnMarshall(*confData, *out.m_Configuration); + } catch (biogears::CommonDataModelException ex) { + throw biogears::CommonDataModelException("BiogearsState Error loading configuration data"); + } } } - } - void BioGears::UnMarshall(const BioGearsEngine& in, CDM::BioGearsStateData& out) - { + // Now, Let's see if there is anything to merge into our base configuration + // At this point I don't think we should be doing this... but maybe you want to... + // m_Logger->Info("Merging OnDisk Configuration"); + // BioGearsConfiguration cFile(*m_Substances); + // cFile.Load("BioGearsConfiguration.xml"); + // m_Config->Merge(cFile); + ///////////// + // Systems // + ///////////// + // Physiology + + size_t PresentSystems = 0x0; + const CDM::BioGearsInhalerData* nhlData = nullptr; + for (const CDM::SystemData& sysData : in.System()) { + if (auto bcData = dynamic_cast(&sysData)) { + try { + io::BiogearsPhysiology::UnMarshall(*bcData, out.GetSubstances(), *out.m_BloodChemistrySystem); + PresentSystems |= BioGearsSystem::BLOOD_CHEMISTRY_SYSTEM; + continue; + } catch (CommonDataModelException ex) { + out.m_ss << "Error loading Blood Chemistry data." << ex.what() << std::endl; + } + } + if (auto cvData = dynamic_cast(&sysData)) { + try { + io::BiogearsPhysiology::UnMarshall(*cvData, out.GetSubstances(), *out.m_CardiovascularSystem); + PresentSystems |= BioGearsSystem::CARDIOVASCULAR_SYSTEM; + continue; + } catch (CommonDataModelException ex) { + out.m_ss << "Error loading Cardiovascular data." << ex.what() << std::endl; + } + } + if (auto dData = dynamic_cast(&sysData)) { + try { + io::BiogearsPhysiology::UnMarshall(*dData, out.GetSubstances(), *out.m_DrugSystem); + PresentSystems |= BioGearsSystem::DRUG_SYSTEM; + continue; + } catch (CommonDataModelException ex) { + out.m_ss << "Error loading Drugs data." << ex.what() << std::endl; + } + } + if (auto ndoData = dynamic_cast(&sysData)) { + try { + io::BiogearsPhysiology::UnMarshall(*ndoData, out.GetSubstances(), *out.m_EndocrineSystem); + PresentSystems |= BioGearsSystem::ENDOCRINE_SYSTEM; + continue; + } catch (CommonDataModelException ex) { + out.m_ss << "Error loading Endocrine data." << ex.what() << std::endl; + } + } + if (auto nrgData = dynamic_cast(&sysData)) { + try { + io::BiogearsPhysiology::UnMarshall(*nrgData, out.GetSubstances(), *out.m_EnergySystem); + PresentSystems |= BioGearsSystem::ENERGY_SYSTEM; + continue; + } catch (CommonDataModelException ex) { + out.m_ss << "Error loading Energy data." << ex.what() << std::endl; + } + } + if (auto gasData = dynamic_cast(&sysData)) { + try { + io::BiogearsPhysiology::UnMarshall(*gasData, out.GetSubstances(), *out.m_GastrointestinalSystem); + PresentSystems |= BioGearsSystem::GASTROINTESTINAL_SYSTEM; + continue; + } catch (CommonDataModelException ex) { + out.m_ss << "Error loading Gastrointestinal data." << ex.what() << std::endl; + } + } + if (auto hepData = dynamic_cast(&sysData)) { + try { + io::BiogearsPhysiology::UnMarshall(*hepData, out.GetSubstances(), *out.m_HepaticSystem); + PresentSystems |= BioGearsSystem::HEPTIC_SYSTEM; + continue; + } catch (CommonDataModelException ex) { + out.m_ss << "Error loading Hepatic data." << ex.what() << std::endl; + } + } + if (auto nrvData = dynamic_cast(&sysData)) { + try { + io::BiogearsPhysiology::UnMarshall(*nrvData, out.GetSubstances(), *out.m_NervousSystem); + PresentSystems |= BioGearsSystem::NERVOUS_SYSTEM; + continue; + } catch (CommonDataModelException ex) { + out.m_ss << "Error loading Nervous data." << ex.what() << std::endl; + } + } + if (auto rnlData = dynamic_cast(&sysData)) { + try { + io::BiogearsPhysiology::UnMarshall(*rnlData, out.GetSubstances(), *out.m_RenalSystem); + PresentSystems |= BioGearsSystem::RENAL_SYSTEM; + continue; + } catch (CommonDataModelException ex) { + out.m_ss << "Error loading Renal data." << ex.what() << std::endl; + } + } + if (auto rspData = dynamic_cast(&sysData)) { + try { + io::BiogearsPhysiology::UnMarshall(*rspData, out.GetSubstances(), *out.m_RespiratorySystem); + PresentSystems |= BioGearsSystem::RESPIRATORY_SYSTEM; + continue; + } catch (CommonDataModelException ex) { + out.m_ss << "Error loading Respiratory data." << ex.what() << std::endl; + } + } + if (auto tsuData = dynamic_cast(&sysData)) { + try { + io::BiogearsPhysiology::UnMarshall(*tsuData, out.GetSubstances(), *out.m_TissueSystem); + PresentSystems |= BioGearsSystem::TISSUE_SYSTEM; + continue; + } catch (CommonDataModelException ex) { + out.m_ss << "Error loading Tissue data." << ex.what() << std::endl; + } + } + if (auto envData = dynamic_cast(&sysData)) { + try { + io::BiogearsEnvironment::UnMarshall(*envData, *out.m_Environment); + PresentSystems |= BioGearsSystem::ENVIRONMENT_SYSTEM; + continue; + } catch (CommonDataModelException ex) { + out.m_ss << "Error loading Environment data." << ex.what() << std::endl; + } + } + if (auto amData = dynamic_cast(&sysData)) { + try { + io::BiogearsEquipment::UnMarshall(*amData, *out.m_AnesthesiaMachine); + PresentSystems |= BioGearsSystem::ANESTHESIA_NACHINE_EQUIPMENT; + continue; + } catch (CommonDataModelException ex) { + out.m_ss << "Error loading Anesthesia Machine data." << ex.what() << std::endl; + } + } + if (auto ecgData = dynamic_cast(&sysData)) { + try { + io::BiogearsEquipment::UnMarshall(*ecgData, *out.m_ECG); + PresentSystems |= BioGearsSystem::ELECTRO_CARDIO_GRAM_EQUIPMENT; + continue; + } catch (CommonDataModelException ex) { + out.m_ss << "Error loading Electrocardiogram data." << ex.what() << std::endl; + } + } + if (auto nhlData = dynamic_cast(&sysData)) { + try { + io::BiogearsEquipment::UnMarshall(*nhlData, *out.m_Inhaler); + PresentSystems |= BioGearsSystem::INHALER_EQUIPMENT; + continue; + } catch (CommonDataModelException ex) { + out.m_ss << "Error loading Energy data." << ex.what() << std::endl; + } + } + } + // Make sure we had all systems in the state + if (PresentSystems != BioGearsSystem::ALL_SYSTEMS_AND_EQUIPMENT_PRESENT) { + out.m_ss << "StateData is missing SystemData for "; + + if (0 == (BioGearsSystem::BLOOD_CHEMISTRY_SYSTEM & PresentSystems)) { + out.m_ss << "Blood Chemistry, " << std::endl; + } + if (0 == (BioGearsSystem::CARDIOVASCULAR_SYSTEM & PresentSystems)) { + out.m_ss << "Cardiovascula," << std::endl; + } + if (0 == (BioGearsSystem::DRUG_SYSTEM & PresentSystems)) { + out.m_ss << "Drug, " << std::endl; + } + if (0 == (BioGearsSystem::ENDOCRINE_SYSTEM & PresentSystems)) { + out.m_ss << "Endocrine, " << std::endl; + } + if (0 == (BioGearsSystem::ENERGY_SYSTEM & PresentSystems)) { + out.m_ss << "Energy, " << std::endl; + } + if (0 == (BioGearsSystem::GASTROINTESTINAL_SYSTEM & PresentSystems)) { + out.m_ss << "Gastrointestinal, " << std::endl; + } + if (0 == (BioGearsSystem::HEPTIC_SYSTEM & PresentSystems)) { + out.m_ss << "Hepatic, " << std::endl; + } + if (0 == (BioGearsSystem::NERVOUS_SYSTEM & PresentSystems)) { + out.m_ss << "Nervous, " << std::endl; + } + if (0 == (BioGearsSystem::RENAL_SYSTEM & PresentSystems)) { + out.m_ss << "Renal, " << std::endl; + } + if (0 == (BioGearsSystem::RESPIRATORY_SYSTEM & PresentSystems)) { + out.m_ss << "Respiratory, " << std::endl; + } + if (0 == (BioGearsSystem::TISSUE_SYSTEM & PresentSystems)) { + out.m_ss << "Tissue, " << std::endl; + } + if (0 == (BioGearsSystem::ENVIRONMENT_SYSTEM & PresentSystems)) { + out.m_ss << "Environment, " << std::endl; + } + if (0 == (BioGearsSystem::ANESTHESIA_NACHINE_EQUIPMENT & PresentSystems)) { + out.m_ss << "Anesthesia Machine, " << std::endl; + } + if (0 == (BioGearsSystem::ELECTRO_CARDIO_GRAM_EQUIPMENT & PresentSystems)) { + out.m_ss << "ECG, " << std::endl; + } + if (0 == (BioGearsSystem::INHALER_EQUIPMENT & PresentSystems)) { + out.m_ss << "Inhaler, " << std::endl; + } + out.m_ss << "}."; + + throw CommonDataModelException(out.m_ss.str()); + } + // Make sure links are correct with our modes + out.m_Compartments->UpdateAirwayGraph(); + out.m_Compartments->GetActiveRespiratoryGraph(); + out.m_Compartments->GetActiveAerosolGraph(); + + // Good to go, save it off and carry on! + out.m_State = EngineState::Active; + if (in.Patient().present()) { + out.m_Logger->Info("Biogears has sucesfully loaded " + in.Patient()->Name() + "."); + } else { + out.m_Logger->Info("Biogears has sucesfully loaded the given statefile"); + } + } + void BioGears::Marshall(const BioGearsEngine& in, CDM::BioGearsStateData& out) + { out.contentVersion(biogears::branded_version_string()); - out.SimulationTime(std::unique_ptr(in.m_SimulationTime->Unload())); - + io::Property::Marshall(*in.m_SimulationTime, out.SimulationTime()); + if (in.m_EngineTrack.GetDataRequestManager().HasDataRequests()) { - out.DataRequests(std::unique_ptr(in.m_EngineTrack.GetDataRequestManager().Unload())); + auto dataRequestsData = std::make_unique(); + io::DataRequests::Marshall(in.m_EngineTrack.GetDataRequestManager(), *dataRequestsData); + out.DataRequests(std::move(dataRequestsData)); } - out.AirwayMode(in.m_AirwayMode); - out.Intubation(in.m_Intubation); + out.AirwayMode(std::make_unique::type>()); + io::BioGears::Marshall(in.m_AirwayMode, out.AirwayMode()); + + out.Intubation(std::make_unique::type>()); + io::Property::Marshall(in.m_Intubation, out.Intubation()); + // Patient - out.Patient(std::unique_ptr(in.m_Patient->Unload())); + CDM_OPTIONAL_PATIENT_PTR_MARSHALL_HELPER(in, out, Patient); // Conditions - std::vector conditions; - in.m_Conditions->Unload(conditions); - for (CDM::ConditionData* cData : conditions) { - out.Condition().push_back(std::unique_ptr(cData)); + auto conditions = std::vector>(); + Conditions::Marshall(*in.m_Conditions, conditions); + for (auto& cData : conditions) { + out.Condition().push_back(std::move(cData)); } // Actions - std::vector activeActions; - in.m_Actions->Unload(activeActions); - for (CDM::ActionData* aData : activeActions) { - out.ActiveAction().push_back(std::unique_ptr(aData)); + std::vector> activeActions; + io::Actions::Marshall(*in.m_Actions, activeActions); + for (auto& aData : activeActions) { + out.ActiveAction().push_back(std::move(aData)); } + // // Active Substances/Compounds for (SESubstance* s : in.m_Substances->GetActiveSubstances()) { - out.ActiveSubstance().push_back(std::unique_ptr(s->Unload())); + auto subData = std::make_unique(); + io::Substance::Marshall(*s, *subData); + out.ActiveSubstance().push_back(std::move(subData)); } + for (SESubstanceCompound* c : in.m_Substances->GetActiveCompounds()) { - out.ActiveSubstanceCompound().push_back(std::unique_ptr(c->Unload())); + auto subData = std::make_unique(); + io::Substance::Marshall(*c, *subData); + out.ActiveSubstanceCompound().push_back(std::move(subData)); } + // Systems - out.System().push_back(std::unique_ptr(in.m_BloodChemistrySystem->Unload())); - out.System().push_back(std::unique_ptr(in.m_CardiovascularSystem->Unload())); - out.System().push_back(std::unique_ptr(in.m_DrugSystem->Unload())); - out.System().push_back(std::unique_ptr(in.m_EndocrineSystem->Unload())); - out.System().push_back(std::unique_ptr(in.m_EnergySystem->Unload())); - out.System().push_back(std::unique_ptr(in.m_GastrointestinalSystem->Unload())); - out.System().push_back(std::unique_ptr(in.m_HepaticSystem->Unload())); - out.System().push_back(std::unique_ptr(in.m_NervousSystem->Unload())); - out.System().push_back(std::unique_ptr(in.m_RenalSystem->Unload())); - out.System().push_back(std::unique_ptr(in.m_RespiratorySystem->Unload())); - out.System().push_back(std::unique_ptr(in.m_TissueSystem->Unload())); - out.System().push_back(std::unique_ptr(in.m_Environment->Unload())); - out.System().push_back(std::unique_ptr(in.m_AnesthesiaMachine->Unload())); - out.System().push_back(std::unique_ptr(in.m_ECG->Unload())); - out.System().push_back(std::unique_ptr(in.m_Inhaler->Unload())); + out.System().push_back(io::BiogearsPhysiology::factory(in.m_BloodChemistrySystem.get())); + out.System().push_back(io::BiogearsPhysiology::factory(in.m_CardiovascularSystem.get())); + out.System().push_back(io::BiogearsPhysiology::factory(in.m_DrugSystem.get())); + out.System().push_back(io::BiogearsPhysiology::factory(in.m_EndocrineSystem.get())); + out.System().push_back(io::BiogearsPhysiology::factory(in.m_EnergySystem.get())); + out.System().push_back(io::BiogearsPhysiology::factory(in.m_GastrointestinalSystem.get())); + out.System().push_back(io::BiogearsPhysiology::factory(in.m_HepaticSystem.get())); + out.System().push_back(io::BiogearsPhysiology::factory(in.m_NervousSystem.get())); + out.System().push_back(io::BiogearsPhysiology::factory(in.m_RenalSystem.get())); + out.System().push_back(io::BiogearsPhysiology::factory(in.m_RespiratorySystem.get())); + out.System().push_back(io::BiogearsPhysiology::factory(in.m_TissueSystem.get())); + out.System().push_back(io::BiogearsEnvironment::factory(in.m_Environment.get())); + out.System().push_back(io::BiogearsEquipment::factory(in.m_AnesthesiaMachine.get())); + out.System().push_back(io::BiogearsEquipment::factory(in.m_ECG.get())); + out.System().push_back(io::BiogearsEquipment::factory(in.m_Inhaler.get())); // Compartments - out.CompartmentManager(std::unique_ptr(in.m_Compartments->Unload())); + // out.CompartmentManager(std::unique_ptr(in.m_Compartments->Unload())); + auto compartments = std::make_unique(); + io::Compartment::Marshall(*static_cast(in.m_Compartments.get()), *compartments); + out.CompartmentManager(std::move(compartments)); // Configuration - out.Configuration(std::unique_ptr(in.m_Config->Unload())); - // Circuitsk - out.CircuitManager(std::unique_ptr(in.m_Circuits->Unload())); + if (in.m_Configuration) { + auto biogearsConfigurationData = std::make_unique(); + io::BiogearsEngineConfiguration::Marshall(*in.m_Configuration, *biogearsConfigurationData); + out.Configuration(std::move(biogearsConfigurationData)); + } + + // Circuits + auto circuits = std::make_unique(); + io::Circuit::Marshall(*static_cast(in.m_Circuits.get()), *circuits); + out.CircuitManager(std::move(circuits)); + } + //---------------------------------------------------------------------------------------- + // BioGearsCompartments + void BioGears::UnMarshall(const CDM::CompartmentManagerData& in, BioGearsCompartments& out, SECircuitManager* circuits) + { + namespace BGE = biogears::physiology; + + io::Compartment::UnMarshall(in, out, circuits); + + out.m_CombinedCardiovascularGraph = out.GetLiquidGraph(BGE::Graph::ActiveCardiovascular); + if (out.m_CombinedCardiovascularGraph == nullptr) { + + throw CommonDataModelException("BioGearsCompartments: Could not find required Graph " + std::string(BGE::Graph::ActiveCardiovascular)); + } + out.m_CardiovascularGraph = out.GetLiquidGraph(BGE::Graph::Cardiovascular); + if (out.m_CardiovascularGraph == nullptr) { + throw CommonDataModelException("BioGearsCompartments: Could not find required Graph " + std::string(BGE::Graph::Cardiovascular)); + } + out.m_CerebralGraph = out.GetLiquidGraph(BGE::Graph::Cerebral); + if (out.m_CerebralGraph == nullptr) { + throw CommonDataModelException("BioGearsCompartments: Could not find required Graph " + std::string(BGE::Graph::Cerebral)); + } + out.m_RenalGraph = out.GetLiquidGraph(BGE::Graph::Renal); + if (out.m_RenalGraph == nullptr) { + throw CommonDataModelException("BioGearsCompartments: Could not find required Graph " + std::string(BGE::Graph::Renal)); + } + out.m_RespiratoryGraph = out.GetGasGraph(BGE::Graph::Respiratory); + if (out.m_RespiratoryGraph == nullptr) { + throw CommonDataModelException("BioGearsCompartments: Could not find required Graph " + std::string(BGE::Graph::Respiratory)); + } + out.m_AnesthesiaMachineGraph = out.GetGasGraph(BGE::Graph::AnesthesiaMachine); + if (out.m_AnesthesiaMachineGraph == nullptr) { + throw CommonDataModelException("BioGearsCompartments: Could not find required Graph " + std::string(BGE::Graph::AnesthesiaMachine)); + } + out.m_CombinedRespiratoryAnesthesiaGraph = out.GetGasGraph(BGE::Graph::RespiratoryAndAnesthesiaMachine); + if (out.m_CombinedRespiratoryAnesthesiaGraph == nullptr) { + throw CommonDataModelException("BioGearsCompartments: Could not find required Graph " + std::string(BGE::Graph::RespiratoryAndAnesthesiaMachine)); + } + out.m_CombinedRespiratoryInhalerGraph = out.GetGasGraph(BGE::Graph::RespiratoryAndInhaler); + if (out.m_CombinedRespiratoryInhalerGraph == nullptr) { + throw CommonDataModelException("BioGearsCompartments: Could not find required Graph " + std::string(BGE::Graph::RespiratoryAndInhaler)); + } + out.m_CombinedRespiratoryNasalCannulaGraph = out.GetGasGraph(BGE::Graph::RespiratoryAndNasalCannula); + if (out.m_CombinedRespiratoryNasalCannulaGraph == nullptr) { + throw CommonDataModelException("BioGearsCompartments: Could not find required Graph " + std::string(BGE::Graph::RespiratoryAndNasalCannula)); + } + out.m_AerosolGraph = out.GetLiquidGraph(BGE::Graph::Aerosol); + if (out.m_AerosolGraph == nullptr) { + throw CommonDataModelException("BioGearsCompartments: Could not find required Graph " + std::string(BGE::Graph::Aerosol)); + } + out.m_CombinedAerosolInhalerGraph = out.GetLiquidGraph(BGE::Graph::AerosolAndInhaler); + if (out.m_CombinedAerosolInhalerGraph == nullptr) { + throw CommonDataModelException("BioGearsCompartments: Could not find required Graph " + std::string(BGE::Graph::AerosolAndInhaler)); + } + out.m_CombinedRespiratoryMechanicalVentilatorGraph = out.GetGasGraph(BGE::Graph::RespiratoryAndMechanicalVentilator); + if (out.m_CombinedRespiratoryMechanicalVentilatorGraph == nullptr) { + throw CommonDataModelException("BioGearsCompartments: Could not find required Graph " + std::string(BGE::Graph::RespiratoryAndMechanicalVentilator)); + } + } + void BioGears::Marshall(const BioGearsCompartments& in, CDM::CompartmentManagerData& out) + { + io::Compartment::Marshall(in, out); + } + //---------------------------------------------------------------------------------------- + // SEBioGearsCircuits + void BioGears::UnMarshall(const CDM::CircuitManagerData& in, BioGearsCircuits& out) + { + + io::Circuit::UnMarshall(in, out); + + out.m_CombinedCardiovascularCircuit = out.GetFluidCircuit(BGE::Circuits::FullCardiovascular); + if (out.m_CombinedCardiovascularCircuit == nullptr) { + throw CommonDataModelException("BioGearsCircuits::Load could not find circuit : " + std::string(BGE::Circuits::FullCardiovascular)); + } + out.m_CardiovascularCircuit = out.GetFluidCircuit(BGE::Circuits::Cardiovascular); + if (out.m_CardiovascularCircuit == nullptr) { + throw CommonDataModelException("BioGearsCircuits::Load could not find circuit : " + std::string(BGE::Circuits::Cardiovascular)); + } + out.m_CerebralCircuit = out.GetFluidCircuit(BGE::Circuits::Cerebral); + if (out.m_CardiovascularCircuit == nullptr) { + throw CommonDataModelException("BioGearsCircuits::Load could not find circuit : " + std::string(BGE::Circuits::Cerebral)); + } + out.m_RenalCircuit = out.GetFluidCircuit(BGE::Circuits::Renal); + if (out.m_RenalCircuit == nullptr) { + throw CommonDataModelException("BioGearsCircuits::Load could not find circuit : " + std::string(BGE::Circuits::Renal)); + } + out.m_RespiratoryCircuit = out.GetFluidCircuit(BGE::Circuits::Respiratory); + if (out.m_RespiratoryCircuit == nullptr) { + throw CommonDataModelException("BioGearsCircuits::Load could not find circuit : " + std::string(BGE::Circuits::Respiratory)); + } + out.m_AnesthesiaMachineCircuit = out.GetFluidCircuit(BGE::Circuits::AnesthesiaMachine); + if (out.m_AnesthesiaMachineCircuit == nullptr) { + throw CommonDataModelException("BioGearsCircuits::Load could not find circuit : " + std::string(BGE::Circuits::AnesthesiaMachine)); + } + out.m_CombinedRespiratoryAnesthesiaCircuit = out.GetFluidCircuit(BGE::Circuits::RespiratoryAnesthesia); + if (out.m_CombinedRespiratoryAnesthesiaCircuit == nullptr) { + throw CommonDataModelException("BioGearsCircuits::Load could not find circuit : " + std::string(BGE::Circuits::RespiratoryAnesthesia)); + } + out.m_CombinedRespiratoryInhalerCircuit = out.GetFluidCircuit(BGE::Circuits::RespiratoryInhaler); + if (out.m_CombinedRespiratoryInhalerCircuit == nullptr) { + throw CommonDataModelException("BioGearsCircuits::Load could not find circuit : " + std::string(BGE::Circuits::RespiratoryInhaler)); + } + out.m_CombinedRespiratoryNasalCannulaCircuit = out.GetFluidCircuit(BGE::Circuits::RespiratoryNasalCannula); + if (out.m_CombinedRespiratoryNasalCannulaCircuit == nullptr) { + throw CommonDataModelException("BioGearsCircuits::Load could not find circuit : " + std::string(BGE::Circuits::RespiratoryNasalCannula)); + } + out.m_CombinedRespiratoryMechanicalVentilatorCircuit = out.GetFluidCircuit(BGE::Circuits::RespiratoryMechanicalVentilator); + if (out.m_CombinedRespiratoryMechanicalVentilatorCircuit == nullptr) { + throw CommonDataModelException("BioGearsCircuits::Load could not find circuit : " + std::string(BGE::Circuits::RespiratoryMechanicalVentilator)); + } + out.m_TemperatureCircuit = out.GetThermalCircuit(BGE::Circuits::Temperature); + if (out.m_TemperatureCircuit == nullptr) { + throw CommonDataModelException("BioGearsCircuits::Load could not find circuit : " + std::string(BGE::Circuits::Temperature)); + } + out.m_InternalTemperatureCircuit = out.GetThermalCircuit(BGE::Circuits::InternalTemperature); + if (out.m_InternalTemperatureCircuit == nullptr) { + throw CommonDataModelException("BioGearsCircuits::Load could not find circuit : " + std::string(BGE::Circuits::InternalTemperature)); + } + out.m_ExternalTemperatureCircuit = out.GetThermalCircuit(BGE::Circuits::ExternalTemperature); + if (out.m_ExternalTemperatureCircuit == nullptr) { + throw CommonDataModelException("BioGearsCircuits::Load could not find circuit : " + std::string(BGE::Circuits::ExternalTemperature)); + } } + void BioGears::Marshall(BioGearsCircuits const& in, CDM::CircuitManagerData& out) + { + io::Circuit::Marshall(in, out); + } + //---------------------------------------------------------------------------------------- + // SEErrorType + void BioGears::UnMarshall(const CDM::enumBioGearsAirwayMode& in, SEBioGearsAirwayMode& out) + { + try { + switch (in) { + case CDM::enumBioGearsAirwayMode::Free: + out = SEBioGearsAirwayMode::Free; + break; + case CDM::enumBioGearsAirwayMode::AnesthesiaMachine: + out = SEBioGearsAirwayMode::AnesthesiaMachine; + break; + case CDM::enumBioGearsAirwayMode::Inhaler: + out = SEBioGearsAirwayMode::Inhaler; + break; + case CDM::enumBioGearsAirwayMode::NasalCannula: + out = SEBioGearsAirwayMode::NasalCannula; + break; + case CDM::enumBioGearsAirwayMode::MechanicalVentilator: + out = SEBioGearsAirwayMode::MechanicalVentilator; + break; + default: + out = SEBioGearsAirwayMode::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SEBioGearsAirwayMode::Invalid; + } + } + void BioGears::Marshall(const SEBioGearsAirwayMode& in, CDM::enumBioGearsAirwayMode& out) + { + switch (in) { + case SEBioGearsAirwayMode::Free: + out = CDM::enumBioGearsAirwayMode::Free; + break; + case SEBioGearsAirwayMode::AnesthesiaMachine: + out = CDM::enumBioGearsAirwayMode::AnesthesiaMachine; + break; + case SEBioGearsAirwayMode::Inhaler: + out = CDM::enumBioGearsAirwayMode::Inhaler; + break; + case SEBioGearsAirwayMode::NasalCannula: + out = CDM::enumBioGearsAirwayMode::NasalCannula; + break; + case SEBioGearsAirwayMode::MechanicalVentilator: + out = CDM::enumBioGearsAirwayMode::MechanicalVentilator; + break; + default: + out = ""; + break; + } + } +} + +bool operator==(CDM::enumBioGearsAirwayMode const& lhs, SEBioGearsAirwayMode const& rhs) +{ + + switch (rhs) { + case SEBioGearsAirwayMode::Free: + return (CDM::enumBioGearsAirwayMode::Free == lhs); + case SEBioGearsAirwayMode::AnesthesiaMachine: + return (CDM::enumBioGearsAirwayMode::AnesthesiaMachine == lhs); + case SEBioGearsAirwayMode::Inhaler: + return (CDM::enumBioGearsAirwayMode::Inhaler == lhs); + case SEBioGearsAirwayMode::NasalCannula: + return (CDM::enumBioGearsAirwayMode::NasalCannula == lhs); + case SEBioGearsAirwayMode::MechanicalVentilator: + return (CDM::enumBioGearsAirwayMode::MechanicalVentilator == lhs); + case SEBioGearsAirwayMode::Invalid: + return ((CDM::enumBioGearsAirwayMode::value)-1 == lhs); + default: + return false; + } +} } -} \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/io/biogears/BioGears.h b/projects/biogears/libBiogears/src/io/biogears/BioGears.h index e23a784d6..b3bcf1c49 100644 --- a/projects/biogears/libBiogears/src/io/biogears/BioGears.h +++ b/projects/biogears/libBiogears/src/io/biogears/BioGears.h @@ -12,59 +12,132 @@ specific language governing permissions and limitations under the License. #pragma once #include +#include #include #include +#include + #include +#include +#include -#define CDM_BIOGEARS_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_BIOGEARS_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ out.func(std::make_unique::type>()); \ - io::BioGears::UnMarshall(*in.m_##func, out.func()); \ + io::BioGears::Marshall(*in.m_##func, out.func()); \ + } + +#define CDM_OPTIONAL_BIOGEARS_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func) { \ + } + +#define SE_BIOGEARS_ENUM_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.Has##func()) { \ + out.func(std::make_unique::type>()); \ + io::BioGears::Marshall(in.m_##func, out.func()); \ } -#define CDM_OPTIONAL_BIOGEARS_UNMARSHAL_HELPER(in, out, func) \ - if (in.m_##func) { \ - io::BioGears::UnMarshall(*in.m_##func, out.func()); \ +#define SE_BIOGEARS_PROPERTY_ENUM_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func != decltype(in.m_##func)::Invalid) { \ + io::BioGears::Marshall(in.m_##func, out.func()); \ } +#define CDM_BIOGEARS_COPY(type, in, out) \ + { \ + CDM::type##Data middle; \ + io::BioGears::Marshall(in, middle); \ + io::BioGears::UnMarshall(middle, out); \ + } namespace biogears { class BiogearsPhysiologyEngine; class BioGearsEngine; +class BioGearsCircuits; +class BioGearsCompartments; +class SECircuitManager; +class BioGears; +class SESystem; namespace io { class BIOGEARS_PRIVATE_API BioGears { public: + // class Factories; + static std::unique_ptr factory(CDM::SystemData const* systemData, biogears::BioGears& bgData); + + static std::unique_ptr factory(const SESystem* data); + // template option + template ::value>* = nullptr> + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); + template ::value>* = nullptr> + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out, std::default_random_engine* rd = nullptr); template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); - template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); + + // class BioGears + static void UnMarshall(const CDM::BioGearsStateData& in, BioGearsEngine& out, const SEScalarTime* simTime = nullptr); + static void Marshall(const BioGearsEngine& in, CDM::BioGearsStateData& out); + + // class BioGearsCompartments + static void UnMarshall(const CDM::CompartmentManagerData& in, BioGearsCompartments& out, SECircuitManager* circuits); + static void Marshall(const BioGearsCompartments& in, CDM::CompartmentManagerData& out); - // class BioGears - static void Marshall(const CDM::BioGearsStateData& in, BioGearsEngine& out, const SEScalarTime* simTime = nullptr); - static void UnMarshall(const BioGearsEngine& in, CDM::BioGearsStateData& out); + // class BioGearsCircuits + static void UnMarshall(const CDM::CircuitManagerData& in, BioGearsCircuits& ou); + static void Marshall(const BioGearsCircuits& in, CDM::CircuitManagerData& out); + // SEErrorType + static void UnMarshall(const CDM::enumBioGearsAirwayMode& in, SEBioGearsAirwayMode& out); + static void Marshall(const SEBioGearsAirwayMode& in, CDM::enumBioGearsAirwayMode& out); }; //---------------------------------------------------------------------------------- - template - void BioGears::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + template ::value>*> + void BioGears::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) + { + if (!option_in.present()) { + out = SE::Invalid; + } else { + UnMarshall(option_in.get(), out); + } + } + + template ::value>*> + void BioGears::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out, std::default_random_engine* rd) { if (!option_in.present()) { - out.Clear(); + out.MakeInvalid(); } else { - Marshall(option_in.get(), out); + UnMarshall(option_in.get(), out, rd); } } + //---------------------------------------------------------------------------------- template - void BioGears::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void BioGears::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); + Marshall(in, *item); option_out.set(*item); } } // Namespace IO + +// Operators +bool operator==(CDM::enumBioGearsAirwayMode const& lhs, SEBioGearsAirwayMode const& rhs); + +inline bool operator==(SEBioGearsAirwayMode const& lhs, CDM::enumBioGearsAirwayMode const& rhs) +{ + return rhs == lhs; +} + +inline bool operator!=(CDM::enumBioGearsAirwayMode const& lhs, SEBioGearsAirwayMode const& rhs) +{ + return !(lhs == rhs); +} + +inline bool operator!=(SEBioGearsAirwayMode const& lhs, CDM::enumBioGearsAirwayMode const& rhs) +{ + return !(rhs == lhs); +} } // Namespace Biogears diff --git a/projects/biogears/libBiogears/src/io/biogears/BioGearsConfiguration.cpp b/projects/biogears/libBiogears/src/io/biogears/BioGearsConfiguration.cpp index b7bd73984..7de728144 100644 --- a/projects/biogears/libBiogears/src/io/biogears/BioGearsConfiguration.cpp +++ b/projects/biogears/libBiogears/src/io/biogears/BioGearsConfiguration.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include "../cdm/EngineConfiguration.h" #include "../cdm/Environment.h" @@ -18,313 +18,387 @@ namespace biogears { namespace io { // class BloodChemistryConfiguration - void BiogearsEngineConfiguration::Marshall(const CDM::BloodChemistryConfigurationData& in, BioGearsConfiguration& out) + void BiogearsEngineConfiguration::UnMarshall(const CDM::BloodChemistryConfigurationData& in, BioGearsConfiguration& out) { - io::Property::Marshall(in.MeanCorpuscularVolume(), out.GetMeanCorpuscularVolume()); - io::Property::Marshall(in.MeanCorpuscularHemoglobin(), out.GetMeanCorpuscularHemoglobin()); - io::Property::Marshall(in.StandardDiffusionDistance(), out.GetStandardDiffusionDistance()); - io::Property::Marshall(in.StandardOxygenDiffusionCoefficient(), out.GetStandardOxygenDiffusionCoefficient()); + if (in.MeanCorpuscularVolume().present() || !out.m_Merge) + io::Property::UnMarshall(in.MeanCorpuscularVolume(), out.GetMeanCorpuscularVolume()); + if (in.MeanCorpuscularHemoglobin().present() || !out.m_Merge) + io::Property::UnMarshall(in.MeanCorpuscularHemoglobin(), out.GetMeanCorpuscularHemoglobin()); + if (in.StandardDiffusionDistance().present() || !out.m_Merge) + io::Property::UnMarshall(in.StandardDiffusionDistance(), out.GetStandardDiffusionDistance()); + if (in.StandardOxygenDiffusionCoefficient().present() || !out.m_Merge) + io::Property::UnMarshall(in.StandardOxygenDiffusionCoefficient(), out.GetStandardOxygenDiffusionCoefficient()); } - void BiogearsEngineConfiguration::UnMarshall(const BioGearsConfiguration& in, CDM::BloodChemistryConfigurationData& out) + void BiogearsEngineConfiguration::Marshall(const BioGearsConfiguration& in, CDM::BloodChemistryConfigurationData& out) { // Blood Chemistry - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MeanCorpuscularHemoglobin) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MeanCorpuscularVolume) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, StandardDiffusionDistance) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, StandardOxygenDiffusionCoefficient) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MeanCorpuscularHemoglobin) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MeanCorpuscularVolume) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, StandardDiffusionDistance) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, StandardOxygenDiffusionCoefficient) } // class CardiovascularConfiguration - void BiogearsEngineConfiguration::Marshall(const CDM::CardiovascularConfigurationData& in, BioGearsConfiguration& out) + void BiogearsEngineConfiguration::UnMarshall(const CDM::CardiovascularConfigurationData& in, BioGearsConfiguration& out) { // Cardiovascular - io::Property::Marshall(in.LeftHeartElastanceMaximum(), out.GetLeftHeartElastanceMaximum()); - io::Property::Marshall(in.LeftHeartElastanceMinimum(), out.GetLeftHeartElastanceMinimum()); - io::Property::Marshall(in.MinimumBloodVolumeFraction(), out.GetMinimumBloodVolumeFraction()); - io::Property::Marshall(in.RightHeartElastanceMaximum(), out.GetRightHeartElastanceMaximum()); - io::Property::Marshall(in.RightHeartElastanceMinimum(), out.GetRightHeartElastanceMinimum()); - io::Property::Marshall(in.StandardPulmonaryCapillaryCoverage(), out.GetStandardPulmonaryCapillaryCoverage()); + if (in.LeftHeartElastanceMaximum().present() || !out.m_Merge) + io::Property::UnMarshall(in.LeftHeartElastanceMaximum(), out.GetLeftHeartElastanceMaximum()); + if (in.LeftHeartElastanceMinimum().present() || !out.m_Merge) + io::Property::UnMarshall(in.LeftHeartElastanceMinimum(), out.GetLeftHeartElastanceMinimum()); + if (in.MinimumBloodVolumeFraction().present() || !out.m_Merge) + io::Property::UnMarshall(in.MinimumBloodVolumeFraction(), out.GetMinimumBloodVolumeFraction()); + if (in.RightHeartElastanceMaximum().present() || !out.m_Merge) + io::Property::UnMarshall(in.RightHeartElastanceMaximum(), out.GetRightHeartElastanceMaximum()); + if (in.RightHeartElastanceMinimum().present() || !out.m_Merge) + io::Property::UnMarshall(in.RightHeartElastanceMinimum(), out.GetRightHeartElastanceMinimum()); + if (in.StandardPulmonaryCapillaryCoverage().present() || !out.m_Merge) + io::Property::UnMarshall(in.StandardPulmonaryCapillaryCoverage(), out.GetStandardPulmonaryCapillaryCoverage()); } - void BiogearsEngineConfiguration::UnMarshall(const BioGearsConfiguration& in, CDM::CardiovascularConfigurationData& out) + void BiogearsEngineConfiguration::Marshall(const BioGearsConfiguration& in, CDM::CardiovascularConfigurationData& out) { // Cardiovascular - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftHeartElastanceMaximum) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftHeartElastanceMinimum) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MinimumBloodVolumeFraction) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightHeartElastanceMaximum) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightHeartElastanceMinimum) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, StandardPulmonaryCapillaryCoverage) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftHeartElastanceMaximum) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftHeartElastanceMinimum) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MinimumBloodVolumeFraction) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightHeartElastanceMaximum) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightHeartElastanceMinimum) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, StandardPulmonaryCapillaryCoverage) } // class CircuitConfiguration - void BiogearsEngineConfiguration::Marshall(const CDM::CircuitConfigurationData& in, BioGearsConfiguration& out) + void BiogearsEngineConfiguration::UnMarshall(const CDM::CircuitConfigurationData& in, BioGearsConfiguration& out) { // Circuit - io::Property::Marshall(in.CardiovascularOpenResistance(), out.GetCardiovascularOpenResistance()); - io::Property::Marshall(in.DefaultOpenElectricResistance(), out.GetDefaultOpenElectricResistance()); - io::Property::Marshall(in.DefaultOpenFlowResistance(), out.GetDefaultOpenFlowResistance()); - io::Property::Marshall(in.DefaultOpenHeatResistance(), out.GetDefaultOpenHeatResistance()); - io::Property::Marshall(in.DefaultClosedElectricResistance(), out.GetDefaultClosedElectricResistance()); - io::Property::Marshall(in.DefaultClosedFlowResistance(), out.GetDefaultClosedFlowResistance()); - io::Property::Marshall(in.DefaultClosedHeatResistance(), out.GetDefaultClosedHeatResistance()); - io::Property::Marshall(in.MachineClosedResistance(), out.GetMachineClosedResistance()); - io::Property::Marshall(in.MachineOpenResistance(), out.GetMachineOpenResistance()); - io::Property::Marshall(in.RespiratoryClosedResistance(), out.GetRespiratoryClosedResistance()); - io::Property::Marshall(in.RespiratoryOpenResistance(), out.GetRespiratoryOpenResistance()); + if (in.CardiovascularOpenResistance().present() || !out.m_Merge) + io::Property::UnMarshall(in.CardiovascularOpenResistance(), out.GetCardiovascularOpenResistance()); + if (in.DefaultOpenElectricResistance().present() || !out.m_Merge) + io::Property::UnMarshall(in.DefaultOpenElectricResistance(), out.GetDefaultOpenElectricResistance()); + if (in.DefaultOpenFlowResistance().present() || !out.m_Merge) + io::Property::UnMarshall(in.DefaultOpenFlowResistance(), out.GetDefaultOpenFlowResistance()); + if (in.DefaultOpenHeatResistance().present() || !out.m_Merge) + io::Property::UnMarshall(in.DefaultOpenHeatResistance(), out.GetDefaultOpenHeatResistance()); + if (in.DefaultClosedElectricResistance().present() || !out.m_Merge) + io::Property::UnMarshall(in.DefaultClosedElectricResistance(), out.GetDefaultClosedElectricResistance()); + if (in.DefaultClosedFlowResistance().present() || !out.m_Merge) + io::Property::UnMarshall(in.DefaultClosedFlowResistance(), out.GetDefaultClosedFlowResistance()); + if (in.DefaultClosedHeatResistance().present() || !out.m_Merge) + io::Property::UnMarshall(in.DefaultClosedHeatResistance(), out.GetDefaultClosedHeatResistance()); + if (in.MachineClosedResistance().present() || !out.m_Merge) + io::Property::UnMarshall(in.MachineClosedResistance(), out.GetMachineClosedResistance()); + if (in.MachineOpenResistance().present() || !out.m_Merge) + io::Property::UnMarshall(in.MachineOpenResistance(), out.GetMachineOpenResistance()); + if (in.RespiratoryClosedResistance().present() || !out.m_Merge) + io::Property::UnMarshall(in.RespiratoryClosedResistance(), out.GetRespiratoryClosedResistance()); + if (in.RespiratoryOpenResistance().present() || !out.m_Merge) + io::Property::UnMarshall(in.RespiratoryOpenResistance(), out.GetRespiratoryOpenResistance()); } - void BiogearsEngineConfiguration::UnMarshall(const BioGearsConfiguration& in, CDM::CircuitConfigurationData& out) + void BiogearsEngineConfiguration::Marshall(const BioGearsConfiguration& in, CDM::CircuitConfigurationData& out) { // Circuits - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, CardiovascularOpenResistance) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, DefaultClosedElectricResistance) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, DefaultClosedFlowResistance) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, DefaultClosedHeatResistance) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, DefaultOpenElectricResistance) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, DefaultOpenFlowResistance) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, DefaultOpenHeatResistance) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MachineClosedResistance) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MachineOpenResistance) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RespiratoryClosedResistance) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RespiratoryOpenResistance) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, CardiovascularOpenResistance) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, DefaultClosedElectricResistance) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, DefaultClosedFlowResistance) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, DefaultClosedHeatResistance) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, DefaultOpenElectricResistance) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, DefaultOpenFlowResistance) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, DefaultOpenHeatResistance) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MachineClosedResistance) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MachineOpenResistance) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RespiratoryClosedResistance) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RespiratoryOpenResistance) } // class ConstantCOnfiguration - void BiogearsEngineConfiguration::Marshall(const CDM::ConstantsConfigurationData& in, BioGearsConfiguration& out) + void BiogearsEngineConfiguration::UnMarshall(const CDM::ConstantsConfigurationData& in, BioGearsConfiguration& out) { // Constants - io::Property::Marshall(in.OxygenMetabolicConstant(), out.GetOxygenMetabolicConstant()); - io::Property::Marshall(in.StefanBoltzmann(), out.GetStefanBoltzmann()); - io::Property::Marshall(in.UniversalGasConstant(), out.GetUniversalGasConstant()); + if (in.OxygenMetabolicConstant().present() || !out.m_Merge) + io::Property::UnMarshall(in.OxygenMetabolicConstant(), out.GetOxygenMetabolicConstant()); + if (in.StefanBoltzmann().present() || !out.m_Merge) + io::Property::UnMarshall(in.StefanBoltzmann(), out.GetStefanBoltzmann()); + if (in.UniversalGasConstant().present() || !out.m_Merge) + io::Property::UnMarshall(in.UniversalGasConstant(), out.GetUniversalGasConstant()); } - void BiogearsEngineConfiguration::UnMarshall(const BioGearsConfiguration& in, CDM::ConstantsConfigurationData& out) + void BiogearsEngineConfiguration::Marshall(const BioGearsConfiguration& in, CDM::ConstantsConfigurationData& out) { // Constants - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, OxygenMetabolicConstant) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, StefanBoltzmann) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, UniversalGasConstant) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, OxygenMetabolicConstant) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, StefanBoltzmann) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, UniversalGasConstant) } // class DrugsConfiguration - void BiogearsEngineConfiguration::Marshall(const CDM::DrugsConfigurationData& in, BioGearsConfiguration& out) + void BiogearsEngineConfiguration::UnMarshall(const CDM::DrugsConfigurationData& in, BioGearsConfiguration& out) { // Drugs - if (in.PDModel().present()) - out.UsePDModel(in.PDModel().get()); + if (in.PDModel().present() || !out.m_Merge) + io::Property::UnMarshall(in.PDModel().get(), out.m_PDEnabled); } - void BiogearsEngineConfiguration::UnMarshall(const BioGearsConfiguration& in, CDM::DrugsConfigurationData& out) + void BiogearsEngineConfiguration::Marshall(const BioGearsConfiguration& in, CDM::DrugsConfigurationData& out) { // Drugs - if (in.HasUsePDModel()) - out.PDModel(in.m_PDEnabled); + if (in.m_PDEnabled != decltype(in.m_PDEnabled)::Invalid) { + io::Property::Marshall(in.m_PDEnabled, out.PDModel()); + } } // class EnergyConfiguration - void BiogearsEngineConfiguration::Marshall(const CDM::EnergyConfigurationData& in, BioGearsConfiguration& out) + void BiogearsEngineConfiguration::UnMarshall(const CDM::EnergyConfigurationData& in, BioGearsConfiguration& out) { // Energy - io::Property::Marshall(in.BodySpecificHeat(), out.GetBodySpecificHeat()); - io::Property::Marshall(in.CoreTemperatureLow(), out.GetCoreTemperatureLow()); - io::Property::Marshall(in.CoreTemperatureHigh(), out.GetCoreTemperatureHigh()); - io::Property::Marshall(in.DeltaCoreTemperatureLow(), out.GetDeltaCoreTemperatureLow()); - io::Property::Marshall(in.EnergyPerATP(), out.GetEnergyPerATP()); - io::Property::Marshall(in.SweatHeatTransfer(), out.GetSweatHeatTransfer()); - io::Property::Marshall(in.VaporizationEnergy(), out.GetVaporizationEnergy()); - io::Property::Marshall(in.VaporSpecificHeat(), out.GetVaporSpecificHeat()); + if (in.BodySpecificHeat().present() || !out.m_Merge) + io::Property::UnMarshall(in.BodySpecificHeat(), out.GetBodySpecificHeat()); + if (in.CoreTemperatureLow().present() || !out.m_Merge) + io::Property::UnMarshall(in.CoreTemperatureLow(), out.GetCoreTemperatureLow()); + if (in.CoreTemperatureHigh().present() || !out.m_Merge) + io::Property::UnMarshall(in.CoreTemperatureHigh(), out.GetCoreTemperatureHigh()); + if (in.DeltaCoreTemperatureLow().present() || !out.m_Merge) + io::Property::UnMarshall(in.DeltaCoreTemperatureLow(), out.GetDeltaCoreTemperatureLow()); + if (in.EnergyPerATP().present() || !out.m_Merge) + io::Property::UnMarshall(in.EnergyPerATP(), out.GetEnergyPerATP()); + if (in.SweatHeatTransfer().present() || !out.m_Merge) + io::Property::UnMarshall(in.SweatHeatTransfer(), out.GetSweatHeatTransfer()); + if (in.VaporizationEnergy().present() || !out.m_Merge) + io::Property::UnMarshall(in.VaporizationEnergy(), out.GetVaporizationEnergy()); + if (in.VaporSpecificHeat().present() || !out.m_Merge) + io::Property::UnMarshall(in.VaporSpecificHeat(), out.GetVaporSpecificHeat()); } - void BiogearsEngineConfiguration::UnMarshall(const BioGearsConfiguration& in, CDM::EnergyConfigurationData& out) + void BiogearsEngineConfiguration::Marshall(const BioGearsConfiguration& in, CDM::EnergyConfigurationData& out) { // Energy - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, BodySpecificHeat) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, CoreTemperatureLow) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, CoreTemperatureHigh) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, DeltaCoreTemperatureLow) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, EnergyPerATP) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SweatHeatTransfer) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, VaporSpecificHeat) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, VaporizationEnergy) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, BodySpecificHeat) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, CoreTemperatureLow) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, CoreTemperatureHigh) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, DeltaCoreTemperatureLow) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, EnergyPerATP) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SweatHeatTransfer) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, VaporSpecificHeat) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, VaporizationEnergy) } // class EnvironmentConfiguration - void BiogearsEngineConfiguration::Marshall(const CDM::EnvironmentConfigurationData& in, BioGearsConfiguration& out) + void BiogearsEngineConfiguration::UnMarshall(const CDM::EnvironmentConfigurationData& in, BioGearsConfiguration& out) { // Environment - io::Property::Marshall(in.AirDensity(), out.GetAirDensity()); - io::Property::Marshall(in.AirSpecificHeat(), out.GetAirSpecificHeat()); - io::Property::Marshall(in.MolarMassOfDryAir(), out.GetMolarMassOfDryAir()); - io::Property::Marshall(in.MolarMassOfWaterVapor(), out.GetMolarMassOfWaterVapor()); + if (in.AirDensity().present() || !out.m_Merge) + io::Property::UnMarshall(in.AirDensity(), out.GetAirDensity()); + if (in.AirSpecificHeat().present() || !out.m_Merge) + io::Property::UnMarshall(in.AirSpecificHeat(), out.GetAirSpecificHeat()); + if (in.MolarMassOfDryAir().present() || !out.m_Merge) + io::Property::UnMarshall(in.MolarMassOfDryAir(), out.GetMolarMassOfDryAir()); + if (in.MolarMassOfWaterVapor().present() || !out.m_Merge) + io::Property::UnMarshall(in.MolarMassOfWaterVapor(), out.GetMolarMassOfWaterVapor()); + + if (out.m_Merge == false) { + out.GetInitialEnvironmentalConditions().Invalidate(); + } + if (in.InitialEnvironmentalConditionsFile().present()) { if (!out.GetInitialEnvironmentalConditions().Load(in.InitialEnvironmentalConditionsFile().get())) { throw biogears::CommonDataModelException("Unable to load InitialEnvironmentalConditions file"); } } else if (in.InitialEnvironmentalConditions().present()) { - if (!out.GetInitialEnvironmentalConditions().Load(in.InitialEnvironmentalConditions().get())) { + try { + io::Environment::UnMarshall(in.InitialEnvironmentalConditions(), out.GetInitialEnvironmentalConditions()); + } catch (biogears::CommonDataModelException ex) { throw biogears::CommonDataModelException("Unable to load InitialEnvironmentalConditions"); } } - io::Property::Marshall(in.WaterDensity(), out.GetWaterDensity()); + + io::Property::UnMarshall(in.WaterDensity(), out.GetWaterDensity()); } - void BiogearsEngineConfiguration::UnMarshall(const BioGearsConfiguration& in, CDM::EnvironmentConfigurationData& out) + void BiogearsEngineConfiguration::Marshall(const BioGearsConfiguration& in, CDM::EnvironmentConfigurationData& out) { // Environment - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, AirDensity) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, AirSpecificHeat) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MolarMassOfDryAir) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MolarMassOfWaterVapor) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, AirDensity) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, AirSpecificHeat) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MolarMassOfDryAir) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MolarMassOfWaterVapor) - CDM_OPTIONAL_ENVIRONMENT_UNMARSHAL_HELPER(in, out, InitialEnvironmentalConditions) + CDM_OPTIONAL_ENVIRONMENT_PTR_MARSHALL_HELPER(in, out, InitialEnvironmentalConditions) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, WaterDensity) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, WaterDensity) } // class GastrointestinalConfiguratio - void BiogearsEngineConfiguration::Marshall(const CDM::GastrointestinalConfigurationData& in, BioGearsConfiguration& out) + void BiogearsEngineConfiguration::UnMarshall(const CDM::GastrointestinalConfigurationData& in, BioGearsConfiguration& out) { // Gastrointestinal - io::Property::Marshall(in.CalciumAbsorptionFraction(), out.GetCalciumAbsorptionFraction()); - io::Property::Marshall(in.CalciumDigestionRate(), out.GetCalciumDigestionRate()); - io::Property::Marshall(in.CarbohydrateAbsorptionFraction(), out.GetCarbohydrateAbsorptionFraction()); + if (in.CalciumAbsorptionFraction().present() || !out.m_Merge) + io::Property::UnMarshall(in.CalciumAbsorptionFraction(), out.GetCalciumAbsorptionFraction()); + if (in.CalciumDigestionRate().present() || !out.m_Merge) + io::Property::UnMarshall(in.CalciumDigestionRate(), out.GetCalciumDigestionRate()); + if (in.CarbohydrateAbsorptionFraction().present() || !out.m_Merge) + io::Property::UnMarshall(in.CarbohydrateAbsorptionFraction(), out.GetCarbohydrateAbsorptionFraction()); + + if (out.m_Merge == false) { + out.GetDefaultStomachContents().Invalidate(); + } + if (in.DefaultStomachContentsFile().present()) { if (!out.GetDefaultStomachContents().Load(in.DefaultStomachContentsFile().get())) { throw biogears::CommonDataModelException("Unable to load Standard Stomach Contents file"); } } else if (in.DefaultStomachContents().present()) { - if (!out.GetDefaultStomachContents().Load(in.DefaultStomachContents().get())) { - throw biogears::CommonDataModelException("Unable to load Standard Stomach Contents"); + try { + io::PatientNutrition::UnMarshall(in.DefaultStomachContents().get(), out.GetDefaultStomachContents()); + } catch (CommonDataModelException ex) { + throw biogears::CommonDataModelException(std::string("Unable to load Standard Stomach Contents") + ex.what()); } } - io::Property::Marshall(in.FatAbsorptionFraction(), out.GetFatAbsorptionFraction()); - io::Property::Marshall(in.ProteinToUreaFraction(), out.GetProteinToUreaFraction()); - io::Property::Marshall(in.WaterDigestionRate(), out.GetWaterDigestionRate()); + + if (in.FatAbsorptionFraction().present() || !out.m_Merge) + io::Property::UnMarshall(in.FatAbsorptionFraction(), out.GetFatAbsorptionFraction()); + if (in.ProteinToUreaFraction().present() || !out.m_Merge) + io::Property::UnMarshall(in.ProteinToUreaFraction(), out.GetProteinToUreaFraction()); + if (in.WaterDigestionRate().present() || !out.m_Merge) + io::Property::UnMarshall(in.WaterDigestionRate(), out.GetWaterDigestionRate()); } - void BiogearsEngineConfiguration::UnMarshall(const BioGearsConfiguration& in, CDM::GastrointestinalConfigurationData& out) + void BiogearsEngineConfiguration::Marshall(const BioGearsConfiguration& in, CDM::GastrointestinalConfigurationData& out) { // Gastrointestinal - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, CalciumAbsorptionFraction) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, CalciumDigestionRate) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, CarbohydrateAbsorptionFraction) - CDM_OPTIONAL_PATIENT_NUTRITION_UNMARSHAL_HELPER(in, out, DefaultStomachContents) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, FatAbsorptionFraction) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ProteinToUreaFraction) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, WaterDigestionRate) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, CalciumAbsorptionFraction) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, CalciumDigestionRate) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, CarbohydrateAbsorptionFraction) + CDM_OPTIONAL_PATIENT_NUTRITION_PTR_MARSHALL_HELPER(in, out, DefaultStomachContents) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, FatAbsorptionFraction) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ProteinToUreaFraction) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, WaterDigestionRate) } // class BioGearsConfiguration - void BiogearsEngineConfiguration::Marshall(const CDM::NervousConfigurationData& in, BioGearsConfiguration& out) + void BiogearsEngineConfiguration::UnMarshall(const CDM::NervousConfigurationData& in, BioGearsConfiguration& out) { // Nervous - if (in.EnableCerebral().present()) - out.EnableCerebral(in.EnableCerebral().get()); - io::Property::Marshall(in.PupilDiameterBaseline(), out.GetPupilDiameterBaseline()); + if (in.EnableCerebral().present() || !out.m_Merge) + io::Property::UnMarshall(in.EnableCerebral().get(), out.m_CerebralEnabled); + if (in.PupilDiameterBaseline().present() || !out.m_Merge) + io::Property::UnMarshall(in.PupilDiameterBaseline(), out.GetPupilDiameterBaseline()); } - void BiogearsEngineConfiguration::UnMarshall(const BioGearsConfiguration& in, CDM::NervousConfigurationData& out) + void BiogearsEngineConfiguration::Marshall(const BioGearsConfiguration& in, CDM::NervousConfigurationData& out) { // Nervous - if (in.HasEnableCerebral()) - out.EnableCerebral(in.m_CerebralEnabled); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PupilDiameterBaseline) + if (in.m_CerebralEnabled != decltype(in.m_CerebralEnabled)::Invalid) { + io::Property::Marshall(in.m_CerebralEnabled, out.EnableCerebral()); + } + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PupilDiameterBaseline) } // class RenalConfiguration - void BiogearsEngineConfiguration::Marshall(const CDM::RenalConfigurationData& in, BioGearsConfiguration& out) + void BiogearsEngineConfiguration::UnMarshall(const CDM::RenalConfigurationData& in, BioGearsConfiguration& out) { // Renal - if (in.EnableRenal().present()) - out.EnableRenal(in.EnableRenal().get()); - - io::Property::Marshall(in.PlasmaSodiumConcentrationSetPoint(), out.GetPlasmaSodiumConcentrationSetPoint()); - - io::Property::Marshall(in.LeftGlomerularFluidPermeabilityBaseline(), out.GetLeftGlomerularFluidPermeabilityBaseline()); - io::Property::Marshall(in.LeftGlomerularFilteringSurfaceAreaBaseline(), out.GetLeftGlomerularFilteringSurfaceAreaBaseline()); - io::Property::Marshall(in.LeftTubularReabsorptionFluidPermeabilityBaseline(), out.GetLeftTubularReabsorptionFluidPermeabilityBaseline()); - io::Property::Marshall(in.LeftTubularReabsorptionFilteringSurfaceAreaBaseline(), out.GetLeftTubularReabsorptionFilteringSurfaceAreaBaseline()); + if (in.EnableRenal().present() || !out.m_Merge) + io::Property::UnMarshall(in.EnableRenal(), out.m_RenalEnabled); + if (in.PlasmaSodiumConcentrationSetPoint().present() || !out.m_Merge) + io::Property::UnMarshall(in.PlasmaSodiumConcentrationSetPoint(), out.GetPlasmaSodiumConcentrationSetPoint()); + if (in.LeftGlomerularFluidPermeabilityBaseline().present() || !out.m_Merge) + io::Property::UnMarshall(in.LeftGlomerularFluidPermeabilityBaseline(), out.GetLeftGlomerularFluidPermeabilityBaseline()); + if (in.LeftGlomerularFilteringSurfaceAreaBaseline().present() || !out.m_Merge) + io::Property::UnMarshall(in.LeftGlomerularFilteringSurfaceAreaBaseline(), out.GetLeftGlomerularFilteringSurfaceAreaBaseline()); + if (in.LeftTubularReabsorptionFluidPermeabilityBaseline().present() || !out.m_Merge) + io::Property::UnMarshall(in.LeftTubularReabsorptionFluidPermeabilityBaseline(), out.GetLeftTubularReabsorptionFluidPermeabilityBaseline()); + if (in.LeftTubularReabsorptionFilteringSurfaceAreaBaseline().present() || !out.m_Merge) + io::Property::UnMarshall(in.LeftTubularReabsorptionFilteringSurfaceAreaBaseline(), out.GetLeftTubularReabsorptionFilteringSurfaceAreaBaseline()); - io::Property::Marshall(in.MaximumAfferentResistance(), out.GetMaximumAfferentResistance()); - io::Property::Marshall(in.MinimumAfferentResistance(), out.GetMinimumAfferentResistance()); + if (in.MaximumAfferentResistance().present() || !out.m_Merge) + io::Property::UnMarshall(in.MaximumAfferentResistance(), out.GetMaximumAfferentResistance()); + if (in.MinimumAfferentResistance().present() || !out.m_Merge) + io::Property::UnMarshall(in.MinimumAfferentResistance(), out.GetMinimumAfferentResistance()); - io::Property::Marshall(in.RightGlomerularFluidPermeabilityBaseline(), out.GetRightGlomerularFluidPermeabilityBaseline()); - io::Property::Marshall(in.RightGlomerularFilteringSurfaceAreaBaseline(), out.GetRightGlomerularFilteringSurfaceAreaBaseline()); - io::Property::Marshall(in.RightTubularReabsorptionFluidPermeabilityBaseline(), out.GetRightTubularReabsorptionFluidPermeabilityBaseline()); - io::Property::Marshall(in.RightTubularReabsorptionFilteringSurfaceAreaBaseline(), out.GetRightTubularReabsorptionFilteringSurfaceAreaBaseline()); - io::Property::Marshall(in.TargetSodiumDelivery(), out.GetTargetSodiumDelivery()); + if (in.RightGlomerularFluidPermeabilityBaseline().present() || !out.m_Merge) + io::Property::UnMarshall(in.RightGlomerularFluidPermeabilityBaseline(), out.GetRightGlomerularFluidPermeabilityBaseline()); + if (in.RightGlomerularFilteringSurfaceAreaBaseline().present() || !out.m_Merge) + io::Property::UnMarshall(in.RightGlomerularFilteringSurfaceAreaBaseline(), out.GetRightGlomerularFilteringSurfaceAreaBaseline()); + if (in.RightTubularReabsorptionFluidPermeabilityBaseline().present() || !out.m_Merge) + io::Property::UnMarshall(in.RightTubularReabsorptionFluidPermeabilityBaseline(), out.GetRightTubularReabsorptionFluidPermeabilityBaseline()); + if (in.RightTubularReabsorptionFilteringSurfaceAreaBaseline().present() || !out.m_Merge) + io::Property::UnMarshall(in.RightTubularReabsorptionFilteringSurfaceAreaBaseline(), out.GetRightTubularReabsorptionFilteringSurfaceAreaBaseline()); + if (in.TargetSodiumDelivery().present() || !out.m_Merge) + io::Property::UnMarshall(in.TargetSodiumDelivery(), out.GetTargetSodiumDelivery()); } - void BiogearsEngineConfiguration::UnMarshall(const BioGearsConfiguration& in, CDM::RenalConfigurationData& out) + void BiogearsEngineConfiguration::Marshall(const BioGearsConfiguration& in, CDM::RenalConfigurationData& out) { // Renal if (in.HasEnableRenal()) - out.EnableRenal(in.m_RenalEnabled); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PlasmaSodiumConcentrationSetPoint) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftGlomerularFilteringSurfaceAreaBaseline) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftGlomerularFluidPermeabilityBaseline) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftTubularReabsorptionFilteringSurfaceAreaBaseline) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftTubularReabsorptionFluidPermeabilityBaseline) + io::Property::Marshall(in.m_RenalEnabled, out.EnableRenal()); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PlasmaSodiumConcentrationSetPoint) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftGlomerularFilteringSurfaceAreaBaseline) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftGlomerularFluidPermeabilityBaseline) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftTubularReabsorptionFilteringSurfaceAreaBaseline) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftTubularReabsorptionFluidPermeabilityBaseline) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MaximumAfferentResistance) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MinimumAfferentResistance) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MaximumAfferentResistance) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MinimumAfferentResistance) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightGlomerularFilteringSurfaceAreaBaseline) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightGlomerularFluidPermeabilityBaseline) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightTubularReabsorptionFilteringSurfaceAreaBaseline) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightTubularReabsorptionFluidPermeabilityBaseline) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightGlomerularFilteringSurfaceAreaBaseline) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightGlomerularFluidPermeabilityBaseline) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightTubularReabsorptionFilteringSurfaceAreaBaseline) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightTubularReabsorptionFluidPermeabilityBaseline) } // class RespiratoryConfiguration - void BiogearsEngineConfiguration::Marshall(const CDM::RespiratoryConfigurationData& in, BioGearsConfiguration& out) + void BiogearsEngineConfiguration::UnMarshall(const CDM::RespiratoryConfigurationData& in, BioGearsConfiguration& out) { // Respiratory - io::Property::Marshall(in.PleuralComplianceSensitivity(), out.GetPleuralComplianceSensitivity()); - io::Property::Marshall(in.PulmonaryVentilationRateMaximum(), out.GetPulmonaryVentilationRateMaximum()); - io::Property::Marshall(in.VentilatoryOcclusionPressure(), out.GetVentilatoryOcclusionPressure()); + if (in.PleuralComplianceSensitivity().present() || !out.m_Merge) + io::Property::UnMarshall(in.PleuralComplianceSensitivity(), out.GetPleuralComplianceSensitivity()); + if (in.PulmonaryVentilationRateMaximum().present() || !out.m_Merge) + io::Property::UnMarshall(in.PulmonaryVentilationRateMaximum(), out.GetPulmonaryVentilationRateMaximum()); + if (in.VentilatoryOcclusionPressure().present() || !out.m_Merge) + io::Property::UnMarshall(in.VentilatoryOcclusionPressure(), out.GetVentilatoryOcclusionPressure()); } - void BiogearsEngineConfiguration::UnMarshall(const BioGearsConfiguration& in, CDM::RespiratoryConfigurationData& out) + void BiogearsEngineConfiguration::Marshall(const BioGearsConfiguration& in, CDM::RespiratoryConfigurationData& out) { // Respiratory - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PleuralComplianceSensitivity) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PulmonaryVentilationRateMaximum) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, VentilatoryOcclusionPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PleuralComplianceSensitivity) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PulmonaryVentilationRateMaximum) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, VentilatoryOcclusionPressure) } // class TissueConfiguration - void BiogearsEngineConfiguration::Marshall(const CDM::TissueConfigurationData& in, BioGearsConfiguration& out) + void BiogearsEngineConfiguration::UnMarshall(const CDM::TissueConfigurationData& in, BioGearsConfiguration& out) { // Tissue - if (in.EnableTissue().present()) - out.EnableTissue(in.EnableTissue().get()); + if (in.EnableTissue().present() || !out.m_Merge) + io::Property::UnMarshall(in.EnableTissue().get(), out.m_TissueEnabled); } - void BiogearsEngineConfiguration::UnMarshall(const BioGearsConfiguration& in, CDM::TissueConfigurationData& out) + void BiogearsEngineConfiguration::Marshall(const BioGearsConfiguration& in, CDM::TissueConfigurationData& out) { // Tissue if (in.HasEnableTissue()) - out.EnableTissue(in.m_TissueEnabled); + io::Property::Marshall(in.m_TissueEnabled, out.EnableTissue()); } // class BioGearsConfiguration - void BiogearsEngineConfiguration::Marshall(const CDM::BioGearsConfigurationData& in, BioGearsConfiguration& out) + void BiogearsEngineConfiguration::UnMarshall(const CDM::BioGearsConfigurationData& in, BioGearsConfiguration& out) { - io::EngineConfiguration::Marshall(in, out); + io::EngineConfiguration::UnMarshall(in, out); - io::BiogearsEngineConfiguration::Marshall(in.BloodChemistryConfiguration(), out); - io::BiogearsEngineConfiguration::Marshall(in.CardiovascularConfiguration(), out); - io::BiogearsEngineConfiguration::Marshall(in.CircuitConfiguration(), out); - io::BiogearsEngineConfiguration::Marshall(in.ConstantsConfiguration(), out); - io::BiogearsEngineConfiguration::Marshall(in.DrugsConfiguration(), out); - io::BiogearsEngineConfiguration::Marshall(in.EnergyConfiguration(), out); - io::BiogearsEngineConfiguration::Marshall(in.EnvironmentConfiguration(), out); - io::BiogearsEngineConfiguration::Marshall(in.GastrointestinalConfiguration(), out); - io::BiogearsEngineConfiguration::Marshall(in.NervousConfiguration(), out); - io::BiogearsEngineConfiguration::Marshall(in.RenalConfiguration(), out); - io::BiogearsEngineConfiguration::Marshall(in.RespiratoryConfiguration(), out); - io::BiogearsEngineConfiguration::Marshall(in.TissueConfiguration(), out); + io::BiogearsEngineConfiguration::UnMarshall(in.BloodChemistryConfiguration(), out); + io::BiogearsEngineConfiguration::UnMarshall(in.CardiovascularConfiguration(), out); + io::BiogearsEngineConfiguration::UnMarshall(in.CircuitConfiguration(), out); + io::BiogearsEngineConfiguration::UnMarshall(in.ConstantsConfiguration(), out); + io::BiogearsEngineConfiguration::UnMarshall(in.DrugsConfiguration(), out); + io::BiogearsEngineConfiguration::UnMarshall(in.EnergyConfiguration(), out); + io::BiogearsEngineConfiguration::UnMarshall(in.EnvironmentConfiguration(), out); + io::BiogearsEngineConfiguration::UnMarshall(in.GastrointestinalConfiguration(), out); + io::BiogearsEngineConfiguration::UnMarshall(in.NervousConfiguration(), out); + io::BiogearsEngineConfiguration::UnMarshall(in.RenalConfiguration(), out); + io::BiogearsEngineConfiguration::UnMarshall(in.RespiratoryConfiguration(), out); + io::BiogearsEngineConfiguration::UnMarshall(in.TissueConfiguration(), out); } - void BiogearsEngineConfiguration::BiogearsEngineConfiguration::UnMarshall(const BioGearsConfiguration& in, CDM::BioGearsConfigurationData& out) + void BiogearsEngineConfiguration::BiogearsEngineConfiguration::Marshall(const BioGearsConfiguration& in, CDM::BioGearsConfigurationData& out) { - io::EngineConfiguration::UnMarshall(in, out); + io::EngineConfiguration::Marshall(in, out); - io::BiogearsEngineConfiguration::UnMarshall(in, out.BloodChemistryConfiguration()); - io::BiogearsEngineConfiguration::UnMarshall(in, out.CardiovascularConfiguration()); - io::BiogearsEngineConfiguration::UnMarshall(in, out.CircuitConfiguration()); - io::BiogearsEngineConfiguration::UnMarshall(in, out.ConstantsConfiguration()); - io::BiogearsEngineConfiguration::UnMarshall(in, out.DrugsConfiguration()); - io::BiogearsEngineConfiguration::UnMarshall(in, out.EnergyConfiguration()); - io::BiogearsEngineConfiguration::UnMarshall(in, out.EnvironmentConfiguration()); - io::BiogearsEngineConfiguration::UnMarshall(in, out.GastrointestinalConfiguration()); - io::BiogearsEngineConfiguration::UnMarshall(in, out.NervousConfiguration()); - io::BiogearsEngineConfiguration::UnMarshall(in, out.RenalConfiguration()); - io::BiogearsEngineConfiguration::UnMarshall(in, out.RespiratoryConfiguration()); - io::BiogearsEngineConfiguration::UnMarshall(in, out.TissueConfiguration()); + io::BiogearsEngineConfiguration::Marshall(in, out.BloodChemistryConfiguration()); + io::BiogearsEngineConfiguration::Marshall(in, out.CardiovascularConfiguration()); + io::BiogearsEngineConfiguration::Marshall(in, out.CircuitConfiguration()); + io::BiogearsEngineConfiguration::Marshall(in, out.ConstantsConfiguration()); + io::BiogearsEngineConfiguration::Marshall(in, out.DrugsConfiguration()); + io::BiogearsEngineConfiguration::Marshall(in, out.EnergyConfiguration()); + io::BiogearsEngineConfiguration::Marshall(in, out.EnvironmentConfiguration()); + io::BiogearsEngineConfiguration::Marshall(in, out.GastrointestinalConfiguration()); + io::BiogearsEngineConfiguration::Marshall(in, out.NervousConfiguration()); + io::BiogearsEngineConfiguration::Marshall(in, out.RenalConfiguration()); + io::BiogearsEngineConfiguration::Marshall(in, out.RespiratoryConfiguration()); + io::BiogearsEngineConfiguration::Marshall(in, out.TissueConfiguration()); } } } \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/io/biogears/BioGearsConfiguration.h b/projects/biogears/libBiogears/src/io/biogears/BioGearsConfiguration.h index 6913ba9a9..4aaf6916b 100644 --- a/projects/biogears/libBiogears/src/io/biogears/BioGearsConfiguration.h +++ b/projects/biogears/libBiogears/src/io/biogears/BioGearsConfiguration.h @@ -18,15 +18,22 @@ specific language governing permissions and limitations under the License. #include -#define CDM_BIOGEARS_ENGINE_CONFIGURATION_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_BIOGEARS_ENGINE_CONFIGURATION_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ out.func(std::make_unique::type>()); \ - io::BiogearsEngineConfiguration::UnMarshall(*in.m_##func, out.func()); \ + io::BiogearsEngineConfiguration::Marshall(*in.m_##func, out.func()); \ } -#define CDM_OPTIONAL_BIOGEARS_ENGINE_CONFIGURATION_UNMARSHAL_HELPER(in, out, func) \ - if (in.m_##func) { \ - io::BiogearsEngineConfiguration::UnMarshall(*in.m_##func, out.func()); \ +#define CDM_OPTIONAL_BIOGEARS_ENGINE_CONFIGURATION_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func) { \ + io::BiogearsEngineConfiguration::Marshall(*in.m_##func, out.func()); \ + } + +#define CDM_BIOGEARS_ENGINE_CONFIGURATION_COPY(type, in, out) \ + { \ + CDM::type##Data middle; \ + io::BiogearsEngineConfiguration::Marshall(in, middle); \ + io::BiogearsEngineConfiguration::UnMarshall(middle, out); \ } namespace biogears { @@ -37,65 +44,65 @@ namespace io { public: // template option template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); // class BloodChemistryConfiguration - static void Marshall(const CDM::BloodChemistryConfigurationData& in, BioGearsConfiguration& out); - static void UnMarshall(const BioGearsConfiguration& in, CDM::BloodChemistryConfigurationData& out); + static void UnMarshall(const CDM::BloodChemistryConfigurationData& in, BioGearsConfiguration& out); + static void Marshall(const BioGearsConfiguration& in, CDM::BloodChemistryConfigurationData& out); // class CardiovascularConfiguration - static void Marshall(const CDM::CardiovascularConfigurationData& in, BioGearsConfiguration& out); - static void UnMarshall(const BioGearsConfiguration& in, CDM::CardiovascularConfigurationData& out); + static void UnMarshall(const CDM::CardiovascularConfigurationData& in, BioGearsConfiguration& out); + static void Marshall(const BioGearsConfiguration& in, CDM::CardiovascularConfigurationData& out); // class CircuitConfiguration - static void Marshall(const CDM::CircuitConfigurationData& in, BioGearsConfiguration& out); - static void UnMarshall(const BioGearsConfiguration& in, CDM::CircuitConfigurationData& out); + static void UnMarshall(const CDM::CircuitConfigurationData& in, BioGearsConfiguration& out); + static void Marshall(const BioGearsConfiguration& in, CDM::CircuitConfigurationData& out); // class ConstantCOnfiguration - static void Marshall(const CDM::ConstantsConfigurationData& in, BioGearsConfiguration& out); - static void UnMarshall(const BioGearsConfiguration& in, CDM::ConstantsConfigurationData& out); + static void UnMarshall(const CDM::ConstantsConfigurationData& in, BioGearsConfiguration& out); + static void Marshall(const BioGearsConfiguration& in, CDM::ConstantsConfigurationData& out); // class DrugsConfiguration - static void Marshall(const CDM::DrugsConfigurationData& in, BioGearsConfiguration& out); - static void UnMarshall(const BioGearsConfiguration& in, CDM::DrugsConfigurationData& out); + static void UnMarshall(const CDM::DrugsConfigurationData& in, BioGearsConfiguration& out); + static void Marshall(const BioGearsConfiguration& in, CDM::DrugsConfigurationData& out); // class EnergyConfiguration - static void Marshall(const CDM::EnergyConfigurationData& in, BioGearsConfiguration& out); - static void UnMarshall(const BioGearsConfiguration& in, CDM::EnergyConfigurationData& out); + static void UnMarshall(const CDM::EnergyConfigurationData& in, BioGearsConfiguration& out); + static void Marshall(const BioGearsConfiguration& in, CDM::EnergyConfigurationData& out); // class EnvironmentConfiguration - static void Marshall(const CDM::EnvironmentConfigurationData& in, BioGearsConfiguration& out); - static void UnMarshall(const BioGearsConfiguration& in, CDM::EnvironmentConfigurationData& out); + static void UnMarshall(const CDM::EnvironmentConfigurationData& in, BioGearsConfiguration& out); + static void Marshall(const BioGearsConfiguration& in, CDM::EnvironmentConfigurationData& out); // class GastrointestinalConfiguratio - static void Marshall(const CDM::GastrointestinalConfigurationData& in, BioGearsConfiguration& out); - static void UnMarshall(const BioGearsConfiguration& in, CDM::GastrointestinalConfigurationData& out); + static void UnMarshall(const CDM::GastrointestinalConfigurationData& in, BioGearsConfiguration& out); + static void Marshall(const BioGearsConfiguration& in, CDM::GastrointestinalConfigurationData& out); // class BioGearsConfiguration - static void Marshall(const CDM::NervousConfigurationData& in, BioGearsConfiguration& out); - static void UnMarshall(const BioGearsConfiguration& in, CDM::NervousConfigurationData& out); + static void UnMarshall(const CDM::NervousConfigurationData& in, BioGearsConfiguration& out); + static void Marshall(const BioGearsConfiguration& in, CDM::NervousConfigurationData& out); // class RenalConfiguration - static void Marshall(const CDM::RenalConfigurationData& in, BioGearsConfiguration& out); - static void UnMarshall(const BioGearsConfiguration& in, CDM::RenalConfigurationData& out); + static void UnMarshall(const CDM::RenalConfigurationData& in, BioGearsConfiguration& out); + static void Marshall(const BioGearsConfiguration& in, CDM::RenalConfigurationData& out); // class RespiratoryConfiguration - static void Marshall(const CDM::RespiratoryConfigurationData& in, BioGearsConfiguration& out); - static void UnMarshall(const BioGearsConfiguration& in, CDM::RespiratoryConfigurationData& out); + static void UnMarshall(const CDM::RespiratoryConfigurationData& in, BioGearsConfiguration& out); + static void Marshall(const BioGearsConfiguration& in, CDM::RespiratoryConfigurationData& out); // class TissueConfiguration - static void Marshall(const CDM::TissueConfigurationData& in, BioGearsConfiguration& out); - static void UnMarshall(const BioGearsConfiguration& in, CDM::TissueConfigurationData& out); + static void UnMarshall(const CDM::TissueConfigurationData& in, BioGearsConfiguration& out); + static void Marshall(const BioGearsConfiguration& in, CDM::TissueConfigurationData& out); // class BioGearsConfiguration - static void Marshall(const CDM::BioGearsConfigurationData& in, BioGearsConfiguration& out); - static void UnMarshall(const BioGearsConfiguration& in, CDM::BioGearsConfigurationData& out); + static void UnMarshall(const CDM::BioGearsConfigurationData& in, BioGearsConfiguration& out); + static void Marshall(const BioGearsConfiguration& in, CDM::BioGearsConfigurationData& out); }; //---------------------------------------------------------------------------------- template - void BiogearsEngineConfiguration::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + void BiogearsEngineConfiguration::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) { - if (!option_in.present()) { - out.Clear(); + if (!option_in.present() && !out.m_Merge) { + out.Invalidate(); } else { - Marshall(option_in.get(), out); + UnMarshall(option_in.get(), out); } } //---------------------------------------------------------------------------------- template - void BiogearsEngineConfiguration::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void BiogearsEngineConfiguration::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); + Marshall(in, *item); option_out.set(*item); } } // Namespace IO diff --git a/projects/biogears/libBiogears/src/io/biogears/BioGearsEnvironment.cpp b/projects/biogears/libBiogears/src/io/biogears/BioGearsEnvironment.cpp index b4a044577..498382e6f 100644 --- a/projects/biogears/libBiogears/src/io/biogears/BioGearsEnvironment.cpp +++ b/projects/biogears/libBiogears/src/io/biogears/BioGearsEnvironment.cpp @@ -1,5 +1,8 @@ #include "BioGearsEnvironment.h" +#include + +#include #include #include @@ -8,19 +11,41 @@ namespace biogears { namespace io { + std::unique_ptr BiogearsEnvironment::factory(CDM::SystemData const* systemData, biogears::BioGears& bgData) + { + if (auto environmentData = dynamic_cast(systemData)) { + auto environment = biogears::Environment::make_unique(bgData); + UnMarshall(*environmentData, *environment); + return environment; + } + + + throw biogears::CommonDataModelException("BioGearsPhysiology:Factory - Unsupported BioGearsSystem Received."); + } + + std::unique_ptr BiogearsEnvironment::factory(const SESystem* system) + { + if (auto biogearsSystem = dynamic_cast(system)) { + auto systemData = std::make_unique(); + Marshall(*biogearsSystem, *systemData); + return systemData; + } + + throw biogears::CommonDataModelException("BioGearsPhysiology:Factory - Unsupported BioGearsSystemData Received."); + } // class SEAnesthesiaMachine - void BiogearsEnvironment::Marshall(const CDM::BioGearsEnvironmentData& in, biogears::Environment& out) + void BiogearsEnvironment::UnMarshall(const CDM::BioGearsEnvironmentData& in, biogears::Environment& out) { - io::Environment::Marshall(in, out); + io::Environment::UnMarshall(in, out); out.BioGearsSystem::LoadState(); out.m_PatientEquivalentDiameter_m = in.PatientEquivalentDiameter_m(); out.StateChange(); } - void BiogearsEnvironment::UnMarshall(const biogears::Environment& in, CDM::BioGearsEnvironmentData& out) + void BiogearsEnvironment::Marshall(const biogears::Environment& in, CDM::BioGearsEnvironmentData& out) { - io::Environment::UnMarshall(in, out); + io::Environment::Marshall(in, out); out.PatientEquivalentDiameter_m(in.m_PatientEquivalentDiameter_m); } } diff --git a/projects/biogears/libBiogears/src/io/biogears/BioGearsEnvironment.h b/projects/biogears/libBiogears/src/io/biogears/BioGearsEnvironment.h index 52faa9911..0c491fb63 100644 --- a/projects/biogears/libBiogears/src/io/biogears/BioGearsEnvironment.h +++ b/projects/biogears/libBiogears/src/io/biogears/BioGearsEnvironment.h @@ -18,48 +18,55 @@ specific language governing permissions and limitations under the License. #include -#define CDM_BIOGEARS_ENVIRONMENT_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_BIOGEARS_ENVIRONMENT_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ out.func(std::make_unique::type>()); \ - io::BiogearsEnvironment::UnMarshall(*in.m_##func, out.func()); \ + io::BiogearsEnvironment::Marshall(*in.m_##func, out.func()); \ } -#define CDM_OPTIONAL_BIOGEARS_ENVIRONMENT_UNMARSHAL_HELPER(in, out, func) \ - if (in.m_##func) { \ - io::BiogearsEnvironment::UnMarshall(*in.m_##func, out.func()); \ +#define CDM_OPTIONAL_BIOGEARS_ENVIRONMENT_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func) { \ + io::BiogearsEnvironment::Marshall(*in.m_##func, out.func()); \ } namespace biogears { class Environment; +class SESystem; +class BioGears; namespace io { class BIOGEARS_PRIVATE_API BiogearsEnvironment { public: + // class Factories; + static std::unique_ptr factory(CDM::SystemData const* systemData, biogears::BioGears& bgData); + + static std::unique_ptr factory(const SESystem* data); + // template option template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); // class SEAnesthesiaMachine - static void Marshall(const CDM::BioGearsEnvironmentData& in, biogears::Environment& out); - static void UnMarshall(const biogears::Environment& in, CDM::BioGearsEnvironmentData& out); + static void UnMarshall(const CDM::BioGearsEnvironmentData& in, biogears::Environment& out); + static void Marshall(const biogears::Environment& in, CDM::BioGearsEnvironmentData& out); }; //---------------------------------------------------------------------------------- template - void BiogearsEnvironment::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + void BiogearsEnvironment::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) { if (!option_in.present()) { - out.Clear(); + out.Invalidate(); } else { - Marshall(option_in.get(), out); + UnMarshall(option_in.get(), out); } } //---------------------------------------------------------------------------------- template - void BiogearsEnvironment::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void BiogearsEnvironment::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); + Marshall(in, *item); option_out.set(*item); } } // Namespace IO diff --git a/projects/biogears/libBiogears/src/io/biogears/BioGearsEquipment.cpp b/projects/biogears/libBiogears/src/io/biogears/BioGearsEquipment.cpp index 8a3ad87e0..994160229 100644 --- a/projects/biogears/libBiogears/src/io/biogears/BioGearsEquipment.cpp +++ b/projects/biogears/libBiogears/src/io/biogears/BioGearsEquipment.cpp @@ -13,65 +13,138 @@ namespace biogears { namespace io { + std::unique_ptr BiogearsEquipment::factory(CDM::SystemData const* systemData, biogears::BioGears& bgData) + { + if (auto environmentData = dynamic_cast(systemData)) { + auto environment = biogears::AnesthesiaMachine::make_unique(bgData); + UnMarshall(*environmentData, *environment); + return environment; + } + + if (auto environmentData = dynamic_cast(systemData)) { + auto environment = biogears::ECG::make_unique(bgData); + UnMarshall(*environmentData, *environment); + return environment; + } + + if (auto environmentData = dynamic_cast(systemData)) { + auto environment = biogears::Inhaler::make_unique(bgData); + UnMarshall(*environmentData, *environment); + return environment; + } + + throw biogears::CommonDataModelException("BioGearsPhysiology:Factory - Unsupported BioGearsSystem Received."); + } + + std::unique_ptr BiogearsEquipment::factory(const SESystem* system) + { + if (auto biogearsSystem = dynamic_cast(system)) { + auto systemData = std::make_unique(); + Marshall(*biogearsSystem, *systemData); + return systemData; + } + + if (auto biogearsSystem = dynamic_cast(system)) { + auto systemData = std::make_unique(); + Marshall(*biogearsSystem, *systemData); + return systemData; + } + + if (auto biogearsSystem = dynamic_cast(system)) { + auto systemData = std::make_unique(); + Marshall(*biogearsSystem, *systemData); + return systemData; + } + + throw biogears::CommonDataModelException("BioGearsPhysiology:Factory - Unsupported BioGearsSystemData Received."); + } + // class SEAnesthesiaMachine - void BiogearsEquipment::Marshall(const CDM::BioGearsAnesthesiaMachineData& in, AnesthesiaMachine& out) + void BiogearsEquipment::UnMarshall(const CDM::BioGearsAnesthesiaMachineData& in, AnesthesiaMachine& out) { - io::Anesthesia::Marshall(in, out); + io::Anesthesia::UnMarshall(in, out); out.BioGearsSystem::LoadState(); - out.m_inhaling = in.Inhaling(); - io::Property::Marshall(in.CurrentBreathingCycleTime(), out.m_currentbreathingCycleTime); - io::Property::Marshall(in.InspirationTime(), out.m_inspirationTime); - io::Property::Marshall(in.OxygenInletVolumeFraction(), out.m_O2InletVolumeFraction); - io::Property::Marshall(in.TotalBreathingCycleTime(), out.m_totalBreathingCycleTime); + out.m_Inhaling = in.Inhaling(); + io::Property::UnMarshall(in.CurrentBreathingCycleTime(), out.m_CurrentBreathingCycleTime); + io::Property::UnMarshall(in.InspirationTime(), out.m_InspirationTime); + io::Property::UnMarshall(in.OxygenInletVolumeFraction(), out.m_OxygenInletVolumeFraction); + io::Property::UnMarshall(in.TotalBreathingCycleTime(), out.m_TotalBreathingCycleTime); } + //----------------------------------------------------------------------------- - void BiogearsEquipment::UnMarshall(const AnesthesiaMachine& in, CDM::BioGearsAnesthesiaMachineData& out) + void BiogearsEquipment::Marshall(const AnesthesiaMachine& in, CDM::BioGearsAnesthesiaMachineData& out) { - io::Anesthesia::UnMarshall(in, out); + io::Anesthesia::Marshall(in, out); - out.Inhaling(in.m_inhaling); + out.Inhaling(in.m_Inhaling); + + if (in.m_CurrentBreathingCycleTime.IsValid()) { + out.CurrentBreathingCycleTime(std::make_unique::type>()); + io::Property::Marshall(in.m_CurrentBreathingCycleTime, out.CurrentBreathingCycleTime()); + } + + if (in.m_InspirationTime.IsValid()) { + out.InspirationTime(std::make_unique::type>()); + io::Property::Marshall(in.m_InspirationTime, out.InspirationTime()); + } + + if (in.m_OxygenInletVolumeFraction.IsValid()) { + out.OxygenInletVolumeFraction(std::make_unique::type>()); + io::Property::Marshall(in.m_OxygenInletVolumeFraction, out.OxygenInletVolumeFraction()); + } + + if (in.m_TotalBreathingCycleTime.IsValid()) { + out.TotalBreathingCycleTime(std::make_unique::type>()); + io::Property::Marshall(in.m_TotalBreathingCycleTime, out.TotalBreathingCycleTime()); + } + }; - io::Property::UnMarshall(in.m_currentbreathingCycleTime, out.CurrentBreathingCycleTime()); - io::Property::UnMarshall(in.m_inspirationTime, out.InspirationTime()); - io::Property::UnMarshall(in.m_O2InletVolumeFraction, out.OxygenInletVolumeFraction()); - io::Property::UnMarshall(in.m_totalBreathingCycleTime, out.TotalBreathingCycleTime()); - } //----------------------------------------------------------------------------- // class SEAnesthesiaMachineChamber - void BiogearsEquipment::Marshall(const CDM::BioGearsElectroCardioGramData& in, ECG& out) + void BiogearsEquipment::UnMarshall(const CDM::BioGearsElectroCardioGramData& in, ECG& out) { - io::ElectroCardioGram::Marshall(in, out); + io::ElectroCardioGram::UnMarshall(in, out); out.BioGearsSystem::LoadState(); - io::Property::Marshall(in.HeartRythmTime(), out.m_HeartRhythmTime); - io::Property::Marshall(in.HeartRythmPeriod(), out.m_HeartRhythmPeriod); - io::ElectroCardioGram::Marshall(in.Waveforms(), out.m_Waveforms); + io::Property::UnMarshall(in.HeartRhythmTime(), out.m_HeartRhythmTime); + io::Property::UnMarshall(in.HeartRhythmPeriod(), out.m_HeartRhythmPeriod); + io::ElectroCardioGram::UnMarshall(in.Waveforms(), out.m_Waveforms); out.m_Waveforms.SetLeadElectricPotential(3, out.GetLead3ElectricPotential()); } //----------------------------------------------------------------------------- - void BiogearsEquipment::UnMarshall(const ECG& in, CDM::BioGearsElectroCardioGramData& out) + void BiogearsEquipment::Marshall(const ECG& in, CDM::BioGearsElectroCardioGramData& out) { - io::ElectroCardioGram::UnMarshall(in, out); + io::ElectroCardioGram::Marshall(in, out); + + if ( in.m_HeartRhythmTime.IsValid()) { + out.HeartRhythmTime(std::make_unique::type>()); + io::Property::Marshall(in.m_HeartRhythmTime, out.HeartRhythmTime()); + }; + if (in.m_HeartRhythmPeriod.IsValid()) { + out.HeartRhythmPeriod(std::make_unique::type>()); + io::Property::Marshall(in.m_HeartRhythmPeriod, out.HeartRhythmPeriod()); + }; + + out.Waveforms(std::make_unique::type>()); + io::ElectroCardioGram::Marshall(in.m_Waveforms, out.Waveforms()); + - io::Property::UnMarshall(in.m_HeartRhythmTime, out.HeartRythmTime()); - io::Property::UnMarshall(in.m_HeartRhythmPeriod, out.HeartRythmPeriod()); - io::ElectroCardioGram::UnMarshall(in.m_Waveforms, out.Waveforms()); } //----------------------------------------------------------------------------- // class SEAnesthesiaMachineOxygenBottle - void BiogearsEquipment::Marshall(const CDM::BioGearsInhalerData& in, biogears::Inhaler& out) + void BiogearsEquipment::UnMarshall(const CDM::BioGearsInhalerData& in, biogears::Inhaler& out) { - io::Inhaler::Marshall(in,out); + io::Inhaler::UnMarshall(in, out); out.BioGearsSystem::LoadState(); } //----------------------------------------------------------------------------- - void BiogearsEquipment::UnMarshall(const biogears::Inhaler& in, CDM::BioGearsInhalerData& out) + void BiogearsEquipment::Marshall(const biogears::Inhaler& in, CDM::BioGearsInhalerData& out) { - io::Inhaler::UnMarshall(in, out); + io::Inhaler::Marshall(in, out); } //----------------------------------------------------------------------------- } diff --git a/projects/biogears/libBiogears/src/io/biogears/BioGearsEquipment.h b/projects/biogears/libBiogears/src/io/biogears/BioGearsEquipment.h index 05b5f02f4..996d250c3 100644 --- a/projects/biogears/libBiogears/src/io/biogears/BioGearsEquipment.h +++ b/projects/biogears/libBiogears/src/io/biogears/BioGearsEquipment.h @@ -18,56 +18,70 @@ specific language governing permissions and limitations under the License. #include -#define CDM_BIOGEARS_EQUIPMENT_UNMARSHAL_HELPER(xsd, func) \ - if (m_##func) { \ - xsd.func(std::make_unique::type>()); \ - io::BiogearsEquipment::UnMarshall(*m_##func, xsd.func()); \ - } +// Question: To Serialize Invalid units or not to Serialize? +// TO Throw an exception when a member is invalid? +#define CDM_BIOGEARS_EQUIPMENT_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func && in.m_##func->IsValid()) { \ + out.func(std::make_unique::type>()); \ + io::BiogearsEquipment::Marshall(*in.m_##func, out.func()); \ + } /* else if (in.m_##func) { \ + throw biogears::CommonDataModelException("func is InValid and cannot be Unmarshalled"); \ + }*/ -#define CDM_OPTIONAL_BIOGEARS_EQUIPMENT_UNMARSHAL_HELPER(in, out, func) \ - if (in.m_##func) { \ - io::BiogearsEquipment::UnMarshall(*in.m_##func, out.func()); \ - } +#define CDM_OPTIONAL_BIOGEARS_EQUIPMENT_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func && in.m_##func->IsValid()) { \ + io::BiogearsEquipment::Marshall(*in.m_##func, out.func()); \ + } /*else if (in.m_##func) { \ + throw biogears::CommonDataModelException("func is InValid and cannot be Unmarshalled"); \ + }*/ namespace biogears { class AnesthesiaMachine; class ECG; class Inhaler; +class SESystem; +class BioGears; +class SESubstanceManager; namespace io { class BIOGEARS_PRIVATE_API BiogearsEquipment { public: + // class Factories; + static std::unique_ptr factory(CDM::SystemData const* systemData, biogears::BioGears& bgData); + + static std::unique_ptr factory(const SESystem* data); + // template option template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); // class SEAnesthesiaMachine - static void Marshall(const CDM::BioGearsAnesthesiaMachineData& in, AnesthesiaMachine& out); - static void UnMarshall(const AnesthesiaMachine& in, CDM::BioGearsAnesthesiaMachineData& out); + static void UnMarshall(const CDM::BioGearsAnesthesiaMachineData& in, AnesthesiaMachine& out); + static void Marshall(const AnesthesiaMachine& in, CDM::BioGearsAnesthesiaMachineData& out); // class SEAnesthesiaMachineChamber - static void Marshall(const CDM::BioGearsElectroCardioGramData& in, ECG& out); - static void UnMarshall(const ECG& in, CDM::BioGearsElectroCardioGramData& out); + static void UnMarshall(const CDM::BioGearsElectroCardioGramData& in, ECG& out); + static void Marshall(const ECG& in, CDM::BioGearsElectroCardioGramData& out); // class SEAnesthesiaMachineOxygenBottle - static void Marshall(const CDM::BioGearsInhalerData& in, biogears::Inhaler& out); - static void UnMarshall(const biogears::Inhaler& in, CDM::BioGearsInhalerData& out); + static void UnMarshall(const CDM::BioGearsInhalerData& in, biogears::Inhaler& out); + static void Marshall(const biogears::Inhaler& in, CDM::BioGearsInhalerData& out); }; //---------------------------------------------------------------------------------- template - void BiogearsEquipment::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + void BiogearsEquipment::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) { if (!option_in.present()) { - out.Clear(); + out.Invalidate(); } else { - Marshall(option_in.get(), out); + UnMarshall(option_in.get(), out); } } //---------------------------------------------------------------------------------- template - void BiogearsEquipment::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void BiogearsEquipment::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); + Marshall(in, *item); option_out.set(*item); } } // Namespace IO diff --git a/projects/biogears/libBiogears/src/io/biogears/BioGearsPhysiology.cpp b/projects/biogears/libBiogears/src/io/biogears/BioGearsPhysiology.cpp index 3a90314c0..0b385c7b3 100644 --- a/projects/biogears/libBiogears/src/io/biogears/BioGearsPhysiology.cpp +++ b/projects/biogears/libBiogears/src/io/biogears/BioGearsPhysiology.cpp @@ -1,16 +1,18 @@ #include "BioGearsPhysiology.h" +#include #include -#include "../cdm/PatientActions.h" -#include "../cdm/Property.h" -#include "../cdm/System.h" +#include "io/cdm/PatientActions.h" +#include "io/cdm/Physiology.h" +#include "io/cdm/Property.h" +#include "io/cdm/System.h" #include #include #include - +#include #include #include #include @@ -26,16 +28,168 @@ #include #include + namespace biogears { namespace io { + std::unique_ptr BiogearsPhysiology::factory(CDM::SystemData const* systemData, biogears::BioGears& bgData) + { + if (auto bloodChemestryData = dynamic_cast(systemData)) { + auto bloodChemestry = BloodChemistry::make_unique(bgData); + UnMarshall(*bloodChemestryData, bgData.GetSubstances(), *bloodChemestry); + return bloodChemestry; + } + if (auto biogearsSystemData + = dynamic_cast(systemData)) { + auto system = Cardiovascular::make_unique(bgData); + UnMarshall(*biogearsSystemData, bgData.GetSubstances(), *system); + return system; + } + + if (auto biogearsSystemData + = dynamic_cast(systemData)) { + auto system = Drugs::make_unique(bgData); + UnMarshall(*biogearsSystemData, bgData.GetSubstances(), *system); + return system; + } + + if (auto biogearsSystemData + = dynamic_cast(systemData)) { + auto system = Endocrine::make_unique(bgData); + UnMarshall(*biogearsSystemData, bgData.GetSubstances(), *system); + return system; + } + + if (auto biogearsSystemData + = dynamic_cast(systemData)) { + auto system = Energy::make_unique(bgData); + UnMarshall(*biogearsSystemData, bgData.GetSubstances(), *system); + return system; + } + + if (auto biogearsSystemData + = dynamic_cast(systemData)) { + auto system = Gastrointestinal::make_unique(bgData); + UnMarshall(*biogearsSystemData, bgData.GetSubstances(), *system); + return system; + } + + if (auto biogearsSystemData + = dynamic_cast(systemData)) { + auto system = Hepatic::make_unique(bgData); + UnMarshall(*biogearsSystemData, bgData.GetSubstances(), *system); + return system; + } + + if (auto biogearsSystemData + = dynamic_cast(systemData)) { + auto system = Nervous::make_unique(bgData); + UnMarshall(*biogearsSystemData, bgData.GetSubstances(), *system); + return system; + } + + if (auto biogearsSystemData + = dynamic_cast(systemData)) { + auto system = Renal::make_unique(bgData); + UnMarshall(*biogearsSystemData, bgData.GetSubstances(), *system); + return system; + } + + if (auto biogearsSystemData + = dynamic_cast(systemData)) { + auto system = Respiratory::make_unique(bgData); + UnMarshall(*biogearsSystemData, bgData.GetSubstances(), *system); + return system; + } + + if (auto biogearsSystemData + = dynamic_cast(systemData)) { + auto system = Tissue::make_unique(bgData); + UnMarshall(*biogearsSystemData, bgData.GetSubstances(), *system); + return system; + } + + throw biogears::CommonDataModelException("BioGearsPhysiology:Factory - Unsupported BioGearsSystem Received."); + } + + std::unique_ptr BiogearsPhysiology::factory(const SESystem* system) + { + if (auto biogearsSystem = dynamic_cast(system)) { + auto systemData = std::make_unique(); + Marshall(*biogearsSystem, *systemData); + return systemData; + } + + if (auto biogearsSystem = dynamic_cast(system)) { + auto systemData = std::make_unique(); + Marshall(*biogearsSystem, *systemData); + return systemData; + } + + if (auto biogearsSystem = dynamic_cast(system)) { + auto systemData = std::make_unique(); + Marshall(*biogearsSystem, *systemData); + return systemData; + } + + if (auto biogearsSystem = dynamic_cast(system)) { + auto systemData = std::make_unique(); + Marshall(*biogearsSystem, *systemData); + return systemData; + } + + if (auto biogearsSystem = dynamic_cast(system)) { + auto systemData = std::make_unique(); + Marshall(*biogearsSystem, *systemData); + return systemData; + } + + if (auto biogearsSystem = dynamic_cast(system)) { + auto systemData = std::make_unique(); + Marshall(*biogearsSystem, *systemData); + return systemData; + } + + if (auto biogearsSystem = dynamic_cast(system)) { + auto systemData = std::make_unique(); + Marshall(*biogearsSystem, *systemData); + return systemData; + } + + if (auto biogearsSystem = dynamic_cast(system)) { + auto systemData = std::make_unique(); + Marshall(*biogearsSystem, *systemData); + return systemData; + } + + if (auto biogearsSystem = dynamic_cast(system)) { + auto systemData = std::make_unique(); + Marshall(*biogearsSystem, *systemData); + return systemData; + } + + if (auto biogearsSystem = dynamic_cast(system)) { + auto systemData = std::make_unique(); + Marshall(*biogearsSystem, *systemData); + return systemData; + } + + if (auto biogearsSystem = dynamic_cast(system)) { + auto systemData = std::make_unique(); + Marshall(*biogearsSystem, *systemData); + return systemData; + } + + throw biogears::CommonDataModelException("BioGearsPhysiology:Factory - Unsupported BioGearsSystemData Received."); + } + // class BloodChemistry - void BiogearsPhysiology::Marshall(const CDM::BioGearsBloodChemistrySystemData& in, const SESubstanceManager& substances, BloodChemistry& out) + void BiogearsPhysiology::UnMarshall(const CDM::BioGearsBloodChemistrySystemData& in, const SESubstanceManager& substances, BloodChemistry& out) { - out.Clear(); - io::System::Marshall(in, out); + out.Invalidate(); + io::Physiology::UnMarshall(in, out); - io::Property::Marshall(in.ArterialOxygenPressure(), out.GetArterialOxygenPressure()); - io::Property::Marshall(in.ArterialCarbonDioxidePressure(), out.GetArterialCarbonDioxidePressure()); + io::Property::UnMarshall(in.ArterialOxygenAverage_mmHg(), out.m_ArterialOxygenAverage_mmHg); + io::Property::UnMarshall(in.ArterialCarbonDioxideAverage_mmHg(), out.m_ArterialCarbonDioxideAverage_mmHg); out.m_RhFactorMismatch_ct = in.RhFactorMismatch_ct(); out.m_RhTransfusionReactionVolume_mL = in.RhTransfusionReactionVolume_mL(); @@ -62,16 +216,12 @@ namespace io { out.BioGearsSystem::LoadState(); } - void BiogearsPhysiology::UnMarshall(const BloodChemistry& in, CDM::BioGearsBloodChemistrySystemData& out) + void BiogearsPhysiology::Marshall(const BloodChemistry& in, CDM::BioGearsBloodChemistrySystemData& out) { - io::System::UnMarshall(in, out); + io::Physiology::Marshall(in, out); - if (in.m_ArterialOxygenPressure != nullptr) { - io::Property::UnMarshall(*in.m_ArterialOxygenPressure, out.ArterialOxygenPressure()); - } - if (in.m_ArterialCarbonDioxidePressure != nullptr) { - io::Property::UnMarshall(*in.m_ArterialCarbonDioxidePressure, out.ArterialCarbonDioxidePressure()); - } + CDM_RUNNING_AVERAGE_PTR_MARSHALL_HELPER(in, out, ArterialOxygenAverage_mmHg) + CDM_RUNNING_AVERAGE_PTR_MARSHALL_HELPER(in, out, ArterialCarbonDioxideAverage_mmHg) out.RhFactorMismatch_ct(in.m_RhFactorMismatch_ct); out.RhTransfusionReactionVolume_mL(in.m_RhTransfusionReactionVolume_mL); @@ -97,10 +247,10 @@ namespace io { out.RadiationAbsorbed(in.m_radAbsorbed_Gy); } // class Cardiovascular - void BiogearsPhysiology::Marshall(const CDM::BioGearsCardiovascularSystemData& in, const SESubstanceManager& substances, Cardiovascular& out) + void BiogearsPhysiology::UnMarshall(const CDM::BioGearsCardiovascularSystemData& in, const SESubstanceManager& substances, Cardiovascular& out) { - out.Clear(); - io::System::Marshall(in, out); + out.Invalidate(); + io::Physiology::UnMarshall(in, out); out.m_StartSystole = in.StartSystole(); out.m_HeartFlowDetected = in.HeartFlowDetected(); @@ -135,20 +285,20 @@ namespace io { out.m_LastCardiacCycleMeanArterialCO2PartialPressure_mmHg = in.LastCardiacCycleMeanArterialCO2PartialPressure_mmHg(); out.m_CardiacCycleStrokeVolume_mL = in.CardiacCycleStrokeVolume_mL(); - io::Property::Marshall(in.CardiacCycleArterialPressure_mmHg(), out.m_CardiacCycleArterialPressure_mmHg); - io::Property::Marshall(in.CardiacCycleArterialCO2PartialPressure_mmHg(), out.m_CardiacCycleArterialCO2PartialPressure_mmHg); - io::Property::Marshall(in.CardiacCyclePulmonaryCapillariesWedgePressure_mmHg(), out.m_CardiacCyclePulmonaryCapillariesWedgePressure_mmHg); - io::Property::Marshall(in.CardiacCyclePulmonaryCapillariesFlow_mL_Per_s(), out.m_CardiacCyclePulmonaryCapillariesFlow_mL_Per_s); - io::Property::Marshall(in.CardiacCyclePulmonaryShuntFlow_mL_Per_s(), out.m_CardiacCyclePulmonaryShuntFlow_mL_Per_s); - io::Property::Marshall(in.CardiacCyclePulmonaryArteryPressure_mmHg(), out.m_CardiacCyclePulmonaryArteryPressure_mmHg); - io::Property::Marshall(in.CardiacCycleCentralVenousPressure_mmHg(), out.m_CardiacCycleCentralVenousPressure_mmHg); - io::Property::Marshall(in.CardiacCycleSkinFlow_mL_Per_s(), out.m_CardiacCycleSkinFlow_mL_Per_s); + io::Property::UnMarshall(in.CardiacCycleArterialPressure_mmHg(), out.m_CardiacCycleArterialPressure_mmHg); + io::Property::UnMarshall(in.CardiacCycleArterialCO2PartialPressure_mmHg(), out.m_CardiacCycleArterialCO2PartialPressure_mmHg); + io::Property::UnMarshall(in.CardiacCyclePulmonaryCapillariesWedgePressure_mmHg(), out.m_CardiacCyclePulmonaryCapillariesWedgePressure_mmHg); + io::Property::UnMarshall(in.CardiacCyclePulmonaryCapillariesFlow_mL_Per_s(), out.m_CardiacCyclePulmonaryCapillariesFlow_mL_Per_s); + io::Property::UnMarshall(in.CardiacCyclePulmonaryShuntFlow_mL_Per_s(), out.m_CardiacCyclePulmonaryShuntFlow_mL_Per_s); + io::Property::UnMarshall(in.CardiacCyclePulmonaryArteryPressure_mmHg(), out.m_CardiacCyclePulmonaryArteryPressure_mmHg); + io::Property::UnMarshall(in.CardiacCycleCentralVenousPressure_mmHg(), out.m_CardiacCycleCentralVenousPressure_mmHg); + io::Property::UnMarshall(in.CardiacCycleSkinFlow_mL_Per_s(), out.m_CardiacCycleSkinFlow_mL_Per_s); out.BioGearsSystem::LoadState(); } - void BiogearsPhysiology::UnMarshall(const Cardiovascular& in, CDM::BioGearsCardiovascularSystemData& out) + void BiogearsPhysiology::Marshall(const Cardiovascular& in, CDM::BioGearsCardiovascularSystemData& out) { - io::System::UnMarshall(in, out); + io::Physiology::Marshall(in, out); out.StartSystole(in.m_StartSystole); out.HeartFlowDetected(in.m_HeartFlowDetected); @@ -176,21 +326,21 @@ namespace io { out.LastCardiacCycleMeanArterialCO2PartialPressure_mmHg(in.m_LastCardiacCycleMeanArterialCO2PartialPressure_mmHg); out.CardiacCycleStrokeVolume_mL(in.m_CardiacCycleStrokeVolume_mL); - io::Property::UnMarshall(in.m_CardiacCycleArterialPressure_mmHg, out.CardiacCycleArterialPressure_mmHg()); - io::Property::UnMarshall(in.m_CardiacCycleArterialCO2PartialPressure_mmHg, out.CardiacCycleArterialCO2PartialPressure_mmHg()); - io::Property::UnMarshall(in.m_CardiacCyclePulmonaryCapillariesWedgePressure_mmHg, out.CardiacCyclePulmonaryCapillariesWedgePressure_mmHg()); - io::Property::UnMarshall(in.m_CardiacCyclePulmonaryCapillariesFlow_mL_Per_s, out.CardiacCyclePulmonaryCapillariesFlow_mL_Per_s()); - io::Property::UnMarshall(in.m_CardiacCyclePulmonaryShuntFlow_mL_Per_s, out.CardiacCyclePulmonaryShuntFlow_mL_Per_s()); - io::Property::UnMarshall(in.m_CardiacCyclePulmonaryArteryPressure_mmHg, out.CardiacCyclePulmonaryArteryPressure_mmHg()); - io::Property::UnMarshall(in.m_CardiacCycleCentralVenousPressure_mmHg, out.CardiacCycleCentralVenousPressure_mmHg()); - io::Property::UnMarshall(in.m_CardiacCycleSkinFlow_mL_Per_s, out.CardiacCycleSkinFlow_mL_Per_s()); + CDM_RUNNING_AVERAGE_PTR_MARSHALL_HELPER(in, out, CardiacCycleArterialPressure_mmHg) + CDM_RUNNING_AVERAGE_PTR_MARSHALL_HELPER(in, out, CardiacCycleArterialCO2PartialPressure_mmHg) + CDM_RUNNING_AVERAGE_PTR_MARSHALL_HELPER(in, out, CardiacCyclePulmonaryCapillariesWedgePressure_mmHg) + CDM_RUNNING_AVERAGE_PTR_MARSHALL_HELPER(in, out, CardiacCyclePulmonaryCapillariesFlow_mL_Per_s) + CDM_RUNNING_AVERAGE_PTR_MARSHALL_HELPER(in, out, CardiacCyclePulmonaryShuntFlow_mL_Per_s) + CDM_RUNNING_AVERAGE_PTR_MARSHALL_HELPER(in, out, CardiacCyclePulmonaryArteryPressure_mmHg) + CDM_RUNNING_AVERAGE_PTR_MARSHALL_HELPER(in, out, CardiacCycleCentralVenousPressure_mmHg) + CDM_RUNNING_AVERAGE_PTR_MARSHALL_HELPER(in, out, CardiacCycleSkinFlow_mL_Per_s) } - // class Cardiovascular - void BiogearsPhysiology::Marshall(const CDM::BioGearsDrugSystemData& in, const SESubstanceManager& substances, Drugs& out) + // class DrugSystem + void BiogearsPhysiology::UnMarshall(const CDM::BioGearsDrugSystemData& in, const SESubstanceManager& substances, Drugs& out) { - out.Clear(); - io::System::Marshall(in, out); + out.Invalidate(); + io::Physiology::UnMarshall(in, out); out.m_SarinRbcAcetylcholinesteraseComplex_nM = in.SarinRbcAcetylcholinesteraseComplex_nM(); out.m_AgedRbcAcetylcholinesterase_nM = in.AgedRbcAcetylcholinesterase_nM(); @@ -207,7 +357,7 @@ namespace io { } SESubstanceBolusState* bolusState = new SESubstanceBolusState(*sub); out.m_BolusAdministrations[sub] = bolusState; - bolusState->Load(bData); + io::PatientActions::UnMarshall(bData, *bolusState); } for (const CDM::TransmucosalStateData& otData : in.TransmucosalStates()) { @@ -219,7 +369,7 @@ namespace io { } SETransmucosalState* otState = new SETransmucosalState(*sub); out.m_TransmucosalStates[sub] = otState; - otState->Load(otData); + io::PatientActions::UnMarshall(otData, *otState); } for (const CDM::NasalStateData& nData : in.NasalStates()) { @@ -231,14 +381,14 @@ namespace io { } SENasalState* nState = new SENasalState(*sub); out.m_NasalStates[sub] = nState; - nState->Load(nData); + io::PatientActions::UnMarshall(nData, *nState); } out.BioGearsSystem::LoadState(); } - void BiogearsPhysiology::UnMarshall(const Drugs& in, CDM::BioGearsDrugSystemData& out) + void BiogearsPhysiology::Marshall(const Drugs& in, CDM::BioGearsDrugSystemData& out) { - io::System::UnMarshall(in, out); + io::Physiology::Marshall(in, out); out.SarinRbcAcetylcholinesteraseComplex_nM(in.m_SarinRbcAcetylcholinesteraseComplex_nM); out.AgedRbcAcetylcholinesterase_nM(in.m_AgedRbcAcetylcholinesterase_nM); @@ -246,7 +396,7 @@ namespace io { CDM::SubstanceBolusStateData bolus_state; for (auto itr : in.m_BolusAdministrations) { if (itr.second != nullptr) { - io::PatientActions::UnMarshall(*itr.second, bolus_state); + io::PatientActions::Marshall(*itr.second, bolus_state); out.BolusAdministration().push_back(bolus_state); } } @@ -254,7 +404,7 @@ namespace io { CDM::TransmucosalStateData transmucosal_state; for (auto itr : in.m_TransmucosalStates) { if (itr.second != nullptr) { - io::PatientActions::UnMarshall(*itr.second, transmucosal_state); + io::PatientActions::Marshall(*itr.second, transmucosal_state); out.TransmucosalStates().push_back(transmucosal_state); } } @@ -262,46 +412,48 @@ namespace io { CDM::NasalStateData nasal_state; for (auto itr : in.m_NasalStates) { if (itr.second != nullptr) { - io::PatientActions::UnMarshall(*itr.second, nasal_state); + io::PatientActions::Marshall(*itr.second, nasal_state); out.NasalStates().push_back(nasal_state); } } } - // class Cardiovascular - void BiogearsPhysiology::Marshall(const CDM::BioGearsEndocrineSystemData& in, const SESubstanceManager& substances, Endocrine& out) + // class EndocrineSystem + void BiogearsPhysiology::UnMarshall(const CDM::BioGearsEndocrineSystemData& in, const SESubstanceManager& substances, Endocrine& out) { - out.Clear(); - io::System::Marshall(in, out); + out.Invalidate(); + io::Physiology::UnMarshall(in, out); out.BioGearsSystem::LoadState(); } - void BiogearsPhysiology::UnMarshall(const Endocrine& in, CDM::BioGearsEndocrineSystemData& out) + void BiogearsPhysiology::Marshall(const Endocrine& in, CDM::BioGearsEndocrineSystemData& out) { - io::System::UnMarshall(in, out); + io::Physiology::Marshall(in, out); } - // class Cardiovascular - void BiogearsPhysiology::Marshall(const CDM::BioGearsEnergySystemData& in, const SESubstanceManager& substances, Energy& out) + // class EnergySystem + void BiogearsPhysiology::UnMarshall(const CDM::BioGearsEnergySystemData& in, const SESubstanceManager& substances, Energy& out) { - out.Clear(); - io::System::Marshall(in, out); - io::Property::Marshall(in.BloodpH(), out.m_BloodpH); - io::Property::Marshall(in.BicarbonateMolarity_mmol_Per_L(), out.m_BicarbonateMolarity_mmol_Per_L); + out.Invalidate(); + io::Physiology::UnMarshall(in, out); + io::Property::UnMarshall(in.BloodpH(), out.m_BloodpH); + io::Property::UnMarshall(in.BicarbonateMolarity_mmol_Per_L(), out.m_BicarbonateMolarity_mmol_Per_L); out.m_packOn = in.PackOn(); out.m_previousWeightPack_kg = in.PreviousWeightPack_kg(); out.BioGearsSystem::LoadState(); } - void BiogearsPhysiology::UnMarshall(const Energy& in, CDM::BioGearsEnergySystemData& out) + void BiogearsPhysiology::Marshall(const Energy& in, CDM::BioGearsEnergySystemData& out) { - io::System::UnMarshall(in, out); - io::Property::UnMarshall(in.m_BloodpH, out.BloodpH()); - io::Property::UnMarshall(in.m_BicarbonateMolarity_mmol_Per_L, out.BicarbonateMolarity_mmol_Per_L()); + io::Physiology::Marshall(in, out); + + CDM_RUNNING_AVERAGE_PTR_MARSHALL_HELPER(in, out, BloodpH); + CDM_RUNNING_AVERAGE_PTR_MARSHALL_HELPER(in, out, BicarbonateMolarity_mmol_Per_L); + out.PackOn(in.m_packOn); out.PreviousWeightPack_kg(in.m_previousWeightPack_kg); } - // class Cardiovascular - void BiogearsPhysiology::Marshall(const CDM::BioGearsGastrointestinalSystemData& in, const SESubstanceManager& substances, Gastrointestinal& out) + // class GastrointestinalSystem + void BiogearsPhysiology::UnMarshall(const CDM::BioGearsGastrointestinalSystemData& in, const SESubstanceManager& substances, Gastrointestinal& out) { - out.Clear(); - io::System::Marshall(in, out); + out.Invalidate(); + io::Physiology::UnMarshall(in, out); out.BioGearsSystem::LoadState(); @@ -315,31 +467,31 @@ namespace io { throw CommonDataModelException(ss.str()); } out.NewDrugTransitState(sub); - out.GetDrugTransitState(sub)->Load(transitData); + io::Physiology::UnMarshall(transitData, *out.GetDrugTransitState(sub)); } out.m_DecrementNutrients = true; } - void BiogearsPhysiology::UnMarshall(const Gastrointestinal& in, CDM::BioGearsGastrointestinalSystemData& out) + void BiogearsPhysiology::Marshall(const Gastrointestinal& in, CDM::BioGearsGastrointestinalSystemData& out) { - io::System::UnMarshall(in, out); + io::Physiology::Marshall(in, out); } - // class Cardiovascular - void BiogearsPhysiology::Marshall(const CDM::BioGearsHepaticSystemData& in, const SESubstanceManager& substances, Hepatic& out) + // class HepaticSystem + void BiogearsPhysiology::UnMarshall(const CDM::BioGearsHepaticSystemData& in, const SESubstanceManager& substances, Hepatic& out) { - out.Clear(); - io::System::Marshall(in, out); + out.Invalidate(); + io::Physiology::UnMarshall(in, out); out.BioGearsSystem::LoadState(); } - void BiogearsPhysiology::UnMarshall(const Hepatic& in, CDM::BioGearsHepaticSystemData& out) + void BiogearsPhysiology::Marshall(const Hepatic& in, CDM::BioGearsHepaticSystemData& out) { - io::System::UnMarshall(in, out); + io::Physiology::Marshall(in, out); } // class Cardiovascular - void BiogearsPhysiology::Marshall(const CDM::BioGearsNervousSystemData& in, const SESubstanceManager& substances, Nervous& out) + void BiogearsPhysiology::UnMarshall(const CDM::BioGearsNervousSystemData& in, const SESubstanceManager& substances, Nervous& out) { - out.Clear(); - io::System::Marshall(in, out); + out.Invalidate(); + io::Physiology::UnMarshall(in, out); // We assume state have to be after all stabilization out.m_FeedbackActive = true; @@ -394,9 +546,9 @@ namespace io { out.BioGearsSystem::LoadState(); } - void BiogearsPhysiology::UnMarshall(const Nervous& in, CDM::BioGearsNervousSystemData& out) + void BiogearsPhysiology::Marshall(const Nervous& in, CDM::BioGearsNervousSystemData& out) { - io::System::UnMarshall(in, out); + io::Physiology::Marshall(in, out); out.AfferentChemoreceptor_Hz(in.m_AfferentChemoreceptor_Hz); out.AfferentPulmonaryStrechReceptor_Hz(in.m_AfferentPulmonaryStretchReceptor_Hz); out.AorticBaroreceptorStrain(in.m_AorticBaroreceptorStrain); @@ -447,53 +599,53 @@ namespace io { out.SympatheticPeripheralSignalFatigue(in.m_SympatheticPeripheralSignalFatigue); out.VagalSignalBaseline(in.m_VagalSignalBaseline_Hz); } - // class Cardiovascular - void BiogearsPhysiology::Marshall(const CDM::BioGearsRenalSystemData& in, const SESubstanceManager& substances, Renal& out) + // class RenalSystem + void BiogearsPhysiology::UnMarshall(const CDM::BioGearsRenalSystemData& in, const SESubstanceManager& substances, Renal& out) { - out.Clear(); - io::System::Marshall(in, out); + out.Invalidate(); + io::Physiology::UnMarshall(in, out); out.m_Urinating = in.Urinating(); - out.m_leftAfferentResistance_mmHg_s_Per_mL = in.LeftAfferentResistance_mmHg_s_Per_mL(); - out.m_rightAfferentResistance_mmHg_s_Per_mL = in.RightAfferentResistance_mmHg_s_Per_mL(); - out.m_leftSodiumFlowSetPoint_mg_Per_s = in.LeftSodiumFlowSetPoint_mg_Per_s(); - out.m_rightSodiumFlowSetPoint_mg_Per_s = in.RightSodiumFlowSetPoint_mg_Per_s(); - - io::Property::Marshall(in.UrineProductionRate_mL_Per_min(), out.m_urineProductionRate_mL_Per_min_runningAvg); - io::Property::Marshall(in.UrineOsmolarity_mOsm_Per_L(), out.m_urineOsmolarity_mOsm_Per_L_runningAvg); - io::Property::Marshall(in.SodiumConcentration_mg_Per_mL(), out.m_sodiumConcentration_mg_Per_mL_runningAvg); - io::Property::Marshall(in.SodiumExcretionRate_mg_Per_min(), out.m_sodiumExcretionRate_mg_Per_min_runningAvg); - io::Property::Marshall(in.LeftSodiumFlow_mg_Per_s(), out.m_leftSodiumFlow_mg_Per_s_runningAvg); - io::Property::Marshall(in.RightSodiumFlow_mg_Per_s(), out.m_rightSodiumFlow_mg_Per_s_runningAvg); - io::Property::Marshall(in.LeftRenalArterialPressure_mmHg(), out.m_leftRenalArterialPressure_mmHg_runningAvg); - io::Property::Marshall(in.RightRenalArterialPressure_mmHg(), out.m_rightRenalArterialPressure_mmHg_runningAvg); + out.m_LeftAfferentResistance_mmHg_s_Per_mL = in.LeftAfferentResistance_mmHg_s_Per_mL(); + out.m_RightAfferentResistance_mmHg_s_Per_mL = in.RightAfferentResistance_mmHg_s_Per_mL(); + out.m_LeftSodiumFlowSetPoint_mg_Per_s = in.LeftSodiumFlowSetPoint_mg_Per_s(); + out.m_RightSodiumFlowSetPoint_mg_Per_s = in.RightSodiumFlowSetPoint_mg_Per_s(); + + io::Property::UnMarshall(in.UrineProductionRate_mL_Per_min(), out.m_UrineProductionRate_mL_Per_min); + io::Property::UnMarshall(in.UrineOsmolarity_mOsm_Per_L(), out.m_UrineOsmolarity_mOsm_Per_L); + io::Property::UnMarshall(in.SodiumConcentration_mg_Per_mL(), out.m_SodiumConcentration_mg_Per_mL); + io::Property::UnMarshall(in.SodiumExcretionRate_mg_Per_min(), out.m_SodiumExcretionRate_mg_Per_min); + io::Property::UnMarshall(in.LeftSodiumFlow_mg_Per_s(), out.m_LeftSodiumFlow_mg_Per_s); + io::Property::UnMarshall(in.RightSodiumFlow_mg_Per_s(), out.m_RightSodiumFlow_mg_Per_s); + io::Property::UnMarshall(in.LeftRenalArterialPressure_mmHg(), out.m_LeftRenalArterialPressure_mmHg); + io::Property::UnMarshall(in.RightRenalArterialPressure_mmHg(), out.m_RightRenalArterialPressure_mmHg); out.BioGearsSystem::LoadState(); } - void BiogearsPhysiology::UnMarshall(const Renal& in, CDM::BioGearsRenalSystemData& out) + void BiogearsPhysiology::Marshall(const Renal& in, CDM::BioGearsRenalSystemData& out) { - io::System::UnMarshall(in, out); + io::Physiology::Marshall(in, out); out.Urinating(in.m_Urinating); - out.LeftAfferentResistance_mmHg_s_Per_mL(in.m_leftAfferentResistance_mmHg_s_Per_mL); - out.RightAfferentResistance_mmHg_s_Per_mL(in.m_rightAfferentResistance_mmHg_s_Per_mL); - out.LeftSodiumFlowSetPoint_mg_Per_s(in.m_leftSodiumFlowSetPoint_mg_Per_s); - out.RightSodiumFlowSetPoint_mg_Per_s(in.m_rightSodiumFlowSetPoint_mg_Per_s); - - io::Property::UnMarshall(in.m_urineProductionRate_mL_Per_min_runningAvg, out.UrineProductionRate_mL_Per_min()); - io::Property::UnMarshall(in.m_urineOsmolarity_mOsm_Per_L_runningAvg, out.UrineOsmolarity_mOsm_Per_L()); - io::Property::UnMarshall(in.m_sodiumConcentration_mg_Per_mL_runningAvg, out.SodiumConcentration_mg_Per_mL()); - io::Property::UnMarshall(in.m_sodiumExcretionRate_mg_Per_min_runningAvg, out.SodiumExcretionRate_mg_Per_min()); - io::Property::UnMarshall(in.m_leftSodiumFlow_mg_Per_s_runningAvg, out.LeftSodiumFlow_mg_Per_s()); - io::Property::UnMarshall(in.m_rightSodiumFlow_mg_Per_s_runningAvg, out.RightSodiumFlow_mg_Per_s()); - io::Property::UnMarshall(in.m_leftRenalArterialPressure_mmHg_runningAvg, out.LeftRenalArterialPressure_mmHg()); - io::Property::UnMarshall(in.m_rightRenalArterialPressure_mmHg_runningAvg, out.RightRenalArterialPressure_mmHg()); + out.LeftAfferentResistance_mmHg_s_Per_mL(in.m_LeftAfferentResistance_mmHg_s_Per_mL); + out.RightAfferentResistance_mmHg_s_Per_mL(in.m_RightAfferentResistance_mmHg_s_Per_mL); + out.LeftSodiumFlowSetPoint_mg_Per_s(in.m_LeftSodiumFlowSetPoint_mg_Per_s); + out.RightSodiumFlowSetPoint_mg_Per_s(in.m_RightSodiumFlowSetPoint_mg_Per_s); + + CDM_RUNNING_AVERAGE_PTR_MARSHALL_HELPER(in, out, UrineProductionRate_mL_Per_min); + CDM_RUNNING_AVERAGE_PTR_MARSHALL_HELPER(in, out, UrineOsmolarity_mOsm_Per_L); + CDM_RUNNING_AVERAGE_PTR_MARSHALL_HELPER(in, out, SodiumConcentration_mg_Per_mL); + CDM_RUNNING_AVERAGE_PTR_MARSHALL_HELPER(in, out, SodiumExcretionRate_mg_Per_min); + CDM_RUNNING_AVERAGE_PTR_MARSHALL_HELPER(in, out, LeftSodiumFlow_mg_Per_s); + CDM_RUNNING_AVERAGE_PTR_MARSHALL_HELPER(in, out, RightSodiumFlow_mg_Per_s); + CDM_RUNNING_AVERAGE_PTR_MARSHALL_HELPER(in, out, LeftRenalArterialPressure_mmHg); + CDM_RUNNING_AVERAGE_PTR_MARSHALL_HELPER(in, out, RightRenalArterialPressure_mmHg); } - // class Cardiovascular - void BiogearsPhysiology::Marshall(const CDM::BioGearsRespiratorySystemData& in, const SESubstanceManager& substances, Respiratory& out) + // class RespiratorySystem + void BiogearsPhysiology::UnMarshall(const CDM::BioGearsRespiratorySystemData& in, const SESubstanceManager& substances, Respiratory& out) { - out.Clear(); - io::System::Marshall(in, out); + out.Invalidate(); + io::Physiology::UnMarshall(in, out); out.m_InitialExpiratoryReserveVolume_L = in.InitialExpiratoryReserveVolume_L(); out.m_InitialFunctionalResidualCapacity_L = in.InitialFunctionalResidualCapacity_L(); @@ -508,7 +660,7 @@ namespace io { out.m_LastCardiacCycleBloodPH = in.LastCardiacCycleBloodPH(); out.m_PreviousTotalLungVolume_L = in.PreviousTotalLungVolume_L(); - io::Property::Marshall(in.BloodPHRunningAverage(), out.m_BloodPHRunningAverage); + io::Property::UnMarshall(in.BloodPHRunningAverage(), out.m_BloodPHRunningAverage); out.m_BreathingCycle = in.BreathingCycle(); out.m_ArterialO2PartialPressure_mmHg = in.ArterialOxygenPressure_mmHg(); @@ -526,8 +678,8 @@ namespace io { out.m_VentilationFrequency_Per_min = in.VentilationFrequency_Per_min(); - io::Property::Marshall(in.ArterialOxygenAverage_mmHg(), out.m_ArterialO2Average_mmHg); - io::Property::Marshall(in.ArterialCarbonDioxideAverage_mmHg(), out.m_ArterialCO2Average_mmHg); + io::Property::UnMarshall(in.ArterialOxygenAverage_mmHg(), out.m_ArterialOxygenAverage_mmHg); + io::Property::UnMarshall(in.ArterialCarbonDioxideAverage_mmHg(), out.m_ArterialCarbonDioxideAverage_mmHg); out.m_ConsciousBreathing = in.ConsciousBreathing(); out.m_ConsciousRespirationPeriod_s = in.ConsciousRespirationPeriod_s(); @@ -542,9 +694,9 @@ namespace io { out.BioGearsSystem::LoadState(); } - void BiogearsPhysiology::UnMarshall(const Respiratory& in, CDM::BioGearsRespiratorySystemData& out) + void BiogearsPhysiology::Marshall(const Respiratory& in, CDM::BioGearsRespiratorySystemData& out) { - io::System::UnMarshall(in, out); + io::Physiology::Marshall(in, out); out.InitialExpiratoryReserveVolume_L(in.m_InitialExpiratoryReserveVolume_L); out.InitialFunctionalResidualCapacity_L(in.m_InitialFunctionalResidualCapacity_L); @@ -559,7 +711,7 @@ namespace io { out.LastCardiacCycleBloodPH(in.m_LastCardiacCycleBloodPH); out.PreviousTotalLungVolume_L(in.m_PreviousTotalLungVolume_L); - io::Property::UnMarshall(in.m_BloodPHRunningAverage, out.BloodPHRunningAverage()); + CDM_RUNNING_AVERAGE_PTR_MARSHALL_HELPER(in, out, BloodPHRunningAverage) out.BreathingCycle(in.m_BreathingCycle); out.ArterialOxygenPressure_mmHg(in.m_ArterialO2PartialPressure_mmHg); @@ -577,8 +729,8 @@ namespace io { out.VentilationFrequency_Per_min(in.m_VentilationFrequency_Per_min); - io::Property::UnMarshall(in.m_ArterialO2Average_mmHg, out.ArterialOxygenAverage_mmHg()); - io::Property::UnMarshall(in.m_ArterialCO2Average_mmHg, out.ArterialCarbonDioxideAverage_mmHg()); + CDM_RUNNING_AVERAGE_PTR_MARSHALL_HELPER(in, out, ArterialOxygenAverage_mmHg) + CDM_RUNNING_AVERAGE_PTR_MARSHALL_HELPER(in, out, ArterialCarbonDioxideAverage_mmHg) out.ConsciousBreathing(in.m_ConsciousBreathing); out.ConsciousRespirationPeriod_s(in.m_ConsciousRespirationPeriod_s); @@ -591,31 +743,33 @@ namespace io { out.HadAirwayObstruction(in.m_HadAirwayObstruction); out.HadBronchoconstriction(in.m_HadBronchoconstriction); } - // class Cardiovascular - void BiogearsPhysiology::Marshall(const CDM::BioGearsTissueSystemData& in, const SESubstanceManager& substances, Tissue& out) + // class TissueSystem + void BiogearsPhysiology::UnMarshall(const CDM::BioGearsTissueSystemData& in, const SESubstanceManager& substances, Tissue& out) { - out.Clear(); - io::System::Marshall(in, out); + out.Invalidate(); + io::Physiology::UnMarshall(in, out); - io::Property::Marshall(in.O2ConsumedRunningAverage_mL_Per_s(), out.m_O2ConsumedRunningAverage_mL_Per_s); - io::Property::Marshall(in.CO2ProducedRunningAverage_mL_Per_s(), out.m_CO2ProducedRunningAverage_mL_Per_s); - io::Property::Marshall(in.RespiratoryQuotientRunningAverage(), out.m_RespiratoryQuotientRunningAverage); + io::Property::UnMarshall(in.O2ConsumedRunningAverage_mL_Per_s(), out.m_O2ConsumedRunningAverage_mL_Per_s); + io::Property::UnMarshall(in.CO2ProducedRunningAverage_mL_Per_s(), out.m_CO2ProducedRunningAverage_mL_Per_s); + io::Property::UnMarshall(in.RespiratoryQuotientRunningAverage(), out.m_RespiratoryQuotientRunningAverage); out.m_RestingPatientMass_kg = in.RestingPatientMass_kg(); out.m_RestingFluidMass_kg = in.RestingFluidMass_kg(); - io::Property::Marshall(in.FatigueRunningAverage(), out.m_FatigueRunningAverage); + io::Property::UnMarshall(in.FatigueRunningAverage(), out.m_FatigueRunningAverage); out.BioGearsSystem::LoadState(); } - void BiogearsPhysiology::UnMarshall(const Tissue& in, CDM::BioGearsTissueSystemData& out) + void BiogearsPhysiology::Marshall(const Tissue& in, CDM::BioGearsTissueSystemData& out) { - io::System::UnMarshall(in, out); + io::Physiology::Marshall(in, out); + + CDM_RUNNING_AVERAGE_PTR_MARSHALL_HELPER(in, out, O2ConsumedRunningAverage_mL_Per_s) + CDM_RUNNING_AVERAGE_PTR_MARSHALL_HELPER(in, out, CO2ProducedRunningAverage_mL_Per_s) + CDM_RUNNING_AVERAGE_PTR_MARSHALL_HELPER(in, out, RespiratoryQuotientRunningAverage) - io::Property::UnMarshall(in.m_O2ConsumedRunningAverage_mL_Per_s,out.O2ConsumedRunningAverage_mL_Per_s()); - io::Property::UnMarshall(in.m_CO2ProducedRunningAverage_mL_Per_s,out.CO2ProducedRunningAverage_mL_Per_s()); - io::Property::UnMarshall(in.m_RespiratoryQuotientRunningAverage,out.RespiratoryQuotientRunningAverage()); out.RestingPatientMass_kg(in.m_RestingPatientMass_kg); out.RestingFluidMass_kg(in.m_RestingFluidMass_kg); - io::Property::UnMarshall(in.m_FatigueRunningAverage,out.FatigueRunningAverage()); + + CDM_RUNNING_AVERAGE_PTR_MARSHALL_HELPER(in, out, FatigueRunningAverage) } } } \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/io/biogears/BioGearsPhysiology.h b/projects/biogears/libBiogears/src/io/biogears/BioGearsPhysiology.h index ab45d946c..0c86a8145 100644 --- a/projects/biogears/libBiogears/src/io/biogears/BioGearsPhysiology.h +++ b/projects/biogears/libBiogears/src/io/biogears/BioGearsPhysiology.h @@ -18,20 +18,22 @@ specific language governing permissions and limitations under the License. #include -#define CDM_BIOGEARS_PHYSIOLOGY_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_BIOGEARS_PHYSIOLOGY_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ out.func(std::make_unique::type>()); \ - io::BiogearsPhysiology::UnMarshall(*in.m_##func, out.func()); \ + io::BiogearsPhysiology::Marshall(*in.m_##func, out.func()); \ } -#define CDM_OPTIONAL_BIOGEARS_PHYSIOLOGY_UNMARSHAL_HELPER(in, out, func) \ - if (in.m_##func) { \ - io::BiogearsPhysiology::UnMarshall(*in.m_##func, out.func()); \ +#define CDM_OPTIONAL_BIOGEARS_PHYSIOLOGY_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func) { \ + io::BiogearsPhysiology::Marshall(*in.m_##func, out.func()); \ } namespace biogears { class SESubstanceManager; - +class SESystem; +class BioGears; +class BioGearsSystem; class BloodChemistry; class Cardiovascular; class Drugs; @@ -47,62 +49,66 @@ class Tissue; namespace io { class BIOGEARS_PRIVATE_API BiogearsPhysiology { public: + // class Factories; + static std::unique_ptr factory(CDM::SystemData const* systemData, biogears::BioGears& bgData); + + static std::unique_ptr factory(const SESystem* data); + // template option template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); // class BloodChemistry - static void Marshall(const CDM::BioGearsBloodChemistrySystemData& in, const SESubstanceManager& substances, BloodChemistry& out); - static void UnMarshall(const BloodChemistry& in, CDM::BioGearsBloodChemistrySystemData& out); + static void UnMarshall(const CDM::BioGearsBloodChemistrySystemData& in, const SESubstanceManager& substances, BloodChemistry& out); + static void Marshall(const BloodChemistry& in, CDM::BioGearsBloodChemistrySystemData& out); // class Cardiovascular - static void Marshall(const CDM::BioGearsCardiovascularSystemData& in, const SESubstanceManager& substances, Cardiovascular& out); - static void UnMarshall(const Cardiovascular& in, CDM::BioGearsCardiovascularSystemData& out); - + static void UnMarshall(const CDM::BioGearsCardiovascularSystemData& in, const SESubstanceManager& substances, Cardiovascular& out); + static void Marshall(const Cardiovascular& in, CDM::BioGearsCardiovascularSystemData& out); // class Drugs - static void Marshall(const CDM::BioGearsDrugSystemData& in, const SESubstanceManager& substances, Drugs& out); - static void UnMarshall(const Drugs& in, CDM::BioGearsDrugSystemData& out); + static void UnMarshall(const CDM::BioGearsDrugSystemData& in, const SESubstanceManager& substances, Drugs& out); + static void Marshall(const Drugs& in, CDM::BioGearsDrugSystemData& out); // class Endocrine - static void Marshall(const CDM::BioGearsEndocrineSystemData& in, const SESubstanceManager& substances, Endocrine& out); - static void UnMarshall(const Endocrine& in, CDM::BioGearsEndocrineSystemData& out); + static void UnMarshall(const CDM::BioGearsEndocrineSystemData& in, const SESubstanceManager& substances, Endocrine& out); + static void Marshall(const Endocrine& in, CDM::BioGearsEndocrineSystemData& out); // class Energy - static void Marshall(const CDM::BioGearsEnergySystemData& in, const SESubstanceManager& substances, Energy& out); - static void UnMarshall(const Energy& in, CDM::BioGearsEnergySystemData& out); + static void UnMarshall(const CDM::BioGearsEnergySystemData& in, const SESubstanceManager& substances, Energy& out); + static void Marshall(const Energy& in, CDM::BioGearsEnergySystemData& out); // class Gastrointestinal - static void Marshall(const CDM::BioGearsGastrointestinalSystemData& in, const SESubstanceManager& substances, Gastrointestinal& out); - static void UnMarshall(const Gastrointestinal& in, CDM::BioGearsGastrointestinalSystemData& out); + static void UnMarshall(const CDM::BioGearsGastrointestinalSystemData& in, const SESubstanceManager& substances, Gastrointestinal& out); + static void Marshall(const Gastrointestinal& in, CDM::BioGearsGastrointestinalSystemData& out); // class Hepatic - static void Marshall(const CDM::BioGearsHepaticSystemData& in, const SESubstanceManager& substances, Hepatic& out); - static void UnMarshall(const Hepatic& in, CDM::BioGearsHepaticSystemData& out); + static void UnMarshall(const CDM::BioGearsHepaticSystemData& in, const SESubstanceManager& substances, Hepatic& out); + static void Marshall(const Hepatic& in, CDM::BioGearsHepaticSystemData& out); // class Nervous - static void Marshall(const CDM::BioGearsNervousSystemData& in, const SESubstanceManager& substances, Nervous& out); - static void UnMarshall(const Nervous& in, CDM::BioGearsNervousSystemData& out); + static void UnMarshall(const CDM::BioGearsNervousSystemData& in, const SESubstanceManager& substances, Nervous& out); + static void Marshall(const Nervous& in, CDM::BioGearsNervousSystemData& out); // class Renal - static void Marshall(const CDM::BioGearsRenalSystemData& in, const SESubstanceManager& substances, Renal& out); - static void UnMarshall(const Renal& in, CDM::BioGearsRenalSystemData& out); + static void UnMarshall(const CDM::BioGearsRenalSystemData& in, const SESubstanceManager& substances, Renal& out); + static void Marshall(const Renal& in, CDM::BioGearsRenalSystemData& out); // class Respiratory - static void Marshall(const CDM::BioGearsRespiratorySystemData& in, const SESubstanceManager& substances, Respiratory& out); - static void UnMarshall(const Respiratory& in, CDM::BioGearsRespiratorySystemData& out); + static void UnMarshall(const CDM::BioGearsRespiratorySystemData& in, const SESubstanceManager& substances, Respiratory& out); + static void Marshall(const Respiratory& in, CDM::BioGearsRespiratorySystemData& out); // class Tissue - static void Marshall(const CDM::BioGearsTissueSystemData& in, const SESubstanceManager& substances, Tissue& out); - static void UnMarshall(const Tissue& in, CDM::BioGearsTissueSystemData& out); + static void UnMarshall(const CDM::BioGearsTissueSystemData& in, const SESubstanceManager& substances, Tissue& out); + static void Marshall(const Tissue& in, CDM::BioGearsTissueSystemData& out); }; //---------------------------------------------------------------------------------- template - void BiogearsPhysiology::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + void BiogearsPhysiology::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) { if (!option_in.present()) { - out.Clear(); + out.Invalidate(); } else { - Marshall(option_in.get(), out); + UnMarshall(option_in.get(), out); } } //---------------------------------------------------------------------------------- template - void BiogearsPhysiology::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void BiogearsPhysiology::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); + Marshall(in, *item); option_out.set(*item); } } // Namespace IO diff --git a/projects/biogears/libBiogears/src/io/cdm/Actions.cpp b/projects/biogears/libBiogears/src/io/cdm/Actions.cpp new file mode 100644 index 000000000..399a13242 --- /dev/null +++ b/projects/biogears/libBiogears/src/io/cdm/Actions.cpp @@ -0,0 +1,214 @@ +#include "Actions.h" + +#include "AnesthesiaActions.h" +#include "EnvironmentActions.h" +#include "InhalerActions.h" +#include "PatientActions.h" +#include "Property.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace biogears { +namespace io { + + std::vector> Actions::action_factory(const CDM::ActionListData& in, SESubstanceManager& substances, std::default_random_engine* rd) + { + std::vector> r_vec; + for (auto action_data : in.Action()) { + r_vec.emplace_back(factory(&action_data, substances, rd)); + } + return std::move(r_vec); + } + std::unique_ptr Actions::factory(CDM::ActionData const* actionData, SESubstanceManager& substances, std::default_random_engine* rd) + { + if (auto advData = dynamic_cast(actionData); advData) { + auto advanceTime = std::make_unique(); + Actions::UnMarshall(*advData, *advanceTime, rd); + return advanceTime; + } + + if (auto stData = dynamic_cast(actionData); stData) { + auto serializeState = std::make_unique(); + Actions::UnMarshall(*stData, *serializeState); + return serializeState; + } + + if (auto patient_action_data = dynamic_cast(actionData)) { + return io::PatientActions::factory(patient_action_data, substances, rd); + } + + if (auto environment_action_data = dynamic_cast(actionData)) { + return io::EnvironmentActions::factory(environment_action_data, substances, rd); + } + + if (auto inhaller_action_data = dynamic_cast(actionData)) { + return io::InhalerActions::factory(inhaller_action_data, substances, rd); + } + + if (auto anesthesia_action_data = dynamic_cast(actionData)) { + return io::AnesthesiaActions::factory(anesthesia_action_data, substances, rd); + } + + throw biogears::CommonDataModelException("Actions:Factory - Unsupported Action Received."); + } + std::unique_ptr Actions::factory(const SEAction* data) + { + if (auto advData = dynamic_cast(data); advData) { + auto advanceTime = std::make_unique(); + Actions::Marshall(*advData, *advanceTime); + return advanceTime; + } + + if (auto stData = dynamic_cast(data); stData) { + auto serializeState = std::make_unique(); + Actions::Marshall(*stData, *serializeState); + return serializeState; + } + + if (auto patient_action_data = dynamic_cast(data)) { + return io::PatientActions::factory(patient_action_data); + } + + if (auto environment_action_data = dynamic_cast(data)) { + return io::EnvironmentActions::factory(environment_action_data); + } + + if (auto inhaller_action_data = dynamic_cast(data)) { + return io::InhalerActions::factory(inhaller_action_data); + } + + if (auto anesthesia_action_data = dynamic_cast(data)) { + return io::AnesthesiaActions::factory(anesthesia_action_data); + } + + throw biogears::CommonDataModelException("Actions::factory does not support the derived Action. If you are not a developer contact upstream for support."); + } + + void Actions::Marshall(SEActionManager const& in, std::vector>& out) + { + io::PatientActions::Marshall(in.m_PatientActions, out); + io::EnvironmentActions::Marshall(in.m_EnvironmentActions, out); + io::AnesthesiaActions::Marshall(in.m_AnesthesiaMachineActions, out); + io::InhalerActions::Marshall(in.m_InhalerActions, out); + } + + //----------------------------------------------------------------------------- + // class SEAction + void Actions::UnMarshall(const CDM::ActionData& in, SEAction& out) + { + out.Invalidate(); + if (in.Comment().present()) { + out.m_Comment = in.Comment().get(); + } + } + void Actions::Marshall(const SEAction& in, CDM::ActionData& out) + { + if (in.HasComment()) { + out.Comment(in.m_Comment); + } + } + //------------------------------------------------------------------------------ + // class SEActionList; + // void Actions::UnMarshall(const CDM::ActionListData& in, SEActionList& out, std::default_random_engine* rd = nullptr) + //{ + //} + // void Actions::Marshall(const SEActionList& in, CDM::ActionListData& out) + //{ + //} + + //----------------------------------------------------------------------------- + // class SEAdvanceTime + void Actions::UnMarshall(const CDM::AdvanceTimeData& in, SEAdvanceTime& out, std::default_random_engine* re) + { + UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.Time(), out.GetTime(), re); + } + void Actions::Marshall(const SEAdvanceTime& in, CDM::AdvanceTimeData& out) + { + Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Time) + } + //----------------------------------------------------------------------------- + // class SESerializationType; + void Actions::UnMarshall(const CDM::enumSerializationType& in, SESerializationType& out) + { + try { + switch (in) { + case CDM::enumSerializationType::Load: + out = SESerializationType::Load; + break; + case CDM::enumSerializationType::Save: + out = SESerializationType::Save; + break; + default: + out = SESerializationType::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SESerializationType::Invalid; + } + } + void Actions::Marshall(const SESerializationType& in, CDM::enumSerializationType& out) + { + switch (in) { + case SESerializationType::Load: + out = CDM::enumSerializationType::Load; + break; + case SESerializationType::Save: + out = CDM::enumSerializationType::Save; + break; + default: + out = ""; + break; + } + } + //----------------------------------------------------------------------------- + // class SESerializeState + void Actions::UnMarshall(const CDM::SerializeStateData& in, SESerializeState& out) + { + UnMarshall(static_cast(in), static_cast(out)); + UnMarshall(in.Type(), out.m_Type); + if (in.Filename().size() > 0) + out.SetFilename(in.Filename()); + } + void Actions::Marshall(const SESerializeState& in, CDM::SerializeStateData& out) + { + Marshall(static_cast(in), static_cast(out)); + if (in.HasFilename()) { + out.Filename(in.m_Filename); + } else { + out.Filename(""); + } + SE_ACTIONS_ENUM_PTR_MARSHALL_HELPER(in, out, Type) + } + //------------------------------------------------------------------------------ + // class SERandomSeed + // void Actions::UnMarshall(const CDM::RandomSeed& in, SERandomSeed& out, std::default_random_engine* rd = nullptr) + //{ + //} + // void Actions::Marshall(const SERandomSeed& in, CDM::RandomSeed& out) + //{ + //} +} +bool operator==(CDM::enumSerializationType const& lhs, SESerializationType const& rhs) +{ + switch (rhs) { + case SESerializationType ::Save: + return (CDM::enumSerializationType ::Save == lhs); + case SESerializationType ::Load: + return (CDM::enumSerializationType ::Load == lhs); + case SESerializationType ::Invalid: + return ((CDM::enumSerializationType::value)-1 == lhs); + default: + return false; + } +} +} diff --git a/projects/biogears/libBiogears/src/io/cdm/Actions.h b/projects/biogears/libBiogears/src/io/cdm/Actions.h new file mode 100644 index 000000000..4864a6e53 --- /dev/null +++ b/projects/biogears/libBiogears/src/io/cdm/Actions.h @@ -0,0 +1,148 @@ +/************************************************************************************** +Copyright 2019 Applied Research Associates, Inc. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the License +at: +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +**************************************************************************************/ + +#pragma once +#include +#include + +#include +#include + +#include "Actions.h" + +#include +#include + +// Question: To Serialize Invalid units or not to Serialize? +// TO Throw an exception when a member is invalid? +#define CDM_ACTIONS_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func && in.m_##func->IsValid()) { \ + out.func(std::make_unique::type>()); \ + io::Actions::Marshall(*in.m_##func, out.func()); \ + } /* else if (in.m_##func) { \ + throw biogears::CommonDataModelException("func is InValid and cannot be Unmarshalled"); \ + }*/ + +#define CDM_OPTIONAL_ACTIONS_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func && in.m_##func->IsValid()) { \ + io::Actions::Marshall(*in.m_##func, out.func()); \ + } /*else if (in.m_##func) { \ + throw biogears::CommonDataModelException("func is InValid and cannot be Unmarshalled"); \ + }*/ + +#define SE_ACTIONS_ENUM_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.Has##func()) { \ + out.func(std::make_unique::type>()); \ + io::Actions::Marshall(in.m_##func, out.func()); \ + } + +#define SE_OPTIONAL_ACTIONS_ENUM_PTR_MARSHALL_HELPER(in, out, func) \ + io::Actions::Marshall(in.m_##func, out.func()); + +namespace biogears { +class SESubstanceManager; +class SEAction; +class SEActionManager; +class SEActionList; +class SEAdvanceTime; +// enum class SESerializationType; +class SESerializeState; +// class SERandomSeed; + +namespace io { + class BIOGEARS_PRIVATE_API Actions { + public: + // class Factories; + static std::vector> action_factory(const CDM::ActionListData& in, SESubstanceManager& substances, std::default_random_engine* rd = nullptr); + static std::unique_ptr factory(CDM::ActionData const* actionData, SESubstanceManager& substances, std::default_random_engine* rd = nullptr); + static std::unique_ptr factory(const SEAction* data); + + static void Marshall(SEActionManager const& in, std::vector>& out); + + // template option + template ::value>* = nullptr> + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); + template ::value>* = nullptr> + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out, std::default_random_engine* rd = nullptr); + template + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); + + // class SEAction; + static void UnMarshall(const CDM::ActionData& in, SEAction& out); + static void Marshall(const SEAction& in, CDM::ActionData& out); + //// class SEActionList; + // static void UnMarshall(const CDM::ActionListData& in, SEActionList& out, std::default_random_engine* rd = nullptr); + // static void Marshall(const SEActionList& in, CDM::ActionListData& out); + // class SEAdvanceTime; + static void UnMarshall(const CDM::AdvanceTimeData& in, SEAdvanceTime& out, std::default_random_engine* re = nullptr); + static void Marshall(const SEAdvanceTime& in, CDM::AdvanceTimeData& out); + // class SESerializationType; + static void UnMarshall(const CDM::enumSerializationType& in, SESerializationType& out); + static void Marshall(const SESerializationType& in, CDM::enumSerializationType& out); + // class SESerializeState; + static void UnMarshall(const CDM::SerializeStateData& in, SESerializeState& out); + static void Marshall(const SESerializeState& in, CDM::SerializeStateData& out); + // class SERandomSeed + // static void UnMarshall(const CDM::RandomSeed& in, SERandomSeed& out, std::default_random_engine* rd = nullptr); + // static void Marshall(const SERandomSeed& in, CDM::RandomSeed& out); + }; + + //---------------------------------------------------------------------------------- + + template ::value>*> + void Actions::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) + { + if (!option_in.present() || option_in->empty()) { + out = SE::Invalid; + } else { + UnMarshall(option_in.get(), out); + } + } + + template ::value>*> + void Actions::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out, std::default_random_engine* rd) + { + if (!option_in.present()) { + out.Invalidate(); + } else { + io::Actions::UnMarshall(option_in.get(), out, rd); + } + } + + template + void Actions::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) + { + auto item = std::make_unique(); + io::Actions::Marshall(in, *item); + option_out.set(std::move(item)); + } +} // namespace io + +// Operators +bool operator==(CDM::enumSerializationType const& lhs, SESerializationType const& rhs); + +inline bool operator==(SESerializationType const& lhs, CDM::enumSerializationType const& rhs) +{ + return rhs == lhs; +} + +inline bool operator!=(CDM::enumSerializationType const& lhs, SESerializationType const& rhs) +{ + return !(lhs == rhs); +} + +inline bool operator!=(SESerializationType const& lhs, CDM::enumSerializationType const& rhs) +{ + return !(rhs == lhs); +} + +} // namespace biogears diff --git a/projects/biogears/libBiogears/src/io/cdm/Anesthesia.cpp b/projects/biogears/libBiogears/src/io/cdm/Anesthesia.cpp index b5abd0042..305d5bf59 100644 --- a/projects/biogears/libBiogears/src/io/cdm/Anesthesia.cpp +++ b/projects/biogears/libBiogears/src/io/cdm/Anesthesia.cpp @@ -3,6 +3,7 @@ #include "Property.h" #include "System.h" +#include #include #include #include @@ -15,115 +16,115 @@ #include #include #include + namespace biogears { namespace io { //---------------------------------------------------------------------------------- - //class SEAnesthesiaMachine - void Anesthesia::Marshall(const CDM::AnesthesiaMachineData& in, SEAnesthesiaMachine& out) + // class SEAnesthesiaMachine + void Anesthesia::UnMarshall(const CDM::AnesthesiaMachineData& in, SEAnesthesiaMachine& out) { - System::Marshall(static_cast(in), static_cast(out)); + System::UnMarshall(static_cast(in), static_cast(out)); + + UnMarshall(in.Connection(), out.m_Connection); - if (in.Connection().present()) { - out.m_Connection = in.Connection().get(); - } if (in.InletFlow().present()) { - io::Property::Marshall(in.InletFlow(), out.GetInletFlow()); + io::Property::UnMarshall(in.InletFlow(), out.GetInletFlow()); } if (in.InspiratoryExpiratoryRatio().present()) { - io::Property::Marshall(in.InspiratoryExpiratoryRatio(), out.GetInspiratoryExpiratoryRatio()); + io::Property::UnMarshall(in.InspiratoryExpiratoryRatio(), out.GetInspiratoryExpiratoryRatio()); } if (in.OxygenFraction().present()) { - io::Property::Marshall(in.OxygenFraction(), out.GetOxygenFraction()); + io::Property::UnMarshall(in.OxygenFraction(), out.GetOxygenFraction()); } - if (in.OxygenSource().present()) { - out.SetOxygenSource(in.OxygenSource().get()); - } + UnMarshall(in.OxygenSource(), out.m_OxygenSource); + if (in.PositiveEndExpiredPressure().present()) { - io::Property::Marshall(in.PositiveEndExpiredPressure(), out.GetPositiveEndExpiredPressure()); - } - if (in.PrimaryGas().present()) { - out.SetPrimaryGas(in.PrimaryGas().get()); + io::Property::UnMarshall(in.PositiveEndExpiredPressure(), out.GetPositiveEndExpiredPressure()); } + UnMarshall(in.PrimaryGas(), out.m_PrimaryGas); + if (in.RespiratoryRate().present()) { - io::Property::Marshall(in.RespiratoryRate(), out.GetRespiratoryRate()); + io::Property::UnMarshall(in.RespiratoryRate(), out.GetRespiratoryRate()); } if (in.ReliefValvePressure().present()) { - io::Property::Marshall(in.ReliefValvePressure(), out.GetReliefValvePressure()); + io::Property::UnMarshall(in.ReliefValvePressure(), out.GetReliefValvePressure()); } if (in.VentilatorPressure().present()) { - io::Property::Marshall(in.VentilatorPressure(), out.GetVentilatorPressure()); + io::Property::UnMarshall(in.VentilatorPressure(), out.GetVentilatorPressure()); } if (in.LeftChamber().present()) { - Marshall(in.LeftChamber(), out.GetLeftChamber()); + UnMarshall(in.LeftChamber(), out.GetLeftChamber()); } if (in.RightChamber().present()) { - Marshall(in.RightChamber(), out.GetRightChamber()); + UnMarshall(in.RightChamber(), out.GetRightChamber()); } if (in.OxygenBottleOne().present()) { - Marshall(in.OxygenBottleOne(), out.GetOxygenBottleOne()); + UnMarshall(in.OxygenBottleOne(), out.GetOxygenBottleOne()); } if (in.OxygenBottleTwo().present()) { - Marshall(in.OxygenBottleTwo(), out.GetOxygenBottleTwo()); + UnMarshall(in.OxygenBottleTwo(), out.GetOxygenBottleTwo()); } SEScalarTime time; + SEAnesthesiaMachineEvent event; for (auto e : in.ActiveEvent()) { - io::Property::Marshall(e.Duration(), time); - out.m_EventState[e.Event()] = true; - out.m_EventDuration_s[e.Event()] = time.GetValue(TimeUnit::s); + io::Property::UnMarshall(e.Duration(), time); + UnMarshall(e.Event(), event); + + out.m_EventState[event] = true; + out.m_EventDuration_s[event] = time.GetValue(TimeUnit::s); } out.StateChange(); ; } //---------------------------------------------------------------------------------- - void Anesthesia::UnMarshall(const SEAnesthesiaMachine& in, CDM::AnesthesiaMachineData& out) + void Anesthesia::Marshall(const SEAnesthesiaMachine& in, CDM::AnesthesiaMachineData& out) { - System::UnMarshall(static_cast(in), static_cast(out)); - if (in.HasConnection()) { - out.Connection(in.m_Connection); - } + System::Marshall(static_cast(in), static_cast(out)); + + SE_OPTIONAL_ANESTHESIA_ENUM_PTR_MARSHALL_HELPER(in, out, Connection) + if (in.m_InletFlow != nullptr) { - io::Property::UnMarshall(*in.m_InletFlow, out.InletFlow()); + io::Property::Marshall(*in.m_InletFlow, out.InletFlow()); } if (in.m_InspiratoryExpiratoryRatio != nullptr) { - io::Property::UnMarshall(*in.m_InspiratoryExpiratoryRatio, out.InspiratoryExpiratoryRatio()); + io::Property::Marshall(*in.m_InspiratoryExpiratoryRatio, out.InspiratoryExpiratoryRatio()); } if (in.m_OxygenFraction != nullptr) { - io::Property::UnMarshall(*in.m_OxygenFraction, out.OxygenFraction()); - } - if (in.HasOxygenSource()) { - out.OxygenSource(in.m_OxygenSource); + io::Property::Marshall(*in.m_OxygenFraction, out.OxygenFraction()); } + + SE_OPTIONAL_ANESTHESIA_ENUM_PTR_MARSHALL_HELPER(in, out, OxygenSource) + if (in.m_PositiveEndExpiredPressure != nullptr) { - io::Property::UnMarshall(*in.m_PositiveEndExpiredPressure, out.PositiveEndExpiredPressure()); - } - if (in.HasPrimaryGas()) { - out.PrimaryGas(in.m_PrimaryGas); + io::Property::Marshall(*in.m_PositiveEndExpiredPressure, out.PositiveEndExpiredPressure()); } + SE_OPTIONAL_ANESTHESIA_ENUM_PTR_MARSHALL_HELPER(in, out, PrimaryGas) + if (in.m_RespiratoryRate != nullptr) { - io::Property::UnMarshall(*in.m_RespiratoryRate, out.RespiratoryRate()); + io::Property::Marshall(*in.m_RespiratoryRate, out.RespiratoryRate()); } if (in.m_ReliefValvePressure != nullptr) { - io::Property::UnMarshall(*in.m_ReliefValvePressure, out.ReliefValvePressure()); + io::Property::Marshall(*in.m_ReliefValvePressure, out.ReliefValvePressure()); } if (in.m_VentilatorPressure != nullptr) { - io::Property::UnMarshall(*in.m_VentilatorPressure, out.VentilatorPressure()); + io::Property::Marshall(*in.m_VentilatorPressure, out.VentilatorPressure()); } if (in.HasLeftChamber()) { - UnMarshall(*in.m_LeftChamber, out.LeftChamber()); + Marshall(*in.m_LeftChamber, out.LeftChamber()); } if (in.HasRightChamber()) { - UnMarshall(*in.m_RightChamber, out.RightChamber()); + Marshall(*in.m_RightChamber, out.RightChamber()); } if (in.HasOxygenBottleOne()) { - UnMarshall(*in.m_OxygenBottleOne, out.OxygenBottleOne()); + Marshall(*in.m_OxygenBottleOne, out.OxygenBottleOne()); } if (in.HasOxygenBottleTwo()) { - UnMarshall(*in.m_OxygenBottleTwo, out.OxygenBottleTwo()); + Marshall(*in.m_OxygenBottleTwo, out.OxygenBottleTwo()); } SEScalarTime time; @@ -136,20 +137,30 @@ namespace io { } CDM::ActiveAnesthesiaMachineEventData* eData = new CDM::ActiveAnesthesiaMachineEventData(); - eData->Event(itr.first); - io::Property::UnMarshall(time, eData->Duration()); + + eData->Event(std::make_uniqueEvent())>::type>()); + io::Anesthesia::Marshall(itr.first, eData->Event()); + + // ::mil::tatrc::physiology::datamodel::enumAnesthesiaMachineEvent + Anesthesia::Marshall(itr.first, eData->Event()); + + eData->Duration(std::make_uniqueDuration())>::type>()); + io::Property::Marshall(time, eData->Duration()); + out.ActiveEvent().push_back(std::unique_ptr(eData)); } } //---------------------------------------------------------------------------------- - //class SEAnesthesiaMachineChamber - void Anesthesia::Marshall(const CDM::AnesthesiaMachineChamberData& in, SEAnesthesiaMachineChamber& out) + // class SEAnesthesiaMachineChamber + void Anesthesia::UnMarshall(const CDM::AnesthesiaMachineChamberData& in, SEAnesthesiaMachineChamber& out) { if (in.State().present()) { - out.SetState(in.State().get()); + auto state = out.GetState(); + Property::UnMarshall(in.State(), state); + out.SetState(state); } if (in.SubstanceFraction().present()) { - io::Property::Marshall(in.SubstanceFraction(), out.GetSubstanceFraction()); + io::Property::UnMarshall(in.SubstanceFraction(), out.GetSubstanceFraction()); } if (in.Substance().present()) { out.m_Substance = out.m_Substances.GetSubstance(in.Substance().get()); @@ -161,33 +172,243 @@ namespace io { } } //---------------------------------------------------------------------------------- - void Anesthesia::UnMarshall(const SEAnesthesiaMachineChamber& in, CDM::AnesthesiaMachineChamberData& out) + void Anesthesia::Marshall(const SEAnesthesiaMachineChamber& in, CDM::AnesthesiaMachineChamberData& out) { - if (in.HasState()) { - out.State(in.m_State); - } + io::Property::Marshall(in.GetState(), out.State()); + if (in.m_SubstanceFraction != nullptr) { - io::Property::UnMarshall(*in.m_SubstanceFraction, out.SubstanceFraction()); + io::Property::Marshall(*in.m_SubstanceFraction, out.SubstanceFraction()); } if (in.HasSubstance()) { out.Substance(in.m_Substance->GetName()); } } //---------------------------------------------------------------------------------- - //class SEAnesthesiaMachineOxygenBottle - void Anesthesia::Marshall(const CDM::AnesthesiaMachineOxygenBottleData& in, SEAnesthesiaMachineOxygenBottle& out) + // class SEAnesthesiaMachineOxygenBottle + void Anesthesia::UnMarshall(const CDM::AnesthesiaMachineOxygenBottleData& in, SEAnesthesiaMachineOxygenBottle& out) { if (in.Volume().present()) { - io::Property::Marshall(in.Volume(), out.GetVolume()); + io::Property::UnMarshall(in.Volume(), out.GetVolume()); } } //---------------------------------------------------------------------------------- - void Anesthesia::UnMarshall(const SEAnesthesiaMachineOxygenBottle& in, CDM::AnesthesiaMachineOxygenBottleData& out) + void Anesthesia::Marshall(const SEAnesthesiaMachineOxygenBottle& in, CDM::AnesthesiaMachineOxygenBottleData& out) { if (in.m_Volume != nullptr) { - io::Property::UnMarshall(*in.m_Volume, out.Volume()); + io::Property::Marshall(*in.m_Volume, out.Volume()); } } //---------------------------------------------------------------------------------- + // SEAnesthesiaMachineEvent + void Anesthesia::UnMarshall(const CDM::enumAnesthesiaMachineEvent& in, SEAnesthesiaMachineEvent& out) + { + try { + switch (in) { + case CDM::enumAnesthesiaMachineEvent::OxygenBottle1Exhausted: + out = SEAnesthesiaMachineEvent::OxygenBottle1Exhausted; + break; + case CDM::enumAnesthesiaMachineEvent::OxygenBottle2Exhausted: + out = SEAnesthesiaMachineEvent::OxygenBottle2Exhausted; + break; + case CDM::enumAnesthesiaMachineEvent::ReliefValveActive: + out = SEAnesthesiaMachineEvent::ReliefValveActive; + break; + default: + out = SEAnesthesiaMachineEvent::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SEAnesthesiaMachineEvent::Invalid; + } + } + void Anesthesia::Marshall(const SEAnesthesiaMachineEvent& in, CDM::enumAnesthesiaMachineEvent& out) + { + switch (in) { + case SEAnesthesiaMachineEvent::OxygenBottle1Exhausted: + out = CDM::enumAnesthesiaMachineEvent::OxygenBottle1Exhausted; + break; + case SEAnesthesiaMachineEvent::OxygenBottle2Exhausted: + out = CDM::enumAnesthesiaMachineEvent::OxygenBottle2Exhausted; + break; + case SEAnesthesiaMachineEvent::ReliefValveActive: + out = CDM::enumAnesthesiaMachineEvent::ReliefValveActive; + break; + + default: + out = ""; + break; + } + } + // SEAnesthesiaMachineOxygenSource + void Anesthesia::UnMarshall(const CDM::enumAnesthesiaMachineOxygenSource& in, SEAnesthesiaMachineOxygenSource& out) + { + try { + switch (in) { + case CDM::enumAnesthesiaMachineOxygenSource::BottleOne: + out = SEAnesthesiaMachineOxygenSource::BottleOne; + break; + case CDM::enumAnesthesiaMachineOxygenSource::BottleTwo: + out = SEAnesthesiaMachineOxygenSource::BottleTwo; + break; + case CDM::enumAnesthesiaMachineOxygenSource::Wall: + out = SEAnesthesiaMachineOxygenSource::Wall; + break; + default: + out = SEAnesthesiaMachineOxygenSource::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SEAnesthesiaMachineOxygenSource::Invalid; + } + } + void Anesthesia::Marshall(const SEAnesthesiaMachineOxygenSource& in, CDM::enumAnesthesiaMachineOxygenSource& out) + { + switch (in) { + case SEAnesthesiaMachineOxygenSource::BottleOne: + out = CDM::enumAnesthesiaMachineOxygenSource::BottleOne; + break; + case SEAnesthesiaMachineOxygenSource::BottleTwo: + out = CDM::enumAnesthesiaMachineOxygenSource::BottleTwo; + break; + case SEAnesthesiaMachineOxygenSource::Wall: + out = CDM::enumAnesthesiaMachineOxygenSource::Wall; + break; + default: + out = ""; + break; + } + } + // SEAnesthesiaMachinePrimaryGas + void Anesthesia::UnMarshall(const CDM::enumAnesthesiaMachinePrimaryGas& in, SEAnesthesiaMachinePrimaryGas& out) + { + try { + switch (in) { + case CDM::enumAnesthesiaMachinePrimaryGas::Air: + out = SEAnesthesiaMachinePrimaryGas::Air; + break; + case CDM::enumAnesthesiaMachinePrimaryGas::Nitrogen: + out = SEAnesthesiaMachinePrimaryGas::Nitrogen; + break; + default: + out = SEAnesthesiaMachinePrimaryGas::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SEAnesthesiaMachinePrimaryGas::Invalid; + } + } + void Anesthesia::Marshall(const SEAnesthesiaMachinePrimaryGas& in, CDM::enumAnesthesiaMachinePrimaryGas& out) + { + switch (in) { + case SEAnesthesiaMachinePrimaryGas::Air: + out = CDM::enumAnesthesiaMachinePrimaryGas::Air; + break; + case SEAnesthesiaMachinePrimaryGas::Nitrogen: + out = CDM::enumAnesthesiaMachinePrimaryGas::Nitrogen; + break; + default: + out = ""; + break; + } + } + // SEAnesthesiaMachineConnection + void Anesthesia::UnMarshall(const CDM::enumAnesthesiaMachineConnection& in, SEAnesthesiaMachineConnection& out) + { + try { + switch (in) { + case CDM::enumAnesthesiaMachineConnection::Mask: + out = SEAnesthesiaMachineConnection::Mask; + break; + case CDM::enumAnesthesiaMachineConnection::Off: + out = SEAnesthesiaMachineConnection::Off; + break; + case CDM::enumAnesthesiaMachineConnection::Tube: + out = SEAnesthesiaMachineConnection::Tube; + break; + default: + out = SEAnesthesiaMachineConnection::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SEAnesthesiaMachineConnection::Invalid; + } + } + void Anesthesia::Marshall(const SEAnesthesiaMachineConnection& in, CDM::enumAnesthesiaMachineConnection& out) + { + switch (in) { + case SEAnesthesiaMachineConnection::Off: + out = CDM::enumAnesthesiaMachineConnection::Off; + break; + case SEAnesthesiaMachineConnection::Mask: + out = CDM::enumAnesthesiaMachineConnection::Mask; + break; + case SEAnesthesiaMachineConnection::Tube: + out = CDM::enumAnesthesiaMachineConnection::Tube; + break; + default: + out = ""; + break; + } + } +} + +bool operator==(CDM::enumAnesthesiaMachineEvent const& lhs, SEAnesthesiaMachineEvent const& rhs) +{ + switch (rhs) { + case SEAnesthesiaMachineEvent::OxygenBottle1Exhausted: + return (CDM::enumAnesthesiaMachineEvent::OxygenBottle1Exhausted == lhs); + case SEAnesthesiaMachineEvent::OxygenBottle2Exhausted: + return (CDM::enumAnesthesiaMachineEvent::OxygenBottle2Exhausted == lhs); + case SEAnesthesiaMachineEvent::ReliefValveActive: + return (CDM::enumAnesthesiaMachineEvent::ReliefValveActive == lhs); + case SEAnesthesiaMachineEvent::Invalid: + return ((CDM::enumAnesthesiaMachineEvent::value)-1 == lhs); + default: + return false; + } +} +bool operator==(CDM::enumAnesthesiaMachineOxygenSource const& lhs, SEAnesthesiaMachineOxygenSource const& rhs) +{ + switch (rhs) { + case SEAnesthesiaMachineOxygenSource::BottleOne: + return (CDM::enumAnesthesiaMachineOxygenSource::BottleOne == lhs); + case SEAnesthesiaMachineOxygenSource::BottleTwo: + return (CDM::enumAnesthesiaMachineOxygenSource::BottleTwo == lhs); + case SEAnesthesiaMachineOxygenSource::Wall: + return (CDM::enumAnesthesiaMachineOxygenSource::Wall == lhs); + case SEAnesthesiaMachineOxygenSource::Invalid: + return ((CDM::enumAnesthesiaMachineOxygenSource::value)-1 == lhs); + default: + return false; + } +} +bool operator==(CDM::enumAnesthesiaMachinePrimaryGas const& lhs, SEAnesthesiaMachinePrimaryGas const& rhs) +{ + switch (rhs) { + case SEAnesthesiaMachinePrimaryGas::Air: + return (CDM::enumAnesthesiaMachinePrimaryGas::Air == lhs); + case SEAnesthesiaMachinePrimaryGas::Nitrogen: + return (CDM::enumAnesthesiaMachinePrimaryGas::Nitrogen == lhs); + case SEAnesthesiaMachinePrimaryGas::Invalid: + return ((CDM::enumAnesthesiaMachinePrimaryGas::value)-1 == lhs); + default: + return false; + } +} +bool operator==(CDM::enumAnesthesiaMachineConnection const& lhs, SEAnesthesiaMachineConnection const& rhs) +{ + switch (rhs) { + case SEAnesthesiaMachineConnection::Off: + return (CDM::enumAnesthesiaMachineConnection::Off == lhs); + case SEAnesthesiaMachineConnection::Mask: + return (CDM::enumAnesthesiaMachineConnection::Mask == lhs); + case SEAnesthesiaMachineConnection::Tube: + return (CDM::enumAnesthesiaMachineConnection::Tube == lhs); + case SEAnesthesiaMachineConnection::Invalid: + return ((CDM::enumAnesthesiaMachineConnection::value)-1 == lhs); + default: + return false; + } +} + } -} \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/io/cdm/Anesthesia.h b/projects/biogears/libBiogears/src/io/cdm/Anesthesia.h index 199696ef6..19e9adc1e 100644 --- a/projects/biogears/libBiogears/src/io/cdm/Anesthesia.h +++ b/projects/biogears/libBiogears/src/io/cdm/Anesthesia.h @@ -12,23 +12,32 @@ specific language governing permissions and limitations under the License. #pragma once #include +#include #include +#include #include #include -#define CDM_ANESTHESIA_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_ANESTHESIA_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ out.func(std::make_unique::type>()); \ - io::Anesthesia::UnMarshall(*in.m_##func, out.func()); \ + io::Anesthesia::Marshall(*in.m_##func, out.func()); \ } -#define CDM_OPTIONAL_ANESTHESIA_UNMARSHAL_HELPER(in, out, func) \ - if (in.m_##func) { \ - io::Anesthesia::UnMarshall(*in.m_##func, out.func()); \ +#define CDM_OPTIONAL_ANESTHESIA_PTR_MARSHALL_HELPER(in, out, func) \ + io::Anesthesia::Marshall(*in.m_##func, out.func()); + +#define SE_ANESTHESIA_ENUM_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.Has##func()) { \ + out.func(std::make_unique::type>()); \ + io::Anesthesia::Marshall(in.m_##func, out.func()); \ } +#define SE_OPTIONAL_ANESTHESIA_ENUM_PTR_MARSHALL_HELPER(in, out, func) \ + io::Anesthesia::Marshall(in.m_##func, out.func()); + namespace biogears { class SEAnesthesiaMachine; class SEAnesthesiaMachineChamber; @@ -37,38 +46,124 @@ class SEAnesthesiaMachineOxygenBottle; namespace io { class BIOGEARS_PRIVATE_API Anesthesia { public: - //template option + // template option + template ::value>* = nullptr> + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); + template ::value>* = nullptr> + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); - template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); - //class SEAnesthesiaMachine - static void Marshall(const CDM::AnesthesiaMachineData& in, SEAnesthesiaMachine& out); - static void UnMarshall(const SEAnesthesiaMachine& in, CDM::AnesthesiaMachineData & out); - //class SEAnesthesiaMachineChamber - static void Marshall(const CDM::AnesthesiaMachineChamberData& in, SEAnesthesiaMachineChamber& out); - static void UnMarshall(const SEAnesthesiaMachineChamber& in, CDM::AnesthesiaMachineChamberData& out); - //class SEAnesthesiaMachineOxygenBottle - static void Marshall(const CDM::AnesthesiaMachineOxygenBottleData& in, SEAnesthesiaMachineOxygenBottle& out); - static void UnMarshall(const SEAnesthesiaMachineOxygenBottle& in, CDM::AnesthesiaMachineOxygenBottleData& out); + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); + // class SEAnesthesiaMachine + static void UnMarshall(const CDM::AnesthesiaMachineData& in, SEAnesthesiaMachine& out); + static void Marshall(const SEAnesthesiaMachine& in, CDM::AnesthesiaMachineData& out); + // class SEAnesthesiaMachineChamber + static void UnMarshall(const CDM::AnesthesiaMachineChamberData& in, SEAnesthesiaMachineChamber& out); + static void Marshall(const SEAnesthesiaMachineChamber& in, CDM::AnesthesiaMachineChamberData& out); + // class SEAnesthesiaMachineOxygenBottle + static void UnMarshall(const CDM::AnesthesiaMachineOxygenBottleData& in, SEAnesthesiaMachineOxygenBottle& out); + static void Marshall(const SEAnesthesiaMachineOxygenBottle& in, CDM::AnesthesiaMachineOxygenBottleData& out); + + // SEAnesthesiaMachineEvent + static void UnMarshall(const CDM::enumAnesthesiaMachineEvent& in, SEAnesthesiaMachineEvent& out); + static void Marshall(const SEAnesthesiaMachineEvent& in, CDM::enumAnesthesiaMachineEvent& out); + // SEAnesthesiaMachineOxygenSource + static void UnMarshall(const CDM::enumAnesthesiaMachineOxygenSource& in, SEAnesthesiaMachineOxygenSource& out); + static void Marshall(const SEAnesthesiaMachineOxygenSource& in, CDM::enumAnesthesiaMachineOxygenSource& out); + // SEAnesthesiaMachinePrimaryGas + static void UnMarshall(const CDM::enumAnesthesiaMachinePrimaryGas& in, SEAnesthesiaMachinePrimaryGas& out); + static void Marshall(const SEAnesthesiaMachinePrimaryGas& in, CDM::enumAnesthesiaMachinePrimaryGas& out); + // SEAnesthesiaMachineConnection + static void UnMarshall(const CDM::enumAnesthesiaMachineConnection& in, SEAnesthesiaMachineConnection& out); + static void Marshall(const SEAnesthesiaMachineConnection& in, CDM::enumAnesthesiaMachineConnection& out); + }; //---------------------------------------------------------------------------------- - template - void Anesthesia::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + template ::value>*> + void Anesthesia::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) + { + if (!option_in.present() || option_in->empty()) { + out = SE::Invalid; + } else { + UnMarshall(option_in.get(), out); + } + } + + template ::value>*> + void Anesthesia::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) { if (!option_in.present()) { - out.Clear(); + out.Invalidate(); } else { - Marshall(option_in.get(), out); + UnMarshall(option_in.get(), out); } } + //---------------------------------------------------------------------------------- template - void Anesthesia::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void Anesthesia::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); + Marshall(in, *item); option_out.set(*item); } } // Namespace IO -} //Namespace Biogears + +// Operators +bool operator==(CDM::enumAnesthesiaMachineEvent const& lhs, SEAnesthesiaMachineEvent const& rhs); +bool operator==(CDM::enumAnesthesiaMachineOxygenSource const& lhs, SEAnesthesiaMachineOxygenSource const& rhs); +bool operator==(CDM::enumAnesthesiaMachinePrimaryGas const& lhs, SEAnesthesiaMachinePrimaryGas const& rhs); +bool operator==(CDM::enumAnesthesiaMachineConnection const& lhs, SEAnesthesiaMachineConnection const& rhs); + +inline bool operator==(SEAnesthesiaMachineEvent const& lhs, CDM::enumAnesthesiaMachineEvent const& rhs) +{ + return rhs == lhs; +} +inline bool operator==(SEAnesthesiaMachineOxygenSource const& lhs, CDM::enumAnesthesiaMachineOxygenSource const& rhs) +{ + return rhs == lhs; +} +inline bool operator==(SEAnesthesiaMachinePrimaryGas const& lhs, CDM::enumAnesthesiaMachinePrimaryGas const& rhs) +{ + return rhs == lhs; +} +inline bool operator==(SEAnesthesiaMachineConnection const& lhs, CDM::enumAnesthesiaMachineConnection const& rhs) +{ + return rhs == lhs; +} + +inline bool operator!=(CDM::enumAnesthesiaMachineEvent const& lhs, SEAnesthesiaMachineEvent const& rhs) +{ + return !(lhs == rhs); +} +inline bool operator!=(CDM::enumAnesthesiaMachineOxygenSource const& lhs, SEAnesthesiaMachineOxygenSource const& rhs) +{ + return !(lhs == rhs); +} +inline bool operator!=(CDM::enumAnesthesiaMachinePrimaryGas const& lhs, SEAnesthesiaMachinePrimaryGas const& rhs) +{ + return !(lhs == rhs); +} +inline bool operator!=(CDM::enumAnesthesiaMachineConnection const& lhs, SEAnesthesiaMachineConnection const& rhs) +{ + return !(lhs == rhs); +} + +inline bool operator!=(SEAnesthesiaMachineEvent const& lhs, CDM::enumAnesthesiaMachineEvent const& rhs) +{ + return !(rhs == lhs); +} +inline bool operator!=(SEAnesthesiaMachineOxygenSource const& lhs, CDM::enumAnesthesiaMachineOxygenSource const& rhs) +{ + return !(rhs == lhs); +} +inline bool operator!=(SEAnesthesiaMachinePrimaryGas const& lhs, CDM::enumAnesthesiaMachinePrimaryGas const& rhs) +{ + return !(rhs == lhs); +} +inline bool operator!=(SEAnesthesiaMachineConnection const& lhs, CDM::enumAnesthesiaMachineConnection const& rhs) +{ + return !(rhs == lhs); +} + + +} // Namespace Biogears diff --git a/projects/biogears/libBiogears/src/io/cdm/AnesthesiaActions.cpp b/projects/biogears/libBiogears/src/io/cdm/AnesthesiaActions.cpp index 83536c778..923e250e9 100644 --- a/projects/biogears/libBiogears/src/io/cdm/AnesthesiaActions.cpp +++ b/projects/biogears/libBiogears/src/io/cdm/AnesthesiaActions.cpp @@ -8,6 +8,8 @@ #include +#include +#include #include #include #include @@ -23,342 +25,373 @@ #include #include #include + +#define POLYMORPHIC_MARSHALL(paramName, typeName) \ + if (auto typeName = dynamic_cast(paramName); typeName) { \ + auto typeName##Data = std::make_unique(); \ + Marshall(*typeName, *typeName##Data); \ + return std::move(typeName##Data); \ + } + +#define POLYMORPHIC_UNMARSHALL(paramName, typeName, schema) \ + if (auto typeName##Data = dynamic_cast(paramName); typeName##Data) { \ + auto typeName = std::make_unique(); \ + schema::UnMarshall(*typeName##Data, *typeName); \ + return std::move(typeName); \ + } + +#define STOCASTIC_POLYMORPHIC_UNMARSHALL(paramName, typeName, schema, engine) \ + if (auto typeName##Data = dynamic_cast(paramName); typeName##Data) { \ + auto typeName = std::make_unique(); \ + schema::UnMarshall(*typeName##Data, *typeName, engine); \ + return std::move(typeName); \ + } namespace biogears { namespace io { - void AnesthesiaActions::UnMarshall(const SEAnesthesiaMachineActionCollection& in, std::vector& out) + void AnesthesiaActions::Marshall(const SEAnesthesiaMachineActionCollection& in, std::vector& out) { if (in.HasConfiguration()) { auto data = std::make_unique(); - io::AnesthesiaActions::UnMarshall(*in.GetConfiguration(), *data); + io::AnesthesiaActions::Marshall(*in.GetConfiguration(), *data); out.push_back(data.release()); } if (in.HasOxygenTankPressureLoss()) { auto data = std::make_unique(); - io::AnesthesiaActions::UnMarshall(*in.GetOxygenTankPressureLoss(), *data); + io::AnesthesiaActions::Marshall(*in.GetOxygenTankPressureLoss(), *data); out.push_back(data.release()); } if (in.HasOxygenWallPortPressureLoss()) { auto data = std::make_unique(); - io::AnesthesiaActions::UnMarshall(*in.GetOxygenWallPortPressureLoss(), *data); + io::AnesthesiaActions::Marshall(*in.GetOxygenWallPortPressureLoss(), *data); out.push_back(data.release()); } if (in.HasExpiratoryValveLeak()) { auto data = std::make_unique(); - io::AnesthesiaActions::UnMarshall(*in.GetExpiratoryValveLeak(), *data); + io::AnesthesiaActions::Marshall(*in.GetExpiratoryValveLeak(), *data); out.push_back(data.release()); } if (in.HasExpiratoryValveObstruction()) { auto data = std::make_unique(); - io::AnesthesiaActions::UnMarshall(*in.GetExpiratoryValveObstruction(), *data); + io::AnesthesiaActions::Marshall(*in.GetExpiratoryValveObstruction(), *data); out.push_back(data.release()); } if (in.HasInspiratoryValveLeak()) { auto data = std::make_unique(); - io::AnesthesiaActions::UnMarshall(*in.GetInspiratoryValveLeak(), *data); + io::AnesthesiaActions::Marshall(*in.GetInspiratoryValveLeak(), *data); out.push_back(data.release()); } if (in.HasInspiratoryValveObstruction()) { auto data = std::make_unique(); - io::AnesthesiaActions::UnMarshall(*in.GetInspiratoryValveObstruction(), *data); + io::AnesthesiaActions::Marshall(*in.GetInspiratoryValveObstruction(), *data); out.push_back(data.release()); } if (in.HasMaskLeak()) { auto data = std::make_unique(); - io::AnesthesiaActions::UnMarshall(*in.GetMaskLeak(), *data); + io::AnesthesiaActions::Marshall(*in.GetMaskLeak(), *data); out.push_back(data.release()); } if (in.HasSodaLimeFailure()) { auto data = std::make_unique(); - io::AnesthesiaActions::UnMarshall(*in.GetSodaLimeFailure(), *data); + io::AnesthesiaActions::Marshall(*in.GetSodaLimeFailure(), *data); out.push_back(data.release()); } if (in.HasTubeCuffLeak()) { auto data = std::make_unique(); - io::AnesthesiaActions::UnMarshall(*in.GetTubeCuffLeak(), *data); + io::AnesthesiaActions::Marshall(*in.GetTubeCuffLeak(), *data); out.push_back(data.release()); } if (in.HasVaporizerFailure()) { auto data = std::make_unique(); - io::AnesthesiaActions::UnMarshall(*in.GetVaporizerFailure(), *data); + io::AnesthesiaActions::Marshall(*in.GetVaporizerFailure(), *data); out.push_back(data.release()); } if (in.HasVentilatorPressureLoss()) { auto data = std::make_unique(); - io::AnesthesiaActions::UnMarshall(*in.GetVentilatorPressureLoss(), *data); + io::AnesthesiaActions::Marshall(*in.GetVentilatorPressureLoss(), *data); out.push_back(data.release()); } if (in.HasYPieceDisconnect()) { auto data = std::make_unique(); - io::AnesthesiaActions::UnMarshall(*in.GetYPieceDisconnect(), *data); + io::AnesthesiaActions::Marshall(*in.GetYPieceDisconnect(), *data); out.push_back(data.release()); } } // class SEAnesthesiaMachineAction - void AnesthesiaActions::Marshall(const CDM::AnesthesiaMachineActionData& in, SEAnesthesiaMachineAction& out) + void AnesthesiaActions::UnMarshall(const CDM::AnesthesiaMachineActionData& in, SEAnesthesiaMachineAction& out, std::default_random_engine* rd) { - io::Scenario::Marshall(static_cast(in), static_cast(out)); + io::Actions::UnMarshall(static_cast(in), static_cast(out)); } //---------------------------------------------------------------------------------- - void AnesthesiaActions::UnMarshall(const SEAnesthesiaMachineAction& in, CDM::AnesthesiaMachineActionData& out) + void AnesthesiaActions::Marshall(const SEAnesthesiaMachineAction& in, CDM::AnesthesiaMachineActionData& out) { - io::Scenario::UnMarshall(static_cast(in), static_cast(out)); + io::Actions::Marshall(static_cast(in), static_cast(out)); } //---------------------------------------------------------------------------------- // class SEAnesthesiaMachineConfiguration - void AnesthesiaActions::Marshall(const CDM::AnesthesiaMachineConfigurationData& in, SEAnesthesiaMachineConfiguration& out) + void AnesthesiaActions::UnMarshall(const CDM::AnesthesiaMachineConfigurationData& in, SEAnesthesiaMachineConfiguration& out, std::default_random_engine* rd) { - Marshall(static_cast(in), static_cast(out)); + UnMarshall(static_cast(in), static_cast(out)); if (in.ConfigurationFile().present()) out.SetConfigurationFile(in.ConfigurationFile().get()); - io::Anesthesia::Marshall(in.Configuration(), out.GetConfiguration()); + io::Anesthesia::UnMarshall(in.Configuration(), out.GetConfiguration()); } //---------------------------------------------------------------------------------- - void AnesthesiaActions::UnMarshall(const SEAnesthesiaMachineConfiguration& in, CDM::AnesthesiaMachineConfigurationData& out) + void AnesthesiaActions::Marshall(const SEAnesthesiaMachineConfiguration& in, CDM::AnesthesiaMachineConfigurationData& out) { - UnMarshall(static_cast(in), static_cast(out)); + Marshall(static_cast(in), static_cast(out)); if (in.HasConfiguration()) - io::Anesthesia::UnMarshall(*in.GetConfiguration(), out.Configuration()); + io::Anesthesia::Marshall(*in.GetConfiguration(), out.Configuration()); else if (in.HasConfigurationFile()) out.ConfigurationFile(in.GetConfigurationFile()); } //---------------------------------------------------------------------------------- // class SEExpiratoryValveLeak - void AnesthesiaActions::Marshall(const CDM::ExpiratoryValveLeakData& in, SEExpiratoryValveLeak& out) + void AnesthesiaActions::UnMarshall(const CDM::ExpiratoryValveLeakData& in, SEExpiratoryValveLeak& out, std::default_random_engine* rd) { - Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.Severity(), out.GetSeverity()); + UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.Severity(), out.GetSeverity()); } //---------------------------------------------------------------------------------- - void AnesthesiaActions::UnMarshall(const SEExpiratoryValveLeak& in, CDM::ExpiratoryValveLeakData& out) + void AnesthesiaActions::Marshall(const SEExpiratoryValveLeak& in, CDM::ExpiratoryValveLeakData& out) { - UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Severity) + Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Severity) } //---------------------------------------------------------------------------------- // class SEExpiratoryValveObstruction - void AnesthesiaActions::Marshall(const CDM::ExpiratoryValveObstructionData& in, SEExpiratoryValveObstruction& out) + void AnesthesiaActions::UnMarshall(const CDM::ExpiratoryValveObstructionData& in, SEExpiratoryValveObstruction& out, std::default_random_engine* rd) { - Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.Severity(), out.GetSeverity()); + UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.Severity(), out.GetSeverity()); } //---------------------------------------------------------------------------------- - void AnesthesiaActions::UnMarshall(const SEExpiratoryValveObstruction& in, CDM::ExpiratoryValveObstructionData& out) + void AnesthesiaActions::Marshall(const SEExpiratoryValveObstruction& in, CDM::ExpiratoryValveObstructionData& out) { - UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Severity) + Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Severity) } //---------------------------------------------------------------------------------- // class SEInspiratoryValveLeak - void AnesthesiaActions::Marshall(const CDM::InspiratoryValveLeakData& in, SEInspiratoryValveLeak& out) + void AnesthesiaActions::UnMarshall(const CDM::InspiratoryValveLeakData& in, SEInspiratoryValveLeak& out, std::default_random_engine* rd) { - Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.Severity(), out.GetSeverity()); + UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.Severity(), out.GetSeverity()); } //---------------------------------------------------------------------------------- - void AnesthesiaActions::UnMarshall(const SEInspiratoryValveLeak& in, CDM::InspiratoryValveLeakData& out) + void AnesthesiaActions::Marshall(const SEInspiratoryValveLeak& in, CDM::InspiratoryValveLeakData& out) { - UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Severity) + Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Severity) } //---------------------------------------------------------------------------------- // class SEInspiratoryValveObstruction - void AnesthesiaActions::Marshall(const CDM::InspiratoryValveObstructionData& in, SEInspiratoryValveObstruction& out) + void AnesthesiaActions::UnMarshall(const CDM::InspiratoryValveObstructionData& in, SEInspiratoryValveObstruction& out, std::default_random_engine* rd) { - Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.Severity(), out.GetSeverity()); + UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.Severity(), out.GetSeverity()); } //---------------------------------------------------------------------------------- - void AnesthesiaActions::UnMarshall(const SEInspiratoryValveObstruction& in, CDM::InspiratoryValveObstructionData& out) + void AnesthesiaActions::Marshall(const SEInspiratoryValveObstruction& in, CDM::InspiratoryValveObstructionData& out) { - UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Severity) + Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Severity) } //---------------------------------------------------------------------------------- // class SEMaskLeak - void AnesthesiaActions::Marshall(const CDM::MaskLeakData& in, SEMaskLeak& out) + void AnesthesiaActions::UnMarshall(const CDM::MaskLeakData& in, SEMaskLeak& out, std::default_random_engine* rd) { - Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.Severity(), out.GetSeverity()); + UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.Severity(), out.GetSeverity()); } //---------------------------------------------------------------------------------- - void AnesthesiaActions::UnMarshall(const SEMaskLeak& in, CDM::MaskLeakData& out) + void AnesthesiaActions::Marshall(const SEMaskLeak& in, CDM::MaskLeakData& out) { - UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Severity) + Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Severity) } //---------------------------------------------------------------------------------- // class SESodaLimeFailure - void AnesthesiaActions::Marshall(const CDM::SodaLimeFailureData& in, SESodaLimeFailure& out) + void AnesthesiaActions::UnMarshall(const CDM::SodaLimeFailureData& in, SESodaLimeFailure& out, std::default_random_engine* rd) { - Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.Severity(), out.GetSeverity()); + UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.Severity(), out.GetSeverity()); } //---------------------------------------------------------------------------------- - void AnesthesiaActions::UnMarshall(const SESodaLimeFailure& in, CDM::SodaLimeFailureData& out) + void AnesthesiaActions::Marshall(const SESodaLimeFailure& in, CDM::SodaLimeFailureData& out) { - UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Severity) + Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Severity) } //---------------------------------------------------------------------------------- // class SETubeCuffLeak - void AnesthesiaActions::Marshall(const CDM::TubeCuffLeakData& in, SETubeCuffLeak& out) + void AnesthesiaActions::UnMarshall(const CDM::TubeCuffLeakData& in, SETubeCuffLeak& out, std::default_random_engine* rd) { - Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.Severity(), out.GetSeverity()); + UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.Severity(), out.GetSeverity()); } //---------------------------------------------------------------------------------- - void AnesthesiaActions::UnMarshall(const SETubeCuffLeak& in, CDM::TubeCuffLeakData& out) + void AnesthesiaActions::Marshall(const SETubeCuffLeak& in, CDM::TubeCuffLeakData& out) { - UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Severity) + Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Severity) } //---------------------------------------------------------------------------------- // class SEVaporizerFailure - void AnesthesiaActions::Marshall(const CDM::VaporizerFailureData& in, SEVaporizerFailure& out) + void AnesthesiaActions::UnMarshall(const CDM::VaporizerFailureData& in, SEVaporizerFailure& out, std::default_random_engine* rd) { - Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.Severity(), out.GetSeverity()); + UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.Severity(), out.GetSeverity()); } //---------------------------------------------------------------------------------- - void AnesthesiaActions::UnMarshall(const SEVaporizerFailure& in, CDM::VaporizerFailureData& out) + void AnesthesiaActions::Marshall(const SEVaporizerFailure& in, CDM::VaporizerFailureData& out) { - UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Severity) + Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Severity) } //---------------------------------------------------------------------------------- // class SEVentilatorPressureLoss - void AnesthesiaActions::Marshall(const CDM::VentilatorPressureLossData& in, SEVentilatorPressureLoss& out) + void AnesthesiaActions::UnMarshall(const CDM::VentilatorPressureLossData& in, SEVentilatorPressureLoss& out, std::default_random_engine* rd) { - Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.Severity(), out.GetSeverity()); + UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.Severity(), out.GetSeverity()); } //---------------------------------------------------------------------------------- - void AnesthesiaActions::UnMarshall(const SEVentilatorPressureLoss& in, CDM::VentilatorPressureLossData& out) + void AnesthesiaActions::Marshall(const SEVentilatorPressureLoss& in, CDM::VentilatorPressureLossData& out) { - UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Severity) + Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Severity) } //---------------------------------------------------------------------------------- // class SEYPieceDisconnect - void AnesthesiaActions::Marshall(const CDM::YPieceDisconnectData& in, SEYPieceDisconnect& out) + void AnesthesiaActions::UnMarshall(const CDM::YPieceDisconnectData& in, SEYPieceDisconnect& out, std::default_random_engine* rd) { - Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.Severity(), out.GetSeverity()); + UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.Severity(), out.GetSeverity(), rd); } //---------------------------------------------------------------------------------- - void AnesthesiaActions::UnMarshall(const SEYPieceDisconnect& in, CDM::YPieceDisconnectData& out) + void AnesthesiaActions::Marshall(const SEYPieceDisconnect& in, CDM::YPieceDisconnectData& out) { - UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Severity) + Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Severity) } //---------------------------------------------------------------------------------- // class SEOxygenWallPortPressureLoss - void AnesthesiaActions::Marshall(const CDM::OxygenWallPortPressureLossData& in, SEOxygenWallPortPressureLoss& out) + void AnesthesiaActions::UnMarshall(const CDM::OxygenWallPortPressureLossData& in, SEOxygenWallPortPressureLoss& out, std::default_random_engine* rd) { - Marshall(static_cast(in), static_cast(out)); - out.SetActive(in.State() == CDM::enumOnOff::On ? true : false); + UnMarshall(static_cast(in), static_cast(out)); + out.SetActive(in.State() == SEOnOff::On ? true : false); } //---------------------------------------------------------------------------------- - void AnesthesiaActions::UnMarshall(const SEOxygenWallPortPressureLoss& in, CDM::OxygenWallPortPressureLossData& out) + void AnesthesiaActions::Marshall(const SEOxygenWallPortPressureLoss& in, CDM::OxygenWallPortPressureLossData& out) { - UnMarshall(static_cast(in), static_cast(out)); + Marshall(static_cast(in), static_cast(out)); + out.State(in.IsActive() ? CDM::enumOnOff::On : CDM::enumOnOff::Off); } //---------------------------------------------------------------------------------- // class SEOxygenTankPressureLoss - void AnesthesiaActions::Marshall(const CDM::OxygenTankPressureLossData& in, SEOxygenTankPressureLoss& out) + void AnesthesiaActions::UnMarshall(const CDM::OxygenTankPressureLossData& in, SEOxygenTankPressureLoss& out, std::default_random_engine* rd) { - Marshall(static_cast(in), static_cast(out)); - out.SetActive(in.State() == CDM::enumOnOff::On ? true : false); + UnMarshall(static_cast(in), static_cast(out)); + out.SetActive(in.State() == SEOnOff::On ? true : false); } //---------------------------------------------------------------------------------- - void AnesthesiaActions::UnMarshall(const SEOxygenTankPressureLoss& in, CDM::OxygenTankPressureLossData& out) + + void AnesthesiaActions::Marshall(const SEOxygenTankPressureLoss& in, CDM::OxygenTankPressureLossData& out) { - UnMarshall(static_cast(in), static_cast(out)); - out.State(in.IsActive() ? CDM::enumOnOff::On : CDM::enumOnOff::Off); + Marshall(static_cast(in), static_cast(out)); + out.State(std::make_unique::type>()); + io::Property::Marshall(in.m_State, out.State()); } + //---------------------------------------------------------------------------------- std::unique_ptr AnesthesiaActions::factory(const SEAnesthesiaMachineAction* anesthesiaMachineAction) { - if (auto oxygenTankPressureLoss = dynamic_cast(anesthesiaMachineAction); oxygenTankPressureLoss) { - auto oxygenTankPressureLossData = std::make_unique(); - UnMarshall(*oxygenTankPressureLoss, *oxygenTankPressureLossData); - return std::move(oxygenTankPressureLossData); - } + POLYMORPHIC_MARSHALL(anesthesiaMachineAction, OxygenTankPressureLoss) + POLYMORPHIC_MARSHALL(anesthesiaMachineAction, OxygenWallPortPressureLoss) + POLYMORPHIC_MARSHALL(anesthesiaMachineAction, YPieceDisconnect) + POLYMORPHIC_MARSHALL(anesthesiaMachineAction, VentilatorPressureLoss) + POLYMORPHIC_MARSHALL(anesthesiaMachineAction, VaporizerFailure) + POLYMORPHIC_MARSHALL(anesthesiaMachineAction, TubeCuffLeak) + POLYMORPHIC_MARSHALL(anesthesiaMachineAction, SodaLimeFailure) + POLYMORPHIC_MARSHALL(anesthesiaMachineAction, MaskLeak) + POLYMORPHIC_MARSHALL(anesthesiaMachineAction, InspiratoryValveObstruction) + POLYMORPHIC_MARSHALL(anesthesiaMachineAction, InspiratoryValveLeak) + POLYMORPHIC_MARSHALL(anesthesiaMachineAction, ExpiratoryValveObstruction) + POLYMORPHIC_MARSHALL(anesthesiaMachineAction, ExpiratoryValveLeak) + POLYMORPHIC_MARSHALL(anesthesiaMachineAction, AnesthesiaMachineConfiguration) - if (auto oxygenWallPortPressureLoss = dynamic_cast(anesthesiaMachineAction); oxygenWallPortPressureLoss) { - auto oxygenWallPortPressureLossData = std::make_unique(); - UnMarshall(*oxygenWallPortPressureLoss, *oxygenWallPortPressureLossData); - return std::move(oxygenWallPortPressureLossData); - } + throw biogears::CommonDataModelException("AnesthesiaActions::factory does not support the derived SEAnesthesiaMachineAction. If you are not a developer contact upstream for support."); + } - if (auto yPieceDisconnect = dynamic_cast(anesthesiaMachineAction); yPieceDisconnect) { - auto yPieceDisconnectData = std::make_unique(); - UnMarshall(*yPieceDisconnect, *yPieceDisconnectData); - return std::move(yPieceDisconnectData); - } + std::unique_ptr AnesthesiaActions::factory(CDM::AnesthesiaMachineActionData const* anesthesiaMachineActionData, SESubstanceManager& substances, std::default_random_engine* rd) + { - if (auto ventilatorPressureLoss = dynamic_cast(anesthesiaMachineAction); ventilatorPressureLoss) { - auto ventilatorPressureLossData = std::make_unique(); - UnMarshall(*ventilatorPressureLoss, *ventilatorPressureLossData); - return std::move(ventilatorPressureLossData); + if (auto AnesthesiaMachineConfigurationData = dynamic_cast(anesthesiaMachineActionData); AnesthesiaMachineConfigurationData) { + auto AnesthesiaMachineConfiguration = std::make_unique(substances); + AnesthesiaActions::UnMarshall(*AnesthesiaMachineConfigurationData, *AnesthesiaMachineConfiguration, rd); + return std::move(AnesthesiaMachineConfiguration); } - if (auto vaporizerFailure = dynamic_cast(anesthesiaMachineAction); vaporizerFailure) { - auto vaporizerFailureData = std::make_unique(); - UnMarshall(*vaporizerFailure, *vaporizerFailureData); - return std::move(vaporizerFailureData); - } + STOCASTIC_POLYMORPHIC_UNMARSHALL(anesthesiaMachineActionData, OxygenWallPortPressureLoss, AnesthesiaActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(anesthesiaMachineActionData, OxygenTankPressureLoss, AnesthesiaActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(anesthesiaMachineActionData, ExpiratoryValveLeak, AnesthesiaActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(anesthesiaMachineActionData, ExpiratoryValveObstruction, AnesthesiaActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(anesthesiaMachineActionData, InspiratoryValveLeak, AnesthesiaActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(anesthesiaMachineActionData, InspiratoryValveObstruction, AnesthesiaActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(anesthesiaMachineActionData, MaskLeak, AnesthesiaActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(anesthesiaMachineActionData, SodaLimeFailure, AnesthesiaActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(anesthesiaMachineActionData, TubeCuffLeak, AnesthesiaActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(anesthesiaMachineActionData, VaporizerFailure, AnesthesiaActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(anesthesiaMachineActionData, VentilatorPressureLoss, AnesthesiaActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(anesthesiaMachineActionData, YPieceDisconnect, AnesthesiaActions, rd) + throw biogears::CommonDataModelException("PatientActions:Factory - Unsupported Anesthesia Machine Action Received."); + } - if (auto tubeCuffLeak = dynamic_cast(anesthesiaMachineAction); tubeCuffLeak) { - auto tubeCuffLeakData = std::make_unique(); - UnMarshall(*tubeCuffLeak, *tubeCuffLeakData); - return std::move(tubeCuffLeakData); + void AnesthesiaActions::Marshall(const SEAnesthesiaMachineActionCollection& in, std::vector>& out) + { + if (in.m_Configuration) { + out.push_back(AnesthesiaActions::factory(in.m_Configuration)); } - - if (auto sodaLimeFailure = dynamic_cast(anesthesiaMachineAction); sodaLimeFailure) { - auto sodaLimeFailureData = std::make_unique(); - UnMarshall(*sodaLimeFailure, *sodaLimeFailureData); - return std::move(sodaLimeFailureData); + // Anesthesia Machine Incidents + if (in.m_OxygenTankPressureLoss) { + out.push_back(AnesthesiaActions::factory(in.m_OxygenTankPressureLoss)); } - - if (auto maskLeak = dynamic_cast(anesthesiaMachineAction); maskLeak) { - auto maskLeakData = std::make_unique(); - UnMarshall(*maskLeak, *maskLeakData); - return std::move(maskLeakData); + if (in.m_OxygenWallPortPressureLoss) { + out.push_back(AnesthesiaActions::factory(in.m_OxygenWallPortPressureLoss)); } - - if (auto inspiratoryValveObstruction = dynamic_cast(anesthesiaMachineAction); inspiratoryValveObstruction) { - auto inspiratoryValveObstructionData = std::make_unique(); - UnMarshall(*inspiratoryValveObstruction, *inspiratoryValveObstructionData); - return std::move(inspiratoryValveObstructionData); + // Anesthesia Machine Failures + if (in.m_ExpiratoryValveLeak) { + out.push_back(AnesthesiaActions::factory(in.m_ExpiratoryValveLeak)); } - - if (auto inspiratoryValveLeak = dynamic_cast(anesthesiaMachineAction); inspiratoryValveLeak) { - auto inspiratoryValveLeakData = std::make_unique(); - UnMarshall(*inspiratoryValveLeak, *inspiratoryValveLeakData); - return std::move(inspiratoryValveLeakData); + if (in.m_ExpiratoryValveObstruction) { + out.push_back(AnesthesiaActions::factory(in.m_ExpiratoryValveObstruction)); } - - if (auto expiratoryValveObstruction = dynamic_cast(anesthesiaMachineAction); expiratoryValveObstruction) { - auto expiratoryValveObstructionData = std::make_unique(); - UnMarshall(*expiratoryValveObstruction, *expiratoryValveObstructionData); - return std::move(expiratoryValveObstructionData); + if (in.m_InspiratoryValveLeak) { + out.push_back(AnesthesiaActions::factory(in.m_InspiratoryValveLeak)); } - - if (auto expiratoryValveLeak = dynamic_cast(anesthesiaMachineAction); expiratoryValveLeak) { - auto expiratoryValveLeakData = std::make_unique(); - UnMarshall(*expiratoryValveLeak, *expiratoryValveLeakData); - return std::move(expiratoryValveLeakData); + if (in.m_InspiratoryValveObstruction) { + out.push_back(AnesthesiaActions::factory(in.m_InspiratoryValveObstruction)); } - - if (auto anesthesiaMachineConfiguration = dynamic_cast(anesthesiaMachineAction); anesthesiaMachineConfiguration) { - auto anesthesiaMachineConfigurationData = std::make_unique(); - UnMarshall(*anesthesiaMachineConfiguration, *anesthesiaMachineConfigurationData); - return std::move(anesthesiaMachineConfigurationData); + if (in.m_MaskLeak) { + out.push_back(AnesthesiaActions::factory(in.m_MaskLeak)); + } + if (in.m_SodaLimeFailure) { + out.push_back(AnesthesiaActions::factory(in.m_SodaLimeFailure)); + } + if (in.m_TubeCuffLeak) { + out.push_back(AnesthesiaActions::factory(in.m_TubeCuffLeak)); + } + if (in.m_VaporizerFailure) { + out.push_back(AnesthesiaActions::factory(in.m_VaporizerFailure)); + } + if (in.m_VentilatorPressureLoss) { + out.push_back(AnesthesiaActions::factory(in.m_VentilatorPressureLoss)); + } + if (in.m_YPieceDisconnect) { + out.push_back(AnesthesiaActions::factory(in.m_YPieceDisconnect)); } - throw biogears::CommonDataModelException("AnesthesiaActions::factory does not support the derived SEAnesthesiaMachineAction. If you are not a developer contact upstream for support."); } } } \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/io/cdm/AnesthesiaActions.h b/projects/biogears/libBiogears/src/io/cdm/AnesthesiaActions.h index 140f0a37c..10842292b 100644 --- a/projects/biogears/libBiogears/src/io/cdm/AnesthesiaActions.h +++ b/projects/biogears/libBiogears/src/io/cdm/AnesthesiaActions.h @@ -12,24 +12,26 @@ specific language governing permissions and limitations under the License. #pragma once #include +#include #include "biogears/cdm/CommonDataModel.h" #include #include -#define CDM_ANESTHESIA_ACTIONS_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_ANESTHESIA_ACTIONS_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ out.func(std::make_unique::type>()); \ - io::AnesthesiaActions::UnMarshall(*in.m_##func, out.func()); \ + io::AnesthesiaActions::Marshall(*in.m_##func, out.func()); \ } -#define CDM_OPTIONAL_ANESTHESIA_ACTIONS_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_OPTIONAL_ANESTHESIA_ACTIONS_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ - io::AnesthesiaActions::UnMarshall(*in.m_##func, out.func()); \ + io::AnesthesiaActions::Marshall(*in.m_##func, out.func()); \ } namespace biogears { +class SEAction; class SEAnesthesiaMachineActionCollection; class SEAnesthesiaMachineAction; class SEAnesthesiaMachineConfiguration; @@ -45,78 +47,81 @@ class SEVentilatorPressureLoss; class SEYPieceDisconnect; class SEOxygenWallPortPressureLoss; class SEOxygenTankPressureLoss; +class SESubstanceManager; namespace io { class BIOGEARS_PRIVATE_API AnesthesiaActions { public: + //Factories + static std::unique_ptr factory(const SEAnesthesiaMachineAction*); + static std::unique_ptr factory(CDM::AnesthesiaMachineActionData const* patientActionData, SESubstanceManager& substances, std::default_random_engine* rd = nullptr); + static void Marshall(const SEAnesthesiaMachineActionCollection& in, std::vector>& out); // - static void UnMarshall(const SEAnesthesiaMachineActionCollection&, std::vector& out); + static void Marshall(const SEAnesthesiaMachineActionCollection&, std::vector& out); //template option template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); //class SEAnesthesiaMachineAction - static void Marshall(const CDM::AnesthesiaMachineActionData& in, SEAnesthesiaMachineAction& out); - static void UnMarshall(const SEAnesthesiaMachineAction& in, CDM::AnesthesiaMachineActionData& out); + static void UnMarshall(const CDM::AnesthesiaMachineActionData& in, SEAnesthesiaMachineAction& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEAnesthesiaMachineAction& in, CDM::AnesthesiaMachineActionData& out); //class SEAnesthesiaMachineConfiguration - static void Marshall(const CDM::AnesthesiaMachineConfigurationData& in, SEAnesthesiaMachineConfiguration& out); - static void UnMarshall(const SEAnesthesiaMachineConfiguration& in, CDM::AnesthesiaMachineConfigurationData& out); + static void UnMarshall(const CDM::AnesthesiaMachineConfigurationData& in, SEAnesthesiaMachineConfiguration& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEAnesthesiaMachineConfiguration& in, CDM::AnesthesiaMachineConfigurationData& out); //class SEExpiratoryValveLeak - static void Marshall(const CDM::ExpiratoryValveLeakData& in, SEExpiratoryValveLeak& out); - static void UnMarshall(const SEExpiratoryValveLeak& in, CDM::ExpiratoryValveLeakData& out); + static void UnMarshall(const CDM::ExpiratoryValveLeakData& in, SEExpiratoryValveLeak& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEExpiratoryValveLeak& in, CDM::ExpiratoryValveLeakData& out); //class SEExpiratoryValveObstruction - static void Marshall(const CDM::ExpiratoryValveObstructionData& in, SEExpiratoryValveObstruction& out); - static void UnMarshall(const SEExpiratoryValveObstruction& in, CDM::ExpiratoryValveObstructionData& out); + static void UnMarshall(const CDM::ExpiratoryValveObstructionData& in, SEExpiratoryValveObstruction& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEExpiratoryValveObstruction& in, CDM::ExpiratoryValveObstructionData& out); //class SEInspiratoryValveLeak - static void Marshall(const CDM::InspiratoryValveLeakData& in, SEInspiratoryValveLeak& out); - static void UnMarshall(const SEInspiratoryValveLeak& in, CDM::InspiratoryValveLeakData& out); + static void UnMarshall(const CDM::InspiratoryValveLeakData& in, SEInspiratoryValveLeak& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEInspiratoryValveLeak& in, CDM::InspiratoryValveLeakData& out); //class SEInspiratoryValveObstruction - static void Marshall(const CDM::InspiratoryValveObstructionData& in, SEInspiratoryValveObstruction& out); - static void UnMarshall(const SEInspiratoryValveObstruction& in, CDM::InspiratoryValveObstructionData& out); + static void UnMarshall(const CDM::InspiratoryValveObstructionData& in, SEInspiratoryValveObstruction& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEInspiratoryValveObstruction& in, CDM::InspiratoryValveObstructionData& out); //class SEMaskLeak - static void Marshall(const CDM::MaskLeakData& in, SEMaskLeak& out); - static void UnMarshall(const SEMaskLeak& in, CDM::MaskLeakData& out); + static void UnMarshall(const CDM::MaskLeakData& in, SEMaskLeak& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEMaskLeak& in, CDM::MaskLeakData& out); //class SESodaLimeFailure - static void Marshall(const CDM::SodaLimeFailureData& in, SESodaLimeFailure& out); - static void UnMarshall(const SESodaLimeFailure& in, CDM::SodaLimeFailureData& out); + static void UnMarshall(const CDM::SodaLimeFailureData& in, SESodaLimeFailure& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SESodaLimeFailure& in, CDM::SodaLimeFailureData& out); //class SETubeCuffLeak - static void Marshall(const CDM::TubeCuffLeakData& in, SETubeCuffLeak& out); - static void UnMarshall(const SETubeCuffLeak& in, CDM::TubeCuffLeakData& out); + static void UnMarshall(const CDM::TubeCuffLeakData& in, SETubeCuffLeak& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SETubeCuffLeak& in, CDM::TubeCuffLeakData& out); //class SEVaporizerFailure - static void Marshall(const CDM::VaporizerFailureData& in, SEVaporizerFailure& out); - static void UnMarshall(const SEVaporizerFailure& in, CDM::VaporizerFailureData& out); + static void UnMarshall(const CDM::VaporizerFailureData& in, SEVaporizerFailure& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEVaporizerFailure& in, CDM::VaporizerFailureData& out); //class SEVentilatorPressureLoss - static void Marshall(const CDM::VentilatorPressureLossData& in, SEVentilatorPressureLoss& out); - static void UnMarshall(const SEVentilatorPressureLoss& in, CDM::VentilatorPressureLossData& out); + static void UnMarshall(const CDM::VentilatorPressureLossData& in, SEVentilatorPressureLoss& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEVentilatorPressureLoss& in, CDM::VentilatorPressureLossData& out); //class SEYPieceDisconnect - static void Marshall(const CDM::YPieceDisconnectData& in, SEYPieceDisconnect& out); - static void UnMarshall(const SEYPieceDisconnect& in, CDM::YPieceDisconnectData& out); + static void UnMarshall(const CDM::YPieceDisconnectData& in, SEYPieceDisconnect& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEYPieceDisconnect& in, CDM::YPieceDisconnectData& out); //class SEOxygenWallPortPressureLoss - static void Marshall(const CDM::OxygenWallPortPressureLossData& in, SEOxygenWallPortPressureLoss& out); - static void UnMarshall(const SEOxygenWallPortPressureLoss& in, CDM::OxygenWallPortPressureLossData& out); + static void UnMarshall(const CDM::OxygenWallPortPressureLossData& in, SEOxygenWallPortPressureLoss& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEOxygenWallPortPressureLoss& in, CDM::OxygenWallPortPressureLossData& out); //class SEOxygenTankPressureLoss - static void Marshall(const CDM::OxygenTankPressureLossData& in, SEOxygenTankPressureLoss& out); - static void UnMarshall(const SEOxygenTankPressureLoss& in, CDM::OxygenTankPressureLossData& out); - //Factories - static std::unique_ptr factory(const SEAnesthesiaMachineAction*); + static void UnMarshall(const CDM::OxygenTankPressureLossData& in, SEOxygenTankPressureLoss& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEOxygenTankPressureLoss& in, CDM::OxygenTankPressureLossData& out); }; //---------------------------------------------------------------------------------- template - void AnesthesiaActions::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + void AnesthesiaActions::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) { if (!option_in.present()) { - out.Clear(); + out.Invalidate(); } else { - Marshall(option_in.get(), out); + UnMarshall(option_in.get(), out); } } //---------------------------------------------------------------------------------- template - void AnesthesiaActions::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void AnesthesiaActions::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); + Marshall(in, *item); option_out.set(*item); } } // Namespace IO diff --git a/projects/biogears/libBiogears/src/io/cdm/Circuit.cpp b/projects/biogears/libBiogears/src/io/cdm/Circuit.cpp index 19a9aa421..885ab5e49 100644 --- a/projects/biogears/libBiogears/src/io/cdm/Circuit.cpp +++ b/projects/biogears/libBiogears/src/io/cdm/Circuit.cpp @@ -5,9 +5,11 @@ #include +#include +#include #include #include -#include +#include #include #include #include @@ -17,384 +19,479 @@ #include #include #include - namespace biogears { namespace io { - //class SEElectricalCircuit - void Circuit::Marshall(const CDM::ElectricalCircuitData& in, SEElectricalCircuit& out) + // class SEElectricalCircuit + void Circuit::UnMarshall(const CDM::ElectricalCircuitData& in, SECircuitLedger const& ledger, SEElectricalCircuit& out) { - //Nothing to Do + // note: not clearing here as the derived class needs to clear and call this super class Load last to get the ref node hooked up + out.Invalidate(); + out.m_Name = in.Name(); + for (auto name : in.Node()) { + auto idx = ledger.nodes.find(name); + if (idx == ledger.nodes.end()) { + out.Error(out.m_Name + " could not find node " + name.c_str()); + } + out.AddNode(*idx->second); + } + for (auto name : in.Path()) { + auto idx = ledger.paths.find(name); + if (idx == ledger.paths.end()) { + out.Error(out.m_Name + " could not find path " + name.c_str()); + } + out.AddPath(*idx->second); + } + for (auto name : in.ReferenceNode()) { + auto idx = ledger.nodes.find(name); + if (idx == ledger.nodes.end()) { + out.Error(out.m_Name + " could not find reference node " + name.c_str()); + } + out.AddReferenceNode(*idx->second); + } + out.StateChange(); } //---------------------------------------------------------------------------------- - void Circuit::UnMarshall(const SEElectricalCircuit& in, CDM::ElectricalCircuitData& out) + void Circuit::Marshall(const SEElectricalCircuit& in, CDM::ElectricalCircuitData& out) { - //Nothing to Do + out.Name(in.m_Name); + if (in.HasReferenceNode()) { + for (auto n : in.m_ReferenceNodes) + out.ReferenceNode().push_back(n->GetName()); + } + for (auto n : in.m_Nodes) + out.Node().push_back(n->GetName()); + for (auto p : in.m_Paths) + out.Path().push_back(p->GetName()); } //---------------------------------------------------------------------------------- - //class SEElectricalCircuitNode - void Circuit::Marshall(const CDM::ElectricalCircuitNodeData& in, SEElectricalCircuitNode& out) + // class SEElectricalCircuitNode + void Circuit::UnMarshall(const CDM::ElectricalCircuitNodeData& in, SECircuitLedger const& ledger, SEElectricalCircuitNode& out) { - Marshall(static_cast(in), static_cast&>(out)); - io::Property::Marshall(in.Voltage(), out.GetVoltage()); - io::Property::Marshall(in.NextVoltage(), out.GetNextVoltage()); - io::Property::Marshall(in.Charge(), out.GetCharge()); - io::Property::Marshall(in.NextCharge(), out.GetNextCharge()); - io::Property::Marshall(in.ChargeBaseline(), out.GetChargeBaseline()); + UnMarshall(static_cast(in), static_cast&>(out)); + io::Property::UnMarshall(in.Voltage(), out.GetVoltage()); + io::Property::UnMarshall(in.NextVoltage(), out.GetNextVoltage()); + io::Property::UnMarshall(in.Charge(), out.GetCharge()); + io::Property::UnMarshall(in.NextCharge(), out.GetNextCharge()); + io::Property::UnMarshall(in.ChargeBaseline(), out.GetChargeBaseline()); } //---------------------------------------------------------------------------------- - void Circuit::UnMarshall(const SEElectricalCircuitNode& in, CDM::ElectricalCircuitNodeData& out) + void Circuit::Marshall(const SEElectricalCircuitNode& in, CDM::ElectricalCircuitNodeData& out) { - UnMarshall(static_cast&>(in), static_cast(out)); + Marshall(static_cast&>(in), static_cast(out)); if (in.HasVoltage()) - io::Property::UnMarshall(*in.m_Potential, out.Voltage()); + io::Property::Marshall(*in.m_Potential, out.Voltage()); if (in.HasNextVoltage()) - io::Property::UnMarshall(*in.m_NextPotential, out.NextVoltage()); + io::Property::Marshall(*in.m_NextPotential, out.NextVoltage()); if (in.HasCharge()) - io::Property::UnMarshall(*in.m_Quantity, out.Charge()); + io::Property::Marshall(*in.m_Quantity, out.Charge()); if (in.HasNextCharge()) - io::Property::UnMarshall(*in.m_NextQuantity, out.NextCharge()); + io::Property::Marshall(*in.m_NextQuantity, out.NextCharge()); if (in.HasChargeBaseline()) - io::Property::UnMarshall(*in.m_QuantityBaseline, out.ChargeBaseline()); + io::Property::Marshall(*in.m_QuantityBaseline, out.ChargeBaseline()); } //---------------------------------------------------------------------------------- - //class SEElectricalCircuitPath - void Circuit::Marshall(const CDM::ElectricalCircuitPathData& in, SEElectricalCircuitPath& out) + // class SEElectricalCircuitPath + void Circuit::UnMarshall(const CDM::ElectricalCircuitPathData& in, SECircuitLedger const& ledger, SEElectricalCircuitPath& out) { - Marshall(static_cast(in), - static_cast&>(out)); + UnMarshall(static_cast(in), + static_cast&>(out)); - io::Property::Marshall(in.Resistance(), out.GetResistance()); - io::Property::Marshall(in.NextResistance(), out.GetNextResistance()); - io::Property::Marshall(in.ResistanceBaseline(), out.GetResistanceBaseline()); - io::Property::Marshall(in.Capacitance(), out.GetCapacitance()); - io::Property::Marshall(in.NextCapacitance(), out.GetNextCapacitance()); - io::Property::Marshall(in.CapacitanceBaseline(), out.GetCapacitanceBaseline()); - io::Property::Marshall(in.Inductance(), out.GetInductance()); - io::Property::Marshall(in.NextInductance(), out.GetNextInductance()); - io::Property::Marshall(in.InductanceBaseline(), out.GetInductanceBaseline()); - io::Property::Marshall(in.Current(), out.GetCurrent()); - io::Property::Marshall(in.NextCurrent(), out.GetNextCurrent()); - io::Property::Marshall(in.CurrentSource(), out.GetCurrentSource()); - io::Property::Marshall(in.NextCurrentSource(), out.GetNextCurrentSource()); - io::Property::Marshall(in.CurrentSourceBaseline(), out.GetCurrentSourceBaseline()); - io::Property::Marshall(in.VoltageSource(), out.GetVoltageSource()); - io::Property::Marshall(in.NextVoltageSource(), out.GetNextVoltageSource()); - io::Property::Marshall(in.VoltageSourceBaseline(), out.GetVoltageSourceBaseline()); - io::Property::Marshall(in.ValveBreakdownVoltage(), out.GetValveBreakdownVoltage()); + io::Property::UnMarshall(in.Resistance(), out.GetResistance()); + io::Property::UnMarshall(in.NextResistance(), out.GetNextResistance()); + io::Property::UnMarshall(in.ResistanceBaseline(), out.GetResistanceBaseline()); + io::Property::UnMarshall(in.Capacitance(), out.GetCapacitance()); + io::Property::UnMarshall(in.NextCapacitance(), out.GetNextCapacitance()); + io::Property::UnMarshall(in.CapacitanceBaseline(), out.GetCapacitanceBaseline()); + io::Property::UnMarshall(in.Inductance(), out.GetInductance()); + io::Property::UnMarshall(in.NextInductance(), out.GetNextInductance()); + io::Property::UnMarshall(in.InductanceBaseline(), out.GetInductanceBaseline()); + io::Property::UnMarshall(in.Current(), out.GetCurrent()); + io::Property::UnMarshall(in.NextCurrent(), out.GetNextCurrent()); + io::Property::UnMarshall(in.CurrentSource(), out.GetCurrentSource()); + io::Property::UnMarshall(in.NextCurrentSource(), out.GetNextCurrentSource()); + io::Property::UnMarshall(in.CurrentSourceBaseline(), out.GetCurrentSourceBaseline()); + io::Property::UnMarshall(in.VoltageSource(), out.GetVoltageSource()); + io::Property::UnMarshall(in.NextVoltageSource(), out.GetNextVoltageSource()); + io::Property::UnMarshall(in.VoltageSourceBaseline(), out.GetVoltageSourceBaseline()); + io::Property::UnMarshall(in.ValveBreakdownVoltage(), out.GetValveBreakdownVoltage()); } //---------------------------------------------------------------------------------- - void Circuit::UnMarshall(const SEElectricalCircuitPath& in, CDM::ElectricalCircuitPathData& out) + void Circuit::Marshall(const SEElectricalCircuitPath& in, CDM::ElectricalCircuitPathData& out) { - UnMarshall(static_cast&>(in), - static_cast(out)); + Marshall(static_cast&>(in), + static_cast(out)); if (in.HasResistance()) { - io::Property::UnMarshall(*in.m_Resistance, out.Resistance()); + io::Property::Marshall(*in.m_Resistance, out.Resistance()); } if (in.HasNextResistance()) { - io::Property::UnMarshall(*in.m_NextResistance, out.NextResistance()); + io::Property::Marshall(*in.m_NextResistance, out.NextResistance()); } if (in.HasResistanceBaseline()) { - io::Property::UnMarshall(*in.m_ResistanceBaseline, out.ResistanceBaseline()); + io::Property::Marshall(*in.m_ResistanceBaseline, out.ResistanceBaseline()); } if (in.HasCapacitance()) { - io::Property::UnMarshall(*in.m_Capacitance, out.Capacitance()); + io::Property::Marshall(*in.m_Capacitance, out.Capacitance()); } if (in.HasNextCapacitance()) { - io::Property::UnMarshall(*in.m_NextCapacitance, out.NextCapacitance()); + io::Property::Marshall(*in.m_NextCapacitance, out.NextCapacitance()); } if (in.HasCapacitanceBaseline()) { - io::Property::UnMarshall(*in.m_CapacitanceBaseline, out.CapacitanceBaseline()); + io::Property::Marshall(*in.m_CapacitanceBaseline, out.CapacitanceBaseline()); } if (in.HasInductance()) { - io::Property::UnMarshall(*in.m_Inductance, out.Inductance()); + io::Property::Marshall(*in.m_Inductance, out.Inductance()); } if (in.HasNextInductance()) { - io::Property::UnMarshall(*in.m_NextInductance, out.NextInductance()); + io::Property::Marshall(*in.m_NextInductance, out.NextInductance()); } if (in.HasInductanceBaseline()) { - io::Property::UnMarshall(*in.m_InductanceBaseline, out.InductanceBaseline()); + io::Property::Marshall(*in.m_InductanceBaseline, out.InductanceBaseline()); } if (in.HasCurrent()) { - io::Property::UnMarshall(*in.m_Flux, out.Current()); + io::Property::Marshall(*in.m_Flux, out.Current()); } if (in.HasNextCurrent()) { - io::Property::UnMarshall(*in.m_NextFlux, out.NextCurrent()); + io::Property::Marshall(*in.m_NextFlux, out.NextCurrent()); } if (in.HasCurrentSource()) { - io::Property::UnMarshall(*in.m_FluxSource, out.CurrentSource()); + io::Property::Marshall(*in.m_FluxSource, out.CurrentSource()); } if (in.HasNextCurrentSource()) { - io::Property::UnMarshall(*in.m_NextFluxSource, out.NextCurrentSource()); + io::Property::Marshall(*in.m_NextFluxSource, out.NextCurrentSource()); } if (in.HasCurrentSourceBaseline()) { - io::Property::UnMarshall(*in.m_FluxSourceBaseline, out.CurrentSourceBaseline()); + io::Property::Marshall(*in.m_FluxSourceBaseline, out.CurrentSourceBaseline()); } if (in.HasVoltageSource()) { - io::Property::UnMarshall(*in.m_PotentialSource, out.VoltageSource()); + io::Property::Marshall(*in.m_PotentialSource, out.VoltageSource()); } if (in.HasNextVoltageSource()) { - io::Property::UnMarshall(*in.m_NextPotentialSource, out.NextVoltageSource()); + io::Property::Marshall(*in.m_NextPotentialSource, out.NextVoltageSource()); } if (in.HasVoltageSourceBaseline()) { - io::Property::UnMarshall(*in.m_PotentialSourceBaseline, out.VoltageSourceBaseline()); + io::Property::Marshall(*in.m_PotentialSourceBaseline, out.VoltageSourceBaseline()); } if (in.HasValveBreakdownVoltage()) { - io::Property::UnMarshall(*in.m_ValveBreakdownPotential, out.ValveBreakdownVoltage()); + io::Property::Marshall(*in.m_ValveBreakdownPotential, out.ValveBreakdownVoltage()); } } //---------------------------------------------------------------------------------- - //class SEFluidCircuit - void Circuit::Marshall(const CDM::FluidCircuitData& in, SEFluidCircuit& out) + // class SEFluidCircuit + void Circuit::UnMarshall(const CDM::FluidCircuitData& in, SECircuitLedger const& ledger, SEFluidCircuit& out) { - //Nothing to Do + // note: not clearing here as the derived class needs to clear and call this super class Load last to get the ref node hooked up + out.Invalidate(); + out.m_Name = in.Name(); + for (auto name : in.Node()) { + auto idx = ledger.nodes.find(name); + if (idx == ledger.nodes.end()) { + out.Error(out.m_Name + " could not find node " + name.c_str()); + } + out.AddNode(*idx->second); + } + for (auto name : in.Path()) { + auto idx = ledger.paths.find(name); + if (idx == ledger.paths.end()) { + out.Error(out.m_Name + " could not find path " + name.c_str()); + } + out.AddPath(*idx->second); + } + for (auto name : in.ReferenceNode()) { + auto idx = ledger.nodes.find(name); + if (idx == ledger.nodes.end()) { + out.Error(out.m_Name + " could not find reference node " + name.c_str()); + } + out.AddReferenceNode(*idx->second); + } + out.StateChange(); } //---------------------------------------------------------------------------------- - void Circuit::UnMarshall(const SEFluidCircuit& in, CDM::FluidCircuitData& out) + void Circuit::Marshall(const SEFluidCircuit& in, CDM::FluidCircuitData& out) { - //Nothing To Do + out.Name(in.m_Name); + if (in.HasReferenceNode()) { + for (auto n : in.m_ReferenceNodes) + out.ReferenceNode().push_back(n->GetName()); + } + for (auto n : in.m_Nodes) + out.Node().push_back(n->GetName()); + for (auto p : in.m_Paths) + out.Path().push_back(p->GetName()); } //---------------------------------------------------------------------------------- - //class SEFluidCircuitNode - void Circuit::Marshall(const CDM::FluidCircuitNodeData& in, SEFluidCircuitNode& out) + // class SEFluidCircuitNode + void Circuit::UnMarshall(const CDM::FluidCircuitNodeData& in, SECircuitLedger const& ledger, SEFluidCircuitNode& out) { - Marshall(static_cast(in), static_cast&>(out)); - io::Property::Marshall(in.Pressure(), out.GetPressure()); - io::Property::Marshall(in.NextPressure(), out.GetNextPressure()); - io::Property::Marshall(in.Volume(), out.GetVolume()); + UnMarshall(static_cast(in), static_cast&>(out)); + io::Property::UnMarshall(in.Pressure(), out.GetPressure()); + io::Property::UnMarshall(in.NextPressure(), out.GetNextPressure()); + io::Property::UnMarshall(in.Volume(), out.GetVolume()); ; - io::Property::Marshall(in.NextVolume(), out.GetNextVolume()); - io::Property::Marshall(in.VolumeBaseline(), out.GetVolumeBaseline()); + io::Property::UnMarshall(in.NextVolume(), out.GetNextVolume()); + io::Property::UnMarshall(in.VolumeBaseline(), out.GetVolumeBaseline()); } //---------------------------------------------------------------------------------- - void Circuit::UnMarshall(const SEFluidCircuitNode& in, CDM::FluidCircuitNodeData& out) + void Circuit::Marshall(const SEFluidCircuitNode& in, CDM::FluidCircuitNodeData& out) { - UnMarshall(static_cast&>(in), static_cast(out)); + Marshall(static_cast&>(in), static_cast(out)); if (in.HasPressure()) - io::Property::UnMarshall(*in.m_Potential, out.Pressure()); + io::Property::Marshall(*in.m_Potential, out.Pressure()); if (in.HasNextPressure()) - io::Property::UnMarshall(*in.m_NextPotential, out.NextPressure()); + io::Property::Marshall(*in.m_NextPotential, out.NextPressure()); if (in.HasVolume()) - io::Property::UnMarshall(*in.m_Quantity, out.Volume()); + io::Property::Marshall(*in.m_Quantity, out.Volume()); if (in.HasNextVolume()) - io::Property::UnMarshall(*in.m_NextQuantity, out.NextVolume()); + io::Property::Marshall(*in.m_NextQuantity, out.NextVolume()); if (in.HasVolumeBaseline()) - io::Property::UnMarshall(*in.m_QuantityBaseline, out.VolumeBaseline()); + io::Property::Marshall(*in.m_QuantityBaseline, out.VolumeBaseline()); } //---------------------------------------------------------------------------------- - //class SEFluidCircuitPath - void Circuit::Marshall(const CDM::FluidCircuitPathData& in, SEFluidCircuitPath& out) + // class SEFluidCircuitPath + void Circuit::UnMarshall(const CDM::FluidCircuitPathData& in, SECircuitLedger const& ledger, SEFluidCircuitPath& out) { - Marshall(static_cast(in), static_cast&>(out)); - io::Property::Marshall(in.Resistance(), out.GetResistance()); - io::Property::Marshall(in.NextResistance(), out.GetNextResistance()); - io::Property::Marshall(in.ResistanceBaseline(), out.GetResistanceBaseline()); - io::Property::Marshall(in.Compliance(), out.GetCompliance()); - io::Property::Marshall(in.NextCompliance(), out.GetNextCompliance()); - io::Property::Marshall(in.ComplianceBaseline(), out.GetComplianceBaseline()); - io::Property::Marshall(in.Inertance(), out.GetInertance()); - io::Property::Marshall(in.NextInertance(), out.GetNextInertance()); - io::Property::Marshall(in.InertanceBaseline(), out.GetInertanceBaseline()); - io::Property::Marshall(in.Flow(), out.GetFlow()); - io::Property::Marshall(in.NextFlow(), out.GetNextFlow()); - io::Property::Marshall(in.FlowSource(), out.GetFlowSource()); - io::Property::Marshall(in.NextFlowSource(), out.GetNextFlowSource()); - io::Property::Marshall(in.FlowSourceBaseline(), out.GetFlowSourceBaseline()); - io::Property::Marshall(in.PressureSource(), out.GetPressureSource()); - io::Property::Marshall(in.NextPressureSource(), out.GetNextPressureSource()); - io::Property::Marshall(in.PressureSourceBaseline(), out.GetPressureSourceBaseline()); - io::Property::Marshall(in.ValveBreakdownPressure(), out.GetValveBreakdownPressure()); + UnMarshall(static_cast(in), static_cast&>(out)); + io::Property::UnMarshall(in.Resistance(), out.GetResistance()); + io::Property::UnMarshall(in.NextResistance(), out.GetNextResistance()); + io::Property::UnMarshall(in.ResistanceBaseline(), out.GetResistanceBaseline()); + io::Property::UnMarshall(in.Compliance(), out.GetCompliance()); + io::Property::UnMarshall(in.NextCompliance(), out.GetNextCompliance()); + io::Property::UnMarshall(in.ComplianceBaseline(), out.GetComplianceBaseline()); + io::Property::UnMarshall(in.Inertance(), out.GetInertance()); + io::Property::UnMarshall(in.NextInertance(), out.GetNextInertance()); + io::Property::UnMarshall(in.InertanceBaseline(), out.GetInertanceBaseline()); + io::Property::UnMarshall(in.Flow(), out.GetFlow()); + io::Property::UnMarshall(in.NextFlow(), out.GetNextFlow()); + io::Property::UnMarshall(in.FlowSource(), out.GetFlowSource()); + io::Property::UnMarshall(in.NextFlowSource(), out.GetNextFlowSource()); + io::Property::UnMarshall(in.FlowSourceBaseline(), out.GetFlowSourceBaseline()); + io::Property::UnMarshall(in.PressureSource(), out.GetPressureSource()); + io::Property::UnMarshall(in.NextPressureSource(), out.GetNextPressureSource()); + io::Property::UnMarshall(in.PressureSourceBaseline(), out.GetPressureSourceBaseline()); + io::Property::UnMarshall(in.ValveBreakdownPressure(), out.GetValveBreakdownPressure()); } //---------------------------------------------------------------------------------- - void Circuit::UnMarshall(const SEFluidCircuitPath& in, CDM::FluidCircuitPathData& out) + void Circuit::Marshall(const SEFluidCircuitPath& in, CDM::FluidCircuitPathData& out) { - UnMarshall(static_cast&>(in), static_cast(out)); + Marshall(static_cast&>(in), static_cast(out)); if (in.HasResistance()) { - io::Property::UnMarshall(*in.m_Resistance, out.Resistance()); + io::Property::Marshall(*in.m_Resistance, out.Resistance()); } if (in.HasNextResistance()) { - io::Property::UnMarshall(*in.m_NextResistance, out.NextResistance()); + io::Property::Marshall(*in.m_NextResistance, out.NextResistance()); } if (in.HasResistanceBaseline()) { - io::Property::UnMarshall(*in.m_ResistanceBaseline, out.ResistanceBaseline()); + io::Property::Marshall(*in.m_ResistanceBaseline, out.ResistanceBaseline()); } if (in.HasCompliance()) { - io::Property::UnMarshall(*in.m_Capacitance, out.Compliance()); + io::Property::Marshall(*in.m_Capacitance, out.Compliance()); } if (in.HasNextCompliance()) { - io::Property::UnMarshall(*in.m_NextCapacitance, out.NextCompliance()); + io::Property::Marshall(*in.m_NextCapacitance, out.NextCompliance()); } if (in.HasComplianceBaseline()) { - io::Property::UnMarshall(*in.m_CapacitanceBaseline, out.ComplianceBaseline()); + io::Property::Marshall(*in.m_CapacitanceBaseline, out.ComplianceBaseline()); } if (in.HasInertance()) { - io::Property::UnMarshall(*in.m_Inductance, out.Inertance()); + io::Property::Marshall(*in.m_Inductance, out.Inertance()); } if (in.HasNextInertance()) { - io::Property::UnMarshall(*in.m_NextInductance, out.NextInertance()); + io::Property::Marshall(*in.m_NextInductance, out.NextInertance()); } if (in.HasInertanceBaseline()) { - io::Property::UnMarshall(*in.m_InductanceBaseline, out.InertanceBaseline()); + io::Property::Marshall(*in.m_InductanceBaseline, out.InertanceBaseline()); } if (in.HasFlow()) { - io::Property::UnMarshall(*in.m_Flux, out.Flow()); + io::Property::Marshall(*in.m_Flux, out.Flow()); } if (in.HasNextFlow()) { - io::Property::UnMarshall(*in.m_NextFlux, out.NextFlow()); + io::Property::Marshall(*in.m_NextFlux, out.NextFlow()); } if (in.HasFlowSource()) { - io::Property::UnMarshall(*in.m_FluxSource, out.FlowSource()); + io::Property::Marshall(*in.m_FluxSource, out.FlowSource()); } if (in.HasNextFlowSource()) { - io::Property::UnMarshall(*in.m_NextFluxSource, out.NextFlowSource()); + io::Property::Marshall(*in.m_NextFluxSource, out.NextFlowSource()); } if (in.HasFlowSourceBaseline()) { - io::Property::UnMarshall(*in.m_FluxSourceBaseline, out.FlowSourceBaseline()); + io::Property::Marshall(*in.m_FluxSourceBaseline, out.FlowSourceBaseline()); } if (in.HasPressureSource()) { - io::Property::UnMarshall(*in.m_PotentialSource, out.PressureSource()); + io::Property::Marshall(*in.m_PotentialSource, out.PressureSource()); } if (in.HasNextPressureSource()) { - io::Property::UnMarshall(*in.m_NextPotentialSource, out.NextPressureSource()); + io::Property::Marshall(*in.m_NextPotentialSource, out.NextPressureSource()); } if (in.HasPressureSourceBaseline()) { - io::Property::UnMarshall(*in.m_PotentialSourceBaseline, out.PressureSourceBaseline()); + io::Property::Marshall(*in.m_PotentialSourceBaseline, out.PressureSourceBaseline()); } if (in.HasValveBreakdownPressure()) { - io::Property::UnMarshall(*in.m_ValveBreakdownPotential, out.ValveBreakdownPressure()); + io::Property::Marshall(*in.m_ValveBreakdownPotential, out.ValveBreakdownPressure()); } } //---------------------------------------------------------------------------------- - //class SEThermalCircuit - void Circuit::Marshall(const CDM::ThermalCircuitData& in, SEThermalCircuit& out) + // class SEThermalCircuit + void Circuit::UnMarshall(const CDM::ThermalCircuitData& in, SECircuitLedger const& ledger, SEThermalCircuit& out) { - //Nothing to do + // note: not clearing here as the derived class needs to clear and call this super class Load last to get the ref node hooked up + out.Invalidate(); + out.m_Name = in.Name(); + for (auto name : in.Node()) { + auto idx = ledger.nodes.find(name); + if (idx == ledger.nodes.end()) { + out.Error(out.m_Name + " could not find node " + name.c_str()); + } + out.AddNode(*idx->second); + } + for (auto name : in.Path()) { + auto idx = ledger.paths.find(name); + if (idx == ledger.paths.end()) { + out.Error(out.m_Name + " could not find path " + name.c_str()); + } + out.AddPath(*idx->second); + } + for (auto name : in.ReferenceNode()) { + auto idx = ledger.nodes.find(name); + if (idx == ledger.nodes.end()) { + out.Error(out.m_Name + " could not find reference node " + name.c_str()); + } + out.AddReferenceNode(*idx->second); + } + out.StateChange(); } //---------------------------------------------------------------------------------- - void Circuit::UnMarshall(const SEThermalCircuit& in, CDM::ThermalCircuitData& out) + void Circuit::Marshall(const SEThermalCircuit& in, CDM::ThermalCircuitData& out) { - //Nothing to do + out.Name(in.m_Name); + if (in.HasReferenceNode()) { + for (auto n : in.m_ReferenceNodes) + out.ReferenceNode().push_back(n->GetName()); + } + for (auto n : in.m_Nodes) + out.Node().push_back(n->GetName()); + for (auto p : in.m_Paths) + out.Path().push_back(p->GetName()); } //---------------------------------------------------------------------------------- - //class SEThermalCircuitNode - void Circuit::Marshall(const CDM::ThermalCircuitNodeData& in, SEThermalCircuitNode& out) + // class SEThermalCircuitNode + void Circuit::UnMarshall(const CDM::ThermalCircuitNodeData& in, SECircuitLedger const& ledger, SEThermalCircuitNode& out) { - Marshall(static_cast(in), static_cast&>(out)); - io::Property::Marshall(in.Temperature(), out.GetTemperature()); - io::Property::Marshall(in.NextTemperature(), out.GetNextTemperature()); - io::Property::Marshall(in.Heat(), out.GetHeat()); - io::Property::Marshall(in.NextHeat(), out.GetNextHeat()); - io::Property::Marshall(in.HeatBaseline(), out.GetHeatBaseline()); + UnMarshall(static_cast(in), static_cast&>(out)); + io::Property::UnMarshall(in.Temperature(), out.GetTemperature()); + io::Property::UnMarshall(in.NextTemperature(), out.GetNextTemperature()); + io::Property::UnMarshall(in.Heat(), out.GetHeat()); + io::Property::UnMarshall(in.NextHeat(), out.GetNextHeat()); + io::Property::UnMarshall(in.HeatBaseline(), out.GetHeatBaseline()); } //---------------------------------------------------------------------------------- - void Circuit::UnMarshall(const SEThermalCircuitNode& in, CDM::ThermalCircuitNodeData& out) + void Circuit::Marshall(const SEThermalCircuitNode& in, CDM::ThermalCircuitNodeData& out) { - UnMarshall(static_cast&>(in), static_cast(out)); + Marshall(static_cast&>(in), static_cast(out)); if (in.HasTemperature()) - io::Property::UnMarshall(*in.m_Potential, out.Temperature()); + io::Property::Marshall(*in.m_Potential, out.Temperature()); if (in.HasNextTemperature()) - io::Property::UnMarshall(*in.m_NextPotential, out.NextTemperature()); + io::Property::Marshall(*in.m_NextPotential, out.NextTemperature()); if (in.HasHeat()) - io::Property::UnMarshall(*in.m_Quantity, out.Heat()); + io::Property::Marshall(*in.m_Quantity, out.Heat()); if (in.HasNextHeat()) - io::Property::UnMarshall(*in.m_NextQuantity, out.NextHeat()); + io::Property::Marshall(*in.m_NextQuantity, out.NextHeat()); if (in.HasHeatBaseline()) - io::Property::UnMarshall(*in.m_QuantityBaseline, out.HeatBaseline()); + io::Property::Marshall(*in.m_QuantityBaseline, out.HeatBaseline()); } //---------------------------------------------------------------------------------- - //class SEThermalCircuitPath - void Circuit::Marshall(const CDM::ThermalCircuitPathData& in, SEThermalCircuitPath& out) + // class SEThermalCircuitPath + void Circuit::UnMarshall(const CDM::ThermalCircuitPathData& in, SECircuitLedger const& ledger, SEThermalCircuitPath& out) { - Marshall(static_cast(in), static_cast&>(out)); - io::Property::Marshall(in.Resistance(), out.GetResistance()); - io::Property::Marshall(in.NextResistance(), out.GetNextResistance()); - io::Property::Marshall(in.ResistanceBaseline(), out.GetResistanceBaseline()); - io::Property::Marshall(in.Capacitance(), out.GetCapacitance()); - io::Property::Marshall(in.NextCapacitance(), out.GetNextCapacitance()); - io::Property::Marshall(in.CapacitanceBaseline(), out.GetCapacitanceBaseline()); - io::Property::Marshall(in.Inductance(), out.GetInductance()); - io::Property::Marshall(in.NextInductance(), out.GetNextInductance()); - io::Property::Marshall(in.InductanceBaseline(), out.GetInductanceBaseline()); - io::Property::Marshall(in.HeatTransferRate(), out.GetHeatTransferRate()); - io::Property::Marshall(in.NextHeatTransferRate(), out.GetNextHeatTransferRate()); - io::Property::Marshall(in.HeatSource(), out.GetHeatSource()); - io::Property::Marshall(in.NextHeatSource(), out.GetNextHeatSource()); - io::Property::Marshall(in.HeatSourceBaseline(), out.GetHeatSourceBaseline()); - io::Property::Marshall(in.TemperatureSource(), out.GetTemperatureSource()); - io::Property::Marshall(in.NextTemperatureSource(), out.GetNextTemperatureSource()); - io::Property::Marshall(in.TemperatureSourceBaseline(), out.GetTemperatureSourceBaseline()); - io::Property::Marshall(in.ValveBreakdownTemperature(), out.GetValveBreakdownTemperature()); + UnMarshall(static_cast(in), static_cast&>(out)); + io::Property::UnMarshall(in.Resistance(), out.GetResistance()); + io::Property::UnMarshall(in.NextResistance(), out.GetNextResistance()); + io::Property::UnMarshall(in.ResistanceBaseline(), out.GetResistanceBaseline()); + io::Property::UnMarshall(in.Capacitance(), out.GetCapacitance()); + io::Property::UnMarshall(in.NextCapacitance(), out.GetNextCapacitance()); + io::Property::UnMarshall(in.CapacitanceBaseline(), out.GetCapacitanceBaseline()); + io::Property::UnMarshall(in.Inductance(), out.GetInductance()); + io::Property::UnMarshall(in.NextInductance(), out.GetNextInductance()); + io::Property::UnMarshall(in.InductanceBaseline(), out.GetInductanceBaseline()); + io::Property::UnMarshall(in.HeatTransferRate(), out.GetHeatTransferRate()); + io::Property::UnMarshall(in.NextHeatTransferRate(), out.GetNextHeatTransferRate()); + io::Property::UnMarshall(in.HeatSource(), out.GetHeatSource()); + io::Property::UnMarshall(in.NextHeatSource(), out.GetNextHeatSource()); + io::Property::UnMarshall(in.HeatSourceBaseline(), out.GetHeatSourceBaseline()); + io::Property::UnMarshall(in.TemperatureSource(), out.GetTemperatureSource()); + io::Property::UnMarshall(in.NextTemperatureSource(), out.GetNextTemperatureSource()); + io::Property::UnMarshall(in.TemperatureSourceBaseline(), out.GetTemperatureSourceBaseline()); + io::Property::UnMarshall(in.ValveBreakdownTemperature(), out.GetValveBreakdownTemperature()); } //---------------------------------------------------------------------------------- - void Circuit::UnMarshall(const SEThermalCircuitPath& in, CDM::ThermalCircuitPathData& out) + void Circuit::Marshall(const SEThermalCircuitPath& in, CDM::ThermalCircuitPathData& out) { - UnMarshall(static_cast&>(in), static_cast(out)); + Marshall(static_cast&>(in), static_cast(out)); if (in.HasResistance()) { - io::Property::UnMarshall(*in.m_Resistance, out.Resistance()); + io::Property::Marshall(*in.m_Resistance, out.Resistance()); } if (in.HasNextResistance()) { - io::Property::UnMarshall(*in.m_NextResistance, out.NextResistance()); + io::Property::Marshall(*in.m_NextResistance, out.NextResistance()); } if (in.HasResistanceBaseline()) { - io::Property::UnMarshall(*in.m_ResistanceBaseline, out.ResistanceBaseline()); + io::Property::Marshall(*in.m_ResistanceBaseline, out.ResistanceBaseline()); } if (in.HasCapacitance()) { - io::Property::UnMarshall(*in.m_Capacitance, out.Capacitance()); + io::Property::Marshall(*in.m_Capacitance, out.Capacitance()); } if (in.HasNextCapacitance()) { - io::Property::UnMarshall(*in.m_NextCapacitance, out.NextCapacitance()); + io::Property::Marshall(*in.m_NextCapacitance, out.NextCapacitance()); } if (in.HasCapacitanceBaseline()) { - io::Property::UnMarshall(*in.m_CapacitanceBaseline, out.CapacitanceBaseline()); + io::Property::Marshall(*in.m_CapacitanceBaseline, out.CapacitanceBaseline()); } if (in.HasInductance()) { - io::Property::UnMarshall(*in.m_Inductance, out.Inductance()); + io::Property::Marshall(*in.m_Inductance, out.Inductance()); } if (in.HasNextInductance()) { - io::Property::UnMarshall(*in.m_NextInductance, out.NextInductance()); + io::Property::Marshall(*in.m_NextInductance, out.NextInductance()); } if (in.HasInductanceBaseline()) { - io::Property::UnMarshall(*in.m_InductanceBaseline, out.InductanceBaseline()); + io::Property::Marshall(*in.m_InductanceBaseline, out.InductanceBaseline()); } if (in.HasHeatTransferRate()) { - io::Property::UnMarshall(*in.m_Flux, out.HeatTransferRate()); + io::Property::Marshall(*in.m_Flux, out.HeatTransferRate()); } if (in.HasNextHeatTransferRate()) { - io::Property::UnMarshall(*in.m_NextFlux, out.NextHeatTransferRate()); + io::Property::Marshall(*in.m_NextFlux, out.NextHeatTransferRate()); } if (in.HasHeatSource()) { - io::Property::UnMarshall(*in.m_FluxSource, out.HeatSource()); + io::Property::Marshall(*in.m_FluxSource, out.HeatSource()); } if (in.HasNextHeatSource()) { - io::Property::UnMarshall(*in.m_NextFluxSource, out.NextHeatSource()); + io::Property::Marshall(*in.m_NextFluxSource, out.NextHeatSource()); } if (in.HasHeatSourceBaseline()) { - io::Property::UnMarshall(*in.m_FluxSourceBaseline, out.HeatSourceBaseline()); + io::Property::Marshall(*in.m_FluxSourceBaseline, out.HeatSourceBaseline()); } if (in.HasTemperatureSource()) { - io::Property::UnMarshall(*in.m_PotentialSource, out.TemperatureSource()); + io::Property::Marshall(*in.m_PotentialSource, out.TemperatureSource()); } if (in.HasNextTemperatureSource()) { - io::Property::UnMarshall(*in.m_NextPotentialSource, out.NextTemperatureSource()); + io::Property::Marshall(*in.m_NextPotentialSource, out.NextTemperatureSource()); } if (in.HasTemperatureSourceBaseline()) { - io::Property::UnMarshall(*in.m_PotentialSourceBaseline, out.TemperatureSourceBaseline()); + io::Property::Marshall(*in.m_PotentialSourceBaseline, out.TemperatureSourceBaseline()); } if (in.HasValveBreakdownTemperature()) { - io::Property::UnMarshall(*in.m_ValveBreakdownPotential, out.ValveBreakdownTemperature()); + io::Property::Marshall(*in.m_ValveBreakdownPotential, out.ValveBreakdownTemperature()); } } //---------------------------------------------------------------------------------- - //class SECircuitManager - void Circuit::Marshall(const CDM::CircuitManagerData& in, SECircuitManager& out) + // class SECircuitManager + void Circuit::UnMarshall(const CDM::CircuitManagerData& in, SECircuitManager& out) { - out.Clear(); + out.Invalidate(); for (const CDM::ElectricalCircuitNodeData& n : in.ElectricalNode()) { - io::Circuit::Marshall(n, out.CreateNode(n.Name(), out.m_ElectricalLedger)); + io::Circuit::UnMarshall(n, out.m_ElectricalLedger, out.CreateNode(n.Name(), out.m_ElectricalLedger)); } for (const CDM::ElectricalCircuitPathData& p : in.ElectricalPath()) { SEElectricalCircuitNode* src = out.GetNode(p.SourceNode(), out.m_ElectricalLedger); @@ -405,13 +502,13 @@ namespace io { if (tgt == nullptr) { throw CommonDataModelException(std::string { "Could not find target node " } + std::string { p.TargetNode() } + " from path " + p.Name().c_str()); } - io::Circuit::Marshall(p, out.CreatePath(*src, *tgt, p.Name(), out.m_ElectricalLedger)); + io::Circuit::UnMarshall(p, out.m_ElectricalLedger, out.CreatePath(*src, *tgt, p.Name(), out.m_ElectricalLedger)); } for (const CDM::ElectricalCircuitData& c : in.ElectricalCircuit()) { - io::Circuit::Marshall(c,out.CreateCircuit(c.Name(), out.m_ElectricalLedger), out.m_ElectricalLedger.nodes, out.m_ElectricalLedger.paths); + io::Circuit::UnMarshall(c, out.m_ElectricalLedger, out.CreateCircuit(c.Name(), out.m_ElectricalLedger)); } for (const CDM::FluidCircuitNodeData& n : in.FluidNode()) { - io::Circuit::Marshall(n, out.CreateNode(n.Name(), out.m_FluidLedger)); + io::Circuit::UnMarshall(n, out.m_FluidLedger, out.CreateNode(n.Name(), out.m_FluidLedger)); } for (const CDM::FluidCircuitPathData& p : in.FluidPath()) { SEFluidCircuitNode* src = out.GetNode(p.SourceNode(), out.m_FluidLedger); @@ -422,13 +519,14 @@ namespace io { if (tgt == nullptr) { throw CommonDataModelException(std::string { "Could not find target node " } + std::string { p.TargetNode() } + " from path " + p.Name().c_str()); } - io::Circuit::Marshall(p, out.CreatePath(*src, *tgt, p.Name(), out.m_FluidLedger)); + io::Circuit::UnMarshall(p, out.m_FluidLedger, out.CreatePath(*src, *tgt, p.Name(), out.m_FluidLedger)); + } + for (const CDM::FluidCircuitData& c : in.FluidCircuit()) { + io::Circuit::UnMarshall(c, out.m_FluidLedger, out.CreateCircuit(c.Name(), out.m_FluidLedger)); + } + for (const CDM::ThermalCircuitNodeData& n : in.ThermalNode()) { + io::Circuit::UnMarshall(n, out.m_ThermalLedger, out.CreateNode(n.Name(), out.m_ThermalLedger)); } - for (const CDM::FluidCircuitData& c : in.FluidCircuit()) - io::Circuit::Marshall(c, out.CreateCircuit(c.Name(), out.m_FluidLedger)); - - for (const CDM::ThermalCircuitNodeData& n : in.ThermalNode()) - io::Circuit::Marshall(n, out.CreateNode(n.Name(), out.m_ThermalLedger)); for (const CDM::ThermalCircuitPathData& p : in.ThermalPath()) { SEThermalCircuitNode* src = out.GetNode(p.SourceNode(), out.m_ThermalLedger); if (src == nullptr) { @@ -438,59 +536,61 @@ namespace io { if (tgt == nullptr) { throw CommonDataModelException(std::string { "Could not find target node " } + std::string { p.TargetNode() } + " from path " + p.Name().c_str()); } - io::Circuit::Marshall(p, out.CreatePath(*src, *tgt, p.Name(), out.m_ThermalLedger)); + io::Circuit::UnMarshall(p, out.m_ThermalLedger, out.CreatePath(*src, *tgt, p.Name(), out.m_ThermalLedger)); + } + for (const CDM::ThermalCircuitData& c : in.ThermalCircuit()) { + io::Circuit::UnMarshall(c, out.m_ThermalLedger, out.CreateCircuit(c.Name(), out.m_ThermalLedger)); } - for (const CDM::ThermalCircuitData& c : in.ThermalCircuit()) - io::Circuit::Marshall(c, out.CreateCircuit(c.Name(), out.m_ThermalLedger)); } + //---------------------------------------------------------------------------------- - void Circuit::UnMarshall(const SECircuitManager& in, CDM::CircuitManagerData& out) + void Circuit::Marshall(const SECircuitManager& in, CDM::CircuitManagerData& out) { - for (auto itr : in.m_ElectricalLedger.nodes) { + for (auto itr : in.m_ElectricalLedger.nodes) { auto ecnData = CDM::ElectricalCircuitNodeData(); - UnMarshall(*itr.second, ecnData); + Marshall(*itr.second, ecnData); out.ElectricalNode().push_back(ecnData); } for (auto itr : in.m_ElectricalLedger.paths) { auto ecpData = CDM::ElectricalCircuitPathData(); - UnMarshall(*itr.second, ecpData); + Marshall(*itr.second, ecpData); out.ElectricalPath().push_back(ecpData); } for (auto itr : in.m_ElectricalLedger.circuits) { auto ecData = CDM::ElectricalCircuitData(); - UnMarshall(*itr.second, ecData); + Marshall(*itr.second, ecData); out.ElectricalCircuit().push_back(ecData); } for (auto itr : in.m_FluidLedger.nodes) { auto fcnData = CDM::FluidCircuitNodeData(); - UnMarshall(*itr.second, fcnData); + Marshall(*itr.second, fcnData); out.FluidNode().push_back(fcnData); } for (auto itr : in.m_FluidLedger.paths) { auto fcpData = CDM::FluidCircuitPathData(); - UnMarshall(*itr.second, fcpData); + Marshall(*itr.second, fcpData); out.FluidPath().push_back(fcpData); } for (auto itr : in.m_FluidLedger.circuits) { auto fcData = CDM::FluidCircuitData(); - UnMarshall(*itr.second, fcData); + Marshall(*itr.second, fcData); out.FluidCircuit().push_back(fcData); } for (auto itr : in.m_ThermalLedger.nodes) { auto tcnData = CDM::ThermalCircuitNodeData(); - UnMarshall(*itr.second, tcnData); + Marshall(*itr.second, tcnData); out.ThermalNode().push_back(tcnData); } for (auto itr : in.m_ThermalLedger.paths) { auto tcpData = CDM::ThermalCircuitPathData(); - UnMarshall(*itr.second, tcpData); + Marshall(*itr.second, tcpData); out.ThermalPath().push_back(tcpData); } for (auto itr : in.m_ThermalLedger.circuits) { auto tcData = CDM::ThermalCircuitData(); - UnMarshall(*itr.second, tcData); + Marshall(*itr.second, tcData); out.ThermalCircuit().push_back(tcData); } } diff --git a/projects/biogears/libBiogears/src/io/cdm/Circuit.h b/projects/biogears/libBiogears/src/io/cdm/Circuit.h index 1f6f5710a..279d50747 100644 --- a/projects/biogears/libBiogears/src/io/cdm/Circuit.h +++ b/projects/biogears/libBiogears/src/io/cdm/Circuit.h @@ -13,28 +13,34 @@ specific language governing permissions and limitations under the License. #pragma once #include +#include "Property.h" + #include "biogears/cdm/CommonDataModel.h" #include #include +#include +#include #include #include +#include +#include +#include #include +#include -#define CDM_CIRCUIT_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_CIRCUIT_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ out.func(std::make_unique::type>()); \ - io::Circuit::UnMarshall(*in.m_##func, out.func()); \ + io::Circuit::Marshall(*in.m_##func, out.func()); \ } -#define CDM_OPTIONAL_CIRCUIT_UNMARSHAL_HELPER(in, out, func) \ - if (in.m_##func) { \ - io::Circuit::UnMarshall(*in.m_##func, out.func()); \ +#define CDM_OPTIONAL_CIRCUIT_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func) { \ + io::Circuit::Marshall(*in.m_##func, out.func()); \ } namespace biogears { -template -class SECircuit; template class SECircuitNode; template @@ -53,82 +59,81 @@ class SECircuitManager; namespace io { class BIOGEARS_PRIVATE_API Circuit { public: - //template option + // template option template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); - //class SECircuit - template - static void Marshall(const CircuitBindType& in, SECircuit& out, const std::map& nodes, const std::map& paths); - template - static void UnMarshall(const SECircuit& in, CircuitBindType& out); - //class SECircuitNode + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); + // class SECircuit + template + static void UnMarshall(const CircuitBindType& in, SECircuit& out, const std::map& nodes, const std::map& paths); + template + static void Marshall(const SECircuit& in, CircuitBindType& out); + // class SECircuitNode template - static void Marshall(const CDM::CircuitNodeData& in, SECircuitNode& out); + static void UnMarshall(const CDM::CircuitNodeData& in, SECircuitNode& out); template - static void UnMarshall(const SECircuitNode& in, CDM::CircuitNodeData& out); - //class SECircuitPath + static void Marshall(const SECircuitNode& in, CDM::CircuitNodeData& out); + // class SECircuitPath template - static void Marshall(const CDM::CircuitPathData& in, SECircuitPath& out); + static void UnMarshall(const CDM::CircuitPathData& in, SECircuitPath& out); template - static void UnMarshall(const SECircuitPath& in, CDM::CircuitPathData& out); - + static void Marshall(const SECircuitPath& in, CDM::CircuitPathData& out); - //class SEElectricalCircuit - static void Marshall(const CDM::ElectricalCircuitData& in, SEElectricalCircuit& out); - static void UnMarshall(const SEElectricalCircuit& in, CDM::ElectricalCircuitData& out); - //class SEElectricalCircuitNode - static void Marshall(const CDM::ElectricalCircuitNodeData& in, SEElectricalCircuitNode& out); - static void UnMarshall(const SEElectricalCircuitNode& in, CDM::ElectricalCircuitNodeData& out); - //class SEElectricalCircuitPath - static void Marshall(const CDM::ElectricalCircuitPathData& in, SEElectricalCircuitPath& out); - static void UnMarshall(const SEElectricalCircuitPath& in, CDM::ElectricalCircuitPathData& out); - //class SEFluidCircuit - static void Marshall(const CDM::FluidCircuitData& in, SEFluidCircuit& out); - static void UnMarshall(const SEFluidCircuit& in, CDM::FluidCircuitData& out); - //class SEFluidCircuitNode - static void Marshall(const CDM::FluidCircuitNodeData& in, SEFluidCircuitNode& out); - static void UnMarshall(const SEFluidCircuitNode& in, CDM::FluidCircuitNodeData& out); - //class SEFluidCircuitPath - static void Marshall(const CDM::FluidCircuitPathData& in, SEFluidCircuitPath& out); - static void UnMarshall(const SEFluidCircuitPath& in, CDM::FluidCircuitPathData& out); - //class SEThermalCircuit - static void Marshall(const CDM::ThermalCircuitData& in, SEThermalCircuit& out); - static void UnMarshall(const SEThermalCircuit& in, CDM::ThermalCircuitData& out); - //class SEThermalCircuitNode - static void Marshall(const CDM::ThermalCircuitNodeData& in, SEThermalCircuitNode& out); - static void UnMarshall(const SEThermalCircuitNode& in, CDM::ThermalCircuitNodeData& out); - //class SEThermalCircuitPath - static void Marshall(const CDM::ThermalCircuitPathData& in, SEThermalCircuitPath& out); - static void UnMarshall(const SEThermalCircuitPath& in, CDM::ThermalCircuitPathData& out); - //class SECircuitManager - static void Marshall(const CDM::CircuitManagerData& in, SECircuitManager& out); - static void UnMarshall(const SECircuitManager& in, CDM::CircuitManagerData& out); + // class SEElectricalCircuit + static void UnMarshall(const CDM::ElectricalCircuitData& in, SECircuitLedger const&, SEElectricalCircuit& out); + static void Marshall(const SEElectricalCircuit& in, CDM::ElectricalCircuitData& out); + // class SEElectricalCircuitNode + static void UnMarshall(const CDM::ElectricalCircuitNodeData& in, SECircuitLedger const&, SEElectricalCircuitNode& out); + static void Marshall(const SEElectricalCircuitNode& in, CDM::ElectricalCircuitNodeData& out); + // class SEElectricalCircuitPath + static void UnMarshall(const CDM::ElectricalCircuitPathData& in, SECircuitLedger const&, SEElectricalCircuitPath& out); + static void Marshall(const SEElectricalCircuitPath& in, CDM::ElectricalCircuitPathData& out); + // class SEFluidCircuit + static void UnMarshall(const CDM::FluidCircuitData& in, SECircuitLedger const&, SEFluidCircuit& out); + static void Marshall(const SEFluidCircuit& in, CDM::FluidCircuitData& out); + // class SEFluidCircuitNode + static void UnMarshall(const CDM::FluidCircuitNodeData& in, SECircuitLedger const&, SEFluidCircuitNode& out); + static void Marshall(const SEFluidCircuitNode& in, CDM::FluidCircuitNodeData& out); + // class SEFluidCircuitPath + static void UnMarshall(const CDM::FluidCircuitPathData& in, SECircuitLedger const&, SEFluidCircuitPath& out); + static void Marshall(const SEFluidCircuitPath& in, CDM::FluidCircuitPathData& out); + // class SEThermalCircuit + static void UnMarshall(const CDM::ThermalCircuitData& in, SECircuitLedger const&, SEThermalCircuit& out); + static void Marshall(const SEThermalCircuit& in, CDM::ThermalCircuitData& out); + // class SEThermalCircuitNode + static void UnMarshall(const CDM::ThermalCircuitNodeData& in, SECircuitLedger const&, SEThermalCircuitNode& out); + static void Marshall(const SEThermalCircuitNode& in, CDM::ThermalCircuitNodeData& out); + // class SEThermalCircuitPath + static void UnMarshall(const CDM::ThermalCircuitPathData& in, SECircuitLedger const&, SEThermalCircuitPath& out); + static void Marshall(const SEThermalCircuitPath& in, CDM::ThermalCircuitPathData& out); + // class SECircuitManager + static void UnMarshall(const CDM::CircuitManagerData& in, SECircuitManager& out); + static void Marshall(const SECircuitManager& in, CDM::CircuitManagerData& out); }; //---------------------------------------------------------------------------------- template - void Circuit::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + void Circuit::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) { if (!option_in.present()) { - out.Clear(); + out.Invalidate(); } else { - Marshall(option_in.get(), out); + UnMarshall(option_in.get(), out); } } //---------------------------------------------------------------------------------- template - void Circuit::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void Circuit::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); + Marshall(in, *item); option_out.set(*item); } - //class SECircuit - template - void Circuit::Marshall(const CircuitBindType& in, SECircuit& out, const std::map& nodes, const std::map& paths) + // class SECircuit + template + void Circuit::UnMarshall(const CircuitBindType& in, SECircuit& out, const std::map& nodes, const std::map& paths) { - out.Clear(); + out.Invalidate(); out.m_Name = in.Name(); for (auto name : in.Node()) { auto idx = nodes.find(name); @@ -154,8 +159,8 @@ namespace io { out.StateChange(); } //---------------------------------------------------------------------------------- - template - void Circuit::UnMarshall(const SECircuit& in, CircuitBindType& out) + template + void Circuit::Marshall(const SECircuit& in, CircuitBindType& out) { out.Name(in.m_Name); if (in.HasReferenceNode()) { @@ -168,51 +173,59 @@ namespace io { out.Path().push_back(p->GetName()); } //---------------------------------------------------------------------------------- - //class SECircuitNode + // class SECircuitNode template - void Circuit::Marshall(const CDM::CircuitNodeData& in, SECircuitNode& out) + void Circuit::UnMarshall(const CDM::CircuitNodeData& in, SECircuitNode& out) { - out.Clear(); + out.Invalidate(); } //---------------------------------------------------------------------------------- template - void Circuit::UnMarshall(const SECircuitNode& in, CDM::CircuitNodeData& out) + void Circuit::Marshall(const SECircuitNode& in, CDM::CircuitNodeData& out) { out.Name(in.m_Name); } //---------------------------------------------------------------------------------- - //class SECircuitPath + // class SECircuitPath template - void Circuit::Marshall(const CDM::CircuitPathData& in, SECircuitPath& out) + void Circuit::UnMarshall(const CDM::CircuitPathData& in, SECircuitPath& out) { - out.Clear(); - out.SetSwitch(in.Switch().get()); - out.SetNextSwitch(in.NextSwitch().get()); - out.SetValve(in.Valve().get()); - out.SetNextValve(in.NextValve().get()); - out.SetPolarizedState(in.PolarizedState().get()); - out.SetNextPolarizedState(in.NextPolarizedState().get()); + // out.Invalidate(); + + io::Property::UnMarshall(in.Switch(), out.m_Switch); + io::Property::UnMarshall(in.NextSwitch(), out.m_NextSwitch); + io::Property::UnMarshall(in.Valve(), out.m_Valve); + io::Property::UnMarshall(in.NextValve(), out.m_NextValve); + io::Property::UnMarshall(in.PolarizedState(), out.m_PolarizedState); + io::Property::UnMarshall(in.NextPolarizedState(), out.m_NextPolarizedState); } //---------------------------------------------------------------------------------- template - void Circuit::UnMarshall(const SECircuitPath& in, CDM::CircuitPathData& out) + void Circuit::Marshall(const SECircuitPath& in, CDM::CircuitPathData& out) { out.Name(in.m_Name); out.SourceNode(in.m_SourceNode.GetName()); out.TargetNode(in.m_TargetNode.GetName()); - if (in.HasSwitch()) - out.Switch(in.m_Switch); - if (in.HasNextSwitch()) - out.NextSwitch(in.m_NextSwitch); - if (in.HasValve()) - out.Valve(in.m_Valve); - if (in.HasNextValve()) - out.NextValve(in.m_NextValve); - if (in.HasPolarizedState()) - out.PolarizedState(in.m_PolarizedState); - if (in.HasNextPolarizedState()) - out.NextPolarizedState(in.m_NextPolarizedState); + + if (in.HasSwitch()) { + io::Property::Marshall(in.m_Switch, out.Switch()); + } + if (in.HasNextSwitch()) { + io::Property::Marshall(in.m_NextSwitch, out.NextSwitch()); + } + if (in.HasValve()) { + io::Property::Marshall(in.m_Valve, out.Valve()); + } + if (in.HasNextValve()) { + io::Property::Marshall(in.m_NextValve, out.NextValve()); + } + if (in.HasPolarizedState()) { + io::Property::Marshall(in.m_PolarizedState, out.PolarizedState()); + } + if (in.HasNextPolarizedState()) { + io::Property::Marshall(in.m_NextPolarizedState, out.NextPolarizedState()); + } } //---------------------------------------------------------------------------------- } // Namespace IO -} //Namespace Biogears +} // Namespace Biogears diff --git a/projects/biogears/libBiogears/src/io/cdm/Compartment.cpp b/projects/biogears/libBiogears/src/io/cdm/Compartment.cpp index 9c0645d81..e746fad8e 100644 --- a/projects/biogears/libBiogears/src/io/cdm/Compartment.cpp +++ b/projects/biogears/libBiogears/src/io/cdm/Compartment.cpp @@ -1,3 +1,4 @@ + #include "Compartment.h" #include "Property.h" @@ -29,33 +30,34 @@ namespace biogears { namespace io { - //class SECompartment - void Compartment::Marshall(const CDM::CompartmentData& in, SECompartment& out) + // class SECompartment + void Compartment::UnMarshall(const CDM::CompartmentData& in, SECompartment& out) { - out.Clear(); + out.Invalidate(); + out.m_Name = in.Name(); } //---------------------------------------------------------------------------------- - void Compartment::UnMarshall(const SECompartment& in, CDM::CompartmentData& out) + void Compartment::Marshall(const SECompartment& in, CDM::CompartmentData& out) { out.Name(in.m_Name); } //---------------------------------------------------------------------------------- - //class SECompartmentLink - void Compartment::Marshall(const CDM::CompartmentLinkData& in, SECompartmentLink& out) + // class SECompartmentLink + void Compartment::UnMarshall(const CDM::CompartmentLinkData& in, SECompartmentLink& out) { - out.Clear(); + out.Invalidate(); } //---------------------------------------------------------------------------------- - void Compartment::UnMarshall(const SECompartmentLink& in, CDM::CompartmentLinkData& out) + void Compartment::Marshall(const SECompartmentLink& in, CDM::CompartmentLinkData& out) { out.Name(in.m_Name); } //---------------------------------------------------------------------------------- - //class SEFluidCompartment + // class SEFluidCompartment template - void Compartment::Marshall(const CDM::FluidCompartmentData& in, SEFluidCompartment& out, SECircuitManager* circuits) + void Compartment::UnMarshall(const CDM::FluidCompartmentData& in, SEFluidCompartment& out, SECircuitManager* circuits) { - Marshall(static_cast(in), static_cast(out)); + UnMarshall(static_cast(in), static_cast(out)); if (!in.Child().empty()) return; else if (!in.Node().empty()) { @@ -71,19 +73,19 @@ namespace io { } } else { // Only load these if you don't have children or nodes if (in.Pressure().present()) { - io::Property::Marshall(in.Pressure(), out.GetPressure()); + io::Property::UnMarshall(in.Pressure(), out.GetPressure()); } if (in.Volume().present()) { - io::Property::Marshall(in.Volume(), out.GetVolume()); + io::Property::UnMarshall(in.Volume(), out.GetVolume()); } } } //---------------------------------------------------------------------------------- template - void Compartment::UnMarshall(const SEFluidCompartment& in, CDM::FluidCompartmentData& out) + void Compartment::Marshall(const SEFluidCompartment& in, CDM::FluidCompartmentData& out) { - UnMarshall(static_cast(in), static_cast(out)); + Marshall(static_cast(in), static_cast(out)); for (auto child : in.m_FluidChildren) { out.Child().push_back(child->GetName()); } @@ -91,26 +93,18 @@ namespace io { out.Node().push_back(nodes->GetName()); } // Even if you have children or nodes, I am unloading everything, this makes the xml actually usefull... - if (in.HasInFlow()) { - io::Property::UnMarshall(const_cast&>(in).GetInFlow(), out.InFlow()); - } - if (in.HasOutFlow()) { - io::Property::UnMarshall(const_cast&>(in).GetOutFlow(), out.OutFlow()); - } - if (in.HasPressure()) { - io::Property::UnMarshall(const_cast&>(in).GetPressure(), out.Pressure()); - } - if (in.HasVolume()) { - io::Property::UnMarshall(const_cast&>(in).GetVolume(), out.Volume()); - } + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in,out,InFlow) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, OutFlow) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Pressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Volume) } //---------------------------------------------------------------------------------- - //class SEFluidCompartmentLink + // class SEFluidCompartmentLink template - void Compartment::Marshall(const CDM::FluidCompartmentLinkData& in, SEFluidCompartmentLink& out, SECircuitManager* circuits) + void Compartment::UnMarshall(const CDM::FluidCompartmentLinkData& in, SEFluidCompartmentLink& out, SECircuitManager* circuits) { - Marshall(static_cast(in), static_cast(out)); + UnMarshall(static_cast(in), static_cast(out)); if (in.Path().present()) { if (circuits == nullptr) { throw CommonDataModelException("Link is mapped to circuit path, " + std::string { in.Path().get() } + ", but no circuit manager was provided, cannot load"); @@ -122,62 +116,62 @@ namespace io { out.MapPath(*path); } else { if (in.Flow().present()) - io::Property::Marshall(in.Flow(), out.GetFlow()); + io::Property::UnMarshall(in.Flow(), out.GetFlow()); } } //---------------------------------------------------------------------------------- template - void Compartment::UnMarshall(const SEFluidCompartmentLink& in, CDM::FluidCompartmentLinkData& out) + void Compartment::Marshall(const SEFluidCompartmentLink& in, CDM::FluidCompartmentLinkData& out) { - UnMarshall(static_cast(in), static_cast(out)); + Marshall(static_cast(in), static_cast(out)); out.SourceCompartment(in.m_SourceCmpt.GetName()); out.TargetCompartment(in.m_TargetCmpt.GetName()); if (in.m_Path != nullptr) out.Path(in.m_Path->GetName()); // Even if you have a path, I am unloading everything, this makes the xml actually usefull... - if (in.HasFlow()) - io::Property::UnMarshall(const_cast&>(in).GetFlow(), out.Flow()); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in,out,Flow) + } //---------------------------------------------------------------------------------- - //class SEGasCompartment - void Compartment::Marshall(const CDM::GasCompartmentData& in, SEGasCompartment& out, SESubstanceManager& subMgr, SECircuitManager* circuits) + // class SEGasCompartment + void Compartment::UnMarshall(const CDM::GasCompartmentData& in, SEGasCompartment& out, SESubstanceManager& subMgr, SECircuitManager* circuits) { - Marshall<>(static_cast(in), static_cast&>(out), circuits); + UnMarshall<>(static_cast(in), static_cast&>(out), circuits); if (in.Child().empty()) { for (const CDM::GasSubstanceQuantityData& d : in.SubstanceQuantity()) { SESubstance* sub = subMgr.GetSubstance(d.Substance()); if (sub == nullptr) { throw CommonDataModelException("Could not find a substance for " + std::string { d.Substance() }); } - io::SubstanceQuantity::Marshall(d, out.CreateSubstanceQuantity(*sub)); + io::SubstanceQuantity::UnMarshall(d, out.CreateSubstanceQuantity(*sub)); ; } } } //---------------------------------------------------------------------------------- - void Compartment::UnMarshall(const SEGasCompartment& in, CDM::GasCompartmentData& out) + void Compartment::Marshall(const SEGasCompartment& in, CDM::GasCompartmentData& out) { - UnMarshall<>(static_cast&>(in), static_cast(out)); + Marshall<>(static_cast&>(in), static_cast(out)); for (SEGasSubstanceQuantity* subQ : in.m_SubstanceQuantities) { - auto gsqData = CDM::GasSubstanceQuantityData(); - io::SubstanceQuantity::UnMarshall(*subQ, gsqData); - out.SubstanceQuantity().push_back(gsqData); + auto gsqData = std::make_unique(); + io::SubstanceQuantity::Marshall(*subQ, *gsqData); + out.SubstanceQuantity().push_back(std::move(gsqData)); } } //---------------------------------------------------------------------------------- - //class SEGasCompartmentLink - void Compartment::Marshall(const CDM::GasCompartmentLinkData& in, SEGasCompartmentLink& out) + // class SEGasCompartmentLink + void Compartment::UnMarshall(const CDM::GasCompartmentLinkData& in, SEGasCompartmentLink& out) { - Marshall(static_cast(in), static_cast(out)); + UnMarshall(static_cast(in), static_cast(out)); } //---------------------------------------------------------------------------------- - void Compartment::UnMarshall(const SEGasCompartmentLink& in, CDM::GasCompartmentLinkData& out) + void Compartment::Marshall(const SEGasCompartmentLink& in, CDM::GasCompartmentLinkData& out) { - UnMarshall(static_cast(in), static_cast(out)); + Marshall(static_cast const&>(in), static_cast(out)); } //---------------------------------------------------------------------------------- - //class SEGasCompartmentGraph - void Compartment::Marshall(const CDM::GasCompartmentGraphData& in, SEGasCompartmentGraph& out, SECompartmentManager& cmptMgr) + // class SEGasCompartmentGraph + void Compartment::UnMarshall(const CDM::GasCompartmentGraphData& in, SEGasCompartmentGraph& out, SECompartmentManager& cmptMgr) { out.m_Name = in.Name(); for (auto name : in.Compartment()) { @@ -196,7 +190,7 @@ namespace io { } } //---------------------------------------------------------------------------------- - void Compartment::UnMarshall(const SEGasCompartmentGraph& in, CDM::GasCompartmentGraphData& out) + void Compartment::Marshall(const SEGasCompartmentGraph& in, CDM::GasCompartmentGraphData& out) { out.Name(in.m_Name); for (SEGasCompartment* cmpt : in.m_Compartments) @@ -205,57 +199,54 @@ namespace io { out.Link().push_back(link->GetName()); } //---------------------------------------------------------------------------------- - //class SELiquidCompartment - void Compartment::Marshall(const CDM::LiquidCompartmentData& in, SELiquidCompartment& out, SESubstanceManager& subMgr, SECircuitManager* circuits) + // class SELiquidCompartment + void Compartment::UnMarshall(const CDM::LiquidCompartmentData& in, SELiquidCompartment& out, SESubstanceManager& subMgr, SECircuitManager* circuits) { - Marshall(static_cast(in), static_cast&>(out), circuits); + UnMarshall(static_cast(in), static_cast&>(out), circuits); if (in.Child().empty()) { for (const CDM::LiquidSubstanceQuantityData& d : in.SubstanceQuantity()) { SESubstance* sub = subMgr.GetSubstance(d.Substance()); if (sub == nullptr) { throw CommonDataModelException("Could not find a substance for " + std::string { d.Substance() }); } - io::SubstanceQuantity::Marshall(d, out.CreateSubstanceQuantity(*sub)); + io::SubstanceQuantity::UnMarshall(d, out.CreateSubstanceQuantity(*sub)); } if (in.pH().present()) { - io::Property::Marshall(in.pH(), out.GetPH()); + io::Property::UnMarshall(in.pH(), out.GetPH()); } if (in.WaterVolumeFraction().present()) { - io::Property::Marshall(in.WaterVolumeFraction(), out.GetWaterVolumeFraction()); + io::Property::UnMarshall(in.WaterVolumeFraction(), out.GetWaterVolumeFraction()); } } } //---------------------------------------------------------------------------------- - void Compartment::UnMarshall(const SELiquidCompartment& in, CDM::LiquidCompartmentData& out) + void Compartment::Marshall(const SELiquidCompartment& in, CDM::LiquidCompartmentData& out) { - UnMarshall(static_cast&>(in), static_cast(out)); + Marshall(static_cast&>(in), static_cast(out)); for (SELiquidSubstanceQuantity* subQ : in.m_SubstanceQuantities) { auto lqsData = CDM::LiquidSubstanceQuantityData(); - io::SubstanceQuantity::UnMarshall(*subQ, lqsData); + io::SubstanceQuantity::Marshall(*subQ, lqsData); out.SubstanceQuantity().push_back(lqsData); } - if (in.HasPH()) { - io::Property::UnMarshall(in.GetPH(), out.pH()); - } - if (in.HasWaterVolumeFraction()) { - io::Property::UnMarshall(in.GetWaterVolumeFraction(), out.WaterVolumeFraction()); - } + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in,out,pH) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, WaterVolumeFraction) + } //---------------------------------------------------------------------------------- - //class SELiquidCompartmentLink - void Compartment::Marshall(const CDM::LiquidCompartmentLinkData& in, SELiquidCompartmentLink& out) + // class SELiquidCompartmentLink + void Compartment::UnMarshall(const CDM::LiquidCompartmentLinkData& in, SELiquidCompartmentLink& out) { - Marshall(static_cast(in), static_cast&>(out)); + UnMarshall(static_cast(in), static_cast&>(out)); } //---------------------------------------------------------------------------------- - void Compartment::UnMarshall(const SELiquidCompartmentLink& in, CDM::LiquidCompartmentLinkData& out) + void Compartment::Marshall(const SELiquidCompartmentLink& in, CDM::LiquidCompartmentLinkData& out) { - UnMarshall(static_cast&>(in), static_cast(out)); + Marshall(static_cast&>(in), static_cast(out)); } //---------------------------------------------------------------------------------- - //class SELiquidCompartmentGraph - void Compartment::Marshall(const CDM::LiquidCompartmentGraphData& in, SELiquidCompartmentGraph& out, SECompartmentManager& cmptMgr) + // class SELiquidCompartmentGraph + void Compartment::UnMarshall(const CDM::LiquidCompartmentGraphData& in, SELiquidCompartmentGraph& out, SECompartmentManager& cmptMgr) { out.m_Name = in.Name(); for (auto name : in.Compartment()) { @@ -274,7 +265,7 @@ namespace io { } } //---------------------------------------------------------------------------------- - void Compartment::UnMarshall(const SELiquidCompartmentGraph& in, CDM::LiquidCompartmentGraphData& out) + void Compartment::Marshall(const SELiquidCompartmentGraph& in, CDM::LiquidCompartmentGraphData& out) { out.Name(in.m_Name); for (SELiquidCompartment* cmpt : in.m_Compartments) @@ -283,55 +274,44 @@ namespace io { out.Link().push_back(link->GetName()); } //---------------------------------------------------------------------------------- - //class SETissueCompartment - void Compartment::Marshall(const CDM::TissueCompartmentData& in, SETissueCompartment& out, SESubstanceManager& subMgr, SECircuitManager* circuits) + // class SETissueCompartment + void Compartment::UnMarshall(const CDM::TissueCompartmentData& in, SETissueCompartment& out, SESubstanceManager& subMgr, SECircuitManager* circuits) { - Marshall(static_cast(in), static_cast(out)); + UnMarshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.AcidicPhospohlipidConcentration(), out.GetAcidicPhospohlipidConcentration()); - io::Property::Marshall(in.MatrixVolume(), out.GetMatrixVolume()); - io::Property::Marshall(in.MembranePotential(), out.GetMembranePotential()); - io::Property::Marshall(in.NeutralLipidsVolumeFraction(), out.GetNeutralLipidsVolumeFraction()); - io::Property::Marshall(in.NeutralPhospholipidsVolumeFraction(), out.GetNeutralPhospholipidsVolumeFraction()); - io::Property::Marshall(in.ReflectionCoefficient(), out.GetReflectionCoefficient()); - io::Property::Marshall(in.TissueToPlasmaAlbuminRatio(), out.GetTissueToPlasmaAlbuminRatio()); - io::Property::Marshall(in.TissueToPlasmaAlphaAcidGlycoproteinRatio(), out.GetTissueToPlasmaAlphaAcidGlycoproteinRatio()); - io::Property::Marshall(in.TissueToPlasmaLipoproteinRatio(), out.GetTissueToPlasmaLipoproteinRatio()); - io::Property::Marshall(in.TotalMass(), out.GetTotalMass()); + io::Property::UnMarshall(in.AcidicPhospohlipidConcentration(), out.GetAcidicPhospohlipidConcentration()); + io::Property::UnMarshall(in.MatrixVolume(), out.GetMatrixVolume()); + io::Property::UnMarshall(in.MembranePotential(), out.GetMembranePotential()); + io::Property::UnMarshall(in.NeutralLipidsVolumeFraction(), out.GetNeutralLipidsVolumeFraction()); + io::Property::UnMarshall(in.NeutralPhospholipidsVolumeFraction(), out.GetNeutralPhospholipidsVolumeFraction()); + io::Property::UnMarshall(in.ReflectionCoefficient(), out.GetReflectionCoefficient()); + io::Property::UnMarshall(in.TissueToPlasmaAlbuminRatio(), out.GetTissueToPlasmaAlbuminRatio()); + io::Property::UnMarshall(in.TissueToPlasmaAlphaAcidGlycoproteinRatio(), out.GetTissueToPlasmaAlphaAcidGlycoproteinRatio()); + io::Property::UnMarshall(in.TissueToPlasmaLipoproteinRatio(), out.GetTissueToPlasmaLipoproteinRatio()); + io::Property::UnMarshall(in.TotalMass(), out.GetTotalMass()); } //---------------------------------------------------------------------------------- - void Compartment::UnMarshall(const SETissueCompartment& in, CDM::TissueCompartmentData& out) + void Compartment::Marshall(const SETissueCompartment& in, CDM::TissueCompartmentData& out) { - UnMarshall(static_cast(in), static_cast(out)); - if (in.HasAcidicPhospohlipidConcentration()) - io::Property::UnMarshall(*in.m_AcidicPhospohlipidConcentration, out.AcidicPhospohlipidConcentration()); - if (in.HasMatrixVolume()) - io::Property::UnMarshall(*in.m_MatrixVolume, out.MatrixVolume()); - if (in.HasMembranePotential()) - io::Property::UnMarshall(*in.m_MembranePotential, out.MembranePotential()); - if (in.HasNeutralLipidsVolumeFraction()) - io::Property::UnMarshall(*in.m_NeutralLipidsVolumeFraction, out.NeutralLipidsVolumeFraction()); - if (in.HasNeutralPhospholipidsVolumeFraction()) - io::Property::UnMarshall(*in.m_NeutralPhospholipidsVolumeFraction, out.NeutralPhospholipidsVolumeFraction()); - if (in.HasReflectionCoefficient()) - io::Property::UnMarshall(*in.m_ReflectionCoefficient, out.ReflectionCoefficient()); - if (in.HasTissueToPlasmaAlbuminRatio()) - io::Property::UnMarshall(*in.m_TissueToPlasmaAlbuminRatio, out.TissueToPlasmaAlbuminRatio()); - if (in.HasTissueToPlasmaAlbuminRatio()) - io::Property::UnMarshall(*in.m_TissueToPlasmaAlbuminRatio, out.TissueToPlasmaAlbuminRatio()); - if (in.HasTissueToPlasmaAlphaAcidGlycoproteinRatio()) - io::Property::UnMarshall(*in.m_TissueToPlasmaAlphaAcidGlycoproteinRatio, out.TissueToPlasmaAlphaAcidGlycoproteinRatio()); - if (in.HasTissueToPlasmaLipoproteinRatio()) - io::Property::UnMarshall(*in.m_TissueToPlasmaLipoproteinRatio, out.TissueToPlasmaLipoproteinRatio()); - if (in.HasTotalMass()) - io::Property::UnMarshall(*in.m_TotalMass, out.TotalMass()); + Marshall(static_cast(in), static_cast(out)); + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, AcidicPhospohlipidConcentration) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MatrixVolume) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MembranePotential) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, NeutralLipidsVolumeFraction) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, NeutralPhospholipidsVolumeFraction) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ReflectionCoefficient) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TissueToPlasmaAlbuminRatio) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TissueToPlasmaAlphaAcidGlycoproteinRatio) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TissueToPlasmaLipoproteinRatio) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TotalMass) } //---------------------------------------------------------------------------------- - //class SEThermalCompartment - void Compartment::Marshall(const CDM::ThermalCompartmentData& in, SEThermalCompartment& out, SECircuitManager* circuits) + // class SEThermalCompartment + void Compartment::UnMarshall(const CDM::ThermalCompartmentData& in, SEThermalCompartment& out, SECircuitManager* circuits) { - Marshall(static_cast(in), static_cast(out)); + UnMarshall(static_cast(in), static_cast(out)); // Not Loading In/Out HeatTransferRate, those are calculated on demand if (!in.Child().empty()) return; @@ -347,34 +327,31 @@ namespace io { out.MapNode(*node); } } else { // Only load these if you don't have children or nodes - io::Property::Marshall(in.Heat(), out.GetHeat()); - io::Property::Marshall(in.Temperature(), out.GetTemperature()); + io::Property::UnMarshall(in.Heat(), out.GetHeat()); + io::Property::UnMarshall(in.Temperature(), out.GetTemperature()); } } //---------------------------------------------------------------------------------- - void Compartment::UnMarshall(SEThermalCompartment& in, CDM::ThermalCompartmentData& out) + void Compartment::Marshall(SEThermalCompartment& in, CDM::ThermalCompartmentData& out) { - UnMarshall(static_cast(in), static_cast(out)); + Marshall(static_cast(in), static_cast(out)); for (SEThermalCompartment* child : in.m_Children) out.Child().push_back(child->GetName()); for (SEThermalCircuitNode* nodes : in.m_Nodes.GetNodes()) out.Node().push_back(nodes->GetName()); // Even if you have children or nodes, I am unloading everything, this makes the xml actually usefull... - if (in.HasHeatTransferRateIn()) - io::Property::UnMarshall(in.GetHeatTransferRateIn(), out.HeatTransferRateIn()); - if (in.HasHeatTransferRateOut()) - io::Property::UnMarshall(in.GetHeatTransferRateOut(), out.HeatTransferRateOut()); - if (in.HasHeat()) - io::Property::UnMarshall(in.GetHeat(), out.Heat()); - if (in.HasTemperature()) - io::Property::UnMarshall(in.GetTemperature(), out.Temperature()); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, HeatTransferRateIn) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, HeatTransferRateOut) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Heat) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Temperature) + } //---------------------------------------------------------------------------------- - //class SEThermalCompartmentLink - void Compartment::Marshall(const CDM::ThermalCompartmentLinkData& in, SEThermalCompartmentLink& out, SECircuitManager* circuits) + // class SEThermalCompartmentLink + void Compartment::UnMarshall(const CDM::ThermalCompartmentLinkData& in, SEThermalCompartmentLink& out, SECircuitManager* circuits) { - Marshall(static_cast(in), static_cast(out)); + UnMarshall(static_cast(in), static_cast(out)); if (in.Path().present()) { if (circuits == nullptr) { throw CommonDataModelException("Link is mapped to circuit path, " + std::string { in.Path().get() } + ", but no circuit manager was provided, cannot load"); @@ -386,32 +363,30 @@ namespace io { out.MapPath(*path); } else { if (in.HeatTransferRate().present()) { - io::Property::Marshall(in.HeatTransferRate(), out.GetHeatTransferRate()); + io::Property::UnMarshall(in.HeatTransferRate(), out.GetHeatTransferRate()); } } } //---------------------------------------------------------------------------------- - void Compartment::UnMarshall(const SEThermalCompartmentLink& in, CDM::ThermalCompartmentLinkData& out) + void Compartment::Marshall(const SEThermalCompartmentLink& in, CDM::ThermalCompartmentLinkData& out) { - UnMarshall(static_cast(in), static_cast(out)); + Marshall(static_cast(in), static_cast(out)); out.SourceCompartment(in.m_SourceCmpt.GetName()); out.TargetCompartment(in.m_TargetCmpt.GetName()); if (in.m_Path != nullptr) out.Path(in.m_Path->GetName()); - // Even if you have a path, I am unloading everything, this makes the xml actually usefull... - if (in.HasHeatTransferRate()) { - io::Property::UnMarshall(*in.m_HeatTransferRate, out.HeatTransferRate()); - } + // Even if you have a path, I am unloading everything, this makes the xml actually usefull...6 + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in,out,HeatTransferRate) } -#define LOAD_COMPARTMENT(type) \ - for (auto& cData : in.type##Compartment()) { \ - Marshall(cData, out.Create##type##Compartment(cData.Name()), out.m_subMgr, circuits); \ +#define LOAD_COMPARTMENT(type) \ + for (auto& cData : in.type##Compartment()) { \ + UnMarshall(cData, out.Create##type##Compartment(cData.Name()), out.m_subMgr, circuits); \ } -#define LOAD_THERMAL_COMPARTMENT(type) \ - for (auto& cData : in.type##Compartment()) { \ - Marshall(cData, out.Create##type##Compartment(cData.Name()), circuits); \ +#define LOAD_THERMAL_COMPARTMENT(type) \ + for (auto& cData : in.type##Compartment()) { \ + UnMarshall(cData, out.Create##type##Compartment(cData.Name()), circuits); \ } #define LOAD_LINK(type) \ @@ -424,7 +399,7 @@ namespace io { if (src == nullptr) { \ throw CommonDataModelException("Unable to find target compartment " + std::string { cData.TargetCompartment() } + " for link " + cData.Name().c_str()); \ } \ - Marshall(cData, out.Create##type##Link(*src, *tgt, cData.Name()), circuits); \ + UnMarshall(cData, out.Create##type##Link(*src, *tgt, cData.Name()), circuits); \ } #define LOAD_HIERARCHY(type) \ @@ -439,9 +414,9 @@ namespace io { } \ } -#define LOAD_GRAPH(type) \ - for (auto& cData : in.type##Graph()) { \ - Marshall(cData, out.Create##type##Graph(cData.Name()), out); \ +#define LOAD_GRAPH(type) \ + for (auto& cData : in.type##Graph()) { \ + UnMarshall(cData, out.Create##type##Graph(cData.Name()), out); \ } #define LOAD_SUBSTANCE(type) \ @@ -454,10 +429,10 @@ namespace io { } //---------------------------------------------------------------------------------- - //class SECompartmentManager - void Compartment::Marshall(CDM::CompartmentManagerData& in, SECompartmentManager& out, SECircuitManager* circuits) + // class SECompartmentManager + void Compartment::UnMarshall(CDM::CompartmentManagerData const& in, SECompartmentManager& out, SECircuitManager* circuits) { - out.Clear(); + out.Invalidate(); LOAD_COMPARTMENT(Gas); LOAD_LINK(Gas); @@ -480,62 +455,62 @@ namespace io { out.StateChange(); } //---------------------------------------------------------------------------------- - void Compartment::UnMarshall(const SECompartmentManager& in, CDM::CompartmentManagerData& out) + void Compartment::Marshall(const SECompartmentManager& in, CDM::CompartmentManagerData& out) { for (SELiquidCompartment* cmpt : in.m_LiquidCompartments) { - auto lcData = CDM::LiquidCompartmentData(); - UnMarshall(*cmpt, lcData); - out.LiquidCompartment().push_back(lcData); + auto lcData = std::make_unique(); + Marshall(*cmpt, *lcData); + out.LiquidCompartment().push_back(std::move(lcData)); } for (SELiquidCompartmentLink* link : in.m_LiquidLinks) { - auto lclData = CDM::LiquidCompartmentLinkData(); - UnMarshall(*link, lclData); - out.LiquidLink().push_back(lclData); + auto lclData = std::make_unique(); + Marshall(*link, *lclData); + out.LiquidLink().push_back(std::move(lclData)); } for (SELiquidCompartmentGraph* graph : in.m_LiquidGraphs) { - auto lcGData = CDM::LiquidCompartmentGraphData(); - UnMarshall(*graph, lcGData); - out.LiquidGraph().push_back(lcGData); + auto lcGData = std::make_unique < CDM::LiquidCompartmentGraphData>(); + Marshall(*graph, *lcGData); + out.LiquidGraph().push_back(std::move(lcGData)); } for (SESubstance* sub : in.m_LiquidSubstances) { out.LiquidSubstance().push_back(sub->GetName()); } for (SEGasCompartment* cmpt : in.m_GasCompartments) { - auto gcData = CDM::GasCompartmentData(); - UnMarshall(*cmpt, gcData); - out.GasCompartment().push_back(gcData); + auto gcData = std::make_unique < CDM::GasCompartmentData>(); + Marshall(*cmpt, *gcData); + out.GasCompartment().push_back(std::move(gcData)); } for (SEGasCompartmentLink* link : in.m_GasLinks) { - auto gclData = CDM::GasCompartmentLinkData(); - UnMarshall(*link, gclData); - out.GasLink().push_back(gclData); + auto gclData = std::make_unique < CDM::GasCompartmentLinkData>(); + Marshall(*link, *gclData); + out.GasLink().push_back(std::move(gclData)); } for (SEGasCompartmentGraph* graph : in.m_GasGraphs) { - auto gcgData = CDM::GasCompartmentGraphData(); - UnMarshall(*graph, gcgData); - out.GasGraph().push_back(gcgData); + auto gcgData = std::make_unique < CDM::GasCompartmentGraphData>(); + Marshall(*graph, *gcgData); + out.GasGraph().push_back(std::move(gcgData)); } for (SESubstance* sub : in.m_GasSubstances) out.GasSubstance().push_back(sub->GetName()); for (SEThermalCompartment* cmpt : in.m_ThermalCompartments) { - auto tcData = CDM::ThermalCompartmentData(); - UnMarshall(*cmpt, tcData); - out.ThermalCompartment().push_back(tcData); + auto tcData = std::make_unique < CDM::ThermalCompartmentData>(); + Marshall(*cmpt, *tcData); + out.ThermalCompartment().push_back(std::move(tcData)); } for (SEThermalCompartmentLink* link : in.m_ThermalLinks) { - auto tclData = CDM::ThermalCompartmentLinkData(); - UnMarshall(*link, tclData); - out.ThermalLink().push_back(tclData); + auto tclData = std::make_unique < CDM::ThermalCompartmentLinkData>(); + Marshall(*link, *tclData); + out.ThermalLink().push_back(std::move(tclData)); } for (SETissueCompartment* cmpt : in.m_TissueCompartments) { - auto tcData = CDM::TissueCompartmentData(); - UnMarshall(*cmpt, tcData); - out.TissueCompartment().push_back(tcData); + auto tcData = std::make_unique < CDM::TissueCompartmentData>(); + Marshall(*cmpt, *tcData); + out.TissueCompartment().push_back(std::move(tcData)); } } //---------------------------------------------------------------------------------- } -} \ No newline at end of file +} diff --git a/projects/biogears/libBiogears/src/io/cdm/Compartment.h b/projects/biogears/libBiogears/src/io/cdm/Compartment.h index 0119f5441..16f81bab2 100644 --- a/projects/biogears/libBiogears/src/io/cdm/Compartment.h +++ b/projects/biogears/libBiogears/src/io/cdm/Compartment.h @@ -17,21 +17,25 @@ specific language governing permissions and limitations under the License. #include +#include +#include #include +#include #include +#include #include - +#include #include -#define CDM_COMPARTMENT_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_COMPARTMENT_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ out.func(std::make_unique::type>()); \ - io::Compartment::UnMarshall(*in.m_##func, out.func()); \ + io::Compartment::Marshall(*in.m_##func, out.func()); \ } -#define CDM_OPTIONAL_COMPARTMENT_UNMARSHAL_HELPER(in, out, func) \ - if (in.m_##func) { \ - io::Compartment::UnMarshall(*in.m_##func, out.func()); \ +#define CDM_OPTIONAL_COMPARTMENT_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func) { \ + io::Compartment::Marshall(*in.m_##func, out.func()); \ } namespace biogears { @@ -45,90 +49,91 @@ class SEFluidCompartment; template class SEFluidCompartmentLink; +class SECompartmentManager; class SEGasCompartment; -class SEGasCompartmentLink; class SEGasCompartmentGraph; +class SEGasCompartmentLink; class SELiquidCompartment; -class SELiquidCompartmentLink; class SELiquidCompartmentGraph; -class SETissueCompartment; +class SELiquidCompartmentLink; +class SESubstanceManager; class SEThermalCompartment; class SEThermalCompartmentLink; -class SECompartmentManager; +class SETissueCompartment; namespace io { class BIOGEARS_PRIVATE_API Compartment { public: - //template option + // template option template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); - //class SECompartment - static void Marshall(const CDM::CompartmentData& in, SECompartment& out); - static void UnMarshall(const SECompartment& in, CDM::CompartmentData& out); - //class SECompartmentLink - static void Marshall(const CDM::CompartmentLinkData& in, SECompartmentLink& out); - static void UnMarshall(const SECompartmentLink& in, CDM::CompartmentLinkData& out); - //class SEFluidCompartment + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); + // class SECompartment + static void UnMarshall(const CDM::CompartmentData& in, SECompartment& out); + static void Marshall(const SECompartment& in, CDM::CompartmentData& out); + // class SECompartmentLink + static void UnMarshall(const CDM::CompartmentLinkData& in, SECompartmentLink& out); + static void Marshall(const SECompartmentLink& in, CDM::CompartmentLinkData& out); + // class SEFluidCompartment template - static void Marshall(const CDM::FluidCompartmentData& in, SEFluidCompartment& out, SECircuitManager* circuits = nullptr); + static void UnMarshall(const CDM::FluidCompartmentData& in, SEFluidCompartment& out, SECircuitManager* circuits = nullptr); template - static void UnMarshall(const SEFluidCompartment& in, CDM::FluidCompartmentData& out); - //class SEFluidCompartmentLink + static void Marshall(const SEFluidCompartment& in, CDM::FluidCompartmentData& out); + // class SEFluidCompartmentLink template - static void Marshall(const CDM::FluidCompartmentLinkData& in, SEFluidCompartmentLink& out, SECircuitManager* circuits = nullptr); + static void UnMarshall(const CDM::FluidCompartmentLinkData& in, SEFluidCompartmentLink& out, SECircuitManager* circuits = nullptr); template - static void UnMarshall(const SEFluidCompartmentLink& in, CDM::FluidCompartmentLinkData& out); - //class SEGasCompartment - static void Marshall(const CDM::GasCompartmentData& in, SEGasCompartment& out, SESubstanceManager& subMgr, SECircuitManager* circuits = nullptr); - static void UnMarshall(const SEGasCompartment& in, CDM::GasCompartmentData& out); - //class SEGasCompartmentLink - static void Marshall(const CDM::GasCompartmentLinkData& in, SEGasCompartmentLink& out); - static void UnMarshall(const SEGasCompartmentLink& in, CDM::GasCompartmentLinkData& out); - //class SEGasCompartmentGraph - static void Marshall(const CDM::GasCompartmentGraphData& in, SEGasCompartmentGraph& out, SECompartmentManager& cmptMgr); - static void UnMarshall(const SEGasCompartmentGraph& in, CDM::GasCompartmentGraphData& out); - //class SELiquidCompartment - static void Marshall(const CDM::LiquidCompartmentData& in, SELiquidCompartment& out, SESubstanceManager& subMgr, SECircuitManager* circuits); - static void UnMarshall(const SELiquidCompartment& in, CDM::LiquidCompartmentData& out); - //class SELiquidCompartmentLink - static void Marshall(const CDM::LiquidCompartmentLinkData& in, SELiquidCompartmentLink& out); - static void UnMarshall(const SELiquidCompartmentLink& in, CDM::LiquidCompartmentLinkData& out); - //class SELiquidCompartmentGraph - static void Marshall(const CDM::LiquidCompartmentGraphData& in, SELiquidCompartmentGraph& out, SECompartmentManager& cmptMgr); - static void UnMarshall(const SELiquidCompartmentGraph& in, CDM::LiquidCompartmentGraphData& out); - //class SETissueCompartment - static void Marshall(const CDM::TissueCompartmentData& in, SETissueCompartment& out, SESubstanceManager& subMgr, SECircuitManager* circuits = nullptr); - static void UnMarshall(const SETissueCompartment& in, CDM::TissueCompartmentData& out); - //class SEThermalCompartment - static void Marshall(const CDM::ThermalCompartmentData& in, SEThermalCompartment& out, SECircuitManager* circuits = nullptr); - static void UnMarshall(SEThermalCompartment& in, CDM::ThermalCompartmentData& out); - //class SEThermalCompartmentLink - static void Marshall(const CDM::ThermalCompartmentLinkData& in, SEThermalCompartmentLink& out, SECircuitManager* circuits = nullptr); - static void UnMarshall(const SEThermalCompartmentLink& in, CDM::ThermalCompartmentLinkData& out); - //class SECompartmentManager - static void Marshall(CDM::CompartmentManagerData& in, SECompartmentManager& out, SECircuitManager* circuits = nullptr); - static void UnMarshall(const SECompartmentManager& in, CDM::CompartmentManagerData& out); + static void Marshall(const SEFluidCompartmentLink& in, CDM::FluidCompartmentLinkData& out); + // class SEGasCompartment + static void UnMarshall(const CDM::GasCompartmentData& in, SEGasCompartment& out, SESubstanceManager& subMgr, SECircuitManager* circuits = nullptr); + static void Marshall(const SEGasCompartment& in, CDM::GasCompartmentData& out); + // class SEGasCompartmentLink + static void UnMarshall(const CDM::GasCompartmentLinkData& in, SEGasCompartmentLink& out); + static void Marshall(const SEGasCompartmentLink& in, CDM::GasCompartmentLinkData& out); + // class SEGasCompartmentGraph + static void UnMarshall(const CDM::GasCompartmentGraphData& in, SEGasCompartmentGraph& out, SECompartmentManager& cmptMgr); + static void Marshall(const SEGasCompartmentGraph& in, CDM::GasCompartmentGraphData& out); + // class SELiquidCompartment + static void UnMarshall(const CDM::LiquidCompartmentData& in, SELiquidCompartment& out, SESubstanceManager& subMgr, SECircuitManager* circuits); + static void Marshall(const SELiquidCompartment& in, CDM::LiquidCompartmentData& out); + // class SELiquidCompartmentLink + static void UnMarshall(const CDM::LiquidCompartmentLinkData& in, SELiquidCompartmentLink& out); + static void Marshall(const SELiquidCompartmentLink& in, CDM::LiquidCompartmentLinkData& out); + // class SELiquidCompartmentGraph + static void UnMarshall(const CDM::LiquidCompartmentGraphData& in, SELiquidCompartmentGraph& out, SECompartmentManager& cmptMgr); + static void Marshall(const SELiquidCompartmentGraph& in, CDM::LiquidCompartmentGraphData& out); + // class SETissueCompartment + static void UnMarshall(const CDM::TissueCompartmentData& in, SETissueCompartment& out, SESubstanceManager& subMgr, SECircuitManager* circuits = nullptr); + static void Marshall(const SETissueCompartment& in, CDM::TissueCompartmentData& out); + // class SEThermalCompartment + static void UnMarshall(const CDM::ThermalCompartmentData& in, SEThermalCompartment& out, SECircuitManager* circuits = nullptr); + static void Marshall(SEThermalCompartment& in, CDM::ThermalCompartmentData& out); + // class SEThermalCompartmentLink + static void UnMarshall(const CDM::ThermalCompartmentLinkData& in, SEThermalCompartmentLink& out, SECircuitManager* circuits = nullptr); + static void Marshall(const SEThermalCompartmentLink& in, CDM::ThermalCompartmentLinkData& out); + // class SECompartmentManager + static void UnMarshall(CDM::CompartmentManagerData const& in, SECompartmentManager& out, SECircuitManager* circuits = nullptr); + static void Marshall(const SECompartmentManager& in, CDM::CompartmentManagerData& out); }; //---------------------------------------------------------------------------------- template - void Compartment::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + void Compartment::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) { if (!option_in.present()) { - out.Invalidate(); + out.MakeInvalid(); } else { - Marshall(option_in.get(), out); + UnMarshall(option_in.get(), out); } } //---------------------------------------------------------------------------------- template - void Compartment::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void Compartment::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); + Marshall(in, *item); option_out.set(*item); } } // Namespace IO -} //Namespace Biogears +} // Namespace Biogears diff --git a/projects/biogears/libBiogears/src/io/cdm/Conditions.cpp b/projects/biogears/libBiogears/src/io/cdm/Conditions.cpp new file mode 100644 index 000000000..a67f1a2ce --- /dev/null +++ b/projects/biogears/libBiogears/src/io/cdm/Conditions.cpp @@ -0,0 +1,73 @@ +#include "Conditions.h" + +#include "Actions.h" +#include "EnvironmentConditions.h" +#include "PatientConditions.h" +#include "Property.h" + +#include +#include + +#include + +namespace biogears { +namespace io { + + std::vector> Conditions::condition_factory(const CDM::ConditionListData& in, SESubstanceManager& substances, std::default_random_engine* rd) + { + std::vector> r_vec; + for (auto condition_data : in.Condition()) { + r_vec.emplace_back(factory(&condition_data, substances, rd)); + } + return std::move(r_vec); + } + + void Conditions::Marshall(SEConditionManager const& in, std::vector>& out) + { + for (auto condition : in.m_Conditions) { + out.push_back(factory(condition)); + } + } + std::unique_ptr Conditions::factory(CDM::ConditionData const* conditionData, SESubstanceManager& substances, std::default_random_engine* rd) + { + + if (auto patient_condition_data = dynamic_cast(conditionData)) { + return io::PatientConditions::factory(patient_condition_data, substances, rd); + } + + if (auto environment_condition_data = dynamic_cast(conditionData)) { + return io::EnvironmentConditions::factory(environment_condition_data, substances, rd); + } + + throw biogears::CommonDataModelException("Conditions:Factory - Unsupported Condition Received."); + } + + std::unique_ptr Conditions::factory(const SECondition* data) + { + if (auto patient_condition_data = dynamic_cast(data)) { + return io::PatientConditions::factory(patient_condition_data); + } + + if (auto environment_condition_data = dynamic_cast(data)) { + return io::EnvironmentConditions::factory(environment_condition_data); + } + + throw biogears::CommonDataModelException("Conditions::factory does not support the derived Condition. If you are not a developer contact upstream for support."); + } + + // class SECondition; + void Conditions::UnMarshall(const CDM::ConditionData& in, SECondition& out) + { + out.Invalidate(); + if (in.Comment().present()) { + out.m_Comment = in.Comment().get(); + } + } + void Conditions::Marshall(const SECondition& in, CDM::ConditionData& out) + { + if (in.HasComment()) { + out.Comment(in.m_Comment); + } + } +} // namespace io +} // namespace biogears \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/io/cdm/Conditions.h b/projects/biogears/libBiogears/src/io/cdm/Conditions.h new file mode 100644 index 000000000..a6e7ee3d5 --- /dev/null +++ b/projects/biogears/libBiogears/src/io/cdm/Conditions.h @@ -0,0 +1,116 @@ +/************************************************************************************** +Copyright 2019 Applied Research Associates, Inc. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the License +at: +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +**************************************************************************************/ + +#pragma once +#include +#include + +#include +#include +#include +#include + +#include "Conditions.h" + +#include +#include + +// Question: To Serialize Invalid units or not to Serialize? +// TO Throw an exception when a member is invalid? +#define CDM_CONDITIONS_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func && in.m_##func->IsValid()) { \ + out.func(std::make_unique::type>()); \ + io::Conditions::Marshall(*in.m_##func, out.func()); \ + } /* else if (in.m_##func) { \ + throw biogears::CommonDataModelException("func is InValid and cannot be Unmarshalled"); \ + }*/ + +#define CDM_OPTIONAL_CONDITIONS_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func && in.m_##func->IsValid()) { \ + io::Conditions::Marshall(*in.m_##func, out.func()); \ + } /*else if (in.m_##func) { \ + throw biogears::CommonDataModelException("func is InValid and cannot be Unmarshalled"); \ + }*/ + +#define SE_CONDITIONS_ENUM_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.Has##func()) { \ + out.func(std::make_unique::type>()); \ + io::Conditions::Marshall(in.m_##func, out.func()); \ + } + +#define SE_OPTIONAL_CONDITIONS_ENUM_PTR_MARSHALL_HELPER(in, out, func) \ + io::Conditions::Marshall(in.m_##func, out.func()); + +namespace biogears { + +class SECondition; +class SEConditionList; +class SESubstanceManager; +class SEConditionManager; + +namespace io { + class BIOGEARS_PRIVATE_API Conditions { + public: + // class Factories; + static std::vector> condition_factory(const CDM::ConditionListData& in, SESubstanceManager& substances, std::default_random_engine* rd = nullptr); + + static std::unique_ptr factory(CDM::ConditionData const* conditionData, SESubstanceManager& substances, std::default_random_engine* rd = nullptr); + static std::unique_ptr factory(const SECondition* data); + + static void Marshall(SEConditionManager const& in, std::vector>& out); + // template option + template ::value>* = nullptr> + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); + template ::value>* = nullptr> + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out, std::default_random_engine* rd = nullptr); + template + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); + + // class Condition; + static void UnMarshall(const CDM::ConditionData& in, SECondition& out); + static void Marshall(const SECondition& in, CDM::ConditionData& out); + // class ConditionList + // static void UnMarshall(const CDM::ConditionListData& in, SEConditionList& out, std::default_random_engine* re = nullptr); + // static void Marshall(const SEConditionList& in, CDM::ConditionListData& out); + }; + + //---------------------------------------------------------------------------------- + + template ::value>*> + void Conditions::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) + { + if (!option_in.present() || option_in->empty()) { + out = SE::Invalid; + } else { + UnMarshall(option_in.get(), out); + } + } + + template ::value>*> + void Conditions::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out, std::default_random_engine* rd) + { + if (!option_in.present()) { + out.Invalidate(); + } else { + io::Conditions::UnMarshall(option_in.get(), out, rd); + } + } + + template + void Conditions::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) + { + auto item = std::make_unique(); + io::Conditions::Marshall(in, *item); + option_out.set(std::move(item)); + } +} // namespace io +} // namespace biogears diff --git a/projects/biogears/libBiogears/src/io/cdm/DataRequests.cpp b/projects/biogears/libBiogears/src/io/cdm/DataRequests.cpp new file mode 100644 index 000000000..28488d8c1 --- /dev/null +++ b/projects/biogears/libBiogears/src/io/cdm/DataRequests.cpp @@ -0,0 +1,350 @@ +#include "DataRequests.h" + +#include "Property.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace biogears { +namespace io { + //----------------------------------------------------------------------------- + // class SEDataRequestManager + void DataRequests::UnMarshall(const CDM::DataRequestManagerData& in, SESubstanceManager const& subMgr, SEDataRequestManager& out, std::default_random_engine* re) + { + out.Invalidate(); + if (in.Filename().present()) + out.m_ResultsFile = in.Filename().get(); + if (in.WorkingDir().present()) + out.m_WorkingDir = in.WorkingDir().get(); + if (in.SamplesPerSecond().present()) + out.m_SamplesPerSecond = in.SamplesPerSecond().get(); + if (in.DefaultDecimalFormatting().present()) + io::Property::UnMarshall(in.DefaultDecimalFormatting(), out.GetDefaultDecimalFormatting()); + if (in.OverrideDecimalFormatting().present()) + io::Property::UnMarshall(in.OverrideDecimalFormatting(), out.GetOverrideDecimalFormatting()); + + for (auto& request : in.DataRequest()) { + auto dr = factory(&request, subMgr, out.m_DefaultDecimalFormatting); + if (dr != nullptr) { + if (out.HasOverrideDecimalFormatting()) + static_cast(dr.get())->Set(*out.m_OverrideDecimalFormatting); + out.m_Requests.push_back(dr.release()); + } + } + } + void DataRequests::Marshall(const SEDataRequestManager& in, CDM::DataRequestManagerData& out) + { + out.SamplesPerSecond(in.m_SamplesPerSecond); + if (in.HasResultsFilename()) + out.Filename(in.m_ResultsFile); + if (in.HasWorkingDir()) + out.WorkingDir(in.m_WorkingDir); + if (in.HasDefaultDecimalFormatting()) + io::Property::Marshall(*in.m_DefaultDecimalFormatting, out.DefaultDecimalFormatting()); + if (in.HasOverrideDecimalFormatting()) + io::Property::Marshall(*in.m_OverrideDecimalFormatting, out.OverrideDecimalFormatting()); + for (auto* dr : in.m_Requests) { + CDM::DataRequestData data; + out.DataRequest().push_back(io::DataRequests::factory(dr)); + } + } + //----------------------------------------------------------------------------- + // class SEDataRequest + void DataRequests::UnMarshall(const CDM::DataRequestData& in, SEDataRequest& out, std::default_random_engine* re) + { + io::Property::UnMarshall(static_cast(in), static_cast(out)); + out.m_Name = in.Name(); + if (in.Unit().present()) { + out.m_RequestedUnit = in.Unit().get(); + } + } + void DataRequests::Marshall(const SEDataRequest& in, CDM::DataRequestData& out) + { + io::Property::Marshall(static_cast(in), static_cast(out)); + out.Name(in.m_Name); + if (in.HasUnit()) { + out.Unit(in.m_Unit->GetString()); + } else if (in.HasRequestedUnit()) { + + out.Unit(in.m_RequestedUnit); + } + } + //----------------------------------------------------------------------------- + // class SEPatientDataRequest + void DataRequests::UnMarshall(const CDM::PatientDataRequestData& in, SEPatientDataRequest& out, std::default_random_engine* re) + { + io::DataRequests::UnMarshall(static_cast(in), static_cast(out)); + } + void DataRequests::Marshall(const SEPatientDataRequest& in, CDM::PatientDataRequestData& out) + { + io::DataRequests::Marshall(static_cast(in), static_cast(out)); + } + //----------------------------------------------------------------------------- + // class SEPhysiologyDataRequest + void DataRequests::UnMarshall(const CDM::PhysiologyDataRequestData& in, SEPhysiologyDataRequest& out, std::default_random_engine* re) + { + io::DataRequests::UnMarshall(static_cast(in), static_cast(out)); + } + void DataRequests::Marshall(const SEPhysiologyDataRequest& in, CDM::PhysiologyDataRequestData& out) + { + io::DataRequests::Marshall(static_cast(in), static_cast(out)); + } + //----------------------------------------------------------------------------- + // class SEEnvironmentDataRequest + void DataRequests::UnMarshall(const CDM::EnvironmentDataRequestData& in, SEEnvironmentDataRequest& out, std::default_random_engine* re) + { + io::DataRequests::UnMarshall(static_cast(in), static_cast(out)); + } + void DataRequests::Marshall(const SEEnvironmentDataRequest& in, CDM::EnvironmentDataRequestData& out) + { + io::DataRequests::Marshall(static_cast(in), static_cast(out)); + } + //----------------------------------------------------------------------------- + // class SEEquipmentDataRequest + void DataRequests::UnMarshall(const CDM::EquipmentDataRequestData& in, SEEquipmentDataRequest& out, std::default_random_engine* re) + { + io::DataRequests::UnMarshall(static_cast(in), static_cast(out)); + out.SetType(in.Type()); + } + void DataRequests::Marshall(const SEEquipmentDataRequest& in, CDM::EquipmentDataRequestData& out) + { + io::DataRequests::Marshall(static_cast(in), static_cast(out)); + if (in.HasType()) { + out.Type(in.m_Type); + } + } + //----------------------------------------------------------------------------- + // class SECompartmentDataRequest + void DataRequests::UnMarshall(const CDM::CompartmentDataRequestData& in, SECompartmentDataRequest& out, std::default_random_engine* re) + { + io::DataRequests::UnMarshall(static_cast(in), static_cast(out)); + out.SetCompartment(in.Compartment()); + } + void DataRequests::Marshall(const SECompartmentDataRequest& in, CDM::CompartmentDataRequestData& out) + { + io::DataRequests::Marshall(static_cast(in), static_cast(out)); + out.Compartment(in.m_Compartment); + } + //----------------------------------------------------------------------------- + // class SECompartmentSubstanceDataRequest + void DataRequests::UnMarshall(const CDM::CompartmentSubstanceDataRequestData& in, SESubstanceManager const& substances, SECompartmentSubstanceDataRequest& out, std::default_random_engine* re) + { + io::DataRequests::UnMarshall(static_cast(in), static_cast(out)); + if (in.Substance().present()) { + out.SetSubstance(substances.GetSubstance(in.Substance().get())); + } + } + + void DataRequests::Marshall(const SECompartmentSubstanceDataRequest& in, CDM::CompartmentSubstanceDataRequestData& out) + { + io::DataRequests::Marshall(static_cast(in), static_cast(out)); + if (in.HasSubstance()) { + out.Substance(in.m_Substance->GetName()); + } + } + //----------------------------------------------------------------------------- + // class SEGasCompartmentDataRequest + void DataRequests::UnMarshall(const CDM::GasCompartmentDataRequestData& in, SESubstanceManager const& substances, SEGasCompartmentDataRequest& out, std::default_random_engine* re) + { + io::DataRequests::UnMarshall(static_cast(in), substances, static_cast(out)); + } + void DataRequests::Marshall(const SEGasCompartmentDataRequest& in, CDM::GasCompartmentDataRequestData& out) + { + io::DataRequests::Marshall(static_cast(in), static_cast(out)); + } + //----------------------------------------------------------------------------- + // class SELiquidCompartmentDataRequest0 + void DataRequests::UnMarshall(const CDM::LiquidCompartmentDataRequestData& in, SESubstanceManager const& substances, SELiquidCompartmentDataRequest& out, std::default_random_engine* re) + { + io::DataRequests::UnMarshall(static_cast(in), substances, static_cast(out)); + } + void DataRequests::Marshall(const SELiquidCompartmentDataRequest& in, CDM::LiquidCompartmentDataRequestData& out) + { + io::DataRequests::Marshall(static_cast(in), static_cast(out)); + } + //----------------------------------------------------------------------------- + // class SEThermalCompartmentDataRequest + void DataRequests::UnMarshall(const CDM::ThermalCompartmentDataRequestData& in, SEThermalCompartmentDataRequest& out, std::default_random_engine* re) + { + io::DataRequests::UnMarshall(static_cast(in), static_cast(out)); + } + void DataRequests::Marshall(const SEThermalCompartmentDataRequest& in, CDM::ThermalCompartmentDataRequestData& out) + { + io::DataRequests::Marshall(static_cast(in), static_cast(out)); + } + //----------------------------------------------------------------------------- + // class SETissueCompartmentDataRequest + void DataRequests::UnMarshall(const CDM::TissueCompartmentDataRequestData& in, SETissueCompartmentDataRequest& out, std::default_random_engine* re) + { + io::DataRequests::UnMarshall(static_cast(in), static_cast(out)); + } + void DataRequests::Marshall(const SETissueCompartmentDataRequest& in, CDM::TissueCompartmentDataRequestData& out) + { + io::DataRequests::Marshall(static_cast(in), static_cast(out)); + } + // class SESubstanceDataRequest + void DataRequests::UnMarshall(const CDM::SubstanceDataRequestData& in, SESubstanceManager const& substances, SESubstanceDataRequest& out, std::default_random_engine* re) + { + io::DataRequests::UnMarshall(static_cast(in), static_cast(out)); + if (in.Compartment().present()) { + out.SetCompartment(in.Compartment().get()); + } + out.SetSubstance(substances.GetSubstance(in.Substance())); + } + void DataRequests::Marshall(const SESubstanceDataRequest& in, CDM::SubstanceDataRequestData& out) + { + io::DataRequests::Marshall(static_cast(in), static_cast(out)); + if (in.HasCompartment()) { + out.Compartment(in.m_Compartment); + } + if (in.HasSubstance()) { + out.Substance(in.m_Substance->GetName()); + } + } + //----------------------------------------------------------------------------- + std::vector> DataRequests ::data_request_factory(const CDM::DataRequestManagerData& in, SESubstanceManager const& substances, const SEDecimalFormat* df) + { + std::vector> r_vec; + for (auto request_data : in.DataRequest()) { + r_vec.emplace_back(factory(&request_data, substances, df)); + } + return r_vec; + } + + //----------------------------------------------------------------------------- + std::unique_ptr DataRequests::factory(CDM::DataRequestData const* requestData, SESubstanceManager const& substances, const SEDecimalFormat* df) + { + CDM::DataRequestData const* drData = requestData; + CDM::PhysiologyDataRequestData const* physSysData = dynamic_cast(drData); + if (physSysData != nullptr) { + auto sys = std::make_unique(df); + DataRequests::UnMarshall(*physSysData, *sys); + return sys; + } + const CDM::GasCompartmentDataRequestData* gasData = dynamic_cast(drData); + if (gasData != nullptr) { + auto Comp = std::make_unique(df); + DataRequests::UnMarshall(*gasData, substances, *Comp); + return Comp; + } + const CDM::LiquidCompartmentDataRequestData* liquidData = dynamic_cast(drData); + if (liquidData != nullptr) { + auto Comp = std::make_unique(df); + DataRequests::UnMarshall(*liquidData, substances, *Comp); + return Comp; + } + const CDM::ThermalCompartmentDataRequestData* thermData = dynamic_cast(drData); + if (thermData != nullptr) { + auto Comp = std::make_unique(df); + DataRequests::UnMarshall(*thermData, *Comp); + return Comp; + } + const CDM::TissueCompartmentDataRequestData* tissueData = dynamic_cast(drData); + if (tissueData != nullptr) { + auto Comp = std::make_unique(df); + DataRequests::UnMarshall(*tissueData, *Comp); + return Comp; + } + const CDM::PatientDataRequestData* patData = dynamic_cast(drData); + if (patData != nullptr) { + auto sys = std::make_unique(df); + DataRequests::UnMarshall(*patData, *sys); + return sys; + } + const CDM::SubstanceDataRequestData* subData = dynamic_cast(drData); + if (subData != nullptr) { + auto sub = std::make_unique(df); + DataRequests::UnMarshall(*subData, substances, *sub); + return sub; + } + const CDM::EnvironmentDataRequestData* envData = dynamic_cast(drData); + if (envData != nullptr) { + auto env = std::make_unique(df); + DataRequests::UnMarshall(*envData, *env); + return env; + } + const CDM::EquipmentDataRequestData* equipSysData = dynamic_cast(drData); + if (equipSysData != nullptr) { + auto sys = std::make_unique(df); + DataRequests::UnMarshall(*equipSysData, *sys); + return sys; + } + + if (substances.GetLogger() != nullptr) + substances.GetLogger()->Error("Unsupported DataRequest Received", "SEDataRequest::newFromBind"); + return nullptr; + } + //----------------------------------------------------------------------------- + std::unique_ptr DataRequests::factory(const SEDataRequest* in) + { + + auto physSysData = dynamic_cast(in); + if (physSysData != nullptr) { + auto sys = std::make_unique(); + DataRequests::Marshall(*physSysData, *sys); + return sys; + } + auto gasData = dynamic_cast(in); + if (gasData != nullptr) { + auto Comp = std::make_unique(); + DataRequests::Marshall(*gasData, *Comp); + return Comp; + } + auto liquidData = dynamic_cast(in); + if (liquidData != nullptr) { + auto Comp = std::make_unique(); + DataRequests::Marshall(*liquidData, *Comp); + return Comp; + } + auto thermData = dynamic_cast(in); + if (thermData != nullptr) { + auto Comp = std::make_unique(); + DataRequests::Marshall(*thermData, *Comp); + return Comp; + } + auto tissueData = dynamic_cast(in); + if (tissueData != nullptr) { + auto Comp = std::make_unique(); + DataRequests::Marshall(*tissueData, *Comp); + return Comp; + } + auto patData = dynamic_cast(in); + if (patData != nullptr) { + auto sys = std::make_unique(); + DataRequests::Marshall(*patData, *sys); + return sys; + } + auto subData = dynamic_cast(in); + if (subData != nullptr) { + auto sub = std::make_unique(); + DataRequests::Marshall(*subData, *sub); + return sub; + } + auto envData = dynamic_cast(in); + if (envData != nullptr) { + auto env = std::make_unique(); + DataRequests::Marshall(*envData, *env); + return env; + } + auto equipSysData = dynamic_cast(in); + if (equipSysData != nullptr) { + auto sys = std::make_unique(); + DataRequests::Marshall(*equipSysData, *sys); + return sys; + } + + throw CommonDataModelException("No Acceptable DataRequest Conversion Found"); + } +} // namespace io +} // namespace biogears \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/io/cdm/DataRequests.h b/projects/biogears/libBiogears/src/io/cdm/DataRequests.h new file mode 100644 index 000000000..50c03bc26 --- /dev/null +++ b/projects/biogears/libBiogears/src/io/cdm/DataRequests.h @@ -0,0 +1,161 @@ +/************************************************************************************** +Copyright 2019 Applied Research Associates, Inc. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the License +at: +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +DATA_REQUESTS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +**************************************************************************************/ + +#pragma once +#include +#include + +#include +#include +#include + +#include "DataRequests.h" + +#include +#include +#include +// Question: To Serialize Invalid units or not to Serialize? +// TO Throw an exception when a member is invalid? +#define CDM_DATA_REQUESTS_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func && in.m_##func->IsValid()) { \ + out.func(std::make_unique::type>()); \ + io::DataRequests::Marshall(*in.m_##func, out.func()); \ + } /* else if (in.m_##func) { \ + throw biogears::CommonDataModelException("func is InValid and cannot be Unmarshalled"); \ + }*/ + +#define CDM_OPTIONAL_DATA_REQUESTS_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func && in.m_##func->IsValid()) { \ + io::DataRequests::Marshall(*in.m_##func, out.func()); \ + } /*else if (in.m_##func) { \ + throw biogears::CommonDataModelException("func is InValid and cannot be Unmarshalled"); \ + }*/ + +#define SE_DATA_REQUESTS_ENUM_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.Has##func()) { \ + out.func(std::make_unique::type>()); \ + io::DataRequests::Marshall(in.m_##func, out.func()); \ + } + +#define SE_OPTIONAL_DATA_REQUESTS_ENUM_PTR_MARSHALL_HELPER(in, out, func) \ + io::DataRequests::Marshall(in.m_##func, out.func()); + +namespace biogears { + +class SEDecimalFormat; + +class SEDataRequest; +class SEPatientDataRequest; +class SEPhysiologyDataRequest; +class SEEnvironmentDataRequest; +class SEEquipmentDataRequest; +class SECompartmentDataRequest; +class SECompartmentSubstanceDataRequest; +class SEGasCompartmentDataRequest; +class SELiquidCompartmentDataRequest; +class SEThermalCompartmentDataRequest; +class SETissueCompartmentDataRequest; +class SESubstanceDataRequest; +class SEDataRequestManager; +class SESubstanceManager; + +namespace io { + class BIOGEARS_PRIVATE_API DataRequests { + public: + // class Factories; + static std::vector> data_request_factory(const CDM::DataRequestManagerData& in, SESubstanceManager const& substances, const SEDecimalFormat* df = nullptr); + static std::unique_ptr factory(CDM::DataRequestData const* actionData, SESubstanceManager const& substances, const SEDecimalFormat* df = nullptr); + static std::unique_ptr factory(SEDataRequest const* data); + + // template option + template ::value>* = nullptr> + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); + template ::value>* = nullptr> + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out, std::default_random_engine* rd = nullptr); + template + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); + + // class SEDataRequestManager + static void UnMarshall(const CDM::DataRequestManagerData& in, const SESubstanceManager& subMgr, SEDataRequestManager& out, std::default_random_engine* re = nullptr); + static void Marshall(const SEDataRequestManager& in, CDM::DataRequestManagerData& out); + + // class SEDataRequest; + static void UnMarshall(const CDM::DataRequestData& in, SEDataRequest& out, std::default_random_engine* re = nullptr); + static void Marshall(const SEDataRequest& in, CDM::DataRequestData& out); + + // class SEPatientDataRequest; + static void UnMarshall(const CDM::PatientDataRequestData& in, SEPatientDataRequest& out, std::default_random_engine* re = nullptr); + static void Marshall(const SEPatientDataRequest& in, CDM::PatientDataRequestData& out); + // class SEPhysiologyDataRequest; + static void UnMarshall(const CDM::PhysiologyDataRequestData& in, SEPhysiologyDataRequest& out, std::default_random_engine* re = nullptr); + static void Marshall(const SEPhysiologyDataRequest& in, CDM::PhysiologyDataRequestData& out); + // class SEEnvironmentDataRequest; + static void UnMarshall(const CDM::EnvironmentDataRequestData& in, SEEnvironmentDataRequest& out, std::default_random_engine* re = nullptr); + static void Marshall(const SEEnvironmentDataRequest& in, CDM::EnvironmentDataRequestData& out); + // class SEEquipmentDataRequest; + static void UnMarshall(const CDM::EquipmentDataRequestData& in, SEEquipmentDataRequest& out, std::default_random_engine* re = nullptr); + static void Marshall(const SEEquipmentDataRequest& in, CDM::EquipmentDataRequestData& out); + // class SECompartmentDataRequest; + static void UnMarshall(const CDM::CompartmentDataRequestData& in, SECompartmentDataRequest& out, std::default_random_engine* re = nullptr); + static void Marshall(const SECompartmentDataRequest& in, CDM::CompartmentDataRequestData& out); + // class SECompartmentSubstanceDataRequest; + static void UnMarshall(const CDM::CompartmentSubstanceDataRequestData& in, SESubstanceManager const& substances, SECompartmentSubstanceDataRequest& out, std::default_random_engine* re = nullptr); + static void Marshall(const SECompartmentSubstanceDataRequest& in, CDM::CompartmentSubstanceDataRequestData& out); + // class SEGasCompartmentDataRequest; + static void UnMarshall(const CDM::GasCompartmentDataRequestData& in, SESubstanceManager const& substances, SEGasCompartmentDataRequest& out, std::default_random_engine* re = nullptr); + static void Marshall(const SEGasCompartmentDataRequest& in, CDM::GasCompartmentDataRequestData& out); + // class SELiquidCompartmentDataRequest; + static void UnMarshall(const CDM::LiquidCompartmentDataRequestData& in, SESubstanceManager const& substances, SELiquidCompartmentDataRequest& out, std::default_random_engine* re = nullptr); + static void Marshall(const SELiquidCompartmentDataRequest& in, CDM::LiquidCompartmentDataRequestData& out); + // class SEThermalCompartmentDataRequest; + static void UnMarshall(const CDM::ThermalCompartmentDataRequestData& in, SEThermalCompartmentDataRequest& out, std::default_random_engine* re = nullptr); + static void Marshall(const SEThermalCompartmentDataRequest& in, CDM::ThermalCompartmentDataRequestData& out); + // class SETissueCompartmentDataRequest; + static void UnMarshall(const CDM::TissueCompartmentDataRequestData& in, SETissueCompartmentDataRequest& out, std::default_random_engine* re = nullptr); + static void Marshall(const SETissueCompartmentDataRequest& in, CDM::TissueCompartmentDataRequestData& out); + // class SESubstanceDataRequest; + static void UnMarshall(const CDM::SubstanceDataRequestData& in, SESubstanceManager const& substances, SESubstanceDataRequest& out, std::default_random_engine* re = nullptr); + static void Marshall(const SESubstanceDataRequest& in, CDM::SubstanceDataRequestData& out); + + }; + + //---------------------------------------------------------------------------------- + + template ::value>*> + void DataRequests::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) + { + if (!option_in.present() || option_in->empty()) { + out = SE::Invalid; + } else { + UnMarshall(option_in.get(), out); + } + } + + template ::value>*> + void DataRequests::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out, std::default_random_engine* rd) + { + if (!option_in.present()) { + out.Invalidate(); + } else { + io::DataRequests::UnMarshall(option_in.get(), out, rd); + } + } + + template + void DataRequests::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) + { + auto item = std::make_unique(); + io::DataRequests::Marshall(in, *item); + option_out.set(std::move(item)); + } +} // namespace io +} // namespace biogears diff --git a/projects/biogears/libBiogears/src/io/cdm/ElectroCardioGram.cpp b/projects/biogears/libBiogears/src/io/cdm/ElectroCardioGram.cpp index 899b568de..557e222c6 100644 --- a/projects/biogears/libBiogears/src/io/cdm/ElectroCardioGram.cpp +++ b/projects/biogears/libBiogears/src/io/cdm/ElectroCardioGram.cpp @@ -1,5 +1,6 @@ #include "ElectroCardioGram.h" +#include "Physiology.h" #include "Property.h" #include @@ -11,111 +12,112 @@ namespace biogears { namespace io { // class SEElectroCardioGram - void ElectroCardioGram::Marshall(const CDM::ElectroCardioGramData& in, SEElectroCardioGram& out) + void ElectroCardioGram::UnMarshall(const CDM::ElectroCardioGramData& in, SEElectroCardioGram& out) { - io::Property::Marshall(in.Lead1ElectricPotential(), out.GetLead1ElectricPotential()); - io::Property::Marshall(in.Lead2ElectricPotential(), out.GetLead2ElectricPotential()); - io::Property::Marshall(in.Lead3ElectricPotential(), out.GetLead3ElectricPotential()); - io::Property::Marshall(in.Lead4ElectricPotential(), out.GetLead4ElectricPotential()); - io::Property::Marshall(in.Lead5ElectricPotential(), out.GetLead5ElectricPotential()); - io::Property::Marshall(in.Lead6ElectricPotential(), out.GetLead6ElectricPotential()); - io::Property::Marshall(in.Lead7ElectricPotential(), out.GetLead7ElectricPotential()); - io::Property::Marshall(in.Lead8ElectricPotential(), out.GetLead8ElectricPotential()); - io::Property::Marshall(in.Lead9ElectricPotential(), out.GetLead9ElectricPotential()); - io::Property::Marshall(in.Lead10ElectricPotential(), out.GetLead10ElectricPotential()); - io::Property::Marshall(in.Lead11ElectricPotential(), out.GetLead11ElectricPotential()); - io::Property::Marshall(in.Lead12ElectricPotential(), out.GetLead12ElectricPotential()); + io::Property::UnMarshall(in.Lead1ElectricPotential(), out.GetLead1ElectricPotential()); + io::Property::UnMarshall(in.Lead2ElectricPotential(), out.GetLead2ElectricPotential()); + io::Property::UnMarshall(in.Lead3ElectricPotential(), out.GetLead3ElectricPotential()); + io::Property::UnMarshall(in.Lead4ElectricPotential(), out.GetLead4ElectricPotential()); + io::Property::UnMarshall(in.Lead5ElectricPotential(), out.GetLead5ElectricPotential()); + io::Property::UnMarshall(in.Lead6ElectricPotential(), out.GetLead6ElectricPotential()); + io::Property::UnMarshall(in.Lead7ElectricPotential(), out.GetLead7ElectricPotential()); + io::Property::UnMarshall(in.Lead8ElectricPotential(), out.GetLead8ElectricPotential()); + io::Property::UnMarshall(in.Lead9ElectricPotential(), out.GetLead9ElectricPotential()); + io::Property::UnMarshall(in.Lead10ElectricPotential(), out.GetLead10ElectricPotential()); + io::Property::UnMarshall(in.Lead11ElectricPotential(), out.GetLead11ElectricPotential()); + io::Property::UnMarshall(in.Lead12ElectricPotential(), out.GetLead12ElectricPotential()); } - void ElectroCardioGram::UnMarshall(const SEElectroCardioGram& in, CDM::ElectroCardioGramData& out) + void ElectroCardioGram::Marshall(const SEElectroCardioGram& in, CDM::ElectroCardioGramData& out) { - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Lead1ElectricPotential) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Lead2ElectricPotential) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Lead3ElectricPotential) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Lead4ElectricPotential) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Lead5ElectricPotential) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Lead6ElectricPotential) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Lead7ElectricPotential) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Lead8ElectricPotential) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Lead9ElectricPotential) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Lead10ElectricPotential) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Lead11ElectricPotential) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Lead12ElectricPotential) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Lead1ElectricPotential) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Lead2ElectricPotential) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Lead3ElectricPotential) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Lead4ElectricPotential) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Lead5ElectricPotential) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Lead6ElectricPotential) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Lead7ElectricPotential) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Lead8ElectricPotential) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Lead9ElectricPotential) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Lead10ElectricPotential) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Lead11ElectricPotential) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Lead12ElectricPotential) } // class SEElectroCardioGram - void ElectroCardioGram::Marshall(const CDM::ElectroCardioGramWaveformLeadNumberData& in, SEElectroCardioGramWaveformLeadNumber& out) + void ElectroCardioGram::UnMarshall(const CDM::ElectroCardioGramWaveformLeadNumberData& in, SEElectroCardioGramWaveformLeadNumber& out) { out.m_value = static_cast(in); } - void ElectroCardioGram::UnMarshall(const SEElectroCardioGramWaveformLeadNumber& in, CDM::ElectroCardioGramWaveformLeadNumberData& out) + void ElectroCardioGram::Marshall(const SEElectroCardioGramWaveformLeadNumber& in, CDM::ElectroCardioGramWaveformLeadNumberData& out) { out = in.m_value; } //---------------------------------------------------------------------------------- // class SEElectroCardioGramInterpolationWaveform - void ElectroCardioGram::Marshall(const CDM::ElectroCardioGramInterpolationWaveformData& in, SEElectroCardioGramInterpolationWaveform& out) + void ElectroCardioGram::UnMarshall(const CDM::ElectroCardioGramInterpolationWaveformData& in, SEElectroCardioGramInterpolationWaveform& out) { - out.Clear(); - out.m_Rhythm = in.Rhythm(); - out.m_LeadNumber = in.Lead(); - io::Property::Marshall(in.Data(), out.GetData()); + out.Invalidate(); + io::Physiology::UnMarshall(in.Rhythm(), out.m_Rhythm); + + out.m_LeadNumber = SEElectroCardioGramWaveformLeadNumber(in.Lead()); + io::Property::UnMarshall(in.Data(), out.GetData()); if (in.TimeStep().present()) - io::Property::Marshall(in.TimeStep(), out.GetTimeStep()); + io::Property::UnMarshall(in.TimeStep(), out.GetTimeStep()); if (in.ActiveIndicies().present()) { for (size_t i = 0; i < in.ActiveIndicies().get().IntegerList().size(); i++) out.m_ActiveIndicies.push_back(in.ActiveIndicies().get().IntegerList()[i]); } } - void ElectroCardioGram::UnMarshall(const SEElectroCardioGramInterpolationWaveform& in, CDM::ElectroCardioGramInterpolationWaveformData& out) + void ElectroCardioGram::Marshall(const SEElectroCardioGramInterpolationWaveform& in, CDM::ElectroCardioGramInterpolationWaveformData& out) { out.Rhythm(""); - CDM_ENUM_UNMARSHAL_HELPER(in, out, Rhythm); + SE_PHYSIOLOGY_ENUM_PTR_MARSHALL_HELPER(in, out, Rhythm); out.Lead(std::make_unique()); if (in.HasLeadNumber()) - out.Lead(in.m_LeadNumber); + out.Lead(in.m_LeadNumber.m_value); out.Data(std::make_unique()); if (in.HasData()) { - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Data) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Data) out.ActiveIndicies(std::unique_ptr(new CDM::IntegerArray())); out.ActiveIndicies().get().IntegerList(std::unique_ptr(new CDM::IntegerList())); for (int i : in.m_ActiveIndicies) out.ActiveIndicies().get().IntegerList().push_back(i); } - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, TimeStep) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TimeStep) } //---------------------------------------------------------------------------------- // class SEElectroCardioGramInterpolator - void ElectroCardioGram::Marshall(const CDM::ElectroCardioGramInterpolatorData& in, SEElectroCardioGramInterpolator& out) + void ElectroCardioGram::UnMarshall(const CDM::ElectroCardioGramInterpolatorData& in, SEElectroCardioGramInterpolator& out) { - out.Clear(); + out.Invalidate(); for (auto w : in.Waveform()) { SEElectroCardioGramInterpolationWaveform* waveform = new SEElectroCardioGramInterpolationWaveform(out.GetLogger()); - Marshall(w, *waveform); + UnMarshall(w, *waveform); out.m_Waveforms[waveform->GetLeadNumber()][waveform->GetRhythm()] = waveform; } for (auto lead : in.Leads()) { auto potential = std::make_unique(); - io::Property::Marshall(lead.ExlectricalPotential(), *potential); - out.m_Leads[lead.Lead()] = potential.release(); + io::Property::UnMarshall(lead.ExlectricalPotential(), *potential); + out.m_Leads[static_cast(lead.Lead())] = potential.release(); } } - void ElectroCardioGram::UnMarshall(const SEElectroCardioGramInterpolator& in, CDM::ElectroCardioGramInterpolatorData& out) + void ElectroCardioGram::Marshall(const SEElectroCardioGramInterpolator& in, CDM::ElectroCardioGramInterpolatorData& out) { for (auto i : in.m_Waveforms) { for (auto j : i.second) { auto ecgiwfData = CDM::ElectroCardioGramInterpolationWaveformData(); - UnMarshall(*j.second, ecgiwfData); + Marshall(*j.second, ecgiwfData); out.Waveform().push_back(ecgiwfData); } } for (auto lead : in.m_Leads) { auto potential = CDM::ElectroCardioGramLeadPotentialData(); - potential.Lead(lead.first); + potential.Lead(lead.first.m_value); auto ecp = CDM::ScalarElectricPotentialData(); - io::Property::UnMarshall(*lead.second, ecp); + io::Property::Marshall(*lead.second, ecp); potential.ExlectricalPotential(ecp); out.Leads().push_back(potential); } diff --git a/projects/biogears/libBiogears/src/io/cdm/ElectroCardioGram.h b/projects/biogears/libBiogears/src/io/cdm/ElectroCardioGram.h index 336895cc7..dbb6aab5d 100644 --- a/projects/biogears/libBiogears/src/io/cdm/ElectroCardioGram.h +++ b/projects/biogears/libBiogears/src/io/cdm/ElectroCardioGram.h @@ -13,22 +13,28 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include "biogears/cdm/CommonDataModel.h" +#include #include #include -#define CDM_ELECTRO_CARDIOGRAM_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_ELECTRO_CARDIOGRAM_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ out.func(std::make_unique::type>()); \ - io::ElectroCardioGram::UnMarshall(*in.m_##func, out.func()); \ + io::ElectroCardioGram::Marshall(*in.m_##func, out.func()); \ } -#define CDM_OPTIONAL_ELECTRO_CARDIOGRAM_UNMARSHAL_HELPER(in, out, func) \ - if (in.m_##func) { \ - io::ElectroCardioGram::UnMarshall(*in.m_##func, out.func()); \ +#define CDM_OPTIONAL_ELECTRO_CARDIOGRAM_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func) { \ + io::ElectroCardioGram::Marshall(*in.m_##func, out.func()); \ } +#define CDM_ELECTRO_CARDIOGRAM_COPY(type, in, out) \ + { \ + CDM::type##Data middle; \ + io::ElectroCardioGram::Marshall(in, middle); \ + io::ElectroCardioGram::UnMarshall(middle, out); \ + } namespace biogears { class SEElectroCardioGram; @@ -41,38 +47,38 @@ namespace io { public: // template option template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); // class SEElectroCardioGram - static void Marshall(const CDM::ElectroCardioGramData& in, SEElectroCardioGram& out); - static void UnMarshall(const SEElectroCardioGram& in, CDM::ElectroCardioGramData& out); + static void UnMarshall(const CDM::ElectroCardioGramData& in, SEElectroCardioGram& out); + static void Marshall(const SEElectroCardioGram& in, CDM::ElectroCardioGramData& out); // class SEElectroCardioGram - static void Marshall(const CDM::ElectroCardioGramWaveformLeadNumberData& in, SEElectroCardioGramWaveformLeadNumber& out); - static void UnMarshall(const SEElectroCardioGramWaveformLeadNumber& in, CDM::ElectroCardioGramWaveformLeadNumberData& out); + static void UnMarshall(const CDM::ElectroCardioGramWaveformLeadNumberData& in, SEElectroCardioGramWaveformLeadNumber& out); + static void Marshall(const SEElectroCardioGramWaveformLeadNumber& in, CDM::ElectroCardioGramWaveformLeadNumberData& out); // class SEElectroCardioGramInterpolationWaveform - static void Marshall(const CDM::ElectroCardioGramInterpolationWaveformData& in, SEElectroCardioGramInterpolationWaveform& out); - static void UnMarshall(const SEElectroCardioGramInterpolationWaveform& in, CDM::ElectroCardioGramInterpolationWaveformData& out); + static void UnMarshall(const CDM::ElectroCardioGramInterpolationWaveformData& in, SEElectroCardioGramInterpolationWaveform& out); + static void Marshall(const SEElectroCardioGramInterpolationWaveform& in, CDM::ElectroCardioGramInterpolationWaveformData& out); // class SEElectroCardioGramWaveformInterpolator - static void Marshall(const CDM::ElectroCardioGramInterpolatorData& in, SEElectroCardioGramInterpolator& out); - static void UnMarshall(const SEElectroCardioGramInterpolator& in, CDM::ElectroCardioGramInterpolatorData& out); + static void UnMarshall(const CDM::ElectroCardioGramInterpolatorData& in, SEElectroCardioGramInterpolator& out); + static void Marshall(const SEElectroCardioGramInterpolator& in, CDM::ElectroCardioGramInterpolatorData& out); }; //---------------------------------------------------------------------------------- template - void ElectroCardioGram::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + void ElectroCardioGram::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) { if (!option_in.present()) { out.Invalidate(); } else { - Marshall(option_in.get(), out); + UnMarshall(option_in.get(), out); } } //---------------------------------------------------------------------------------- template - void ElectroCardioGram::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void ElectroCardioGram::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); + Marshall(in, *item); option_out.set(*item); } } // Namespace IO diff --git a/projects/biogears/libBiogears/src/io/cdm/EngineConfiguration.cpp b/projects/biogears/libBiogears/src/io/cdm/EngineConfiguration.cpp index 85d874b6b..c027437d9 100644 --- a/projects/biogears/libBiogears/src/io/cdm/EngineConfiguration.cpp +++ b/projects/biogears/libBiogears/src/io/cdm/EngineConfiguration.cpp @@ -1,5 +1,6 @@ #include "EngineConfiguration.h" +#include "ElectroCardioGram.h" #include "Property.h" #include @@ -18,24 +19,26 @@ #endif namespace biogears { namespace io { - //class PhysiologyEngineConfiguration - void EngineConfiguration::Marshall(const CDM::PhysiologyEngineConfigurationData& in, PhysiologyEngineConfiguration& out) + // class PhysiologyEngineConfiguration + void EngineConfiguration::UnMarshall(const CDM::PhysiologyEngineConfigurationData& in, PhysiologyEngineConfiguration& out) { if (!out.m_Merge) - out.Clear(); // Reset only if we are not merging + out.Invalidate(); // Reset only if we are not merging if (in.TimeStep().present()) + io::Property::UnMarshall(in.TimeStep(), out.GetTimeStep()); - io::Property::Marshall(in.TimeStep(), out.GetTimeStep()); - if (in.WritePatientBaselineFile().present()) - out.SetWritePatientBaselineFile(in.WritePatientBaselineFile().get()); + io::Property::UnMarshall(in.WritePatientBaselineFile(), out.m_WritePatientBaselineFile); if (in.ElectroCardioGramInterpolatorFile().present()) { if (!out.GetECGInterpolator().LoadWaveforms(in.ElectroCardioGramInterpolatorFile().get())) { throw CommonDataModelException("Unable to load ElectroCardioGram Waveforms file"); } } else if (in.ElectroCardioGramInterpolator().present()) { - if (!out.GetECGInterpolator().Load(in.ElectroCardioGramInterpolator().get())) { + try { + io::ElectroCardioGram::UnMarshall(in.ElectroCardioGramInterpolator(), out.GetECGInterpolator()); + + } catch (CommonDataModelException ex) { throw CommonDataModelException("Unable to load ElectroCardioGram Waveforms"); } } @@ -67,133 +70,172 @@ namespace io { dData = dynamic_cast(&in.StabilizationCriteria().get()); } if (tData != nullptr) { - if (!out.GetTimedStabilizationCriteria().Load(*tData)) { + try { + UnMarshall(*tData, out.GetTimedStabilizationCriteria()); + } catch (CommonDataModelException ex) { throw CommonDataModelException("Unable to load Stabilization Criteria"); } } else if (dData != nullptr) { - if (!out.GetDynamicStabilizationCriteria().Load(*dData)) { + try { + UnMarshall(*dData, out.GetDynamicStabilizationCriteria()); + } catch (CommonDataModelException ex) { throw CommonDataModelException("Unable to load Stabilization Criteria"); } } } //---------------------------------------------------------------------------------- - void EngineConfiguration::UnMarshall(const PhysiologyEngineConfiguration& in, CDM::PhysiologyEngineConfigurationData& out) + void EngineConfiguration::Marshall(const PhysiologyEngineConfiguration& in, CDM::PhysiologyEngineConfigurationData& out) { - if (in.HasECGInterpolator()) - out.ElectroCardioGramInterpolator(std::unique_ptr(in.m_ECGInterpolator->Unload())); - if (in.HasStabilizationCriteria()) - out.StabilizationCriteria(std::unique_ptr(in.m_StabilizationCriteria->Unload())); - if (in.HasTimeStep()) - io::Property::UnMarshall(*in.m_TimeStep, out.TimeStep()); - if (in.HasWritePatientBaselineFile()) - out.WritePatientBaselineFile(in.m_WritePatientBaselineFile); + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TimeStep) + SE_OPTIONAL_PROPERTY_ENUM_PTR_MARSHALL_HELPER(in, out, WritePatientBaselineFile) + + if (in.m_ECGInterpolator) { + io::ElectroCardioGram::Marshall(*in.m_ECGInterpolator, out.ElectroCardioGramInterpolator()); + } + + if (in.HasDynamicStabilizationCriteria()) { + auto dsc = std::make_unique(); + io::EngineConfiguration::Marshall(*in.GetDynamicStabilizationCriteria(), *dsc); + out.StabilizationCriteria(std::move(dsc)); + } + if (in.HasTimedStabilizationCriteria()) { + auto tsc = std::make_unique(); + io::EngineConfiguration::Marshall(*in.GetTimedStabilizationCriteria(), *tsc); + out.StabilizationCriteria(std::move(tsc)); + } } //---------------------------------------------------------------------------------- - //class PhysiologyEngineStabilization - void EngineConfiguration::Marshall(const CDM::PhysiologyEngineStabilizationData& in, PhysiologyEngineStabilization& out) + // class PhysiologyEngineStabilization + void EngineConfiguration::UnMarshall(const CDM::PhysiologyEngineStabilizationData& in, PhysiologyEngineStabilization& out) { - out.Clear(); + out.Invalidate(); + + if (in.Canceled().present()) + out.m_Canceled = in.Canceled().get(); + if (in.CurrentTime().present()) + io::Property::UnMarshall(in.CurrentTime(), out.GetCurrentTime()); + if (in.StabilizationDuration().present()) + io::Property::UnMarshall(in.StabilizationDuration(), out.GetStabilizationDuration()); + if (in.LogProgress().present()) + out.m_LogProgress = in.LogProgress().get(); } //---------------------------------------------------------------------------------- - void EngineConfiguration::UnMarshall(const PhysiologyEngineStabilization& in, CDM::PhysiologyEngineStabilizationData& out) + void EngineConfiguration::Marshall(const PhysiologyEngineStabilization& in, CDM::PhysiologyEngineStabilizationData& out) { + out.Canceled(in.m_Canceled); + out.LogProgress(in.m_LogProgress); + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, CurrentTime) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, StabilizationDuration) } //---------------------------------------------------------------------------------- - //class PhysiologyEngineTimedStabilization - void EngineConfiguration::Marshall(const CDM::PhysiologyEngineTimedStabilizationData& in, PhysiologyEngineTimedStabilization& out) + // class PhysiologyEngineTimedStabilization + void EngineConfiguration::UnMarshall(const CDM::PhysiologyEngineTimedStabilizationData& in, PhysiologyEngineTimedStabilization& out) { - Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.RestingStabilizationTime(), out.GetRestingStabilizationTime()); + UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.RestingStabilizationTime(), out.GetRestingStabilizationTime()); if (in.FeedbackStabilizationTime().present()) { - io::Property::Marshall(in.FeedbackStabilizationTime(), out.GetFeedbackStabilizationTime()); + io::Property::UnMarshall(in.FeedbackStabilizationTime(), out.GetFeedbackStabilizationTime()); } for (auto cc : in.ConditionStabilization()) { auto* sc = new PhysiologyEngineTimedStabilizationCriteria(nullptr); - Marshall(cc, *sc); + UnMarshall(cc, *sc); out.m_ConditionCriteria.push_back(sc); } } //---------------------------------------------------------------------------------- - void EngineConfiguration::UnMarshall(const PhysiologyEngineTimedStabilization& in, CDM::PhysiologyEngineTimedStabilizationData& out) + void EngineConfiguration::Marshall(const PhysiologyEngineTimedStabilization& in, CDM::PhysiologyEngineTimedStabilizationData& out) { - UnMarshall(static_cast(in), static_cast(out)); - io::Property::UnMarshall(in.m_RestingStabilizationTime, out.RestingStabilizationTime()); + Marshall(static_cast(in), static_cast(out)); + if (in.m_RestingStabilizationTime.IsValid()) { + out.RestingStabilizationTime(std::make_unique::type>()); + io::Property::Marshall(in.m_RestingStabilizationTime, out.RestingStabilizationTime()); + } if (in.HasFeedbackStabilizationTime()) - io::Property::UnMarshall(*in.m_FeedbackStabilizationTime, out.FeedbackStabilizationTime()); + io::Property::Marshall(*in.m_FeedbackStabilizationTime, out.FeedbackStabilizationTime()); for (auto& cc : in.m_ConditionCriteria) { auto petcsData = CDM::PhysiologyEngineTimedConditionStabilizationData(); - UnMarshall(*cc, petcsData); + Marshall(*cc, petcsData); out.ConditionStabilization().push_back(petcsData); } } //---------------------------------------------------------------------------------- - //class PhysiologyEngineTimedConditionStabilization - void EngineConfiguration::Marshall(const CDM::PhysiologyEngineTimedConditionStabilizationData& in, PhysiologyEngineTimedStabilizationCriteria& out) + // class PhysiologyEngineTimedConditionStabilization + void EngineConfiguration::UnMarshall(const CDM::PhysiologyEngineTimedConditionStabilizationData& in, PhysiologyEngineTimedStabilizationCriteria& out) { - out.Clear(); + out.Invalidate(); out.SetName(in.Name()); - io::Property::Marshall(in.Time(), out.GetTime()); + io::Property::UnMarshall(in.Time(), out.GetTime()); } //---------------------------------------------------------------------------------- - void EngineConfiguration::UnMarshall(const PhysiologyEngineTimedStabilizationCriteria& in, CDM::PhysiologyEngineTimedConditionStabilizationData& out) + void EngineConfiguration::Marshall(const PhysiologyEngineTimedStabilizationCriteria& in, CDM::PhysiologyEngineTimedConditionStabilizationData& out) { out.Name(in.m_Name); - io::Property::UnMarshall(in.GetTime(), out.Time()); + io::Property::Marshall(in.GetTime(), out.Time()); } //---------------------------------------------------------------------------------- - //class PhysiologyEngineDynamicStabilization - void EngineConfiguration::Marshall(const CDM::PhysiologyEngineDynamicStabilizationData& in, PhysiologyEngineDynamicStabilization& out) + // class PhysiologyEngineDynamicStabilization + void EngineConfiguration::UnMarshall(const CDM::PhysiologyEngineDynamicStabilizationData& in, PhysiologyEngineDynamicStabilization& out) { - Marshall(static_cast(in), static_cast(out)); - Marshall(in.RestingStabilizationCriteria(), out.GetRestingCriteria()); + UnMarshall(static_cast(in), static_cast(out)); + UnMarshall(in.RestingStabilizationCriteria(), out.GetRestingCriteria()); if (in.FeedbackStabilizationCriteria().present()) - Marshall(in.FeedbackStabilizationCriteria(), out.GetFeedbackCriteria()); + UnMarshall(in.FeedbackStabilizationCriteria(), out.GetFeedbackCriteria()); for (auto cData : in.ConditionStabilization()) { PhysiologyEngineDynamicStabilizationCriteria* c = new PhysiologyEngineDynamicStabilizationCriteria(out.GetLogger()); - Marshall(cData.Criteria(), *c); + UnMarshall(cData.Criteria(), *c); c->SetName(cData.Name()); out.AddConditionCriteria(*c); } } //---------------------------------------------------------------------------------- - void EngineConfiguration::UnMarshall(const PhysiologyEngineDynamicStabilization& in, CDM::PhysiologyEngineDynamicStabilizationData& out) + void EngineConfiguration::Marshall(const PhysiologyEngineDynamicStabilization& in, CDM::PhysiologyEngineDynamicStabilizationData& out) { - UnMarshall(static_cast(in), static_cast(out)); - UnMarshall(in.GetRestingCriteria(), out.RestingStabilizationCriteria()); + Marshall(static_cast(in), static_cast(out)); + out.RestingStabilizationCriteria(std::make_unique()); + Marshall(in.GetRestingCriteria(), out.RestingStabilizationCriteria()); - if (in.HasFeedbackCriteria()) - UnMarshall(*in.m_FeedbackCriteria, out.FeedbackStabilizationCriteria()); + if (in.HasFeedbackCriteria()) { + out.FeedbackStabilizationCriteria(std::make_unique()); + Marshall(*in.m_FeedbackCriteria, out.FeedbackStabilizationCriteria()); + } for (auto& c : in.m_ConditionCriteria) { std::unique_ptr csData(new CDM::PhysiologyEngineDynamicConditionStabilizationData()); csData->Criteria(std::make_unique()); - UnMarshall(*c, csData->Criteria()); + Marshall(*c, csData->Criteria()); csData->Name(c->GetName()); out.ConditionStabilization().push_back(*csData); } } //---------------------------------------------------------------------------------- - //class PhysiologyEngineDynamicStabilizationCriteria - void EngineConfiguration::Marshall(const CDM::PhysiologyEngineDynamicStabilizationCriteriaData& in, PhysiologyEngineDynamicStabilizationCriteria& out) + // class PhysiologyEngineDynamicStabilizationCriteria + void EngineConfiguration::UnMarshall(const CDM::PhysiologyEngineDynamicStabilizationCriteriaData& in, PhysiologyEngineDynamicStabilizationCriteria& out) { - out.Clear(); - io::Property::Marshall(in.ConvergenceTime(), out.GetConvergenceTime()); - io::Property::Marshall(in.MinimumReactionTime(), out.GetMinimumReactionTime()); - io::Property::Marshall(in.MaximumAllowedStabilizationTime(), out.GetMaximumAllowedStabilizationTime()); - for (auto pcData : in.PropertyConvergence()) + out.Invalidate(); + io::Property::UnMarshall(in.ConvergenceTime(), out.GetConvergenceTime()); + io::Property::UnMarshall(in.MinimumReactionTime(), out.GetMinimumReactionTime()); + io::Property::UnMarshall(in.MaximumAllowedStabilizationTime(), out.GetMaximumAllowedStabilizationTime()); + for (auto pcData : in.PropertyConvergence()) { + // if (pcData.PercentDifference() != pcData.PercentDifference()) { out.CreateSystemPropertyConvergence(pcData.PercentDifference(), pcData.Name()); + //} + } } //---------------------------------------------------------------------------------- - void EngineConfiguration::UnMarshall(const PhysiologyEngineDynamicStabilizationCriteria& in, CDM::PhysiologyEngineDynamicStabilizationCriteriaData& out) + void EngineConfiguration::Marshall(const PhysiologyEngineDynamicStabilizationCriteria& in, CDM::PhysiologyEngineDynamicStabilizationCriteriaData& out) { - io::Property::UnMarshall(*in.m_ConvergenceTime, out.ConvergenceTime()); - io::Property::UnMarshall(*in.m_MinimumReactionTime, out.MinimumReactionTime()); - io::Property::UnMarshall(*in.m_MaximumAllowedStabilizationTime, out.MaximumAllowedStabilizationTime()); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, ConvergenceTime) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, MinimumReactionTime) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, MaximumAllowedStabilizationTime) for (auto pc : in.m_PropertyConvergence) { - std::unique_ptr pcData(new CDM::PhysiologyEngineDynamicStabilizationCriteriaPropertyData()); + auto pcData = std::make_unique(); + // if (pcData->PercentDifference() != pcData->PercentDifference()) { pcData->Name(pc->GetDataRequest().GetName()); pcData->PercentDifference(pc->m_Target); out.PropertyConvergence().push_back(*pcData.get()); + //} } } //---------------------------------------------------------------------------------- diff --git a/projects/biogears/libBiogears/src/io/cdm/EngineConfiguration.h b/projects/biogears/libBiogears/src/io/cdm/EngineConfiguration.h index 6a3da73ef..96efae265 100644 --- a/projects/biogears/libBiogears/src/io/cdm/EngineConfiguration.h +++ b/projects/biogears/libBiogears/src/io/cdm/EngineConfiguration.h @@ -13,22 +13,28 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include "biogears/cdm/CommonDataModel.h" +#include #include #include #include -#define CDM_BIOGEARS_CONFIGURATION_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_BIOGEARS_CONFIGURATION_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ out.func(std::make_unique::type>()); \ - io::EngineConfiguration::UnMarshall(*in.m_##func, out.func()); \ + io::EngineConfiguration::Marshall(*in.m_##func, out.func()); \ } -#define CDM_OPTIONAL_BIOGEARS_CONFIGURATION_UNMARSHAL_HELPER(in, out, func) \ - if (in.m_##func) { \ - io::EngineConfiguration::UnMarshall(*in.m_##func, out.func()); \ +#define CDM_OPTIONAL_BIOGEARS_CONFIGURATION_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func) { \ + io::EngineConfiguration::Marshall(*in.m_##func, out.func()); \ } +#define CDM_BIOGEARS_CONFIGURATION_COPY(type, in, out) \ + { \ + CDM::type##Data middle; \ + io::EngineConfiguration::Marshall(in, middle); \ + io::EngineConfiguration::UnMarshall(middle, out); \ + } namespace biogears { class PhysiologyEngineConfiguration; class PhysiologyEngineStabilization; @@ -41,47 +47,47 @@ class PhysiologyEngineTimedStabilizationCriteria; namespace io { class BIOGEARS_PRIVATE_API EngineConfiguration { public: - //template option + // template option template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); - //class PhysiologyEngineConfiguration - static void Marshall(const CDM::PhysiologyEngineConfigurationData& in, PhysiologyEngineConfiguration& out); - static void UnMarshall(const PhysiologyEngineConfiguration& in, CDM::PhysiologyEngineConfigurationData& out); - //class PhysiologyEngineStabilization - static void Marshall(const CDM::PhysiologyEngineStabilizationData& in, PhysiologyEngineStabilization& out); - static void UnMarshall(const PhysiologyEngineStabilization& in, CDM::PhysiologyEngineStabilizationData& out); - //class PhysiologyEngineTimedStabilization - static void Marshall(const CDM::PhysiologyEngineTimedStabilizationData& in, PhysiologyEngineTimedStabilization& out); - static void UnMarshall(const PhysiologyEngineTimedStabilization& in, CDM::PhysiologyEngineTimedStabilizationData& out); - //class PhysiologyEngineTimedConditionStabilization - static void Marshall(const CDM::PhysiologyEngineTimedConditionStabilizationData& in, PhysiologyEngineTimedStabilizationCriteria& out); - static void UnMarshall(const PhysiologyEngineTimedStabilizationCriteria& in, CDM::PhysiologyEngineTimedConditionStabilizationData& out); - //class PhysiologyEngineDynamicStabilization - static void Marshall(const CDM::PhysiologyEngineDynamicStabilizationData& in, PhysiologyEngineDynamicStabilization& out); - static void UnMarshall(const PhysiologyEngineDynamicStabilization& in, CDM::PhysiologyEngineDynamicStabilizationData& out); - //class PhysiologyEngineDynamicStabilizationCriteria - static void Marshall(const CDM::PhysiologyEngineDynamicStabilizationCriteriaData& in, PhysiologyEngineDynamicStabilizationCriteria& out); - static void UnMarshall(const PhysiologyEngineDynamicStabilizationCriteria& in, CDM::PhysiologyEngineDynamicStabilizationCriteriaData& out); + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); + // class PhysiologyEngineConfiguration + static void UnMarshall(const CDM::PhysiologyEngineConfigurationData& in, PhysiologyEngineConfiguration& out); + static void Marshall(const PhysiologyEngineConfiguration& in, CDM::PhysiologyEngineConfigurationData& out); + // class PhysiologyEngineStabilization + static void UnMarshall(const CDM::PhysiologyEngineStabilizationData& in, PhysiologyEngineStabilization& out); + static void Marshall(const PhysiologyEngineStabilization& in, CDM::PhysiologyEngineStabilizationData& out); + // class PhysiologyEngineTimedStabilization + static void UnMarshall(const CDM::PhysiologyEngineTimedStabilizationData& in, PhysiologyEngineTimedStabilization& out); + static void Marshall(const PhysiologyEngineTimedStabilization& in, CDM::PhysiologyEngineTimedStabilizationData& out); + // class PhysiologyEngineTimedConditionStabilization + static void UnMarshall(const CDM::PhysiologyEngineTimedConditionStabilizationData& in, PhysiologyEngineTimedStabilizationCriteria& out); + static void Marshall(const PhysiologyEngineTimedStabilizationCriteria& in, CDM::PhysiologyEngineTimedConditionStabilizationData& out); + // class PhysiologyEngineDynamicStabilization + static void UnMarshall(const CDM::PhysiologyEngineDynamicStabilizationData& in, PhysiologyEngineDynamicStabilization& out); + static void Marshall(const PhysiologyEngineDynamicStabilization& in, CDM::PhysiologyEngineDynamicStabilizationData& out); + // class PhysiologyEngineDynamicStabilizationCriteria + static void UnMarshall(const CDM::PhysiologyEngineDynamicStabilizationCriteriaData& in, PhysiologyEngineDynamicStabilizationCriteria& out); + static void Marshall(const PhysiologyEngineDynamicStabilizationCriteria& in, CDM::PhysiologyEngineDynamicStabilizationCriteriaData& out); }; //---------------------------------------------------------------------------------- template - void EngineConfiguration::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + void EngineConfiguration::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) { if (!option_in.present()) { - out.Clear(); + out.Invalidate(); } else { - Marshall(option_in.get(), out); + UnMarshall(option_in.get(), out); } } //---------------------------------------------------------------------------------- template - void EngineConfiguration::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void EngineConfiguration::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); + Marshall(in, *item); option_out.set(*item); } } // Namespace IO -} //Namespace Biogears +} // Namespace Biogears diff --git a/projects/biogears/libBiogears/src/io/cdm/EngineState.cpp b/projects/biogears/libBiogears/src/io/cdm/EngineState.cpp index 3cda2e446..d9ec41086 100644 --- a/projects/biogears/libBiogears/src/io/cdm/EngineState.cpp +++ b/projects/biogears/libBiogears/src/io/cdm/EngineState.cpp @@ -7,12 +7,12 @@ namespace biogears { namespace io { - void EngineState::Marshall(const CDM::PhysiologyEngineStateData& in, PhysiologyEngine& out) + void EngineState::UnMarshall(const CDM::PhysiologyEngineStateData& in, PhysiologyEngine& out) { return; } //---------------------------------------------------------------------------------- - void EngineState::UnMarshall(const PhysiologyEngine& in, CDM::PhysiologyEngineStateData& out) + void EngineState::Marshall(const PhysiologyEngine& in, CDM::PhysiologyEngineStateData& out) { return; } diff --git a/projects/biogears/libBiogears/src/io/cdm/EngineState.h b/projects/biogears/libBiogears/src/io/cdm/EngineState.h index 7ff72821a..4c2724f0b 100644 --- a/projects/biogears/libBiogears/src/io/cdm/EngineState.h +++ b/projects/biogears/libBiogears/src/io/cdm/EngineState.h @@ -18,15 +18,15 @@ specific language governing permissions and limitations under the License. #include -#define CDM_ENGINE_STATE_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_ENGINE_STATE_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ out.func(std::make_unique::type>()); \ - io::EngineState::UnMarshall(*in.m_##func, out.func()); \ + io::EngineState::Marshall(*in.m_##func, out.func()); \ } -#define CDM_OPTIONAL_ENGINE_STATE_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_OPTIONAL_ENGINE_STATE_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ - io::EngineState::UnMarshall(*in.m_##func, out.func()); \ + io::EngineState::Marshall(*in.m_##func, out.func()); \ } namespace biogears { @@ -37,29 +37,29 @@ namespace io { public: //template option template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); //class SEPhysiologyEngineState - static void Marshall(const CDM::PhysiologyEngineStateData& in, PhysiologyEngine& out); - static void UnMarshall(const PhysiologyEngine& in, CDM::PhysiologyEngineStateData& out); + static void UnMarshall(const CDM::PhysiologyEngineStateData& in, PhysiologyEngine& out); + static void Marshall(const PhysiologyEngine& in, CDM::PhysiologyEngineStateData& out); }; //---------------------------------------------------------------------------------- template - void EngineState::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + void EngineState::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) { if (!option_in.present()) { - out.Invalidate(); + out.MakeInvalid(); } else { - Marshall(option_in.get(), out); + UnMarshall(option_in.get(), out); } } //---------------------------------------------------------------------------------- template - void EngineState::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void EngineState::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); + Marshall(in, *item); option_out.set(*item); } } // Namespace IO diff --git a/projects/biogears/libBiogears/src/io/cdm/Environment.cpp b/projects/biogears/libBiogears/src/io/cdm/Environment.cpp index a9b4c8e26..b0a53886d 100644 --- a/projects/biogears/libBiogears/src/io/cdm/Environment.cpp +++ b/projects/biogears/libBiogears/src/io/cdm/Environment.cpp @@ -31,24 +31,28 @@ namespace biogears { namespace io { // class SEEnvironmentalConditions - void Environment::Marshall(const CDM::EnvironmentalConditionsData& in, SEEnvironmentalConditions& out) + void Environment::UnMarshall(const CDM::EnvironmentalConditionsData& in, SEEnvironmentalConditions& out) { - out.Clear(); + out.Invalidate(); if (in.Name().present()) { out.SetName(in.Name().get()); } - if (in.SurroundingType().present()) { - out.SetSurroundingType(in.SurroundingType().get()); + + if (!in.SurroundingType().present() || in.SurroundingType()->empty()) { + out.m_SurroundingType = SESurroundingType::Air; + } else { + io::Environment::UnMarshall(in.SurroundingType().get(), out.m_SurroundingType); } - io::Property::Marshall(in.AirDensity(), out.GetAirDensity()); - io::Property::Marshall(in.AirVelocity(), out.GetAirVelocity()); - io::Property::Marshall(in.AmbientTemperature(), out.GetAmbientTemperature()); - io::Property::Marshall(in.AtmosphericPressure(), out.GetAtmosphericPressure()); - io::Property::Marshall(in.ClothingResistance(), out.GetClothingResistance()); - io::Property::Marshall(in.Emissivity(), out.GetEmissivity()); - io::Property::Marshall(in.MeanRadiantTemperature(), out.GetMeanRadiantTemperature()); - io::Property::Marshall(in.RelativeHumidity(), out.GetRelativeHumidity()); - io::Property::Marshall(in.RespirationAmbientTemperature(), out.GetRespirationAmbientTemperature()); + + io::Property::UnMarshall(in.AirDensity(), out.GetAirDensity()); + io::Property::UnMarshall(in.AirVelocity(), out.GetAirVelocity()); + io::Property::UnMarshall(in.AmbientTemperature(), out.GetAmbientTemperature()); + io::Property::UnMarshall(in.AtmosphericPressure(), out.GetAtmosphericPressure()); + io::Property::UnMarshall(in.ClothingResistance(), out.GetClothingResistance()); + io::Property::UnMarshall(in.Emissivity(), out.GetEmissivity()); + io::Property::UnMarshall(in.MeanRadiantTemperature(), out.GetMeanRadiantTemperature()); + io::Property::UnMarshall(in.RelativeHumidity(), out.GetRelativeHumidity()); + io::Property::UnMarshall(in.RespirationAmbientTemperature(), out.GetRespirationAmbientTemperature()); SESubstance* sub; for (const CDM::SubstanceFractionData& sfData : in.AmbientGas()) { @@ -56,11 +60,11 @@ namespace io { if (sub == nullptr) { throw CommonDataModelException("Substance not found : " + sfData.Name()); } - if (sub->GetState() != CDM::enumSubstanceState::Gas) { + if (sub->GetState() != SESubstanceState::Gas) { throw CommonDataModelException("Substance not gas : " + sfData.Name()); } SESubstanceFraction* sf = new SESubstanceFraction(*sub); - io::Substance::Marshall(sfData, *sf); + io::Substance::UnMarshall(sfData, *sf); out.m_AmbientGases.push_back(sf); out.m_cAmbientGases.push_back(sf); } @@ -70,99 +74,103 @@ namespace io { if (sub == nullptr) { throw CommonDataModelException("Substance not found : " + scData.Name()); } - if (sub->GetState() != CDM::enumSubstanceState::Solid && sub->GetState() != CDM::enumSubstanceState::Liquid) { + if (sub->GetState() != SESubstanceState::Solid && sub->GetState() != SESubstanceState::Liquid) { throw CommonDataModelException("Substance not a liquid or solid : " + scData.Name()); } - SESubstanceConcentration* sc = new SESubstanceConcentration(*sub); - io::Substance::Marshall(scData, *sc); + SESubstanceConcentration* sc = new SESubstanceConcentration(sub->GetDefinition()); + io::Substance::UnMarshall(scData, *sc); out.m_AmbientAerosols.push_back(sc); out.m_cAmbientAerosols.push_back(sc); } } - void Environment::UnMarshall(const SEEnvironmentalConditions& in, CDM::EnvironmentalConditionsData& out) + void Environment::Marshall(const SEEnvironmentalConditions& in, CDM::EnvironmentalConditionsData& out) { if (in.HasName()) { out.Name(in.m_Name); } else { out.Name("Local Environment Conditions"); } - if (in.HasSurroundingType()) { - out.SurroundingType(in.m_SurroundingType); - } - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, AirDensity); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, AirVelocity); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, AmbientTemperature); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, AtmosphericPressure); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ClothingResistance); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Emissivity) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MeanRadiantTemperature) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RelativeHumidity) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RespirationAmbientTemperature) + + auto item = std::make_unique(); + io::Environment::Marshall(in.m_SurroundingType, *item); + out.SurroundingType(std::move(item)); + + if (in.m_AirDensity && in.m_AirDensity->IsValid()) { + io::Property::Marshall(*in.m_AirDensity, out.AirDensity()); + }; + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, AirVelocity); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, AmbientTemperature); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, AtmosphericPressure); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ClothingResistance); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Emissivity) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MeanRadiantTemperature) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RelativeHumidity) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RespirationAmbientTemperature) for (SESubstanceFraction* sf : in.m_AmbientGases) { auto sfData = std::make_unique(); - io::Substance::UnMarshall(*sf, *sfData); + io::Substance::Marshall(*sf, *sfData); out.AmbientGas().push_back(std::move(sfData)); } for (SESubstanceConcentration* sc : in.m_AmbientAerosols) { auto scData = std::make_unique(); - io::Substance::UnMarshall(*sc, *scData); + io::Substance::Marshall(*sc, *scData); out.AmbientAerosol().push_back(std::move(scData)); } } //---------------------------------------------------------------------------------- // class SEActiveHeating - void Environment::Marshall(const CDM::ActiveHeatingData& in, SEActiveHeating& out) + void Environment::UnMarshall(const CDM::ActiveHeatingData& in, SEActiveHeating& out, std::default_random_engine* rd) { - io::Property::Marshall(in.Power(), out.GetPower()); - io::Property::Marshall(in.SurfaceArea(), out.GetSurfaceArea()); - io::Property::Marshall(in.SurfaceAreaFraction(), out.GetSurfaceAreaFraction()); + io::Property::UnMarshall(in.Power(), out.GetPower(), rd); + io::Property::UnMarshall(in.SurfaceArea(), out.GetSurfaceArea(), rd); + io::Property::UnMarshall(in.SurfaceAreaFraction(), out.GetSurfaceAreaFraction(), rd); } - void Environment::UnMarshall(const SEActiveHeating& in, CDM::ActiveHeatingData& out) + void Environment::Marshall(const SEActiveHeating& in, CDM::ActiveHeatingData& out) { - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Power); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SurfaceArea) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SurfaceAreaFraction); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Power); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SurfaceArea) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SurfaceAreaFraction); } //---------------------------------------------------------------------------------- // class SEActiveCooling - void Environment::Marshall(const CDM::ActiveCoolingData& in, SEActiveCooling& out) + void Environment::UnMarshall(const CDM::ActiveCoolingData& in, SEActiveCooling& out, std::default_random_engine* rd) { - io::Property::Marshall(in.Power(), out.GetPower()); - io::Property::Marshall(in.SurfaceArea(), out.GetSurfaceArea()); - io::Property::Marshall(in.SurfaceAreaFraction(), out.GetSurfaceAreaFraction()); + io::Property::UnMarshall(in.Power(), out.GetPower(), rd); + io::Property::UnMarshall(in.SurfaceArea(), out.GetSurfaceArea(), rd); + io::Property::UnMarshall(in.SurfaceAreaFraction(), out.GetSurfaceAreaFraction(), rd); } - void Environment::UnMarshall(const SEActiveCooling& in, CDM::ActiveCoolingData& out) + void Environment::Marshall(const SEActiveCooling& in, CDM::ActiveCoolingData& out) { - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Power); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SurfaceArea); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SurfaceAreaFraction); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Power); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SurfaceArea); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SurfaceAreaFraction); } //---------------------------------------------------------------------------------- // class SEAppliedTemperature - void Environment::Marshall(const CDM::AppliedTemperatureData& in, SEAppliedTemperature& out) + void Environment::UnMarshall(const CDM::AppliedTemperatureData& in, SEAppliedTemperature& out) { - out.Clear(); + out.Invalidate(); if (in.State().present()) { - out.m_State = in.State().get(); + io::Property::UnMarshall(in.State().get(), out.m_State); } - io::Property::Marshall(in.Temperature(), out.GetTemperature()); - io::Property::Marshall(in.SurfaceArea(), out.GetSurfaceArea()); - io::Property::Marshall(in.SurfaceAreaFraction(), out.GetSurfaceAreaFraction()); + io::Property::UnMarshall(in.Temperature(), out.GetTemperature()); + io::Property::UnMarshall(in.SurfaceArea(), out.GetSurfaceArea()); + io::Property::UnMarshall(in.SurfaceAreaFraction(), out.GetSurfaceAreaFraction()); } - void Environment::UnMarshall(const SEAppliedTemperature& in, CDM::AppliedTemperatureData& out) + void Environment::Marshall(const SEAppliedTemperature& in, CDM::AppliedTemperatureData& out) { - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Temperature); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SurfaceArea); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SurfaceAreaFraction); - out.State(in.m_State); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Temperature); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SurfaceArea); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SurfaceAreaFraction); + io::Property::Marshall(in.m_State, out.State()); } //---------------------------------------------------------------------------------- // class SEEnvironment - void Environment::Marshall(const CDM::EnvironmentData& in, SEEnvironment& out) + void Environment::UnMarshall(const CDM::EnvironmentData& in, SEEnvironment& out) { - io::System::Marshall(static_cast(in), static_cast(out)); + io::System::UnMarshall(static_cast(in), static_cast(out)); if (in.Name().present()) { out.m_Name = in.Name().get(); @@ -170,22 +178,22 @@ namespace io { out.m_Name = "Local Environment"; } - Marshall(in.Conditions(), out.GetConditions()); - io::Property::Marshall(in.ConvectiveHeatLoss(), out.GetConvectiveHeatLoss()); - io::Property::Marshall(in.ConvectiveHeatTranferCoefficient(), out.GetConvectiveHeatTranferCoefficient()); - io::Property::Marshall(in.EvaporativeHeatLoss(), out.GetEvaporativeHeatLoss()); - io::Property::Marshall(in.EvaporativeHeatTranferCoefficient(), out.GetEvaporativeHeatTranferCoefficient()); - io::Property::Marshall(in.RadiativeHeatLoss(), out.GetRadiativeHeatLoss()); - io::Property::Marshall(in.RadiativeHeatTranferCoefficient(), out.GetRadiativeHeatTranferCoefficient()); - io::Property::Marshall(in.RespirationHeatLoss(), out.GetRespirationHeatLoss()); - io::Property::Marshall(in.SkinHeatLoss(), out.GetSkinHeatLoss()); + UnMarshall(in.Conditions(), out.GetConditions()); + io::Property::UnMarshall(in.ConvectiveHeatLoss(), out.GetConvectiveHeatLoss()); + io::Property::UnMarshall(in.ConvectiveHeatTranferCoefficient(), out.GetConvectiveHeatTranferCoefficient()); + io::Property::UnMarshall(in.EvaporativeHeatLoss(), out.GetEvaporativeHeatLoss()); + io::Property::UnMarshall(in.EvaporativeHeatTranferCoefficient(), out.GetEvaporativeHeatTranferCoefficient()); + io::Property::UnMarshall(in.RadiativeHeatLoss(), out.GetRadiativeHeatLoss()); + io::Property::UnMarshall(in.RadiativeHeatTranferCoefficient(), out.GetRadiativeHeatTranferCoefficient()); + io::Property::UnMarshall(in.RespirationHeatLoss(), out.GetRespirationHeatLoss()); + io::Property::UnMarshall(in.SkinHeatLoss(), out.GetSkinHeatLoss()); out.StateChange(); } - void Environment::UnMarshall(const SEEnvironment& in, CDM::EnvironmentData& out) + void Environment::Marshall(const SEEnvironment& in, CDM::EnvironmentData& out) { - io::System::UnMarshall(static_cast(in), static_cast(out)); + io::System::Marshall(static_cast(in), static_cast(out)); if (in.HasName()) { out.Name(in.m_Name); @@ -193,17 +201,64 @@ namespace io { out.Name("Unknown Environment"); } - CDM_OPTIONAL_ENVIRONMENT_UNMARSHAL_HELPER(in, out, Conditions); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ConvectiveHeatLoss); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ConvectiveHeatTranferCoefficient); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, EvaporativeHeatLoss); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, EvaporativeHeatTranferCoefficient); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RadiativeHeatLoss); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RadiativeHeatTranferCoefficient); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RespirationHeatLoss); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SkinHeatLoss); - + CDM_OPTIONAL_ENVIRONMENT_PTR_MARSHALL_HELPER(in, out, Conditions); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ConvectiveHeatLoss); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ConvectiveHeatTranferCoefficient); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, EvaporativeHeatLoss); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, EvaporativeHeatTranferCoefficient); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RadiativeHeatLoss); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RadiativeHeatTranferCoefficient); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RespirationHeatLoss); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SkinHeatLoss); + } + //----------------------------------------------------------------------------- + // class SESurroundingType; + void Environment::UnMarshall(const CDM::enumSurroundingType& in, SESurroundingType& out) + { + try { + switch (in) { + case CDM::enumSurroundingType::Air: + out = SESurroundingType::Air; + break; + case CDM::enumSurroundingType::Water: + out = SESurroundingType::Water; + break; + default: + out = SESurroundingType::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SESurroundingType::Invalid; + } + } + void Environment::Marshall(const SESurroundingType& in, CDM::enumSurroundingType& out) + { + switch (in) { + case SESurroundingType::Air: + out = CDM::enumSurroundingType::Air; + break; + case SESurroundingType::Water: + out = CDM::enumSurroundingType::Water; + break; + default: + out = ""; + break; + } } //---------------------------------------------------------------------------------- } -} \ No newline at end of file +bool operator==(CDM::enumSurroundingType const& lhs, SESurroundingType const& rhs) +{ + switch (rhs) { + case SESurroundingType ::Air: + return (CDM::enumSurroundingType::Air == lhs); + case SESurroundingType ::Water: + return (CDM::enumSurroundingType::Water == lhs); + case SESurroundingType ::Invalid: + return ((CDM::enumSurroundingType::value)-1 == lhs); + default: + return false; + } +} + +} diff --git a/projects/biogears/libBiogears/src/io/cdm/Environment.h b/projects/biogears/libBiogears/src/io/cdm/Environment.h index 73c02382b..bf8fa13ec 100644 --- a/projects/biogears/libBiogears/src/io/cdm/Environment.h +++ b/projects/biogears/libBiogears/src/io/cdm/Environment.h @@ -1,3 +1,4 @@ + /************************************************************************************** Copyright 2019 Applied Research Associates, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use @@ -12,21 +13,39 @@ specific language governing permissions and limitations under the License. #pragma once #include +#include -#include "biogears/cdm/CommonDataModel.h" +#include +#include #include #include -#define CDM_ENVIRONMENT_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_ENVIRONMENT_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ out.func(std::make_unique::type>()); \ - io::Environment::UnMarshall(*in.m_##func, out.func()); \ + io::Environment::Marshall(*in.m_##func, out.func()); \ + } + +#define CDM_OPTIONAL_ENVIRONMENT_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func && in.m_##func->IsValid()) { \ + io::Environment::Marshall(*in.m_##func, out.func()); \ + } + +#define SE_ENVIRONMENT_ENUM_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.Has##func()) { \ + out.func(std::make_unique::type>()); \ + io::Environment::Marshall(in.m_##func, out.func()); \ } -#define CDM_OPTIONAL_ENVIRONMENT_UNMARSHAL_HELPER(in, out, func) \ - if (in.m_##func) { \ - io::Environment::UnMarshall(*in.m_##func, out.func()); \ +#define SE_OPTIONAL_ENVIRONMENT_ENUM_PTR_MARSHALL_HELPER(in, out, func) \ + io::Environment::Marshall(in.m_##func, out.func()); + +#define CDM_ENVIRONMENT_COPY(type, in, out) \ + { \ + CDM::type##Data middle; \ + io::Environment::Marshall(in, middle); \ + io::Environment::UnMarshall(middle, out); \ } namespace biogears { @@ -39,44 +58,80 @@ class SEAppliedTemperature; namespace io { class BIOGEARS_PRIVATE_API Environment { public: - //template option - template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); + // template option + template ::value>* = nullptr> + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); + template ::value>* = nullptr> + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); - //class SEEnvironmentalConditions - static void Marshall(const CDM::EnvironmentalConditionsData& in, SEEnvironmentalConditions& out); - static void UnMarshall(const SEEnvironmentalConditions& in, CDM::EnvironmentalConditionsData& out); - //class SEActiveHeating - static void Marshall(const CDM::ActiveHeatingData& in, SEActiveHeating& out); - static void UnMarshall(const SEActiveHeating& in, CDM::ActiveHeatingData& out); - //class SEActiveCooling - static void Marshall(const CDM::ActiveCoolingData& in, SEActiveCooling& out); - static void UnMarshall(const SEActiveCooling& in, CDM::ActiveCoolingData& out); - //class SEAppliedTemperature - static void Marshall(const CDM::AppliedTemperatureData& in, SEAppliedTemperature& out); - static void UnMarshall(const SEAppliedTemperature& in, CDM::AppliedTemperatureData& out); - //class SEEnvironment - static void Marshall(const CDM::EnvironmentData& in, SEEnvironment& out); - static void UnMarshall(const SEEnvironment& in, CDM::EnvironmentData& out); + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); + + // class SEEnvironmentalConditions + static void UnMarshall(const CDM::EnvironmentalConditionsData& in, SEEnvironmentalConditions& out); + static void Marshall(const SEEnvironmentalConditions& in, CDM::EnvironmentalConditionsData& out); + // class SEActiveHeating + static void UnMarshall(const CDM::ActiveHeatingData& in, SEActiveHeating& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEActiveHeating& in, CDM::ActiveHeatingData& out); + // class SEActiveCooling + static void UnMarshall(const CDM::ActiveCoolingData& in, SEActiveCooling& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEActiveCooling& in, CDM::ActiveCoolingData& out); + // class SEAppliedTemperature + static void UnMarshall(const CDM::AppliedTemperatureData& in, SEAppliedTemperature& out); + static void Marshall(const SEAppliedTemperature& in, CDM::AppliedTemperatureData& out); + // class SEEnvironment + static void UnMarshall(const CDM::EnvironmentData& in, SEEnvironment& out); + static void Marshall(const SEEnvironment& in, CDM::EnvironmentData& out); + + // class SESurroundingType; + static void UnMarshall(const CDM::enumSurroundingType& in, SESurroundingType& out); + static void Marshall(const SESurroundingType& in, CDM::enumSurroundingType& out); }; //---------------------------------------------------------------------------------- - template - void Environment::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + template ::value>*> + void Environment::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) + { + if (!option_in.present() || option_in->empty()) { + out = SE::Invalid; + } else { + io::Environment::UnMarshall(option_in.get(), out); + } + } + + template ::value>*> + void Environment::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) { if (!option_in.present()) { - out.Clear(); + out.Invalidate(); } else { - Marshall(option_in.get(), out); + UnMarshall(option_in.get(), out); } } - //---------------------------------------------------------------------------------- + template - void Environment::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void Environment::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { - auto item = std::make_unique(); - UnMarshall(in, *item); - option_out.set(*item); + auto item = std::make_unique(); + io::Environment::Marshall(in, *item); + option_out.set(std::move(item)); } } // Namespace IO -} //Namespace Biogears + +// Operators +bool operator==(CDM::enumSurroundingType const& lhs, SESurroundingType const& rhs); + +inline bool operator==(SESurroundingType const& lhs, CDM::enumSurroundingType const& rhs) +{ + return rhs == lhs; +} + +inline bool operator!=(CDM::enumSurroundingType const& lhs, SESurroundingType const& rhs) +{ + return !(lhs == rhs); +} + +inline bool operator!=(SESurroundingType const& lhs, CDM::enumSurroundingType const& rhs) +{ + return !(rhs == lhs); +} + +} // Namespace Biogears diff --git a/projects/biogears/libBiogears/src/io/cdm/EnvironmentActions.cpp b/projects/biogears/libBiogears/src/io/cdm/EnvironmentActions.cpp index bd3935b3f..d9cc104c2 100644 --- a/projects/biogears/libBiogears/src/io/cdm/EnvironmentActions.cpp +++ b/projects/biogears/libBiogears/src/io/cdm/EnvironmentActions.cpp @@ -1,6 +1,7 @@ #include "EnvironmentActions.h" -#include "Scenario.h" +#include "Actions.h" +#include "Environment.h" #include #include @@ -9,68 +10,88 @@ #include #include #include +#include + +#define POLYMORPHIC_MARSHALL(paramName, typeName) \ + if (auto typeName = dynamic_cast(paramName); typeName) { \ + auto typeName##Data = std::make_unique(); \ + Marshall(*typeName, *typeName##Data); \ + return std::move(typeName##Data); \ + } + +#define POLYMORPHIC_UNMARSHALL(paramName, typeName, schema) \ + if (auto typeName##Data = dynamic_cast(paramName); typeName##Data) { \ + auto typeName = std::make_unique(); \ + schema::UnMarshall(*typeName##Data, *typeName); \ + return std::move(typeName); \ + } + +#define STOCASTIC_POLYMORPHIC_UNMARSHALL(paramName, typeName, schema, engine) \ + if (auto typeName##Data = dynamic_cast(paramName); typeName##Data) { \ + auto typeName = std::make_unique(); \ + schema::UnMarshall(*typeName##Data, *typeName, engine); \ + return std::move(typeName); \ + } + namespace biogears { namespace io { // class SEEnvironmentAction - void EnvironmentActions::Marshall(const CDM::EnvironmentActionData& in, SEEnvironmentAction& out) + void EnvironmentActions::UnMarshall(const CDM::EnvironmentActionData& in, SEEnvironmentAction& out) { - io::Scenario::Marshall(static_cast(in), static_cast(out)); + io::Actions::UnMarshall(static_cast(in), static_cast(out)); } //---------------------------------------------------------------------------------- - void EnvironmentActions::UnMarshall(const SEEnvironmentAction& in, CDM::EnvironmentActionData& out) + void EnvironmentActions::Marshall(const SEEnvironmentAction& in, CDM::EnvironmentActionData& out) { - io::Scenario::UnMarshall(static_cast(in), static_cast(out)); + io::Actions::Marshall(static_cast(in), static_cast(out)); } //---------------------------------------------------------------------------------- // class SEEnvironmentChange - void EnvironmentActions::Marshall(const CDM::EnvironmentChangeData& in, SEEnvironmentChange& out) + void EnvironmentActions::UnMarshall(const CDM::EnvironmentChangeData& in, SEEnvironmentChange& out) { - io::Scenario::Marshall(static_cast(in), static_cast(out)); - if (in.ConditionsFile().present()) + UnMarshall(static_cast(in), static_cast(out)); + if (in.ConditionsFile().present()) { out.SetConditionsFile(in.ConditionsFile().get()); - else if (in.Conditions().present()) - out.GetConditions().Load(in.Conditions().get()); + } else if (in.Conditions().present()) { + Environment::UnMarshall(in.Conditions(), out.GetConditions()); + } } //---------------------------------------------------------------------------------- - void EnvironmentActions::UnMarshall(const SEEnvironmentChange& in, CDM::EnvironmentChangeData& out) + void EnvironmentActions::Marshall(const SEEnvironmentChange& in, CDM::EnvironmentChangeData& out) { - io::Scenario::UnMarshall(static_cast(in), static_cast(out)); - if (in.HasConditions()) - out.Conditions(std::unique_ptr(in.m_Conditions->Unload())); - else if (in.HasConditionsFile()) + io::Actions::Marshall(static_cast(in), static_cast(out)); + + if (in.m_Conditions && in.m_Conditions->IsValid()) { + io::Environment::Marshall(*in.m_Conditions, out.Conditions()); + } else if (in.HasConditionsFile()) { out.ConditionsFile(in.m_ConditionsFile); + } } //---------------------------------------------------------------------------------- // class SEThermalApplication - void EnvironmentActions::Marshall(const CDM::ThermalApplicationData& in, SEThermalApplication& out) + void EnvironmentActions::UnMarshall(const CDM::ThermalApplicationData& in, SEThermalApplication& out) { - io::Scenario::Marshall(static_cast(in), static_cast(out)); + io::Actions::UnMarshall(static_cast(in), static_cast(out)); - if (in.ActiveHeating().present()) - out.GetActiveHeating().Load(in.ActiveHeating().get()); - if (in.ActiveCooling().present()) - out.GetActiveCooling().Load(in.ActiveCooling().get()); - if (in.AppliedTemperature().present()) - out.GetAppliedTemperature().Load(in.AppliedTemperature().get()); + io::Environment::UnMarshall(in.ActiveHeating(), out.GetActiveHeating()); + io::Environment::UnMarshall(in.ActiveCooling(), out.GetActiveCooling()); + io::Environment::UnMarshall(in.AppliedTemperature(), out.GetAppliedTemperature()); } //---------------------------------------------------------------------------------- - void EnvironmentActions::UnMarshall(const SEThermalApplication& in, CDM::ThermalApplicationData& out) + void EnvironmentActions::Marshall(const SEThermalApplication& in, CDM::ThermalApplicationData& out) { - io::Scenario::UnMarshall(static_cast(in), static_cast(out)); - if (in.HasActiveHeating()) - out.ActiveHeating(std::unique_ptr(in.m_ActiveHeating->Unload())); - if (in.HasActiveCooling()) - out.ActiveCooling(std::unique_ptr(in.m_ActiveCooling->Unload())); - if (in.HasAppliedTemperature()) - out.AppliedTemperature(std::unique_ptr(in.m_AppliedTemperature->Unload())); + Marshall(static_cast(in), static_cast(out)); + CDM_OPTIONAL_ENVIRONMENT_PTR_MARSHALL_HELPER(in, out, ActiveHeating) + CDM_OPTIONAL_ENVIRONMENT_PTR_MARSHALL_HELPER(in, out, ActiveCooling) + CDM_OPTIONAL_ENVIRONMENT_PTR_MARSHALL_HELPER(in, out, AppliedTemperature) } //---------------------------------------------------------------------------------- template void Copy(const SE& in, SE& out) { XSD data; - EnvironmentActions::UnMarshall(in, data); - EnvironmentActions::Marshall(data, out); + EnvironmentActions::Marshall(in, data); + EnvironmentActions::UnMarshall(data, out); } //----------------------------------------------------------------------------- void EnvironmentActions::Copy(const SEEnvironmentAction& in, SEEnvironmentAction& out) @@ -89,18 +110,36 @@ namespace io { //! Can throw NULLPTR to indicate a failure std::unique_ptr EnvironmentActions::factory(const SEEnvironmentAction* environmentAction) { - if (auto environmentChangeAction = dynamic_cast(environmentAction); environmentChangeAction) { - auto environmentChangeActionData = std::make_unique(); - UnMarshall(*environmentChangeAction, *environmentChangeActionData); - return std::move(environmentChangeActionData); + POLYMORPHIC_MARSHALL(environmentAction, EnvironmentChange) + POLYMORPHIC_MARSHALL(environmentAction, ThermalApplication) + + throw biogears::CommonDataModelException("EnvironmentActions::factory does not support the derived SEEnvironmentAction. If you are not a developer contact upstream for support."); + } + + std::unique_ptr EnvironmentActions::factory(CDM::EnvironmentActionData const* environmentActionData, SESubstanceManager& substances, std::default_random_engine* rd) + { + if (auto EnvironmentChangeData = dynamic_cast(environmentActionData); EnvironmentChangeData) { + auto EnvironmentChange = std::make_unique(substances); + EnvironmentActions::UnMarshall(*EnvironmentChangeData, *EnvironmentChange); + return std::move(EnvironmentChange); + } + + POLYMORPHIC_UNMARSHALL(environmentActionData, ThermalApplication, EnvironmentActions) + + throw biogears::CommonDataModelException("PatientActions::factory: Unsupported Environment Action."); + } + + void EnvironmentActions::Marshall(const SEEnvironmentActionCollection& in, std::vector>& out) + { + if (nullptr != in.m_Change) { + out.push_back(EnvironmentActions::factory(in.m_Change)); } - - if (auto thermalApplication = dynamic_cast(environmentAction); thermalApplication) { - auto thermalApplicationData = std::make_unique(); - UnMarshall(*thermalApplication, *thermalApplicationData); - return std::move(thermalApplicationData); + + if (nullptr != in.m_ThermalApplication) { + out.push_back(EnvironmentActions::factory(in.m_ThermalApplication)); } - throw biogears::CommonDataModelException("EnvironmentActions::factory does not support the derived SEEnvironmentAction. If you are not a developer contact upstream for support."); + + } -} -} \ No newline at end of file +} // namespace io +} // namespace biogears \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/io/cdm/EnvironmentActions.h b/projects/biogears/libBiogears/src/io/cdm/EnvironmentActions.h index 3e608e7e0..9073524aa 100644 --- a/projects/biogears/libBiogears/src/io/cdm/EnvironmentActions.h +++ b/projects/biogears/libBiogears/src/io/cdm/EnvironmentActions.h @@ -22,39 +22,45 @@ specific language governing permissions and limitations under the License. namespace biogears { class SEEnvironmentAction; +class SEEnvironmentActionCollection; class SEEnvironmentChange; class SEThermalApplication; +class SEAction; +class SESubstanceManager; -#define CDM_ENVIRONMENT_ACTIONS_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_ENVIRONMENT_ACTIONS_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ out.func(std::make_unique::type>()); \ - io::EnvironmentActions::UnMarshall(*in.m_##func, out.func()); \ + io::EnvironmentActions::Marshall(*in.m_##func, out.func()); \ } -#define CDM_OPTIONAL_ENVIRONMENT_ACTIONS_UNMARSHAL_HELPER(in, out, func) \ - if (in.m_##func) { \ - io::EnvironmentActions::UnMarshall(*in.m_##func, out.func()); \ +#define CDM_OPTIONAL_ENVIRONMENT_ACTIONS_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func) { \ + io::EnvironmentActions::Marshall(*in.m_##func, out.func()); \ } namespace io { class BIOGEARS_PRIVATE_API EnvironmentActions { public: - //template option - template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); - template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); - //class SEEnvironmentAction - static void Marshall(const CDM::EnvironmentActionData& in, SEEnvironmentAction& out); - static void UnMarshall(const SEEnvironmentAction& in, CDM::EnvironmentActionData& out); - //class SEEnvironmentChange - static void Marshall(const CDM::EnvironmentChangeData& in, SEEnvironmentChange& out); - static void UnMarshall(const SEEnvironmentChange& in, CDM::EnvironmentChangeData& out); - //class SEThermalApplication - static void Marshall(const CDM::ThermalApplicationData& in, SEThermalApplication& out); - static void UnMarshall(const SEThermalApplication& in, CDM::ThermalApplicationData& out); // Factories static std::unique_ptr factory(const SEEnvironmentAction*); + static std::unique_ptr factory(CDM::EnvironmentActionData const* actionData, SESubstanceManager& substances, std::default_random_engine* rd = nullptr); + + static void Marshall(const SEEnvironmentActionCollection& in, std::vector>& out); + // template option + template + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); + template + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); + // class SEEnvironmentAction + static void UnMarshall(const CDM::EnvironmentActionData& in, SEEnvironmentAction& out); + static void Marshall(const SEEnvironmentAction& in, CDM::EnvironmentActionData& out); + // class SEEnvironmentChange + static void UnMarshall(const CDM::EnvironmentChangeData& in, SEEnvironmentChange& out); + static void Marshall(const SEEnvironmentChange& in, CDM::EnvironmentChangeData& out); + // class SEThermalApplication + static void UnMarshall(const CDM::ThermalApplicationData& in, SEThermalApplication& out); + static void Marshall(const SEThermalApplication& in, CDM::ThermalApplicationData& out); //----------------------------------------------------------------------------- static void Copy(const SEEnvironmentAction& in, SEEnvironmentAction& out); @@ -63,21 +69,21 @@ namespace io { }; //---------------------------------------------------------------------------------- template - void EnvironmentActions::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + void EnvironmentActions::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) { if (!option_in.present()) { - out.Invalidate(); + out.MakeInvalid(); } else { - Marshall(option_in.get(), out); + UnMarshall(option_in.get(), out); } } //---------------------------------------------------------------------------------- template - void EnvironmentActions::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void EnvironmentActions::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); + Marshall(in, *item); option_out.set(*item); } } // Namespace IO -} //Namespace Biogears +} // Namespace Biogears diff --git a/projects/biogears/libBiogears/src/io/cdm/EnvironmentConditions.cpp b/projects/biogears/libBiogears/src/io/cdm/EnvironmentConditions.cpp index 17458f83f..1a951fa96 100644 --- a/projects/biogears/libBiogears/src/io/cdm/EnvironmentConditions.cpp +++ b/projects/biogears/libBiogears/src/io/cdm/EnvironmentConditions.cpp @@ -7,34 +7,74 @@ #include #include +#define POLYMORPHIC_MARSHALL(paramName, typeName) \ + if (auto typeName = dynamic_cast(paramName); typeName) { \ + auto typeName##Data = std::make_unique(); \ + Marshall(*typeName, *typeName##Data); \ + return std::move(typeName##Data); \ + } + +#define POLYMORPHIC_UNMARSHALL(paramName, typeName, schema) \ + if (auto typeName##Data = dynamic_cast(paramName); typeName##Data) { \ + auto typeName = std::make_unique(); \ + schema::UnMarshall(*typeName##Data, *typeName); \ + return std::move(typeName); \ + } + +#define STOCASTIC_POLYMORPHIC_UNMARSHALL(paramName, typeName, schema, engine) \ + if (auto typeName##Data = dynamic_cast(paramName); typeName##Data) { \ + auto typeName = std::make_unique(); \ + schema::UnMarshall(*typeName##Data, *typeName, engine); \ + return std::move(typeName); \ + } + namespace biogears { namespace io { - //class SEEnvironmentCondition - void EnvironmentConditions::Marshall(const CDM::EnvironmentConditionData& in, SEEnvironmentCondition& out) + //---------------------------------------------------------------------------------- + + std::unique_ptr EnvironmentConditions::factory(CDM::EnvironmentConditionData const* environmentConditionData, SESubstanceManager& substances, std::default_random_engine* rd) + { + + if (const auto initialEnvironmentData = dynamic_cast(environmentConditionData); initialEnvironmentData) { + auto initialEnvironmentAction = std::make_unique(substances); + EnvironmentConditions::UnMarshall(*initialEnvironmentData, *initialEnvironmentAction); + return initialEnvironmentAction; + } + + throw CommonDataModelException("Unsupported Condition Received in PatientConditions::factory"); + } + + std::unique_ptr EnvironmentConditions::factory(const SEEnvironmentCondition* conditionData) + { + POLYMORPHIC_MARSHALL(conditionData, InitialEnvironment) + throw biogears::CommonDataModelException("PatientConditions::factory does not support the derived SEPatientCondition. If you are not a developer contact upstream for support."); + } + // class SEEnvironmentCondition + void EnvironmentConditions::UnMarshall(const CDM::EnvironmentConditionData& in, SEEnvironmentCondition& out) { - io::Scenario::Marshall(static_cast(in), static_cast(out)); + io::Conditions::UnMarshall(static_cast(in), static_cast(out)); } //---------------------------------------------------------------------------------- - void EnvironmentConditions::UnMarshall(const SEEnvironmentCondition& in, CDM::EnvironmentConditionData& out) + void EnvironmentConditions::Marshall(const SEEnvironmentCondition& in, CDM::EnvironmentConditionData& out) { - io::Scenario::UnMarshall(static_cast(in), static_cast(out)); + io::Conditions::Marshall(static_cast(in), static_cast(out)); } //---------------------------------------------------------------------------------- - //class SEInitialEnvironment - void EnvironmentConditions::Marshall(const CDM::InitialEnvironmentData& in, SEInitialEnvironment& out) + // class SEInitialEnvironment + void EnvironmentConditions::UnMarshall(const CDM::InitialEnvironmentData& in, SEInitialEnvironment& out) { - io::Scenario::Marshall(static_cast(in), static_cast(out)); + io::Conditions::UnMarshall(static_cast(in), static_cast(out)); if (in.ConditionsFile().present()) out.SetConditionsFile(in.ConditionsFile().get()); if (in.Conditions().present()) - io::Environment::Marshall(in.Conditions(), out.GetConditions()); + io::Environment::UnMarshall(in.Conditions(), out.GetConditions()); } //---------------------------------------------------------------------------------- - void EnvironmentConditions::UnMarshall(const SEInitialEnvironment& in, CDM::InitialEnvironmentData& out) + void EnvironmentConditions::Marshall(const SEInitialEnvironment& in, CDM::InitialEnvironmentData& out) { - io::Scenario::UnMarshall(static_cast(in), static_cast(out)); + io::Conditions::Marshall(static_cast(in), static_cast(out)); if (in.HasConditions()) - io::Environment::UnMarshall(*in.m_Conditions, out.Conditions()); + io::Environment::Marshall(*in.m_Conditions, out.Conditions()); else if (in.HasConditionsFile()) out.ConditionsFile(in.m_ConditionsFile); } diff --git a/projects/biogears/libBiogears/src/io/cdm/EnvironmentConditions.h b/projects/biogears/libBiogears/src/io/cdm/EnvironmentConditions.h index 86caab1d7..11973df3b 100644 --- a/projects/biogears/libBiogears/src/io/cdm/EnvironmentConditions.h +++ b/projects/biogears/libBiogears/src/io/cdm/EnvironmentConditions.h @@ -14,57 +14,64 @@ specific language governing permissions and limitations under the License. #include #include +#include #include #include -#define CDM_ENVIRONMENT_CONDITIONS_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_ENVIRONMENT_CONDITIONS_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ out.func(std::make_unique::type>()); \ - io::EnvironmentConditions::UnMarshall(*in.m_##func, out.func()); \ + io::EnvironmentConditions::Marshall(*in.m_##func, out.func()); \ } -#define CDM_OPTIONAL_ENVIRONMENT_CONDITIONS_UNMARSHAL_HELPER(in, out, func) \ - if (in.m_##func) { \ - io::EnvironmentConditions::UnMarshall(*in.m_##func, out.func()); \ +#define CDM_OPTIONAL_ENVIRONMENT_CONDITIONS_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func) { \ + io::EnvironmentConditions::Marshall(*in.m_##func, out.func()); \ } namespace biogears { +class SECondition; +class SESubstanceManager; class SEEnvironmentCondition; class SEInitialEnvironment; namespace io { class BIOGEARS_PRIVATE_API EnvironmentConditions { public: - //template option + // class Factories; + static std::unique_ptr factory(CDM::EnvironmentConditionData const* environmentConditionData, SESubstanceManager& substances, std::default_random_engine* rd = nullptr); + static std::unique_ptr factory(const SEEnvironmentCondition* data); + + // template option template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); - //class SEEnvironmentCondition - static void Marshall(const CDM::EnvironmentConditionData& in, SEEnvironmentCondition& out); - static void UnMarshall(const SEEnvironmentCondition& in, CDM::EnvironmentConditionData& out); - //class SEInitialEnvironment - static void Marshall(const CDM::InitialEnvironmentData& in, SEInitialEnvironment& out); - static void UnMarshall(const SEInitialEnvironment& in, CDM::InitialEnvironmentData& out); + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); + // class SEEnvironmentCondition + static void UnMarshall(const CDM::EnvironmentConditionData& in, SEEnvironmentCondition& out); + static void Marshall(const SEEnvironmentCondition& in, CDM::EnvironmentConditionData& out); + // class SEInitialEnvironment + static void UnMarshall(const CDM::InitialEnvironmentData& in, SEInitialEnvironment& out); + static void Marshall(const SEInitialEnvironment& in, CDM::InitialEnvironmentData& out); }; //---------------------------------------------------------------------------------- template - void EnvironmentConditions::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + void EnvironmentConditions::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) { if (!option_in.present()) { - out.Clear(); + out.Invalidate(); } else { - Marshall(option_in.get(), out); + UnMarshall(option_in.get(), out); } } //---------------------------------------------------------------------------------- template - void EnvironmentConditions::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void EnvironmentConditions::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); + Marshall(in, *item); option_out.set(*item); } } // Namespace IO -} //Namespace Biogears +} // Namespace Biogears diff --git a/projects/biogears/libBiogears/src/io/biogears/BioGearsEquipmentmBioGearsPhysiology.cpp b/projects/biogears/libBiogears/src/io/cdm/Generators.cpp similarity index 100% rename from projects/biogears/libBiogears/src/io/biogears/BioGearsEquipmentmBioGearsPhysiology.cpp rename to projects/biogears/libBiogears/src/io/cdm/Generators.cpp diff --git a/projects/biogears/libBiogears/src/io/biogears/BioGearsEquipmentmBioGearsPhysiology.h b/projects/biogears/libBiogears/src/io/cdm/Generators.h similarity index 100% rename from projects/biogears/libBiogears/src/io/biogears/BioGearsEquipmentmBioGearsPhysiology.h rename to projects/biogears/libBiogears/src/io/cdm/Generators.h diff --git a/projects/biogears/libBiogears/src/io/cdm/Inhaler.cpp b/projects/biogears/libBiogears/src/io/cdm/Inhaler.cpp index fa8dc7d91..ff3dfb37c 100644 --- a/projects/biogears/libBiogears/src/io/cdm/Inhaler.cpp +++ b/projects/biogears/libBiogears/src/io/cdm/Inhaler.cpp @@ -12,15 +12,15 @@ namespace biogears { namespace io { - void Inhaler::Marshall(const CDM::InhalerData& in, SEInhaler& out) + void Inhaler::UnMarshall(const CDM::InhalerData& in, SEInhaler& out) { - out.Clear(); + out.Invalidate(); if (in.State().present()) - out.SetState(in.State().get()); + io::Property::UnMarshall(in.State().get(), out.m_State); - io::Property::Marshall(in.MeteredDose(), out.GetMeteredDose()); - io::Property::Marshall(in.NozzleLoss(), out.GetNozzleLoss()); - io::Property::Marshall(in.SpacerVolume(), out.GetSpacerVolume()); + io::Property::UnMarshall(in.MeteredDose(), out.GetMeteredDose()); + io::Property::UnMarshall(in.NozzleLoss(), out.GetNozzleLoss()); + io::Property::UnMarshall(in.SpacerVolume(), out.GetSpacerVolume()); if (in.Substance().present()) out.SetSubstance(out.m_Substances.GetSubstance(in.Substance().get())); @@ -28,12 +28,14 @@ namespace io { out.StateChange(); } //---------------------------------------------------------------------------------- - void Inhaler::UnMarshall(const SEInhaler& in, CDM::InhalerData& out) + void Inhaler::Marshall(const SEInhaler& in, CDM::InhalerData& out) { - CDM_ENUM_UNMARSHAL_HELPER(in,out,State) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MeteredDose) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, NozzleLoss) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SpacerVolume) + if (in.HasState()) { + io::Property::Marshall(in.m_State, out.State()); + } + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MeteredDose) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, NozzleLoss) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SpacerVolume) if (in.HasSubstance()) out.Substance(in.m_Substance->GetName()); } diff --git a/projects/biogears/libBiogears/src/io/cdm/Inhaler.h b/projects/biogears/libBiogears/src/io/cdm/Inhaler.h index 10e60529a..8275ee10b 100644 --- a/projects/biogears/libBiogears/src/io/cdm/Inhaler.h +++ b/projects/biogears/libBiogears/src/io/cdm/Inhaler.h @@ -18,15 +18,15 @@ specific language governing permissions and limitations under the License. #include -#define CDM_INHALER_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_INHALER_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ out.func(std::make_unique::type>()); \ - io::Inhaler::UnMarshall(*in.m_##func, out.func()); \ + io::Inhaler::Marshall(*in.m_##func, out.func()); \ } -#define CDM_OPTIONAL_INHALER_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_OPTIONAL_INHALER_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ - io::Inhaler::UnMarshall(*in.m_##func, out.func()); \ + io::Inhaler::Marshall(*in.m_##func, out.func()); \ } namespace biogears { class SEInhaler; @@ -37,29 +37,29 @@ namespace io { public: //template option template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); //class SEInhaler - static void Marshall(const CDM::InhalerData& in, SEInhaler& out); - static void UnMarshall(const SEInhaler& in, CDM::InhalerData& out); + static void UnMarshall(const CDM::InhalerData& in, SEInhaler& out); + static void Marshall(const SEInhaler& in, CDM::InhalerData& out); }; //---------------------------------------------------------------------------------- template - void Inhaler::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + void Inhaler::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) { if (!option_in.present()) { - out.Clear(); + out.Invalidate(); } else { - Marshall(option_in.get(), out); + UnMarshall(option_in.get(), out); } } //---------------------------------------------------------------------------------- template - void Inhaler::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void Inhaler::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); + Marshall(in, *item); option_out.set(*item); } } // Namespace IO diff --git a/projects/biogears/libBiogears/src/io/cdm/InhalerActions.cpp b/projects/biogears/libBiogears/src/io/cdm/InhalerActions.cpp index cb4de0a0e..9d4546ebd 100644 --- a/projects/biogears/libBiogears/src/io/cdm/InhalerActions.cpp +++ b/projects/biogears/libBiogears/src/io/cdm/InhalerActions.cpp @@ -4,38 +4,61 @@ #include "Property.h" #include "Scenario.h" +#include #include #include #include +#include + +#define POLYMORPHIC_MARSHALL(paramName, typeName) \ + if (auto typeName = dynamic_cast(paramName); typeName) { \ + auto typeName##Data = std::make_unique(); \ + Marshall(*typeName, *typeName##Data); \ + return std::move(typeName##Data); \ + } + +#define POLYMORPHIC_UNMARSHALL(paramName, typeName, schema) \ + if (auto typeName##Data = dynamic_cast(paramName); typeName##Data) { \ + auto typeName = std::make_unique(); \ + schema::UnMarshall(*typeName##Data, *typeName); \ + return std::move(typeName); \ + } + +#define STOCASTIC_POLYMORPHIC_UNMARSHALL(paramName, typeName, schema, engine) \ + if (auto typeName##Data = dynamic_cast(paramName); typeName##Data) { \ + auto typeName = std::make_unique(); \ + schema::UnMarshall(*typeName##Data, *typeName, engine); \ + return std::move(typeName); \ + } namespace biogears { namespace io { - //class SEInhalerAction - void InhalerActions::Marshall(const CDM::InhalerActionData& in, SEInhalerAction& out) + // class SEInhalerAction + void InhalerActions::UnMarshall(const CDM::InhalerActionData& in, SEInhalerAction& out) { - io::Scenario::Marshall(static_cast(in), static_cast(out)); + io::Actions::UnMarshall(static_cast(in), static_cast(out)); } //---------------------------------------------------------------------------------- - void InhalerActions::UnMarshall(const SEInhalerAction& in, CDM::InhalerActionData& out) + void InhalerActions::Marshall(const SEInhalerAction& in, CDM::InhalerActionData& out) { - io::Scenario::UnMarshall(static_cast(in), static_cast(out)); + io::Actions::Marshall(static_cast(in), static_cast(out)); } //---------------------------------------------------------------------------------- - //class SEInhalerConfiguration - void InhalerActions::Marshall(const CDM::InhalerConfigurationData& in, SEInhalerConfiguration& out) + // class SEInhalerConfiguration + void InhalerActions::UnMarshall(const CDM::InhalerConfigurationData& in, SEInhalerConfiguration& out) { - io::Scenario::Marshall(static_cast(in), static_cast(out)); + io::Actions::UnMarshall(static_cast(in), static_cast(out)); if (in.ConfigurationFile().present()) { out.SetConfigurationFile(in.ConfigurationFile().get()); } - io::Inhaler::Marshall(in.Configuration(), out.GetConfiguration()); + io::Inhaler::UnMarshall(in.Configuration(), out.GetConfiguration()); } //---------------------------------------------------------------------------------- - void InhalerActions::UnMarshall(const SEInhalerConfiguration& in, CDM::InhalerConfigurationData& out) + void InhalerActions::Marshall(const SEInhalerConfiguration& in, CDM::InhalerConfigurationData& out) { - io::Scenario::UnMarshall(static_cast(in), static_cast(out)); + io::Actions::Marshall(static_cast(in), static_cast(out)); if (in.HasConfiguration()) { - io::Inhaler::UnMarshall(*in.m_Configuration, out.Configuration()); + io::Inhaler::Marshall(*in.m_Configuration, out.Configuration()); } else if (in.HasConfigurationFile()) { out.ConfigurationFile(in.m_ConfigurationFile); } @@ -44,12 +67,27 @@ namespace io { // Factories std::unique_ptr InhalerActions::factory(const SEInhalerAction* inhalerAction) { - if (auto inhalerConfiguration = dynamic_cast(inhalerAction); inhalerConfiguration) { - auto inhalerConfigurationData = std::make_unique(); - UnMarshall(*inhalerConfiguration, *inhalerConfigurationData); - return std::move(inhalerConfigurationData); - } + POLYMORPHIC_MARSHALL(inhalerAction, InhalerConfiguration) + throw biogears::CommonDataModelException("InhalerActions::factory does not support the derived SEInhalerAction. If you are not a developer contact upstream for support."); } -} -} \ No newline at end of file + + std::unique_ptr InhalerActions::factory(CDM::InhalerActionData const* inhalerActionData, SESubstanceManager& substances, std::default_random_engine* rd) + { + if (auto InhalerConfigurationData = dynamic_cast(inhalerActionData); InhalerConfigurationData) { + auto InhalerConfiguration = std::make_unique(substances); + InhalerActions::UnMarshall(*InhalerConfigurationData, *InhalerConfiguration); + return std::move(InhalerConfiguration); + } + throw biogears::CommonDataModelException("PatientActions:Factory - Unsupported Inhaler Action Received."); + } + + void InhalerActions::Marshall(const SEInhalerActionCollection& in, std::vector>& out) { + if (nullptr != in.m_Configuration) { + out.push_back(InhalerActions::factory(in.m_Configuration)); + } + } + + +} // namespace io +} // namespace biogears \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/io/cdm/InhalerActions.h b/projects/biogears/libBiogears/src/io/cdm/InhalerActions.h index 30b47b854..3c053f0d7 100644 --- a/projects/biogears/libBiogears/src/io/cdm/InhalerActions.h +++ b/projects/biogears/libBiogears/src/io/cdm/InhalerActions.h @@ -12,61 +12,68 @@ specific language governing permissions and limitations under the License. #pragma once #include +#include #include "biogears/cdm/CommonDataModel.h" #include #include -#define CDM_INHALER_ACTIONS_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_INHALER_ACTIONS_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ out.func(std::make_unique::type>()); \ - io::InhalerActions::UnMarshall(*in.m_##func, out.func()); \ + io::InhalerActions::Marshall(*in.m_##func, out.func()); \ } -#define CDM_OPTIONAL_INHALER_ACTIONS_UNMARSHAL_HELPER(in, out, func) \ - if (in.m_##func) { \ - io::InhalerActions::UnMarshall(*in.m_##func, out.func()); \ +#define CDM_OPTIONAL_INHALER_ACTIONS_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func) { \ + io::InhalerActions::Marshall(*in.m_##func, out.func()); \ } namespace biogears { +class SEAction; class SEInhalerAction; +class SEInhalerActionCollection; class SEInhalerConfiguration; +class SESubstanceManager; namespace io { class BIOGEARS_PRIVATE_API InhalerActions { public: - //template option - template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); - template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); - //class SEInhalerAction - static void Marshall(const CDM::InhalerActionData& in, SEInhalerAction& out); - static void UnMarshall(const SEInhalerAction& in, CDM::InhalerActionData& out); - //class SEInhalerConfiguration - static void Marshall(const CDM::InhalerConfigurationData& in, SEInhalerConfiguration& out); - static void UnMarshall(const SEInhalerConfiguration& in, CDM::InhalerConfigurationData& out); // Factories static std::unique_ptr factory(const SEInhalerAction*); + static std::unique_ptr factory(CDM::InhalerActionData const* inhalerActionData, SESubstanceManager& substances, std::default_random_engine* rd = nullptr); + + static void Marshall(const SEInhalerActionCollection& in, std::vector>& out); + // template option + template + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); + template + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); + // class SEInhalerAction + static void UnMarshall(const CDM::InhalerActionData& in, SEInhalerAction& out); + static void Marshall(const SEInhalerAction& in, CDM::InhalerActionData& out); + // class SEInhalerConfiguration + static void UnMarshall(const CDM::InhalerConfigurationData& in, SEInhalerConfiguration& out); + static void Marshall(const SEInhalerConfiguration& in, CDM::InhalerConfigurationData& out); }; //---------------------------------------------------------------------------------- template - void InhalerActions::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + void InhalerActions::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) { if (!option_in.present()) { - out.Invalidate(); + out.MakeInvalid(); } else { - Marshall(option_in.get(), out); + UnMarshall(option_in.get(), out); } } //---------------------------------------------------------------------------------- template - void InhalerActions::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void InhalerActions::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); + Marshall(in, *item); option_out.set(*item); } } // Namespace IO -} //Namespace Biogears +} // Namespace Biogears diff --git a/projects/biogears/libBiogears/src/io/cdm/Patient.cpp b/projects/biogears/libBiogears/src/io/cdm/Patient.cpp index f86d3fe74..1f1fdb333 100644 --- a/projects/biogears/libBiogears/src/io/cdm/Patient.cpp +++ b/projects/biogears/libBiogears/src/io/cdm/Patient.cpp @@ -1,76 +1,93 @@ + #include "Patient.h" #include "Property.h" #include - +#include #include namespace biogears { namespace io { //---------------------------------------------------------------------------------- // class SEPatient - void Patient::Marshall(const CDM::PatientData& in, SEPatient& out) + void Patient::UnMarshall(const CDM::PatientData& in, SEPatient& out) { - out.Clear(); + out.Invalidate(); out.m_Name = in.Name(); if (in.Annotation().present()) { out.SetAnnotation(in.Annotation().get()); } - if (in.Sex().present()) { - out.m_Gender = in.Sex().get(); + Patient::UnMarshall(in.Sex(), out.m_Sex); + + io::Property::UnMarshall(in.Age(), out.GetAge()); + io::Property::UnMarshall(in.Weight(), out.GetWeight()); + io::Property::UnMarshall(in.Height(), out.GetHeight()); + + if (in.BodyMassIndex().present()) { + if (!in.Weight().present() && in.Height().present()) { + out.CalculateWeightByBMI(in.BodyMassIndex().get().value()); + } else if (in.Weight().present() && !in.Height().present()) { + out.CalculateHeightByBMI(in.BodyMassIndex().get().value()); + } else { + std::stringstream ss; + ss << "BodyMassIndex as an input must be provided with height OR weight (and not neither/both). BMI input value is not being used and default inputs will be used." << std::endl; + out.Warning(ss); } - io::Property::Marshall(in.Age(), out.GetAge()); - io::Property::Marshall(in.Weight(), out.GetWeight()); - io::Property::Marshall(in.Height(), out.GetHeight()); - io::Property::Marshall(in.AlveoliSurfaceArea(), out.GetAlveoliSurfaceArea()); - io::Property::Marshall(in.BasalMetabolicRate(), out.GetBasalMetabolicRate()); +} + + + io::Property::UnMarshall(in.AlveoliSurfaceArea(), out.GetAlveoliSurfaceArea()); + io::Property::UnMarshall(in.BasalMetabolicRate(), out.GetBasalMetabolicRate()); + if (in.BloodTypeRh().present()) { out.m_BloodRh = in.BloodTypeRh().get(); } if (in.BloodTypeABO().present()) { - out.m_BloodType = in.BloodTypeABO().get(); + io::Patient::UnMarshall(in.BloodTypeABO(), out.m_BloodType); } - io::Property::Marshall(in.BloodVolumeBaseline(), out.GetBloodVolumeBaseline()); - io::Property::Marshall(in.BodyDensity(), out.GetBodyDensity()); - io::Property::Marshall(in.BodyFatFraction(), out.GetBodyFatFraction()); - io::Property::Marshall(in.DiastolicArterialPressureBaseline(), out.GetDiastolicArterialPressureBaseline()); - io::Property::Marshall(in.ExpiratoryReserveVolume(), out.GetExpiratoryReserveVolume()); - io::Property::Marshall(in.FunctionalResidualCapacity(), out.GetFunctionalResidualCapacity()); - io::Property::Marshall(in.HeartRateBaseline(), out.GetHeartRateBaseline()); - io::Property::Marshall(in.HeartRateMaximum(), out.GetHeartRateMaximum()); - io::Property::Marshall(in.HeartRateMinimum(), out.GetHeartRateMinimum()); - io::Property::Marshall(in.Hyperhidrosis(), out.GetHyperhidrosis()); - io::Property::Marshall(in.InspiratoryCapacity(), out.GetInspiratoryCapacity()); - io::Property::Marshall(in.InspiratoryReserveVolume(), out.GetInspiratoryReserveVolume()); - io::Property::Marshall(in.LeanBodyMass(), out.GetLeanBodyMass()); - io::Property::Marshall(in.MaxWorkRate(), out.GetMaxWorkRate()); - io::Property::Marshall(in.MuscleMass(), out.GetMuscleMass()); - io::Property::Marshall(in.MeanArterialPressureBaseline(), out.GetMeanArterialPressureBaseline()); - io::Property::Marshall(in.PainSusceptibility(), out.GetPainSusceptibility()); - io::Property::Marshall(in.ResidualVolume(), out.GetResidualVolume()); - io::Property::Marshall(in.RespirationRateBaseline(), out.GetRespirationRateBaseline()); - io::Property::Marshall(in.RespiratoryDriverAmplitudeBaseline(), out.GetRespiratoryDriverAmplitudeBaseline()); - io::Property::Marshall(in.RightLungRatio(), out.GetRightLungRatio()); - io::Property::Marshall(in.SkinSurfaceArea(), out.GetSkinSurfaceArea()); - io::Property::Marshall(in.SleepAmount(), out.GetSleepAmount()); - io::Property::Marshall(in.SystolicArterialPressureBaseline(), out.GetSystolicArterialPressureBaseline()); - io::Property::Marshall(in.TotalVentilationBaseline(), out.GetTotalVentilationBaseline()); - io::Property::Marshall(in.TidalVolumeBaseline(), out.GetTidalVolumeBaseline()); - io::Property::Marshall(in.TotalLungCapacity(), out.GetTotalLungCapacity()); - io::Property::Marshall(in.VitalCapacity(), out.GetVitalCapacity()); + + io::Property::UnMarshall(in.BloodVolumeBaseline(), out.GetBloodVolumeBaseline()); + io::Property::UnMarshall(in.BodyDensity(), out.GetBodyDensity()); + io::Property::UnMarshall(in.BodyFatFraction(), out.GetBodyFatFraction()); + io::Property::UnMarshall(in.DiastolicArterialPressureBaseline(), out.GetDiastolicArterialPressureBaseline()); + io::Property::UnMarshall(in.ExpiratoryReserveVolume(), out.GetExpiratoryReserveVolume()); + io::Property::UnMarshall(in.FunctionalResidualCapacity(), out.GetFunctionalResidualCapacity()); + io::Property::UnMarshall(in.HeartRateBaseline(), out.GetHeartRateBaseline()); + io::Property::UnMarshall(in.HeartRateMaximum(), out.GetHeartRateMaximum()); + io::Property::UnMarshall(in.HeartRateMinimum(), out.GetHeartRateMinimum()); + io::Property::UnMarshall(in.Hyperhidrosis(), out.GetHyperhidrosis()); + io::Property::UnMarshall(in.InspiratoryCapacity(), out.GetInspiratoryCapacity()); + io::Property::UnMarshall(in.InspiratoryReserveVolume(), out.GetInspiratoryReserveVolume()); + io::Property::UnMarshall(in.LeanBodyMass(), out.GetLeanBodyMass()); + io::Property::UnMarshall(in.MaxWorkRate(), out.GetMaxWorkRate()); + io::Property::UnMarshall(in.MuscleMass(), out.GetMuscleMass()); + io::Property::UnMarshall(in.MeanArterialPressureBaseline(), out.GetMeanArterialPressureBaseline()); + io::Property::UnMarshall(in.PainSusceptibility(), out.GetPainSusceptibility()); + io::Property::UnMarshall(in.ResidualVolume(), out.GetResidualVolume()); + io::Property::UnMarshall(in.RespirationRateBaseline(), out.GetRespirationRateBaseline()); + io::Property::UnMarshall(in.RespiratoryDriverAmplitudeBaseline(), out.GetRespiratoryDriverAmplitudeBaseline()); + io::Property::UnMarshall(in.RightLungRatio(), out.GetRightLungRatio()); + io::Property::UnMarshall(in.SkinSurfaceArea(), out.GetSkinSurfaceArea()); + io::Property::UnMarshall(in.SleepAmount(), out.GetSleepAmount()); + io::Property::UnMarshall(in.SystolicArterialPressureBaseline(), out.GetSystolicArterialPressureBaseline()); + io::Property::UnMarshall(in.TotalVentilationBaseline(), out.GetTotalVentilationBaseline()); + io::Property::UnMarshall(in.TidalVolumeBaseline(), out.GetTidalVolumeBaseline()); + io::Property::UnMarshall(in.TotalLungCapacity(), out.GetTotalLungCapacity()); + io::Property::UnMarshall(in.VitalCapacity(), out.GetVitalCapacity()); SEScalarTime time; + SEPatientEventType key = SEPatientEventType::Invalid; for (auto e : in.ActiveEvent()) { - io::Property::Marshall(e.Duration(), time); - out.m_EventState[e.Event()] = true; - out.m_EventDuration_s[e.Event()] = time.GetValue(TimeUnit::s); + io::Property::UnMarshall(e.Duration(), time); + Patient::UnMarshall(e.Event(), key); + out.m_EventState[key] = true; + out.m_EventDuration_s[key] = time.GetValue(TimeUnit::s); } } - //---------------------------------------------------------------------------------- - void Patient::UnMarshall(const SEPatient& in, CDM::PatientData& out) + void Patient::Marshall(const SEPatient& in, CDM::PatientData& out) { if (in.HasName()) { out.Name(in.m_Name); @@ -78,49 +95,47 @@ namespace io { if (in.HasAnnotation()) { out.Annotation(in.m_Annotation); } - if (in.HasGender()) { - out.Sex(in.m_Gender); - } + SE_OPTIONAL_PATIENT_ENUM_PTR_MARSHALL_HELPER(in, out, Sex) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Age); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Weight) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Height) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, AlveoliSurfaceArea) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, BasalMetabolicRate) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Age); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Weight) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Height) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, AlveoliSurfaceArea) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, BasalMetabolicRate) if (in.HasBloodRh()) { out.BloodTypeRh(in.m_BloodRh); } - if (in.HasBloodType()) { - out.BloodTypeABO(in.m_BloodType); - } - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, BloodVolumeBaseline) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, BodyDensity) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, BodyFatFraction) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, DiastolicArterialPressureBaseline) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ExpiratoryReserveVolume) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, FunctionalResidualCapacity) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, HeartRateBaseline) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, HeartRateMaximum) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, HeartRateMinimum) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Hyperhidrosis) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, InspiratoryCapacity) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, InspiratoryReserveVolume) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeanBodyMass) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MaxWorkRate) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MuscleMass) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MeanArterialPressureBaseline) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PainSusceptibility) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ResidualVolume) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RespirationRateBaseline) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RespiratoryDriverAmplitudeBaseline) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightLungRatio) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SkinSurfaceArea) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SleepAmount) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SystolicArterialPressureBaseline) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, TotalVentilationBaseline) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, TidalVolumeBaseline) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, TotalLungCapacity) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, VitalCapacity) + + Patient::Marshall(in.m_BloodType, out.BloodTypeABO()); + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, BloodVolumeBaseline) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, BodyDensity) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, BodyFatFraction) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, DiastolicArterialPressureBaseline) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ExpiratoryReserveVolume) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, FunctionalResidualCapacity) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, HeartRateBaseline) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, HeartRateMaximum) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, HeartRateMinimum) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Hyperhidrosis) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, InspiratoryCapacity) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, InspiratoryReserveVolume) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeanBodyMass) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MaxWorkRate) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MuscleMass) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MeanArterialPressureBaseline) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PainSusceptibility) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ResidualVolume) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RespirationRateBaseline) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RespiratoryDriverAmplitudeBaseline) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightLungRatio) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SkinSurfaceArea) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SleepAmount) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SystolicArterialPressureBaseline) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TotalVentilationBaseline) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TidalVolumeBaseline) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TotalLungCapacity) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, VitalCapacity) SEScalarTime time; for (auto itr : in.m_EventState) { @@ -136,13 +151,814 @@ namespace io { time.SetValue(it2->second, TimeUnit::s); } CDM::ActivePatientEventData* eData = new CDM::ActivePatientEventData(); - eData->Event(itr.first); - io::Property::UnMarshall(time, eData->Duration()); + eData->Event(std::make_uniqueEvent())>::type>()); + io::Patient::Marshall(itr.first, eData->Event()); + + eData->Duration(std::make_uniqueDuration())>::type>()); + io::Property::Marshall(time, eData->Duration()); ; out.ActiveEvent().push_back(std::unique_ptr(eData)); } } //---------------------------------------------------------------------------------- + // SEOpenClosed + void Patient::UnMarshall(const CDM::enumSex& in, SESex& out) + { + try { + switch (in) { + case CDM::enumSex::Male: + out = SESex::Male; + break; + case CDM::enumSex::Female: + out = SESex::Female; + break; + default: + out = SESex::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SESex::Invalid; + } + } + void Patient::Marshall(const SESex& in, CDM::enumSex& out) + { + switch (in) { + case SESex::Male: + out = CDM::enumSex::Male; + break; + case SESex::Female: + out = CDM::enumSex::Female; + break; + default: + out = ""; + break; + } + } + //---------------------------------------------------------------------------------- + // SEOnOff + void Patient::UnMarshall(const CDM::enumBloodType& in, SEBloodType& out) + { + try { + switch (in) { + case CDM::enumBloodType::A: + out = SEBloodType::A; + break; + case CDM::enumBloodType::B: + out = SEBloodType::B; + break; + case CDM::enumBloodType::AB: + out = SEBloodType::AB; + break; + case CDM::enumBloodType::O: + out = SEBloodType::O; + break; + default: + out = SEBloodType::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SEBloodType::Invalid; + } + } + void Patient::Marshall(const SEBloodType& in, CDM::enumBloodType& out) + { + switch (in) { + case SEBloodType::A: + out = CDM::enumBloodType::A; + break; + case SEBloodType::B: + out = CDM::enumBloodType::B; + break; + case SEBloodType::AB: + out = CDM::enumBloodType::AB; + break; + case SEBloodType::O: + out = CDM::enumBloodType::O; + break; + default: + out = ""; + break; + } + } + //---------------------------------------------------------------------------------- + // SEErrorType + void Patient::UnMarshall(const CDM::enumPatientEvent& in, SEPatientEventType& out) + { + try { + switch (in) { + case CDM::enumPatientEvent::AcuteLungInjury: + out = SEPatientEventType::AcuteLungInjury; + break; + case CDM::enumPatientEvent::AcuteRespiratoryDistress: + out = SEPatientEventType::AcuteRespiratoryDistress; + break; + case CDM::enumPatientEvent::Antidiuresis: + out = SEPatientEventType::Antidiuresis; + break; + case CDM::enumPatientEvent::Asystole: + out = SEPatientEventType::Asystole; + break; + case CDM::enumPatientEvent::Bradycardia: + out = SEPatientEventType::Bradycardia; + break; + case CDM::enumPatientEvent::Bradypnea: + out = SEPatientEventType::Bradypnea; + break; + case CDM::enumPatientEvent::BrainOxygenDeficit: + out = SEPatientEventType::BrainOxygenDeficit; + break; + case CDM::enumPatientEvent::CardiacArrest: + out = SEPatientEventType::CardiacArrest; + break; + case CDM::enumPatientEvent::CardiogenicShock: + out = SEPatientEventType::CardiogenicShock; + break; + case CDM::enumPatientEvent::CompartmentSyndrome_LeftArm: + out = SEPatientEventType::CompartmentSyndromeLeftArm; + break; + case CDM::enumPatientEvent::CompartmentSyndrome_RightArm: + out = SEPatientEventType::CompartmentSyndromeRightArm; + break; + case CDM::enumPatientEvent::CompartmentSyndrome_LeftLeg: + out = SEPatientEventType::CompartmentSyndromeLeftLeg; + break; + case CDM::enumPatientEvent::CompartmentSyndrome_RightLeg: + out = SEPatientEventType::CompartmentSyndromeRightLeg; + break; + case CDM::enumPatientEvent::CompartmentSyndrome_Abdominal: + out = SEPatientEventType::CompartmentSyndromeAbdominal; + break; + case CDM::enumPatientEvent::CriticalBrainOxygenDeficit: + out = SEPatientEventType::CriticalBrainOxygenDeficit; + break; + case CDM::enumPatientEvent::Dehydration: + out = SEPatientEventType::Dehydration; + break; + case CDM::enumPatientEvent::Diuresis: + out = SEPatientEventType::Diuresis; + break; + case CDM::enumPatientEvent::MildDiarrhea: + out = SEPatientEventType::MildDiarrhea; + break; + case CDM::enumPatientEvent::SevereDiarrhea: + out = SEPatientEventType::SevereDiarrhea; + break; + case CDM::enumPatientEvent::Fasciculation: + out = SEPatientEventType::Fasciculation; + break; + case CDM::enumPatientEvent::Fatigue: + out = SEPatientEventType::Fatigue; + break; + case CDM::enumPatientEvent::FlaccidParalysis: + out = SEPatientEventType::FlaccidParalysis; + break; + case CDM::enumPatientEvent::FunctionalIncontinence: + out = SEPatientEventType::FunctionalIncontinence; + break; + case CDM::enumPatientEvent::MildHeadache: + out = SEPatientEventType::MildHeadache; + break; + case CDM::enumPatientEvent::SevereHeadache: + out = SEPatientEventType::SevereHeadache; + break; + case CDM::enumPatientEvent::HemolyticTransfusionReaction: + out = SEPatientEventType::HemolyticTransfusionReaction; + break; + case CDM::enumPatientEvent::Hypercapnia: + out = SEPatientEventType::Hypercapnia; + break; + case CDM::enumPatientEvent::Hyperglycemia: + out = SEPatientEventType::Hyperglycemia; + break; + case CDM::enumPatientEvent::MildDiaphoresis: + out = SEPatientEventType::MildDiaphoresis; + break; + case CDM::enumPatientEvent::ModerateDiaphoresis: + out = SEPatientEventType::ModerateDiaphoresis; + break; + case CDM::enumPatientEvent::SevereDiaphoresis: + out = SEPatientEventType::SevereDiaphoresis; + break; + case CDM::enumPatientEvent::MildHyperkalemia: + out = SEPatientEventType::MildHyperkalemia; + break; + case CDM::enumPatientEvent::SevereHyperkalemia: + out = SEPatientEventType::SevereHyperkalemia; + break; + case CDM::enumPatientEvent::MildHypernatremia: + out = SEPatientEventType::MildHypernatremia; + break; + case CDM::enumPatientEvent::SevereHypernatremia: + out = SEPatientEventType::SevereHypernatremia; + break; + case CDM::enumPatientEvent::Hyperthermia: + out = SEPatientEventType::Hyperthermia; + break; + case CDM::enumPatientEvent::Hypoglycemia: + out = SEPatientEventType::Hypoglycemia; + break; + case CDM::enumPatientEvent::HypoglycemicShock: + out = SEPatientEventType::HypoglycemicShock; + break; + case CDM::enumPatientEvent::HypoglycemicComa: + out = SEPatientEventType::HypoglycemicComa; + break; + case CDM::enumPatientEvent::MildHypothermia: + out = SEPatientEventType::MildHypothermia; + break; + case CDM::enumPatientEvent::ModerateHypothermia: + out = SEPatientEventType::ModerateHypothermia; + break; + case CDM::enumPatientEvent::SevereHypothermia: + out = SEPatientEventType::SevereHypothermia; + break; + case CDM::enumPatientEvent::MildHypokalemia: + out = SEPatientEventType::MildHypokalemia; + break; + case CDM::enumPatientEvent::SevereHypokalemia: + out = SEPatientEventType::SevereHypokalemia; + break; + case CDM::enumPatientEvent::MildHyponatremia: + out = SEPatientEventType::MildHyponatremia; + break; + case CDM::enumPatientEvent::SevereHyponatremia: + out = SEPatientEventType::SevereHyponatremia; + break; + case CDM::enumPatientEvent::Hypoxia: + out = SEPatientEventType::Hypoxia; + break; + case CDM::enumPatientEvent::HypovolemicShock: + out = SEPatientEventType::HypovolemicShock; + break; + case CDM::enumPatientEvent::IntracranialHypertension: + out = SEPatientEventType::IntracranialHypertension; + break; + case CDM::enumPatientEvent::IntracranialHypotension: + out = SEPatientEventType::IntracranialHypotension; + break; + case CDM::enumPatientEvent::IrreversibleState: + out = SEPatientEventType::IrreversibleState; + break; + case CDM::enumPatientEvent::Ketoacidosis: + out = SEPatientEventType::Ketoacidosis; + break; + case CDM::enumPatientEvent::LacticAcidosis: + out = SEPatientEventType::LacticAcidosis; + break; + case CDM::enumPatientEvent::LiverGlycogenDepleted: + out = SEPatientEventType::LiverGlycogenDepleted; + break; + case CDM::enumPatientEvent::MaximumPulmonaryVentilationRate: + out = SEPatientEventType::MaximumPulmonaryVentilationRate; + break; + case CDM::enumPatientEvent::MetabolicAcidosis: + out = SEPatientEventType::MetabolicAcidosis; + break; + case CDM::enumPatientEvent::MetabolicAlkalosis: + out = SEPatientEventType::MetabolicAlkalosis; + break; + case CDM::enumPatientEvent::MildWeakness: + out = SEPatientEventType::MildWeakness; + break; + case CDM::enumPatientEvent::ModerateWeakness: + out = SEPatientEventType::ModerateWeakness; + break; + case CDM::enumPatientEvent::MildSecretions: + out = SEPatientEventType::MildSecretions; + break; + case CDM::enumPatientEvent::ModerateSecretions: + out = SEPatientEventType::ModerateSecretions; + break; + case CDM::enumPatientEvent::MuscleCatabolism: + out = SEPatientEventType::MuscleCatabolism; + break; + case CDM::enumPatientEvent::MuscleGlycogenDepleted: + out = SEPatientEventType::MuscleGlycogenDepleted; + break; + case CDM::enumPatientEvent::MyocardiumOxygenDeficit: + out = SEPatientEventType::MyocardiumOxygenDeficit; + break; + case CDM::enumPatientEvent::Natriuresis: + out = SEPatientEventType::Natriuresis; + break; + case CDM::enumPatientEvent::Nausea: + out = SEPatientEventType::Nausea; + break; + case CDM::enumPatientEvent::NutritionDepleted: + out = SEPatientEventType::NutritionDepleted; + break; + case CDM::enumPatientEvent::PulselessRhythm: + out = SEPatientEventType::PulselessRhythm; + break; + case CDM::enumPatientEvent::RenalHypoperfusion: + out = SEPatientEventType::RenalHypoperfusion; + break; + case CDM::enumPatientEvent::RespiratoryAcidosis: + out = SEPatientEventType::RespiratoryAcidosis; + break; + case CDM::enumPatientEvent::RespiratoryAlkalosis: + out = SEPatientEventType::RespiratoryAlkalosis; + break; + case CDM::enumPatientEvent::SevereAcuteRespiratoryDistress: + out = SEPatientEventType::SevereAcuteRespiratoryDistress; + break; + case CDM::enumPatientEvent::SevereSecretions: + out = SEPatientEventType::SevereSecretions; + break; + case CDM::enumPatientEvent::Seizures: + out = SEPatientEventType::Seizures; + break; + case CDM::enumPatientEvent::Shivering: + out = SEPatientEventType::Shivering; + break; + case CDM::enumPatientEvent::StartOfCardiacCycle: + out = SEPatientEventType::StartOfCardiacCycle; + break; + case CDM::enumPatientEvent::StartOfExhale: + out = SEPatientEventType::StartOfExhale; + break; + case CDM::enumPatientEvent::StartOfInhale: + out = SEPatientEventType::StartOfInhale; + break; + case CDM::enumPatientEvent::SevereSepsis: + out = SEPatientEventType::SevereSepsis; + break; + case CDM::enumPatientEvent::Tachycardia: + out = SEPatientEventType::Tachycardia; + break; + case CDM::enumPatientEvent::Tachypnea: + out = SEPatientEventType::Tachypnea; + break; + case CDM::enumPatientEvent::Vomiting: + out = SEPatientEventType::Vomiting; + break; + default: + out = SEPatientEventType::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SEPatientEventType::Invalid; + } + } + void Patient::Marshall(const SEPatientEventType& in, CDM::enumPatientEvent& out) + { + switch (in) { + case SEPatientEventType::AcuteLungInjury: + out = CDM::enumPatientEvent::AcuteLungInjury; + break; + case SEPatientEventType::AcuteRespiratoryDistress: + out = CDM::enumPatientEvent::AcuteRespiratoryDistress; + break; + case SEPatientEventType::Antidiuresis: + out = CDM::enumPatientEvent::Antidiuresis; + break; + case SEPatientEventType::Asystole: + out = CDM::enumPatientEvent::Asystole; + break; + case SEPatientEventType::Bradycardia: + out = CDM::enumPatientEvent::Bradycardia; + break; + case SEPatientEventType::Bradypnea: + out = CDM::enumPatientEvent::Bradypnea; + break; + case SEPatientEventType::BrainOxygenDeficit: + out = CDM::enumPatientEvent::BrainOxygenDeficit; + break; + case SEPatientEventType::CardiacArrest: + out = CDM::enumPatientEvent::CardiacArrest; + break; + case SEPatientEventType::CardiogenicShock: + out = CDM::enumPatientEvent::CardiogenicShock; + break; + case SEPatientEventType::CompartmentSyndromeLeftArm: + out = CDM::enumPatientEvent::CompartmentSyndrome_LeftArm; + break; + case SEPatientEventType::CompartmentSyndromeRightArm: + out = CDM::enumPatientEvent::CompartmentSyndrome_RightArm; + break; + case SEPatientEventType::CompartmentSyndromeLeftLeg: + out = CDM::enumPatientEvent::CompartmentSyndrome_LeftLeg; + break; + case SEPatientEventType::CompartmentSyndromeRightLeg: + out = CDM::enumPatientEvent::CompartmentSyndrome_RightLeg; + break; + case SEPatientEventType::CompartmentSyndromeAbdominal: + out = CDM::enumPatientEvent::CompartmentSyndrome_Abdominal; + break; + case SEPatientEventType::CriticalBrainOxygenDeficit: + out = CDM::enumPatientEvent::CriticalBrainOxygenDeficit; + break; + case SEPatientEventType::Dehydration: + out = CDM::enumPatientEvent::Dehydration; + break; + case SEPatientEventType::Diuresis: + out = CDM::enumPatientEvent::Diuresis; + break; + case SEPatientEventType::MildDiarrhea: + out = CDM::enumPatientEvent::MildDiarrhea; + break; + case SEPatientEventType::SevereDiarrhea: + out = CDM::enumPatientEvent::SevereDiarrhea; + break; + case SEPatientEventType::Fasciculation: + out = CDM::enumPatientEvent::Fasciculation; + break; + case SEPatientEventType::Fatigue: + out = CDM::enumPatientEvent::Fatigue; + break; + case SEPatientEventType::FlaccidParalysis: + out = CDM::enumPatientEvent::FlaccidParalysis; + break; + case SEPatientEventType::FunctionalIncontinence: + out = CDM::enumPatientEvent::FunctionalIncontinence; + break; + case SEPatientEventType::MildHeadache: + out = CDM::enumPatientEvent::MildHeadache; + break; + case SEPatientEventType::SevereHeadache: + out = CDM::enumPatientEvent::SevereHeadache; + break; + case SEPatientEventType::HemolyticTransfusionReaction: + out = CDM::enumPatientEvent::HemolyticTransfusionReaction; + break; + case SEPatientEventType::Hypercapnia: + out = CDM::enumPatientEvent::Hypercapnia; + break; + case SEPatientEventType::Hyperglycemia: + out = CDM::enumPatientEvent::Hyperglycemia; + break; + case SEPatientEventType::MildDiaphoresis: + out = CDM::enumPatientEvent::MildDiaphoresis; + break; + case SEPatientEventType::ModerateDiaphoresis: + out = CDM::enumPatientEvent::ModerateDiaphoresis; + break; + case SEPatientEventType::SevereDiaphoresis: + out = CDM::enumPatientEvent::SevereDiaphoresis; + break; + case SEPatientEventType::MildHyperkalemia: + out = CDM::enumPatientEvent::MildHyperkalemia; + break; + case SEPatientEventType::SevereHyperkalemia: + out = CDM::enumPatientEvent::SevereHyperkalemia; + break; + case SEPatientEventType::MildHypernatremia: + out = CDM::enumPatientEvent::MildHypernatremia; + break; + case SEPatientEventType::SevereHypernatremia: + out = CDM::enumPatientEvent::SevereHypernatremia; + break; + case SEPatientEventType::Hyperthermia: + out = CDM::enumPatientEvent::Hyperthermia; + break; + case SEPatientEventType::Hypoglycemia: + out = CDM::enumPatientEvent::Hypoglycemia; + break; + case SEPatientEventType::HypoglycemicShock: + out = CDM::enumPatientEvent::HypoglycemicShock; + break; + case SEPatientEventType::HypoglycemicComa: + out = CDM::enumPatientEvent::HypoglycemicComa; + break; + case SEPatientEventType::MildHypothermia: + out = CDM::enumPatientEvent::MildHypothermia; + break; + case SEPatientEventType::ModerateHypothermia: + out = CDM::enumPatientEvent::ModerateHypothermia; + break; + case SEPatientEventType::SevereHypothermia: + out = CDM::enumPatientEvent::SevereHypothermia; + break; + case SEPatientEventType::MildHypokalemia: + out = CDM::enumPatientEvent::MildHypokalemia; + break; + case SEPatientEventType::SevereHypokalemia: + out = CDM::enumPatientEvent::SevereHypokalemia; + break; + case SEPatientEventType::MildHyponatremia: + out = CDM::enumPatientEvent::MildHyponatremia; + break; + case SEPatientEventType::SevereHyponatremia: + out = CDM::enumPatientEvent::SevereHyponatremia; + break; + case SEPatientEventType::Hypoxia: + out = CDM::enumPatientEvent::Hypoxia; + break; + case SEPatientEventType::HypovolemicShock: + out = CDM::enumPatientEvent::HypovolemicShock; + break; + case SEPatientEventType::IntracranialHypertension: + out = CDM::enumPatientEvent::IntracranialHypertension; + break; + case SEPatientEventType::IntracranialHypotension: + out = CDM::enumPatientEvent::IntracranialHypotension; + break; + case SEPatientEventType::IrreversibleState: + out = CDM::enumPatientEvent::IrreversibleState; + break; + case SEPatientEventType::Ketoacidosis: + out = CDM::enumPatientEvent::Ketoacidosis; + break; + case SEPatientEventType::LacticAcidosis: + out = CDM::enumPatientEvent::LacticAcidosis; + break; + case SEPatientEventType::LiverGlycogenDepleted: + out = CDM::enumPatientEvent::LiverGlycogenDepleted; + break; + case SEPatientEventType::MaximumPulmonaryVentilationRate: + out = CDM::enumPatientEvent::MaximumPulmonaryVentilationRate; + break; + case SEPatientEventType::MetabolicAcidosis: + out = CDM::enumPatientEvent::MetabolicAcidosis; + break; + case SEPatientEventType::MetabolicAlkalosis: + out = CDM::enumPatientEvent::MetabolicAlkalosis; + break; + case SEPatientEventType::MildWeakness: + out = CDM::enumPatientEvent::MildWeakness; + break; + case SEPatientEventType::ModerateWeakness: + out = CDM::enumPatientEvent::ModerateWeakness; + break; + case SEPatientEventType::MildSecretions: + out = CDM::enumPatientEvent::MildSecretions; + break; + case SEPatientEventType::ModerateSecretions: + out = CDM::enumPatientEvent::ModerateSecretions; + break; + case SEPatientEventType::MuscleCatabolism: + out = CDM::enumPatientEvent::MuscleCatabolism; + break; + case SEPatientEventType::MuscleGlycogenDepleted: + out = CDM::enumPatientEvent::MuscleGlycogenDepleted; + break; + case SEPatientEventType::MyocardiumOxygenDeficit: + out = CDM::enumPatientEvent::MyocardiumOxygenDeficit; + break; + case SEPatientEventType::Natriuresis: + out = CDM::enumPatientEvent::Natriuresis; + break; + case SEPatientEventType::Nausea: + out = CDM::enumPatientEvent::Nausea; + break; + case SEPatientEventType::NutritionDepleted: + out = CDM::enumPatientEvent::NutritionDepleted; + break; + case SEPatientEventType::PulselessRhythm: + out = CDM::enumPatientEvent::PulselessRhythm; + break; + case SEPatientEventType::RenalHypoperfusion: + out = CDM::enumPatientEvent::RenalHypoperfusion; + break; + case SEPatientEventType::RespiratoryAcidosis: + out = CDM::enumPatientEvent::RespiratoryAcidosis; + break; + case SEPatientEventType::RespiratoryAlkalosis: + out = CDM::enumPatientEvent::RespiratoryAlkalosis; + break; + case SEPatientEventType::SevereAcuteRespiratoryDistress: + out = CDM::enumPatientEvent::SevereAcuteRespiratoryDistress; + break; + case SEPatientEventType::SevereSecretions: + out = CDM::enumPatientEvent::SevereSecretions; + break; + case SEPatientEventType::Seizures: + out = CDM::enumPatientEvent::Seizures; + break; + case SEPatientEventType::Shivering: + out = CDM::enumPatientEvent::Shivering; + break; + case SEPatientEventType::StartOfCardiacCycle: + out = CDM::enumPatientEvent::StartOfCardiacCycle; + break; + case SEPatientEventType::StartOfExhale: + out = CDM::enumPatientEvent::StartOfExhale; + break; + case SEPatientEventType::StartOfInhale: + out = CDM::enumPatientEvent::StartOfInhale; + break; + case SEPatientEventType::SevereSepsis: + out = CDM::enumPatientEvent::SevereSepsis; + break; + case SEPatientEventType::Tachycardia: + out = CDM::enumPatientEvent::Tachycardia; + break; + case SEPatientEventType::Tachypnea: + out = CDM::enumPatientEvent::Tachypnea; + break; + case SEPatientEventType::Vomiting: + out = CDM::enumPatientEvent::Vomiting; + break; + default: + out = ""; + break; + } + } + //---------------------------------------------------------------------------------- +} + +bool operator==(CDM::enumSex const& lhs, SESex const& rhs) +{ + switch (rhs) { + case SESex::Male: + return (CDM::enumSex::Male == lhs); + case SESex::Female: + return (CDM::enumSex::Female == lhs); + case SESex::Invalid: + return ((CDM::enumSex::value)-1 == lhs); + default: + return false; + } +} +bool operator==(CDM::enumBloodType const& lhs, SEBloodType const& rhs) +{ + switch (rhs) { + case SEBloodType::A: + return (CDM::enumBloodType::A == lhs); + case SEBloodType::AB: + return (CDM::enumBloodType::AB == lhs); + case SEBloodType::B: + return (CDM::enumBloodType::B == lhs); + case SEBloodType::O: + return (CDM::enumBloodType::O == lhs); + case SEBloodType::Invalid: + return ((CDM::enumBloodType::value)-1 == lhs); + default: + return false; + } +} +bool operator==(CDM::enumPatientEvent const& lhs, SEPatientEventType const& rhs) +{ + switch (rhs) { + case SEPatientEventType::AcuteLungInjury: + return (CDM::enumPatientEvent::AcuteLungInjury == lhs); + case SEPatientEventType::AcuteRespiratoryDistress: + return (CDM::enumPatientEvent::AcuteRespiratoryDistress == lhs); + case SEPatientEventType::Antidiuresis: + return (CDM::enumPatientEvent::Antidiuresis == lhs); + case SEPatientEventType::Asystole: + return (CDM::enumPatientEvent::Asystole == lhs); + case SEPatientEventType::Bradycardia: + return (CDM::enumPatientEvent::Bradycardia == lhs); + case SEPatientEventType::Bradypnea: + return (CDM::enumPatientEvent::Bradypnea == lhs); + case SEPatientEventType::BrainOxygenDeficit: + return (CDM::enumPatientEvent::BrainOxygenDeficit == lhs); + case SEPatientEventType::CardiacArrest: + return (CDM::enumPatientEvent::CardiacArrest == lhs); + case SEPatientEventType::CardiogenicShock: + return (CDM::enumPatientEvent::CardiogenicShock == lhs); + case SEPatientEventType::CompartmentSyndromeLeftArm: + return (CDM::enumPatientEvent::CompartmentSyndrome_LeftArm == lhs); + case SEPatientEventType::CompartmentSyndromeRightArm: + return (CDM::enumPatientEvent::CompartmentSyndrome_RightArm == lhs); + case SEPatientEventType::CompartmentSyndromeLeftLeg: + return (CDM::enumPatientEvent::CompartmentSyndrome_LeftLeg == lhs); + case SEPatientEventType::CompartmentSyndromeRightLeg: + return (CDM::enumPatientEvent::CompartmentSyndrome_RightLeg == lhs); + case SEPatientEventType::CompartmentSyndromeAbdominal: + return (CDM::enumPatientEvent::CompartmentSyndrome_Abdominal == lhs); + case SEPatientEventType::CriticalBrainOxygenDeficit: + return (CDM::enumPatientEvent::CriticalBrainOxygenDeficit == lhs); + case SEPatientEventType::Dehydration: + return (CDM::enumPatientEvent::Dehydration == lhs); + case SEPatientEventType::Diuresis: + return (CDM::enumPatientEvent::Diuresis == lhs); + case SEPatientEventType::MildDiarrhea: + return (CDM::enumPatientEvent::MildDiarrhea == lhs); + case SEPatientEventType::SevereDiarrhea: + return (CDM::enumPatientEvent::SevereDiarrhea == lhs); + case SEPatientEventType::Fasciculation: + return (CDM::enumPatientEvent::Fasciculation == lhs); + case SEPatientEventType::Fatigue: + return (CDM::enumPatientEvent::Fatigue == lhs); + case SEPatientEventType::FlaccidParalysis: + return (CDM::enumPatientEvent::FlaccidParalysis == lhs); + case SEPatientEventType::FunctionalIncontinence: + return (CDM::enumPatientEvent::FunctionalIncontinence == lhs); + case SEPatientEventType::MildHeadache: + return (CDM::enumPatientEvent::MildHeadache == lhs); + case SEPatientEventType::SevereHeadache: + return (CDM::enumPatientEvent::SevereHeadache == lhs); + case SEPatientEventType::HemolyticTransfusionReaction: + return (CDM::enumPatientEvent::HemolyticTransfusionReaction == lhs); + case SEPatientEventType::Hypercapnia: + return (CDM::enumPatientEvent::Hypercapnia == lhs); + case SEPatientEventType::Hyperglycemia: + return (CDM::enumPatientEvent::Hyperglycemia == lhs); + case SEPatientEventType::MildDiaphoresis: + return (CDM::enumPatientEvent::MildDiaphoresis == lhs); + case SEPatientEventType::ModerateDiaphoresis: + return (CDM::enumPatientEvent::ModerateDiaphoresis == lhs); + case SEPatientEventType::SevereDiaphoresis: + return (CDM::enumPatientEvent::SevereDiaphoresis == lhs); + case SEPatientEventType::MildHyperkalemia: + return (CDM::enumPatientEvent::MildHyperkalemia == lhs); + case SEPatientEventType::SevereHyperkalemia: + return (CDM::enumPatientEvent::SevereHyperkalemia == lhs); + case SEPatientEventType::MildHypernatremia: + return (CDM::enumPatientEvent::MildHypernatremia == lhs); + case SEPatientEventType::SevereHypernatremia: + return (CDM::enumPatientEvent::SevereHypernatremia == lhs); + case SEPatientEventType::Hyperthermia: + return (CDM::enumPatientEvent::Hyperthermia == lhs); + case SEPatientEventType::Hypoglycemia: + return (CDM::enumPatientEvent::Hypoglycemia == lhs); + case SEPatientEventType::HypoglycemicShock: + return (CDM::enumPatientEvent::HypoglycemicShock == lhs); + case SEPatientEventType::HypoglycemicComa: + return (CDM::enumPatientEvent::HypoglycemicComa == lhs); + case SEPatientEventType::MildHypothermia: + return (CDM::enumPatientEvent::MildHypothermia == lhs); + case SEPatientEventType::ModerateHypothermia: + return (CDM::enumPatientEvent::ModerateHypothermia == lhs); + case SEPatientEventType::SevereHypothermia: + return (CDM::enumPatientEvent::SevereHypothermia == lhs); + case SEPatientEventType::MildHypokalemia: + return (CDM::enumPatientEvent::MildHypokalemia == lhs); + case SEPatientEventType::SevereHypokalemia: + return (CDM::enumPatientEvent::SevereHypokalemia == lhs); + case SEPatientEventType::MildHyponatremia: + return (CDM::enumPatientEvent::MildHyponatremia == lhs); + case SEPatientEventType::SevereHyponatremia: + return (CDM::enumPatientEvent::SevereHyponatremia == lhs); + case SEPatientEventType::Hypoxia: + return (CDM::enumPatientEvent::Hypoxia == lhs); + case SEPatientEventType::HypovolemicShock: + return (CDM::enumPatientEvent::HypovolemicShock == lhs); + case SEPatientEventType::IntracranialHypertension: + return (CDM::enumPatientEvent::IntracranialHypertension == lhs); + case SEPatientEventType::IntracranialHypotension: + return (CDM::enumPatientEvent::IntracranialHypotension == lhs); + case SEPatientEventType::IrreversibleState: + return (CDM::enumPatientEvent::IrreversibleState == lhs); + case SEPatientEventType::Ketoacidosis: + return (CDM::enumPatientEvent::Ketoacidosis == lhs); + case SEPatientEventType::LacticAcidosis: + return (CDM::enumPatientEvent::LacticAcidosis == lhs); + case SEPatientEventType::LiverGlycogenDepleted: + return (CDM::enumPatientEvent::LiverGlycogenDepleted == lhs); + case SEPatientEventType::MaximumPulmonaryVentilationRate: + return (CDM::enumPatientEvent::MaximumPulmonaryVentilationRate == lhs); + case SEPatientEventType::MetabolicAcidosis: + return (CDM::enumPatientEvent::MetabolicAcidosis == lhs); + case SEPatientEventType::MetabolicAlkalosis: + return (CDM::enumPatientEvent::MetabolicAlkalosis == lhs); + case SEPatientEventType::MildWeakness: + return (CDM::enumPatientEvent::MildWeakness == lhs); + case SEPatientEventType::ModerateWeakness: + return (CDM::enumPatientEvent::ModerateWeakness == lhs); + case SEPatientEventType::MildSecretions: + return (CDM::enumPatientEvent::MildSecretions == lhs); + case SEPatientEventType::ModerateSecretions: + return (CDM::enumPatientEvent::ModerateSecretions == lhs); + case SEPatientEventType::MuscleCatabolism: + return (CDM::enumPatientEvent::MuscleCatabolism == lhs); + case SEPatientEventType::MuscleGlycogenDepleted: + return (CDM::enumPatientEvent::MuscleGlycogenDepleted == lhs); + case SEPatientEventType::MyocardiumOxygenDeficit: + return (CDM::enumPatientEvent::MyocardiumOxygenDeficit == lhs); + case SEPatientEventType::Natriuresis: + return (CDM::enumPatientEvent::Natriuresis == lhs); + case SEPatientEventType::Nausea: + return (CDM::enumPatientEvent::Nausea == lhs); + case SEPatientEventType::NutritionDepleted: + return (CDM::enumPatientEvent::NutritionDepleted == lhs); + case SEPatientEventType::PulselessRhythm: + return (CDM::enumPatientEvent::PulselessRhythm == lhs); + case SEPatientEventType::RenalHypoperfusion: + return (CDM::enumPatientEvent::RenalHypoperfusion == lhs); + case SEPatientEventType::RespiratoryAcidosis: + return (CDM::enumPatientEvent::RespiratoryAcidosis == lhs); + case SEPatientEventType::RespiratoryAlkalosis: + return (CDM::enumPatientEvent::RespiratoryAlkalosis == lhs); + case SEPatientEventType::SevereAcuteRespiratoryDistress: + return (CDM::enumPatientEvent::SevereAcuteRespiratoryDistress == lhs); + case SEPatientEventType::SevereSecretions: + return (CDM::enumPatientEvent::SevereSecretions == lhs); + case SEPatientEventType::Seizures: + return (CDM::enumPatientEvent::Seizures == lhs); + case SEPatientEventType::Shivering: + return (CDM::enumPatientEvent::Shivering == lhs); + case SEPatientEventType::StartOfCardiacCycle: + return (CDM::enumPatientEvent::StartOfCardiacCycle == lhs); + case SEPatientEventType::StartOfExhale: + return (CDM::enumPatientEvent::StartOfExhale == lhs); + case SEPatientEventType::StartOfInhale: + return (CDM::enumPatientEvent::StartOfInhale == lhs); + case SEPatientEventType::SevereSepsis: + return (CDM::enumPatientEvent::SevereSepsis == lhs); + case SEPatientEventType::Tachycardia: + return (CDM::enumPatientEvent::Tachycardia == lhs); + case SEPatientEventType::Tachypnea: + return (CDM::enumPatientEvent::Tachypnea == lhs); + case SEPatientEventType::Vomiting: + return (CDM::enumPatientEvent::Vomiting == lhs); + case SEPatientEventType::Invalid: + return ((CDM::enumPatientEvent::value)-1 == lhs); + default: + return false; + } +} } -} \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/io/cdm/Patient.h b/projects/biogears/libBiogears/src/io/cdm/Patient.h index afefc0318..dd4dc213c 100644 --- a/projects/biogears/libBiogears/src/io/cdm/Patient.h +++ b/projects/biogears/libBiogears/src/io/cdm/Patient.h @@ -13,20 +13,37 @@ specific language governing permissions and limitations under the License. #pragma once #include -#include "biogears/cdm/CommonDataModel.h" +#include +#include #include #include -#define CDM_PATIENT_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_PATIENT_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ out.func(std::make_unique::type>()); \ - io::Patient::UnMarshall(*in.m_##func, out.func()); \ + io::Patient::Marshall(*in.m_##func, out.func()); \ } -#define CDM_OPTIONAL_PATIENT_UNMARSHAL_HELPER(in, out, func) \ - if (in.m_##func) { \ - io::Patient::UnMarshall(*in.m_##func, out.func()); \ +#define CDM_OPTIONAL_PATIENT_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func) { \ + io::Patient::Marshall(*in.m_##func, out.func()); \ + } + +#define SE_PATIENT_ENUM_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.Has##func()) { \ + out.func(std::make_unique::type>()); \ + io::Patient::Marshall(in.m_##func, out.func()); \ + } + +#define SE_OPTIONAL_PATIENT_ENUM_PTR_MARSHALL_HELPER(in, out, func) \ + io::Patient::Marshall(in.m_##func, out.func()); + +#define CDM_PATIENT_COPY(type, in, out) \ + { \ + CDM::type##Data middle; \ + io::Patient::Marshall(in, middle); \ + io::Patient::UnMarshall(middle, out); \ } namespace biogears { @@ -35,32 +52,113 @@ class SEPatient; namespace io { class BIOGEARS_PRIVATE_API Patient { public: - //template option + // template option + template ::value>* = nullptr> + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); + template ::value>* = nullptr> + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); + template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); + + // class SEPatient + static void UnMarshall(const CDM::PatientData& in, SEPatient& out); + static void Marshall(const SEPatient& in, CDM::PatientData& out); + + // SESex + static void UnMarshall(const CDM::enumSex& in, SESex& out); + static void Marshall(const SESex& in, CDM::enumSex& out); + // SEBloodType + static void UnMarshall(const CDM::enumBloodType& in, SEBloodType& out); + static void Marshall(const SEBloodType& in, CDM::enumBloodType& out); + // SEPatientEventType + static void UnMarshall(const CDM::enumPatientEvent& in, SEPatientEventType& out); + static void Marshall(const SEPatientEventType& in, CDM::enumPatientEvent& out); + template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); - //class SEPatient - static void Marshall(const CDM::PatientData& in, SEPatient& out); - static void UnMarshall(const SEPatient& in, CDM::PatientData& out); + static typename std::enable_if::type>::type + UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) + { + if (!option_in.present() || option_in->empty()) { + out = SE::Invalid; + } else { + UnMarshall(option_in.get(), out); + } + } }; //---------------------------------------------------------------------------------- - template - void Patient::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + template ::value>*> + void Patient::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) + { + if (!option_in.present() || option_in->empty()) { + out = SE::Invalid; + } else { + UnMarshall(option_in.get(), out); + } + } + + template ::value>*> + void Patient::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) { if (!option_in.present()) { - out.Clear(); + out.MakeInvalid(); } else { - Marshall(option_in.get(), out); + UnMarshall(option_in.get(), out); } } - //---------------------------------------------------------------------------------- + template - void Patient::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void Patient::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); - option_out.set(*item); + Marshall(in, *item); + option_out.set(std::move(item)); } } // Namespace IO -} //Namespace Biogears + +// Operators +// Operators +bool operator==(CDM::enumSex const& lhs, SESex const& rhs); +bool operator==(CDM::enumBloodType const& lhs, SEBloodType const& rhs); +bool operator==(CDM::enumPatientEvent const& lhs, SEPatientEventType const& rhs); + +inline bool operator==(SESex const& lhs, CDM::enumSex const& rhs) +{ + return rhs == lhs; +} +inline bool operator==(SEBloodType const& lhs, CDM::enumBloodType const& rhs) +{ + return rhs == lhs; +} +inline bool operator==(SEPatientEventType const& lhs, CDM::enumPatientEvent const& rhs) +{ + return rhs == lhs; +} + +inline bool operator!=(CDM::enumSex const& lhs, SESex const& rhs) +{ + return !(lhs == rhs); +} +inline bool operator!=(CDM::enumBloodType const& lhs, SEBloodType const& rhs) +{ + return !(lhs == rhs); +} +inline bool operator!=(CDM::enumPatientEvent const& lhs, SEPatientEventType const& rhs) +{ + return !(lhs == rhs); +} + +inline bool operator!=(SESex const& lhs, CDM::enumSex const& rhs) +{ + return !(rhs == lhs); +} +inline bool operator!=(SEBloodType const& lhs, CDM::enumBloodType const& rhs) +{ + return !(rhs == lhs); +} +inline bool operator!=(SEPatientEventType const& lhs, CDM::enumPatientEvent const& rhs) +{ + return !(rhs == lhs); +} + +} // Namespace Biogears diff --git a/projects/biogears/libBiogears/src/io/cdm/PatientActions.cpp b/projects/biogears/libBiogears/src/io/cdm/PatientActions.cpp index 9f3b1c599..473cd060e 100644 --- a/projects/biogears/libBiogears/src/io/cdm/PatientActions.cpp +++ b/projects/biogears/libBiogears/src/io/cdm/PatientActions.cpp @@ -1,13 +1,16 @@ #include "PatientActions.h" #include +#include +#include "Actions.h" #include "AnesthesiaActions.h" #include "EnvironmentActions.h" #include "InhalerActions.h" #include "PatientNutrition.h" #include "Property.h" #include "Scenario.h" +#include "Substance.h" #include #include @@ -15,12 +18,11 @@ #include #include -#include - -#include +#include #include #include #include +#include #include #include #include @@ -32,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -39,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -65,7 +69,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -88,386 +94,485 @@ #include #include -#define POLYMORPHIC_UNMARSHALL(paramName, typeName) \ +#define POLYMORPHIC_MARSHALL(paramName, typeName) \ if (auto typeName = dynamic_cast(paramName); typeName) { \ auto typeName##Data = std::make_unique(); \ - UnMarshall(*typeName, *typeName##Data); \ + Marshall(*typeName, *typeName##Data); \ return std::move(typeName##Data); \ } -#define POLYMORPHIC_MARSHALL(paramName, typeName, schema) \ +#define POLYMORPHIC_UNMARSHALL(paramName, typeName, schema) \ if (auto typeName##Data = dynamic_cast(paramName); typeName##Data) { \ auto typeName = std::make_unique(); \ - schema::Marshall(*typeName##Data, *typeName); \ + schema::UnMarshall(*typeName##Data, *typeName); \ return std::move(typeName); \ } -namespace biogears { -namespace io { - // class SEActionList - std::vector> PatientActions::action_factory(const CDM::ActionListData& in, SESubstanceManager& substances) - { - std::vector> r_vec; - for (auto action_data : in.Action()) { - r_vec.emplace_back(factory(&action_data, substances)); - } - return std::move(r_vec); +#define STOCASTIC_POLYMORPHIC_UNMARSHALL(paramName, typeName, schema, engine) \ + if (auto typeName##Data = dynamic_cast(paramName); typeName##Data) { \ + auto typeName = std::make_unique(); \ + schema::UnMarshall(*typeName##Data, *typeName, engine); \ + return std::move(typeName); \ } - std::unique_ptr PatientActions::factory(CDM::ActionData const* actionData, SESubstanceManager& substances) - { - if (auto advData = dynamic_cast(actionData); advData) { - auto a = std::make_unique(); - Scenario::Marshall(*advData, *a); - return a; - } - - if (auto stData = dynamic_cast(actionData); stData) { - auto a = std::make_unique(); - Scenario::Marshall(*stData, *a); - return a; - } - - if (auto environmentActionData = dynamic_cast(actionData); environmentActionData) { - - if (auto EnvironmentChangeData = dynamic_cast(environmentActionData); EnvironmentChangeData) { - auto EnvironmentChange = std::make_unique(substances); - EnvironmentActions::Marshall(*EnvironmentChangeData, *EnvironmentChange); - return std::move(EnvironmentChange); - } - - POLYMORPHIC_MARSHALL(environmentActionData, ThermalApplication, EnvironmentActions) - - throw biogears::CommonDataModelException("PatientActions::factory: Unsupported Environment Action."); - } - - if (auto patientActionData = dynamic_cast(actionData); patientActionData) { - POLYMORPHIC_MARSHALL(patientActionData, PatientAssessmentRequest, PatientActions) - POLYMORPHIC_MARSHALL(patientActionData, AcuteStress, PatientActions) - POLYMORPHIC_MARSHALL(patientActionData, ExampleAction, PatientActions) - POLYMORPHIC_MARSHALL(patientActionData, AirwayObstruction, PatientActions) - POLYMORPHIC_MARSHALL(patientActionData, Apnea, PatientActions) - POLYMORPHIC_MARSHALL(patientActionData, BrainInjury, PatientActions) - POLYMORPHIC_MARSHALL(patientActionData, BurnWound, PatientActions) - POLYMORPHIC_MARSHALL(patientActionData, Escharotomy, PatientActions) - POLYMORPHIC_MARSHALL(patientActionData, Bronchoconstriction, PatientActions) - POLYMORPHIC_MARSHALL(patientActionData, CardiacArrest, PatientActions) - POLYMORPHIC_MARSHALL(patientActionData, AsthmaAttack, PatientActions) - - if (auto chestCompressionData = dynamic_cast(actionData); chestCompressionData) { - POLYMORPHIC_MARSHALL(chestCompressionData, ChestCompressionForce, PatientActions) - POLYMORPHIC_MARSHALL(chestCompressionData, ChestCompressionForceScale, PatientActions) - } +namespace biogears { +namespace io { - POLYMORPHIC_MARSHALL(patientActionData, ChestOcclusiveDressing, PatientActions) - POLYMORPHIC_MARSHALL(patientActionData, ConsciousRespiration, PatientActions) - POLYMORPHIC_MARSHALL(patientActionData, ConsumeNutrients, PatientActions) - POLYMORPHIC_MARSHALL(patientActionData, Ebola, PatientActions) - POLYMORPHIC_MARSHALL(patientActionData, Ebola, PatientActions) - POLYMORPHIC_MARSHALL(patientActionData, Intubation, PatientActions) - POLYMORPHIC_MARSHALL(patientActionData, MechanicalVentilation, PatientActions) - POLYMORPHIC_MARSHALL(patientActionData, NasalCannula, PatientActions) - POLYMORPHIC_MARSHALL(patientActionData, NeedleDecompression, PatientActions) - POLYMORPHIC_MARSHALL(patientActionData, Override, PatientActions) - POLYMORPHIC_MARSHALL(patientActionData, Hemorrhage, PatientActions) - POLYMORPHIC_MARSHALL(patientActionData, PainStimulus, PatientActions) - POLYMORPHIC_MARSHALL(patientActionData, PericardialEffusion, PatientActions) - POLYMORPHIC_MARSHALL(patientActionData, Infection, PatientActions) - POLYMORPHIC_MARSHALL(patientActionData, TensionPneumothorax, PatientActions) - POLYMORPHIC_MARSHALL(patientActionData, Tourniquet, PatientActions) - POLYMORPHIC_MARSHALL(patientActionData, PulmonaryShunt, PatientActions) - POLYMORPHIC_MARSHALL(patientActionData, RadiationAbsorbedDose, PatientActions) - - if (auto substanceBolusData = dynamic_cast(actionData); substanceBolusData) { + std::unique_ptr PatientActions::factory(CDM::PatientActionData const* patientActionData, SESubstanceManager& substances, std::default_random_engine* rd) + { + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, AcuteStress, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, AcuteRespiratoryDistress, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, AsthmaAttack, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, AirwayObstruction, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, Amputation, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, Apnea, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, BrainInjury, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, Bronchoconstriction, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, BurnWound, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, CardiacArrest, PatientActions, rd) + + if (auto chestCompressionData = dynamic_cast(patientActionData); chestCompressionData) { + STOCASTIC_POLYMORPHIC_UNMARSHALL(chestCompressionData, ChestCompressionForce, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(chestCompressionData, ChestCompressionForceScale, PatientActions, rd) + throw biogears::CommonDataModelException("PatientActions:Factory - Unsupported ChestCompression Action Received."); + } + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, ChestOcclusiveDressing, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, ChestTube, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, ConsciousRespiration, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, ConsumeNutrients, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, Exercise, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, Ebola, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, Escharotomy, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, ExampleAction, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, Intubation, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, Infection, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, Fracture, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, Hemorrhage, PatientActions, rd) + POLYMORPHIC_UNMARSHALL(patientActionData, MechanicalVentilation, PatientActions) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, NasalCannula, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, NeedleDecompression, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, Override, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, PainStimulus, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, PatientAssessmentRequest, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, PericardialEffusion, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, PulmonaryShunt, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, RadiationAbsorbedDose, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, TensionPneumothorax, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, Tourniquet, PatientActions, rd) + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, Sleep, PatientActions, rd) + + if (auto substanceAdministrationActionData = dynamic_cast(patientActionData); substanceAdministrationActionData) { + if (auto substanceBolusData = dynamic_cast(substanceAdministrationActionData); substanceBolusData) { auto substance = substances.GetSubstance(substanceBolusData->Substance()); if (substance == nullptr) { throw biogears::CommonDataModelException("PatientActions:Factory - Unknown substance : " + substanceBolusData->Substance()); } auto substanceBolusaction = std::make_unique(*substance); - Scenario::Marshall(*substanceBolusData, *substanceBolusaction); + PatientActions::UnMarshall(*substanceBolusData, *substanceBolusaction, rd); return substanceBolusaction; } - if (auto substanceOralDoseData = dynamic_cast(actionData); substanceOralDoseData) { + if (auto substanceOralDoseData = dynamic_cast(substanceAdministrationActionData); substanceOralDoseData) { auto substance = substances.GetSubstance(substanceOralDoseData->Substance()); if (substance == nullptr) { throw biogears::CommonDataModelException("PatientActions:Factory - Unknown substance : " + substanceOralDoseData->Substance()); } auto od = std::make_unique(*substance); - Scenario::Marshall(*substanceOralDoseData, *od); + PatientActions::UnMarshall(*substanceOralDoseData, *od, rd); return od; } - if (auto substanceNasalDoseData = dynamic_cast(actionData); substanceNasalDoseData) { + if (auto substanceNasalDoseData = dynamic_cast(substanceAdministrationActionData); substanceNasalDoseData) { auto substance = substances.GetSubstance(substanceNasalDoseData->Substance()); if (substance == nullptr) { throw biogears::CommonDataModelException("PatientActions:Factory - Unknown substance : " + substanceNasalDoseData->Substance()); } auto substanceNasalDoseAction = std::make_unique(*substance); - Scenario::Marshall(*substanceNasalDoseData, *substanceNasalDoseAction); + PatientActions::UnMarshall(*substanceNasalDoseData, *substanceNasalDoseAction, rd); return substanceNasalDoseAction; } - if (auto substanceInfusionData = dynamic_cast(actionData); substanceInfusionData) { + if (auto substanceInfusionData = dynamic_cast(substanceAdministrationActionData); substanceInfusionData) { auto substance = substances.GetSubstance(substanceInfusionData->Substance()); if (substance == nullptr) { throw biogears::CommonDataModelException("PatientActions:Factory - Unknown substance : " + substanceInfusionData->Substance()); } auto substanceInfusionAction = std::make_unique(*substance); - Scenario::Marshall(*substanceInfusionData, *substanceInfusionAction); + PatientActions::UnMarshall(*substanceInfusionData, *substanceInfusionAction, rd); return substanceInfusionAction; } - if (auto substanceCompoundInfusionData = dynamic_cast(actionData); substanceCompoundInfusionData) { + if (auto substanceCompoundInfusionData = dynamic_cast(substanceAdministrationActionData); substanceCompoundInfusionData) { auto compound = substances.GetCompound(substanceCompoundInfusionData->SubstanceCompound()); if (compound == nullptr) { throw biogears::CommonDataModelException("PatientActions:Factory - Unknown substance : " + substanceCompoundInfusionData->SubstanceCompound()); } auto substanceCompoundInfusionAction = std::make_unique(*compound); - Scenario::Marshall(*substanceCompoundInfusionData, *substanceCompoundInfusionAction); + PatientActions::UnMarshall(*substanceCompoundInfusionData, *substanceCompoundInfusionAction, rd); return substanceCompoundInfusionAction; } - - POLYMORPHIC_MARSHALL(patientActionData, Urinate, PatientActions) - throw biogears::CommonDataModelException("PatientActions:Factory - Unsupported Patient Action Received."); - } else if (auto anesthesiaMachineActionData = dynamic_cast(actionData); anesthesiaMachineActionData) { - - if (auto AnesthesiaMachineConfigurationData = dynamic_cast(anesthesiaMachineActionData); AnesthesiaMachineConfigurationData) { - auto AnesthesiaMachineConfiguration = std::make_unique(substances); - AnesthesiaActions::Marshall(*AnesthesiaMachineConfigurationData, *AnesthesiaMachineConfiguration); - return std::move(AnesthesiaMachineConfiguration); - } - - POLYMORPHIC_MARSHALL(anesthesiaMachineActionData, OxygenWallPortPressureLoss, AnesthesiaActions) - POLYMORPHIC_MARSHALL(anesthesiaMachineActionData, OxygenTankPressureLoss, AnesthesiaActions) - POLYMORPHIC_MARSHALL(anesthesiaMachineActionData, ExpiratoryValveLeak, AnesthesiaActions) - POLYMORPHIC_MARSHALL(anesthesiaMachineActionData, ExpiratoryValveObstruction, AnesthesiaActions) - POLYMORPHIC_MARSHALL(anesthesiaMachineActionData, InspiratoryValveLeak, AnesthesiaActions) - POLYMORPHIC_MARSHALL(anesthesiaMachineActionData, InspiratoryValveObstruction, AnesthesiaActions) - POLYMORPHIC_MARSHALL(anesthesiaMachineActionData, MaskLeak, AnesthesiaActions) - POLYMORPHIC_MARSHALL(anesthesiaMachineActionData, SodaLimeFailure, AnesthesiaActions) - POLYMORPHIC_MARSHALL(anesthesiaMachineActionData, TubeCuffLeak, AnesthesiaActions) - POLYMORPHIC_MARSHALL(anesthesiaMachineActionData, VaporizerFailure, AnesthesiaActions) - POLYMORPHIC_MARSHALL(anesthesiaMachineActionData, VentilatorPressureLoss, AnesthesiaActions) - POLYMORPHIC_MARSHALL(anesthesiaMachineActionData, YPieceDisconnect, AnesthesiaActions) - throw biogears::CommonDataModelException("PatientActions:Factory - Unsupported Anesthesia Machine Action Received."); - } - - else if (auto inhalerActionData = dynamic_cast(actionData); inhalerActionData) { - if (auto InhalerConfigurationData = dynamic_cast(anesthesiaMachineActionData); InhalerConfigurationData) { - auto InhalerConfiguration = std::make_unique(substances); - InhalerActions::Marshall(*InhalerConfigurationData, *InhalerConfiguration); - return std::move(InhalerConfiguration); - } - throw biogears::CommonDataModelException("PatientActions:Factory - Unsupported Inhaler Action Received."); + throw biogears::CommonDataModelException("PatientActions:Factory - Unsupported SubstanceAdministration Action Received."); } + STOCASTIC_POLYMORPHIC_UNMARSHALL(patientActionData, Urinate, PatientActions, rd) + throw biogears::CommonDataModelException("PatientActions:Factory - Unsupported Patient Action Received."); + throw biogears::CommonDataModelException("PatientActions:Factory - Unsupported Action Received."); } std::unique_ptr PatientActions::factory(const SEPatientAction* patientAction) { - POLYMORPHIC_UNMARSHALL(patientAction, PatientAssessmentRequest) - POLYMORPHIC_UNMARSHALL(patientAction, AcuteRespiratoryDistress) - POLYMORPHIC_UNMARSHALL(patientAction, AcuteStress) - POLYMORPHIC_UNMARSHALL(patientAction, AirwayObstruction) - POLYMORPHIC_UNMARSHALL(patientAction, Apnea) - POLYMORPHIC_UNMARSHALL(patientAction, AsthmaAttack) - POLYMORPHIC_UNMARSHALL(patientAction, BrainInjury) - POLYMORPHIC_UNMARSHALL(patientAction, Bronchoconstriction) - POLYMORPHIC_UNMARSHALL(patientAction, BurnWound) - POLYMORPHIC_UNMARSHALL(patientAction, CardiacArrest) - POLYMORPHIC_UNMARSHALL(patientAction, ChestCompression) - POLYMORPHIC_UNMARSHALL(patientAction, ChestCompressionForce) - POLYMORPHIC_UNMARSHALL(patientAction, ChestCompressionForceScale) - POLYMORPHIC_UNMARSHALL(patientAction, ChestOcclusiveDressing) - POLYMORPHIC_UNMARSHALL(patientAction, Ebola) - POLYMORPHIC_UNMARSHALL(patientAction, Escharotomy) - POLYMORPHIC_UNMARSHALL(patientAction, ConsciousRespiration) - POLYMORPHIC_UNMARSHALL(patientAction, ConsumeNutrients) - POLYMORPHIC_UNMARSHALL(patientAction, Exercise) - POLYMORPHIC_UNMARSHALL(patientAction, Hemorrhage) - POLYMORPHIC_UNMARSHALL(patientAction, Infection) - POLYMORPHIC_UNMARSHALL(patientAction, Intubation) - POLYMORPHIC_UNMARSHALL(patientAction, MechanicalVentilation) - POLYMORPHIC_UNMARSHALL(patientAction, NasalCannula) - POLYMORPHIC_UNMARSHALL(patientAction, NeedleDecompression) - POLYMORPHIC_UNMARSHALL(patientAction, PainStimulus) - POLYMORPHIC_UNMARSHALL(patientAction, PericardialEffusion) - POLYMORPHIC_UNMARSHALL(patientAction, PulmonaryShunt) - POLYMORPHIC_UNMARSHALL(patientAction, RadiationAbsorbedDose) - POLYMORPHIC_UNMARSHALL(patientAction, TensionPneumothorax) - POLYMORPHIC_UNMARSHALL(patientAction, Sleep) - POLYMORPHIC_UNMARSHALL(patientAction, SubstanceAdministration) - POLYMORPHIC_UNMARSHALL(patientAction, SubstanceBolus) - POLYMORPHIC_UNMARSHALL(patientAction, SubstanceCompoundInfusion) - POLYMORPHIC_UNMARSHALL(patientAction, SubstanceInfusion) - POLYMORPHIC_UNMARSHALL(patientAction, SubstanceNasalDose) - POLYMORPHIC_UNMARSHALL(patientAction, SubstanceOralDose) - POLYMORPHIC_UNMARSHALL(patientAction, Tourniquet) - POLYMORPHIC_UNMARSHALL(patientAction, Urinate) - POLYMORPHIC_UNMARSHALL(patientAction, Override) + if (auto PatientAssessmentRequest = dynamic_cast(patientAction); PatientAssessmentRequest) { + auto PatientAssessmentRequestData = std::make_unique(); + Marshall(*PatientAssessmentRequest, *PatientAssessmentRequestData); + return std::move(PatientAssessmentRequestData); + } + POLYMORPHIC_MARSHALL(patientAction, AcuteRespiratoryDistress) + POLYMORPHIC_MARSHALL(patientAction, AcuteStress) + POLYMORPHIC_MARSHALL(patientAction, AirwayObstruction) + POLYMORPHIC_MARSHALL(patientAction, Amputation) + POLYMORPHIC_MARSHALL(patientAction, Apnea) + POLYMORPHIC_MARSHALL(patientAction, AsthmaAttack) + POLYMORPHIC_MARSHALL(patientAction, BrainInjury) + POLYMORPHIC_MARSHALL(patientAction, Bronchoconstriction) + POLYMORPHIC_MARSHALL(patientAction, BurnWound) + POLYMORPHIC_MARSHALL(patientAction, CardiacArrest) + POLYMORPHIC_MARSHALL(patientAction, ChestCompression) + POLYMORPHIC_MARSHALL(patientAction, ChestCompressionForce) + POLYMORPHIC_MARSHALL(patientAction, ChestCompressionForceScale) + POLYMORPHIC_MARSHALL(patientAction, ChestOcclusiveDressing) + POLYMORPHIC_MARSHALL(patientAction, ChestTube) + POLYMORPHIC_MARSHALL(patientAction, Ebola) + POLYMORPHIC_MARSHALL(patientAction, Escharotomy) + POLYMORPHIC_MARSHALL(patientAction, ConsciousRespiration) + POLYMORPHIC_MARSHALL(patientAction, ConsumeNutrients) + POLYMORPHIC_MARSHALL(patientAction, Exercise) + POLYMORPHIC_MARSHALL(patientAction, Fracture) + POLYMORPHIC_MARSHALL(patientAction, Hemorrhage) + POLYMORPHIC_MARSHALL(patientAction, Infection) + POLYMORPHIC_MARSHALL(patientAction, Intubation) + POLYMORPHIC_MARSHALL(patientAction, MechanicalVentilation) + POLYMORPHIC_MARSHALL(patientAction, NasalCannula) + POLYMORPHIC_MARSHALL(patientAction, NeedleDecompression) + POLYMORPHIC_MARSHALL(patientAction, Override) + POLYMORPHIC_MARSHALL(patientAction, PainStimulus) + POLYMORPHIC_MARSHALL(patientAction, PericardialEffusion) + POLYMORPHIC_MARSHALL(patientAction, PulmonaryShunt) + POLYMORPHIC_MARSHALL(patientAction, RadiationAbsorbedDose) + POLYMORPHIC_MARSHALL(patientAction, TensionPneumothorax) + POLYMORPHIC_MARSHALL(patientAction, Tourniquet) + POLYMORPHIC_MARSHALL(patientAction, Sleep) + + if (auto substanceAdministration = dynamic_cast(patientAction); substanceAdministration) { + POLYMORPHIC_MARSHALL(patientAction, SubstanceBolus) + POLYMORPHIC_MARSHALL(patientAction, SubstanceCompoundInfusion) + POLYMORPHIC_MARSHALL(patientAction, SubstanceInfusion) + POLYMORPHIC_MARSHALL(patientAction, SubstanceOralDose) + POLYMORPHIC_MARSHALL(patientAction, SubstanceNasalDose) + } + + POLYMORPHIC_MARSHALL(patientAction, Urinate) throw biogears::CommonDataModelException("InhalerActions::factory does not support the derived SEInhalerAction. If you are not a developer contact upstream for support."); } + void PatientActions::Marshall(const SEPatientActionCollection& in, std::vector>& out) + { + if (in.m_AcuteRespiratoryDistress) { + out.push_back(PatientActions::factory(in.m_AcuteRespiratoryDistress)); + } + if (in.m_AcuteStress) { + out.push_back(PatientActions::factory(in.m_AcuteStress)); + } + if (in.m_ExampleAction) { + out.push_back(PatientActions::factory(in.m_ExampleAction)); + } + if (in.m_AirwayObstruction) { + out.push_back(PatientActions::factory(in.m_AirwayObstruction)); + } + if (in.m_Apnea) { + out.push_back(PatientActions::factory(in.m_Apnea)); + } + if (in.m_AsthmaAttack) { + out.push_back(PatientActions::factory(in.m_AsthmaAttack)); + } + if (in.m_BrainInjury) { + out.push_back(PatientActions::factory(in.m_BrainInjury)); + } + if (in.m_Bronchoconstriction) { + out.push_back(PatientActions::factory(in.m_Bronchoconstriction)); + } + if (in.m_BurnWound) { + out.push_back(PatientActions::factory(in.m_BurnWound)); + } + if (in.m_CardiacArrest) { + out.push_back(PatientActions::factory(in.m_CardiacArrest)); + } + if (in.m_ChestCompression) { + out.push_back(PatientActions::factory(in.m_ChestCompression)); + } + if (in.m_LeftChestOcclusiveDressing) { + out.push_back(PatientActions::factory(in.m_LeftChestOcclusiveDressing)); + } + if (in.m_RightChestOcclusiveDressing) { + out.push_back(PatientActions::factory(in.m_RightChestOcclusiveDressing)); + } + if (in.m_LeftChestTube) { + out.push_back(PatientActions::factory(in.m_LeftChestTube)); + } + if (in.m_RightChestTube) { + out.push_back(PatientActions::factory(in.m_RightChestTube)); + } + if (in.m_ConsciousRespiration) { + out.push_back(PatientActions::factory(in.m_ConsciousRespiration)); + } + if (in.m_ConsumeNutrients) { + out.push_back(PatientActions::factory(in.m_ConsumeNutrients)); + } + if (in.m_Ebola) { + out.push_back(PatientActions::factory(in.m_Ebola)); + } + if (in.m_Exercise) { + out.push_back(PatientActions::factory(in.m_Exercise)); + } + if (in.m_Fracture) { + out.push_back(PatientActions::factory(in.m_Fracture)); + } + if (in.m_Infection) { + out.push_back(PatientActions::factory(in.m_Infection)); + } + if (in.m_Intubation) { + out.push_back(PatientActions::factory(in.m_Intubation)); + } + if (in.m_MechanicalVentilation) { + out.push_back(PatientActions::factory(in.m_MechanicalVentilation)); + } + if (in.m_NasalCannula) { + out.push_back(PatientActions::factory(in.m_NasalCannula)); + } + if (in.m_LeftNeedleDecompression) { + out.push_back(PatientActions::factory(in.m_LeftNeedleDecompression)); + } + if (in.m_RightNeedleDecompression) { + out.push_back(PatientActions::factory(in.m_RightNeedleDecompression)); + } + if (in.m_PericardialEffusion) { + out.push_back(PatientActions::factory(in.m_PericardialEffusion)); + } + if (in.m_PulmonaryShunt) { + out.push_back(PatientActions::factory(in.m_PulmonaryShunt)); + } + if (in.m_RadiationAbsorbedDose) { + out.push_back(PatientActions::factory(in.m_RadiationAbsorbedDose)); + } + if (in.m_Sleep) { + out.push_back(PatientActions::factory(in.m_Sleep)); + } + if (in.m_LeftClosedTensionPneumothorax) { + out.push_back(PatientActions::factory(in.m_LeftClosedTensionPneumothorax)); + } + if (in.m_LeftOpenTensionPneumothorax) { + out.push_back(PatientActions::factory(in.m_LeftOpenTensionPneumothorax)); + } + if (in.m_RightClosedTensionPneumothorax) { + out.push_back(PatientActions::factory(in.m_RightClosedTensionPneumothorax)); + } + if (in.m_RightOpenTensionPneumothorax) { + out.push_back(PatientActions::factory(in.m_RightOpenTensionPneumothorax)); + } + if (in.m_Urinate) { + out.push_back(PatientActions::factory(in.m_Urinate)); + } + if (in.m_OverrideAction) { + out.push_back(PatientActions::factory(in.m_OverrideAction)); + } + + for ( auto&[ key, action ] : in.m_Hemorrhages) { + out.push_back(PatientActions::factory(action)); + } + for (auto& [key, action] : in.m_Amputations) { + out.push_back(PatientActions::factory(action)); + } + for (auto&[ key, action ] : in.m_Tourniquets) { + out.push_back(PatientActions::factory(action)); + } + for (auto&[ key, action ] : in.m_Escharotomies) { + out.push_back(PatientActions::factory(action)); + } + for (auto&[ key, action ] : in.m_PainStimuli) { + out.push_back(PatientActions::factory(action)); + } + for (auto&[ key, action ] : in.m_SubstanceBolus) { + out.push_back(PatientActions::factory(action)); + } + for (auto&[ key, action ] : in.m_SubstanceInfusions) { + out.push_back(PatientActions::factory(action)); + } + for (auto&[ key, action ] : in.m_SubstanceOralDoses) { + out.push_back(PatientActions::factory(action)); + } + for (auto&[ key, action ] : in.m_SubstanceNasalDoses) { + out.push_back(PatientActions::factory(action)); + } + for (auto&[ key, action ] : in.m_SubstanceCompoundInfusions) { + out.push_back(PatientActions::factory(action)); + } + } + //---------------------------------------------------------------------------------- // class SEPatientAction - void PatientActions::Marshall(const CDM::PatientActionData& in, SEPatientAction& out) + void PatientActions::UnMarshall(const CDM::PatientActionData& in, SEPatientAction& out) { - Scenario::Marshall(static_cast(in), static_cast(out)); + Actions::UnMarshall(static_cast(in), static_cast(out)); } - void PatientActions::UnMarshall(const SEPatientAction& in, CDM::PatientActionData& out) + void PatientActions::Marshall(const SEPatientAction& in, CDM::PatientActionData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); + Actions::Marshall(static_cast(in), static_cast(out)); } //---------------------------------------------------------------------------------- // class SEPatientAssessmentRequest - void PatientActions::Marshall(const CDM::PatientAssessmentRequestData& in, SEPatientAssessmentRequest& out) + void PatientActions::UnMarshall(const CDM::PatientAssessmentRequestData& in, SEPatientAssessmentRequest& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - Scenario::Marshall(static_cast(in), static_cast(out)); - - out.m_Type = in.Type(); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); + PatientActions::UnMarshall(in.Type(), out.m_Type); } - void PatientActions::UnMarshall(const SEPatientAssessmentRequest& in, CDM::PatientAssessmentRequestData& out) + void PatientActions::Marshall(const SEPatientAssessmentRequest& in, CDM::PatientAssessmentRequestData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - if (in.HasType()) { - out.Type(in.m_Type); - } + PatientActions::Marshall(static_cast(in), static_cast(out)); + SE_PATIENT_ACTIONS_ENUM_PTR_MARSHALL_HELPER(in, out, Type) } // class SEAcuteRespiratoryDistressStress; - void PatientActions::Marshall(const CDM::AcuteRespiratoryDistressData& in, SEAcuteRespiratoryDistress& out) + void PatientActions::UnMarshall(const CDM::AcuteRespiratoryDistressData& in, SEAcuteRespiratoryDistress& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - Scenario::Marshall(static_cast(in), static_cast(out)); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.Severity(), out.GetSeverity()); + io::Property::UnMarshall(in.Severity(), out.GetSeverity(), rd); } - void PatientActions::UnMarshall(const SEAcuteRespiratoryDistress& in, CDM::AcuteRespiratoryDistressData& out) + void PatientActions::Marshall(const SEAcuteRespiratoryDistress& in, CDM::AcuteRespiratoryDistressData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Severity) + PatientActions::Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Severity) } //---------------------------------------------------------------------------------- // class SEAcuteStress - void PatientActions::Marshall(const CDM::AcuteStressData& in, SEAcuteStress& out) + void PatientActions::UnMarshall(const CDM::AcuteStressData& in, SEAcuteStress& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - Scenario::Marshall(static_cast(in), static_cast(out)); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.Severity(), out.GetSeverity()); + io::Property::UnMarshall(in.Severity(), out.GetSeverity(), rd); } - void PatientActions::UnMarshall(const SEAcuteStress& in, CDM::AcuteStressData& out) + void PatientActions::Marshall(const SEAcuteStress& in, CDM::AcuteStressData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Severity) + PatientActions::Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Severity) } //---------------------------------------------------------------------------------- // class SEExampleAction - void PatientActions::Marshall(const CDM::ExampleActionData& in, SEExampleAction& out) + void PatientActions::UnMarshall(const CDM::ExampleActionData& in, SEExampleAction& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - Scenario::Marshall(static_cast(in), static_cast(out)); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.Severity(), out.GetSeverity()); + io::Property::UnMarshall(in.Severity(), out.GetSeverity(), rd); } - void PatientActions::UnMarshall(const SEExampleAction& in, CDM::ExampleActionData& out) + void PatientActions::Marshall(const SEExampleAction& in, CDM::ExampleActionData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Severity) + PatientActions::Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Severity) } //---------------------------------------------------------------------------------- // class SEAirwayObstruction - void PatientActions::Marshall(const CDM::AirwayObstructionData& in, SEAirwayObstruction& out) + void PatientActions::UnMarshall(const CDM::AirwayObstructionData& in, SEAirwayObstruction& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - Scenario::Marshall(static_cast(in), static_cast(out)); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.Severity(), out.GetSeverity()); + io::Property::UnMarshall(in.Severity(), out.GetSeverity(), rd); } - void PatientActions::UnMarshall(const SEAirwayObstruction& in, CDM::AirwayObstructionData& out) + void PatientActions::Marshall(const SEAirwayObstruction& in, CDM::AirwayObstructionData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Severity) + PatientActions::Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Severity) } //---------------------------------------------------------------------------------- // class SEApnea - void PatientActions::Marshall(const CDM::ApneaData& in, SEApnea& out) + void PatientActions::UnMarshall(const CDM::ApneaData& in, SEApnea& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - Scenario::Marshall(static_cast(in), static_cast(out)); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.Severity(), out.GetSeverity()); + io::Property::UnMarshall(in.Severity(), out.GetSeverity(), rd); } - void PatientActions::UnMarshall(const SEApnea& in, CDM::ApneaData& out) + void PatientActions::Marshall(const SEApnea& in, CDM::ApneaData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Severity) + PatientActions::Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Severity) } //---------------------------------------------------------------------------------- // class SEAsthmaAttack - void PatientActions::Marshall(const CDM::AsthmaAttackData& in, SEAsthmaAttack& out) + void PatientActions::UnMarshall(const CDM::AsthmaAttackData& in, SEAsthmaAttack& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - Scenario::Marshall(static_cast(in), static_cast(out)); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.Severity(), out.GetSeverity()); + io::Property::UnMarshall(in.Severity(), out.GetSeverity(), rd); } - void PatientActions::UnMarshall(const SEAsthmaAttack& in, CDM::AsthmaAttackData& out) + void PatientActions::Marshall(const SEAsthmaAttack& in, CDM::AsthmaAttackData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Severity) + PatientActions::Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Severity) } //---------------------------------------------------------------------------------- // class SEBrainInjury - void PatientActions::Marshall(const CDM::BrainInjuryData& in, SEBrainInjury& out) + void PatientActions::UnMarshall(const CDM::BrainInjuryData& in, SEBrainInjury& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - Scenario::Marshall(static_cast(in), static_cast(out)); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.Severity(), out.GetSeverity()); - out.m_Type = in.Type(); + io::Property::UnMarshall(in.Severity(), out.GetSeverity(), rd); + io::PatientActions::UnMarshall(in.Type(), out.m_Type); } - void PatientActions::UnMarshall(const SEBrainInjury& in, CDM::BrainInjuryData& out) + void PatientActions::Marshall(const SEBrainInjury& in, CDM::BrainInjuryData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Severity) - CDM_ENUM_UNMARSHAL_HELPER(in, out, Type) + PatientActions::Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Severity) + SE_PATIENT_ACTIONS_ENUM_PTR_MARSHALL_HELPER(in, out, Type) } //---------------------------------------------------------------------------------- // class SEBronchoconstriction - void PatientActions::Marshall(const CDM::BronchoconstrictionData& in, SEBronchoconstriction& out) + void PatientActions::UnMarshall(const CDM::BronchoconstrictionData& in, SEBronchoconstriction& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - Scenario::Marshall(static_cast(in), static_cast(out)); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.Severity(), out.GetSeverity()); + io::Property::UnMarshall(in.Severity(), out.GetSeverity(), rd); } - void PatientActions::UnMarshall(const SEBronchoconstriction& in, CDM::BronchoconstrictionData& out) + void PatientActions::Marshall(const SEBronchoconstriction& in, CDM::BronchoconstrictionData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Severity) + PatientActions::Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Severity) } //---------------------------------------------------------------------------------- // class SEBurnWound - void PatientActions::Marshall(const CDM::BurnWoundData& in, SEBurnWound& out) + void PatientActions::UnMarshall(const CDM::BurnWoundData& in, SEBurnWound& out, std::default_random_engine* rd) { - //TODO: UPDATE TO SUPPORT NEW MEMBERS - out.Clear(); + // TODO: UPDATE TO SUPPORT NEW MEMBERS + out.Invalidate(); - Scenario::Marshall(static_cast(in), static_cast(out)); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); out.SetTotalBodySurfaceArea(in.TotalBodySurfaceArea().value()); @@ -476,12 +581,12 @@ namespace io { out.m_compartmentsAffected.push_back(compData); } } - void PatientActions::UnMarshall(const SEBurnWound& in, CDM::BurnWoundData& out) + void PatientActions::Marshall(const SEBurnWound& in, CDM::BurnWoundData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); + PatientActions::Marshall(static_cast(in), static_cast(out)); if (in.m_TBSA != nullptr) { out.TotalBodySurfaceArea(std::make_unique()); - io::Property::UnMarshall(*in.m_TBSA, out.TotalBodySurfaceArea()); + io::Property::Marshall(*in.m_TBSA, out.TotalBodySurfaceArea()); } if (!in.m_compartmentsAffected.empty()) { for (std::string compData : in.m_compartmentsAffected) { @@ -491,189 +596,211 @@ namespace io { } //---------------------------------------------------------------------------------- // class SECardiacArrest - void PatientActions::Marshall(const CDM::CardiacArrestData& in, SECardiacArrest& out) + void PatientActions::UnMarshall(const CDM::CardiacArrestData& in, SECardiacArrest& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - Scenario::Marshall(static_cast(in), static_cast(out)); - - out.m_State = in.State(); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); + Property::UnMarshall(in.State(), out.m_State); } - void PatientActions::UnMarshall(const SECardiacArrest& in, CDM::CardiacArrestData& out) + void PatientActions::Marshall(const SECardiacArrest& in, CDM::CardiacArrestData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - out.State(in.m_State); + PatientActions::Marshall(static_cast(in), static_cast(out)); + out.State(std::make_unique::type>()); + Property::Marshall(in.m_State, out.State()); } //---------------------------------------------------------------------------------- // class SEChestCompression - void PatientActions::Marshall(const CDM::ChestCompressionData& in, SEChestCompression& out) + void PatientActions::UnMarshall(const CDM::ChestCompressionData& in, SEChestCompression& out) { - out.Clear(); + out.Invalidate(); - Scenario::Marshall(static_cast(in), static_cast(out)); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); } - void PatientActions::UnMarshall(const SEChestCompression& in, CDM::ChestCompressionData& out) + void PatientActions::Marshall(const SEChestCompression& in, CDM::ChestCompressionData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); + PatientActions::Marshall(static_cast(in), static_cast(out)); } //---------------------------------------------------------------------------------- // class SEChestCompressionForce - void PatientActions::Marshall(const CDM::ChestCompressionForceData& in, SEChestCompressionForce& out) + void PatientActions::UnMarshall(const CDM::ChestCompressionForceData& in, SEChestCompressionForce& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - Scenario::Marshall(static_cast(in), static_cast(out)); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.Force(), out.GetForce()); + io::Property::UnMarshall(in.Force(), out.GetForce(), rd); } - void PatientActions::UnMarshall(const SEChestCompressionForce& in, CDM::ChestCompressionForceData& out) + void PatientActions::Marshall(const SEChestCompressionForce& in, CDM::ChestCompressionForceData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Force) + PatientActions::Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Force) } //---------------------------------------------------------------------------------- // class SEChestCompressionForceScale - void PatientActions::Marshall(const CDM::ChestCompressionForceScaleData& in, SEChestCompressionForceScale& out) + void PatientActions::UnMarshall(const CDM::ChestCompressionForceScaleData& in, SEChestCompressionForceScale& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - Scenario::Marshall(static_cast(in), static_cast(out)); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.ForceScale(), out.GetForceScale()); + io::Property::UnMarshall(in.ForceScale(), out.GetForceScale(), rd); if (in.ForcePeriod().present()) { - io::Property::Marshall(in.ForcePeriod(), out.GetForcePeriod()); + io::Property::UnMarshall(in.ForcePeriod(), out.GetForcePeriod(), rd); } } - void PatientActions::UnMarshall(const SEChestCompressionForceScale& in, CDM::ChestCompressionForceScaleData& out) + void PatientActions::Marshall(const SEChestCompressionForceScale& in, CDM::ChestCompressionForceScaleData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, ForceScale) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ForcePeriod) + PatientActions::Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, ForceScale) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ForcePeriod) } //---------------------------------------------------------------------------------- // class SEChestOcclusiveDressing - void PatientActions::Marshall(const CDM::ChestOcclusiveDressingData& in, SEChestOcclusiveDressing& out) + void PatientActions::UnMarshall(const CDM::ChestOcclusiveDressingData& in, SEChestOcclusiveDressing& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - Scenario::Marshall(static_cast(in), static_cast(out)); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); - out.m_Side = in.Side(); - out.m_State = in.State(); + Property::UnMarshall(in.Side(), out.m_Side); + Property::UnMarshall(in.State(), out.m_State); } - void PatientActions::UnMarshall(const SEChestOcclusiveDressing& in, CDM::ChestOcclusiveDressingData& out) + void PatientActions::Marshall(const SEChestOcclusiveDressing& in, CDM::ChestOcclusiveDressingData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - out.State(in.m_State); - CDM_ENUM_UNMARSHAL_HELPER(in, out, Side) + PatientActions::Marshall(static_cast(in), static_cast(out)); + out.State(std::make_unique::type>()); + + out.State(std::make_unique::type>()); + io::Property::Marshall(in.m_State, out.State()); + + SE_PROPERTY_ENUM_PTR_MARSHALL_HELPER(in, out, Side) + } + //---------------------------------------------------------------------------------- + // class SEChestTube + void PatientActions::UnMarshall(const CDM::ChestTubeData& in, SEChestTube& out, std::default_random_engine* rd) + { + out.Invalidate(); + + PatientActions::UnMarshall(static_cast(in), static_cast(out)); + ; + Property::UnMarshall(in.Side(), out.m_Side); + Property::UnMarshall(in.State(), out.m_State); + } + void PatientActions::Marshall(const SEChestTube& in, CDM::ChestTubeData& out) + { + PatientActions::Marshall(static_cast(in), static_cast(out)); + out.State(std::make_unique::type>()); + Property::Marshall(in.m_State, out.State()); + + SE_PROPERTY_ENUM_PTR_MARSHALL_HELPER(in, out, Side) } //---------------------------------------------------------------------------------- // class SEConsciousRespirationCommand - void PatientActions::Marshall(const CDM::ConsciousRespirationCommandData& in, SEConsciousRespirationCommand& out) + void PatientActions::UnMarshall(const CDM::ConsciousRespirationCommandData& in, SEConsciousRespirationCommand& out) { - out.Clear(); + out.Invalidate(); if (in.Comment().present()) { out.m_Comment = in.Comment().get(); } } - void PatientActions::UnMarshall(const SEConsciousRespirationCommand& in, CDM::ConsciousRespirationCommandData& out) + void PatientActions::Marshall(const SEConsciousRespirationCommand& in, CDM::ConsciousRespirationCommandData& out) { out.Comment(in.m_Comment); } //---------------------------------------------------------------------------------- // class SEEbola - void PatientActions::Marshall(const CDM::EbolaData& in, SEEbola& out) + void PatientActions::UnMarshall(const CDM::EbolaData& in, SEEbola& out, std::default_random_engine* rd) { - out.Clear(); - - Scenario::Marshall(static_cast(in), static_cast(out)); + out.Invalidate(); - out.m_Severity = in.Severity(); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); + PatientActions::UnMarshall(in.Severity(), out.m_Severity); } - void PatientActions::UnMarshall(const SEEbola& in, CDM::EbolaData& out) + void PatientActions::Marshall(const SEEbola& in, CDM::EbolaData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_ENUM_UNMARSHAL_HELPER(in, out, Severity) + PatientActions::Marshall(static_cast(in), static_cast(out)); + SE_PATIENT_ACTIONS_ENUM_PTR_MARSHALL_HELPER(in, out, Severity) } //---------------------------------------------------------------------------------- // class SEEscharotomy - void PatientActions::Marshall(const CDM::EscharotomyData& in, SEEscharotomy& out) + void PatientActions::UnMarshall(const CDM::EscharotomyData& in, SEEscharotomy& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - Scenario::Marshall(static_cast(in), static_cast(out)); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); out.m_Location = in.Location(); } - void PatientActions::UnMarshall(const SEEscharotomy& in, CDM::EscharotomyData& out) + void PatientActions::Marshall(const SEEscharotomy& in, CDM::EscharotomyData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); + PatientActions::Marshall(static_cast(in), static_cast(out)); out.Location(in.m_Location); } //---------------------------------------------------------------------------------- // class SEForcedInhale - void PatientActions::Marshall(const CDM::ForcedInhaleData& in, SEForcedInhale& out) + void PatientActions::UnMarshall(const CDM::ForcedInhaleData& in, SEForcedInhale& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - PatientActions::Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.InspiratoryCapacityFraction(), out.GetInspiratoryCapacityFraction()); - io::Property::Marshall(in.Period(), out.GetPeriod()); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.InspiratoryCapacityFraction(), out.GetInspiratoryCapacityFraction(), rd); + io::Property::UnMarshall(in.Period(), out.GetPeriod(), rd); } - void PatientActions::UnMarshall(const SEForcedInhale& in, CDM::ForcedInhaleData& out) + void PatientActions::Marshall(const SEForcedInhale& in, CDM::ForcedInhaleData& out) { - PatientActions::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Period) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, InspiratoryCapacityFraction) + PatientActions::Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Period) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, InspiratoryCapacityFraction) } //---------------------------------------------------------------------------------- // class SEForcedExhale - void PatientActions::Marshall(const CDM::ForcedExhaleData& in, SEForcedExhale& out) + void PatientActions::UnMarshall(const CDM::ForcedExhaleData& in, SEForcedExhale& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - PatientActions::Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.ExpiratoryReserveVolumeFraction(), out.GetExpiratoryReserveVolumeFraction()); - io::Property::Marshall(in.Period(), out.GetPeriod()); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.ExpiratoryReserveVolumeFraction(), out.GetExpiratoryReserveVolumeFraction(), rd); + io::Property::UnMarshall(in.Period(), out.GetPeriod(), rd); } - void PatientActions::UnMarshall(const SEForcedExhale& in, CDM::ForcedExhaleData& out) + void PatientActions::Marshall(const SEForcedExhale& in, CDM::ForcedExhaleData& out) { - PatientActions::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Period) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, ExpiratoryReserveVolumeFraction) + PatientActions::Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Period) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, ExpiratoryReserveVolumeFraction) } //---------------------------------------------------------------------------------- // class SEBreathHold - void PatientActions::Marshall(const CDM::BreathHoldData& in, SEBreathHold& out) + void PatientActions::UnMarshall(const CDM::BreathHoldData& in, SEBreathHold& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - PatientActions::Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.Period(), out.GetPeriod()); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.Period(), out.GetPeriod(), rd); } - void PatientActions::UnMarshall(const SEBreathHold& in, CDM::BreathHoldData& out) + void PatientActions::Marshall(const SEBreathHold& in, CDM::BreathHoldData& out) { - PatientActions::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Period) + PatientActions::Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Period) } //---------------------------------------------------------------------------------- // class SEUseInhaler - void PatientActions::Marshall(const CDM::UseInhalerData& in, SEUseInhaler& out) + void PatientActions::UnMarshall(const CDM::UseInhalerData& in, SEUseInhaler& out, std::default_random_engine* rd) { - out.Clear(); - PatientActions::Marshall(static_cast(in), static_cast(out)); + out.Invalidate(); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); } - void PatientActions::UnMarshall(const SEUseInhaler& in, CDM::UseInhalerData& out) + void PatientActions::Marshall(const SEUseInhaler& in, CDM::UseInhalerData& out) { - PatientActions::UnMarshall(static_cast(in), static_cast(out)); + PatientActions::Marshall(static_cast(in), static_cast(out)); } //---------------------------------------------------------------------------------- // class SEConsciousRespiration - void PatientActions::Marshall(const CDM::ConsciousRespirationData& in, SEConsciousRespiration& out) + void PatientActions::UnMarshall(const CDM::ConsciousRespirationData& in, SEConsciousRespiration& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - PatientActions::Marshall(static_cast(in), static_cast(out)); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); // Set this before our super class tells us to Clear if the action wants us to keep our current data out.m_ClearCommands = !in.AppendToPrevious(); out.m_ClearCommands = true; @@ -683,248 +810,286 @@ namespace io { CDM::BreathHoldData* bh = dynamic_cast(command); if (bh != nullptr) { - PatientActions::Marshall(*bh, out.AddBreathHold()); + PatientActions::UnMarshall(*bh, out.AddBreathHold()); continue; } CDM::ForcedInhaleData* fi = dynamic_cast(command); if (fi != nullptr) { - PatientActions::Marshall(*fi, out.AddForcedInhale()); + PatientActions::UnMarshall(*fi, out.AddForcedInhale()); continue; } CDM::ForcedExhaleData* fe = dynamic_cast(command); if (fe != nullptr) { - PatientActions::Marshall(*fe, out.AddForcedExhale()); + PatientActions::UnMarshall(*fe, out.AddForcedExhale()); continue; } CDM::UseInhalerData* si = dynamic_cast(command); if (si != nullptr) { - PatientActions::Marshall(*si, out.AddUseInhaler()); + PatientActions::UnMarshall(*si, out.AddUseInhaler()); continue; } } } - void PatientActions::UnMarshall(const SEConsciousRespiration& in, CDM::ConsciousRespirationData& out) + void PatientActions::Marshall(const SEConsciousRespiration& in, CDM::ConsciousRespirationData& out) { - PatientActions::UnMarshall(static_cast(in), static_cast(out)); + PatientActions::Marshall(static_cast(in), static_cast(out)); out.AppendToPrevious(false); for (SEConsciousRespirationCommand* cmd : in.m_Commands) { - auto cmdData = std::unique_ptr(); - PatientActions::UnMarshall(*cmd, *cmdData); + auto cmdData = std::make_unique(); + PatientActions::Marshall(*cmd, *cmdData); out.Command().push_back(std::move(cmdData)); } } //---------------------------------------------------------------------------------- // class SEConsumeNutrients - void PatientActions::Marshall(const CDM::ConsumeNutrientsData& in, SEConsumeNutrients& out) + void PatientActions::UnMarshall(const CDM::ConsumeNutrientsData& in, SEConsumeNutrients& out, std::default_random_engine* rd) { - out.Clear(); - PatientActions::Marshall(static_cast(in), static_cast(out)); + out.Invalidate(); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); if (in.Nutrition().present()) { - out.GetNutrition().Load(in.Nutrition().get()); + io::PatientNutrition::UnMarshall(in.Nutrition(), out.GetNutrition()); } else if (in.NutritionFile().present()) { out.SetNutritionFile(in.NutritionFile().get()); } } - void PatientActions::UnMarshall(const SEConsumeNutrients& in, CDM::ConsumeNutrientsData& out) + void PatientActions::Marshall(const SEConsumeNutrients& in, CDM::ConsumeNutrientsData& out) { - PatientActions::UnMarshall(static_cast(in), static_cast(out)); - CDM_OPTIONAL_PATIENT_NUTRITION_UNMARSHAL_HELPER(in, out, Nutrition) + PatientActions::Marshall(static_cast(in), static_cast(out)); + CDM_OPTIONAL_PATIENT_NUTRITION_PTR_MARSHALL_HELPER(in, out, Nutrition) out.NutritionFile(in.m_NutritionFile); } //---------------------------------------------------------------------------------- // class SEExercise - void Marshall(const CDM::GenericExerciseData& in, SEExercise::SEGeneric& out) + void UnMarshall(const CDM::GenericExerciseData& in, SEExercise::SEGeneric& out, std::default_random_engine* rd) { - io::Property::Marshall(in.Intensity(), out.Intensity); - io::Property::Marshall(in.DesiredWorkRate(), out.DesiredWorkRate); + io::Property::UnMarshall(in.Intensity(), out.Intensity, rd); + io::Property::UnMarshall(in.DesiredWorkRate(), out.DesiredWorkRate, rd); } - void Marshall(const CDM::CyclingExerciseData& in, SEExercise::SECycling& out) + void UnMarshall(const CDM::CyclingExerciseData& in, SEExercise::SECycling& out, std::default_random_engine* rd) { - io::Property::Marshall(in.Cadence(), out.CadenceCycle); - io::Property::Marshall(in.Power(), out.PowerCycle); + io::Property::UnMarshall(in.Cadence(), out.CadenceCycle, rd); + io::Property::UnMarshall(in.Power(), out.PowerCycle, rd); if (in.AddedWeight().present()) { - io::Property::Marshall(in.AddedWeight().get(), out.AddedWeight); + io::Property::UnMarshall(in.AddedWeight().get(), out.AddedWeight, rd); } else { out.AddedWeight.SetValue(0, MassUnit::kg); } } - void Marshall(const CDM::RunningExerciseData& in, SEExercise::SERunning& out) + void UnMarshall(const CDM::RunningExerciseData& in, SEExercise::SERunning& out, std::default_random_engine* rd) { - io::Property::Marshall(in.Speed(), out.SpeedRun); - io::Property::Marshall(in.Incline(), out.InclineRun); + io::Property::UnMarshall(in.Speed(), out.SpeedRun, rd); + io::Property::UnMarshall(in.Incline(), out.InclineRun, rd); if (in.AddedWeight().present()) { - io::Property::Marshall(in.AddedWeight().get(), out.AddedWeight); + io::Property::UnMarshall(in.AddedWeight().get(), out.AddedWeight, rd); } else { out.AddedWeight.SetValue(0, MassUnit::kg); } } - void Marshall(const CDM::StrengthExerciseData& in, SEExercise::SEStrengthTraining& out) + void UnMarshall(const CDM::StrengthExerciseData& in, SEExercise::SEStrengthTraining& out, std::default_random_engine* rd) { - io::Property::Marshall(in.Weight(), out.WeightStrength); - io::Property::Marshall(in.Repetitions(), out.RepsStrength); + io::Property::UnMarshall(in.Weight(), out.WeightStrength, rd); + io::Property::UnMarshall(in.Repetitions(), out.RepsStrength, rd); } - void PatientActions::Marshall(const CDM::ExerciseData& in, SEExercise& out) + void PatientActions::UnMarshall(const CDM::ExerciseData& in, SEExercise& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - Scenario::Marshall(static_cast(in), static_cast(out)); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); if (in.GenericExercise().present()) { out.m_mode = SEExercise::ExerciseType ::GENERIC; - io::Marshall(in.GenericExercise().get(), out.GetGenericExercise()); + io::UnMarshall(in.GenericExercise().get(), out.GetGenericExercise(), rd); } if (in.CyclingExercise().present()) { out.m_mode = SEExercise::ExerciseType ::CYCLING; - io::Marshall(in.CyclingExercise().get(), out.GetCyclingExercise()); + io::UnMarshall(in.CyclingExercise().get(), out.GetCyclingExercise(), rd); } if (in.RunningExercise().present()) { out.m_mode = SEExercise::ExerciseType ::RUNNING; - io::Marshall(in.RunningExercise().get(), out.GetRunningExercise()); + io::UnMarshall(in.RunningExercise().get(), out.GetRunningExercise(), rd); } if (in.StrengthExercise().present()) { out.m_mode = SEExercise::ExerciseType ::STRENGTH_TRAINING; - io::Marshall(in.StrengthExercise().get(), out.GetStrengthExercise()); + io::UnMarshall(in.StrengthExercise().get(), out.GetStrengthExercise(), rd); } } //---------------------------------------------------------------------------------- - void UnMarshall(const SEExercise::SEGeneric& in, CDM::GenericExerciseData& out) + void Marshall(const SEExercise::SEGeneric& in, CDM::GenericExerciseData& out) { if (in.Intensity.IsValid()) { - io::Property::UnMarshall(in.Intensity, out.Intensity()); + io::Property::Marshall(in.Intensity, out.Intensity()); } if (in.DesiredWorkRate.IsValid()) { - io::Property::UnMarshall(in.DesiredWorkRate, out.DesiredWorkRate()); + io::Property::Marshall(in.DesiredWorkRate, out.DesiredWorkRate()); } } - void UnMarshall(const SEExercise::SECycling& in, CDM::CyclingExerciseData& out) + void Marshall(const SEExercise::SECycling& in, CDM::CyclingExerciseData& out) { out.Cadence(std::make_unique()); out.Power(std::make_unique()); - io::Property::UnMarshall(in.CadenceCycle, out.Cadence()); - io::Property::UnMarshall(in.PowerCycle, out.Power()); + io::Property::Marshall(in.CadenceCycle, out.Cadence()); + io::Property::Marshall(in.PowerCycle, out.Power()); if (in.AddedWeight.IsValid()) { - io::Property::UnMarshall(in.AddedWeight, out.AddedWeight()); + io::Property::Marshall(in.AddedWeight, out.AddedWeight()); } } - void UnMarshall(const SEExercise::SERunning& in, CDM::RunningExerciseData& out) + void Marshall(const SEExercise::SERunning& in, CDM::RunningExerciseData& out) { out.Speed(std::make_unique()); out.Incline(std::make_unique()); - io::Property::UnMarshall(in.SpeedRun, out.Speed()); - io::Property::UnMarshall(in.InclineRun, out.Incline()); + io::Property::Marshall(in.SpeedRun, out.Speed()); + io::Property::Marshall(in.InclineRun, out.Incline()); if (in.AddedWeight.IsValid()) { - io::Property::UnMarshall(in.AddedWeight, out.AddedWeight()); + io::Property::Marshall(in.AddedWeight, out.AddedWeight()); } } - void UnMarshall(const SEExercise::SEStrengthTraining& in, CDM::StrengthExerciseData& out) + void Marshall(const SEExercise::SEStrengthTraining& in, CDM::StrengthExerciseData& out) { out.Weight(std::make_unique()); out.Repetitions(std::make_unique()); - io::Property::UnMarshall(in.WeightStrength, out.Weight()); - io::Property::UnMarshall(in.RepsStrength, out.Repetitions()); + io::Property::Marshall(in.WeightStrength, out.Weight()); + io::Property::Marshall(in.RepsStrength, out.Repetitions()); } - void PatientActions::UnMarshall(const SEExercise& in, CDM::ExerciseData& out) + void PatientActions::Marshall(const SEExercise& in, CDM::ExerciseData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); + PatientActions::Marshall(static_cast(in), static_cast(out)); if (in.HasGenericExercise()) { auto item = std::make_unique(); - io::UnMarshall(in.m_genericExercise, *item); + io::Marshall(in.m_genericExercise, *item); out.GenericExercise(std::move(item)); } if (in.HasCyclingExercise()) { auto item = std::make_unique(); - io::UnMarshall(in.m_cyclingExercise, *item); + io::Marshall(in.m_cyclingExercise, *item); out.CyclingExercise(std::move(item)); } if (in.HasRunningExercise()) { auto item = std::make_unique(); - io::UnMarshall(in.m_runningExercise, *item); + io::Marshall(in.m_runningExercise, *item); out.RunningExercise(std::move(item)); } if (in.HasStrengthExercise()) { auto item = std::make_unique(); - io::UnMarshall(in.m_strengthExercise, *item); + io::Marshall(in.m_strengthExercise, *item); out.StrengthExercise(std::move(item)); } } //---------------------------------------------------------------------------------- + // class SEFracture + void PatientActions::UnMarshall(const CDM::FractureData& in, SEFracture& out, std::default_random_engine* rd) + { + out.Invalidate(); + + PatientActions::UnMarshall(static_cast(in), static_cast(out)); + + io::PatientActions::UnMarshall(in.FracturedBone(), out.m_FracturedBone); + io::Property::UnMarshall(in.Side(), out.m_Side); + io::PatientActions::UnMarshall(in.FractureType(), out.m_FractureType); + io::Property::UnMarshall(in.Severity(), out.GetSeverity(), rd); + } + void PatientActions::Marshall(const SEFracture& in, CDM::FractureData& out) + { + PatientActions::Marshall(static_cast(in), static_cast(out)); + SE_PATIENT_ACTIONS_ENUM_PTR_MARSHALL_HELPER(in, out, FracturedBone) + SE_PATIENT_ACTIONS_ENUM_PTR_MARSHALL_HELPER(in, out, FractureType) + + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Severity) + + SE_PROPERTY_ENUM_PTR_MARSHALL_HELPER(in, out, Side) + } + //---------------------------------------------------------------------------------- // class SEHemorrhage - void PatientActions::Marshall(const CDM::HemorrhageData& in, SEHemorrhage& out) + void PatientActions::UnMarshall(const CDM::HemorrhageData& in, SEHemorrhage& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - Scenario::Marshall(static_cast(in), static_cast(out)); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); out.m_Compartment = in.Compartment(); - io::Property::Marshall(in.InitialRate(), out.GetInitialRate()); - io::Property::Marshall(in.BleedResistance(), out.GetBleedResistance()); + io::Property::UnMarshall(in.InitialRate(), out.GetInitialRate(), rd); + io::Property::UnMarshall(in.BleedResistance(), out.GetBleedResistance(), rd); out.SetMCIS(); } - void PatientActions::UnMarshall(const SEHemorrhage& in, CDM::HemorrhageData& out) + void PatientActions::Marshall(const SEHemorrhage& in, CDM::HemorrhageData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); + PatientActions::Marshall(static_cast(in), static_cast(out)); + out.Compartment(in.m_Compartment); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, InitialRate) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, BleedResistance) + } + //---------------------------------------------------------------------------------- +// class SEAmputation + void PatientActions::UnMarshall(const CDM::AmputationData& in, SEAmputation& out, std::default_random_engine* rd) + { + out.Invalidate(); + + PatientActions::UnMarshall(static_cast(in), static_cast(out)); + + out.m_Compartment = in.Compartment(); + + } + void PatientActions::Marshall(const SEAmputation& in, CDM::AmputationData& out) + { + PatientActions::Marshall(static_cast(in), static_cast(out)); out.Compartment(in.m_Compartment); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, InitialRate) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, BleedResistance) } //---------------------------------------------------------------------------------- // class SEInfection - void PatientActions::Marshall(const CDM::InfectionData& in, SEInfection& out) + void PatientActions::UnMarshall(const CDM::InfectionData& in, SEInfection& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - Scenario::Marshall(static_cast(in), static_cast(out)); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); out.m_Location = in.Location(); - out.m_Severity = in.Severity(); - io::Property::Marshall(in.MinimumInhibitoryConcentration(), out.GetMinimumInhibitoryConcentration()); + io::PatientActions::UnMarshall(in.Severity(), out.m_Severity); + io::Property::UnMarshall(in.MinimumInhibitoryConcentration(), out.GetMinimumInhibitoryConcentration(), rd); } - void PatientActions::UnMarshall(const SEInfection& in, CDM::InfectionData& out) + void PatientActions::Marshall(const SEInfection& in, CDM::InfectionData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); + PatientActions::Marshall(static_cast(in), static_cast(out)); out.Location(in.GetLocation()); - CDM_ENUM_UNMARSHAL_HELPER(in, out, Severity) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, MinimumInhibitoryConcentration) + SE_PATIENT_ACTIONS_ENUM_PTR_MARSHALL_HELPER(in, out, Severity) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, MinimumInhibitoryConcentration) } //---------------------------------------------------------------------------------- // class SEIntubation - void PatientActions::Marshall(const CDM::IntubationData& in, SEIntubation& out) + void PatientActions::UnMarshall(const CDM::IntubationData& in, SEIntubation& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - Scenario::Marshall(static_cast(in), static_cast(out)); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); - out.m_Type = in.Type(); + io::PatientActions::UnMarshall(in.Type(), out.m_Type); } - void PatientActions::UnMarshall(const SEIntubation& in, CDM::IntubationData& out) + void PatientActions::Marshall(const SEIntubation& in, CDM::IntubationData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_ENUM_UNMARSHAL_HELPER(in, out, Type) + PatientActions::Marshall(static_cast(in), static_cast(out)); + SE_PATIENT_ACTIONS_ENUM_PTR_MARSHALL_HELPER(in, out, Type) } //---------------------------------------------------------------------------------- // class SEMechanicalVentilation - void PatientActions::Marshall(const CDM::MechanicalVentilationData& in, const SESubstanceManager& substances, SEMechanicalVentilation& out) + void PatientActions::UnMarshall(const CDM::MechanicalVentilationData& in, const SESubstanceManager& substances, SEMechanicalVentilation& out, std::default_random_engine* rd) { - out.Clear(); - - Scenario::Marshall(static_cast(in), static_cast(out)); + out.Invalidate(); - out.SetState(in.State()); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); + Property::UnMarshall(in.State(), out.m_State); if (in.Flow().present()) { - io::Property::Marshall(in.Flow(), out.GetFlow()); + io::Property::UnMarshall(in.Flow(), out.GetFlow(), rd); } else { out.GetFlow().Invalidate(); } if (in.Pressure().present()) { - io::Property::Marshall(in.Pressure(), out.GetPressure()); + io::Property::UnMarshall(in.Pressure(), out.GetPressure(), rd); } else { out.GetPressure().Invalidate(); } @@ -937,669 +1102,1333 @@ namespace io { if (sub == nullptr) { throw CommonDataModelException("Substance not found : " + sfData.Name()); } - if (sub->GetState() != CDM::enumSubstanceState::Gas) { + if (sub->GetState() != SESubstanceState::Gas) { throw CommonDataModelException("Substance not gas : " + sfData.Name()); } auto subFrac = std::make_unique(*sub); - subFrac->Load(sfData); + io::Substance::UnMarshall(sfData, *subFrac); out.m_GasFractions.push_back(subFrac.get()); out.m_cGasFractions.push_back(subFrac.release()); } if (!out.IsValid()) { - throw CommonDataModelException("Unable to Marshall SEMechanicalVentilation with the given MechanicalVentilationData"); + throw CommonDataModelException("Unable to UnMarshall SEMechanicalVentilation with the given MechanicalVentilationData"); } } - void PatientActions::UnMarshall(const SEMechanicalVentilation& in, CDM::MechanicalVentilationData& out) + void PatientActions::Marshall(const SEMechanicalVentilation& in, CDM::MechanicalVentilationData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_ENUM_UNMARSHAL_HELPER(in, out, State) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Flow) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Pressure) + PatientActions::Marshall(static_cast(in), static_cast(out)); + out.State(std::make_unique::type>()); + Property::Marshall(in.GetState(), out.State()); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Flow) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Pressure) for (SESubstanceFraction* sf : in.m_GasFractions) { - out.GasFraction().push_back(std::unique_ptr(sf->Unload())); + auto sfData = std::make_unique(); + io::Substance::Marshall(*sf, *sfData); + out.GasFraction().push_back(std::move(sfData)); } } //---------------------------------------------------------------------------------- // class SENasalCannula - void PatientActions::Marshall(const CDM::NasalCannulaData& in, SENasalCannula& out) + void PatientActions::UnMarshall(const CDM::NasalCannulaData& in, SENasalCannula& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - Scenario::Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.FlowRate(), out.GetFlowRate()); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.FlowRate(), out.GetFlowRate(), rd); } - void PatientActions::UnMarshall(const SENasalCannula& in, CDM::NasalCannulaData& out) + void PatientActions::Marshall(const SENasalCannula& in, CDM::NasalCannulaData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, FlowRate) + PatientActions::Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, FlowRate) } //---------------------------------------------------------------------------------- // class SENasalStates - void PatientActions::Marshall(const CDM::NasalStateData& in, SENasalState& out) + void PatientActions::UnMarshall(const CDM::NasalStateData& in, SENasalState& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - io::Property::Marshall(in.TotalNasalDose(), out.GetTotalNasalDose()); + io::Property::UnMarshall(in.TotalNasalDose(), out.GetTotalNasalDose(), rd); out.m_UnreleasedDrugMasses.clear(); for (auto umData : in.UnreleasedDrugMasses()) { - SEScalarMass unrelMass; - unrelMass.Load(umData); - out.m_UnreleasedDrugMasses.push_back(unrelMass); + out.m_UnreleasedDrugMasses.emplace_back(); + io::Property::UnMarshall(umData, out.m_UnreleasedDrugMasses.back()); } out.m_ReleasedDrugMasses.clear(); for (auto rmData : in.ReleasedDrugMasses()) { - SEScalarMass relMass; - relMass.Load(rmData); - out.m_ReleasedDrugMasses.push_back(relMass); + out.m_ReleasedDrugMasses.emplace_back(); + io::Property::UnMarshall(rmData, out.m_ReleasedDrugMasses.back()); } } - void PatientActions::UnMarshall(const SENasalState& in, CDM::NasalStateData& out) + void PatientActions::Marshall(const SENasalState& in, CDM::NasalStateData& out) { - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, TotalNasalDose); - // CDM_PROPERTY_UNMARSHAL_HELPER(in, out, VenaCavaConcentration); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, TotalNasalDose); + // CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, VenaCavaConcentration); out.UnreleasedDrugMasses().clear(); for (auto umData : in.m_UnreleasedDrugMasses) { CDM::ScalarMassData mass; - io::Property::UnMarshall(umData, mass); + io::Property::Marshall(umData, mass); out.UnreleasedDrugMasses().push_back(mass); } out.ReleasedDrugMasses().clear(); for (auto rmData : in.m_ReleasedDrugMasses) { CDM::ScalarMassData mass; - io::Property::UnMarshall(rmData, mass); + io::Property::Marshall(rmData, mass); out.ReleasedDrugMasses().push_back(mass); } out.Substance(in.m_Substance->GetName()); } //---------------------------------------------------------------------------------- // class SENeedleDecompression - void PatientActions::Marshall(const CDM::NeedleDecompressionData& in, SENeedleDecompression& out) + void PatientActions::UnMarshall(const CDM::NeedleDecompressionData& in, SENeedleDecompression& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - Scenario::Marshall(static_cast(in), static_cast(out)); - - out.m_Side = in.Side(); - out.m_State = in.State(); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); + ; + Property::UnMarshall(in.Side(), out.m_Side); + Property::UnMarshall(in.State(), out.m_State); } - void PatientActions::UnMarshall(const SENeedleDecompression& in, CDM::NeedleDecompressionData& out) + void PatientActions::Marshall(const SENeedleDecompression& in, CDM::NeedleDecompressionData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - out.State(in.m_State); - CDM_ENUM_UNMARSHAL_HELPER(in, out, Side) + PatientActions::Marshall(static_cast(in), static_cast(out)); + out.State(std::make_unique::type>()); + Property::Marshall(in.m_State, out.State()); + + SE_PROPERTY_ENUM_PTR_MARSHALL_HELPER(in, out, Side) } //---------------------------------------------------------------------------------- // class SEOverride - void PatientActions::Marshall(const CDM::OverrideData& in, SEOverride& out) + void PatientActions::UnMarshall(const CDM::OverrideData& in, SEOverride& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); + + PatientActions::UnMarshall(static_cast(in), static_cast(out)); - Scenario::Marshall(static_cast(in), static_cast(out)); + Property::UnMarshall(in.State(), out.m_OverrideState); + Property::UnMarshall(in.Conformant(), out.m_OverrideConformance); - out.SetOverrideState(in.State()); - out.SetOverrideConformance(in.Conformant()); if (in.ArterialBloodPHOverride().present()) { - io::Property::Marshall(in.ArterialBloodPHOverride(), out.GetArterialPHOverride()); + io::Property::UnMarshall(in.ArterialBloodPHOverride(), out.GetArterialPHOverride(), rd); } if (in.VenousBloodPHOverride().present()) { - io::Property::Marshall(in.VenousBloodPHOverride(), out.GetVenousPHOverride()); + io::Property::UnMarshall(in.VenousBloodPHOverride(), out.GetVenousPHOverride(), rd); } if (in.CarbonDioxideSaturationOverride().present()) { - io::Property::Marshall(in.CarbonDioxideSaturationOverride(), out.GetCO2SaturationOverride()); + io::Property::UnMarshall(in.CarbonDioxideSaturationOverride(), out.GetCO2SaturationOverride(), rd); } if (in.CarbonMonoxideSaturationOverride().present()) { - io::Property::Marshall(in.CarbonMonoxideSaturationOverride(), out.GetCOSaturationOverride()); + io::Property::UnMarshall(in.CarbonMonoxideSaturationOverride(), out.GetCOSaturationOverride(), rd); } if (in.OxygenSaturationOverride().present()) { - io::Property::Marshall(in.OxygenSaturationOverride(), out.GetO2SaturationOverride()); + io::Property::UnMarshall(in.OxygenSaturationOverride(), out.GetO2SaturationOverride(), rd); } if (in.PhosphateOverride().present()) { - io::Property::Marshall(in.PhosphateOverride(), out.GetPhosphateOverride()); + io::Property::UnMarshall(in.PhosphateOverride(), out.GetPhosphateOverride(), rd); } if (in.WhiteBloodCellCountOverride().present()) { - io::Property::Marshall(in.WhiteBloodCellCountOverride(), out.GetWBCCountOverride()); + io::Property::UnMarshall(in.WhiteBloodCellCountOverride(), out.GetWBCCountOverride(), rd); } if (in.TotalBilirubinOverride().present()) { - io::Property::Marshall(in.TotalBilirubinOverride(), out.GetTotalBilirubinOverride()); + io::Property::UnMarshall(in.TotalBilirubinOverride(), out.GetTotalBilirubinOverride(), rd); } if (in.CalciumConcentrationOverride().present()) { - io::Property::Marshall(in.CalciumConcentrationOverride(), out.GetCalciumConcentrationOverride()); + io::Property::UnMarshall(in.CalciumConcentrationOverride(), out.GetCalciumConcentrationOverride(), rd); } if (in.GlucoseConcentrationOverride().present()) { - io::Property::Marshall(in.GlucoseConcentrationOverride(), out.GetGlucoseConcentrationOverride()); + io::Property::UnMarshall(in.GlucoseConcentrationOverride(), out.GetGlucoseConcentrationOverride(), rd); } if (in.LactateConcentrationOverride().present()) { - io::Property::Marshall(in.LactateConcentrationOverride(), out.GetLactateConcentrationOverride()); + io::Property::UnMarshall(in.LactateConcentrationOverride(), out.GetLactateConcentrationOverride(), rd); } if (in.PotassiumConcentrationOverride().present()) { - io::Property::Marshall(in.PotassiumConcentrationOverride(), out.GetPotassiumConcentrationOverride()); + io::Property::UnMarshall(in.PotassiumConcentrationOverride(), out.GetPotassiumConcentrationOverride(), rd); } if (in.SodiumConcentrationOverride().present()) { - io::Property::Marshall(in.SodiumConcentrationOverride(), out.GetSodiumConcentrationOverride()); + io::Property::UnMarshall(in.SodiumConcentrationOverride(), out.GetSodiumConcentrationOverride(), rd); } if (in.BloodVolumeOverride().present()) { - io::Property::Marshall(in.BloodVolumeOverride(), out.GetBloodVolumeOverride()); + io::Property::UnMarshall(in.BloodVolumeOverride(), out.GetBloodVolumeOverride(), rd); } if (in.CardiacOutputOverride().present()) { - io::Property::Marshall(in.CardiacOutputOverride(), out.GetCardiacOutputOverride()); + io::Property::UnMarshall(in.CardiacOutputOverride(), out.GetCardiacOutputOverride(), rd); } if (in.DiastolicArterialPressureOverride().present()) { - io::Property::Marshall(in.DiastolicArterialPressureOverride(), out.GetDiastolicArterialPressureOverride()); + io::Property::UnMarshall(in.DiastolicArterialPressureOverride(), out.GetDiastolicArterialPressureOverride(), rd); } if (in.MeanArterialPressureOverride().present()) { - io::Property::Marshall(in.MeanArterialPressureOverride(), out.GetMAPOverride()); + io::Property::UnMarshall(in.MeanArterialPressureOverride(), out.GetMAPOverride(), rd); } if (in.HeartRateOverride().present()) { - io::Property::Marshall(in.HeartRateOverride(), out.GetHeartRateOverride()); + io::Property::UnMarshall(in.HeartRateOverride(), out.GetHeartRateOverride(), rd); } if (in.HeartStrokeVolumeOverride().present()) { - io::Property::Marshall(in.HeartStrokeVolumeOverride(), out.GetHeartStrokeVolumeOverride()); + io::Property::UnMarshall(in.HeartStrokeVolumeOverride(), out.GetHeartStrokeVolumeOverride(), rd); } if (in.SystolicArterialPressureOverride().present()) { - io::Property::Marshall(in.SystolicArterialPressureOverride(), out.GetSystolicArterialPressureOverride()); + io::Property::UnMarshall(in.SystolicArterialPressureOverride(), out.GetSystolicArterialPressureOverride(), rd); } if (in.InsulinSynthesisRateOverride().present()) { - io::Property::Marshall(in.InsulinSynthesisRateOverride(), out.GetInsulinSynthesisRateOverride()); + io::Property::UnMarshall(in.InsulinSynthesisRateOverride(), out.GetInsulinSynthesisRateOverride(), rd); } if (in.GlucagonSynthesisRateOverride().present()) { - io::Property::Marshall(in.GlucagonSynthesisRateOverride(), out.GetGlucagonSynthesisRateOverride()); + io::Property::UnMarshall(in.GlucagonSynthesisRateOverride(), out.GetGlucagonSynthesisRateOverride(), rd); } if (in.AchievedExerciseLevelOverride().present()) { - io::Property::Marshall(in.AchievedExerciseLevelOverride(), out.GetAchievedExerciseLevelOverride()); + io::Property::UnMarshall(in.AchievedExerciseLevelOverride(), out.GetAchievedExerciseLevelOverride(), rd); } if (in.CoreTemperatureOverride().present()) { - io::Property::Marshall(in.CoreTemperatureOverride(), out.GetCoreTemperatureOverride()); + io::Property::UnMarshall(in.CoreTemperatureOverride(), out.GetCoreTemperatureOverride(), rd); } if (in.CreatinineProductionRateOverride().present()) { - io::Property::Marshall(in.CreatinineProductionRateOverride(), out.GetCreatinineProductionRateOverride()); + io::Property::UnMarshall(in.CreatinineProductionRateOverride(), out.GetCreatinineProductionRateOverride(), rd); } if (in.ExerciseMeanArterialPressureDeltaOverride().present()) { - io::Property::Marshall(in.ExerciseMeanArterialPressureDeltaOverride(), out.GetExerciseMeanArterialPressureDeltaOverride()); + io::Property::UnMarshall(in.ExerciseMeanArterialPressureDeltaOverride(), out.GetExerciseMeanArterialPressureDeltaOverride(), rd); } if (in.FatigueLevelOverride().present()) { - io::Property::Marshall(in.FatigueLevelOverride(), out.GetFatigueLevelOverride()); + io::Property::UnMarshall(in.FatigueLevelOverride(), out.GetFatigueLevelOverride(), rd); } if (in.LactateProductionRateOverride().present()) { - io::Property::Marshall(in.LactateProductionRateOverride(), out.GetLactateProductionRateOverride()); + io::Property::UnMarshall(in.LactateProductionRateOverride(), out.GetLactateProductionRateOverride(), rd); } if (in.SkinTemperatureOverride().present()) { - io::Property::Marshall(in.SkinTemperatureOverride(), out.GetSkinTemperatureOverride()); + io::Property::UnMarshall(in.SkinTemperatureOverride(), out.GetSkinTemperatureOverride(), rd); } if (in.SweatRateOverride().present()) { - io::Property::Marshall(in.SweatRateOverride(), out.GetSweatRateOverride()); + io::Property::UnMarshall(in.SweatRateOverride(), out.GetSweatRateOverride(), rd); } if (in.TotalMetabolicRateOverride().present()) { - io::Property::Marshall(in.TotalMetabolicRateOverride(), out.GetTotalMetabolicOverride()); + io::Property::UnMarshall(in.TotalMetabolicRateOverride(), out.GetTotalMetabolicOverride(), rd); } if (in.TotalWorkRateLevelOverride().present()) { - io::Property::Marshall(in.TotalWorkRateLevelOverride(), out.GetTotalWorkRateLevelOverride()); + io::Property::UnMarshall(in.TotalWorkRateLevelOverride(), out.GetTotalWorkRateLevelOverride(), rd); } if (in.SodiumLostToSweatOverride().present()) { - io::Property::Marshall(in.SodiumLostToSweatOverride(), out.GetSodiumLostToSweatOverride()); + io::Property::UnMarshall(in.SodiumLostToSweatOverride(), out.GetSodiumLostToSweatOverride(), rd); } if (in.PotassiumLostToSweatOverride().present()) { - io::Property::Marshall(in.PotassiumLostToSweatOverride(), out.GetPotassiumLostToSweatOverride()); + io::Property::UnMarshall(in.PotassiumLostToSweatOverride(), out.GetPotassiumLostToSweatOverride(), rd); } if (in.ChlorideLostToSweatOverride().present()) { - io::Property::Marshall(in.ChlorideLostToSweatOverride(), out.GetChlorideLostToSweatOverride()); + io::Property::UnMarshall(in.ChlorideLostToSweatOverride(), out.GetChlorideLostToSweatOverride(), rd); } if (in.LeftAfferentArterioleResistanceOverride().present()) { - io::Property::Marshall(in.LeftAfferentArterioleResistanceOverride(), out.GetLeftAfferentArterioleResistanceOverride()); + io::Property::UnMarshall(in.LeftAfferentArterioleResistanceOverride(), out.GetLeftAfferentArterioleResistanceOverride(), rd); } if (in.LeftGlomerularFiltrationRateOverride().present()) { - io::Property::Marshall(in.LeftGlomerularFiltrationRateOverride(), out.GetLeftGlomerularFiltrationRateOverride()); + io::Property::UnMarshall(in.LeftGlomerularFiltrationRateOverride(), out.GetLeftGlomerularFiltrationRateOverride(), rd); } if (in.LeftReabsorptionRateOverride().present()) { - io::Property::Marshall(in.LeftReabsorptionRateOverride(), out.GetLeftReaborptionRateOverride()); + io::Property::UnMarshall(in.LeftReabsorptionRateOverride(), out.GetLeftReaborptionRateOverride(), rd); } if (in.RenalBloodFlowOverride().present()) { - io::Property::Marshall(in.RenalBloodFlowOverride(), out.GetRenalBloodFlowOverride()); + io::Property::UnMarshall(in.RenalBloodFlowOverride(), out.GetRenalBloodFlowOverride(), rd); } if (in.RenalPlasmaFlowOverride().present()) { - io::Property::Marshall(in.RenalPlasmaFlowOverride(), out.GetRenalPlasmaFlowOverride()); + io::Property::UnMarshall(in.RenalPlasmaFlowOverride(), out.GetRenalPlasmaFlowOverride(), rd); } if (in.RightAfferentArterioleResistanceOverride().present()) { - io::Property::Marshall(in.RightAfferentArterioleResistanceOverride(), out.GetRightAfferentArterioleResistanceOverride()); + io::Property::UnMarshall(in.RightAfferentArterioleResistanceOverride(), out.GetRightAfferentArterioleResistanceOverride(), rd); } if (in.RightGlomerularFiltrationRateOverride().present()) { - io::Property::Marshall(in.RightGlomerularFiltrationRateOverride(), out.GetRightGlomerularFiltrationRateOverride()); + io::Property::UnMarshall(in.RightGlomerularFiltrationRateOverride(), out.GetRightGlomerularFiltrationRateOverride(), rd); } if (in.RightReabsorptionRateOverride().present()) { - io::Property::Marshall(in.RightReabsorptionRateOverride(), out.GetRightReaborptionRateOverride()); + io::Property::UnMarshall(in.RightReabsorptionRateOverride(), out.GetRightReaborptionRateOverride(), rd); } if (in.UrinationRateOverride().present()) { - io::Property::Marshall(in.UrinationRateOverride(), out.GetUrinationRateOverride()); + io::Property::UnMarshall(in.UrinationRateOverride(), out.GetUrinationRateOverride(), rd); } if (in.UrineProductionRateOverride().present()) { - io::Property::Marshall(in.UrineProductionRateOverride(), out.GetUrineProductionRateOverride()); + io::Property::UnMarshall(in.UrineProductionRateOverride(), out.GetUrineProductionRateOverride(), rd); } if (in.UrineOsmolalityOverride().present()) { - io::Property::Marshall(in.UrineOsmolalityOverride(), out.GetUrineOsmolalityOverride()); + io::Property::UnMarshall(in.UrineOsmolalityOverride(), out.GetUrineOsmolalityOverride(), rd); } if (in.UrineVolumeOverride().present()) { - io::Property::Marshall(in.UrineVolumeOverride(), out.GetUrineVolumeOverride()); + io::Property::UnMarshall(in.UrineVolumeOverride(), out.GetUrineVolumeOverride(), rd); } if (in.UrineUreaNitrogenConcentrationOverride().present()) { - io::Property::Marshall(in.UrineUreaNitrogenConcentrationOverride(), out.GetUrineUreaNitrogenConcentrationOverride()); + io::Property::UnMarshall(in.UrineUreaNitrogenConcentrationOverride(), out.GetUrineUreaNitrogenConcentrationOverride(), rd); } if (in.ExpiratoryFlowOverride().present()) { - io::Property::Marshall(in.ExpiratoryFlowOverride(), out.GetExpiratoryFlowOverride()); + io::Property::UnMarshall(in.ExpiratoryFlowOverride(), out.GetExpiratoryFlowOverride(), rd); } if (in.InspiratoryFlowOverride().present()) { - io::Property::Marshall(in.InspiratoryFlowOverride(), out.GetInspiratoryFlowOverride()); + io::Property::UnMarshall(in.InspiratoryFlowOverride(), out.GetInspiratoryFlowOverride(), rd); } if (in.PulmonaryComplianceOverride().present()) { - io::Property::Marshall(in.PulmonaryComplianceOverride(), out.GetPulmonaryComplianceOverride()); + io::Property::UnMarshall(in.PulmonaryComplianceOverride(), out.GetPulmonaryComplianceOverride(), rd); } if (in.PulmonaryResistanceOverride().present()) { - io::Property::Marshall(in.PulmonaryResistanceOverride(), out.GetPulmonaryResistanceOverride()); + io::Property::UnMarshall(in.PulmonaryResistanceOverride(), out.GetPulmonaryResistanceOverride(), rd); } if (in.RespirationRateOverride().present()) { - io::Property::Marshall(in.RespirationRateOverride(), out.GetRespirationRateOverride()); + io::Property::UnMarshall(in.RespirationRateOverride(), out.GetRespirationRateOverride(), rd); } if (in.TidalVolumeOverride().present()) { - io::Property::Marshall(in.TidalVolumeOverride(), out.GetTidalVolumeOverride()); + io::Property::UnMarshall(in.TidalVolumeOverride(), out.GetTidalVolumeOverride(), rd); } if (in.TargetPulmonaryVentilationOverride().present()) { - io::Property::Marshall(in.TargetPulmonaryVentilationOverride(), out.GetTargetPulmonaryVentilationOverride()); + io::Property::UnMarshall(in.TargetPulmonaryVentilationOverride(), out.GetTargetPulmonaryVentilationOverride(), rd); } if (in.TotalAlveolarVentilationOverride().present()) { - io::Property::Marshall(in.TotalAlveolarVentilationOverride(), out.GetTotalAlveolarVentilationOverride()); + io::Property::UnMarshall(in.TotalAlveolarVentilationOverride(), out.GetTotalAlveolarVentilationOverride(), rd); } if (in.TotalLungVolumeOverride().present()) { - io::Property::Marshall(in.TotalLungVolumeOverride(), out.GetTotalLungVolumeOverride()); + io::Property::UnMarshall(in.TotalLungVolumeOverride(), out.GetTotalLungVolumeOverride(), rd); } if (in.TotalPulmonaryVentilationOverride().present()) { - io::Property::Marshall(in.TotalPulmonaryVentilationOverride(), out.GetTotalPulmonaryVentilationOverride()); + io::Property::UnMarshall(in.TotalPulmonaryVentilationOverride(), out.GetTotalPulmonaryVentilationOverride(), rd); } if (in.ExtravascularFluidVolumeOverride().present()) { - io::Property::Marshall(in.ExtravascularFluidVolumeOverride(), out.GetExtravascularFluidVolumeOverride()); + io::Property::UnMarshall(in.ExtravascularFluidVolumeOverride(), out.GetExtravascularFluidVolumeOverride(), rd); } if (in.IntracellularFluidVolumeOverride().present()) { - io::Property::Marshall(in.IntracellularFluidVolumeOverride(), out.GetIntracellularFluidVolumeOverride()); + io::Property::UnMarshall(in.IntracellularFluidVolumeOverride(), out.GetIntracellularFluidVolumeOverride(), rd); } if (in.LiverGlycogenOverride().present()) { - io::Property::Marshall(in.LiverGlycogenOverride(), out.GetLiverGlycogenOverride()); + io::Property::UnMarshall(in.LiverGlycogenOverride(), out.GetLiverGlycogenOverride(), rd); } if (in.MuscleGlycogenOverride().present()) { - io::Property::Marshall(in.MuscleGlycogenOverride(), out.GetMuscleGlycogenOverride()); + io::Property::UnMarshall(in.MuscleGlycogenOverride(), out.GetMuscleGlycogenOverride(), rd); } if (in.StoredProteinOverride().present()) { - io::Property::Marshall(in.StoredProteinOverride(), out.GetStoredProteinOverride()); + io::Property::UnMarshall(in.StoredProteinOverride(), out.GetStoredProteinOverride(), rd); } if (in.StoredFatOverride().present()) { - io::Property::Marshall(in.StoredFatOverride(), out.GetStoredFatOverride()); + io::Property::UnMarshall(in.StoredFatOverride(), out.GetStoredFatOverride(), rd); } if (!out.IsValid()) { throw CommonDataModelException("Unable to marshall SEOverride from the provided OverrideData"); } } - void PatientActions::UnMarshall(const SEOverride& in, CDM::OverrideData& out) + void PatientActions::Marshall(const SEOverride& in, CDM::OverrideData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); + PatientActions::Marshall(static_cast(in), static_cast(out)); if (in.HasOverrideState()) { - out.State((in.m_OverrideState) ? CDM::enumOnOff::On : CDM::enumOnOff::Off); + out.State(std::make_unique::type>()); + Property::Marshall(in.m_OverrideState, out.State()); } if (in.HasOverrideConformance()) { - out.Conformant((in.m_OverrideConformance) ? CDM::enumOnOff::On : CDM::enumOnOff::Off); + out.Conformant(std::make_unique::type>()); + Property::Marshall(in.m_OverrideConformance, out.Conformant()); } - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ArterialBloodPHOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, VenousBloodPHOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, CarbonDioxideSaturationOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, CarbonMonoxideSaturationOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, OxygenSaturationOverride) + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ArterialBloodPHOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, VenousBloodPHOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, CarbonDioxideSaturationOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, CarbonMonoxideSaturationOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, OxygenSaturationOverride) // GetBloodVolumeOverride - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PhosphateOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, WhiteBloodCellCountOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, TotalBilirubinOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, CalciumConcentrationOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, GlucoseConcentrationOverride) - - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LactateConcentrationOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PotassiumConcentrationOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SodiumConcentrationOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, BloodVolumeOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, CardiacOutputOverride) - - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, DiastolicArterialPressureOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MeanArterialPressureOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, HeartRateOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, HeartStrokeVolumeOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SystolicArterialPressureOverride) - - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, InsulinSynthesisRateOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, GlucagonSynthesisRateOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, AchievedExerciseLevelOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, CoreTemperatureOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, CreatinineProductionRateOverride) - - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ExerciseMeanArterialPressureDeltaOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, FatigueLevelOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LactateProductionRateOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SkinTemperatureOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SweatRateOverride) - - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, TotalMetabolicRateOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, TotalWorkRateLevelOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SodiumLostToSweatOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PotassiumLostToSweatOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ChlorideLostToSweatOverride) - - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftAfferentArterioleResistanceOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftGlomerularFiltrationRateOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftReabsorptionRateOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RenalBloodFlowOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RenalPlasmaFlowOverride) - - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightAfferentArterioleResistanceOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightGlomerularFiltrationRateOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightReabsorptionRateOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, UrineProductionRateOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, UrineOsmolalityOverride) - - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, UrineVolumeOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, UrineUreaNitrogenConcentrationOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ExpiratoryFlowOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, InspiratoryFlowOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PulmonaryComplianceOverride) - - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PulmonaryResistanceOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RespirationRateOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, TidalVolumeOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, TargetPulmonaryVentilationOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, TotalAlveolarVentilationOverride) - - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, TotalLungVolumeOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, TotalPulmonaryVentilationOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ExtravascularFluidVolumeOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, IntracellularFluidVolumeOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LiverGlycogenOverride) - - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MuscleGlycogenOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, StoredProteinOverride) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, StoredFatOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PhosphateOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, WhiteBloodCellCountOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TotalBilirubinOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, CalciumConcentrationOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, GlucoseConcentrationOverride) + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LactateConcentrationOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PotassiumConcentrationOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SodiumConcentrationOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, BloodVolumeOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, CardiacOutputOverride) + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, DiastolicArterialPressureOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MeanArterialPressureOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, HeartRateOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, HeartStrokeVolumeOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SystolicArterialPressureOverride) + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, InsulinSynthesisRateOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, GlucagonSynthesisRateOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, AchievedExerciseLevelOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, CoreTemperatureOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, CreatinineProductionRateOverride) + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ExerciseMeanArterialPressureDeltaOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, FatigueLevelOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LactateProductionRateOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SkinTemperatureOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SweatRateOverride) + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TotalMetabolicRateOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TotalWorkRateLevelOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SodiumLostToSweatOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PotassiumLostToSweatOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ChlorideLostToSweatOverride) + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftAfferentArterioleResistanceOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftGlomerularFiltrationRateOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftReabsorptionRateOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RenalBloodFlowOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RenalPlasmaFlowOverride) + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightAfferentArterioleResistanceOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightGlomerularFiltrationRateOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightReabsorptionRateOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, UrineProductionRateOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, UrineOsmolalityOverride) + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, UrineVolumeOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, UrineUreaNitrogenConcentrationOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ExpiratoryFlowOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, InspiratoryFlowOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PulmonaryComplianceOverride) + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PulmonaryResistanceOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RespirationRateOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TidalVolumeOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TargetPulmonaryVentilationOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TotalAlveolarVentilationOverride) + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TotalLungVolumeOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TotalPulmonaryVentilationOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ExtravascularFluidVolumeOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, IntracellularFluidVolumeOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LiverGlycogenOverride) + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MuscleGlycogenOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, StoredProteinOverride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, StoredFatOverride) } //---------------------------------------------------------------------------------- // class SEPainStimulus - void PatientActions::Marshall(const CDM::PainStimulusData& in, SEPainStimulus& out) + void PatientActions::UnMarshall(const CDM::PainStimulusData& in, SEPainStimulus& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - Scenario::Marshall(static_cast(in), static_cast(out)); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.Severity(), out.GetSeverity()); + io::Property::UnMarshall(in.Severity(), out.GetSeverity(), rd); out.m_Location = in.Location(); } - void PatientActions::UnMarshall(const SEPainStimulus& in, CDM::PainStimulusData& out) + void PatientActions::Marshall(const SEPainStimulus& in, CDM::PainStimulusData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); + PatientActions::Marshall(static_cast(in), static_cast(out)); out.Location(in.m_Location); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Severity) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Severity) } //---------------------------------------------------------------------------------- // class SEPericardialEffusion - void PatientActions::Marshall(const CDM::PericardialEffusionData& in, SEPericardialEffusion& out) + void PatientActions::UnMarshall(const CDM::PericardialEffusionData& in, SEPericardialEffusion& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - Scenario::Marshall(static_cast(in), static_cast(out)); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.EffusionRate(), out.GetEffusionRate()); + io::Property::UnMarshall(in.EffusionRate(), out.GetEffusionRate(), rd); } - void PatientActions::UnMarshall(const SEPericardialEffusion& in, CDM::PericardialEffusionData& out) + void PatientActions::Marshall(const SEPericardialEffusion& in, CDM::PericardialEffusionData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, EffusionRate) + PatientActions::Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, EffusionRate) } //---------------------------------------------------------------------------------- // class SEPulmonaryShunt - void PatientActions::Marshall(const CDM::PulmonaryShuntData& in, SEPulmonaryShunt& out) + void PatientActions::UnMarshall(const CDM::PulmonaryShuntData& in, SEPulmonaryShunt& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - Scenario::Marshall(static_cast(in), static_cast(out)); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.FlowRateScaling(), out.GetFlowRateScale()); + io::Property::UnMarshall(in.FlowRateScaling(), out.GetFlowRateScale(), rd); } - void PatientActions::UnMarshall(const SEPulmonaryShunt& in, CDM::PulmonaryShuntData& out) + void PatientActions::Marshall(const SEPulmonaryShunt& in, CDM::PulmonaryShuntData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, FlowRateScaling) + PatientActions::Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, FlowRateScaling) } //---------------------------------------------------------------------------------- // class SERadiationAbsorbedDose - void PatientActions::Marshall(const CDM::RadiationAbsorbedDoseData& in, SERadiationAbsorbedDose& out) + void PatientActions::UnMarshall(const CDM::RadiationAbsorbedDoseData& in, SERadiationAbsorbedDose& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - Scenario::Marshall(static_cast(in), static_cast(out)); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.RadiationDose(), out.GetDose()); + io::Property::UnMarshall(in.RadiationDose(), out.GetDose(), rd); } - void PatientActions::UnMarshall(const SERadiationAbsorbedDose& in, CDM::RadiationAbsorbedDoseData& out) + void PatientActions::Marshall(const SERadiationAbsorbedDose& in, CDM::RadiationAbsorbedDoseData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, RadiationDose) + PatientActions::Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, RadiationDose) } //---------------------------------------------------------------------------------- // class SESleep - void PatientActions::Marshall(const CDM::SleepData& in, SESleep& out) + void PatientActions::UnMarshall(const CDM::SleepData& in, SESleep& out, std::default_random_engine* rd) { - out.Clear(); - - Scenario::Marshall(static_cast(in), static_cast(out)); + out.Invalidate(); - out.m_SleepState = in.Sleep(); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); + Property::UnMarshall(in.Sleep(), out.m_SleepState); } - void PatientActions::UnMarshall(const SESleep& in, CDM::SleepData& out) + void PatientActions::Marshall(const SESleep& in, CDM::SleepData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - out.Sleep(in.GetSleepState()); + PatientActions::Marshall(static_cast(in), static_cast(out)); + out.Sleep(std::make_unique::type>()); + Property::Marshall(in.m_SleepState, out.Sleep()); } //---------------------------------------------------------------------------------- // class SESubstanceAdministration - void PatientActions::Marshall(const CDM::SubstanceAdministrationData& in, SESubstanceAdministration& out) + void PatientActions::UnMarshall(const CDM::SubstanceAdministrationData& in, SESubstanceAdministration& out) { - out.Clear(); + out.Invalidate(); - Scenario::Marshall(static_cast(in), static_cast(out)); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); } - void PatientActions::UnMarshall(const SESubstanceAdministration& in, CDM::SubstanceAdministrationData& out) + void PatientActions::Marshall(const SESubstanceAdministration& in, CDM::SubstanceAdministrationData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); + PatientActions::Marshall(static_cast(in), static_cast(out)); } //---------------------------------------------------------------------------------- // class SESubstanceBolus - void PatientActions::Marshall(const CDM::SubstanceBolusData& in, SESubstanceBolus& out) - { - out.Clear(); - Scenario::Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.Dose(), out.GetDose()); - io::Property::Marshall(in.Concentration(), out.GetConcentration()); - io::Property::Marshall(in.AdminTime(), out.GetAdminTime()); - out.m_AdminRoute = in.AdminRoute(); - } - void PatientActions::UnMarshall(const SESubstanceBolus& in, CDM::SubstanceBolusData& out) - { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_ENUM_UNMARSHAL_HELPER(in, out, AdminRoute) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Dose) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Concentration) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, AdminTime) + void PatientActions::UnMarshall(const CDM::SubstanceBolusData& in, SESubstanceBolus& out, std::default_random_engine* rd) + { + out.Invalidate(); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.Dose(), out.GetDose(), rd); + io::Property::UnMarshall(in.Concentration(), out.GetConcentration(), rd); + io::Property::UnMarshall(in.AdminTime(), out.GetAdminTime(), rd); + io::PatientActions::UnMarshall(in.AdminRoute(), out.m_AdminRoute); + } + void PatientActions::Marshall(const SESubstanceBolus& in, CDM::SubstanceBolusData& out) + { + PatientActions::Marshall(static_cast(in), static_cast(out)); + SE_PATIENT_ACTIONS_ENUM_PTR_MARSHALL_HELPER(in, out, AdminRoute) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Dose) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Concentration) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, AdminTime) out.Substance(in.m_Substance.GetName()); } //---------------------------------------------------------------------------------- // class SESubstanceBolusState - void PatientActions::Marshall(const CDM::SubstanceBolusStateData& in, SESubstanceBolusState& out) + void PatientActions::UnMarshall(const CDM::SubstanceBolusStateData& in, SESubstanceBolusState& out, std::default_random_engine* rd) { // TODO: Need to pass SubstanceManager to populate Substance based on name // NOTE: This might require us to throw exception // NOTE: This deffintly requires a refactor to not store internal substances as references - io::Property::Marshall(in.ElapsedTime(), out.m_ElapsedTime); - io::Property::Marshall(in.AdministeredDose(), out.m_AdministeredDose); + io::Property::UnMarshall(in.ElapsedTime(), out.m_ElapsedTime, rd); + io::Property::UnMarshall(in.AdministeredDose(), out.m_AdministeredDose, rd); } - void PatientActions::UnMarshall(const SESubstanceBolusState& in, CDM::SubstanceBolusStateData& out) + void PatientActions::Marshall(const SESubstanceBolusState& in, CDM::SubstanceBolusStateData& out) { out.Substance(in.m_Substance.GetName()); out.ElapsedTime(std::make_unique()); - io::Property::UnMarshall(in.m_ElapsedTime, out.ElapsedTime()); + io::Property::Marshall(in.m_ElapsedTime, out.ElapsedTime()); out.AdministeredDose(std::make_unique()); - io::Property::UnMarshall(in.m_AdministeredDose, out.AdministeredDose()); + io::Property::Marshall(in.m_AdministeredDose, out.AdministeredDose()); } //---------------------------------------------------------------------------------- // class SESubstanceCompoundInfusion - void PatientActions::Marshall(const CDM::SubstanceCompoundInfusionData& in, SESubstanceCompoundInfusion& out) + void PatientActions::UnMarshall(const CDM::SubstanceCompoundInfusionData& in, SESubstanceCompoundInfusion& out, std::default_random_engine* rd) { - out.Clear(); - Scenario::Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.Rate(), out.GetRate()); - io::Property::Marshall(in.BagVolume(), out.GetBagVolume()); + out.Invalidate(); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.Rate(), out.GetRate(), rd); + io::Property::UnMarshall(in.BagVolume(), out.GetBagVolume(), rd); } - void PatientActions::UnMarshall(const SESubstanceCompoundInfusion& in, CDM::SubstanceCompoundInfusionData& out) + void PatientActions::Marshall(const SESubstanceCompoundInfusion& in, CDM::SubstanceCompoundInfusionData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Rate) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, BagVolume) + PatientActions::Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Rate) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, BagVolume) out.SubstanceCompound(in.m_Compound.GetName()); } //---------------------------------------------------------------------------------- // class SESubstanceInfusion - void PatientActions::Marshall(const CDM::SubstanceInfusionData& in, SESubstanceInfusion& out) + void PatientActions::UnMarshall(const CDM::SubstanceInfusionData& in, SESubstanceInfusion& out, std::default_random_engine* rd) { - out.Clear(); - Scenario::Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.Rate(), out.GetRate()); - io::Property::Marshall(in.Concentration(), out.GetConcentration()); + out.Invalidate(); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.Rate(), out.GetRate(), rd); + io::Property::UnMarshall(in.Concentration(), out.GetConcentration(), rd); } - void PatientActions::UnMarshall(const SESubstanceInfusion& in, CDM::SubstanceInfusionData& out) + void PatientActions::Marshall(const SESubstanceInfusion& in, CDM::SubstanceInfusionData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Rate) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Concentration) + PatientActions::Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Rate) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Concentration) out.Substance(in.m_Substance.GetName()); } //---------------------------------------------------------------------------------- // class SESubstanceNasalDose - void PatientActions::Marshall(const CDM::SubstanceNasalDoseData& in, SESubstanceNasalDose& out) + void PatientActions::UnMarshall(const CDM::SubstanceNasalDoseData& in, SESubstanceNasalDose& out, std::default_random_engine* rd) { - out.Clear(); - PatientActions::Marshall(static_cast(in), static_cast(out)); - - io::PatientActions::Marshall((CDM::SubstanceAdministrationData const&)in, (SESubstanceAdministration&)out); - io::Property::Marshall(in.Dose(), out.GetDose()); + out.Invalidate(); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.Dose(), out.GetDose(), rd); } - void PatientActions::UnMarshall(const SESubstanceNasalDose& in, CDM::SubstanceNasalDoseData& out) + void PatientActions::Marshall(const SESubstanceNasalDose& in, CDM::SubstanceNasalDoseData& out) { - io::PatientActions::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Dose); + io::PatientActions::Marshall(static_cast(in), static_cast(out)); + out.Substance(in.GetSubstance().GetName()); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Dose); } //---------------------------------------------------------------------------------- // class SESubstanceOralDose - void PatientActions::Marshall(const CDM::SubstanceOralDoseData& in, SESubstanceOralDose& out) + void PatientActions::UnMarshall(const CDM::SubstanceOralDoseData& in, SESubstanceOralDose& out, std::default_random_engine* rd) { - out.Clear(); - io::PatientActions::Marshall((CDM::SubstanceAdministrationData const&)in, (SESubstanceAdministration&)out); - io::Property::Marshall(in.Dose(), out.GetDose()); - out.m_AdminRoute = in.AdminRoute(); + out.Invalidate(); + io::PatientActions::UnMarshall((CDM::SubstanceAdministrationData const&)in, (SESubstanceAdministration&)out); + io::Property::UnMarshall(in.Dose(), out.GetDose(), rd); + io::PatientActions::UnMarshall(in.AdminRoute(), out.m_AdminRoute); } - void PatientActions::UnMarshall(const SESubstanceOralDose& in, CDM::SubstanceOralDoseData& out) + void PatientActions::Marshall(const SESubstanceOralDose& in, CDM::SubstanceOralDoseData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Dose) + PatientActions::Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Dose) - out.AdminRoute(in.GetAdminRoute()); + SE_PATIENT_ACTIONS_ENUM_PTR_MARSHALL_HELPER(in, out, AdminRoute) out.Substance(in.m_Substance.GetName()); } //---------------------------------------------------------------------------------- // class SETensionPneumothorax - void PatientActions::Marshall(const CDM::TensionPneumothoraxData& in, SETensionPneumothorax& out) + void PatientActions::UnMarshall(const CDM::TensionPneumothoraxData& in, SETensionPneumothorax& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); + + PatientActions::UnMarshall(static_cast(in), static_cast(out)); - Scenario::Marshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.Severity(), out.GetSeverity(), rd); - io::Property::Marshall(in.Severity(), out.GetSeverity()); - out.m_Type = in.Type(); - out.m_Side = in.Side(); + io::PatientActions::UnMarshall(in.Type(), out.m_Type); + io::Property::UnMarshall(in.Side(), out.m_Side); } - void PatientActions::UnMarshall(const SETensionPneumothorax& in, CDM::TensionPneumothoraxData& out) + void PatientActions::Marshall(const SETensionPneumothorax& in, CDM::TensionPneumothoraxData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Severity) - CDM_ENUM_UNMARSHAL_HELPER(in, out, Type) - CDM_ENUM_UNMARSHAL_HELPER(in, out, Side) + PatientActions::Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Severity) + SE_PATIENT_ACTIONS_ENUM_PTR_MARSHALL_HELPER(in, out, Type) + SE_PROPERTY_ENUM_PTR_MARSHALL_HELPER(in, out, Side) } //---------------------------------------------------------------------------------- // class SETransmucosalStates - void PatientActions::Marshall(const CDM::TransmucosalStateData& in, SETransmucosalState& out) + void PatientActions::UnMarshall(const CDM::TransmucosalStateData& in, SETransmucosalState& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - io::Property::Marshall(in.MouthSolidMass(), out.GetMouthSolidMass()); - io::Property::Marshall(in.SalivaConcentration(), out.GetSalivaConcentration()); + io::Property::UnMarshall(in.MouthSolidMass(), out.GetMouthSolidMass(), rd); + io::Property::UnMarshall(in.SalivaConcentration(), out.GetSalivaConcentration(), rd); out.m_BuccalConcentrations.clear(); for (auto brData : in.BuccalConcentrations()) { SEScalarMassPerVolume buc; - io::Property::Marshall(brData, buc); + io::Property::UnMarshall(brData, buc, rd); out.m_BuccalConcentrations.push_back(buc); } out.m_SublingualConcentrations.clear(); for (auto slData : in.SublingualConcentrations()) { SEScalarMassPerVolume s1; - io::Property::Marshall(slData, s1); + io::Property::UnMarshall(slData, s1, rd); out.m_SublingualConcentrations.push_back(s1); } } - void PatientActions::UnMarshall(const SETransmucosalState& in, CDM::TransmucosalStateData& out) + void PatientActions::Marshall(const SETransmucosalState& in, CDM::TransmucosalStateData& out) { - out.MouthSolidMass(std::unique_ptr(in.m_MouthSolidMass->Unload())); - out.SalivaConcentration(std::unique_ptr(in.m_SalivaConcentration->Unload())); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, MouthSolidMass) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, SalivaConcentration) + for (auto bcData : in.m_BuccalConcentrations) { - out.BuccalConcentrations().push_back(std::unique_ptr(bcData.Unload())); + out.BuccalConcentrations().push_back(std::make_unique()); + io::Property::Marshall(bcData, out.BuccalConcentrations().back()); } for (auto slData : in.m_SublingualConcentrations) { - out.SublingualConcentrations().push_back(std::unique_ptr(slData.Unload())); + out.SublingualConcentrations().push_back(std::make_unique()); + io::Property::Marshall(slData, out.SublingualConcentrations().back()); } out.Substance(in.m_Substance->GetName()); } //---------------------------------------------------------------------------------- // class SETourniquet; - void PatientActions::Marshall(const CDM::TourniquetData& in, SETourniquet& out) + void PatientActions::UnMarshall(const CDM::TourniquetData& in, SETourniquet& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - io::PatientActions::Marshall((CDM::TourniquetData const&)in, (SEPatientAction&)out); + io::PatientActions::UnMarshall((CDM::TourniquetData const&)in, (SEPatientAction&)out); out.m_Compartment = in.Compartment(); - out.m_TourniquetLevel = in.TourniquetLevel(); + io::PatientActions::UnMarshall(in.TourniquetLevel(), out.m_TourniquetLevel); } - void PatientActions::UnMarshall(const SETourniquet& in, CDM::TourniquetData& out) + void PatientActions::Marshall(const SETourniquet& in, CDM::TourniquetData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); + PatientActions::Marshall(static_cast(in), static_cast(out)); out.Compartment(in.m_Compartment); - out.TourniquetLevel(in.m_TourniquetLevel); + SE_PATIENT_ACTIONS_ENUM_PTR_MARSHALL_HELPER(in, out, TourniquetLevel) } //---------------------------------------------------------------------------------- // class SEUrinate - void PatientActions::Marshall(const CDM::UrinateData& in, SEUrinate& out) + void PatientActions::UnMarshall(const CDM::UrinateData& in, SEUrinate& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); - Scenario::Marshall(static_cast(in), static_cast(out)); + PatientActions::UnMarshall(static_cast(in), static_cast(out)); } - void PatientActions::UnMarshall(const SEUrinate& in, CDM::UrinateData& out) + void PatientActions::Marshall(const SEUrinate& in, CDM::UrinateData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); + PatientActions::Marshall(static_cast(in), static_cast(out)); + } + //---------------------------------------------------------------------------------- + // SEBrainInjuryType + void PatientActions::UnMarshall(const CDM::enumBrainInjuryType& in, SEBrainInjuryType& out) + { + try { + switch (in) { + case CDM::enumBrainInjuryType::Diffuse: + out = SEBrainInjuryType::Diffuse; + break; + case CDM::enumBrainInjuryType::LeftFocal: + out = SEBrainInjuryType::LeftFocal; + break; + case CDM::enumBrainInjuryType::RightFocal: + out = SEBrainInjuryType::RightFocal; + break; + default: + out = SEBrainInjuryType::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SEBrainInjuryType::Invalid; + } + } + void PatientActions::Marshall(const SEBrainInjuryType& in, CDM::enumBrainInjuryType& out) + { + switch (in) { + case SEBrainInjuryType::Diffuse: + out = CDM::enumBrainInjuryType::Diffuse; + break; + case SEBrainInjuryType::LeftFocal: + out = CDM::enumBrainInjuryType::LeftFocal; + break; + case SEBrainInjuryType::RightFocal: + out = CDM::enumBrainInjuryType::RightFocal; + break; + default: + out = ""; + break; + } + } + // SEBolusAdministration + void PatientActions::UnMarshall(const CDM::enumBolusAdministration& in, SEBolusAdministration& out) + { + try { + switch (in) { + case CDM::enumBolusAdministration::Intraarterial: + out = SEBolusAdministration::Intraarterial; + break; + case CDM::enumBolusAdministration::Intramuscular: + out = SEBolusAdministration::Intramuscular; + break; + case CDM::enumBolusAdministration::Intravenous: + out = SEBolusAdministration::Intravenous; + break; + default: + out = SEBolusAdministration::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SEBolusAdministration::Invalid; + } + } + void PatientActions::Marshall(const SEBolusAdministration& in, CDM::enumBolusAdministration& out) + { + switch (in) { + case SEBolusAdministration::Intraarterial: + out = CDM::enumBolusAdministration::Intraarterial; + break; + case SEBolusAdministration::Intramuscular: + out = CDM::enumBolusAdministration::Intramuscular; + break; + case SEBolusAdministration::Intravenous: + out = CDM::enumBolusAdministration::Intravenous; + break; + default: + out = ""; + break; + } + } + // SEBurnDegree + void PatientActions::UnMarshall(const CDM::enumBurnDegree& in, SEBurnDegree& out) + { + try { + switch (in) { + case CDM::enumBurnDegree::First: + out = SEBurnDegree::First; + break; + case CDM::enumBurnDegree::Second: + out = SEBurnDegree::Second; + break; + case CDM::enumBurnDegree::Third: + out = SEBurnDegree::Third; + break; + default: + out = SEBurnDegree::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SEBurnDegree::Invalid; + } + } + void PatientActions::Marshall(const SEBurnDegree& in, CDM::enumBurnDegree& out) + { + switch (in) { + case SEBurnDegree::First: + out = CDM::enumBurnDegree::First; + break; + case SEBurnDegree::Second: + out = CDM::enumBurnDegree::Second; + break; + case SEBurnDegree::Third: + out = CDM::enumBurnDegree::Third; + break; + default: + out = ""; + break; + } + } + // SEFracturedBone + void PatientActions::UnMarshall(const CDM::enumBone& in, SEFracturedBone& out) + { + try { + switch (in) { + case CDM::enumBone::Radius: + out = SEFracturedBone::Radius; + break; + case CDM::enumBone::Tibia: + out = SEFracturedBone::Tibia; + break; + default: + out = SEFracturedBone::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SEFracturedBone::Invalid; + } + } + void PatientActions::Marshall(const SEFracturedBone& in, CDM::enumBone& out) + { + switch (in) { + case SEFracturedBone::Radius: + out = CDM::enumBone::Radius; + break; + case SEFracturedBone::Tibia: + out = CDM::enumBone::Tibia; + break; + default: + out = ""; + break; + } + } + // SEFractureTypes + void PatientActions::UnMarshall(const CDM::enumFractureTypes& in, SEFractureType& out) + { + try { + switch (in) { + case CDM::enumFractureTypes::Transverse: + out = SEFractureType::Transverse; + break; + case CDM::enumFractureTypes::Oblique: + out = SEFractureType::Oblique; + break; + case CDM::enumFractureTypes::Spiral: + out = SEFractureType::Spiral; + break; + case CDM::enumFractureTypes::Segmented: + out = SEFractureType::Segmented; + break; + case CDM::enumFractureTypes::Comminuted: + out = SEFractureType::Comminuted; + break; + default: + out = SEFractureType::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SEFractureType::Invalid; + } + } + void PatientActions::Marshall(const SEFractureType& in, CDM::enumFractureTypes& out) + { + switch (in) { + case SEFractureType::Transverse: + out = CDM::enumFractureTypes::Transverse; + break; + case SEFractureType::Oblique: + out = CDM::enumFractureTypes::Oblique; + break; + case SEFractureType::Spiral: + out = CDM::enumFractureTypes::Spiral; + break; + case SEFractureType::Segmented: + out = CDM::enumFractureTypes::Segmented; + break; + case SEFractureType::Comminuted: + out = CDM::enumFractureTypes::Comminuted; + break; + default: + out = ""; + break; + } + } + // SEInfectionSeverity + void PatientActions::UnMarshall(const CDM::enumInfectionSeverity& in, SEInfectionSeverity& out) + { + try { + switch (in) { + case CDM::enumInfectionSeverity::Eliminated: + out = SEInfectionSeverity::Eliminated; + break; + case CDM::enumInfectionSeverity::Mild: + out = SEInfectionSeverity::Mild; + break; + case CDM::enumInfectionSeverity::Moderate: + out = SEInfectionSeverity::Moderate; + break; + case CDM::enumInfectionSeverity::Severe: + out = SEInfectionSeverity::Severe; + break; + default: + out = SEInfectionSeverity::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SEInfectionSeverity::Invalid; + } + } + void PatientActions::Marshall(const SEInfectionSeverity& in, CDM::enumInfectionSeverity& out) + { + switch (in) { + case SEInfectionSeverity::Eliminated: + out = CDM::enumInfectionSeverity::Eliminated; + break; + case SEInfectionSeverity::Mild: + out = CDM::enumInfectionSeverity::Mild; + break; + case SEInfectionSeverity::Moderate: + out = CDM::enumInfectionSeverity::Moderate; + break; + case SEInfectionSeverity::Severe: + out = CDM::enumInfectionSeverity::Severe; + break; + default: + out = ""; + break; + } + } + // SEIntubationType + void PatientActions::UnMarshall(const CDM::enumIntubationType& in, SEIntubationType& out) + { + try { + switch (in) { + case CDM::enumIntubationType::Esophageal: + out = SEIntubationType::Esophageal; + break; + case CDM::enumIntubationType::LeftMainstem: + out = SEIntubationType::LeftMainstem; + break; + case CDM::enumIntubationType::RightMainstem: + out = SEIntubationType::RightMainstem; + break; + case CDM::enumIntubationType::Tracheal: + out = SEIntubationType::Tracheal; + break; + case CDM::enumIntubationType::Off: + out = SEIntubationType::Off; + break; + default: + out = SEIntubationType::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SEIntubationType::Invalid; + } + } + void PatientActions::Marshall(const SEIntubationType& in, CDM::enumIntubationType& out) + { + switch (in) { + case SEIntubationType::Esophageal: + out = CDM::enumIntubationType::Esophageal; + break; + case SEIntubationType::LeftMainstem: + out = CDM::enumIntubationType::LeftMainstem; + break; + case SEIntubationType::RightMainstem: + out = CDM::enumIntubationType::RightMainstem; + break; + case SEIntubationType::Tracheal: + out = CDM::enumIntubationType::Tracheal; + break; + case SEIntubationType::Off: + out = CDM::enumIntubationType::Off; + break; + default: + out = ""; + break; + } + } + // SEPatientAssessmentType + void PatientActions::UnMarshall(const CDM::enumPatientAssessment& in, SEPatientAssessmentType& out) + { + try { + switch (in) { + case CDM::enumPatientAssessment::ArterialBloodGasAnalysis: + out = SEPatientAssessmentType::ArterialBloodGasAnalysis; + break; + case CDM::enumPatientAssessment::PulmonaryFunctionTest: + out = SEPatientAssessmentType::PulmonaryFunctionTest; + break; + case CDM::enumPatientAssessment::ProthrombinTime: + out = SEPatientAssessmentType::ProthrombinTime; + break; + case CDM::enumPatientAssessment::PsychomotorVigilanceTask: + out = SEPatientAssessmentType::PsychomotorVigilanceTask; + break; + case CDM::enumPatientAssessment::CompleteBloodCount: + out = SEPatientAssessmentType::CompleteBloodCount; + break; + case CDM::enumPatientAssessment::ComprehensiveMetabolicPanel: + out = SEPatientAssessmentType::ComprehensiveMetabolicPanel; + break; + case CDM::enumPatientAssessment::SequentialOrganFailureAssessment: + out = SEPatientAssessmentType::SequentialOrganFailureAssessment; + break; + case CDM::enumPatientAssessment::Urinalysis: + out = SEPatientAssessmentType::Urinalysis; + break; + default: + out = SEPatientAssessmentType::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SEPatientAssessmentType::Invalid; + } + } + void PatientActions::Marshall(const SEPatientAssessmentType& in, CDM::enumPatientAssessment& out) + { + switch (in) { + case SEPatientAssessmentType::ArterialBloodGasAnalysis: + out = CDM::enumPatientAssessment::ArterialBloodGasAnalysis; + break; + case SEPatientAssessmentType::PulmonaryFunctionTest: + out = CDM::enumPatientAssessment::PulmonaryFunctionTest; + break; + case SEPatientAssessmentType::ProthrombinTime: + out = CDM::enumPatientAssessment::ProthrombinTime; + break; + case SEPatientAssessmentType::PsychomotorVigilanceTask: + out = CDM::enumPatientAssessment::PsychomotorVigilanceTask; + break; + case SEPatientAssessmentType::CompleteBloodCount: + out = CDM::enumPatientAssessment::CompleteBloodCount; + break; + case SEPatientAssessmentType::ComprehensiveMetabolicPanel: + out = CDM::enumPatientAssessment::ComprehensiveMetabolicPanel; + break; + case SEPatientAssessmentType::SequentialOrganFailureAssessment: + out = CDM::enumPatientAssessment::SequentialOrganFailureAssessment; + break; + case SEPatientAssessmentType::Urinalysis: + out = CDM::enumPatientAssessment::Urinalysis; + break; + default: + out = ""; + break; + } + } + // SEPneumothoraxType + void PatientActions::UnMarshall(const CDM::enumPneumothoraxType& in, SEPneumothoraxType& out) + { + try { + switch (in) { + case CDM::enumPneumothoraxType::Open: + out = SEPneumothoraxType::Open; + break; + case CDM::enumPneumothoraxType::Closed: + out = SEPneumothoraxType::Closed; + break; + default: + out = SEPneumothoraxType::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SEPneumothoraxType::Invalid; + } + } + void PatientActions::Marshall(const SEPneumothoraxType& in, CDM::enumPneumothoraxType& out) + { + switch (in) { + case SEPneumothoraxType::Open: + out = CDM::enumPneumothoraxType::Open; + break; + case SEPneumothoraxType::Closed: + out = CDM::enumPneumothoraxType::Closed; + break; + default: + out = ""; + break; + } + } + // SEOralAdministrationType + void PatientActions::UnMarshall(const CDM::enumOralAdministration in, SEOralAdministrationType& out) + { + try { + switch (in) { + case CDM::enumOralAdministration::Transmucosal: + out = SEOralAdministrationType::Transmucosal; + break; + case CDM::enumOralAdministration::Gastrointestinal: + out = SEOralAdministrationType::Gastrointestinal; + break; + default: + out = SEOralAdministrationType::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SEOralAdministrationType::Invalid; + } + } + void PatientActions::Marshall(const SEOralAdministrationType& in, CDM::enumOralAdministration& out) + { + switch (in) { + case SEOralAdministrationType::Transmucosal: + out = CDM::enumOralAdministration::Transmucosal; + break; + case SEOralAdministrationType::Gastrointestinal: + out = CDM::enumOralAdministration::Gastrointestinal; + break; + default: + out = ""; + break; + } + } + // SETourniquetApplicationType + void PatientActions::UnMarshall(const CDM::enumTourniquetApplicationLevel& in, SETourniquetApplicationType& out) + { + try { + switch (in) { + case CDM::enumTourniquetApplicationLevel::Applied: + out = SETourniquetApplicationType::Applied; + break; + case CDM::enumTourniquetApplicationLevel::Misapplied: + out = SETourniquetApplicationType::Misapplied; + break; + case CDM::enumTourniquetApplicationLevel::None: + out = SETourniquetApplicationType::NotApplied; + break; + default: + out = SETourniquetApplicationType::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SETourniquetApplicationType::Invalid; + } + } + void PatientActions::Marshall(const SETourniquetApplicationType& in, CDM::enumTourniquetApplicationLevel& out) + { + switch (in) { + case SETourniquetApplicationType::Applied: + out = CDM::enumTourniquetApplicationLevel::Applied; + break; + case SETourniquetApplicationType::Misapplied: + out = CDM::enumTourniquetApplicationLevel::Misapplied; + break; + case SETourniquetApplicationType::NotApplied: + out = CDM::enumTourniquetApplicationLevel::None; + break; + default: + out = ""; + break; + } } //---------------------------------------------------------------------------------- + +} + +bool operator==(CDM::enumBrainInjuryType const& lhs, SEBrainInjuryType const& rhs) +{ + switch (rhs) { + case SEBrainInjuryType::Diffuse: + return (CDM::enumBrainInjuryType::Diffuse == lhs); + case SEBrainInjuryType::LeftFocal: + return (CDM::enumBrainInjuryType::LeftFocal == lhs); + case SEBrainInjuryType::RightFocal: + return (CDM::enumBrainInjuryType::RightFocal == lhs); + case SEBrainInjuryType::Invalid: + return ((CDM::enumBrainInjuryType::value)-1 == lhs); + default: + return false; + } +} +bool operator==(CDM::enumBolusAdministration const& lhs, SEBolusAdministration const& rhs) +{ + switch (rhs) { + case SEBolusAdministration::Intraarterial: + return (CDM::enumBolusAdministration::Intraarterial == lhs); + case SEBolusAdministration::Intramuscular: + return (CDM::enumBolusAdministration::Intramuscular == lhs); + case SEBolusAdministration::Intravenous: + return (CDM::enumBolusAdministration::Intravenous == lhs); + case SEBolusAdministration::Invalid: + return ((CDM::enumBolusAdministration::value)-1 == lhs); + default: + return false; + } +} +bool operator==(CDM::enumBurnDegree const& lhs, SEBurnDegree const& rhs) +{ + switch (rhs) { + case SEBurnDegree::First: + return (CDM::enumBurnDegree::First == lhs); + case SEBurnDegree::Second: + return (CDM::enumBurnDegree::Second == lhs); + case SEBurnDegree::Third: + return (CDM::enumBurnDegree::Third == lhs); + case SEBurnDegree::Invalid: + return ((CDM::enumBurnDegree::value)-1 == lhs); + default: + return false; + } +} +bool operator==(CDM::enumBone const& lhs, SEFracturedBone const& rhs) +{ + switch (rhs) { + case SEFracturedBone::Radius: + return (CDM::enumBone::Radius == lhs); + case SEFracturedBone::Tibia: + return (CDM::enumBone::Tibia == lhs); + case SEFracturedBone::Invalid: + return ((CDM::enumBone::value)-1 == lhs); + default: + return false; + } +} +bool operator==(CDM::enumFractureTypes const& lhs, SEFractureType const& rhs) +{ + switch (rhs) { + case SEFractureType::Transverse: + return (CDM::enumFractureTypes::Transverse == lhs); + case SEFractureType::Oblique: + return (CDM::enumFractureTypes::Oblique == lhs); + case SEFractureType::Spiral: + return (CDM::enumFractureTypes::Spiral == lhs); + case SEFractureType::Segmented: + return (CDM::enumFractureTypes::Segmented == lhs); + case SEFractureType::Comminuted: + return (CDM::enumFractureTypes::Comminuted == lhs); + case SEFractureType::Invalid: + return ((CDM::enumFractureTypes::value)-1 == lhs); + default: + return false; + } +} +bool operator==(CDM::enumInfectionSeverity const& lhs, SEInfectionSeverity const& rhs) +{ + switch (rhs) { + case SEInfectionSeverity::Eliminated: + return (CDM::enumInfectionSeverity::Eliminated == lhs); + case SEInfectionSeverity::Mild: + return (CDM::enumInfectionSeverity::Mild == lhs); + case SEInfectionSeverity::Moderate: + return (CDM::enumInfectionSeverity::Moderate == lhs); + case SEInfectionSeverity::Severe: + return (CDM::enumInfectionSeverity::Severe == lhs); + case SEInfectionSeverity::Invalid: + return ((CDM::enumInfectionSeverity::value)-1 == lhs); + default: + return false; + } +} +bool operator==(CDM::enumIntubationType const& lhs, SEIntubationType const& rhs) +{ + switch (rhs) { + case SEIntubationType::Off: + return (CDM::enumIntubationType::Off == lhs); + case SEIntubationType::Esophageal: + return (CDM::enumIntubationType::Esophageal == lhs); + case SEIntubationType::LeftMainstem: + return (CDM::enumIntubationType::LeftMainstem == lhs); + case SEIntubationType::RightMainstem: + return (CDM::enumIntubationType::RightMainstem == lhs); + case SEIntubationType::Tracheal: + return (CDM::enumIntubationType::Tracheal == lhs); + case SEIntubationType::Invalid: + return ((CDM::enumIntubationType::value)-1 == lhs); + default: + return false; + } +} + +bool operator==(CDM::enumPatientAssessment const& lhs, SEPatientAssessmentType const& rhs) +{ + switch (rhs) { + case SEPatientAssessmentType::ArterialBloodGasAnalysis: + return (CDM::enumPatientAssessment::ArterialBloodGasAnalysis == lhs); + case SEPatientAssessmentType::PulmonaryFunctionTest: + return (CDM::enumPatientAssessment::PulmonaryFunctionTest == lhs); + case SEPatientAssessmentType::ProthrombinTime: + return (CDM::enumPatientAssessment::ProthrombinTime == lhs); + case SEPatientAssessmentType::PsychomotorVigilanceTask: + return (CDM::enumPatientAssessment::PsychomotorVigilanceTask == lhs); + case SEPatientAssessmentType::CompleteBloodCount: + return (CDM::enumPatientAssessment::CompleteBloodCount == lhs); + case SEPatientAssessmentType::ComprehensiveMetabolicPanel: + return (CDM::enumPatientAssessment::ComprehensiveMetabolicPanel == lhs); + case SEPatientAssessmentType::SequentialOrganFailureAssessment: + return (CDM::enumPatientAssessment::SequentialOrganFailureAssessment == lhs); + case SEPatientAssessmentType::Urinalysis: + return (CDM::enumPatientAssessment::Urinalysis == lhs); + case SEPatientAssessmentType::Invalid: + return ((CDM::enumPatientAssessment::value)-1 == lhs); + default: + return false; + } +} +bool operator==(CDM::enumPneumothoraxType const& lhs, SEPneumothoraxType const& rhs) +{ + switch (rhs) { + case SEPneumothoraxType::Open: + return (CDM::enumPneumothoraxType::Open == lhs); + case SEPneumothoraxType::Closed: + return (CDM::enumPneumothoraxType::Closed == lhs); + case SEPneumothoraxType::Invalid: + return ((CDM::enumPneumothoraxType::value)-1 == lhs); + default: + return false; + } +} +bool operator==(CDM::enumOralAdministration const& lhs, SEOralAdministrationType const& rhs) +{ + switch (rhs) { + case SEOralAdministrationType::Gastrointestinal: + return (CDM::enumOralAdministration::Gastrointestinal == lhs); + case SEOralAdministrationType::Transmucosal: + return (CDM::enumOralAdministration::Transmucosal == lhs); + case SEOralAdministrationType::Invalid: + return ((CDM::enumOralAdministration::value)-1 == lhs); + default: + return false; + } +} +bool operator==(CDM::enumTourniquetApplicationLevel const& lhs, SETourniquetApplicationType const& rhs) +{ + switch (rhs) { + case SETourniquetApplicationType::NotApplied: + return (CDM::enumTourniquetApplicationLevel::None == lhs); + case SETourniquetApplicationType::Misapplied: + return (CDM::enumTourniquetApplicationLevel::Misapplied == lhs); + case SETourniquetApplicationType::Applied: + return (CDM::enumTourniquetApplicationLevel::Applied == lhs); + case SETourniquetApplicationType::Invalid: + return ((CDM::enumTourniquetApplicationLevel::value)-1 == lhs); + default: + return false; + } +} } -} \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/io/cdm/PatientActions.h b/projects/biogears/libBiogears/src/io/cdm/PatientActions.h index 930860e13..5e34c13a1 100644 --- a/projects/biogears/libBiogears/src/io/cdm/PatientActions.h +++ b/projects/biogears/libBiogears/src/io/cdm/PatientActions.h @@ -12,22 +12,41 @@ specific language governing permissions and limitations under the License. #pragma once #include +#include -#include "biogears/cdm/CommonDataModel.h" +#include #include -#include +#include +#include +#include -#define CDM_PATIENT_ACTIONS_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_PATIENT_ACTIONS_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ out.func(std::make_unique::type>()); \ - io::PatientActions::UnMarshall(*in.m_##func, out.func()); \ + io::PatientActions::Marshall(*in.m_##func, out.func()); \ + } + +#define CDM_OPTIONAL_PATIENT_ACTIONS_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func) { \ + io::PatientActions::Marshall(*in.m_##func, out.func()); \ + } + +#define SE_PATIENT_ACTIONS_ENUM_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.Has##func()) { \ + out.func(std::make_unique::type>()); \ + io::PatientActions::Marshall(in.m_##func, out.func()); \ } -#define CDM_OPTIONAL_PATIENT_ACTIONS_UNMARSHAL_HELPER(in, out, func) \ - if (in.m_##func) { \ - io::PatientActions::UnMarshall(*in.m_##func, out.func()); \ +#define SE_OPTIONAL_PATIENT_ACTIONS_ENUM_PTR_MARSHALL_HELPER(in, out, func) \ + io::PatientActions::Marshall(in.m_##func, out.func()); + +#define CDM_PATIENT_ACTION_COPY(type, in, out) \ + { \ + CDM::type##Data middle; \ + io::PatientActions::Marshall(in, middle); \ + io::PatientActions::UnMarshall(middle, out); \ } namespace biogears { @@ -35,11 +54,13 @@ class SESubstanceManager; class SEAction; class SEPatientAction; +class SEPatientActionCollection; class SEPatientAssessmentRequest; class SEAcuteRespiratoryDistress; class SEAcuteStress; class SEExampleAction; class SEAirwayObstruction; +class SEAmputation; class SEApnea; class SEAsthmaAttack; class SEBrainInjury; @@ -50,6 +71,7 @@ class SEChestCompression; class SEChestCompressionForce; class SEChestCompressionForceScale; class SEChestOcclusiveDressing; +class SEChestTube; class SEConsciousRespirationCommand; class SEEbola; class SEEscharotomy; @@ -60,6 +82,7 @@ class SEUseInhaler; class SEConsciousRespiration; class SEConsumeNutrients; class SEExercise; +class SEFracture; class SEHemorrhage; class SEInfection; class SEIntubation; @@ -89,183 +112,391 @@ namespace io { class BIOGEARS_PRIVATE_API PatientActions { public: // class Factories; - static std::vector> action_factory(const CDM::ActionListData& in, SESubstanceManager& substances); - static std::unique_ptr factory(CDM::ActionData const* actionData, SESubstanceManager& substances); + static std::unique_ptr factory(CDM::PatientActionData const* patientActionData, SESubstanceManager& substances, std::default_random_engine* rd = nullptr); static std::unique_ptr factory(const SEPatientAction* data); + + static void Marshall(const SEPatientActionCollection& in, std::vector>& out); // template option + template ::value>* = nullptr> + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); + + template ::value>* = nullptr> + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); + template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); - template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); // class SEPatientAction; - static void Marshall(const CDM::PatientActionData& in, SEPatientAction& out); - static void UnMarshall(const SEPatientAction& in, CDM::PatientActionData& out); + static void UnMarshall(const CDM::PatientActionData& in, SEPatientAction& out); + static void Marshall(const SEPatientAction& in, CDM::PatientActionData& out); // class SEPatientAssessmentRequest; - static void Marshall(const CDM::PatientAssessmentRequestData& in, SEPatientAssessmentRequest& out); - static void UnMarshall(const SEPatientAssessmentRequest& in, CDM::PatientAssessmentRequestData& out); + static void UnMarshall(const CDM::PatientAssessmentRequestData& in, SEPatientAssessmentRequest& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEPatientAssessmentRequest& in, CDM::PatientAssessmentRequestData& out); // class SEAcuteRespiratoryDistressStress; - static void Marshall(const CDM::AcuteRespiratoryDistressData& in, SEAcuteRespiratoryDistress& out); - static void UnMarshall(const SEAcuteRespiratoryDistress& in, CDM::AcuteRespiratoryDistressData& out); + static void UnMarshall(const CDM::AcuteRespiratoryDistressData& in, SEAcuteRespiratoryDistress& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEAcuteRespiratoryDistress& in, CDM::AcuteRespiratoryDistressData& out); // class SEAcuteStress; - static void Marshall(const CDM::AcuteStressData& in, SEAcuteStress& out); - static void UnMarshall(const SEAcuteStress& in, CDM::AcuteStressData& out); + static void UnMarshall(const CDM::AcuteStressData& in, SEAcuteStress& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEAcuteStress& in, CDM::AcuteStressData& out); // class SEExampleAction; - static void Marshall(const CDM::ExampleActionData& in, SEExampleAction& out); - static void UnMarshall(const SEExampleAction& in, CDM::ExampleActionData& out); + static void UnMarshall(const CDM::ExampleActionData& in, SEExampleAction& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEExampleAction& in, CDM::ExampleActionData& out); // class SEAirwayObstruction; - static void Marshall(const CDM::AirwayObstructionData& in, SEAirwayObstruction& out); - static void UnMarshall(const SEAirwayObstruction& in, CDM::AirwayObstructionData& out); + static void UnMarshall(const CDM::AirwayObstructionData& in, SEAirwayObstruction& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEAirwayObstruction& in, CDM::AirwayObstructionData& out); + // class SEAmputation; + static void UnMarshall(const CDM::AmputationData& in, SEAmputation& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEAmputation& in, CDM::AmputationData& out); // class SEApnea; - static void Marshall(const CDM::ApneaData& in, SEApnea& out); - static void UnMarshall(const SEApnea& in, CDM::ApneaData& out); + static void UnMarshall(const CDM::ApneaData& in, SEApnea& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEApnea& in, CDM::ApneaData& out); // class SEAsthmaAttack; - static void Marshall(const CDM::AsthmaAttackData& in, SEAsthmaAttack& out); - static void UnMarshall(const SEAsthmaAttack& in, CDM::AsthmaAttackData& out); + static void UnMarshall(const CDM::AsthmaAttackData& in, SEAsthmaAttack& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEAsthmaAttack& in, CDM::AsthmaAttackData& out); // class SEBrainInjury; - static void Marshall(const CDM::BrainInjuryData& in, SEBrainInjury& out); - static void UnMarshall(const SEBrainInjury& in, CDM::BrainInjuryData& out); + static void UnMarshall(const CDM::BrainInjuryData& in, SEBrainInjury& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEBrainInjury& in, CDM::BrainInjuryData& out); // class SEBronchoconstriction; - static void Marshall(const CDM::BronchoconstrictionData& in, SEBronchoconstriction& out); - static void UnMarshall(const SEBronchoconstriction& in, CDM::BronchoconstrictionData& out); + static void UnMarshall(const CDM::BronchoconstrictionData& in, SEBronchoconstriction& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEBronchoconstriction& in, CDM::BronchoconstrictionData& out); // class SEBurnWound; - static void Marshall(const CDM::BurnWoundData& in, SEBurnWound& out); - static void UnMarshall(const SEBurnWound& in, CDM::BurnWoundData& out); + static void UnMarshall(const CDM::BurnWoundData& in, SEBurnWound& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEBurnWound& in, CDM::BurnWoundData& out); // class SECardiacArrest; - static void Marshall(const CDM::CardiacArrestData& in, SECardiacArrest& out); - static void UnMarshall(const SECardiacArrest& in, CDM::CardiacArrestData& out); + static void UnMarshall(const CDM::CardiacArrestData& in, SECardiacArrest& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SECardiacArrest& in, CDM::CardiacArrestData& out); // class SEChestCompression; - static void Marshall(const CDM::ChestCompressionData& in, SEChestCompression& out); - static void UnMarshall(const SEChestCompression& in, CDM::ChestCompressionData& out); + static void UnMarshall(const CDM::ChestCompressionData& in, SEChestCompression& out); + static void Marshall(const SEChestCompression& in, CDM::ChestCompressionData& out); // class SEChestCompressionForce; - static void Marshall(const CDM::ChestCompressionForceData& in, SEChestCompressionForce& out); - static void UnMarshall(const SEChestCompressionForce& in, CDM::ChestCompressionForceData& out); + static void UnMarshall(const CDM::ChestCompressionForceData& in, SEChestCompressionForce& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEChestCompressionForce& in, CDM::ChestCompressionForceData& out); // class SEChestCompressionForceScale; - static void Marshall(const CDM::ChestCompressionForceScaleData& in, SEChestCompressionForceScale& out); - static void UnMarshall(const SEChestCompressionForceScale& in, CDM::ChestCompressionForceScaleData& out); + static void UnMarshall(const CDM::ChestCompressionForceScaleData& in, SEChestCompressionForceScale& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEChestCompressionForceScale& in, CDM::ChestCompressionForceScaleData& out); + // class SENeedleDecompression; + static void UnMarshall(const CDM::ChestTubeData& in, SEChestTube& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEChestTube& in, CDM::ChestTubeData& out); // class SEChestOcclusiveDressing; - static void Marshall(const CDM::ChestOcclusiveDressingData& in, SEChestOcclusiveDressing& out); - static void UnMarshall(const SEChestOcclusiveDressing& in, CDM::ChestOcclusiveDressingData& out); + static void UnMarshall(const CDM::ChestOcclusiveDressingData& in, SEChestOcclusiveDressing& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEChestOcclusiveDressing& in, CDM::ChestOcclusiveDressingData& out); // class SEConsciousRespirationCommand; - static void Marshall(const CDM::ConsciousRespirationCommandData& in, SEConsciousRespirationCommand& out); - static void UnMarshall(const SEConsciousRespirationCommand& in, CDM::ConsciousRespirationCommandData& out); + static void UnMarshall(const CDM::ConsciousRespirationCommandData& in, SEConsciousRespirationCommand& out); + static void Marshall(const SEConsciousRespirationCommand& in, CDM::ConsciousRespirationCommandData& out); // class SEEbola; - static void Marshall(const CDM::EbolaData& in, SEEbola& out); - static void UnMarshall(const SEEbola& in, CDM::EbolaData& out); + static void UnMarshall(const CDM::EbolaData& in, SEEbola& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEEbola& in, CDM::EbolaData& out); // class SEEscharotomy - static void Marshall(const CDM::EscharotomyData& in, SEEscharotomy& out); - static void UnMarshall(const SEEscharotomy& in, CDM::EscharotomyData& out); + static void UnMarshall(const CDM::EscharotomyData& in, SEEscharotomy& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEEscharotomy& in, CDM::EscharotomyData& out); // class SEExercise; - static void Marshall(const CDM::ExerciseData& in, SEExercise& out); - static void UnMarshall(const SEExercise& in, CDM::ExerciseData& out); + static void UnMarshall(const CDM::ExerciseData& in, SEExercise& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEExercise& in, CDM::ExerciseData& out); + // class SEFracture; + static void UnMarshall(const CDM::FractureData& in, SEFracture& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEFracture& in, CDM::FractureData& out); // class SEForcedInhale; - static void Marshall(const CDM::ForcedInhaleData& in, SEForcedInhale& out); - static void UnMarshall(const SEForcedInhale& in, CDM::ForcedInhaleData& out); + static void UnMarshall(const CDM::ForcedInhaleData& in, SEForcedInhale& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEForcedInhale& in, CDM::ForcedInhaleData& out); // class SEForcedExhale; - static void Marshall(const CDM::ForcedExhaleData& in, SEForcedExhale& out); - static void UnMarshall(const SEForcedExhale& in, CDM::ForcedExhaleData& out); + static void UnMarshall(const CDM::ForcedExhaleData& in, SEForcedExhale& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEForcedExhale& in, CDM::ForcedExhaleData& out); // class SEBreathHold; - static void Marshall(const CDM::BreathHoldData& in, SEBreathHold& out); - static void UnMarshall(const SEBreathHold& in, CDM::BreathHoldData& out); + static void UnMarshall(const CDM::BreathHoldData& in, SEBreathHold& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEBreathHold& in, CDM::BreathHoldData& out); // class SEUseInhaler; - static void Marshall(const CDM::UseInhalerData& in, SEUseInhaler& out); - static void UnMarshall(const SEUseInhaler& in, CDM::UseInhalerData& out); + static void UnMarshall(const CDM::UseInhalerData& in, SEUseInhaler& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEUseInhaler& in, CDM::UseInhalerData& out); // class SEConsciousRespiration; - static void Marshall(const CDM::ConsciousRespirationData& in, SEConsciousRespiration& out); - static void UnMarshall(const SEConsciousRespiration& in, CDM::ConsciousRespirationData& out); + static void UnMarshall(const CDM::ConsciousRespirationData& in, SEConsciousRespiration& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEConsciousRespiration& in, CDM::ConsciousRespirationData& out); // class SEConsumeNutrients; - static void Marshall(const CDM::ConsumeNutrientsData& in, SEConsumeNutrients& out); - static void UnMarshall(const SEConsumeNutrients& in, CDM::ConsumeNutrientsData& out); + static void UnMarshall(const CDM::ConsumeNutrientsData& in, SEConsumeNutrients& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEConsumeNutrients& in, CDM::ConsumeNutrientsData& out); // class SEHemorrhage; - static void Marshall(const CDM::HemorrhageData& in, SEHemorrhage& out); - static void UnMarshall(const SEHemorrhage& in, CDM::HemorrhageData& out); + static void UnMarshall(const CDM::HemorrhageData& in, SEHemorrhage& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEHemorrhage& in, CDM::HemorrhageData& out); // class SEInfection; - static void Marshall(const CDM::InfectionData& in, SEInfection& out); - static void UnMarshall(const SEInfection& in, CDM::InfectionData& out); + static void UnMarshall(const CDM::InfectionData& in, SEInfection& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEInfection& in, CDM::InfectionData& out); // class SEIntubation; - static void Marshall(const CDM::IntubationData& in, SEIntubation& out); - static void UnMarshall(const SEIntubation& in, CDM::IntubationData& out); + static void UnMarshall(const CDM::IntubationData& in, SEIntubation& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEIntubation& in, CDM::IntubationData& out); // class SEMechanicalVentilation; - static void Marshall(const CDM::MechanicalVentilationData& in, const SESubstanceManager& substances, SEMechanicalVentilation& out); - static void UnMarshall(const SEMechanicalVentilation& in, CDM::MechanicalVentilationData& out); + static void UnMarshall(const CDM::MechanicalVentilationData& in, const SESubstanceManager& substances, SEMechanicalVentilation& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEMechanicalVentilation& in, CDM::MechanicalVentilationData& out); // class SENasalCannula; - static void Marshall(const CDM::NasalCannulaData& in, SENasalCannula& out); - static void UnMarshall(const SENasalCannula& in, CDM::NasalCannulaData& out); + static void UnMarshall(const CDM::NasalCannulaData& in, SENasalCannula& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SENasalCannula& in, CDM::NasalCannulaData& out); // class SENasalState; - static void Marshall(const CDM::NasalStateData& in, SENasalState& out); - static void UnMarshall(const SENasalState& in, CDM::NasalStateData& out); + static void UnMarshall(const CDM::NasalStateData& in, SENasalState& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SENasalState& in, CDM::NasalStateData& out); // class SENeedleDecompression; - static void Marshall(const CDM::NeedleDecompressionData& in, SENeedleDecompression& out); - static void UnMarshall(const SENeedleDecompression& in, CDM::NeedleDecompressionData& out); + static void UnMarshall(const CDM::NeedleDecompressionData& in, SENeedleDecompression& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SENeedleDecompression& in, CDM::NeedleDecompressionData& out); // class SEPainStimulus; - static void Marshall(const CDM::PainStimulusData& in, SEPainStimulus& out); - static void UnMarshall(const SEPainStimulus& in, CDM::PainStimulusData& out); + static void UnMarshall(const CDM::PainStimulusData& in, SEPainStimulus& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEPainStimulus& in, CDM::PainStimulusData& out); // class SEPericardialEffusion; - static void Marshall(const CDM::PericardialEffusionData& in, SEPericardialEffusion& out); - static void UnMarshall(const SEPericardialEffusion& in, CDM::PericardialEffusionData& out); + static void UnMarshall(const CDM::PericardialEffusionData& in, SEPericardialEffusion& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEPericardialEffusion& in, CDM::PericardialEffusionData& out); // class SEPulmonaryShunt; - static void Marshall(const CDM::PulmonaryShuntData& in, SEPulmonaryShunt& out); - static void UnMarshall(const SEPulmonaryShunt& in, CDM::PulmonaryShuntData& out); + static void UnMarshall(const CDM::PulmonaryShuntData& in, SEPulmonaryShunt& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEPulmonaryShunt& in, CDM::PulmonaryShuntData& out); // class SERadiationAbsorbedDose; - static void Marshall(const CDM::RadiationAbsorbedDoseData& in, SERadiationAbsorbedDose& out); - static void UnMarshall(const SERadiationAbsorbedDose& in, CDM::RadiationAbsorbedDoseData& out); + static void UnMarshall(const CDM::RadiationAbsorbedDoseData& in, SERadiationAbsorbedDose& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SERadiationAbsorbedDose& in, CDM::RadiationAbsorbedDoseData& out); // class SESleep; - static void Marshall(const CDM::SleepData& in, SESleep& out); - static void UnMarshall(const SESleep& in, CDM::SleepData& out); + static void UnMarshall(const CDM::SleepData& in, SESleep& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SESleep& in, CDM::SleepData& out); // class SESubstanceNasalDose; - static void Marshall(const CDM::SubstanceNasalDoseData& in, SESubstanceNasalDose& out); - static void UnMarshall(const SESubstanceNasalDose& in, CDM::SubstanceNasalDoseData& out); + static void UnMarshall(const CDM::SubstanceNasalDoseData& in, SESubstanceNasalDose& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SESubstanceNasalDose& in, CDM::SubstanceNasalDoseData& out); // class SETensionPneumothorax; - static void Marshall(const CDM::TensionPneumothoraxData& in, SETensionPneumothorax& out); - static void UnMarshall(const SETensionPneumothorax& in, CDM::TensionPneumothoraxData& out); + static void UnMarshall(const CDM::TensionPneumothoraxData& in, SETensionPneumothorax& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SETensionPneumothorax& in, CDM::TensionPneumothoraxData& out); // class SESubstanceAdministration; - static void Marshall(const CDM::SubstanceAdministrationData& in, SESubstanceAdministration& out); - static void UnMarshall(const SESubstanceAdministration& in, CDM::SubstanceAdministrationData& out); + static void UnMarshall(const CDM::SubstanceAdministrationData& in, SESubstanceAdministration& out); + static void Marshall(const SESubstanceAdministration& in, CDM::SubstanceAdministrationData& out); // class SESubstanceBolus; - static void Marshall(const CDM::SubstanceBolusData& in, SESubstanceBolus& out); - static void UnMarshall(const SESubstanceBolus& in, CDM::SubstanceBolusData& out); + static void UnMarshall(const CDM::SubstanceBolusData& in, SESubstanceBolus& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SESubstanceBolus& in, CDM::SubstanceBolusData& out); // class SESubstanceBolusState; - static void Marshall(const CDM::SubstanceBolusStateData& in, SESubstanceBolusState& out); - static void UnMarshall(const SESubstanceBolusState& in, CDM::SubstanceBolusStateData& out); + static void UnMarshall(const CDM::SubstanceBolusStateData& in, SESubstanceBolusState& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SESubstanceBolusState& in, CDM::SubstanceBolusStateData& out); // class SESubstanceCompoundInfusion; - static void Marshall(const CDM::SubstanceCompoundInfusionData& in, SESubstanceCompoundInfusion& out); - static void UnMarshall(const SESubstanceCompoundInfusion& in, CDM::SubstanceCompoundInfusionData& out); + static void UnMarshall(const CDM::SubstanceCompoundInfusionData& in, SESubstanceCompoundInfusion& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SESubstanceCompoundInfusion& in, CDM::SubstanceCompoundInfusionData& out); // class SESubstanceInfusion; - static void Marshall(const CDM::SubstanceInfusionData& in, SESubstanceInfusion& out); - static void UnMarshall(const SESubstanceInfusion& in, CDM::SubstanceInfusionData& out); + static void UnMarshall(const CDM::SubstanceInfusionData& in, SESubstanceInfusion& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SESubstanceInfusion& in, CDM::SubstanceInfusionData& out); // class SESubstanceOralDose; - static void Marshall(const CDM::SubstanceOralDoseData& in, SESubstanceOralDose& out); - static void UnMarshall(const SESubstanceOralDose& in, CDM::SubstanceOralDoseData& out); + static void UnMarshall(const CDM::SubstanceOralDoseData& in, SESubstanceOralDose& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SESubstanceOralDose& in, CDM::SubstanceOralDoseData& out); // class SETransmucosalState; - static void Marshall(const CDM::TransmucosalStateData& in, SETransmucosalState& out); - static void UnMarshall(const SETransmucosalState& in, CDM::TransmucosalStateData& out); + static void UnMarshall(const CDM::TransmucosalStateData& in, SETransmucosalState& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SETransmucosalState& in, CDM::TransmucosalStateData& out); // class SETourniquet; - static void Marshall(const CDM::TourniquetData& in, SETourniquet& out); - static void UnMarshall(const SETourniquet& in, CDM::TourniquetData& out); + static void UnMarshall(const CDM::TourniquetData& in, SETourniquet& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SETourniquet& in, CDM::TourniquetData& out); // class SEUrinate; - static void Marshall(const CDM::UrinateData& in, SEUrinate& out); - static void UnMarshall(const SEUrinate& in, CDM::UrinateData& out); + static void UnMarshall(const CDM::UrinateData& in, SEUrinate& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEUrinate& in, CDM::UrinateData& out); // class SEOverride; - static void Marshall(const CDM::OverrideData& in, SEOverride& out); - static void UnMarshall(const SEOverride& in, CDM::OverrideData& out); + static void UnMarshall(const CDM::OverrideData& in, SEOverride& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEOverride& in, CDM::OverrideData& out); + + // SEBrainInjuryType + static void UnMarshall(const CDM::enumBrainInjuryType& in, SEBrainInjuryType& out); + static void Marshall(const SEBrainInjuryType& in, CDM::enumBrainInjuryType& out); + // SEBolusAdministration + static void UnMarshall(const CDM::enumBolusAdministration& in, SEBolusAdministration& out); + static void Marshall(const SEBolusAdministration& in, CDM::enumBolusAdministration& out); + // SEBurnDegree + static void UnMarshall(const CDM::enumBurnDegree& in, SEBurnDegree& out); + static void Marshall(const SEBurnDegree& in, CDM::enumBurnDegree& out); + // SEFracturedBone + static void UnMarshall(const CDM::enumBone& in, SEFracturedBone& out); + static void Marshall(const SEFracturedBone& in, CDM::enumBone& out); + // SEFractureType + static void UnMarshall(const CDM::enumFractureTypes& in, SEFractureType& out); + static void Marshall(const SEFractureType& in, CDM::enumFractureTypes& out); + // SEInfectionSeverity + static void UnMarshall(const CDM::enumInfectionSeverity& in, SEInfectionSeverity& out); + static void Marshall(const SEInfectionSeverity& in, CDM::enumInfectionSeverity& out); + // SEIntubationType + static void UnMarshall(const CDM::enumIntubationType& in, SEIntubationType& out); + static void Marshall(const SEIntubationType& in, CDM::enumIntubationType& out); + // SEPatientAssessmentType + static void UnMarshall(const CDM::enumPatientAssessment& in, SEPatientAssessmentType& out); + static void Marshall(const SEPatientAssessmentType& in, CDM::enumPatientAssessment& out); + // SEPneumothoraxType + static void UnMarshall(const CDM::enumPneumothoraxType& in, SEPneumothoraxType& out); + static void Marshall(const SEPneumothoraxType& in, CDM::enumPneumothoraxType& out); + // SEOralAdministrationType + static void UnMarshall(const CDM::enumOralAdministration in, SEOralAdministrationType& out); + static void Marshall(const SEOralAdministrationType& in, CDM::enumOralAdministration& out); + // SETourniquetApplicationType + static void UnMarshall(const CDM::enumTourniquetApplicationLevel& in, SETourniquetApplicationType& out); + static void Marshall(const SETourniquetApplicationType& in, CDM::enumTourniquetApplicationLevel& out); }; //---------------------------------------------------------------------------------- - template - void PatientActions::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + template ::value>*> + void PatientActions::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) + { + if (!option_in.present() || option_in->empty()) { + out = SE::Invalid; + } else { + io::PatientActions::UnMarshall(option_in.get(), out); + } + } + + template ::value>*> + void PatientActions::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) { if (!option_in.present()) { - out.Clear()(); + out.Invalidate(); } else { - Marshall(option_in.get(), out); + io::PatientActions::UnMarshall(option_in.get(), out); } } - //---------------------------------------------------------------------------------- + template - void PatientActions::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void PatientActions::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { + auto item = std::make_unique(); - UnMarshall(in, *item); - option_out.set(*item); + io::PatientActions::Marshall(in, *item); + option_out.set(std::move(item)); } } // Namespace IO + +// Operators +bool operator==(CDM::enumBrainInjuryType const& lhs, SEBrainInjuryType const& rhs); +bool operator==(CDM::enumBolusAdministration const& lhs, SEBolusAdministration const& rhs); +bool operator==(CDM::enumBurnDegree const& lhs, SEBurnDegree const& rhs); +bool operator==(CDM::enumBone const& lhs, SEFracturedBone const& rhs); +bool operator==(CDM::enumFractureTypes const& lhs, SEFractureType const& rhs); +bool operator==(CDM::enumInfectionSeverity const& lhs, SEInfectionSeverity const& rhs); +bool operator==(CDM::enumIntubationType const& lhs, SEIntubationType const& rhs); +bool operator==(CDM::enumPatientAssessment const& lhs, SEPatientAssessmentType const& rhs); +bool operator==(CDM::enumPneumothoraxType const& lhs, SEPneumothoraxType const& rhs); +bool operator==(CDM::enumOralAdministration const& lhs, SEOralAdministrationType const& rhs); +bool operator==(CDM::enumTourniquetApplicationLevel const& lhs, SETourniquetApplicationType const& rhs); + +inline bool operator==(SEBrainInjuryType const& lhs, CDM::enumBrainInjuryType const& rhs) +{ + return rhs == lhs; +} +inline bool operator==(SEBolusAdministration const& lhs, CDM::enumBolusAdministration const& rhs) +{ + return rhs == lhs; +} +inline bool operator==(SEBurnDegree const& lhs, CDM::enumBurnDegree const& rhs) +{ + return rhs == lhs; +} +inline bool operator==(SEFracturedBone const& lhs, CDM::enumBone const& rhs) +{ + return rhs == lhs; +} +inline bool operator==(SEFractureType const& lhs, CDM::enumFractureTypes const& rhs) +{ + return rhs == lhs; +} +inline bool operator==(SEInfectionSeverity const& lhs, CDM::enumInfectionSeverity const& rhs) +{ + return rhs == lhs; +} +inline bool operator==(SEIntubationType const& lhs, CDM::enumIntubationType const& rhs) +{ + return rhs == lhs; +} +inline bool operator==(SEPatientAssessmentType const& lhs, CDM::enumPatientAssessment const& rhs) +{ + return rhs == lhs; +} +inline bool operator==(SEPneumothoraxType const& lhs, CDM::enumPneumothoraxType const& rhs) +{ + return rhs == lhs; +} +inline bool operator==(SEOralAdministrationType const& lhs, CDM::enumOralAdministration const& rhs) +{ + return rhs == lhs; +} +inline bool operator==(SETourniquetApplicationType const& lhs, CDM::enumTourniquetApplicationLevel const& rhs) +{ + return rhs == lhs; +} + +inline bool operator!=(CDM::enumBrainInjuryType const& lhs, SEBrainInjuryType const& rhs) +{ + return !(lhs == rhs); +} +inline bool operator!=(CDM::enumBolusAdministration const& lhs, SEBolusAdministration const& rhs) +{ + return !(lhs == rhs); +} +inline bool operator!=(CDM::enumBurnDegree const& lhs, SEBurnDegree const& rhs) +{ + return !(lhs == rhs); +} +inline bool operator!=(CDM::enumBone const& lhs, SEFracturedBone const& rhs) +{ + return !(lhs == rhs); +} +inline bool operator!=(CDM::enumFractureTypes const& lhs, SEFractureType const& rhs) +{ + return !(lhs == rhs); +} +inline bool operator!=(CDM::enumInfectionSeverity const& lhs, SEInfectionSeverity const& rhs) +{ + return !(lhs == rhs); +} +inline bool operator!=(CDM::enumIntubationType const& lhs, SEIntubationType const& rhs) +{ + return !(lhs == rhs); +} +inline bool operator!=(CDM::enumPatientAssessment const& lhs, SEPatientAssessmentType const& rhs) +{ + return !(lhs == rhs); +} +inline bool operator!=(CDM::enumPneumothoraxType const& lhs, SEPneumothoraxType const& rhs) +{ + return !(lhs == rhs); +} +inline bool operator!=(CDM::enumOralAdministration const& lhs, SEOralAdministrationType const& rhs) +{ + return !(lhs == rhs); +} +inline bool operator!=(CDM::enumTourniquetApplicationLevel const& lhs, SETourniquetApplicationType const& rhs) +{ + return !(lhs == rhs); +} + +inline bool operator!=(SEBrainInjuryType const& lhs, CDM::enumBrainInjuryType const& rhs) +{ + return !(rhs == lhs); +} +inline bool operator!=(SEBolusAdministration const& lhs, CDM::enumBolusAdministration const& rhs) +{ + return !(rhs == lhs); +} +inline bool operator!=(SEBurnDegree const& lhs, CDM::enumBurnDegree const& rhs) +{ + return !(rhs == lhs); +} +inline bool operator!=(SEFracturedBone const& lhs, CDM::enumBone const& rhs) +{ + return !(rhs == lhs); +} +inline bool operator!=(SEFractureType const& lhs, CDM::enumFractureTypes const& rhs) +{ + return !(rhs == lhs); +} +inline bool operator!=(SEInfectionSeverity const& lhs, CDM::enumInfectionSeverity const& rhs) +{ + return !(rhs == lhs); } // Namespace Biogears +inline bool operator!=(SEIntubationType const& lhs, CDM::enumIntubationType const& rhs) +{ + return !(rhs == lhs); +} +inline bool operator!=(SEPatientAssessmentType const& lhs, CDM::enumPatientAssessment const& rhs) +{ + return !(rhs == lhs); +} +inline bool operator!=(SEPneumothoraxType const& lhs, CDM::enumPneumothoraxType const& rhs) +{ + return !(rhs == lhs); +} +inline bool operator!=(SEOralAdministrationType const& lhs, CDM::enumOralAdministration const& rhs) +{ + return !(rhs == lhs); +} +inline bool operator!=(SETourniquetApplicationType const& lhs, CDM::enumTourniquetApplicationLevel const& rhs) +{ + return !(rhs == lhs); +} + +} diff --git a/projects/biogears/libBiogears/src/io/cdm/PatientAssessments.cpp b/projects/biogears/libBiogears/src/io/cdm/PatientAssessments.cpp index 0ccffdea9..48ecb73eb 100644 --- a/projects/biogears/libBiogears/src/io/cdm/PatientAssessments.cpp +++ b/projects/biogears/libBiogears/src/io/cdm/PatientAssessments.cpp @@ -1,3 +1,4 @@ + #include "PatientAssessments.h" #include "Property.h" @@ -22,352 +23,558 @@ namespace biogears { namespace io { // class SEPatientAssessment - void PatientAssessments::Marshall(const CDM::PatientAssessmentData& in, SEPatientAssessment& out) + void PatientAssessments::UnMarshall(const CDM::PatientAssessmentData& in, SEPatientAssessment& out) { - // Empty Marshall + // Empty UnMarshall } //---------------------------------------------------------------------------------- - void PatientAssessments::UnMarshall(const SEPatientAssessment& in, CDM::PatientAssessmentData& out) + void PatientAssessments::Marshall(const SEPatientAssessment& in, CDM::PatientAssessmentData& out) { - // Empty UnMarshall + // Empty Marshall } //---------------------------------------------------------------------------------- // class SEArterialBloodGasAnalysis - void PatientAssessments::Marshall(const CDM::ArterialBloodGasAnalysisData& in, SEArterialBloodGasAnalysis& out) + void PatientAssessments::UnMarshall(const CDM::ArterialBloodGasAnalysisData& in, SEArterialBloodGasAnalysis& out) { - Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.pH(), out.GetpH()); - io::Property::Marshall(in.PartialPressureOxygen(), out.GetPartialPressureOxygen()); - io::Property::Marshall(in.PartialPressureCarbonDioxide(), out.GetPartialPressureCarbonDioxide()); - io::Property::Marshall(in.BaseExcess(), out.GetBaseExcess()); - io::Property::Marshall(in.StandardBicarbonate(), out.GetStandardBicarbonate()); - io::Property::Marshall(in.OxygenSaturation(), out.GetOxygenSaturation()); + UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.pH(), out.GetpH()); + io::Property::UnMarshall(in.PartialPressureOxygen(), out.GetPartialPressureOxygen()); + io::Property::UnMarshall(in.PartialPressureCarbonDioxide(), out.GetPartialPressureCarbonDioxide()); + io::Property::UnMarshall(in.BaseExcess(), out.GetBaseExcess()); + io::Property::UnMarshall(in.StandardBicarbonate(), out.GetStandardBicarbonate()); + io::Property::UnMarshall(in.OxygenSaturation(), out.GetOxygenSaturation()); } //---------------------------------------------------------------------------------- - void PatientAssessments::UnMarshall(const SEArterialBloodGasAnalysis& in, CDM::ArterialBloodGasAnalysisData& out) + void PatientAssessments::Marshall(const SEArterialBloodGasAnalysis& in, CDM::ArterialBloodGasAnalysisData& out) { - UnMarshall(static_cast(in), static_cast(out)); + Marshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, pH) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, PartialPressureOxygen) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, PartialPressureCarbonDioxide) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, BaseExcess) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, StandardBicarbonate) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, OxygenSaturation) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, pH) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, PartialPressureOxygen) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, PartialPressureCarbonDioxide) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, BaseExcess) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, StandardBicarbonate) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, OxygenSaturation) } //---------------------------------------------------------------------------------- // class SEPulmonaryFunctionTest - void PatientAssessments::Marshall(const CDM::PulmonaryFunctionTestData& in, SEPulmonaryFunctionTest& out) + void PatientAssessments::UnMarshall(const CDM::PulmonaryFunctionTestData& in, SEPulmonaryFunctionTest& out) { - Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.ExpiratoryReserveVolume(), out.GetExpiratoryReserveVolume()); - io::Property::Marshall(in.ForcedVitalCapacity(), out.GetForcedVitalCapacity()); - io::Property::Marshall(in.ForcedExpiratoryVolume(), out.GetForcedExpiratoryVolume()); - io::Property::Marshall(in.ForcedExpiratoryFlow(), out.GetForcedExpiratoryFlow()); - io::Property::Marshall(in.FunctionalResidualCapacity(), out.GetFunctionalResidualCapacity()); - io::Property::Marshall(in.InspiratoryReserveVolume(), out.GetInspiratoryReserveVolume()); - io::Property::Marshall(in.MaximumVoluntaryVentilation(), out.GetMaximumVoluntaryVentilation()); - io::Property::Marshall(in.PeakExpiratoryFlow(), out.GetPeakExpiratoryFlow()); - io::Property::Marshall(in.ResidualVolume(), out.GetResidualVolume()); - io::Property::Marshall(in.SlowVitalCapacity(), out.GetSlowVitalCapacity()); - io::Property::Marshall(in.TotalLungCapacity(), out.GetTotalLungCapacity()); - io::Property::Marshall(in.VitalCapacity(), out.GetVitalCapacity()); - io::Property::Marshall(in.LungVolumePlot(), out.GetLungVolumePlot()); + UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.ExpiratoryReserveVolume(), out.GetExpiratoryReserveVolume()); + io::Property::UnMarshall(in.ForcedVitalCapacity(), out.GetForcedVitalCapacity()); + io::Property::UnMarshall(in.ForcedExpiratoryVolume(), out.GetForcedExpiratoryVolume()); + io::Property::UnMarshall(in.ForcedExpiratoryFlow(), out.GetForcedExpiratoryFlow()); + io::Property::UnMarshall(in.FunctionalResidualCapacity(), out.GetFunctionalResidualCapacity()); + io::Property::UnMarshall(in.InspiratoryReserveVolume(), out.GetInspiratoryReserveVolume()); + io::Property::UnMarshall(in.MaximumVoluntaryVentilation(), out.GetMaximumVoluntaryVentilation()); + io::Property::UnMarshall(in.PeakExpiratoryFlow(), out.GetPeakExpiratoryFlow()); + io::Property::UnMarshall(in.ResidualVolume(), out.GetResidualVolume()); + io::Property::UnMarshall(in.SlowVitalCapacity(), out.GetSlowVitalCapacity()); + io::Property::UnMarshall(in.TotalLungCapacity(), out.GetTotalLungCapacity()); + io::Property::UnMarshall(in.VitalCapacity(), out.GetVitalCapacity()); + io::Property::UnMarshall(in.LungVolumePlot(), out.GetLungVolumePlot()); } //---------------------------------------------------------------------------------- - void PatientAssessments::UnMarshall(const SEPulmonaryFunctionTest& in, CDM::PulmonaryFunctionTestData& out) + void PatientAssessments::Marshall(const SEPulmonaryFunctionTest& in, CDM::PulmonaryFunctionTestData& out) { - UnMarshall(static_cast(in), static_cast(out)); - - if (in.m_ExpiratoryReserveVolume != nullptr) - io::Property::UnMarshall(*in.m_ExpiratoryReserveVolume, out.ExpiratoryReserveVolume()); - if (in.m_ForcedVitalCapacity != nullptr) - io::Property::UnMarshall(*in.m_ForcedVitalCapacity, out.ForcedVitalCapacity()); - if (in.m_ForcedExpiratoryVolume != nullptr) - io::Property::UnMarshall(*in.m_ForcedExpiratoryVolume, out.ForcedExpiratoryVolume()); - if (in.m_ForcedExpiratoryFlow != nullptr) - io::Property::UnMarshall(*in.m_ForcedExpiratoryFlow, out.ForcedExpiratoryFlow()); - if (in.m_FunctionalResidualCapacity != nullptr) - io::Property::UnMarshall(*in.m_FunctionalResidualCapacity, out.FunctionalResidualCapacity()); - if (in.m_InspiratoryCapacity != nullptr) - io::Property::UnMarshall(*in.m_InspiratoryCapacity, out.InspiratoryCapacity()); - if (in.m_InspiratoryReserveVolume != nullptr) - io::Property::UnMarshall(*in.m_InspiratoryReserveVolume, out.InspiratoryReserveVolume()); - if (in.m_MaximumVoluntaryVentilation != nullptr) - io::Property::UnMarshall(*in.m_MaximumVoluntaryVentilation, out.MaximumVoluntaryVentilation()); - if (in.m_PeakExpiratoryFlow != nullptr) - io::Property::UnMarshall(*in.m_PeakExpiratoryFlow, out.PeakExpiratoryFlow()); - if (in.m_ResidualVolume != nullptr) - io::Property::UnMarshall(*in.m_ResidualVolume, out.ResidualVolume()); - if (in.m_SlowVitalCapacity != nullptr) - io::Property::UnMarshall(*in.m_SlowVitalCapacity, out.SlowVitalCapacity()); - if (in.m_TotalLungCapacity != nullptr) - io::Property::UnMarshall(*in.m_TotalLungCapacity, out.TotalLungCapacity()); - if (in.m_VitalCapacity != nullptr) - io::Property::UnMarshall(*in.m_VitalCapacity, out.VitalCapacity()); - if (in.m_LungVolumePlot != nullptr) - io::Property::UnMarshall(*in.m_LungVolumePlot, out.LungVolumePlot()); + Marshall(static_cast(in), static_cast(out)); + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ExpiratoryReserveVolume) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ForcedVitalCapacity) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ForcedExpiratoryVolume) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ForcedExpiratoryFlow) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, FunctionalResidualCapacity) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, InspiratoryCapacity) + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, InspiratoryReserveVolume) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MaximumVoluntaryVentilation) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PeakExpiratoryFlow) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ResidualVolume) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SlowVitalCapacity) + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TotalLungCapacity) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, VitalCapacity) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LungVolumePlot) } //---------------------------------------------------------------------------------- // class SECompleteBloodCount - void PatientAssessments::Marshall(const CDM::CompleteBloodCountData& in, SECompleteBloodCount& out) + void PatientAssessments::UnMarshall(const CDM::CompleteBloodCountData& in, SECompleteBloodCount& out) { - Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.Hematocrit(), out.GetHematocrit()); - io::Property::Marshall(in.Hemoglobin(), out.GetHemoglobin()); - io::Property::Marshall(in.LymphocyteCellCount(), out.GetLymphocyteCellCount()); - io::Property::Marshall(in.PlateletCount(), out.GetPlateletCount()); - io::Property::Marshall(in.MeanCorpuscularHemoglobin(), out.GetMeanCorpuscularHemoglobin()); - io::Property::Marshall(in.MeanCorpuscularHemoglobinConcentration(), out.GetMeanCorpuscularHemoglobinConcentration()); - io::Property::Marshall(in.MeanCorpuscularVolume(), out.GetMeanCorpuscularVolume()); - io::Property::Marshall(in.NeutrophilCellCount(), out.GetNeutrophilCount()); - io::Property::Marshall(in.RedBloodCellCount(), out.GetRedBloodCellCount()); - io::Property::Marshall(in.WhiteBloodCellCount(), out.GetWhiteBloodCellCount()); + UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.Hematocrit(), out.GetHematocrit()); + io::Property::UnMarshall(in.Hemoglobin(), out.GetHemoglobin()); + io::Property::UnMarshall(in.LymphocyteCellCount(), out.GetLymphocyteCellCount()); + io::Property::UnMarshall(in.PlateletCount(), out.GetPlateletCount()); + io::Property::UnMarshall(in.MeanCorpuscularHemoglobin(), out.GetMeanCorpuscularHemoglobin()); + io::Property::UnMarshall(in.MeanCorpuscularHemoglobinConcentration(), out.GetMeanCorpuscularHemoglobinConcentration()); + io::Property::UnMarshall(in.MeanCorpuscularVolume(), out.GetMeanCorpuscularVolume()); + io::Property::UnMarshall(in.NeutrophilCellCount(), out.GetNeutrophilCount()); + io::Property::UnMarshall(in.RedBloodCellCount(), out.GetRedBloodCellCount()); + io::Property::UnMarshall(in.WhiteBloodCellCount(), out.GetWhiteBloodCellCount()); } //---------------------------------------------------------------------------------- - void PatientAssessments::UnMarshall(const SECompleteBloodCount& in, CDM::CompleteBloodCountData& out) + void PatientAssessments::Marshall(const SECompleteBloodCount& in, CDM::CompleteBloodCountData& out) { - UnMarshall(static_cast(in), static_cast(out)); - - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Hematocrit) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Hemoglobin) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LymphocyteCellCount) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PlateletCount) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MeanCorpuscularHemoglobin) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MeanCorpuscularHemoglobinConcentration) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MeanCorpuscularVolume) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, NeutrophilCellCount) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RedBloodCellCount) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, WhiteBloodCellCount) + Marshall(static_cast(in), static_cast(out)); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Hematocrit) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Hemoglobin) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LymphocyteCellCount) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PlateletCount) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MeanCorpuscularHemoglobin) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MeanCorpuscularHemoglobinConcentration) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MeanCorpuscularVolume) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, NeutrophilCellCount) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RedBloodCellCount) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, WhiteBloodCellCount) } //---------------------------------------------------------------------------------- // class SEComprehensiveMetabolicPanel - void PatientAssessments::Marshall(const CDM::ComprehensiveMetabolicPanelData& in, SEComprehensiveMetabolicPanel& out) + void PatientAssessments::UnMarshall(const CDM::ComprehensiveMetabolicPanelData& in, SEComprehensiveMetabolicPanel& out) { - Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.Albumin(), out.GetAlbumin()); - io::Property::Marshall(in.ALP(), out.GetALP()); - io::Property::Marshall(in.ALT(), out.GetALT()); - io::Property::Marshall(in.AST(), out.GetAST()); - io::Property::Marshall(in.BUN(), out.GetBUN()); - io::Property::Marshall(in.Calcium(), out.GetCalcium()); - io::Property::Marshall(in.CO2(), out.GetCO2()); - io::Property::Marshall(in.Creatinine(), out.GetCreatinine()); - io::Property::Marshall(in.Glucose(), out.GetGlucose()); - io::Property::Marshall(in.Potassium(), out.GetPotassium()); - io::Property::Marshall(in.Sodium(), out.GetSodium()); - io::Property::Marshall(in.TotalBilirubin(), out.GetTotalBilirubin()); - io::Property::Marshall(in.TotalProtein(), out.GetTotalProtein()); + UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.Albumin(), out.GetAlbumin()); + io::Property::UnMarshall(in.ALP(), out.GetALP()); + io::Property::UnMarshall(in.ALT(), out.GetALT()); + io::Property::UnMarshall(in.AST(), out.GetAST()); + io::Property::UnMarshall(in.BUN(), out.GetBUN()); + io::Property::UnMarshall(in.Calcium(), out.GetCalcium()); + io::Property::UnMarshall(in.CO2(), out.GetCO2()); + io::Property::UnMarshall(in.Creatinine(), out.GetCreatinine()); + io::Property::UnMarshall(in.Glucose(), out.GetGlucose()); + io::Property::UnMarshall(in.Potassium(), out.GetPotassium()); + io::Property::UnMarshall(in.Sodium(), out.GetSodium()); + io::Property::UnMarshall(in.TotalBilirubin(), out.GetTotalBilirubin()); + io::Property::UnMarshall(in.TotalProtein(), out.GetTotalProtein()); } //---------------------------------------------------------------------------------- - void PatientAssessments::UnMarshall(const SEComprehensiveMetabolicPanel& in, CDM::ComprehensiveMetabolicPanelData& out) + void PatientAssessments::Marshall(const SEComprehensiveMetabolicPanel& in, CDM::ComprehensiveMetabolicPanelData& out) { - UnMarshall(static_cast(in), static_cast(out)); - if (in.HasAlbumin()) { - io::Property::UnMarshall(*in.m_Albumin, out.Albumin()); - } - if (in.HasALP()) { - io::Property::UnMarshall(*in.m_ALP, out.ALP()); - } - if (in.HasALT()) { - io::Property::UnMarshall(*in.m_ALT, out.ALT()); - } - if (in.HasAST()) { - io::Property::UnMarshall(*in.m_AST, out.AST()); - } - if (in.HasBUN()) { - io::Property::UnMarshall(*in.m_BUN, out.BUN()); - } - if (in.HasCalcium()) { - io::Property::UnMarshall(*in.m_Calcium, out.Calcium()); - } - if (in.HasChloride()) { - io::Property::UnMarshall(*in.m_Chloride, out.Chloride()); - } - if (in.HasCO2()) { - io::Property::UnMarshall(*in.m_CO2, out.CO2()); - } - if (in.HasCreatinine()) { - io::Property::UnMarshall(*in.m_Creatinine, out.Creatinine()); - } - if (in.HasGlucose()) { - io::Property::UnMarshall(*in.m_Glucose, out.Glucose()); - } - if (in.HasPotassium()) { - io::Property::UnMarshall(*in.m_Potassium, out.Potassium()); - } - if (in.HasSodium()) { - io::Property::UnMarshall(*in.m_Sodium, out.Sodium()); - } - if (in.HasTotalBilirubin()) { - io::Property::UnMarshall(*in.m_TotalBilirubin, out.TotalBilirubin()); - } - if (in.HasTotalProtein()) { - io::Property::UnMarshall(*in.m_TotalProtein, out.TotalProtein()); - } + Marshall(static_cast(in), static_cast(out)); + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Albumin) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ALP) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ALT) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, AST) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, BUN) + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Calcium) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Chloride) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, CO2) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Creatinine) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Glucose) + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Potassium) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Sodium) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TotalBilirubin) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TotalProtein) } //---------------------------------------------------------------------------------- // class SEUrinalysis - void PatientAssessments::Marshall(const CDM::UrinalysisData& in, SEUrinalysis& out) + void PatientAssessments::UnMarshall(const CDM::UrinalysisData& in, SEUrinalysis& out) { - Marshall(static_cast(in), static_cast(out)); - if (in.Color().present()) - out.m_Color = in.Color().get(); - if (in.Appearance().present()) - out.m_Appearance = in.Appearance().get(); - if (in.Glucose().present()) - out.m_Glucose = in.Glucose().get(); - if (in.Ketone().present()) - out.m_Ketone = in.Ketone().get(); - io::Property::Marshall(in.Bilirubin(), out.GetBilirubinResult()); - io::Property::Marshall(in.SpecificGravity(), out.GetSpecificGravityResult()); - if (in.Blood().present()) - out.m_Blood = in.Blood().get(); - io::Property::Marshall(in.pH(), out.GetPHResult()); - if (in.Protein().present()) - out.m_Protein = in.Protein().get(); - io::Property::Marshall(in.Urobilinogen(), out.GetUrobilinogenResult()); - if (in.Nitrite().present()) - out.m_Nitrite = in.Nitrite().get(); - if (in.LeukocyteEsterase().present()) - out.m_LeukocyteEsterase = in.LeukocyteEsterase().get(); - Marshall(in.Microscopic(), out.GetMicroscopicResult()); + UnMarshall(static_cast(in), static_cast(out)); + + UnMarshall(in.Color(), out.m_Color); + UnMarshall(in.Appearance(), out.m_Appearance); + UnMarshall(in.Glucose(), out.m_Glucose); + UnMarshall(in.Ketone(), out.m_Ketone); + + io::Property::UnMarshall(in.Bilirubin(), out.GetBilirubinResult()); + io::Property::UnMarshall(in.SpecificGravity(), out.GetSpecificGravityResult()); + + UnMarshall(in.Blood(), out.m_Blood); + io::Property::UnMarshall(in.pH(), out.GetPHResult()); + UnMarshall(in.Protein(), out.m_Protein); + io::Property::UnMarshall(in.Urobilinogen(), out.GetUrobilinogenResult()); + UnMarshall(in.Nitrite(), out.m_Nitrite); + UnMarshall(in.LeukocyteEsterase(), out.m_LeukocyteEsterase); + UnMarshall(in.Microscopic(), out.GetMicroscopicResult()); } //---------------------------------------------------------------------------------- - void PatientAssessments::UnMarshall(const SEUrinalysis& in, CDM::UrinalysisData& out) + void PatientAssessments::Marshall(const SEUrinalysis& in, CDM::UrinalysisData& out) { - UnMarshall(static_cast(in), static_cast(out)); - if (in.HasColorResult()) - out.Color(in.m_Color); - if (in.HasAppearanceResult()) - out.Appearance(in.m_Appearance); - if (in.HasGlucoseResult()) - out.Glucose(in.m_Glucose); - if (in.HasKetoneResult()) - out.Ketone(in.m_Ketone); - if (in.HasBilirubinResult()) { - io::Property::UnMarshall(*in.m_Bilirubin, out.Bilirubin()); - } - if (in.HasSpecificGravityResult()) { - io::Property::UnMarshall(*in.m_SpecificGravity, out.SpecificGravity()); - } - if (in.HasBloodResult()) - out.Blood(in.m_Blood); - if (in.HasPHResult()) { - io::Property::UnMarshall(*in.m_pH, out.pH()); - } - if (in.HasProteinResult()) - out.Protein(in.m_Protein); - if (in.HasUrobilinogenResult()) { - io::Property::UnMarshall(*in.m_Urobilinogen, out.Urobilinogen()); - } - if (in.HasNitriteResult()) - out.Nitrite(in.m_Nitrite); - if (in.HasLeukocyteEsteraseResult()) - out.LeukocyteEsterase(in.m_LeukocyteEsterase); + Marshall(static_cast(in), static_cast(out)); + + SE_OPTIONAL_PATIENT_ASSESSMENT_ENUM_PTR_MARSHALL_HELPER(in, out, Color) + SE_OPTIONAL_PATIENT_ASSESSMENT_ENUM_PTR_MARSHALL_HELPER(in, out, Appearance) + SE_OPTIONAL_PATIENT_ASSESSMENT_ENUM_PTR_MARSHALL_HELPER(in, out, Glucose) + SE_OPTIONAL_PATIENT_ASSESSMENT_ENUM_PTR_MARSHALL_HELPER(in, out, Ketone) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Bilirubin) + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SpecificGravity) + SE_OPTIONAL_PATIENT_ASSESSMENT_ENUM_PTR_MARSHALL_HELPER(in, out, Blood) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, pH) + + SE_OPTIONAL_PATIENT_ASSESSMENT_ENUM_PTR_MARSHALL_HELPER(in, out, Protein) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Urobilinogen) + + SE_OPTIONAL_PATIENT_ASSESSMENT_ENUM_PTR_MARSHALL_HELPER(in, out, Nitrite) + SE_OPTIONAL_PATIENT_ASSESSMENT_ENUM_PTR_MARSHALL_HELPER(in, out, LeukocyteEsterase) if (in.HasMicroscopicResult()) - UnMarshall(*in.m_Microscopic, out.Microscopic()); + Marshall(*in.m_Microscopic, out.Microscopic()); } //---------------------------------------------------------------------------------- // class SEUrinalysisMicroscopic - void PatientAssessments::Marshall(const CDM::UrinalysisMicroscopicData& in, SEUrinalysisMicroscopic& out) + void PatientAssessments::UnMarshall(const CDM::UrinalysisMicroscopicData& in, SEUrinalysisMicroscopic& out) { - Marshall(static_cast(in), static_cast(out)); + UnMarshall(static_cast(in), static_cast(out)); - out.m_ObservationType = in.ObservationType(); - io::Property::Marshall(in.RedBloodCells(), out.GetRedBloodCellsResult()); - io::Property::Marshall(in.WhiteBloodCells(), out.GetWhiteBloodCellsResult()); + UnMarshall(in.ObservationType(), out.m_ObservationType); + io::Property::UnMarshall(in.RedBloodCells(), out.GetRedBloodCellsResult()); + io::Property::UnMarshall(in.WhiteBloodCells(), out.GetWhiteBloodCellsResult()); if (in.EpithelialCells().present()) - out.m_EpithelialCells = in.EpithelialCells().get(); - io::Property::Marshall(in.Casts(), out.GetCastsResult()); - - if (in.Crystals().present()) - out.m_Crystals = in.Crystals().get(); - if (in.Bacteria().present()) - out.m_Bacteria = in.Bacteria().get(); - if (in.Trichomonads().present()) - out.m_Trichomonads = in.Trichomonads().get(); - if (in.Yeast().present()) - out.m_Yeast = in.Yeast().get(); + UnMarshall(in.EpithelialCells(), out.m_EpithelialCells); + io::Property::UnMarshall(in.Casts(), out.GetCastsResult()); + + UnMarshall(in.Crystals(), out.m_Crystals); + UnMarshall(in.Bacteria(), out.m_Bacteria); + UnMarshall(in.Trichomonads(), out.m_Trichomonads); + UnMarshall(in.Yeast(), out.m_Yeast); } //---------------------------------------------------------------------------------- - void PatientAssessments::UnMarshall(const SEUrinalysisMicroscopic& in, CDM::UrinalysisMicroscopicData& out) + void PatientAssessments::Marshall(const SEUrinalysisMicroscopic& in, CDM::UrinalysisMicroscopicData& out) { - UnMarshall(static_cast(in), static_cast(out)); - if (in.HasObservationType()) - out.ObservationType(in.m_ObservationType); - if (in.HasRedBloodCellsResult()) { - io::Property::UnMarshall(*in.m_RedBloodCells, out.RedBloodCells()); - } - if (in.HasWhiteBloodCellsResult()) { - io::Property::UnMarshall(*in.m_WhiteBloodCells, out.WhiteBloodCells()); - } - if (in.HasEpithelialCellsResult()) - out.EpithelialCells(in.m_EpithelialCells); - if (in.HasCastsResult()) { - io::Property::UnMarshall(*in.m_Casts, out.Casts()); - } - if (in.HasCrystalsResult()) - out.Crystals(in.m_Crystals); - if (in.HasBacteriaResult()) - out.Bacteria(in.m_Bacteria); - if (in.HasTrichomonadsResult()) - out.Trichomonads(in.m_Trichomonads); - if (in.HasYeastResult()) - out.Yeast(in.m_Yeast); + Marshall(static_cast(in), static_cast(out)); + + SE_PATIENT_ASSESSMENT_ENUM_PTR_MARSHALL_HELPER(in, out, ObservationType) + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RedBloodCells) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, WhiteBloodCells) + + SE_OPTIONAL_PATIENT_ASSESSMENT_ENUM_PTR_MARSHALL_HELPER(in, out, EpithelialCells) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Casts) + + SE_OPTIONAL_PATIENT_ASSESSMENT_ENUM_PTR_MARSHALL_HELPER(in, out, Crystals) + SE_OPTIONAL_PATIENT_ASSESSMENT_ENUM_PTR_MARSHALL_HELPER(in, out, Bacteria) + SE_OPTIONAL_PATIENT_ASSESSMENT_ENUM_PTR_MARSHALL_HELPER(in, out, Trichomonads) + SE_OPTIONAL_PATIENT_ASSESSMENT_ENUM_PTR_MARSHALL_HELPER(in, out, Yeast) } //---------------------------------------------------------------------------------- // class SEProthrombinTime.h - void PatientAssessments::Marshall(const CDM::ProthrombinTimeData& in, SEProthrombinTime& out) + void PatientAssessments::UnMarshall(const CDM::ProthrombinTimeData& in, SEProthrombinTime& out) { - io::PatientAssessments::Marshall(in, (SEPatientAssessment&)out); - io::Property::Marshall(in.InternationalNormalizedRatio(), out.GetInternationalNormalizedRatio()); + io::PatientAssessments::UnMarshall(in, (SEPatientAssessment&)out); + io::Property::UnMarshall(in.InternationalNormalizedRatio(), out.GetInternationalNormalizedRatio()); } - void PatientAssessments::UnMarshall(const SEProthrombinTime& in, CDM::ProthrombinTimeData& out) + void PatientAssessments::Marshall(const SEProthrombinTime& in, CDM::ProthrombinTimeData& out) { - io::PatientAssessments::UnMarshall((SEPatientAssessment const&)in, out); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, InternationalNormalizedRatio) + io::PatientAssessments::Marshall((SEPatientAssessment const&)in, out); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, InternationalNormalizedRatio) } //---------------------------------------------------------------------------------- // class SEPsychomotorVigilanceTask.h - void PatientAssessments::Marshall(const CDM::PsychomotorVigilanceTaskData& in, SEPsychomotorVigilanceTask& out) + void PatientAssessments::UnMarshall(const CDM::PsychomotorVigilanceTaskData& in, SEPsychomotorVigilanceTask& out) { - io::PatientAssessments::Marshall(in, (SEPatientAssessment&)out); - io::Property::Marshall(in.AttentionLapses(), out.GetAttentionLapses()); - io::Property::Marshall(in.ReactionTime(), out.GetReactionTime()); + io::PatientAssessments::UnMarshall(in, (SEPatientAssessment&)out); + io::Property::UnMarshall(in.AttentionLapses(), out.GetAttentionLapses()); + io::Property::UnMarshall(in.ReactionTime(), out.GetReactionTime()); } - void PatientAssessments::UnMarshall(const SEPsychomotorVigilanceTask& in, CDM::PsychomotorVigilanceTaskData& out) + void PatientAssessments::Marshall(const SEPsychomotorVigilanceTask& in, CDM::PsychomotorVigilanceTaskData& out) { - io::PatientAssessments::UnMarshall((SEPatientAssessment const&)in, out); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, AttentionLapses) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ReactionTime) + io::PatientAssessments::Marshall((SEPatientAssessment const&)in, out); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, AttentionLapses) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ReactionTime) } //---------------------------------------------------------------------------------- // class SESequentialOrganFailureAssessment.h - void PatientAssessments::Marshall(const CDM::SequentialOrganFailureAssessmentData& in, SESequentialOrganFailureAssessment& out) + void PatientAssessments::UnMarshall(const CDM::SequentialOrganFailureAssessmentData& in, SESequentialOrganFailureAssessment& out) { - io::PatientAssessments::Marshall(in, (SEPatientAssessment&)out); - io::Property::Marshall(in.RespirationSOFA(), out.GetRespirationSOFA()); - io::Property::Marshall(in.CoagulationSOFA(), out.GetCoagulationSOFA()); - io::Property::Marshall(in.LiverSOFA(), out.GetLiverSOFA()); - io::Property::Marshall(in.CardiovascularSOFA(), out.GetCardiovascularSOFA()); - io::Property::Marshall(in.CentralNervousSOFA(), out.GetCentralNervousSOFA()); - io::Property::Marshall(in.RenalSOFA(), out.GetRenalSOFA()); - } - void PatientAssessments::UnMarshall(const SESequentialOrganFailureAssessment& in, CDM::SequentialOrganFailureAssessmentData& out) + io::PatientAssessments::UnMarshall(in, (SEPatientAssessment&)out); + io::Property::UnMarshall(in.RespirationSOFA(), out.GetRespirationSOFA()); + io::Property::UnMarshall(in.CoagulationSOFA(), out.GetCoagulationSOFA()); + io::Property::UnMarshall(in.LiverSOFA(), out.GetLiverSOFA()); + io::Property::UnMarshall(in.CardiovascularSOFA(), out.GetCardiovascularSOFA()); + io::Property::UnMarshall(in.CentralNervousSOFA(), out.GetCentralNervousSOFA()); + io::Property::UnMarshall(in.RenalSOFA(), out.GetRenalSOFA()); + } + void PatientAssessments::Marshall(const SESequentialOrganFailureAssessment& in, CDM::SequentialOrganFailureAssessmentData& out) { - io::PatientAssessments::UnMarshall((SEPatientAssessment const&)in, out); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, RespirationSOFA) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, CoagulationSOFA) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, LiverSOFA) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, CardiovascularSOFA) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, CentralNervousSOFA) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, RenalSOFA) + io::PatientAssessments::Marshall((SEPatientAssessment const&)in, out); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, RespirationSOFA) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, CoagulationSOFA) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, LiverSOFA) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, CardiovascularSOFA) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, CentralNervousSOFA) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, RenalSOFA) } + //----------------------------------------------------------------------------------- + // SEPresenceIndicator + void PatientAssessments::UnMarshall(const CDM::enumPresenceIndicator& in, SEPresenceIndicator& out) + { + try { + switch (in) { + case CDM::enumPresenceIndicator::Negative: + out = SEPresenceIndicator::Negative; + break; + case CDM::enumPresenceIndicator::Positive: + out = SEPresenceIndicator::Positive; + break; + default: + out = SEPresenceIndicator::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SEPresenceIndicator::Invalid; + } + } + void PatientAssessments::Marshall(const SEPresenceIndicator& in, CDM::enumPresenceIndicator& out) + { + switch (in) { + case SEPresenceIndicator::Negative: + out = CDM::enumPresenceIndicator::Negative; + break; + case SEPresenceIndicator::Positive: + out = CDM::enumPresenceIndicator::Positive; + break; + default: + out = ""; + break; + } + } + // SEClarityIndicator + void PatientAssessments::UnMarshall(const CDM::enumClarityIndicator& in, SEClarityIndicator& out) + { + try { + switch (in) { + case CDM::enumClarityIndicator::Clear: + out = SEClarityIndicator::Clear; + break; + case CDM::enumClarityIndicator::Cloudy: + out = SEClarityIndicator::Cloudy; + break; + case CDM::enumClarityIndicator::SlightlyCloudy: + out = SEClarityIndicator::SlightlyCloudy; + break; + case CDM::enumClarityIndicator::Turbid: + out = SEClarityIndicator::Turbid; + break; + default: + out = SEClarityIndicator::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SEClarityIndicator::Invalid; + } + } + void PatientAssessments::Marshall(const SEClarityIndicator& in, CDM::enumClarityIndicator& out) + { + switch (in) { + case SEClarityIndicator::Clear: + out = CDM::enumClarityIndicator::Clear; + break; + case SEClarityIndicator::SlightlyCloudy: + out = CDM::enumClarityIndicator::SlightlyCloudy; + break; + case SEClarityIndicator::Cloudy: + out = CDM::enumClarityIndicator::Cloudy; + break; + case SEClarityIndicator::Turbid: + out = CDM::enumClarityIndicator::Turbid; + break; + default: + out = ""; + break; + } + } + // SEUrineColor + void PatientAssessments::UnMarshall(const CDM::enumUrineColor& in, SEUrineColor& out) + { + try { + switch (in) { + case CDM::enumUrineColor::Yellow: + out = SEUrineColor::Yellow; + break; + case CDM::enumUrineColor::DarkYellow: + out = SEUrineColor::DarkYellow; + break; + case CDM::enumUrineColor::PaleYellow: + out = SEUrineColor::PaleYellow; + break; + case CDM::enumUrineColor::Pink: + out = SEUrineColor::Pink; + break; + default: + out = SEUrineColor::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SEUrineColor::Invalid; + } + } + void PatientAssessments::Marshall(const SEUrineColor& in, CDM::enumUrineColor& out) + { + switch (in) { + case SEUrineColor::PaleYellow: + out = CDM::enumUrineColor::PaleYellow; + break; + case SEUrineColor::Yellow: + out = CDM::enumUrineColor::Yellow; + break; + case SEUrineColor::DarkYellow: + out = CDM::enumUrineColor::DarkYellow; + break; + case SEUrineColor::Pink: + out = CDM::enumUrineColor::Pink; + break; + default: + out = ""; + break; + } + } + // SEMicroscopicObservationType + void PatientAssessments::UnMarshall(const CDM::enumMicroscopicObservationType& in, SEMicroscopicObservationType& out) + { + try { + switch (in) { + case CDM::enumMicroscopicObservationType::HighPowerField: + out = SEMicroscopicObservationType::HighPowerField; + break; + case CDM::enumMicroscopicObservationType::LowPowerField: + out = SEMicroscopicObservationType::LowPowerField; + break; + default: + out = SEMicroscopicObservationType::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SEMicroscopicObservationType::Invalid; + } + } + void PatientAssessments::Marshall(const SEMicroscopicObservationType& in, CDM::enumMicroscopicObservationType& out) + { + switch (in) { + case SEMicroscopicObservationType::HighPowerField: + out = CDM::enumMicroscopicObservationType::HighPowerField; + break; + case SEMicroscopicObservationType::LowPowerField: + out = CDM::enumMicroscopicObservationType::LowPowerField; + break; + default: + out = ""; + break; + } + } + // SEMicroscopicObservationAmount + void PatientAssessments::UnMarshall(const CDM::enumMicroscopicObservationAmount& in, SEMicroscopicObservationAmount& out) + { + try { + switch (in) { + case CDM::enumMicroscopicObservationAmount::Few: + out = SEMicroscopicObservationAmount::Few; + break; + case CDM::enumMicroscopicObservationAmount::Many: + out = SEMicroscopicObservationAmount::Many; + break; + case CDM::enumMicroscopicObservationAmount::Moderate: + out = SEMicroscopicObservationAmount::Moderate; + break; + default: + out = SEMicroscopicObservationAmount::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SEMicroscopicObservationAmount::Invalid; + } + } + void PatientAssessments::Marshall(const SEMicroscopicObservationAmount& in, CDM::enumMicroscopicObservationAmount& out) + { + switch (in) { + case SEMicroscopicObservationAmount::Few: + out = CDM::enumMicroscopicObservationAmount::Few; + break; + case SEMicroscopicObservationAmount::Moderate: + out = CDM::enumMicroscopicObservationAmount::Moderate; + break; + case SEMicroscopicObservationAmount::Many: + out = CDM::enumMicroscopicObservationAmount::Many; + break; + default: + out = ""; + break; + } + } +} // NAMESPACE IO + +bool operator==(CDM::enumPresenceIndicator const& lhs, SEPresenceIndicator const& rhs) +{ + switch (rhs) { + case SEPresenceIndicator::Negative: + return (CDM::enumPresenceIndicator::Negative == lhs); + case SEPresenceIndicator::Positive: + return (CDM::enumPresenceIndicator::Positive == lhs); + case SEPresenceIndicator::Invalid: + return ((CDM::enumPresenceIndicator::value)-1 == lhs); + default: + return false; + } +} +bool operator==(CDM::enumClarityIndicator const& lhs, SEClarityIndicator const& rhs) +{ + switch (rhs) { + case SEClarityIndicator::Clear: + return (CDM::enumClarityIndicator::Clear == lhs); + case SEClarityIndicator::SlightlyCloudy: + return (CDM::enumClarityIndicator::SlightlyCloudy == lhs); + case SEClarityIndicator::Cloudy: + return (CDM::enumClarityIndicator::Cloudy == lhs); + case SEClarityIndicator::Turbid: + return (CDM::enumClarityIndicator::Turbid == lhs); + case SEClarityIndicator::Invalid: + return ((CDM::enumClarityIndicator::value)-1 == lhs); + default: + return false; + } +} +bool operator==(CDM::enumUrineColor const& lhs, SEUrineColor const& rhs) +{ + switch (rhs) { + case SEUrineColor::DarkYellow: + return (CDM::enumUrineColor::DarkYellow == lhs); + case SEUrineColor::PaleYellow: + return (CDM::enumUrineColor::PaleYellow == lhs); + case SEUrineColor::Pink: + return (CDM::enumUrineColor::Pink == lhs); + case SEUrineColor::Yellow: + return (CDM::enumUrineColor::Yellow == lhs); + case SEUrineColor::Invalid: + return ((CDM::enumUrineColor::value)-1 == lhs); + default: + return false; + } } -} \ No newline at end of file +bool operator==(CDM::enumMicroscopicObservationType const& lhs, SEMicroscopicObservationType const& rhs) +{ + switch (rhs) { + case SEMicroscopicObservationType::HighPowerField: + return (CDM::enumMicroscopicObservationType::HighPowerField == lhs); + case SEMicroscopicObservationType::LowPowerField: + return (CDM::enumMicroscopicObservationType::LowPowerField == lhs); + case SEMicroscopicObservationType ::Invalid: + return ((CDM::enumMicroscopicObservationType::value)-1 == lhs); + default: + return false; + } +} +bool operator==(CDM::enumMicroscopicObservationAmount const& lhs, SEMicroscopicObservationAmount const& rhs) +{ + switch (rhs) { + case SEMicroscopicObservationAmount::Few: + return (CDM::enumMicroscopicObservationAmount::Few == lhs); + case SEMicroscopicObservationAmount::Moderate: + return (CDM::enumMicroscopicObservationAmount::Moderate == lhs); + case SEMicroscopicObservationAmount::Many: + return (CDM::enumMicroscopicObservationAmount::Many == lhs); + case SEMicroscopicObservationAmount::Invalid: + return ((CDM::enumMicroscopicObservationAmount::value)-1 == lhs); + default: + return false; + } +} + +} // Namespace BioGears diff --git a/projects/biogears/libBiogears/src/io/cdm/PatientAssessments.h b/projects/biogears/libBiogears/src/io/cdm/PatientAssessments.h index 7ecd6e30b..83c922c1d 100644 --- a/projects/biogears/libBiogears/src/io/cdm/PatientAssessments.h +++ b/projects/biogears/libBiogears/src/io/cdm/PatientAssessments.h @@ -12,23 +12,34 @@ specific language governing permissions and limitations under the License. #pragma once #include - -#include "biogears/cdm/CommonDataModel.h" +#include #include +#include +#include +#include + #include -#define CDM_PATIENT_ASSESSMENTS_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_PATIENT_ASSESSMENTS_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ out.func(std::make_unique::type>()); \ - io::PatientAssessments::UnMarshall(*in.m_##func, out.func()); \ + io::PatientAssessments::Marshall(*in.m_##func, out.func()); \ } -#define CDM_OPTIONAL_PATIENT_ASSESSMENTS_UNMARSHAL_HELPER(in, out, func) \ - if (in.m_##func) { \ - io::PatientAssessments::UnMarshall(*in.m_##func, out.func()); \ +#define CDM_OPTIONAL_PATIENT_ASSESSMENTS_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func) { \ + io::PatientAssessments::Marshall(*in.m_##func, out.func()); \ + } + +#define SE_PATIENT_ASSESSMENT_ENUM_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.Has##func()) { \ + out.func(std::make_unique::type>()); \ + io::PatientAssessments::Marshall(in.m_##func, out.func()); \ } +#define SE_OPTIONAL_PATIENT_ASSESSMENT_ENUM_PTR_MARSHALL_HELPER(in, out, func) \ + io::PatientAssessments::Marshall(in.m_##func, out.func()); namespace biogears { class SEPatientAssessment; @@ -46,64 +57,162 @@ class SEUrinalysisMicroscopic; // SEPsychomotorVigilanceTask.h // SESequentialOrganFailureAssessment.h - namespace io { class BIOGEARS_PRIVATE_API PatientAssessments { public: - //template option - template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); + // template option + template ::value>* = nullptr> + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); + template ::value>* = nullptr> + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); - //class SEPatientAssessment - static void Marshall(const CDM::PatientAssessmentData& in, SEPatientAssessment& out); - static void UnMarshall(const SEPatientAssessment& in, CDM::PatientAssessmentData& out); - //class SEArterialBloodGasAnalysis - static void Marshall(const CDM::ArterialBloodGasAnalysisData& in, SEArterialBloodGasAnalysis& out); - static void UnMarshall(const SEArterialBloodGasAnalysis& in, CDM::ArterialBloodGasAnalysisData& out); - //class SEPulmonaryFunctionTest - static void Marshall(const CDM::PulmonaryFunctionTestData& in, SEPulmonaryFunctionTest& out); - static void UnMarshall(const SEPulmonaryFunctionTest& in, CDM::PulmonaryFunctionTestData& out); - //class SECompleteBloodCount - static void Marshall(const CDM::CompleteBloodCountData& in, SECompleteBloodCount& out); - static void UnMarshall(const SECompleteBloodCount& in, CDM::CompleteBloodCountData& out); - //class SEComprehensiveMetabolicPanel - static void Marshall(const CDM::ComprehensiveMetabolicPanelData& in, SEComprehensiveMetabolicPanel& out); - static void UnMarshall(const SEComprehensiveMetabolicPanel& in, CDM::ComprehensiveMetabolicPanelData& out); - //class SEUrinalysis - static void Marshall(const CDM::UrinalysisData& in, SEUrinalysis& out); - static void UnMarshall(const SEUrinalysis& in, CDM::UrinalysisData& out); - //class SEUrinalysisMicroscopic - static void Marshall(const CDM::UrinalysisMicroscopicData& in, SEUrinalysisMicroscopic& out); - static void UnMarshall(const SEUrinalysisMicroscopic& in, CDM::UrinalysisMicroscopicData& out); - //class SEProthrombinTime.h - static void Marshall(const CDM::ProthrombinTimeData& in, SEProthrombinTime& out); - static void UnMarshall(const SEProthrombinTime& in, CDM::ProthrombinTimeData& out); - //class SEPsychomotorVigilanceTask.h - static void Marshall(const CDM::PsychomotorVigilanceTaskData& in, SEPsychomotorVigilanceTask& out); - static void UnMarshall(const SEPsychomotorVigilanceTask& in, CDM::PsychomotorVigilanceTaskData& out); - //class SESequentialOrganFailureAssessment.h - static void Marshall(const CDM::SequentialOrganFailureAssessmentData& in, SESequentialOrganFailureAssessment& out); - static void UnMarshall(const SESequentialOrganFailureAssessment& in, CDM::SequentialOrganFailureAssessmentData& out); + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); + // class SEPatientAssessment + static void UnMarshall(const CDM::PatientAssessmentData& in, SEPatientAssessment& out); + static void Marshall(const SEPatientAssessment& in, CDM::PatientAssessmentData& out); + // class SEArterialBloodGasAnalysis + static void UnMarshall(const CDM::ArterialBloodGasAnalysisData& in, SEArterialBloodGasAnalysis& out); + static void Marshall(const SEArterialBloodGasAnalysis& in, CDM::ArterialBloodGasAnalysisData& out); + // class SEPulmonaryFunctionTest + static void UnMarshall(const CDM::PulmonaryFunctionTestData& in, SEPulmonaryFunctionTest& out); + static void Marshall(const SEPulmonaryFunctionTest& in, CDM::PulmonaryFunctionTestData& out); + // class SECompleteBloodCount + static void UnMarshall(const CDM::CompleteBloodCountData& in, SECompleteBloodCount& out); + static void Marshall(const SECompleteBloodCount& in, CDM::CompleteBloodCountData& out); + // class SEComprehensiveMetabolicPanel + static void UnMarshall(const CDM::ComprehensiveMetabolicPanelData& in, SEComprehensiveMetabolicPanel& out); + static void Marshall(const SEComprehensiveMetabolicPanel& in, CDM::ComprehensiveMetabolicPanelData& out); + // class SEUrinalysis + static void UnMarshall(const CDM::UrinalysisData& in, SEUrinalysis& out); + static void Marshall(const SEUrinalysis& in, CDM::UrinalysisData& out); + // class SEUrinalysisMicroscopic + static void UnMarshall(const CDM::UrinalysisMicroscopicData& in, SEUrinalysisMicroscopic& out); + static void Marshall(const SEUrinalysisMicroscopic& in, CDM::UrinalysisMicroscopicData& out); + // class SEProthrombinTime.h + static void UnMarshall(const CDM::ProthrombinTimeData& in, SEProthrombinTime& out); + static void Marshall(const SEProthrombinTime& in, CDM::ProthrombinTimeData& out); + // class SEPsychomotorVigilanceTask.h + static void UnMarshall(const CDM::PsychomotorVigilanceTaskData& in, SEPsychomotorVigilanceTask& out); + static void Marshall(const SEPsychomotorVigilanceTask& in, CDM::PsychomotorVigilanceTaskData& out); + // class SESequentialOrganFailureAssessment.h + static void UnMarshall(const CDM::SequentialOrganFailureAssessmentData& in, SESequentialOrganFailureAssessment& out); + static void Marshall(const SESequentialOrganFailureAssessment& in, CDM::SequentialOrganFailureAssessmentData& out); + //---- + // SEPresenceIndicator + static void UnMarshall(const CDM::enumPresenceIndicator& in, SEPresenceIndicator& out); + static void Marshall(const SEPresenceIndicator& in, CDM::enumPresenceIndicator& out); + // SEClarityIndicator + static void UnMarshall(const CDM::enumClarityIndicator& in, SEClarityIndicator& out); + static void Marshall(const SEClarityIndicator& in, CDM::enumClarityIndicator& out); + // SEUrineColor + static void UnMarshall(const CDM::enumUrineColor& in, SEUrineColor& out); + static void Marshall(const SEUrineColor& in, CDM::enumUrineColor& out); + // SEMicroscopicObservationType + static void UnMarshall(const CDM::enumMicroscopicObservationType& in, SEMicroscopicObservationType& out); + static void Marshall(const SEMicroscopicObservationType& in, CDM::enumMicroscopicObservationType& out); + // SEMicroscopicObservationAmount + static void UnMarshall(const CDM::enumMicroscopicObservationAmount& in, SEMicroscopicObservationAmount& out); + static void Marshall(const SEMicroscopicObservationAmount& in, CDM::enumMicroscopicObservationAmount& out); }; - //---------------------------------------------------------------------------------- - template - void PatientAssessments::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + //------------------------------------------------------------------------------- + template ::value>*> + void PatientAssessments::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) + { + if (!option_in.present() || option_in->empty()) { + out = SE::Invalid; + } else { + UnMarshall(option_in.get(), out); + } + } + + template ::value>*> + void PatientAssessments::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) { if (!option_in.present()) { - out.Clear(); + out.Invalidate(); } else { - Marshall(option_in.get(), out); + UnMarshall(option_in.get(), out); } } //---------------------------------------------------------------------------------- template - void PatientAssessments::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void PatientAssessments::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); + Marshall(in, *item); option_out.set(*item); } } // Namespace IO -} //Namespace Biogears + +// Operators +bool operator==(CDM::enumPresenceIndicator const& lhs, SEPresenceIndicator const& rhs); +bool operator==(CDM::enumClarityIndicator const& lhs, SEClarityIndicator const& rhs); +bool operator==(CDM::enumUrineColor const& lhs, SEUrineColor const& rhs); +bool operator==(CDM::enumMicroscopicObservationType const& lhs, SEMicroscopicObservationType const& rhs); +bool operator==(CDM::enumMicroscopicObservationAmount const& lhs, SEMicroscopicObservationAmount const& rhs); + +inline bool operator==(SEPresenceIndicator const& lhs, CDM::enumPresenceIndicator const& rhs) +{ + return rhs == lhs; +} +inline bool operator==(SEClarityIndicator const& lhs, CDM::enumClarityIndicator const& rhs) +{ + return rhs == lhs; +} +inline bool operator==(SEUrineColor const& lhs, CDM::enumUrineColor const& rhs) +{ + return rhs == lhs; +} +inline bool operator==(SEMicroscopicObservationType const& lhs, CDM::enumMicroscopicObservationType const& rhs) +{ + return rhs == lhs; +} +inline bool operator==(SEMicroscopicObservationAmount const& lhs, CDM::enumMicroscopicObservationAmount const& rhs) +{ + return rhs == lhs; +} + +inline bool operator!=(CDM::enumPresenceIndicator const& lhs, SEPresenceIndicator const& rhs) +{ + return !(lhs == rhs); +} +inline bool operator!=(CDM::enumClarityIndicator const& lhs, SEClarityIndicator const& rhs) +{ + return !(lhs == rhs); +} +inline bool operator!=(CDM::enumUrineColor const& lhs, SEUrineColor const& rhs) +{ + return !(lhs == rhs); +} +inline bool operator!=(CDM::enumMicroscopicObservationType const& lhs, SEMicroscopicObservationType const& rhs) +{ + return !(lhs == rhs); +} +inline bool operator!=(CDM::enumMicroscopicObservationAmount const& lhs, SEMicroscopicObservationAmount const& rhs) +{ + return !(lhs == rhs); +} + +inline bool operator!=(SEPresenceIndicator const& lhs, CDM::enumPresenceIndicator const& rhs) +{ + return !(rhs == lhs); +} +inline bool operator!=(SEClarityIndicator const& lhs, CDM::enumClarityIndicator const& rhs) +{ + return !(rhs == lhs); +} +inline bool operator!=(SEUrineColor const& lhs, CDM::enumUrineColor const& rhs) +{ + return !(rhs == lhs); +} +inline bool operator!=(SEMicroscopicObservationType const& lhs, CDM::enumMicroscopicObservationType const& rhs) +{ + return !(rhs == lhs); +} +inline bool operator!=(SEMicroscopicObservationAmount const& lhs, CDM::enumMicroscopicObservationAmount const& rhs) +{ + return !(rhs == lhs); +} + +} // Namespace Biogears diff --git a/projects/biogears/libBiogears/src/io/cdm/PatientConditions.cpp b/projects/biogears/libBiogears/src/io/cdm/PatientConditions.cpp index c5eda649b..c7a3df9bc 100644 --- a/projects/biogears/libBiogears/src/io/cdm/PatientConditions.cpp +++ b/projects/biogears/libBiogears/src/io/cdm/PatientConditions.cpp @@ -25,248 +25,240 @@ #include "biogears/cdm/substance/SESubstanceManager.h" -#define PATIENT_CONDITION_POLYMORPHIC_UNMARSHALL(paramName, typeName) \ +#define POLYMORPHIC_MARSHALL(paramName, typeName) \ if (auto typeName = dynamic_cast(paramName); typeName) { \ auto typeName##Data = std::make_unique(); \ - UnMarshall(*typeName, *typeName##Data); \ + Marshall(*typeName, *typeName##Data); \ return std::move(typeName##Data); \ } -#define PATIENT_CONDITION_POLYMORPHIC_MARSHALL(paramName, typeName, schema) \ +#define POLYMORPHIC_UNMARSHALL(paramName, typeName, schema) \ if (auto typeName##Data = dynamic_cast(paramName); typeName##Data) { \ auto typeName = std::make_unique(); \ - schema::Marshall(*typeName##Data, *typeName); \ + schema::UnMarshall(*typeName##Data, *typeName); \ + return std::move(typeName); \ + } + +#define STOCASTIC_POLYMORPHIC_UNMARSHALL(paramName, typeName, schema, engine) \ + if (auto typeName##Data = dynamic_cast(paramName); typeName##Data) { \ + auto typeName = std::make_unique(); \ + schema::UnMarshall(*typeName##Data, *typeName, engine); \ return std::move(typeName); \ } namespace biogears { namespace io { - // class SEConditionList - std::vector> PatientConditions::condition_factory(const CDM::ConditionListData& in, SESubstanceManager& substances) - { - std::vector> r_vec; - for (const auto condition_data : in.Condition()) { - r_vec.emplace_back(factory(&condition_data, substances)); - } - return std::move(r_vec); - } //---------------------------------------------------------------------------------- - std::unique_ptr PatientConditions::factory(const CDM::ConditionData* conditionData, SESubstanceManager& substances) + std::unique_ptr PatientConditions::factory(CDM::PatientConditionData const* patientConditionData, SESubstanceManager& substances, std::default_random_engine* rd) { // Could speed up case by testing Patient Conditions vs another type // But we only have 1 type at this time, and a few conditions to support - PATIENT_CONDITION_POLYMORPHIC_MARSHALL(conditionData, ChronicAnemia, PatientConditions) - PATIENT_CONDITION_POLYMORPHIC_MARSHALL(conditionData, ChronicObstructivePulmonaryDisease, PatientConditions) - PATIENT_CONDITION_POLYMORPHIC_MARSHALL(conditionData, ChronicVentricularSystolicDysfunction, PatientConditions) - PATIENT_CONDITION_POLYMORPHIC_MARSHALL(conditionData, ChronicPericardialEffusion, PatientConditions) - PATIENT_CONDITION_POLYMORPHIC_MARSHALL(conditionData, ChronicRenalStenosis, PatientConditions) - PATIENT_CONDITION_POLYMORPHIC_MARSHALL(conditionData, Dehydration, PatientConditions) - PATIENT_CONDITION_POLYMORPHIC_MARSHALL(conditionData, DiabetesType1, PatientConditions) - PATIENT_CONDITION_POLYMORPHIC_MARSHALL(conditionData, DiabetesType2, PatientConditions) - PATIENT_CONDITION_POLYMORPHIC_MARSHALL(conditionData, Starvation, PatientConditions) - PATIENT_CONDITION_POLYMORPHIC_MARSHALL(conditionData, ImpairedAlveolarExchange, PatientConditions) - PATIENT_CONDITION_POLYMORPHIC_MARSHALL(conditionData, LobarPneumonia, PatientConditions) - - if (const auto initialEnvironmentData = dynamic_cast(conditionData); initialEnvironmentData) { - auto initialEnvironmentAction = std::make_unique(substances); - EnvironmentConditions::Marshall(*initialEnvironmentData, *initialEnvironmentAction); - return initialEnvironmentAction; - } + POLYMORPHIC_UNMARSHALL(patientConditionData, ChronicAnemia, PatientConditions) + POLYMORPHIC_UNMARSHALL(patientConditionData, ChronicObstructivePulmonaryDisease, PatientConditions) + POLYMORPHIC_UNMARSHALL(patientConditionData, ChronicVentricularSystolicDysfunction, PatientConditions) + POLYMORPHIC_UNMARSHALL(patientConditionData, ChronicPericardialEffusion, PatientConditions) + POLYMORPHIC_UNMARSHALL(patientConditionData, ChronicRenalStenosis, PatientConditions) + POLYMORPHIC_UNMARSHALL(patientConditionData, Dehydration, PatientConditions) + POLYMORPHIC_UNMARSHALL(patientConditionData, DiabetesType1, PatientConditions) + POLYMORPHIC_UNMARSHALL(patientConditionData, DiabetesType2, PatientConditions) + POLYMORPHIC_UNMARSHALL(patientConditionData, Starvation, PatientConditions) + POLYMORPHIC_UNMARSHALL(patientConditionData, ImpairedAlveolarExchange, PatientConditions) + POLYMORPHIC_UNMARSHALL(patientConditionData, LobarPneumonia, PatientConditions) throw CommonDataModelException("Unsupported Condition Received in PatientConditions::factory"); } - std::unique_ptr PatientConditions::factory(const SECondition* conditionData) + std::unique_ptr PatientConditions::factory(const SEPatientCondition* patientConditionData) { - PATIENT_CONDITION_POLYMORPHIC_UNMARSHALL(conditionData, ChronicAnemia) - PATIENT_CONDITION_POLYMORPHIC_UNMARSHALL(conditionData, ChronicHeartFailure) - PATIENT_CONDITION_POLYMORPHIC_UNMARSHALL(conditionData, ChronicVentricularSystolicDysfunction) - PATIENT_CONDITION_POLYMORPHIC_UNMARSHALL(conditionData, ChronicObstructivePulmonaryDisease) - PATIENT_CONDITION_POLYMORPHIC_UNMARSHALL(conditionData, ChronicPericardialEffusion) - PATIENT_CONDITION_POLYMORPHIC_UNMARSHALL(conditionData, ChronicRenalStenosis) - PATIENT_CONDITION_POLYMORPHIC_UNMARSHALL(conditionData, Dehydration) - PATIENT_CONDITION_POLYMORPHIC_UNMARSHALL(conditionData, DiabetesType1) - PATIENT_CONDITION_POLYMORPHIC_UNMARSHALL(conditionData, DiabetesType2) - PATIENT_CONDITION_POLYMORPHIC_UNMARSHALL(conditionData, ImpairedAlveolarExchange) - PATIENT_CONDITION_POLYMORPHIC_UNMARSHALL(conditionData, LobarPneumonia) - PATIENT_CONDITION_POLYMORPHIC_UNMARSHALL(conditionData, Starvation) + POLYMORPHIC_MARSHALL(patientConditionData, ChronicAnemia) + POLYMORPHIC_MARSHALL(patientConditionData, ChronicHeartFailure) + POLYMORPHIC_MARSHALL(patientConditionData, ChronicVentricularSystolicDysfunction) + POLYMORPHIC_MARSHALL(patientConditionData, ChronicObstructivePulmonaryDisease) + POLYMORPHIC_MARSHALL(patientConditionData, ChronicPericardialEffusion) + POLYMORPHIC_MARSHALL(patientConditionData, ChronicRenalStenosis) + POLYMORPHIC_MARSHALL(patientConditionData, Dehydration) + POLYMORPHIC_MARSHALL(patientConditionData, DiabetesType1) + POLYMORPHIC_MARSHALL(patientConditionData, DiabetesType2) + POLYMORPHIC_MARSHALL(patientConditionData, ImpairedAlveolarExchange) + POLYMORPHIC_MARSHALL(patientConditionData, LobarPneumonia) + POLYMORPHIC_MARSHALL(patientConditionData, Starvation) throw biogears::CommonDataModelException("PatientConditions::factory does not support the derived SEPatientCondition. If you are not a developer contact upstream for support."); } //---------------------------------------------------------------------------------- // SEPatientCondition - void PatientConditions::Marshall(const CDM::PatientConditionData& in, SEPatientCondition& out) + void PatientConditions::UnMarshall(const CDM::PatientConditionData& in, SEPatientCondition& out) { - Scenario::Marshall(static_cast(in), static_cast(out)); + Conditions::UnMarshall(static_cast(in), static_cast(out)); } //---------------------------------------------------------------------------------- - void PatientConditions::UnMarshall(const SEPatientCondition& in, CDM::PatientConditionData& out) + void PatientConditions::Marshall(const SEPatientCondition& in, CDM::PatientConditionData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); + Conditions::Marshall(static_cast(in), static_cast(out)); } // SEChronicAnemia - void PatientConditions::Marshall(const CDM::ChronicAnemiaData& in, SEChronicAnemia& out) + void PatientConditions::UnMarshall(const CDM::ChronicAnemiaData& in, SEChronicAnemia& out) { - PatientConditions::Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.ReductionFactor(), out.GetReductionFactor()); + PatientConditions::UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.ReductionFactor(), out.GetReductionFactor()); } //---------------------------------------------------------------------------------- - void PatientConditions::UnMarshall(const SEChronicAnemia& in, CDM::ChronicAnemiaData& out) + void PatientConditions::Marshall(const SEChronicAnemia& in, CDM::ChronicAnemiaData& out) { - PatientConditions::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, ReductionFactor) + PatientConditions::Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, ReductionFactor) } //---------------------------------------------------------------------------------- // SEChronicHeartFailure - void PatientConditions::Marshall(const CDM::ChronicHeartFailureData& in, SEChronicHeartFailure& out) + void PatientConditions::UnMarshall(const CDM::ChronicHeartFailureData& in, SEChronicHeartFailure& out) { - PatientConditions::Marshall(static_cast(in), static_cast(out)); + PatientConditions::UnMarshall(static_cast(in), static_cast(out)); } //---------------------------------------------------------------------------------- - void PatientConditions::UnMarshall(const SEChronicHeartFailure& in, CDM::ChronicHeartFailureData& out) + void PatientConditions::Marshall(const SEChronicHeartFailure& in, CDM::ChronicHeartFailureData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); + Conditions::Marshall(static_cast(in), static_cast(out)); } //---------------------------------------------------------------------------------- // SEChronicVentricularSystolicDysfunction - void PatientConditions::Marshall(const CDM::ChronicVentricularSystolicDysfunctionData& in, SEChronicVentricularSystolicDysfunction& out) + void PatientConditions::UnMarshall(const CDM::ChronicVentricularSystolicDysfunctionData& in, SEChronicVentricularSystolicDysfunction& out) { - PatientConditions::Marshall(static_cast(in), static_cast(out)); + PatientConditions::UnMarshall(static_cast(in), static_cast(out)); } //---------------------------------------------------------------------------------- - void PatientConditions::UnMarshall(const SEChronicVentricularSystolicDysfunction& in, CDM::ChronicVentricularSystolicDysfunctionData& out) + void PatientConditions::Marshall(const SEChronicVentricularSystolicDysfunction& in, CDM::ChronicVentricularSystolicDysfunctionData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); + Conditions::Marshall(static_cast(in), static_cast(out)); } //---------------------------------------------------------------------------------- // SEChronicObstructivePulmonaryDisease - void PatientConditions::Marshall(const CDM::ChronicObstructivePulmonaryDiseaseData& in, SEChronicObstructivePulmonaryDisease& out) + void PatientConditions::UnMarshall(const CDM::ChronicObstructivePulmonaryDiseaseData& in, SEChronicObstructivePulmonaryDisease& out) { - PatientConditions::Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.BronchitisSeverity(), out.GetBronchitisSeverity()); - io::Property::Marshall(in.EmphysemaSeverity(), out.GetEmphysemaSeverity()); + PatientConditions::UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.BronchitisSeverity(), out.GetBronchitisSeverity()); + io::Property::UnMarshall(in.EmphysemaSeverity(), out.GetEmphysemaSeverity()); } //---------------------------------------------------------------------------------- - void PatientConditions::UnMarshall(const SEChronicObstructivePulmonaryDisease& in, CDM::ChronicObstructivePulmonaryDiseaseData& out) + void PatientConditions::Marshall(const SEChronicObstructivePulmonaryDisease& in, CDM::ChronicObstructivePulmonaryDiseaseData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); + Conditions::Marshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, BronchitisSeverity) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, EmphysemaSeverity) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, BronchitisSeverity) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, EmphysemaSeverity) } //---------------------------------------------------------------------------------- // SEChronicPericardialEffusion - void PatientConditions::Marshall(const CDM::ChronicPericardialEffusionData& in, SEChronicPericardialEffusion& out) + void PatientConditions::UnMarshall(const CDM::ChronicPericardialEffusionData& in, SEChronicPericardialEffusion& out) { - PatientConditions::Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.AccumulatedVolume(), out.GetAccumulatedVolume()); + PatientConditions::UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.AccumulatedVolume(), out.GetAccumulatedVolume()); } //---------------------------------------------------------------------------------- - void PatientConditions::UnMarshall(const SEChronicPericardialEffusion& in, CDM::ChronicPericardialEffusionData& out) + void PatientConditions::Marshall(const SEChronicPericardialEffusion& in, CDM::ChronicPericardialEffusionData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, AccumulatedVolume) + Conditions::Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, AccumulatedVolume) } //---------------------------------------------------------------------------------- // SEChronicRenalStenosis - void PatientConditions::Marshall(const CDM::ChronicRenalStenosisData& in, SEChronicRenalStenosis& out) + void PatientConditions::UnMarshall(const CDM::ChronicRenalStenosisData& in, SEChronicRenalStenosis& out) { - PatientConditions::Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.LeftKidneySeverity(), out.GetLeftKidneySeverity()); - io::Property::Marshall(in.RightKidneySeverity(), out.GetRightKidneySeverity()); + PatientConditions::UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.LeftKidneySeverity(), out.GetLeftKidneySeverity()); + io::Property::UnMarshall(in.RightKidneySeverity(), out.GetRightKidneySeverity()); } //---------------------------------------------------------------------------------- - void PatientConditions::UnMarshall(const SEChronicRenalStenosis& in, CDM::ChronicRenalStenosisData& out) + void PatientConditions::Marshall(const SEChronicRenalStenosis& in, CDM::ChronicRenalStenosisData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftKidneySeverity) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightKidneySeverity) + Conditions::Marshall(static_cast(in), static_cast(out)); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftKidneySeverity) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightKidneySeverity) } //---------------------------------------------------------------------------------- // SEDehydration - void PatientConditions::Marshall(const CDM::DehydrationData& in, SEDehydration& out) + void PatientConditions::UnMarshall(const CDM::DehydrationData& in, SEDehydration& out) { - PatientConditions::Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.DehydrationFraction(), out.GetDehydrationFraction()); + PatientConditions::UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.DehydrationFraction(), out.GetDehydrationFraction()); } //---------------------------------------------------------------------------------- - void PatientConditions::UnMarshall(const SEDehydration& in, CDM::DehydrationData& out) + void PatientConditions::Marshall(const SEDehydration& in, CDM::DehydrationData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, DehydrationFraction) + Conditions::Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, DehydrationFraction) } //---------------------------------------------------------------------------------- // SEDiabetesType1 - void PatientConditions::Marshall(const CDM::DiabetesType1Data& in, SEDiabetesType1& out) + void PatientConditions::UnMarshall(const CDM::DiabetesType1Data& in, SEDiabetesType1& out) { - PatientConditions::Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.InsulinProductionSeverity(), out.GetInsulinProductionSeverity()); + PatientConditions::UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.InsulinProductionSeverity(), out.GetInsulinProductionSeverity()); } //---------------------------------------------------------------------------------- - void PatientConditions::UnMarshall(const SEDiabetesType1& in, CDM::DiabetesType1Data& out) + void PatientConditions::Marshall(const SEDiabetesType1& in, CDM::DiabetesType1Data& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, InsulinProductionSeverity) + Conditions::Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, InsulinProductionSeverity) } //---------------------------------------------------------------------------------- // SEDiabetesType2 - void PatientConditions::Marshall(const CDM::DiabetesType2Data& in, SEDiabetesType2& out) + void PatientConditions::UnMarshall(const CDM::DiabetesType2Data& in, SEDiabetesType2& out) { - PatientConditions::Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.InsulinProductionSeverity(), out.GetInsulinProductionSeverity()); - io::Property::Marshall(in.InsulinResistanceSeverity(), out.GetInsulinResistanceSeverity()); + PatientConditions::UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.InsulinProductionSeverity(), out.GetInsulinProductionSeverity()); + io::Property::UnMarshall(in.InsulinResistanceSeverity(), out.GetInsulinResistanceSeverity()); } //---------------------------------------------------------------------------------- - void PatientConditions::UnMarshall(const SEDiabetesType2& in, CDM::DiabetesType2Data& out) + void PatientConditions::Marshall(const SEDiabetesType2& in, CDM::DiabetesType2Data& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, InsulinProductionSeverity) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, InsulinResistanceSeverity) + Conditions::Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, InsulinProductionSeverity) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, InsulinResistanceSeverity) } //---------------------------------------------------------------------------------- // SEImpairedAlveolarExchange - void PatientConditions::Marshall(const CDM::ImpairedAlveolarExchangeData& in, SEImpairedAlveolarExchange& out) + void PatientConditions::UnMarshall(const CDM::ImpairedAlveolarExchangeData& in, SEImpairedAlveolarExchange& out) { - PatientConditions::Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.ImpairedSurfaceArea(), out.GetImpairedSurfaceArea()); - io::Property::Marshall(in.ImpairedFraction(), out.GetImpairedFraction()); + PatientConditions::UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.ImpairedSurfaceArea(), out.GetImpairedSurfaceArea()); + io::Property::UnMarshall(in.ImpairedFraction(), out.GetImpairedFraction()); } //---------------------------------------------------------------------------------- - void PatientConditions::UnMarshall(const SEImpairedAlveolarExchange& in, CDM::ImpairedAlveolarExchangeData& out) + void PatientConditions::Marshall(const SEImpairedAlveolarExchange& in, CDM::ImpairedAlveolarExchangeData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ImpairedSurfaceArea) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ImpairedFraction) + Conditions::Marshall(static_cast(in), static_cast(out)); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ImpairedSurfaceArea) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ImpairedFraction) } //---------------------------------------------------------------------------------- // SELobarPneumonia - void PatientConditions::Marshall(const CDM::LobarPneumoniaData& in, SELobarPneumonia& out) + void PatientConditions::UnMarshall(const CDM::LobarPneumoniaData& in, SELobarPneumonia& out) { - PatientConditions::Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.Severity(), out.GetSeverity()); - io::Property::Marshall(in.LeftLungAffected(), out.GetLeftLungAffected()); - io::Property::Marshall(in.RightLungAffected(), out.GetRightLungAffected()); + PatientConditions::UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.Severity(), out.GetSeverity()); + io::Property::UnMarshall(in.LeftLungAffected(), out.GetLeftLungAffected()); + io::Property::UnMarshall(in.RightLungAffected(), out.GetRightLungAffected()); } //---------------------------------------------------------------------------------- - void PatientConditions::UnMarshall(const SELobarPneumonia& in, CDM::LobarPneumoniaData& out) + void PatientConditions::Marshall(const SELobarPneumonia& in, CDM::LobarPneumoniaData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Severity) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, LeftLungAffected) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, RightLungAffected) + Conditions::Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Severity) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftLungAffected) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightLungAffected) } //---------------------------------------------------------------------------------- // SEStarvation - void PatientConditions::Marshall(const CDM::StarvationData& in, SEStarvation& out) + void PatientConditions::UnMarshall(const CDM::StarvationData& in, SEStarvation& out) { - PatientConditions::Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.TimeSinceMeal(), out.GetTimeSinceMeal()); + PatientConditions::UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.TimeSinceMeal(), out.GetTimeSinceMeal()); } //---------------------------------------------------------------------------------- - void PatientConditions::UnMarshall(const SEStarvation& in, CDM::StarvationData& out) + void PatientConditions::Marshall(const SEStarvation& in, CDM::StarvationData& out) { - Scenario::UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, TimeSinceMeal) + Conditions::Marshall(static_cast(in), static_cast(out)); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, TimeSinceMeal) } //---------------------------------------------------------------------------------- } diff --git a/projects/biogears/libBiogears/src/io/cdm/PatientConditions.h b/projects/biogears/libBiogears/src/io/cdm/PatientConditions.h index e07f1697a..4cc5c1a0c 100644 --- a/projects/biogears/libBiogears/src/io/cdm/PatientConditions.h +++ b/projects/biogears/libBiogears/src/io/cdm/PatientConditions.h @@ -12,21 +12,29 @@ specific language governing permissions and limitations under the License. #pragma once #include +#include #include "biogears/cdm/CommonDataModel.h" #include #include -#define CDM_PATIENT_CONDITIONS_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_PATIENT_CONDITIONS_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ out.func(std::make_unique::type>()); \ - io::PatientConditions::UnMarshall(*in.m_##func, out.func()); \ + io::PatientConditions::Marshall(*in.m_##func, out.func()); \ } -#define CDM_OPTIONAL_PATIENT_CONDITIONS_UNMARSHAL_HELPER(in, out, func) \ - if (in.m_##func) { \ - io::PatientConditions::UnMarshall(*in.m_##func, out.func()); \ +#define CDM_OPTIONAL_PATIENT_CONDITIONS_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func) { \ + io::PatientConditions::Marshall(*in.m_##func, out.func()); \ + } + +#define CDM_PATIENT_CONDITIONS_COPY(type, in, out) \ + { \ + CDM::type##Data middle; \ + io::PatientConditions::Marshall(in, middle); \ + io::PatientConditions::UnMarshall(middle, out); \ } namespace biogears { @@ -50,74 +58,74 @@ class SEStarvation; namespace io { class BIOGEARS_PRIVATE_API PatientConditions { public: - //class SEConditionList; - static std::vector> condition_factory(const CDM::ConditionListData& in, SESubstanceManager& substances); - static std::unique_ptr factory(const CDM::ConditionData* data, SESubstanceManager& substances); - static std::unique_ptr factory(const SECondition* data); - //template option + // class Factories; + static std::unique_ptr factory(CDM::PatientConditionData const* patientConditionData, SESubstanceManager& substances, std::default_random_engine* rd = nullptr); + static std::unique_ptr factory(const SEPatientCondition* data); + + // template option template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); - + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); + template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); - //SEPatientCondition - static void Marshall(const CDM::PatientConditionData& in, SEPatientCondition& out); - static void UnMarshall(const SEPatientCondition& in, CDM::PatientConditionData& out); - //SEChronicAnemia - static void Marshall(const CDM::ChronicAnemiaData& in, SEChronicAnemia& out); - static void UnMarshall(const SEChronicAnemia& in, CDM::ChronicAnemiaData& out); - //SEChronicHeartFailure - static void Marshall(const CDM::ChronicHeartFailureData& in, SEChronicHeartFailure& out); - static void UnMarshall(const SEChronicHeartFailure& in, CDM::ChronicHeartFailureData& out); - //SEChronicVentricularSystolicDysfunction - static void Marshall(const CDM::ChronicVentricularSystolicDysfunctionData& in, SEChronicVentricularSystolicDysfunction& out); - static void UnMarshall(const SEChronicVentricularSystolicDysfunction& in, CDM::ChronicVentricularSystolicDysfunctionData& out); - //SEChronicObstructivePulmonaryDisease - static void Marshall(const CDM::ChronicObstructivePulmonaryDiseaseData& in, SEChronicObstructivePulmonaryDisease& out); - static void UnMarshall(const SEChronicObstructivePulmonaryDisease& in, CDM::ChronicObstructivePulmonaryDiseaseData& out); - //SEChronicPericardialEffusion - static void Marshall(const CDM::ChronicPericardialEffusionData& in, SEChronicPericardialEffusion& out); - static void UnMarshall(const SEChronicPericardialEffusion& in, CDM::ChronicPericardialEffusionData& out); - //SEChronicRenalStenosis - static void Marshall(const CDM::ChronicRenalStenosisData& in, SEChronicRenalStenosis& out); - static void UnMarshall(const SEChronicRenalStenosis& in, CDM::ChronicRenalStenosisData& out); - //SEDehydration - static void Marshall(const CDM::DehydrationData& in, SEDehydration& out); - static void UnMarshall(const SEDehydration& in, CDM::DehydrationData& out); - //SEDiabetesType1 - static void Marshall(const CDM::DiabetesType1Data& in, SEDiabetesType1& out); - static void UnMarshall(const SEDiabetesType1& in, CDM::DiabetesType1Data& out); - //SEDiabetesType2 - static void Marshall(const CDM::DiabetesType2Data& in, SEDiabetesType2& out); - static void UnMarshall(const SEDiabetesType2& in, CDM::DiabetesType2Data& out); - //SEImpairedAlveolarExchange - static void Marshall(const CDM::ImpairedAlveolarExchangeData& in, SEImpairedAlveolarExchange& out); - static void UnMarshall(const SEImpairedAlveolarExchange& in, CDM::ImpairedAlveolarExchangeData& out); - //SELobarPneumonia - static void Marshall(const CDM::LobarPneumoniaData& in, SELobarPneumonia& out); - static void UnMarshall(const SELobarPneumonia& in, CDM::LobarPneumoniaData& out); - //SEStarvation - static void Marshall(const CDM::StarvationData& in, SEStarvation& out); - static void UnMarshall(const SEStarvation& in, CDM::StarvationData& out); + // SEPatientCondition + static void UnMarshall(const CDM::PatientConditionData& in, SEPatientCondition& out); + static void Marshall(const SEPatientCondition& in, CDM::PatientConditionData& out); + // SEChronicAnemia + static void UnMarshall(const CDM::ChronicAnemiaData& in, SEChronicAnemia& out); + static void Marshall(const SEChronicAnemia& in, CDM::ChronicAnemiaData& out); + // SEChronicHeartFailure + static void UnMarshall(const CDM::ChronicHeartFailureData& in, SEChronicHeartFailure& out); + static void Marshall(const SEChronicHeartFailure& in, CDM::ChronicHeartFailureData& out); + // SEChronicVentricularSystolicDysfunction + static void UnMarshall(const CDM::ChronicVentricularSystolicDysfunctionData& in, SEChronicVentricularSystolicDysfunction& out); + static void Marshall(const SEChronicVentricularSystolicDysfunction& in, CDM::ChronicVentricularSystolicDysfunctionData& out); + // SEChronicObstructivePulmonaryDisease + static void UnMarshall(const CDM::ChronicObstructivePulmonaryDiseaseData& in, SEChronicObstructivePulmonaryDisease& out); + static void Marshall(const SEChronicObstructivePulmonaryDisease& in, CDM::ChronicObstructivePulmonaryDiseaseData& out); + // SEChronicPericardialEffusion + static void UnMarshall(const CDM::ChronicPericardialEffusionData& in, SEChronicPericardialEffusion& out); + static void Marshall(const SEChronicPericardialEffusion& in, CDM::ChronicPericardialEffusionData& out); + // SEChronicRenalStenosis + static void UnMarshall(const CDM::ChronicRenalStenosisData& in, SEChronicRenalStenosis& out); + static void Marshall(const SEChronicRenalStenosis& in, CDM::ChronicRenalStenosisData& out); + // SEDehydration + static void UnMarshall(const CDM::DehydrationData& in, SEDehydration& out); + static void Marshall(const SEDehydration& in, CDM::DehydrationData& out); + // SEDiabetesType1 + static void UnMarshall(const CDM::DiabetesType1Data& in, SEDiabetesType1& out); + static void Marshall(const SEDiabetesType1& in, CDM::DiabetesType1Data& out); + // SEDiabetesType2 + static void UnMarshall(const CDM::DiabetesType2Data& in, SEDiabetesType2& out); + static void Marshall(const SEDiabetesType2& in, CDM::DiabetesType2Data& out); + // SEImpairedAlveolarExchange + static void UnMarshall(const CDM::ImpairedAlveolarExchangeData& in, SEImpairedAlveolarExchange& out); + static void Marshall(const SEImpairedAlveolarExchange& in, CDM::ImpairedAlveolarExchangeData& out); + // SELobarPneumonia + static void UnMarshall(const CDM::LobarPneumoniaData& in, SELobarPneumonia& out); + static void Marshall(const SELobarPneumonia& in, CDM::LobarPneumoniaData& out); + // SEStarvation + static void UnMarshall(const CDM::StarvationData& in, SEStarvation& out); + static void Marshall(const SEStarvation& in, CDM::StarvationData& out); }; //---------------------------------------------------------------------------------- template - void PatientConditions::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + void PatientConditions::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) { if (!option_in.present()) { - out.Invalidate(); + out.MakeInvalid(); } else { - Marshall(option_in.get(), out); + UnMarshall(option_in.get(), out); } } //---------------------------------------------------------------------------------- template - void PatientConditions::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void PatientConditions::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); + Marshall(in, *item); option_out.set(*item); } } // Namespace IO -} //Namespace Biogears +} // Namespace Biogears diff --git a/projects/biogears/libBiogears/src/io/cdm/PatientNutrition.cpp b/projects/biogears/libBiogears/src/io/cdm/PatientNutrition.cpp index c939f0980..6b926c50b 100644 --- a/projects/biogears/libBiogears/src/io/cdm/PatientNutrition.cpp +++ b/projects/biogears/libBiogears/src/io/cdm/PatientNutrition.cpp @@ -10,47 +10,35 @@ namespace biogears { namespace io { - //class SENutrition - void PatientNutrition::Marshall(const CDM::NutritionData& in, SENutrition& out) + // class SENutrition + void PatientNutrition::UnMarshall(const CDM::NutritionData& in, SENutrition& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); if (in.Name().present()) { out.m_Name = in.Name().get(); } else { out.m_Name = "Standard Meal"; } - io::Property::Marshall(in.Carbohydrate(), out.GetCarbohydrate()); - io::Property::Marshall(in.Fat(), out.GetFat()); - io::Property::Marshall(in.Protein(), out.GetProtein()); - io::Property::Marshall(in.Calcium(), out.GetCalcium()); - io::Property::Marshall(in.Sodium(), out.GetSodium()); - io::Property::Marshall(in.Water(), out.GetWater()); + io::Property::UnMarshall(in.Carbohydrate(), out.GetCarbohydrate(), rd); + io::Property::UnMarshall(in.Fat(), out.GetFat(), rd); + io::Property::UnMarshall(in.Protein(), out.GetProtein(), rd); + io::Property::UnMarshall(in.Calcium(), out.GetCalcium(), rd); + io::Property::UnMarshall(in.Sodium(), out.GetSodium(), rd); + io::Property::UnMarshall(in.Water(), out.GetWater(), rd); } //---------------------------------------------------------------------------------- - void PatientNutrition::UnMarshall(const SENutrition& in, CDM::NutritionData& out) + void PatientNutrition::Marshall(const SENutrition& in, CDM::NutritionData& out) { if (!in.m_Name.empty()) { out.Name(in.m_Name); } - if (in.m_Carbohydrate != nullptr) { - io::Property::UnMarshall(*in.m_Carbohydrate, out.Carbohydrate()); - } - if (in.m_Fat != nullptr) { - io::Property::UnMarshall(*in.m_Fat, out.Fat()); - } - if (in.m_Protein != nullptr) { - io::Property::UnMarshall(*in.m_Protein, out.Protein()); - } - if (in.m_Calcium != nullptr) { - io::Property::UnMarshall(*in.m_Calcium, out.Calcium()); - } - if (in.m_Sodium != nullptr) { - io::Property::UnMarshall(*in.m_Sodium, out.Sodium()); - } - if (in.m_Water != nullptr) { - io::Property::UnMarshall(*in.m_Water, out.Water()); - } + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Carbohydrate) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Fat) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Protein) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Calcium) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Sodium) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Water) } //---------------------------------------------------------------------------------- } diff --git a/projects/biogears/libBiogears/src/io/cdm/PatientNutrition.h b/projects/biogears/libBiogears/src/io/cdm/PatientNutrition.h index 3a795cfc5..f3a0ac1ce 100644 --- a/projects/biogears/libBiogears/src/io/cdm/PatientNutrition.h +++ b/projects/biogears/libBiogears/src/io/cdm/PatientNutrition.h @@ -12,21 +12,29 @@ specific language governing permissions and limitations under the License. #pragma once #include +#include #include "biogears/cdm/CommonDataModel.h" #include #include -#define CDM_PATIENT_NUTRITION_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_PATIENT_NUTRITION_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ out.func(std::make_unique::type>()); \ - io::PatientNutrition::UnMarshall(*in.m_##func, out.func()); \ + io::PatientNutrition::Marshall(*in.m_##func, out.func()); \ } -#define CDM_OPTIONAL_PATIENT_NUTRITION_UNMARSHAL_HELPER(in, out, func) \ - if (in.m_##func) { \ - io::PatientNutrition::UnMarshall(*in.m_##func, out.func()); \ +#define CDM_OPTIONAL_PATIENT_NUTRITION_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func) { \ + io::PatientNutrition::Marshall(*in.m_##func, out.func()); \ + } + +#define CDM_PATIENT_NUTRITION_COPY(type, in, out) \ + { \ + CDM::type##Data middle; \ + io::PatientNutrition::Marshall(in, middle); \ + io::PatientNutrition::UnMarshall(middle, out); \ } namespace biogears { @@ -35,32 +43,32 @@ class SENutrition; namespace io { class BIOGEARS_PRIVATE_API PatientNutrition { public: - //template option + // template option template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); - //class SENutrition - static void Marshall(const CDM::NutritionData& in, SENutrition& out); - static void UnMarshall(const SENutrition& in, CDM::NutritionData& out); + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); + // class SENutrition + static void UnMarshall(const CDM::NutritionData& in, SENutrition& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SENutrition& in, CDM::NutritionData& out); }; //---------------------------------------------------------------------------------- template - void PatientNutrition::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + void PatientNutrition::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) { if (!option_in.present()) { - out.Clear(); + out.Invalidate(); } else { - Marshall(option_in.get(), out); + UnMarshall(option_in.get(), out); } } //---------------------------------------------------------------------------------- template - void PatientNutrition::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void PatientNutrition::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); + Marshall(in, *item); option_out.set(*item); } } // Namespace IO -} //Namespace Biogears +} // Namespace Biogears diff --git a/projects/biogears/libBiogears/src/io/cdm/Physiology.cpp b/projects/biogears/libBiogears/src/io/cdm/Physiology.cpp index eedfac30d..6b236423f 100644 --- a/projects/biogears/libBiogears/src/io/cdm/Physiology.cpp +++ b/projects/biogears/libBiogears/src/io/cdm/Physiology.cpp @@ -1,11 +1,13 @@ #include "Physiology.h" +#include "Actions.h" #include "PatientNutrition.h" #include "Property.h" #include "System.h" #include +#include #include #include #include @@ -22,680 +24,921 @@ namespace biogears { namespace io { // class SEPupillaryResponse - void Physiology::Marshall(const CDM::PupillaryResponseData& in, SEPupillaryResponse& out) + void Physiology::UnMarshall(const CDM::PupillaryResponseData& in, SEPupillaryResponse& out) { - io::Property::Marshall(in.ReactivityModifier(), out.GetReactivityModifier()); - io::Property::Marshall(in.ShapeModifier(), out.GetShapeModifier()); - io::Property::Marshall(in.SizeModifier(), out.GetSizeModifier()); + io::Property::UnMarshall(in.ReactivityModifier(), out.GetReactivityModifier()); + io::Property::UnMarshall(in.ShapeModifier(), out.GetShapeModifier()); + io::Property::UnMarshall(in.SizeModifier(), out.GetSizeModifier()); } - void Physiology::UnMarshall(const SEPupillaryResponse& in, CDM::PupillaryResponseData& out) + void Physiology::Marshall(const SEPupillaryResponse& in, CDM::PupillaryResponseData& out) { - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ReactivityModifier) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ShapeModifier) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SizeModifier) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ReactivityModifier) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ShapeModifier) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SizeModifier) } //---------------------------------------------------------------------------------- // class SEInflammationState - void Physiology::Marshall(const CDM::InflammatoryResponseData& in, SEInflammatoryResponse& out) - { - out.SetActiveTLR(in.ActiveTLR()); - - io::Property::Marshall(in.LocalPathogen(), out.GetLocalPathogen()); - io::Property::Marshall(in.LocalMacrophage(), out.GetLocalMacrophage()); - io::Property::Marshall(in.LocalNeutrophil(), out.GetLocalNeutrophil()); - io::Property::Marshall(in.LocalBarrier(), out.GetLocalBarrier()); - io::Property::Marshall(in.AutonomicResponseLevel(), out.GetAutonomicResponseLevel()); - io::Property::Marshall(in.Catecholamines(), out.GetCatecholamines()); - io::Property::Marshall(in.ConstitutiveNOS(), out.GetConstitutiveNOS()); - io::Property::Marshall(in.InducibleNOSPre(), out.GetInducibleNOSPre()); - io::Property::Marshall(in.InducibleNOS(), out.GetInducibleNOS()); - io::Property::Marshall(in.Interleukin6(), out.GetInterleukin6()); - io::Property::Marshall(in.Interleukin10(), out.GetInterleukin10()); - io::Property::Marshall(in.Interleukin12(), out.GetInterleukin12()); - io::Property::Marshall(in.MacrophageResting(), out.GetMacrophageResting()); - io::Property::Marshall(in.MacrophageActive(), out.GetMacrophageActive()); - io::Property::Marshall(in.NeutrophilResting(), out.GetNeutrophilResting()); - io::Property::Marshall(in.NeutrophilActive(), out.GetNeutrophilActive()); - io::Property::Marshall(in.Nitrate(), out.GetNitrate()); - io::Property::Marshall(in.NitricOxide(), out.GetNitricOxide()); - io::Property::Marshall(in.BloodPathogen(), out.GetBloodPathogen()); - io::Property::Marshall(in.TissueIntegrity(), out.GetTissueIntegrity()); - io::Property::Marshall(in.Trauma(), out.GetTrauma()); - io::Property::Marshall(in.TumorNecrosisFactor(), out.GetTumorNecrosisFactor()); - io::Property::Marshall(in.InflammationTime(), out.GetInflammationTime()); + void Physiology::UnMarshall(const CDM::InflammatoryResponseData& in, SEInflammatoryResponse& out) + { + auto activeTLR = out.GetActiveTLR(); + io::Property::UnMarshall(in.ActiveTLR(), activeTLR); + out.SetActiveTLR(activeTLR); + + io::Property::UnMarshall(in.LocalPathogen(), out.GetLocalPathogen()); + io::Property::UnMarshall(in.LocalMacrophage(), out.GetLocalMacrophage()); + io::Property::UnMarshall(in.LocalNeutrophil(), out.GetLocalNeutrophil()); + io::Property::UnMarshall(in.LocalBarrier(), out.GetLocalBarrier()); + io::Property::UnMarshall(in.AutonomicResponseLevel(), out.GetAutonomicResponseLevel()); + io::Property::UnMarshall(in.Catecholamines(), out.GetCatecholamines()); + io::Property::UnMarshall(in.ConstitutiveNOS(), out.GetConstitutiveNOS()); + io::Property::UnMarshall(in.InducibleNOSPre(), out.GetInducibleNOSPre()); + io::Property::UnMarshall(in.InducibleNOS(), out.GetInducibleNOS()); + io::Property::UnMarshall(in.Interleukin6(), out.GetInterleukin6()); + io::Property::UnMarshall(in.Interleukin10(), out.GetInterleukin10()); + io::Property::UnMarshall(in.Interleukin12(), out.GetInterleukin12()); + io::Property::UnMarshall(in.MacrophageResting(), out.GetMacrophageResting()); + io::Property::UnMarshall(in.MacrophageActive(), out.GetMacrophageActive()); + io::Property::UnMarshall(in.NeutrophilResting(), out.GetNeutrophilResting()); + io::Property::UnMarshall(in.NeutrophilActive(), out.GetNeutrophilActive()); + io::Property::UnMarshall(in.Nitrate(), out.GetNitrate()); + io::Property::UnMarshall(in.NitricOxide(), out.GetNitricOxide()); + io::Property::UnMarshall(in.BloodPathogen(), out.GetBloodPathogen()); + io::Property::UnMarshall(in.TissueIntegrity(), out.GetTissueIntegrity()); + io::Property::UnMarshall(in.Trauma(), out.GetTrauma()); + io::Property::UnMarshall(in.TumorNecrosisFactor(), out.GetTumorNecrosisFactor()); + io::Property::UnMarshall(in.InflammationTime(), out.GetInflammationTime()); + + SEInflammationSource conversion; for (auto src : in.Source()) { - out.m_InflammationSources.push_back(src); + + UnMarshall(src, conversion); + out.m_InflammationSources.push_back(conversion); } } - void Physiology::UnMarshall(const SEInflammatoryResponse& in, CDM::InflammatoryResponseData& out) - { - CDM_ENUM_UNMARSHAL_HELPER(in, out, ActiveTLR); - - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, LocalPathogen) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, LocalMacrophage) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, LocalNeutrophil) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, LocalBarrier) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, AutonomicResponseLevel) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Catecholamines) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, ConstitutiveNOS) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, InducibleNOSPre) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, InducibleNOS) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Interleukin6) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Interleukin10) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Interleukin12) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, MacrophageResting) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, MacrophageActive) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, NeutrophilResting) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, NeutrophilActive) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Nitrate) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, NitricOxide) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, BloodPathogen) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, TissueIntegrity) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Trauma) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, TumorNecrosisFactor) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, InflammationTime) + void Physiology::Marshall(const SEInflammatoryResponse& in, CDM::InflammatoryResponseData& out) + { + + SE_PROPERTY_ENUM_PTR_MARSHALL_HELPER(in, out, ActiveTLR); + + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, LocalPathogen) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, LocalMacrophage) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, LocalNeutrophil) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, LocalBarrier) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, AutonomicResponseLevel) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Catecholamines) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, ConstitutiveNOS) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, InducibleNOSPre) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, InducibleNOS) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Interleukin6) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Interleukin10) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Interleukin12) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, MacrophageResting) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, MacrophageActive) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, NeutrophilResting) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, NeutrophilActive) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Nitrate) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, NitricOxide) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, BloodPathogen) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, TissueIntegrity) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Trauma) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, TumorNecrosisFactor) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, InflammationTime) + + CDM::enumInflammationSource conversion; for (auto src : in.m_InflammationSources) { - out.Source().push_back(src); + + Marshall(src, conversion); + out.Source().push_back(conversion); } } //---------------------------------------------------------------------------------- // class SEBloodChemistrySystem - void Physiology::Marshall(const CDM::BloodChemistrySystemData& in, SEBloodChemistrySystem& out) - { - System::Marshall(static_cast(in), static_cast(out)); - - io::Property::Marshall(in.BloodDensity(), out.GetBloodDensity()); - io::Property::Marshall(in.ArterialBloodPH(), out.GetArterialBloodPH()); - io::Property::Marshall(in.ArterialBloodPHBaseline(), out.GetArterialBloodPHBaseline()); - io::Property::Marshall(in.VenousBloodPH(), out.GetVenousBloodPH()); - io::Property::Marshall(in.BloodSpecificHeat(), out.GetBloodSpecificHeat()); - io::Property::Marshall(in.BloodUreaNitrogenConcentration(), out.GetBloodUreaNitrogenConcentration()); - io::Property::Marshall(in.CarbonDioxideSaturation(), out.GetCarbonDioxideSaturation()); - io::Property::Marshall(in.CarbonMonoxideSaturation(), out.GetCarbonMonoxideSaturation()); - io::Property::Marshall(in.Hematocrit(), out.GetHematocrit()); - io::Property::Marshall(in.HemoglobinContent(), out.GetHemoglobinContent()); - io::Property::Marshall(in.HemoglobinLostToUrine(), out.GetHemoglobinLostToUrine()); - io::Property::Marshall(in.LymphocyteCellCount(), out.GetLymphocyteCellCount()); - io::Property::Marshall(in.NeutrophilCellCount(), out.GetNeutrophilCellCount()); - io::Property::Marshall(in.OxygenSaturation(), out.GetOxygenSaturation()); - io::Property::Marshall(in.OxygenVenousSaturation(), out.GetOxygenVenousSaturation()); - io::Property::Marshall(in.Phosphate(), out.GetPhosphate()); - io::Property::Marshall(in.PlasmaVolume(), out.GetPlasmaVolume()); - io::Property::Marshall(in.PulseOximetry(), out.GetPulseOximetry()); - io::Property::Marshall(in.RedBloodCellAcetylcholinesterase(), out.GetRedBloodCellAcetylcholinesterase()); - io::Property::Marshall(in.RedBloodCellCount(), out.GetRedBloodCellCount()); - io::Property::Marshall(in.ShuntFraction(), out.GetShuntFraction()); - io::Property::Marshall(in.StrongIonDifference(), out.GetStrongIonDifference()); - io::Property::Marshall(in.TotalBilirubin(), out.GetTotalBilirubin()); - io::Property::Marshall(in.TotalProteinConcentration(), out.GetTotalProteinConcentration()); - io::Property::Marshall(in.RhTransfusionReactionVolume(), out.GetRhTransfusionReactionVolume()); - io::Property::Marshall(in.ViralLoad(), out.GetViralLoad()); - io::Property::Marshall(in.VolumeFractionNeutralPhospholipidInPlasma(), out.GetVolumeFractionNeutralPhospholipidInPlasma()); - io::Property::Marshall(in.VolumeFractionNeutralLipidInPlasma(), out.GetVolumeFractionNeutralLipidInPlasma()); - io::Property::Marshall(in.WhiteBloodCellCount(), out.GetWhiteBloodCellCount()); - - io::Property::Marshall(in.ArterialCarbonDioxidePressure(), out.GetArterialCarbonDioxidePressure()); - io::Property::Marshall(in.ArterialOxygenPressure(), out.GetArterialOxygenPressure()); - io::Property::Marshall(in.PulmonaryArterialCarbonDioxidePressure(), out.GetPulmonaryArterialCarbonDioxidePressure()); - io::Property::Marshall(in.PulmonaryArterialOxygenPressure(), out.GetPulmonaryArterialOxygenPressure()); - io::Property::Marshall(in.PulmonaryVenousCarbonDioxidePressure(), out.GetPulmonaryVenousCarbonDioxidePressure()); - io::Property::Marshall(in.PulmonaryVenousOxygenPressure(), out.GetPulmonaryVenousOxygenPressure()); - io::Property::Marshall(in.VenousCarbonDioxidePressure(), out.GetVenousCarbonDioxidePressure()); - io::Property::Marshall(in.VenousOxygenPressure(), out.GetVenousOxygenPressure()); - - Marshall(in.InflammatoryResponse(), out.GetInflammatoryResponse()); - } - void Physiology::UnMarshall(const SEBloodChemistrySystem& in, CDM::BloodChemistrySystemData& out) - { - System::UnMarshall(static_cast(in), static_cast(out)); - - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, BloodDensity) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ArterialBloodPH) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ArterialBloodPHBaseline) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, VenousBloodPH) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, BloodSpecificHeat) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, BloodUreaNitrogenConcentration) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, CarbonDioxideSaturation) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, CarbonMonoxideSaturation) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Hematocrit) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, HemoglobinContent) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, HemoglobinLostToUrine) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LymphocyteCellCount) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, NeutrophilCellCount) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, OxygenSaturation) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, OxygenVenousSaturation) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Phosphate) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PlasmaVolume) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PulseOximetry) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RedBloodCellAcetylcholinesterase) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RedBloodCellCount) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ShuntFraction) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, StrongIonDifference) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, TotalBilirubin) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, TotalProteinConcentration) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RhTransfusionReactionVolume) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ViralLoad) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, VolumeFractionNeutralPhospholipidInPlasma) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, VolumeFractionNeutralLipidInPlasma) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, WhiteBloodCellCount) - - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ArterialCarbonDioxidePressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ArterialOxygenPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PulmonaryArterialCarbonDioxidePressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PulmonaryArterialOxygenPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PulmonaryVenousCarbonDioxidePressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PulmonaryVenousOxygenPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, VenousCarbonDioxidePressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, VenousOxygenPressure) - - UnMarshall(*in.m_InflammatoryResponse, out.InflammatoryResponse()); + void Physiology::UnMarshall(const CDM::BloodChemistrySystemData& in, SEBloodChemistrySystem& out) + { + System::UnMarshall(static_cast(in), static_cast(out)); + + io::Property::UnMarshall(in.BloodDensity(), out.GetBloodDensity()); + io::Property::UnMarshall(in.ArterialBloodPH(), out.GetArterialBloodPH()); + io::Property::UnMarshall(in.ArterialBloodPHBaseline(), out.GetArterialBloodPHBaseline()); + io::Property::UnMarshall(in.VenousBloodPH(), out.GetVenousBloodPH()); + io::Property::UnMarshall(in.BloodSpecificHeat(), out.GetBloodSpecificHeat()); + io::Property::UnMarshall(in.BloodUreaNitrogenConcentration(), out.GetBloodUreaNitrogenConcentration()); + io::Property::UnMarshall(in.CarbonDioxideSaturation(), out.GetCarbonDioxideSaturation()); + io::Property::UnMarshall(in.CarbonMonoxideSaturation(), out.GetCarbonMonoxideSaturation()); + io::Property::UnMarshall(in.Hematocrit(), out.GetHematocrit()); + io::Property::UnMarshall(in.HemoglobinContent(), out.GetHemoglobinContent()); + io::Property::UnMarshall(in.HemoglobinLostToUrine(), out.GetHemoglobinLostToUrine()); + io::Property::UnMarshall(in.LymphocyteCellCount(), out.GetLymphocyteCellCount()); + io::Property::UnMarshall(in.NeutrophilCellCount(), out.GetNeutrophilCellCount()); + io::Property::UnMarshall(in.OxygenSaturation(), out.GetOxygenSaturation()); + io::Property::UnMarshall(in.OxygenVenousSaturation(), out.GetOxygenVenousSaturation()); + io::Property::UnMarshall(in.Phosphate(), out.GetPhosphate()); + io::Property::UnMarshall(in.PlasmaVolume(), out.GetPlasmaVolume()); + io::Property::UnMarshall(in.PulseOximetry(), out.GetPulseOximetry()); + io::Property::UnMarshall(in.RedBloodCellAcetylcholinesterase(), out.GetRedBloodCellAcetylcholinesterase()); + io::Property::UnMarshall(in.RedBloodCellCount(), out.GetRedBloodCellCount()); + io::Property::UnMarshall(in.ShuntFraction(), out.GetShuntFraction()); + io::Property::UnMarshall(in.StrongIonDifference(), out.GetStrongIonDifference()); + io::Property::UnMarshall(in.TotalBilirubin(), out.GetTotalBilirubin()); + io::Property::UnMarshall(in.TotalProteinConcentration(), out.GetTotalProteinConcentration()); + io::Property::UnMarshall(in.RhTransfusionReactionVolume(), out.GetRhTransfusionReactionVolume()); + io::Property::UnMarshall(in.ViralLoad(), out.GetViralLoad()); + io::Property::UnMarshall(in.VolumeFractionNeutralPhospholipidInPlasma(), out.GetVolumeFractionNeutralPhospholipidInPlasma()); + io::Property::UnMarshall(in.VolumeFractionNeutralLipidInPlasma(), out.GetVolumeFractionNeutralLipidInPlasma()); + io::Property::UnMarshall(in.WhiteBloodCellCount(), out.GetWhiteBloodCellCount()); + + io::Property::UnMarshall(in.ArterialCarbonDioxidePressure(), out.GetArterialCarbonDioxidePressure()); + io::Property::UnMarshall(in.ArterialOxygenPressure(), out.GetArterialOxygenPressure()); + io::Property::UnMarshall(in.PulmonaryArterialCarbonDioxidePressure(), out.GetPulmonaryArterialCarbonDioxidePressure()); + io::Property::UnMarshall(in.PulmonaryArterialOxygenPressure(), out.GetPulmonaryArterialOxygenPressure()); + io::Property::UnMarshall(in.PulmonaryVenousCarbonDioxidePressure(), out.GetPulmonaryVenousCarbonDioxidePressure()); + io::Property::UnMarshall(in.PulmonaryVenousOxygenPressure(), out.GetPulmonaryVenousOxygenPressure()); + io::Property::UnMarshall(in.VenousCarbonDioxidePressure(), out.GetVenousCarbonDioxidePressure()); + io::Property::UnMarshall(in.VenousOxygenPressure(), out.GetVenousOxygenPressure()); + + UnMarshall(in.InflammatoryResponse(), out.GetInflammatoryResponse()); + } + void Physiology::Marshall(const SEBloodChemistrySystem& in, CDM::BloodChemistrySystemData& out) + { + System::Marshall(static_cast(in), static_cast(out)); + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, BloodDensity) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ArterialBloodPH) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ArterialBloodPHBaseline) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, VenousBloodPH) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, BloodSpecificHeat) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, BloodUreaNitrogenConcentration) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, CarbonDioxideSaturation) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, CarbonMonoxideSaturation) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Hematocrit) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, HemoglobinContent) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, HemoglobinLostToUrine) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LymphocyteCellCount) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, NeutrophilCellCount) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, OxygenSaturation) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, OxygenVenousSaturation) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Phosphate) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PlasmaVolume) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PulseOximetry) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RedBloodCellAcetylcholinesterase) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RedBloodCellCount) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ShuntFraction) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, StrongIonDifference) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TotalBilirubin) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TotalProteinConcentration) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RhTransfusionReactionVolume) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ViralLoad) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, VolumeFractionNeutralPhospholipidInPlasma) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, VolumeFractionNeutralLipidInPlasma) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, WhiteBloodCellCount) + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ArterialCarbonDioxidePressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ArterialOxygenPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PulmonaryArterialCarbonDioxidePressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PulmonaryArterialOxygenPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PulmonaryVenousCarbonDioxidePressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PulmonaryVenousOxygenPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, VenousCarbonDioxidePressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, VenousOxygenPressure) + + Marshall(*in.m_InflammatoryResponse, out.InflammatoryResponse()); } //---------------------------------------------------------------------------------- // class SECardiovascularSystem - void Physiology::Marshall(const CDM::CardiovascularSystemData& in, SECardiovascularSystem& out) + void Physiology::UnMarshall(const CDM::CardiovascularSystemData& in, SECardiovascularSystem& out) { - System::Marshall(static_cast(in), static_cast(out)); - if (in.HeartRhythm().present()) { - out.SetHeartRhythm(in.HeartRhythm().get()); - } + System::UnMarshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.ArterialPressure(), out.GetArterialPressure()); - io::Property::Marshall(in.BloodVolume(), out.GetBloodVolume()); - io::Property::Marshall(in.CardiacIndex(), out.GetCardiacIndex()); - io::Property::Marshall(in.CardiacOutput(), out.GetCardiacOutput()); - io::Property::Marshall(in.CentralVenousPressure(), out.GetCentralVenousPressure()); - io::Property::Marshall(in.CerebralBloodFlow(), out.GetCerebralBloodFlow()); - io::Property::Marshall(in.CerebralPerfusionPressure(), out.GetCerebralPerfusionPressure()); - io::Property::Marshall(in.DiastolicArterialPressure(), out.GetDiastolicArterialPressure()); - io::Property::Marshall(in.ExtremityPressureLeftArm(), out.GetExtremityPressureLeftArm()); - io::Property::Marshall(in.ExtremityPressureLeftLeg(), out.GetExtremityPressureLeftLeg()); - io::Property::Marshall(in.ExtremityPressureRightArm(), out.GetExtremityPressureRightArm()); - io::Property::Marshall(in.ExtremityPressureRightLeg(), out.GetExtremityPressureRightLeg()); - io::Property::Marshall(in.HeartEjectionFraction(), out.GetHeartEjectionFraction()); - io::Property::Marshall(in.HeartRate(), out.GetHeartRate()); - - io::Property::Marshall(in.HeartStrokeVolume(), out.GetHeartStrokeVolume()); - io::Property::Marshall(in.IntracranialPressure(), out.GetIntracranialPressure()); - io::Property::Marshall(in.MeanArterialPressure(), out.GetMeanArterialPressure()); - io::Property::Marshall(in.MeanArterialCarbonDioxidePartialPressure(), out.GetMeanArterialCarbonDioxidePartialPressure()); - io::Property::Marshall(in.MeanArterialCarbonDioxidePartialPressureDelta(), out.GetMeanArterialCarbonDioxidePartialPressureDelta()); - io::Property::Marshall(in.MeanCentralVenousPressure(), out.GetMeanCentralVenousPressure()); - io::Property::Marshall(in.MeanSkinFlow(), out.GetMeanSkinFlow()); - io::Property::Marshall(in.PulmonaryArterialPressure(), out.GetPulmonaryArterialPressure()); - io::Property::Marshall(in.PulmonaryCapillariesWedgePressure(), out.GetPulmonaryCapillariesWedgePressure()); - io::Property::Marshall(in.PulmonaryDiastolicArterialPressure(), out.GetPulmonaryDiastolicArterialPressure()); - io::Property::Marshall(in.PulmonaryMeanArterialPressure(), out.GetPulmonaryMeanArterialPressure()); - io::Property::Marshall(in.PulmonaryMeanCapillaryFlow(), out.GetPulmonaryMeanCapillaryFlow()); - io::Property::Marshall(in.PulmonaryMeanShuntFlow(), out.GetPulmonaryMeanShuntFlow()); - io::Property::Marshall(in.PulmonarySystolicArterialPressure(), out.GetPulmonarySystolicArterialPressure()); - io::Property::Marshall(in.PulmonaryVascularResistance(), out.GetPulmonaryVascularResistance()); - io::Property::Marshall(in.PulmonaryVascularResistanceIndex(), out.GetPulmonaryVascularResistanceIndex()); - io::Property::Marshall(in.PulsePressure(), out.GetPulsePressure()); - io::Property::Marshall(in.SystolicArterialPressure(), out.GetSystolicArterialPressure()); - io::Property::Marshall(in.SystemicVascularResistance(), out.GetSystemicVascularResistance()); - } - void Physiology::UnMarshall(const SECardiovascularSystem& in, CDM::CardiovascularSystemData& out) - { - System::UnMarshall(static_cast(in), static_cast(out)); - if (in.HasHeartRhythm()) { - out.HeartRhythm(in.m_HeartRhythm); - } + UnMarshall(in.HeartRhythm(), out.m_HeartRhythm); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ArterialPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, BloodVolume) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, CardiacIndex) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, CardiacOutput) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, CentralVenousPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, CerebralBloodFlow) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, CerebralPerfusionPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, DiastolicArterialPressure) - - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ExtremityPressureLeftArm) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ExtremityPressureLeftLeg) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ExtremityPressureRightArm) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ExtremityPressureRightLeg) - - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, HeartEjectionFraction) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, HeartRate) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, HeartStrokeVolume) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, IntracranialPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MeanArterialPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MeanArterialCarbonDioxidePartialPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MeanArterialCarbonDioxidePartialPressureDelta) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MeanCentralVenousPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MeanSkinFlow) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PulmonaryArterialPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PulmonaryCapillariesWedgePressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PulmonaryDiastolicArterialPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PulmonaryMeanArterialPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PulmonaryMeanCapillaryFlow) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PulmonaryMeanShuntFlow) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PulmonarySystolicArterialPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PulmonaryVascularResistance) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PulmonaryVascularResistanceIndex) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PulsePressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SystolicArterialPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SystemicVascularResistance) + io::Property::UnMarshall(in.ArterialPressure(), out.GetArterialPressure()); + io::Property::UnMarshall(in.BloodVolume(), out.GetBloodVolume()); + io::Property::UnMarshall(in.CardiacIndex(), out.GetCardiacIndex()); + io::Property::UnMarshall(in.CardiacOutput(), out.GetCardiacOutput()); + io::Property::UnMarshall(in.CentralVenousPressure(), out.GetCentralVenousPressure()); + io::Property::UnMarshall(in.CerebralBloodFlow(), out.GetCerebralBloodFlow()); + io::Property::UnMarshall(in.CerebralPerfusionPressure(), out.GetCerebralPerfusionPressure()); + io::Property::UnMarshall(in.DiastolicArterialPressure(), out.GetDiastolicArterialPressure()); + io::Property::UnMarshall(in.ExtremityPressureLeftArm(), out.GetExtremityPressureLeftArm()); + io::Property::UnMarshall(in.ExtremityPressureLeftLeg(), out.GetExtremityPressureLeftLeg()); + io::Property::UnMarshall(in.ExtremityPressureRightArm(), out.GetExtremityPressureRightArm()); + io::Property::UnMarshall(in.ExtremityPressureRightLeg(), out.GetExtremityPressureRightLeg()); + io::Property::UnMarshall(in.HeartEjectionFraction(), out.GetHeartEjectionFraction()); + io::Property::UnMarshall(in.HeartRate(), out.GetHeartRate()); + + io::Property::UnMarshall(in.HeartStrokeVolume(), out.GetHeartStrokeVolume()); + io::Property::UnMarshall(in.IntracranialPressure(), out.GetIntracranialPressure()); + io::Property::UnMarshall(in.MeanArterialPressure(), out.GetMeanArterialPressure()); + io::Property::UnMarshall(in.MeanArterialCarbonDioxidePartialPressure(), out.GetMeanArterialCarbonDioxidePartialPressure()); + io::Property::UnMarshall(in.MeanArterialCarbonDioxidePartialPressureDelta(), out.GetMeanArterialCarbonDioxidePartialPressureDelta()); + io::Property::UnMarshall(in.MeanCentralVenousPressure(), out.GetMeanCentralVenousPressure()); + io::Property::UnMarshall(in.MeanSkinFlow(), out.GetMeanSkinFlow()); + io::Property::UnMarshall(in.PulmonaryArterialPressure(), out.GetPulmonaryArterialPressure()); + io::Property::UnMarshall(in.PulmonaryCapillariesWedgePressure(), out.GetPulmonaryCapillariesWedgePressure()); + io::Property::UnMarshall(in.PulmonaryDiastolicArterialPressure(), out.GetPulmonaryDiastolicArterialPressure()); + io::Property::UnMarshall(in.PulmonaryMeanArterialPressure(), out.GetPulmonaryMeanArterialPressure()); + io::Property::UnMarshall(in.PulmonaryMeanCapillaryFlow(), out.GetPulmonaryMeanCapillaryFlow()); + io::Property::UnMarshall(in.PulmonaryMeanShuntFlow(), out.GetPulmonaryMeanShuntFlow()); + io::Property::UnMarshall(in.PulmonarySystolicArterialPressure(), out.GetPulmonarySystolicArterialPressure()); + io::Property::UnMarshall(in.PulmonaryVascularResistance(), out.GetPulmonaryVascularResistance()); + io::Property::UnMarshall(in.PulmonaryVascularResistanceIndex(), out.GetPulmonaryVascularResistanceIndex()); + io::Property::UnMarshall(in.PulsePressure(), out.GetPulsePressure()); + io::Property::UnMarshall(in.SystolicArterialPressure(), out.GetSystolicArterialPressure()); + io::Property::UnMarshall(in.SystemicVascularResistance(), out.GetSystemicVascularResistance()); + } + void Physiology::Marshall(const SECardiovascularSystem& in, CDM::CardiovascularSystemData& out) + { + System::Marshall(static_cast(in), static_cast(out)); + + SE_OPTIONAL_PHYSIOLOGY_ENUM_PTR_MARSHALL_HELPER(in, out, HeartRhythm) + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ArterialPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, BloodVolume) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, CardiacIndex) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, CardiacOutput) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, CentralVenousPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, CerebralBloodFlow) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, CerebralPerfusionPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, DiastolicArterialPressure) + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ExtremityPressureLeftArm) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ExtremityPressureLeftLeg) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ExtremityPressureRightArm) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ExtremityPressureRightLeg) + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, HeartEjectionFraction) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, HeartRate) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, HeartStrokeVolume) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, IntracranialPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MeanArterialPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MeanArterialCarbonDioxidePartialPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MeanArterialCarbonDioxidePartialPressureDelta) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MeanCentralVenousPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MeanSkinFlow) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PulmonaryArterialPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PulmonaryCapillariesWedgePressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PulmonaryDiastolicArterialPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PulmonaryMeanArterialPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PulmonaryMeanCapillaryFlow) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PulmonaryMeanShuntFlow) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PulmonarySystolicArterialPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PulmonaryVascularResistance) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PulmonaryVascularResistanceIndex) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PulsePressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SystolicArterialPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SystemicVascularResistance) } //---------------------------------------------------------------------------------- // class SEDrugSystem - void Physiology::Marshall(const CDM::DrugSystemData& in, SEDrugSystem& out) - { - System::Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.AntibioticActivity(), out.GetAntibioticActivity()); - io::Property::Marshall(in.BronchodilationLevel(), out.GetBronchodilationLevel()); - io::Property::Marshall(in.FeverChange(), out.GetFeverChange()); - io::Property::Marshall(in.HeartRateChange(), out.GetHeartRateChange()); - io::Property::Marshall(in.HemorrhageChange(), out.GetHemorrhageChange()); - io::Property::Marshall(in.MeanBloodPressureChange(), out.GetMeanBloodPressureChange()); - io::Property::Marshall(in.NeuromuscularBlockLevel(), out.GetNeuromuscularBlockLevel()); - io::Property::Marshall(in.PainToleranceChange(), out.GetPainToleranceChange()); - io::Property::Marshall(in.PulsePressureChange(), out.GetPulsePressureChange()); - io::Property::Marshall(in.RespirationRateChange(), out.GetRespirationRateChange()); - io::Property::Marshall(in.SedationLevel(), out.GetSedationLevel()); - io::Property::Marshall(in.TidalVolumeChange(), out.GetTidalVolumeChange()); - io::Property::Marshall(in.TubularPermeabilityChange(), out.GetTubularPermeabilityChange()); - io::Property::Marshall(in.CentralNervousResponse(), out.GetCentralNervousResponse()); - } - void Physiology::UnMarshall(const SEDrugSystem& in, CDM::DrugSystemData& out) - { - System::UnMarshall(static_cast(in), static_cast(out)); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, AntibioticActivity) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, BronchodilationLevel) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, FeverChange) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, HeartRateChange) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, HemorrhageChange) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MeanBloodPressureChange) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, NeuromuscularBlockLevel) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PainToleranceChange) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PulsePressureChange) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RespirationRateChange) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SedationLevel) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, TidalVolumeChange) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, TubularPermeabilityChange) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, CentralNervousResponse) + void Physiology::UnMarshall(const CDM::DrugSystemData& in, SEDrugSystem& out) + { + System::UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.AntibioticActivity(), out.GetAntibioticActivity()); + io::Property::UnMarshall(in.BronchodilationLevel(), out.GetBronchodilationLevel()); + io::Property::UnMarshall(in.FeverChange(), out.GetFeverChange()); + io::Property::UnMarshall(in.HeartRateChange(), out.GetHeartRateChange()); + io::Property::UnMarshall(in.HemorrhageChange(), out.GetHemorrhageChange()); + io::Property::UnMarshall(in.MeanBloodPressureChange(), out.GetMeanBloodPressureChange()); + io::Property::UnMarshall(in.NeuromuscularBlockLevel(), out.GetNeuromuscularBlockLevel()); + io::Property::UnMarshall(in.PainToleranceChange(), out.GetPainToleranceChange()); + io::Property::UnMarshall(in.PulsePressureChange(), out.GetPulsePressureChange()); + io::Property::UnMarshall(in.RespirationRateChange(), out.GetRespirationRateChange()); + io::Property::UnMarshall(in.SedationLevel(), out.GetSedationLevel()); + io::Property::UnMarshall(in.TidalVolumeChange(), out.GetTidalVolumeChange()); + io::Property::UnMarshall(in.TubularPermeabilityChange(), out.GetTubularPermeabilityChange()); + io::Property::UnMarshall(in.CentralNervousResponse(), out.GetCentralNervousResponse()); + } + void Physiology::Marshall(const SEDrugSystem& in, CDM::DrugSystemData& out) + { + System::Marshall(static_cast(in), static_cast(out)); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, AntibioticActivity) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, BronchodilationLevel) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, FeverChange) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, HeartRateChange) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, HemorrhageChange) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MeanBloodPressureChange) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, NeuromuscularBlockLevel) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PainToleranceChange) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PulsePressureChange) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RespirationRateChange) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SedationLevel) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TidalVolumeChange) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TubularPermeabilityChange) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, CentralNervousResponse) } //---------------------------------------------------------------------------------- // class SEEndocrineSystem - void Physiology::Marshall(const CDM::EndocrineSystemData& in, SEEndocrineSystem& out) + void Physiology::UnMarshall(const CDM::EndocrineSystemData& in, SEEndocrineSystem& out) { - System::Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.InsulinSynthesisRate(), out.GetInsulinSynthesisRate()); - io::Property::Marshall(in.GlucagonSynthesisRate(), out.GetGlucagonSynthesisRate()); + System::UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.InsulinSynthesisRate(), out.GetInsulinSynthesisRate()); + io::Property::UnMarshall(in.GlucagonSynthesisRate(), out.GetGlucagonSynthesisRate()); } - void Physiology::UnMarshall(const SEEndocrineSystem& in, CDM::EndocrineSystemData& out) + void Physiology::Marshall(const SEEndocrineSystem& in, CDM::EndocrineSystemData& out) { - System::UnMarshall(static_cast(in), static_cast(out)); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, InsulinSynthesisRate) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, GlucagonSynthesisRate) + System::Marshall(static_cast(in), static_cast(out)); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, InsulinSynthesisRate) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, GlucagonSynthesisRate) } //---------------------------------------------------------------------------------- // class SEEnergySystem - void Physiology::Marshall(const CDM::EnergySystemData& in, SEEnergySystem& out) - { - System::Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.AchievedExerciseLevel(), out.GetAchievedExerciseLevel()); - io::Property::Marshall(in.ChlorideLostToSweat(), out.GetChlorideLostToSweat()); - io::Property::Marshall(in.CoreTemperature(), out.GetCoreTemperature()); - io::Property::Marshall(in.CreatinineProductionRate(), out.GetCreatinineProductionRate()); - io::Property::Marshall(in.EnergyDeficit(), out.GetEnergyDeficit()); - io::Property::Marshall(in.ExerciseEnergyDemand(), out.GetExerciseEnergyDemand()); - io::Property::Marshall(in.ExerciseMeanArterialPressureDelta(), out.GetExerciseMeanArterialPressureDelta()); - io::Property::Marshall(in.FatigueLevel(), out.GetFatigueLevel()); - io::Property::Marshall(in.LactateProductionRate(), out.GetLactateProductionRate()); - io::Property::Marshall(in.PotassiumLostToSweat(), out.GetPotassiumLostToSweat()); - io::Property::Marshall(in.SkinTemperatureTorso(), out.GetSkinTemperatureTorso()); - io::Property::Marshall(in.SkinTemperatureHead(), out.GetSkinTemperatureHead()); - io::Property::Marshall(in.SkinTemperatureLeftArm(), out.GetSkinTemperatureLeftArm()); - io::Property::Marshall(in.SkinTemperatureRightArm(), out.GetSkinTemperatureRightArm()); - io::Property::Marshall(in.SkinTemperatureLeftLeg(), out.GetSkinTemperatureLeftLeg()); - io::Property::Marshall(in.SkinTemperatureRightLeg(), out.GetSkinTemperatureRightLeg()); - io::Property::Marshall(in.SodiumLostToSweat(), out.GetSodiumLostToSweat()); - io::Property::Marshall(in.SweatRate(), out.GetSweatRate()); - io::Property::Marshall(in.TotalMetabolicRate(), out.GetTotalMetabolicRate()); - io::Property::Marshall(in.TotalWorkRateLevel(), out.GetTotalWorkRateLevel()); - } - void Physiology::UnMarshall(const SEEnergySystem& in, CDM::EnergySystemData& out) - { - System::UnMarshall(static_cast(in), static_cast(out)); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, AchievedExerciseLevel) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ChlorideLostToSweat) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, CoreTemperature) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, CreatinineProductionRate) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, EnergyDeficit) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ExerciseEnergyDemand) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ExerciseMeanArterialPressureDelta) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, FatigueLevel) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LactateProductionRate) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PotassiumLostToSweat) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SkinTemperatureTorso) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SkinTemperatureHead) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SkinTemperatureLeftArm) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SkinTemperatureRightArm) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SkinTemperatureLeftLeg) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SkinTemperatureRightLeg) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SodiumLostToSweat) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SweatRate) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, TotalMetabolicRate) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, TotalWorkRateLevel) + void Physiology::UnMarshall(const CDM::EnergySystemData& in, SEEnergySystem& out) + { + + System::UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.AchievedExerciseLevel(), out.GetAchievedExerciseLevel()); + io::Property::UnMarshall(in.ChlorideLostToSweat(), out.GetChlorideLostToSweat()); + io::Property::UnMarshall(in.CoreTemperature(), out.GetCoreTemperature()); + io::Property::UnMarshall(in.CreatinineProductionRate(), out.GetCreatinineProductionRate()); + io::Property::UnMarshall(in.EnergyDeficit(), out.GetEnergyDeficit()); + io::Property::UnMarshall(in.ExerciseEnergyDemand(), out.GetExerciseEnergyDemand()); + io::Property::UnMarshall(in.ExerciseMeanArterialPressureDelta(), out.GetExerciseMeanArterialPressureDelta()); + io::Property::UnMarshall(in.FatigueLevel(), out.GetFatigueLevel()); + io::Property::UnMarshall(in.LactateProductionRate(), out.GetLactateProductionRate()); + io::Property::UnMarshall(in.PotassiumLostToSweat(), out.GetPotassiumLostToSweat()); + io::Property::UnMarshall(in.SkinTemperature(), out.GetSkinTemperature()); + io::Property::UnMarshall(in.SkinTemperatureTorso(), out.GetSkinTemperatureTorso()); + io::Property::UnMarshall(in.SkinTemperatureHead(), out.GetSkinTemperatureHead()); + io::Property::UnMarshall(in.SkinTemperatureLeftArm(), out.GetSkinTemperatureLeftArm()); + io::Property::UnMarshall(in.SkinTemperatureRightArm(), out.GetSkinTemperatureRightArm()); + io::Property::UnMarshall(in.SkinTemperatureLeftLeg(), out.GetSkinTemperatureLeftLeg()); + io::Property::UnMarshall(in.SkinTemperatureRightLeg(), out.GetSkinTemperatureRightLeg()); + io::Property::UnMarshall(in.BurnSkinTemperature(), out.GetBurnSkinTemperature()); + io::Property::UnMarshall(in.SodiumLostToSweat(), out.GetSodiumLostToSweat()); + io::Property::UnMarshall(in.SweatRate(), out.GetSweatRate()); + io::Property::UnMarshall(in.TotalMetabolicRate(), out.GetTotalMetabolicRate()); + io::Property::UnMarshall(in.TotalWorkRateLevel(), out.GetTotalWorkRateLevel()); + } + void Physiology::Marshall(const SEEnergySystem& in, CDM::EnergySystemData& out) + { + System::Marshall(static_cast(in), static_cast(out)); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, AchievedExerciseLevel) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ChlorideLostToSweat) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, CoreTemperature) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, CreatinineProductionRate) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, EnergyDeficit) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ExerciseEnergyDemand) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ExerciseMeanArterialPressureDelta) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, FatigueLevel) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LactateProductionRate) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PotassiumLostToSweat) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SkinTemperature) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SkinTemperatureTorso) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SkinTemperatureHead) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SkinTemperatureLeftArm) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SkinTemperatureRightArm) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SkinTemperatureLeftLeg) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SkinTemperatureRightLeg) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, BurnSkinTemperature); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SodiumLostToSweat) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SweatRate) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TotalMetabolicRate) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TotalWorkRateLevel) } //---------------------------------------------------------------------------------- // class SEGastrointestinalSystem - void Physiology::Marshall(const CDM::GastrointestinalSystemData& in, SEGastrointestinalSystem& out) + void Physiology::UnMarshall(const CDM::GastrointestinalSystemData& in, SEGastrointestinalSystem& out) { - System::Marshall(static_cast(in), static_cast(out)); + System::UnMarshall(static_cast(in), static_cast(out)); if (in.ChymeAbsorptionRate().present()) { - io::Property::Marshall(in.ChymeAbsorptionRate(), out.GetChymeAbsorptionRate()); + io::Property::UnMarshall(in.ChymeAbsorptionRate(), out.GetChymeAbsorptionRate()); } if (in.StomachContents().present()) { - out.GetStomachContents().Load(in.StomachContents().get()); + io::PatientNutrition::UnMarshall(in.StomachContents(), out.GetStomachContents()); } } - void Physiology::UnMarshall(const SEGastrointestinalSystem& in, CDM::GastrointestinalSystemData& out) + void Physiology::Marshall(const SEGastrointestinalSystem& in, CDM::GastrointestinalSystemData& out) { - System::UnMarshall(static_cast(in), static_cast(out)); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ChymeAbsorptionRate) - CDM_OPTIONAL_PATIENT_NUTRITION_UNMARSHAL_HELPER(in, out, StomachContents) + System::Marshall(static_cast(in), static_cast(out)); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ChymeAbsorptionRate) + CDM_OPTIONAL_PATIENT_NUTRITION_PTR_MARSHALL_HELPER(in, out, StomachContents) + } + //---------------------------------------------------------------------------------- + // class SEDrugTransitState + void Physiology::UnMarshall(const CDM::DrugTransitStateData& in, SEDrugTransitState& out) { + out.m_LumenDissolvedMasses.clear(); + SEScalarMass mass; + for (auto disMass : in.LumenDissolvedMasses()) { + io::Property::UnMarshall(disMass, mass); + out.m_LumenDissolvedMasses.push_back(mass); + } + out.m_LumenSolidMasses.clear(); + for (auto solMass : in.LumenSolidMasses()) { + io::Property::UnMarshall(solMass, mass); + out.m_LumenSolidMasses.push_back(mass); + } + out.m_EnterocyteMasses.clear(); + for (auto entMass : in.EnterocyteMasses()) { + io::Property::UnMarshall(entMass, mass); + out.m_EnterocyteMasses.push_back(mass); + } + io::Property::UnMarshall(in.MassExcreted(), out.GetTotalMassExcreted()); + io::Property::UnMarshall(in.MassMetabolized(), out.GetTotalMassMetabolized()); + + } + + void Physiology::Marshall(const SEDrugTransitState& in, CDM::DrugTransitStateData& out) { + for (auto tdMass : in.m_LumenDissolvedMasses) { + out.LumenDissolvedMasses().push_back(std::unique_ptr()); + io::Property::Marshall(tdMass, out.LumenDissolvedMasses().back()); + } + for (auto tsMass : in.m_LumenSolidMasses) { + out.LumenSolidMasses().push_back(std::unique_ptr()); + io::Property::Marshall(tsMass, out.LumenSolidMasses().back()); + } + for (auto eMass : in.m_EnterocyteMasses) { + out.EnterocyteMasses().push_back(std::unique_ptr()); + io::Property::Marshall(eMass, out.EnterocyteMasses().back()); + } + if (in.m_TotalMassMetabolized && in.m_TotalMassMetabolized->IsValid()) { + out.MassMetabolized(std::make_unique::type>()); + io::Property::Marshall(*in.m_TotalMassMetabolized, out.MassMetabolized()); + } + if (in.m_TotalMassExcreted && in.m_TotalMassExcreted->IsValid()) { + out.MassExcreted(std::make_unique::type>()); + io::Property::Marshall(*in.m_TotalMassMetabolized, out.MassExcreted()); + } + + out.Substance(in.m_Substance->GetName()); } //---------------------------------------------------------------------------------- // class SEHepaticSystem - void Physiology::Marshall(const CDM::HepaticSystemData& in, SEHepaticSystem& out) + void Physiology::UnMarshall(const CDM::HepaticSystemData& in, SEHepaticSystem& out) { - System::Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.KetoneProductionRate(), out.GetKetoneProductionRate()); - io::Property::Marshall(in.HepaticGluconeogenesisRate(), out.GetHepaticGluconeogenesisRate()); + System::UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.KetoneProductionRate(), out.GetKetoneProductionRate()); + io::Property::UnMarshall(in.HepaticGluconeogenesisRate(), out.GetHepaticGluconeogenesisRate()); } //---------------------------------------------------------------------------------- - void Physiology::UnMarshall(const SEHepaticSystem& in, CDM::HepaticSystemData& out) + void Physiology::Marshall(const SEHepaticSystem& in, CDM::HepaticSystemData& out) { - System::UnMarshall(static_cast(in), static_cast(out)); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, KetoneProductionRate) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, HepaticGluconeogenesisRate) + System::Marshall(static_cast(in), static_cast(out)); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, KetoneProductionRate) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, HepaticGluconeogenesisRate) } //---------------------------------------------------------------------------------- // class SENervousSystem - void Physiology::Marshall(const CDM::NervousSystemData& in, SENervousSystem& out) - { - System::Marshall(static_cast(in), static_cast(out)); - out.SetSleepState(in.SleepState().get()); - - io::Property::Marshall(in.ComplianceScale(), out.GetComplianceScale()); - io::Property::Marshall(in.HeartRateScale(), out.GetHeartRateScale()); - io::Property::Marshall(in.HeartElastanceScale(), out.GetHeartElastanceScale()); - io::Property::Marshall(in.MentalStatus(), out.GetMentalStatus()); - - io::Property::Marshall(in.PainVisualAnalogueScale(), out.GetPainVisualAnalogueScale()); - io::Property::Marshall(in.GlasgowComaScalar(), out.GetGlasgowComaScalar()); - io::Property::Marshall(in.ResistanceScaleExtrasplanchnic(), out.GetResistanceScaleExtrasplanchnic()); - io::Property::Marshall(in.ResistanceScaleMuscle(), out.GetResistanceScaleMuscle()); - io::Property::Marshall(in.ResistanceScaleMyocardium(), out.GetResistanceScaleMyocardium()); - io::Property::Marshall(in.ResistanceScaleSplanchnic(), out.GetResistanceScaleSplanchnic()); - io::Property::Marshall(in.SleepTime(), out.GetSleepTime()); - io::Property::Marshall(in.WakeTime(), out.GetWakeTime()); - - io::Property::Marshall(in.BiologicalDebt(), out.GetBiologicalDebt()); - io::Property::Marshall(in.ReactionTime(), out.GetReactionTime()); - io::Property::Marshall(in.AttentionLapses(), out.GetAttentionLapses()); - - io::Property::Marshall(in.RichmondAgitationSedationScale(), out.GetRichmondAgitationSedationScale()); - - Marshall(in.LeftEyePupillaryResponse(), out.GetLeftEyePupillaryResponse()); - Marshall(in.RightEyePupillaryResponse(), out.GetRightEyePupillaryResponse()); - } - void Physiology::UnMarshall(const SENervousSystem& in, CDM::NervousSystemData& out) - { - System::UnMarshall(static_cast(in), static_cast(out)); - out.SleepState(in.m_SleepState); - - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ComplianceScale) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, HeartRateScale) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, HeartElastanceScale) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MentalStatus) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PainVisualAnalogueScale) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, GlasgowComaScalar) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ResistanceScaleExtrasplanchnic) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ResistanceScaleMuscle) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ResistanceScaleMyocardium) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ResistanceScaleSplanchnic) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SleepTime) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, WakeTime) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, BiologicalDebt) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ReactionTime) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, AttentionLapses) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RichmondAgitationSedationScale) - - UnMarshall(*in.m_LeftEyePupillaryResponse, out.LeftEyePupillaryResponse()); - UnMarshall(*in.m_RightEyePupillaryResponse, out.RightEyePupillaryResponse()); + void Physiology::UnMarshall(const CDM::NervousSystemData& in, SENervousSystem& out) + { + System::UnMarshall(static_cast(in), static_cast(out)); + + if (in.ComplianceScale().present()) + io::Property::UnMarshall(in.ComplianceScale(), out.GetComplianceScale()); + if (in.HeartRateScale().present()) + io::Property::UnMarshall(in.HeartRateScale(), out.GetHeartRateScale()); + if (in.HeartElastanceScale().present()) + io::Property::UnMarshall(in.HeartElastanceScale(), out.GetHeartElastanceScale()); + if (in.MentalStatus().present()) + io::Property::UnMarshall(in.MentalStatus(), out.GetMentalStatus()); + if (in.GlasgowComaScalar().present()) + io::Property::UnMarshall(in.GlasgowComaScalar(), out.GetGlasgowComaScalar()); + + if (in.LeftEyePupillaryResponse().present()) + UnMarshall(in.LeftEyePupillaryResponse(), out.GetLeftEyePupillaryResponse()); + if (in.RightEyePupillaryResponse().present()) + UnMarshall(in.RightEyePupillaryResponse(), out.GetRightEyePupillaryResponse()); + + if (in.PainVisualAnalogueScale().present()) + io::Property::UnMarshall(in.PainVisualAnalogueScale(), out.GetPainVisualAnalogueScale()); + if (in.ResistanceScaleExtrasplanchnic().present()) + io::Property::UnMarshall(in.ResistanceScaleExtrasplanchnic(), out.GetResistanceScaleExtrasplanchnic()); + if (in.ResistanceScaleMuscle().present()) + io::Property::UnMarshall(in.ResistanceScaleMuscle(), out.GetResistanceScaleMuscle()); + if (in.ResistanceScaleMyocardium().present()) + io::Property::UnMarshall(in.ResistanceScaleMyocardium(), out.GetResistanceScaleMyocardium()); + if (in.ResistanceScaleSplanchnic().present()) + io::Property::UnMarshall(in.ResistanceScaleSplanchnic(), out.GetResistanceScaleSplanchnic()); + if (in.SleepTime().present()) + io::Property::UnMarshall(in.SleepTime(), out.GetSleepTime()); + if (in.WakeTime().present()) + io::Property::UnMarshall(in.WakeTime(), out.GetWakeTime()); + + if (in.SleepState().present()) + UnMarshall(in.SleepState(), out.m_SleepState); + + if (in.BiologicalDebt().present()) + io::Property::UnMarshall(in.BiologicalDebt(), out.GetBiologicalDebt()); + if (in.ReactionTime().present()) + io::Property::UnMarshall(in.ReactionTime(), out.GetReactionTime()); + if (in.AttentionLapses().present()) + io::Property::UnMarshall(in.AttentionLapses(), out.GetAttentionLapses()); + if (in.RichmondAgitationSedationScale().present()) + io::Property::UnMarshall(in.RichmondAgitationSedationScale(), out.GetRichmondAgitationSedationScale()); + } + void Physiology::Marshall(const SENervousSystem& in, CDM::NervousSystemData& out) + { + System::Marshall(static_cast(in), static_cast(out)); + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ComplianceScale) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, HeartRateScale) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, HeartElastanceScale) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MentalStatus) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, GlasgowComaScalar) + Marshall(*in.m_LeftEyePupillaryResponse, out.LeftEyePupillaryResponse()); + Marshall(*in.m_RightEyePupillaryResponse, out.RightEyePupillaryResponse()); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PainVisualAnalogueScale) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ResistanceScaleExtrasplanchnic) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ResistanceScaleMuscle) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ResistanceScaleMyocardium) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ResistanceScaleSplanchnic) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SleepTime) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, WakeTime) + + SE_OPTIONAL_PHYSIOLOGY_ENUM_PTR_MARSHALL_HELPER(in, out, SleepState) + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, BiologicalDebt) + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ReactionTime) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, AttentionLapses) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RichmondAgitationSedationScale) } //---------------------------------------------------------------------------------- // class SERenalSystem - void Physiology::Marshall(const CDM::RenalSystemData& in, SERenalSystem& out) - { - System::Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.BladderPressure(), out.GetBladderPressure()); - io::Property::Marshall(in.GlomerularFiltrationRate(), out.GetGlomerularFiltrationRate()); - io::Property::Marshall(in.FiltrationFraction(), out.GetFiltrationFraction()); - - io::Property::Marshall(in.LeftAfferentArterioleResistance(), out.GetLeftAfferentArterioleResistance()); - io::Property::Marshall(in.LeftBowmansCapsulesHydrostaticPressure(), out.GetLeftBowmansCapsulesHydrostaticPressure()); - io::Property::Marshall(in.LeftBowmansCapsulesOsmoticPressure(), out.GetLeftBowmansCapsulesOsmoticPressure()); - io::Property::Marshall(in.LeftEfferentArterioleResistance(), out.GetLeftEfferentArterioleResistance()); - io::Property::Marshall(in.LeftGlomerularCapillariesHydrostaticPressure(), out.GetLeftGlomerularCapillariesHydrostaticPressure()); - io::Property::Marshall(in.LeftGlomerularCapillariesOsmoticPressure(), out.GetLeftGlomerularCapillariesOsmoticPressure()); - io::Property::Marshall(in.LeftGlomerularFiltrationCoefficient(), out.GetLeftGlomerularFiltrationCoefficient()); - io::Property::Marshall(in.LeftGlomerularFiltrationRate(), out.GetLeftGlomerularFiltrationRate()); - io::Property::Marshall(in.LeftGlomerularFiltrationSurfaceArea(), out.GetLeftGlomerularFiltrationSurfaceArea()); - io::Property::Marshall(in.LeftGlomerularFluidPermeability(), out.GetLeftGlomerularFluidPermeability()); - io::Property::Marshall(in.LeftFiltrationFraction(), out.GetLeftFiltrationFraction()); - io::Property::Marshall(in.LeftNetFiltrationPressure(), out.GetLeftNetFiltrationPressure()); - io::Property::Marshall(in.LeftNetReabsorptionPressure(), out.GetLeftNetReabsorptionPressure()); - io::Property::Marshall(in.LeftPeritubularCapillariesHydrostaticPressure(), out.GetLeftPeritubularCapillariesHydrostaticPressure()); - io::Property::Marshall(in.LeftPeritubularCapillariesOsmoticPressure(), out.GetLeftPeritubularCapillariesOsmoticPressure()); - io::Property::Marshall(in.LeftReabsorptionFiltrationCoefficient(), out.GetLeftReabsorptionFiltrationCoefficient()); - io::Property::Marshall(in.LeftReabsorptionRate(), out.GetLeftReabsorptionRate()); - io::Property::Marshall(in.LeftTubularReabsorptionFiltrationSurfaceArea(), out.GetLeftTubularReabsorptionFiltrationSurfaceArea()); - io::Property::Marshall(in.LeftTubularReabsorptionFluidPermeability(), out.GetLeftTubularReabsorptionFluidPermeability()); - io::Property::Marshall(in.LeftTubularHydrostaticPressure(), out.GetLeftTubularHydrostaticPressure()); - io::Property::Marshall(in.LeftTubularOsmoticPressure(), out.GetLeftTubularOsmoticPressure()); - - io::Property::Marshall(in.RenalBloodFlow(), out.GetRenalBloodFlow()); - io::Property::Marshall(in.RenalPlasmaFlow(), out.GetRenalPlasmaFlow()); - io::Property::Marshall(in.RenalVascularResistance(), out.GetRenalVascularResistance()); - - io::Property::Marshall(in.RightAfferentArterioleResistance(), out.GetRightAfferentArterioleResistance()); - io::Property::Marshall(in.RightBowmansCapsulesHydrostaticPressure(), out.GetRightBowmansCapsulesHydrostaticPressure()); - io::Property::Marshall(in.RightBowmansCapsulesOsmoticPressure(), out.GetRightBowmansCapsulesOsmoticPressure()); - io::Property::Marshall(in.RightEfferentArterioleResistance(), out.GetRightEfferentArterioleResistance()); - io::Property::Marshall(in.RightGlomerularCapillariesHydrostaticPressure(), out.GetRightGlomerularCapillariesHydrostaticPressure()); - io::Property::Marshall(in.RightGlomerularCapillariesOsmoticPressure(), out.GetRightGlomerularCapillariesOsmoticPressure()); - io::Property::Marshall(in.RightGlomerularFiltrationCoefficient(), out.GetRightGlomerularFiltrationCoefficient()); - io::Property::Marshall(in.RightGlomerularFiltrationRate(), out.GetRightGlomerularFiltrationRate()); - io::Property::Marshall(in.RightGlomerularFiltrationSurfaceArea(), out.GetRightGlomerularFiltrationSurfaceArea()); - io::Property::Marshall(in.RightGlomerularFluidPermeability(), out.GetRightGlomerularFluidPermeability()); - io::Property::Marshall(in.RightFiltrationFraction(), out.GetRightFiltrationFraction()); - io::Property::Marshall(in.RightNetFiltrationPressure(), out.GetRightNetFiltrationPressure()); - io::Property::Marshall(in.RightNetReabsorptionPressure(), out.GetRightNetReabsorptionPressure()); - io::Property::Marshall(in.RightPeritubularCapillariesHydrostaticPressure(), out.GetRightPeritubularCapillariesHydrostaticPressure()); - io::Property::Marshall(in.RightPeritubularCapillariesOsmoticPressure(), out.GetRightPeritubularCapillariesOsmoticPressure()); - io::Property::Marshall(in.RightReabsorptionFiltrationCoefficient(), out.GetRightReabsorptionFiltrationCoefficient()); - io::Property::Marshall(in.RightReabsorptionRate(), out.GetRightReabsorptionRate()); - io::Property::Marshall(in.RightTubularReabsorptionFiltrationSurfaceArea(), out.GetRightTubularReabsorptionFiltrationSurfaceArea()); - io::Property::Marshall(in.RightTubularReabsorptionFluidPermeability(), out.GetRightTubularReabsorptionFluidPermeability()); - io::Property::Marshall(in.RightTubularHydrostaticPressure(), out.GetRightTubularHydrostaticPressure()); - io::Property::Marshall(in.RightTubularOsmoticPressure(), out.GetRightTubularOsmoticPressure()); - - io::Property::Marshall(in.UrinationRate(), out.GetUrinationRate()); - io::Property::Marshall(in.UrineOsmolality(), out.GetUrineOsmolality()); - io::Property::Marshall(in.UrineOsmolarity(), out.GetUrineOsmolarity()); - io::Property::Marshall(in.UrineProductionRate(), out.GetUrineProductionRate()); - io::Property::Marshall(in.MeanUrineOutput(), out.GetMeanUrineOutput()); - io::Property::Marshall(in.UrineSpecificGravity(), out.GetUrineSpecificGravity()); - io::Property::Marshall(in.UrineVolume(), out.GetUrineVolume()); - io::Property::Marshall(in.UrineUreaNitrogenConcentration(), out.GetUrineUreaNitrogenConcentration()); - } - void Physiology::UnMarshall(const SERenalSystem& in, CDM::RenalSystemData& out) - { - System::UnMarshall(static_cast(in), static_cast(out)); - - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, BladderPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, GlomerularFiltrationRate) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, FiltrationFraction) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftAfferentArterioleResistance) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftBowmansCapsulesHydrostaticPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftBowmansCapsulesOsmoticPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftEfferentArterioleResistance) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftGlomerularCapillariesHydrostaticPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftGlomerularCapillariesOsmoticPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftGlomerularFiltrationCoefficient) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftGlomerularFiltrationRate) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftGlomerularFiltrationSurfaceArea) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftGlomerularFluidPermeability) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftFiltrationFraction) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftNetFiltrationPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftNetReabsorptionPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftPeritubularCapillariesHydrostaticPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftPeritubularCapillariesOsmoticPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftReabsorptionFiltrationCoefficient) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftReabsorptionRate) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftTubularReabsorptionFiltrationSurfaceArea) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftTubularReabsorptionFluidPermeability) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftTubularHydrostaticPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LeftTubularOsmoticPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RenalBloodFlow) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RenalPlasmaFlow) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RenalVascularResistance) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightAfferentArterioleResistance) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightBowmansCapsulesHydrostaticPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightBowmansCapsulesOsmoticPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightEfferentArterioleResistance) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightGlomerularCapillariesHydrostaticPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightGlomerularCapillariesOsmoticPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightGlomerularFiltrationCoefficient) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightGlomerularFiltrationRate) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightGlomerularFiltrationSurfaceArea) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightGlomerularFluidPermeability) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightFiltrationFraction) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightNetFiltrationPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightNetReabsorptionPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightPeritubularCapillariesHydrostaticPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightPeritubularCapillariesOsmoticPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightReabsorptionFiltrationCoefficient) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightReabsorptionRate) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightTubularReabsorptionFiltrationSurfaceArea) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightTubularReabsorptionFluidPermeability) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightTubularHydrostaticPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RightTubularOsmoticPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, UrinationRate) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, UrineOsmolality) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, UrineOsmolarity) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, UrineProductionRate) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MeanUrineOutput) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, UrineSpecificGravity) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, UrineVolume) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, UrineUreaNitrogenConcentration) + void Physiology::UnMarshall(const CDM::RenalSystemData& in, SERenalSystem& out) + { + System::UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.BladderPressure(), out.GetBladderPressure()); + io::Property::UnMarshall(in.GlomerularFiltrationRate(), out.GetGlomerularFiltrationRate()); + io::Property::UnMarshall(in.FiltrationFraction(), out.GetFiltrationFraction()); + + io::Property::UnMarshall(in.LeftAfferentArterioleResistance(), out.GetLeftAfferentArterioleResistance()); + io::Property::UnMarshall(in.LeftBowmansCapsulesHydrostaticPressure(), out.GetLeftBowmansCapsulesHydrostaticPressure()); + io::Property::UnMarshall(in.LeftBowmansCapsulesOsmoticPressure(), out.GetLeftBowmansCapsulesOsmoticPressure()); + io::Property::UnMarshall(in.LeftEfferentArterioleResistance(), out.GetLeftEfferentArterioleResistance()); + io::Property::UnMarshall(in.LeftGlomerularCapillariesHydrostaticPressure(), out.GetLeftGlomerularCapillariesHydrostaticPressure()); + io::Property::UnMarshall(in.LeftGlomerularCapillariesOsmoticPressure(), out.GetLeftGlomerularCapillariesOsmoticPressure()); + io::Property::UnMarshall(in.LeftGlomerularFiltrationCoefficient(), out.GetLeftGlomerularFiltrationCoefficient()); + io::Property::UnMarshall(in.LeftGlomerularFiltrationRate(), out.GetLeftGlomerularFiltrationRate()); + io::Property::UnMarshall(in.LeftGlomerularFiltrationSurfaceArea(), out.GetLeftGlomerularFiltrationSurfaceArea()); + io::Property::UnMarshall(in.LeftGlomerularFluidPermeability(), out.GetLeftGlomerularFluidPermeability()); + io::Property::UnMarshall(in.LeftFiltrationFraction(), out.GetLeftFiltrationFraction()); + io::Property::UnMarshall(in.LeftNetFiltrationPressure(), out.GetLeftNetFiltrationPressure()); + io::Property::UnMarshall(in.LeftNetReabsorptionPressure(), out.GetLeftNetReabsorptionPressure()); + io::Property::UnMarshall(in.LeftPeritubularCapillariesHydrostaticPressure(), out.GetLeftPeritubularCapillariesHydrostaticPressure()); + io::Property::UnMarshall(in.LeftPeritubularCapillariesOsmoticPressure(), out.GetLeftPeritubularCapillariesOsmoticPressure()); + io::Property::UnMarshall(in.LeftReabsorptionFiltrationCoefficient(), out.GetLeftReabsorptionFiltrationCoefficient()); + io::Property::UnMarshall(in.LeftReabsorptionRate(), out.GetLeftReabsorptionRate()); + io::Property::UnMarshall(in.LeftTubularReabsorptionFiltrationSurfaceArea(), out.GetLeftTubularReabsorptionFiltrationSurfaceArea()); + io::Property::UnMarshall(in.LeftTubularReabsorptionFluidPermeability(), out.GetLeftTubularReabsorptionFluidPermeability()); + io::Property::UnMarshall(in.LeftTubularHydrostaticPressure(), out.GetLeftTubularHydrostaticPressure()); + io::Property::UnMarshall(in.LeftTubularOsmoticPressure(), out.GetLeftTubularOsmoticPressure()); + + io::Property::UnMarshall(in.RenalBloodFlow(), out.GetRenalBloodFlow()); + io::Property::UnMarshall(in.RenalPlasmaFlow(), out.GetRenalPlasmaFlow()); + io::Property::UnMarshall(in.RenalVascularResistance(), out.GetRenalVascularResistance()); + + io::Property::UnMarshall(in.RightAfferentArterioleResistance(), out.GetRightAfferentArterioleResistance()); + io::Property::UnMarshall(in.RightBowmansCapsulesHydrostaticPressure(), out.GetRightBowmansCapsulesHydrostaticPressure()); + io::Property::UnMarshall(in.RightBowmansCapsulesOsmoticPressure(), out.GetRightBowmansCapsulesOsmoticPressure()); + io::Property::UnMarshall(in.RightEfferentArterioleResistance(), out.GetRightEfferentArterioleResistance()); + io::Property::UnMarshall(in.RightGlomerularCapillariesHydrostaticPressure(), out.GetRightGlomerularCapillariesHydrostaticPressure()); + io::Property::UnMarshall(in.RightGlomerularCapillariesOsmoticPressure(), out.GetRightGlomerularCapillariesOsmoticPressure()); + io::Property::UnMarshall(in.RightGlomerularFiltrationCoefficient(), out.GetRightGlomerularFiltrationCoefficient()); + io::Property::UnMarshall(in.RightGlomerularFiltrationRate(), out.GetRightGlomerularFiltrationRate()); + io::Property::UnMarshall(in.RightGlomerularFiltrationSurfaceArea(), out.GetRightGlomerularFiltrationSurfaceArea()); + io::Property::UnMarshall(in.RightGlomerularFluidPermeability(), out.GetRightGlomerularFluidPermeability()); + io::Property::UnMarshall(in.RightFiltrationFraction(), out.GetRightFiltrationFraction()); + io::Property::UnMarshall(in.RightNetFiltrationPressure(), out.GetRightNetFiltrationPressure()); + io::Property::UnMarshall(in.RightNetReabsorptionPressure(), out.GetRightNetReabsorptionPressure()); + io::Property::UnMarshall(in.RightPeritubularCapillariesHydrostaticPressure(), out.GetRightPeritubularCapillariesHydrostaticPressure()); + io::Property::UnMarshall(in.RightPeritubularCapillariesOsmoticPressure(), out.GetRightPeritubularCapillariesOsmoticPressure()); + io::Property::UnMarshall(in.RightReabsorptionFiltrationCoefficient(), out.GetRightReabsorptionFiltrationCoefficient()); + io::Property::UnMarshall(in.RightReabsorptionRate(), out.GetRightReabsorptionRate()); + io::Property::UnMarshall(in.RightTubularReabsorptionFiltrationSurfaceArea(), out.GetRightTubularReabsorptionFiltrationSurfaceArea()); + io::Property::UnMarshall(in.RightTubularReabsorptionFluidPermeability(), out.GetRightTubularReabsorptionFluidPermeability()); + io::Property::UnMarshall(in.RightTubularHydrostaticPressure(), out.GetRightTubularHydrostaticPressure()); + io::Property::UnMarshall(in.RightTubularOsmoticPressure(), out.GetRightTubularOsmoticPressure()); + + io::Property::UnMarshall(in.UrinationRate(), out.GetUrinationRate()); + io::Property::UnMarshall(in.UrineOsmolality(), out.GetUrineOsmolality()); + io::Property::UnMarshall(in.UrineOsmolarity(), out.GetUrineOsmolarity()); + io::Property::UnMarshall(in.UrineProductionRate(), out.GetUrineProductionRate()); + io::Property::UnMarshall(in.MeanUrineOutput(), out.GetMeanUrineOutput()); + io::Property::UnMarshall(in.UrineSpecificGravity(), out.GetUrineSpecificGravity()); + io::Property::UnMarshall(in.UrineVolume(), out.GetUrineVolume()); + io::Property::UnMarshall(in.UrineUreaNitrogenConcentration(), out.GetUrineUreaNitrogenConcentration()); + } + void Physiology::Marshall(const SERenalSystem& in, CDM::RenalSystemData& out) + { + System::Marshall(static_cast(in), static_cast(out)); + + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, BladderPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, GlomerularFiltrationRate) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, FiltrationFraction) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftAfferentArterioleResistance) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftBowmansCapsulesHydrostaticPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftBowmansCapsulesOsmoticPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftEfferentArterioleResistance) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftGlomerularCapillariesHydrostaticPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftGlomerularCapillariesOsmoticPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftGlomerularFiltrationCoefficient) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftGlomerularFiltrationRate) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftGlomerularFiltrationSurfaceArea) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftGlomerularFluidPermeability) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftFiltrationFraction) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftNetFiltrationPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftNetReabsorptionPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftPeritubularCapillariesHydrostaticPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftPeritubularCapillariesOsmoticPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftReabsorptionFiltrationCoefficient) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftReabsorptionRate) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftTubularReabsorptionFiltrationSurfaceArea) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftTubularReabsorptionFluidPermeability) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftTubularHydrostaticPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LeftTubularOsmoticPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RenalBloodFlow) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RenalPlasmaFlow) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RenalVascularResistance) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightAfferentArterioleResistance) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightBowmansCapsulesHydrostaticPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightBowmansCapsulesOsmoticPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightEfferentArterioleResistance) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightGlomerularCapillariesHydrostaticPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightGlomerularCapillariesOsmoticPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightGlomerularFiltrationCoefficient) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightGlomerularFiltrationRate) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightGlomerularFiltrationSurfaceArea) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightGlomerularFluidPermeability) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightFiltrationFraction) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightNetFiltrationPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightNetReabsorptionPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightPeritubularCapillariesHydrostaticPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightPeritubularCapillariesOsmoticPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightReabsorptionFiltrationCoefficient) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightReabsorptionRate) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightTubularReabsorptionFiltrationSurfaceArea) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightTubularReabsorptionFluidPermeability) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightTubularHydrostaticPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RightTubularOsmoticPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, UrinationRate) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, UrineOsmolality) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, UrineOsmolarity) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, UrineProductionRate) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MeanUrineOutput) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, UrineSpecificGravity) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, UrineVolume) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, UrineUreaNitrogenConcentration) } //---------------------------------------------------------------------------------- // class SERespiratorySystem - void Physiology::Marshall(const CDM::RespiratorySystemData& in, SERespiratorySystem& out) - { - System::Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.AlveolarArterialGradient(), out.GetAlveolarArterialGradient()); - io::Property::Marshall(in.CarricoIndex(), out.GetCarricoIndex()); - io::Property::Marshall(in.EndTidalCarbonDioxideFraction(), out.GetEndTidalCarbonDioxideFraction()); - io::Property::Marshall(in.EndTidalCarbonDioxidePressure(), out.GetEndTidalCarbonDioxidePressure()); - io::Property::Marshall(in.ExpiratoryFlow(), out.GetExpiratoryFlow()); - io::Property::Marshall(in.InspiratoryExpiratoryRatio(), out.GetInspiratoryExpiratoryRatio()); - io::Property::Marshall(in.InspiratoryFlow(), out.GetInspiratoryFlow()); - io::Property::Marshall(in.MeanPleuralPressure(), out.GetMeanPleuralPressure()); - io::Property::Marshall(in.PulmonaryCompliance(), out.GetPulmonaryCompliance()); - io::Property::Marshall(in.PulmonaryResistance(), out.GetPulmonaryResistance()); - io::Property::Marshall(in.RespirationDriverFrequency(), out.GetRespirationDriverFrequency()); - io::Property::Marshall(in.RespirationDriverPressure(), out.GetRespirationDriverPressure()); - io::Property::Marshall(in.RespirationMusclePressure(), out.GetRespirationMusclePressure()); - io::Property::Marshall(in.RespirationRate(), out.GetRespirationRate()); - io::Property::Marshall(in.SpecificVentilation(), out.GetSpecificVentilation()); - io::Property::Marshall(in.TargetPulmonaryVentilation(), out.GetTargetPulmonaryVentilation()); - io::Property::Marshall(in.TidalVolume(), out.GetTidalVolume()); - io::Property::Marshall(in.TotalAlveolarVentilation(), out.GetTotalAlveolarVentilation()); - io::Property::Marshall(in.TotalDeadSpaceVentilation(), out.GetTotalDeadSpaceVentilation()); - io::Property::Marshall(in.TotalLungVolume(), out.GetTotalLungVolume()); - io::Property::Marshall(in.TotalPulmonaryVentilation(), out.GetTotalPulmonaryVentilation()); - io::Property::Marshall(in.TranspulmonaryPressure(), out.GetTranspulmonaryPressure()); - } - void Physiology::UnMarshall(const SERespiratorySystem& in, CDM::RespiratorySystemData& out) - { - System::UnMarshall(static_cast(in), static_cast(out)); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, AlveolarArterialGradient) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, CarricoIndex) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, EndTidalCarbonDioxideFraction) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, EndTidalCarbonDioxidePressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ExpiratoryFlow) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, InspiratoryExpiratoryRatio) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, InspiratoryFlow) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MeanPleuralPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PulmonaryCompliance) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PulmonaryResistance) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RespirationDriverFrequency) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RespirationDriverPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RespirationMusclePressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RespirationRate) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SpecificVentilation) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, TargetPulmonaryVentilation) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, TidalVolume) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, TotalAlveolarVentilation) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, TotalDeadSpaceVentilation) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, TotalLungVolume) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, TotalPulmonaryVentilation) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, TranspulmonaryPressure) + void Physiology::UnMarshall(const CDM::RespiratorySystemData& in, SERespiratorySystem& out) + { + System::UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.AlveolarArterialGradient(), out.GetAlveolarArterialGradient()); + io::Property::UnMarshall(in.CarricoIndex(), out.GetCarricoIndex()); + io::Property::UnMarshall(in.EndTidalCarbonDioxideFraction(), out.GetEndTidalCarbonDioxideFraction()); + io::Property::UnMarshall(in.EndTidalCarbonDioxidePressure(), out.GetEndTidalCarbonDioxidePressure()); + io::Property::UnMarshall(in.ExpiratoryFlow(), out.GetExpiratoryFlow()); + io::Property::UnMarshall(in.InspiratoryExpiratoryRatio(), out.GetInspiratoryExpiratoryRatio()); + io::Property::UnMarshall(in.InspiratoryFlow(), out.GetInspiratoryFlow()); + io::Property::UnMarshall(in.MeanPleuralPressure(), out.GetMeanPleuralPressure()); + io::Property::UnMarshall(in.PulmonaryCompliance(), out.GetPulmonaryCompliance()); + io::Property::UnMarshall(in.PulmonaryResistance(), out.GetPulmonaryResistance()); + io::Property::UnMarshall(in.RespirationDriverFrequency(), out.GetRespirationDriverFrequency()); + io::Property::UnMarshall(in.RespirationDriverPressure(), out.GetRespirationDriverPressure()); + io::Property::UnMarshall(in.RespirationMusclePressure(), out.GetRespirationMusclePressure()); + io::Property::UnMarshall(in.RespirationRate(), out.GetRespirationRate()); + io::Property::UnMarshall(in.SpecificVentilation(), out.GetSpecificVentilation()); + io::Property::UnMarshall(in.TargetPulmonaryVentilation(), out.GetTargetPulmonaryVentilation()); + io::Property::UnMarshall(in.TidalVolume(), out.GetTidalVolume()); + io::Property::UnMarshall(in.TotalAlveolarVentilation(), out.GetTotalAlveolarVentilation()); + io::Property::UnMarshall(in.TotalDeadSpaceVentilation(), out.GetTotalDeadSpaceVentilation()); + io::Property::UnMarshall(in.TotalLungVolume(), out.GetTotalLungVolume()); + io::Property::UnMarshall(in.TotalPulmonaryVentilation(), out.GetTotalPulmonaryVentilation()); + io::Property::UnMarshall(in.TranspulmonaryPressure(), out.GetTranspulmonaryPressure()); + } + void Physiology::Marshall(const SERespiratorySystem& in, CDM::RespiratorySystemData& out) + { + System::Marshall(static_cast(in), static_cast(out)); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, AlveolarArterialGradient) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, CarricoIndex) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, EndTidalCarbonDioxideFraction) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, EndTidalCarbonDioxidePressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ExpiratoryFlow) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, InspiratoryExpiratoryRatio) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, InspiratoryFlow) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MeanPleuralPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PulmonaryCompliance) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PulmonaryResistance) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RespirationDriverFrequency) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RespirationDriverPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RespirationMusclePressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RespirationRate) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, SpecificVentilation) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TargetPulmonaryVentilation) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TidalVolume) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TotalAlveolarVentilation) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TotalDeadSpaceVentilation) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TotalLungVolume) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TotalPulmonaryVentilation) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TranspulmonaryPressure) } //---------------------------------------------------------------------------------- // class SETissueSystem - void Physiology::Marshall(const CDM::TissueSystemData& in, SETissueSystem& out) - { - System::Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.CarbonDioxideProductionRate(), out.GetCarbonDioxideProductionRate()); - io::Property::Marshall(in.DehydrationFraction(), out.GetDehydrationFraction()); - io::Property::Marshall(in.ExtracellularFluidVolume(), out.GetExtracellularFluidVolume()); - io::Property::Marshall(in.ExtravascularFluidVolume(), out.GetExtravascularFluidVolume()); - io::Property::Marshall(in.IntracellularFluidPH(), out.GetIntracellularFluidPH()); - io::Property::Marshall(in.IntracellularFluidVolume(), out.GetIntracellularFluidVolume()); - io::Property::Marshall(in.TotalBodyFluidVolume(), out.GetTotalBodyFluidVolume()); - io::Property::Marshall(in.OxygenConsumptionRate(), out.GetOxygenConsumptionRate()); - io::Property::Marshall(in.RespiratoryExchangeRatio(), out.GetRespiratoryExchangeRatio()); - io::Property::Marshall(in.LiverInsulinSetPoint(), out.GetLiverInsulinSetPoint()); - io::Property::Marshall(in.LiverGlucagonSetPoint(), out.GetLiverGlucagonSetPoint()); - io::Property::Marshall(in.MuscleInsulinSetPoint(), out.GetMuscleInsulinSetPoint()); - io::Property::Marshall(in.MuscleGlucagonSetPoint(), out.GetMuscleGlucagonSetPoint()); - io::Property::Marshall(in.FatInsulinSetPoint(), out.GetFatInsulinSetPoint()); - io::Property::Marshall(in.FatGlucagonSetPoint(), out.GetFatGlucagonSetPoint()); - io::Property::Marshall(in.LiverGlycogen(), out.GetLiverGlycogen()); - io::Property::Marshall(in.MuscleGlycogen(), out.GetMuscleGlycogen()); - io::Property::Marshall(in.StoredProtein(), out.GetStoredProtein()); - io::Property::Marshall(in.StoredFat(), out.GetStoredFat()); - } - void Physiology::UnMarshall(const SETissueSystem& in, CDM::TissueSystemData& out) - { - System::UnMarshall(static_cast(in), static_cast(out)); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, CarbonDioxideProductionRate) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, DehydrationFraction) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ExtracellularFluidVolume) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, ExtravascularFluidVolume) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, IntracellularFluidPH) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, IntracellularFluidVolume) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, TotalBodyFluidVolume) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, OxygenConsumptionRate) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RespiratoryExchangeRatio) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LiverInsulinSetPoint) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LiverGlucagonSetPoint) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MuscleInsulinSetPoint) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MuscleGlucagonSetPoint) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, FatInsulinSetPoint) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, FatGlucagonSetPoint) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, LiverGlycogen) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MuscleGlycogen) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, StoredProtein) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, StoredFat) + void Physiology::UnMarshall(const CDM::TissueSystemData& in, SETissueSystem& out) + { + System::UnMarshall(static_cast(in), static_cast(out)); + io::Property::UnMarshall(in.CarbonDioxideProductionRate(), out.GetCarbonDioxideProductionRate()); + io::Property::UnMarshall(in.DehydrationFraction(), out.GetDehydrationFraction()); + io::Property::UnMarshall(in.ExtracellularFluidVolume(), out.GetExtracellularFluidVolume()); + io::Property::UnMarshall(in.ExtravascularFluidVolume(), out.GetExtravascularFluidVolume()); + io::Property::UnMarshall(in.IntracellularFluidPH(), out.GetIntracellularFluidPH()); + io::Property::UnMarshall(in.IntracellularFluidVolume(), out.GetIntracellularFluidVolume()); + io::Property::UnMarshall(in.TotalBodyFluidVolume(), out.GetTotalBodyFluidVolume()); + io::Property::UnMarshall(in.OxygenConsumptionRate(), out.GetOxygenConsumptionRate()); + io::Property::UnMarshall(in.RespiratoryExchangeRatio(), out.GetRespiratoryExchangeRatio()); + io::Property::UnMarshall(in.LiverInsulinSetPoint(), out.GetLiverInsulinSetPoint()); + io::Property::UnMarshall(in.LiverGlucagonSetPoint(), out.GetLiverGlucagonSetPoint()); + io::Property::UnMarshall(in.MuscleInsulinSetPoint(), out.GetMuscleInsulinSetPoint()); + io::Property::UnMarshall(in.MuscleGlucagonSetPoint(), out.GetMuscleGlucagonSetPoint()); + io::Property::UnMarshall(in.FatInsulinSetPoint(), out.GetFatInsulinSetPoint()); + io::Property::UnMarshall(in.FatGlucagonSetPoint(), out.GetFatGlucagonSetPoint()); + io::Property::UnMarshall(in.LiverGlycogen(), out.GetLiverGlycogen()); + io::Property::UnMarshall(in.MuscleGlycogen(), out.GetMuscleGlycogen()); + io::Property::UnMarshall(in.StoredProtein(), out.GetStoredProtein()); + io::Property::UnMarshall(in.StoredFat(), out.GetStoredFat()); + } + void Physiology::Marshall(const SETissueSystem& in, CDM::TissueSystemData& out) + { + System::Marshall(static_cast(in), static_cast(out)); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, CarbonDioxideProductionRate) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, DehydrationFraction) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ExtracellularFluidVolume) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, ExtravascularFluidVolume) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, IntracellularFluidPH) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, IntracellularFluidVolume) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, TotalBodyFluidVolume) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, OxygenConsumptionRate) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, RespiratoryExchangeRatio) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LiverInsulinSetPoint) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LiverGlucagonSetPoint) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MuscleInsulinSetPoint) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MuscleGlucagonSetPoint) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, FatInsulinSetPoint) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, FatGlucagonSetPoint) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, LiverGlycogen) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MuscleGlycogen) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, StoredProtein) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, StoredFat) + } + //---------------------------------------------------------------------------------- + // SEInflammationSource + void Physiology::UnMarshall(const CDM::enumInflammationSource& in, SEInflammationSource& out) + { + try { + switch (in) { + case CDM::enumInflammationSource::Burn: + out = SEInflammationSource::Burn; + break; + case CDM::enumInflammationSource::Hemorrhage: + out = SEInflammationSource::Hemorrhage; + break; + case CDM::enumInflammationSource::Infection: + out = SEInflammationSource::Infection; + break; + case CDM::enumInflammationSource::Ebola: + out = SEInflammationSource::Ebola; + break; + default: + out = SEInflammationSource::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SEInflammationSource::Invalid; + } + } + void Physiology::Marshall(const SEInflammationSource& in, CDM::enumInflammationSource& out) + { + switch (in) { + case SEInflammationSource::Burn: + out = CDM::enumInflammationSource::Burn; + break; + case SEInflammationSource::Hemorrhage: + out = CDM::enumInflammationSource::Hemorrhage; + break; + case SEInflammationSource::Infection: + out = CDM::enumInflammationSource::Infection; + break; + case SEInflammationSource::Ebola: + out = CDM::enumInflammationSource::Ebola; + break; + default: + out = ""; + break; + } } //---------------------------------------------------------------------------------- + // SEHeartRhythm + void Physiology::UnMarshall(const CDM::enumHeartRhythm& in, SEHeartRhythm& out) + { + try { + switch (in) { + case CDM::enumHeartRhythm::Asystole: + out = SEHeartRhythm::Asystole; + break; + case CDM::enumHeartRhythm::NormalSinus: + out = SEHeartRhythm::NormalSinus; + break; + default: + out = SEHeartRhythm::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SEHeartRhythm::Invalid; + } + } + void Physiology::Marshall(const SEHeartRhythm& in, CDM::enumHeartRhythm& out) + { + switch (in) { + case SEHeartRhythm::Asystole: + out = CDM::enumHeartRhythm::Asystole; + break; + case SEHeartRhythm::NormalSinus: + out = CDM::enumHeartRhythm::NormalSinus; + break; + default: + out = ""; + break; + } + } + //---------------------------------------------------------------------------------- + // SESleepState + void Physiology::UnMarshall(const CDM::enumSleepState& in, SESleepState& out) + { + try { + switch (in) { + case CDM::enumSleepState::Asleep: + out = SESleepState::Sleeping; + break; + case CDM::enumSleepState::Awake: + out = SESleepState::Awake; + break; + default: + out = SESleepState::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SESleepState::Invalid; + } + } + void Physiology::Marshall(const SESleepState& in, CDM::enumSleepState& out) + { + switch (in) { + case SESleepState::Sleeping: + out = CDM::enumSleepState::Asleep; + break; + case SESleepState::Awake: + out = CDM::enumSleepState::Awake; + break; + default: + out = ""; + break; + } + } + //---------------------------------------------------------------------------------- +} + +bool operator==(CDM::enumInflammationSource const& lhs, SEInflammationSource const& rhs) +{ + switch (rhs) { + case SEInflammationSource::Burn: + return (CDM::enumInflammationSource::Burn == lhs); + case SEInflammationSource::Hemorrhage: + return (CDM::enumInflammationSource::Hemorrhage == lhs); + case SEInflammationSource::Infection: + return (CDM::enumInflammationSource::Infection == lhs); + case SEInflammationSource::Ebola: + return (CDM::enumInflammationSource::Ebola == lhs); + case SEInflammationSource::Invalid: + return ((CDM::enumInflammationSource::value)-1 == lhs); + default: + return false; + } +} +bool operator==(CDM::enumHeartRhythm const& lhs, SEHeartRhythm const& rhs) +{ + switch (rhs) { + case SEHeartRhythm::Asystole: + return (CDM::enumHeartRhythm::Asystole == lhs); + case SEHeartRhythm::NormalSinus: + return (CDM::enumHeartRhythm::NormalSinus == lhs); + case SEHeartRhythm::Invalid: + return ((CDM::enumHeartRhythm::value)-1 == lhs); + default: + return false; + } +} +bool operator==(CDM::enumSleepState const& lhs, SESleepState const& rhs) +{ + switch (rhs) { + case SESleepState::Awake: + return (CDM::enumSleepState::Awake == lhs); + case SESleepState::Sleeping: + return (CDM::enumSleepState::Asleep == lhs); + case SESleepState::Invalid: + return ((CDM::enumSleepState::value)-1 == lhs); + default: + return false; + } } } diff --git a/projects/biogears/libBiogears/src/io/cdm/Physiology.h b/projects/biogears/libBiogears/src/io/cdm/Physiology.h index 2ddc242b2..0f1cd2169 100644 --- a/projects/biogears/libBiogears/src/io/cdm/Physiology.h +++ b/projects/biogears/libBiogears/src/io/cdm/Physiology.h @@ -12,21 +12,39 @@ specific language governing permissions and limitations under the License. #pragma once #include +#include -#include "biogears/cdm/CommonDataModel.h" +#include +#include #include #include -#define CDM_PHYSIOLOGY_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_PHYSIOLOGY_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ out.func(std::make_unique::type>()); \ - io::Physiology::UnMarshall(*in.m_##func, out.func()); \ + io::Physiology::Marshall(*in.m_##func, out.func()); \ } -#define CDM_OPTIONAL_PHYSIOLOGY_UNMARSHAL_HELPER(in, out, func) \ - if (in.m_##func) { \ - io::Physiology::UnMarshall(*in.m_##func, out.func()); \ +#define CDM_OPTIONAL_PHYSIOLOGY_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func) { \ + io::Physiology::Marshall(*in.m_##func, out.func()); \ + } + +#define SE_PHYSIOLOGY_ENUM_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.Has##func()) { \ + out.func(std::make_unique::type>()); \ + io::Physiology::Marshall(in.m_##func, out.func()); \ + } + +#define SE_OPTIONAL_PHYSIOLOGY_ENUM_PTR_MARSHALL_HELPER(in, out, func) \ + io::Physiology::Marshall(in.m_##func, out.func()); + +#define CDM_PHYSIOLOGY_COPY(type, in, out) \ + { \ + CDM::type##Data middle; \ + io::Patient::Marshall(in, middle); \ + io::Patient::UnMarshall(middle, out); \ } namespace biogears { @@ -39,6 +57,7 @@ class SEDrugSystem; class SEEndocrineSystem; class SEEnergySystem; class SEGastrointestinalSystem; +class SEDrugTransitState; class SEHepaticSystem; class SENervousSystem; class SERenalSystem; @@ -48,68 +67,140 @@ class SETissueSystem; namespace io { class BIOGEARS_PRIVATE_API Physiology { public: - //template option + // template option + template ::value>* = nullptr> + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); + template ::value>* = nullptr> + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out, std::default_random_engine* rd = nullptr); template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); - template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); - //class SEPupillaryResponse - static void Marshall(const CDM::PupillaryResponseData& in, SEPupillaryResponse& out); - static void UnMarshall(const SEPupillaryResponse& in, CDM::PupillaryResponseData& out); - //class SEInflammationState - static void Marshall(const CDM::InflammatoryResponseData& in, SEInflammatoryResponse& out); - static void UnMarshall(const SEInflammatoryResponse& in, CDM::InflammatoryResponseData& out); - //class SEBloodChemistrySystem - static void Marshall(const CDM::BloodChemistrySystemData& in, SEBloodChemistrySystem& out); - static void UnMarshall(const SEBloodChemistrySystem& in, CDM::BloodChemistrySystemData& out); - //class SECardiovascularSystem - static void Marshall(const CDM::CardiovascularSystemData& in, SECardiovascularSystem& out); - static void UnMarshall(const SECardiovascularSystem& in, CDM::CardiovascularSystemData& out); - //class SEDrugSystem - static void Marshall(const CDM::DrugSystemData& in, SEDrugSystem& out); - static void UnMarshall(const SEDrugSystem& in, CDM::DrugSystemData& out); - //class SEEndocrineSystem - static void Marshall(const CDM::EndocrineSystemData& in, SEEndocrineSystem& out); - static void UnMarshall(const SEEndocrineSystem& in, CDM::EndocrineSystemData& out); - //class SEEnergySystem - static void Marshall(const CDM::EnergySystemData& in, SEEnergySystem& out); - static void UnMarshall(const SEEnergySystem& in, CDM::EnergySystemData& out); - //class SEGastrointestinalSystem - static void Marshall(const CDM::GastrointestinalSystemData& in, SEGastrointestinalSystem& out); - static void UnMarshall(const SEGastrointestinalSystem& in, CDM::GastrointestinalSystemData& out); - //class SEHepaticSystem - static void Marshall(const CDM::HepaticSystemData& in, SEHepaticSystem& out); - static void UnMarshall(const SEHepaticSystem& in, CDM::HepaticSystemData& out); - //class SENervousSystem - static void Marshall(const CDM::NervousSystemData& in, SENervousSystem& out); - static void UnMarshall(const SENervousSystem& in, CDM::NervousSystemData& out); - //class SERenalSystem - static void Marshall(const CDM::RenalSystemData& in, SERenalSystem& out); - static void UnMarshall(const SERenalSystem& in, CDM::RenalSystemData& out); - //class SERespiratorySystem - static void Marshall(const CDM::RespiratorySystemData& in, SERespiratorySystem& out); - static void UnMarshall(const SERespiratorySystem& in, CDM::RespiratorySystemData& out); - //class SETissueSystem - static void Marshall(const CDM::TissueSystemData& in, SETissueSystem& out); - static void UnMarshall(const SETissueSystem& in, CDM::TissueSystemData& out); + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); + // class SEPupillaryResponse + static void UnMarshall(const CDM::PupillaryResponseData& in, SEPupillaryResponse& out); + static void Marshall(const SEPupillaryResponse& in, CDM::PupillaryResponseData& out); + // class SEInflammationState + static void UnMarshall(const CDM::InflammatoryResponseData& in, SEInflammatoryResponse& out); + static void Marshall(const SEInflammatoryResponse& in, CDM::InflammatoryResponseData& out); + // class SEBloodChemistrySystem + static void UnMarshall(const CDM::BloodChemistrySystemData& in, SEBloodChemistrySystem& out); + static void Marshall(const SEBloodChemistrySystem& in, CDM::BloodChemistrySystemData& out); + // class SECardiovascularSystem + static void UnMarshall(const CDM::CardiovascularSystemData& in, SECardiovascularSystem& out); + static void Marshall(const SECardiovascularSystem& in, CDM::CardiovascularSystemData& out); + // class SEDrugSystem + static void UnMarshall(const CDM::DrugSystemData& in, SEDrugSystem& out); + static void Marshall(const SEDrugSystem& in, CDM::DrugSystemData& out); + // class SEEndocrineSystem + static void UnMarshall(const CDM::EndocrineSystemData& in, SEEndocrineSystem& out); + static void Marshall(const SEEndocrineSystem& in, CDM::EndocrineSystemData& out); + // class SEEnergySystem + static void UnMarshall(const CDM::EnergySystemData& in, SEEnergySystem& out); + static void Marshall(const SEEnergySystem& in, CDM::EnergySystemData& out); + // class SEGastrointestinalSystem + static void UnMarshall(const CDM::GastrointestinalSystemData& in, SEGastrointestinalSystem& out); + static void Marshall(const SEGastrointestinalSystem& in, CDM::GastrointestinalSystemData& out); + // class SEDrugTransitState + static void UnMarshall(const CDM::DrugTransitStateData& in, SEDrugTransitState& out); + static void Marshall(const SEDrugTransitState& in, CDM::DrugTransitStateData& out); + // class SEHepaticSystem + static void UnMarshall(const CDM::HepaticSystemData& in, SEHepaticSystem& out); + static void Marshall(const SEHepaticSystem& in, CDM::HepaticSystemData& out); + // class SENervousSystem + static void UnMarshall(const CDM::NervousSystemData& in, SENervousSystem& out); + static void Marshall(const SENervousSystem& in, CDM::NervousSystemData& out); + // class SERenalSystem + static void UnMarshall(const CDM::RenalSystemData& in, SERenalSystem& out); + static void Marshall(const SERenalSystem& in, CDM::RenalSystemData& out); + // class SERespiratorySystem + static void UnMarshall(const CDM::RespiratorySystemData& in, SERespiratorySystem& out); + static void Marshall(const SERespiratorySystem& in, CDM::RespiratorySystemData& out); + // class SETissueSystem + static void UnMarshall(const CDM::TissueSystemData& in, SETissueSystem& out); + static void Marshall(const SETissueSystem& in, CDM::TissueSystemData& out); + + // SEInflammationSource + static void UnMarshall(const CDM::enumInflammationSource& in, SEInflammationSource& out); + static void Marshall(const SEInflammationSource& in, CDM::enumInflammationSource& out); + // SEHeartRhythm + static void UnMarshall(const CDM::enumHeartRhythm& in, SEHeartRhythm& out); + static void Marshall(const SEHeartRhythm& in, CDM::enumHeartRhythm& out); + // SESleepState + static void UnMarshall(const CDM::enumSleepState& in, SESleepState& out); + static void Marshall(const SESleepState& in, CDM::enumSleepState& out); }; //---------------------------------------------------------------------------------- - template - void Physiology::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + + template ::value>*> + void Physiology::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) + { + if (!option_in.present() || option_in->empty()) { + out = SE::Invalid; + } else { + UnMarshall(option_in.get(), out); + } + } + + template ::value>*> + void Physiology::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out, std::default_random_engine* rd) { if (!option_in.present()) { - out.Clear(); + out.Invalidate(); } else { - Marshall(option_in.get(), out); + UnMarshall(option_in.get(), out); } } + //---------------------------------------------------------------------------------- template - void Physiology::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void Physiology::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); + Marshall(in, *item); option_out.set(*item); } } // Namespace IO -} //Namespace Biogears + +// Operators +bool operator==(CDM::enumInflammationSource const& lhs, SEInflammationSource const& rhs); +bool operator==(CDM::enumHeartRhythm const& lhs, SEHeartRhythm const& rhs); +bool operator==(CDM::enumSleepState const& lhs, SESleepState const& rhs); + +inline bool operator==(SEInflammationSource const& lhs, CDM::enumInflammationSource const& rhs) +{ + return rhs == lhs; +} +inline bool operator==(SEHeartRhythm const& lhs, CDM::enumHeartRhythm const& rhs) +{ + return rhs == lhs; +} +inline bool operator==(SESleepState const& lhs, CDM::enumSleepState const& rhs) +{ + return rhs == lhs; +} + +inline bool operator!=(CDM::enumInflammationSource const& lhs, SEInflammationSource const& rhs) +{ + return !(lhs == rhs); +} +inline bool operator!=(CDM::enumHeartRhythm const& lhs, SEHeartRhythm const& rhs) +{ + return !(lhs == rhs); +} +inline bool operator!=(CDM::enumSleepState const& lhs, SESleepState const& rhs) +{ + return !(lhs == rhs); +} + +inline bool operator!=(SEInflammationSource const& lhs, CDM::enumInflammationSource const& rhs) +{ + return !(rhs == lhs); +} +inline bool operator!=(SEHeartRhythm const& lhs, CDM::enumHeartRhythm const& rhs) +{ + return !(rhs == lhs); +} +inline bool operator!=(SESleepState const& lhs, CDM::enumSleepState const& rhs) +{ + return !(rhs == lhs); +} + +} // Namespace Biogears diff --git a/projects/biogears/libBiogears/src/io/cdm/Property.cpp b/projects/biogears/libBiogears/src/io/cdm/Property.cpp index 15dcf5696..f4fee9eef 100644 --- a/projects/biogears/libBiogears/src/io/cdm/Property.cpp +++ b/projects/biogears/libBiogears/src/io/cdm/Property.cpp @@ -2,39 +2,6 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #if defined(BIOGEARS_THROW_READONLY_EXCEPTIONS) #define READ_ONLY_CHECK() \ if (out.m_readOnly) \ @@ -49,22 +16,22 @@ namespace biogears { namespace io { // class SEDecimalFormat // template option - void Property::Marshall(xsd::cxx::tree::optional const& option_in, SEDecimalFormat& out) + void Property::UnMarshall(xsd::cxx::tree::optional const& option_in, SEDecimalFormat& out) { if (!option_in.present()) { out.Reset(); } else { - Marshall(option_in.get(), out); + UnMarshall(option_in.get(), out); } } - void Property::UnMarshall(SEDecimalFormat const& in, xsd::cxx::tree::optional& option_out) + void Property::Marshall(SEDecimalFormat const& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); + Marshall(in, *item); option_out.set(*item); } - void Property::Marshall(const CDM::DecimalFormatData& in, SEDecimalFormat& out) + void Property::UnMarshall(const CDM::DecimalFormatData& in, SEDecimalFormat& out, std::default_random_engine* rd) { out.Reset(); if (in.DecimalFormat().present()) { @@ -78,7 +45,7 @@ namespace io { if (in.Precision().present()) out.m_Precision = in.Precision().get(); } - void Property::UnMarshall(const SEDecimalFormat& in, CDM::DecimalFormatData& out) + void Property::Marshall(const SEDecimalFormat& in, CDM::DecimalFormatData& out) { out.Precision(static_cast(in.m_Precision)); switch (in.m_Notation) { @@ -98,22 +65,22 @@ namespace io { } } // class SEFunctionElectricPotentialVsTime------------------------------------------------- - void Property::Marshall(const CDM::FunctionElectricPotentialVsTimeData& in, SEFunctionElectricPotentialVsTime& out) + void Property::UnMarshall(const CDM::FunctionElectricPotentialVsTimeData& in, SEFunctionElectricPotentialVsTime& out, std::default_random_engine* rd) { - Property::Marshall(static_cast(in), static_cast(out)); + Property::UnMarshall(static_cast(in), static_cast(out)); out.m_TimeUnit = &TimeUnit::GetCompoundUnit(in.IndependentUnit().get()); out.m_ElectricPotentialUnit = &ElectricPotentialUnit::GetCompoundUnit(in.DependentUnit().get()); } - void Property::UnMarshall(const SEFunctionElectricPotentialVsTime& in, CDM::FunctionElectricPotentialVsTimeData& out) + void Property::Marshall(const SEFunctionElectricPotentialVsTime& in, CDM::FunctionElectricPotentialVsTimeData& out) { - Property::UnMarshall(static_cast(in), static_cast(out)); + Property::Marshall(static_cast(in), static_cast(out)); out.IndependentUnit(in.m_TimeUnit->GetString()); out.DependentUnit(in.m_ElectricPotentialUnit->GetString()); } // class SEFunction------------------------------------------------- - void Property::Marshall(const CDM::FunctionData& in, SEFunction& out) + void Property::UnMarshall(const CDM::FunctionData& in, SEFunction& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); for (auto& dv : in.Dependent().DoubleList()) { out.m_Dependent.push_back(dv); } @@ -121,7 +88,8 @@ namespace io { out.m_Independent.push_back(iv); } } - void Property::UnMarshall(const SEFunction& in, CDM::FunctionData& out) + + void Property::Marshall(const SEFunction& in, CDM::FunctionData& out) { out.Dependent(std::make_unique()); out.Dependent().DoubleList(std::make_unique()); @@ -135,39 +103,39 @@ namespace io { } } // class SEFunctionVolumeVsTime------------------------------------------------- - void Property::Marshall(const CDM::FunctionVolumeVsTimeData& in, SEFunctionVolumeVsTime& out) + void Property::UnMarshall(const CDM::FunctionVolumeVsTimeData& in, SEFunctionVolumeVsTime& out, std::default_random_engine* rd) { - Property::Marshall(static_cast(in), static_cast(out)); + Property::UnMarshall(static_cast(in), static_cast(out)); out.m_TimeUnit = &TimeUnit::GetCompoundUnit(in.IndependentUnit().get()); out.m_VolumeUnit = &VolumeUnit::GetCompoundUnit(in.DependentUnit().get()); } - void Property::UnMarshall(const SEFunctionVolumeVsTime& in, CDM::FunctionVolumeVsTimeData& out) + void Property::Marshall(const SEFunctionVolumeVsTime& in, CDM::FunctionVolumeVsTimeData& out) { - Property::UnMarshall(static_cast(in), static_cast(out)); + Property::Marshall(static_cast(in), static_cast(out)); out.IndependentUnit(in.m_TimeUnit->GetString()); out.DependentUnit(in.m_VolumeUnit->GetString()); } // class SEHistogramFractionVsLength------------------------------------------------- - void Property::Marshall(const CDM::HistogramFractionVsLengthData& in, SEHistogramFractionVsLength& out) + void Property::UnMarshall(const CDM::HistogramFractionVsLengthData& in, SEHistogramFractionVsLength& out, std::default_random_engine* rd) { - Property::Marshall(static_cast(in), static_cast(out)); + Property::UnMarshall(static_cast(in), static_cast(out)); out.m_LengthUnit = &LengthUnit::GetCompoundUnit(in.IndependentUnit().get()); } - void Property::UnMarshall(const SEHistogramFractionVsLength& in, CDM::HistogramFractionVsLengthData& out) + void Property::Marshall(const SEHistogramFractionVsLength& in, CDM::HistogramFractionVsLengthData& out) { - Property::UnMarshall(static_cast(in), static_cast(out)); + Property::Marshall(static_cast(in), static_cast(out)); out.IndependentUnit(in.m_LengthUnit->GetString()); } // class SEHistogram------------------------------------------------- - void Property::Marshall(const CDM::HistogramData& in, SEHistogram& out) + void Property::UnMarshall(const CDM::HistogramData& in, SEHistogram& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); for (auto& dv : in.Dependent().DoubleList()) out.m_Dependent.push_back(dv); for (auto& iv : in.Independent().DoubleList()) out.m_Independent.push_back(iv); } - void Property::UnMarshall(const SEHistogram& in, CDM::HistogramData& out) + void Property::Marshall(const SEHistogram& in, CDM::HistogramData& out) { out.Dependent(std::unique_ptr(new CDM::DoubleList())); out.Dependent().DoubleList(std::unique_ptr(new CDM::DoubleList())); @@ -179,219 +147,226 @@ namespace io { out.Independent().DoubleList().push_back(iv); } // class SEScalar0To1------------------------------------------------- - void Property::Marshall(const CDM::Scalar0To1Data& in, SEScalar0To1& out) - { - Property::Marshall(static_cast(in), static_cast(out)); - } - void Property::UnMarshall(const SEScalar0To1& in, CDM::Scalar0To1Data& out) - { - Property::UnMarshall(static_cast(in), static_cast(out)); - } - // class SEScalarAmount------------------------------------------------- - void Property::Marshall(const CDM::ScalarAmountData& in, SEScalarAmount& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarAmount& in, CDM::ScalarAmountData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarAmountPerMass------------------------------------------------- - void Property::Marshall(const CDM::ScalarAmountPerMassData& in, SEScalarAmountPerMass& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarAmountPerMass& in, CDM::ScalarAmountPerMassData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarAmountPerTime------------------------------------------------- - void Property::Marshall(const CDM::ScalarAmountPerTimeData& in, SEScalarAmountPerTime& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarAmountPerTime& in, CDM::ScalarAmountPerTimeData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarAmountPerVolume------------------------------------------------- - void Property::Marshall(const CDM::ScalarAmountPerVolumeData& in, SEScalarAmountPerVolume& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarAmountPerVolume& in, CDM::ScalarAmountPerVolumeData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarArea------------------------------------------------- - void Property::Marshall(const CDM::ScalarAreaData& in, SEScalarArea& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarArea& in, CDM::ScalarAreaData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarAreaPerTimePressure------------------------------------------------- - void Property::Marshall(const CDM::ScalarAreaPerTimePressureData& in, SEScalarAreaPerTimePressure& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarAreaPerTimePressure& in, CDM::ScalarAreaPerTimePressureData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarElectricCapacitance------------------------------------------------- - void Property::Marshall(const CDM::ScalarElectricCapacitanceData& in, SEScalarElectricCapacitance& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarElectricCapacitance& in, CDM::ScalarElectricCapacitanceData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarElectricCharge------------------------------------------------- - void Property::Marshall(const CDM::ScalarElectricChargeData& in, SEScalarElectricCharge& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarElectricCharge& in, CDM::ScalarElectricChargeData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarElectricCurrent------------------------------------------------- - void Property::Marshall(const CDM::ScalarElectricCurrentData& in, SEScalarElectricCurrent& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarElectricCurrent& in, CDM::ScalarElectricCurrentData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarElectricInductance------------------------------------------------- - void Property::Marshall(const CDM::ScalarElectricInductanceData& in, SEScalarElectricInductance& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarElectricInductance& in, CDM::ScalarElectricInductanceData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarElectricPotential------------------------------------------------- - void Property::Marshall(const CDM::ScalarElectricPotentialData& in, SEScalarElectricPotential& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarElectricPotential& in, CDM::ScalarElectricPotentialData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarElectricResistance------------------------------------------------- - void Property::Marshall(const CDM::ScalarElectricResistanceData& in, SEScalarElectricResistance& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarElectricResistance& in, CDM::ScalarElectricResistanceData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarEnergy------------------------------------------------- - void Property::Marshall(const CDM::ScalarEnergyData& in, SEScalarEnergy& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarEnergy& in, CDM::ScalarEnergyData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarEnergyPerAmount------------------------------------------------- - void Property::Marshall(const CDM::ScalarEnergyPerAmountData& in, SEScalarEnergyPerAmount& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarEnergyPerAmount& in, CDM::ScalarEnergyPerAmountData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarEnergyPerMass------------------------------------------------- - void Property::Marshall(const CDM::ScalarEnergyPerMassData& in, SEScalarEnergyPerMass& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarEnergyPerMass& in, CDM::ScalarEnergyPerMassData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarFlowCompliance------------------------------------------------- - void Property::Marshall(const CDM::ScalarFlowComplianceData& in, SEScalarFlowCompliance& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarFlowCompliance& in, CDM::ScalarFlowComplianceData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarFlowElastance------------------------------------------------- - void Property::Marshall(const CDM::ScalarFlowElastanceData& in, SEScalarFlowElastance& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarFlowElastance& in, CDM::ScalarFlowElastanceData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarFlowInertance------------------------------------------------- - void Property::Marshall(const CDM::ScalarFlowInertanceData& in, SEScalarFlowInertance& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarFlowInertance& in, CDM::ScalarFlowInertanceData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarFlowResistance------------------------------------------------- - void Property::Marshall(const CDM::ScalarFlowResistanceData& in, SEScalarFlowResistance& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarFlowResistance& in, CDM::ScalarFlowResistanceData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarForce------------------------------------------------- - void Property::Marshall(const CDM::ScalarForceData& in, SEScalarForce& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarForce& in, CDM::ScalarForceData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarFraction------------------------------------------------- - void Property::Marshall(const CDM::ScalarFractionData& in, SEScalarFraction& out) - { - Property::Marshall(static_cast(in), static_cast(out)); - } - void Property::UnMarshall(const SEScalarFraction& in, CDM::ScalarFractionData& out) - { - Property::UnMarshall(static_cast(in), static_cast(out)); - } - // class SEScalarFrequency------------------------------------------------- - void Property::Marshall(const CDM::ScalarFrequencyData& in, SEScalarFrequency& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarFrequency& in, CDM::ScalarFrequencyData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalar------------------------------------------------- - void Property::Marshall(const CDM::ScalarData& in, SEScalar& out) + void Property::UnMarshall(const CDM::Scalar0To1Data& in, SEScalar0To1& out, std::default_random_engine* rd) + { + Property::UnMarshall(static_cast(in), static_cast(out), rd); + // TODO: Improve handing out of bound values + out.SetValue(std::clamp(out.GetValue(), 0.0, 1.0)); + } + void Property::Marshall(const SEScalar0To1& in, CDM::Scalar0To1Data& out) + { + Property::Marshall(static_cast(in), static_cast(out)); + } + //// class SEScalarAmount------------------------------------------------- + // void Property::UnMarshall(const CDM::ScalarAmountData& in, SEScalarAmount& out, std::default_random_engine* rd) + //{ + // Property::UnMarshall(static_cast(in), static_cast&>(out), rd); + // } + // void Property::Marshall(const SEScalarAmount& in, CDM::ScalarAmountData& out) + //{ + // Property::Marshall(static_cast const&>(in), static_cast(out)); + // } + //// class SEScalarAmountPerMass------------------------------------------------- + // void Property::UnMarshall(const CDM::ScalarAmountPerMassData& in, SEScalarAmountPerMass& out, std::default_random_engine* rd) + //{ + // Property::UnMarshall(static_cast(in), static_cast&>(out), rd); + // } + // void Property::Marshall(const SEScalarAmountPerMass& in, CDM::ScalarAmountPerMassData& out) + //{ + // Property::Marshall(static_cast const&>(in), static_cast(out)); + // } + //// class SEScalarAmountPerTime------------------------------------------------- + // void Property::UnMarshall(const CDM::ScalarAmountPerTimeData& in, SEScalarAmountPerTime& out, std::default_random_engine* rd) + //{ + // Property::UnMarshall(static_cast(in), static_cast&>(out), rd); + // } + // void Property::Marshall(const SEScalarAmountPerTime& in, CDM::ScalarAmountPerTimeData& out) + //{ + // Property::Marshall(static_cast const&>(in), static_cast(out)); + // } + //// class SEScalarAmountPerVolume------------------------------------------------- + // void Property::UnMarshall(const CDM::ScalarAmountPerVolumeData& in, SEScalarAmountPerVolume& out, std::default_random_engine* rd) + //{ + // Property::UnMarshall(static_cast(in), static_cast&>(out), rd); + // } + // void Property::Marshall(const SEScalarAmountPerVolume& in, CDM::ScalarAmountPerVolumeData& out) + //{ + // Property::Marshall(static_cast const&>(in), static_cast(out)); + // } + //// class SEScalarArea------------------------------------------------- + // void Property::UnMarshall(const CDM::ScalarAreaData& in, SEScalarArea& out, std::default_random_engine* rd) + //{ + // Property::UnMarshall(static_cast(in), static_cast&>(out), rd); + // } + // void Property::Marshall(const SEScalarArea& in, CDM::ScalarAreaData& out) + //{ + // Property::Marshall(static_cast const&>(in), static_cast(out)); + // } + //// class SEScalarAreaPerTimePressure------------------------------------------------- + // void Property::UnMarshall(const CDM::ScalarAreaPerTimePressureData& in, SEScalarAreaPerTimePressure& out, std::default_random_engine* rd) + //{ + // Property::UnMarshall(static_cast(in), static_cast&>(out), rd); + // } + // void Property::Marshall(const SEScalarAreaPerTimePressure& in, CDM::ScalarAreaPerTimePressureData& out) + //{ + // Property::Marshall(static_cast const&>(in), static_cast(out)); + // } + //// class SEScalarElectricCapacitance------------------------------------------------- + // void Property::UnMarshall(const CDM::ScalarElectricCapacitanceData& in, SEScalarElectricCapacitance& out, std::default_random_engine* rd) + //{ + // Property::UnMarshall(static_cast(in), static_cast&>(out), rd); + // } + // void Property::Marshall(const SEScalarElectricCapacitance& in, CDM::ScalarElectricCapacitanceData& out) + //{ + // Property::Marshall(static_cast const&>(in), static_cast(out)); + // } + //// class SEScalarElectricCharge------------------------------------------------- + // void Property::UnMarshall(const CDM::ScalarElectricChargeData& in, SEScalarElectricCharge& out, std::default_random_engine* rd) + //{ + // Property::UnMarshall(static_cast(in), static_cast&>(out), rd); + // } + // void Property::Marshall(const SEScalarElectricCharge& in, CDM::ScalarElectricChargeData& out) + //{ + // Property::Marshall(static_cast const&>(in), static_cast(out)); + // } + //// class SEScalarElectricCurrent------------------------------------------------- + // void Property::UnMarshall(const CDM::ScalarElectricCurrentData& in, SEScalarElectricCurrent& out, std::default_random_engine* rd) + //{ + // Property::UnMarshall(static_cast(in), static_cast&>(out), rd); + // } + // void Property::Marshall(const SEScalarElectricCurrent& in, CDM::ScalarElectricCurrentData& out) + //{ + // Property::Marshall(static_cast const&>(in), static_cast(out)); + // } + //// class SEScalarElectricInductance------------------------------------------------- + // void Property::UnMarshall(const CDM::ScalarElectricInductanceData& in, SEScalarElectricInductance& out, std::default_random_engine* rd) + //{ + // Property::UnMarshall(static_cast(in), static_cast&>(out), rd); + // } + // void Property::Marshall(const SEScalarElectricInductance& in, CDM::ScalarElectricInductanceData& out) + //{ + // Property::Marshall(static_cast const&>(in), static_cast(out)); + // } + //// class SEScalarElectricPotential------------------------------------------------- + // void Property::UnMarshall(const CDM::ScalarElectricPotentialData& in, SEScalarElectricPotential& out, std::default_random_engine* rd) + //{ + // Property::UnMarshall(static_cast(in), static_cast&>(out), rd); + // } + // void Property::Marshall(const SEScalarElectricPotential& in, CDM::ScalarElectricPotentialData& out) + //{ + // Property::Marshall(static_cast const&>(in), static_cast(out)); + // } + //// class SEScalarElectricResistance------------------------------------------------- + // void Property::UnMarshall(const CDM::ScalarElectricResistanceData& in, SEScalarElectricResistance& out, std::default_random_engine* rd) + //{ + // Property::UnMarshall(static_cast(in), static_cast&>(out), rd); + // } + // void Property::Marshall(const SEScalarElectricResistance& in, CDM::ScalarElectricResistanceData& out) + //{ + // Property::Marshall(static_cast const&>(in), static_cast(out)); + // } + //// class SEScalarEnergy------------------------------------------------- + // void Property::UnMarshall(const CDM::ScalarEnergyData& in, SEScalarEnergy& out, std::default_random_engine* rd) + //{ + // Property::UnMarshall(static_cast(in), static_cast&>(out), rd); + // } + // void Property::Marshall(const SEScalarEnergy& in, CDM::ScalarEnergyData& out) + //{ + // Property::Marshall(static_cast const&>(in), static_cast(out)); + // } + //// class SEScalarEnergyPerAmount------------------------------------------------- + // void Property::UnMarshall(const CDM::ScalarEnergyPerAmountData& in, SEScalarEnergyPerAmount& out, std::default_random_engine* rd) + //{ + // Property::UnMarshall(static_cast(in), static_cast&>(out), rd); + // } + // void Property::Marshall(const SEScalarEnergyPerAmount& in, CDM::ScalarEnergyPerAmountData& out) + //{ + // Property::Marshall(static_cast const&>(in), static_cast(out)); + // } + //// class SEScalarEnergyPerMass------------------------------------------------- + // void Property::UnMarshall(const CDM::ScalarEnergyPerMassData& in, SEScalarEnergyPerMass& out, std::default_random_engine* rd) + //{ + // Property::UnMarshall(static_cast(in), static_cast&>(out), rd); + // } + // void Property::Marshall(const SEScalarEnergyPerMass& in, CDM::ScalarEnergyPerMassData& out) + //{ + // Property::Marshall(static_cast const&>(in), static_cast(out)); + // } + //// class SEScalarFlowCompliance------------------------------------------------- + // void Property::UnMarshall(const CDM::ScalarFlowComplianceData& in, SEScalarFlowCompliance& out, std::default_random_engine* rd) + //{ + // Property::UnMarshall(static_cast(in), static_cast&>(out), rd); + // } + // void Property::Marshall(const SEScalarFlowCompliance& in, CDM::ScalarFlowComplianceData& out) + //{ + // Property::Marshall(static_cast const&>(in), static_cast(out)); + // } + //// class SEScalarFlowElastance------------------------------------------------- + // void Property::UnMarshall(const CDM::ScalarFlowElastanceData& in, SEScalarFlowElastance& out, std::default_random_engine* rd) + //{ + // Property::UnMarshall(static_cast(in), static_cast&>(out), rd); + // } + // void Property::Marshall(const SEScalarFlowElastance& in, CDM::ScalarFlowElastanceData& out) + //{ + // Property::Marshall(static_cast const&>(in), static_cast(out)); + // } + //// class SEScalarFlowInertance------------------------------------------------- + // void Property::UnMarshall(const CDM::ScalarFlowInertanceData& in, SEScalarFlowInertance& out, std::default_random_engine* rd) + //{ + // Property::UnMarshall(static_cast(in), static_cast&>(out), rd); + // } + // void Property::Marshall(const SEScalarFlowInertance& in, CDM::ScalarFlowInertanceData& out) + //{ + // Property::Marshall(static_cast const&>(in), static_cast(out)); + // } + //// class SEScalarFlowResistance------------------------------------------------- + // void Property::UnMarshall(const CDM::ScalarFlowResistanceData& in, SEScalarFlowResistance& out, std::default_random_engine* rd) + //{ + // Property::UnMarshall(static_cast(in), static_cast&>(out), rd); + // } + // void Property::Marshall(const SEScalarFlowResistance& in, CDM::ScalarFlowResistanceData& out) + //{ + // Property::Marshall(static_cast const&>(in), static_cast(out)); + // } + //// class SEScalarForce------------------------------------------------- + // void Property::UnMarshall(const CDM::ScalarForceData& in, SEScalarForce& out, std::default_random_engine* rd) + //{ + // Property::UnMarshall(static_cast(in), static_cast&>(out), rd); + // } + // void Property::Marshall(const SEScalarForce& in, CDM::ScalarForceData& out) + //{ + // Property::Marshall(static_cast const&>(in), static_cast(out)); + // } + // class SEScalarFraction------------------------------------------------- + void Property::UnMarshall(const CDM::ScalarFractionData& in, SEScalarFraction& out, std::default_random_engine* rd) + { + Property::UnMarshall(static_cast(in), static_cast(out)); + } + void Property::Marshall(const SEScalarFraction& in, CDM::ScalarFractionData& out) + { + Property::Marshall(static_cast(in), static_cast(out)); + } + //// class SEScalarFrequency------------------------------------------------- + // void Property::UnMarshall(const CDM::ScalarFrequencyData& in, SEScalarFrequency& out, std::default_random_engine* rd) + //{ + // Property::UnMarshall(static_cast(in), static_cast&>(out), rd); + // } + // void Property::Marshall(const SEScalarFrequency& in, CDM::ScalarFrequencyData& out) + //{ + // Property::Marshall(static_cast const&>(in), static_cast(out)); + // } + //// class SEScalar------------------------------------------------- + void Property::UnMarshall(const CDM::ScalarData& in, SEScalar& out, std::default_random_engine* rd) { READ_ONLY_CHECK() - out.Clear(); + out.Invalidate(); ; - out.m_value = in.value(); + if (in.deviation().present() && rd) { + auto nd = std::normal_distribution(in.value(), in.deviation().get()); + out.SetValue(nd(*rd)); + } else { + out.SetValue(in.value()); + } if (in.unit().present()) { std::string u = in.unit().get(); if (!("unitless" == u || "" == u || u.empty())) { @@ -400,354 +375,212 @@ namespace io { } out.m_readOnly = in.readOnly(); } - void Property::UnMarshall(const SEScalar& in, CDM::ScalarData& out) + void Property::Marshall(const SEScalar& in, CDM::ScalarData& out) { out.value(in.m_value); out.readOnly(in.m_readOnly); } - // class SEScalarHeatCapacitance------------------------------------------------- - void Property::Marshall(const CDM::ScalarHeatCapacitanceData& in, SEScalarHeatCapacitance& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarHeatCapacitance& in, CDM::ScalarHeatCapacitanceData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarHeatCapacitancePerAmount------------------------------------------------- - void Property::Marshall(const CDM::ScalarHeatCapacitancePerAmountData& in, SEScalarHeatCapacitancePerAmount& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarHeatCapacitancePerAmount& in, CDM::ScalarHeatCapacitancePerAmountData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarHeatCapacitancePerMass------------------------------------------------- - void Property::Marshall(const CDM::ScalarHeatCapacitancePerMassData& in, SEScalarHeatCapacitancePerMass& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarHeatCapacitancePerMass& in, CDM::ScalarHeatCapacitancePerMassData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarHeatConductance------------------------------------------------- - void Property::Marshall(const CDM::ScalarHeatConductanceData& in, SEScalarHeatConductance& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarHeatConductance& in, CDM::ScalarHeatConductanceData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarHeatConductancePerArea------------------------------------------------- - void Property::Marshall(const CDM::ScalarHeatConductancePerAreaData& in, SEScalarHeatConductancePerArea& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarHeatConductancePerArea& in, CDM::ScalarHeatConductancePerAreaData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarHeatInductance------------------------------------------------- - void Property::Marshall(const CDM::ScalarHeatInductanceData& in, SEScalarHeatInductance& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarHeatInductance& in, CDM::ScalarHeatInductanceData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarHeatResistanceArea------------------------------------------------- - void Property::Marshall(const CDM::ScalarHeatResistanceAreaData& in, SEScalarHeatResistanceArea& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarHeatResistanceArea& in, CDM::ScalarHeatResistanceAreaData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarHeatResistance------------------------------------------------- - void Property::Marshall(const CDM::ScalarHeatResistanceData& in, SEScalarHeatResistance& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarHeatResistance& in, CDM::ScalarHeatResistanceData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarInversePressure------------------------------------------------- - void Property::Marshall(const CDM::ScalarInversePressureData& in, SEScalarInversePressure& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarInversePressure& in, CDM::ScalarInversePressureData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarInverseVolume------------------------------------------------- - void Property::Marshall(const CDM::ScalarInverseVolumeData& in, SEScalarInverseVolume& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarInverseVolume& in, CDM::ScalarInverseVolumeData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarLength------------------------------------------------- - void Property::Marshall(const CDM::ScalarLengthData& in, SEScalarLength& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarLength& in, CDM::ScalarLengthData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarLengthPerTime------------------------------------------------- - void Property::Marshall(const CDM::ScalarLengthPerTimeData& in, SEScalarLengthPerTime& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarLengthPerTime& in, CDM::ScalarLengthPerTimeData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarLengthPerTimePressure------------------------------------------------- - void Property::Marshall(const CDM::ScalarLengthPerTimePressureData& in, SEScalarLengthPerTimePressure& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarLengthPerTimePressure& in, CDM::ScalarLengthPerTimePressureData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarMass------------------------------------------------- - void Property::Marshall(const CDM::ScalarMassData& in, SEScalarMass& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarMass& in, CDM::ScalarMassData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarMassPerAmount------------------------------------------------- - void Property::Marshall(const CDM::ScalarMassPerAmountData& in, SEScalarMassPerAmount& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarMassPerAmount& in, CDM::ScalarMassPerAmountData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarMassPerAreaTime------------------------------------------------- - void Property::Marshall(const CDM::ScalarMassPerAreaTimeData& in, SEScalarMassPerAreaTime& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarMassPerAreaTime& in, CDM::ScalarMassPerAreaTimeData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarMassPerMass------------------------------------------------- - void Property::Marshall(const CDM::ScalarMassPerMassData& in, SEScalarMassPerMass& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarMassPerMass& in, CDM::ScalarMassPerMassData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarMassPerTime------------------------------------------------- - void Property::Marshall(const CDM::ScalarMassPerTimeData& in, SEScalarMassPerTime& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarMassPerTime& in, CDM::ScalarMassPerTimeData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarMassPerVolume------------------------------------------------- - void Property::Marshall(const CDM::ScalarMassPerVolumeData& in, SEScalarMassPerVolume& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarMassPerVolume& in, CDM::ScalarMassPerVolumeData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarNeg1To1------------------------------------------------- - void Property::Marshall(const CDM::ScalarNeg1To1Data& in, SEScalarNeg1To1& out) - { - Property::Marshall(static_cast(in), static_cast(out)); - } - void Property::UnMarshall(const SEScalarNeg1To1& in, CDM::ScalarNeg1To1Data& out) - { - Property::UnMarshall(static_cast(in), static_cast(out)); - } - // class SEScalarOsmolality------------------------------------------------- - void Property::Marshall(const CDM::ScalarOsmolalityData& in, SEScalarOsmolality& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarOsmolality& in, CDM::ScalarOsmolalityData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarOsmolarity------------------------------------------------- - void Property::Marshall(const CDM::ScalarOsmolarityData& in, SEScalarOsmolarity& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarOsmolarity& in, CDM::ScalarOsmolarityData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarPower------------------------------------------------- - void Property::Marshall(const CDM::ScalarPowerData& in, SEScalarPower& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarPower& in, CDM::ScalarPowerData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarPowerPerAreaTemperatureToTheFourth------------------------------------------------- - void Property::Marshall(const CDM::ScalarPowerPerAreaTemperatureToTheFourthData& in, SEScalarPowerPerAreaTemperatureToTheFourth& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarPowerPerAreaTemperatureToTheFourth& in, CDM::ScalarPowerPerAreaTemperatureToTheFourthData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarPressure------------------------------------------------- - void Property::Marshall(const CDM::ScalarPressureData& in, SEScalarPressure& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarPressure& in, CDM::ScalarPressureData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarPressurePerVolume------------------------------------------------- - void Property::Marshall(const CDM::ScalarPressurePerVolumeData& in, SEScalarPressurePerVolume& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarPressurePerVolume& in, CDM::ScalarPressurePerVolumeData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScaMlarPressureTimePerArea------------------------------------------------- - void Property::Marshall(const CDM::ScalarPressureTimePerAreaData& in, SEScalarPressureTimePerArea& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarPressureTimePerArea& in, CDM::ScalarPressureTimePerAreaData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarPressureTimePerVolumeArea------------------------------------------------- - void Property::Marshall(const CDM::ScalarPressureTimePerVolumeAreaData& in, SEScalarPressureTimePerVolumeArea& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarPressureTimePerVolumeArea& in, CDM::ScalarPressureTimePerVolumeAreaData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarTemperature------------------------------------------------- - void Property::Marshall(const CDM::ScalarTemperatureData& in, SEScalarTemperature& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarTemperature& in, CDM::ScalarTemperatureData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarTime------------------------------------------------- - void Property::Marshall(const CDM::ScalarTimeData& in, SEScalarTime& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); - } - void Property::UnMarshall(const SEScalarTime& in, CDM::ScalarTimeData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); - } - // class SEScalarVolume------------------------------------------------- - void Property::Marshall(const CDM::ScalarVolumeData& in, SEScalarVolume& out) + + // class SEScalarNeg1To1------------------------------------------------- + void Property::UnMarshall(const CDM::ScalarNeg1To1Data& in, SEScalarNeg1To1& out, std::default_random_engine* rd) { - Property::Marshall(static_cast(in), static_cast&>(out)); + Property::UnMarshall(static_cast(in), static_cast(out), rd); } - void Property::UnMarshall(const SEScalarVolume& in, CDM::ScalarVolumeData& out) + void Property::Marshall(const SEScalarNeg1To1& in, CDM::ScalarNeg1To1Data& out) { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); + Property::Marshall(static_cast(in), static_cast(out)); } - // class SEScalarVolumePerPressure------------------------------------------------- - void Property::Marshall(const CDM::ScalarVolumePerPressureData& in, SEScalarVolumePerPressure& out) + + // class SERunningAverage------------------------------------------------- + void Property::UnMarshall(const CDM::RunningAverageData& in, RunningAverage& out, std::default_random_engine* rd) { - Property::Marshall(static_cast(in), static_cast&>(out)); + out.m_Sum = in.sum(); + out.m_NumSamples = in.numSamples(); } - void Property::UnMarshall(const SEScalarVolumePerPressure& in, CDM::ScalarVolumePerPressureData& out) + void Property::Marshall(const RunningAverage& in, CDM::RunningAverageData& out) { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); + out.sum(in.m_Sum); + out.numSamples(in.m_NumSamples); } - // class SEScalarVolumePerTimeArea------------------------------------------------- - void Property::Marshall(const CDM::ScalarVolumePerTimeAreaData& in, SEScalarVolumePerTimeArea& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); + + // SESide + void Property::UnMarshall(const CDM::enumSide& in, SESide& out) + { + try { + switch (in) { + case CDM::enumSide::Left: + out = SESide::Left; + break; + case CDM::enumSide::Right: + out = SESide::Right; + break; + default: + out = SESide::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SESide::Invalid; + } } - void Property::UnMarshall(const SEScalarVolumePerTimeArea& in, CDM::ScalarVolumePerTimeAreaData& out) + void Property::Marshall(const SESide& in, CDM::enumSide& out) { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); + switch (in) { + case SESide::Left: + out = CDM::enumSide::Left; + break; + case SESide::Right: + out = CDM::enumSide::Right; + break; + default: + // out = (CDM::enumSide::value)-1; + break; + } } - // class SEScalarVolumePerTime------------------------------------------------- - void Property::Marshall(const CDM::ScalarVolumePerTimeData& in, SEScalarVolumePerTime& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); + // SEOpenClosed + void Property::UnMarshall(const CDM::enumOpenClosed& in, SEOpenClosed& out) + { + try { + switch (in) { + case CDM::enumOpenClosed::Open: + out = SEOpenClosed::Open; + break; + case CDM::enumOpenClosed::Closed: + out = SEOpenClosed::Closed; + break; + default: + out = SEOpenClosed::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SEOpenClosed::Invalid; + } } - void Property::UnMarshall(const SEScalarVolumePerTime& in, CDM::ScalarVolumePerTimeData& out) + void Property::Marshall(const SEOpenClosed& in, CDM::enumOpenClosed& out) { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); + switch (in) { + case SEOpenClosed::Open: + out = CDM::enumOpenClosed::Open; + break; + case SEOpenClosed::Closed: + out = CDM::enumOpenClosed::Closed; + break; + default: + // out = (CDM::enumOpenClosed::value)-1; + break; + } } - // class SEScalarVolumePerTimeMass------------------------------------------------- - void Property::Marshall(const CDM::ScalarVolumePerTimeMassData& in, SEScalarVolumePerTimeMass& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); + // SEOnOff + void Property::UnMarshall(const CDM::enumOnOff& in, SEOnOff& out) + { + try { + switch (in) { + case CDM::enumOnOff::On: + out = SEOnOff::On; + break; + case CDM::enumOnOff::Off: + out = SEOnOff::Off; + break; + default: + out = SEOnOff::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SEOnOff::Invalid; + } } - void Property::UnMarshall(const SEScalarVolumePerTimeMass& in, CDM::ScalarVolumePerTimeMassData& out) + void Property::Marshall(const SEOnOff& in, CDM::enumOnOff& out) { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); + switch (in) { + case SEOnOff::On: + out = CDM::enumOnOff::On; + break; + case SEOnOff::Off: + out = CDM::enumOnOff::Off; + break; + default: + // out = (CDM::enumOnOff::value)-1; + break; + } } - // class SEScalarVolumePerTimePressureArea------------------------------------------------- - void Property::Marshall(const CDM::ScalarVolumePerTimePressureAreaData& in, SEScalarVolumePerTimePressureArea& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); + // SEErrorType + void Property::UnMarshall(const CDM::enumErrorType& in, SEErrorType& out) + { + try { + switch (in) { + case CDM::enumErrorType::Standard: + out = SEErrorType::Standard; + break; + default: + out = SEErrorType::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SEErrorType::Invalid; + } } - void Property::UnMarshall(const SEScalarVolumePerTimePressureArea& in, CDM::ScalarVolumePerTimePressureAreaData& out) + void Property::Marshall(const SEErrorType& in, CDM::enumErrorType& out) { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); + switch (in) { + case SEErrorType::Standard: + out = CDM::enumErrorType::Standard; + break; + default: + // out = (CDM::enumErrorType::value)-1; + break; + } } - // class SEScalarVolumePerTimePressure------------------------------------------------- - void Property::Marshall(const CDM::ScalarVolumePerTimePressureData& in, SEScalarVolumePerTimePressure& out) - { - Property::Marshall(static_cast(in), static_cast&>(out)); +} + +// Operators +bool operator==(CDM::enumSide const& lhs, SESide const& rhs) +{ + switch (rhs) { + case SESide::Left: + return (CDM::enumSide::Left == lhs); + case SESide::Right: + return (CDM::enumSide::Right == lhs); + case SESide::Invalid: + return ((CDM::enumSide::value)-1 == lhs); + default: + return false; } - void Property::UnMarshall(const SEScalarVolumePerTimePressure& in, CDM::ScalarVolumePerTimePressureData& out) - { - Property::UnMarshall(static_cast const&>(in), static_cast(out)); +} +bool operator==(CDM::enumOpenClosed const& lhs, SEOpenClosed const& rhs) +{ + switch (rhs) { + case SEOpenClosed::Open: + return (CDM::enumOpenClosed::Open == lhs); + case SEOpenClosed::Closed: + return (CDM::enumOpenClosed::Closed == lhs); + case SEOpenClosed::Invalid: + return ((CDM::enumOpenClosed::value)-1 == lhs); + default: + return false; } - // class SERunningAverage------------------------------------------------- - void Property::Marshall(const CDM::RunningAverageData& in, RunningAverage& out) - { - out.m_Sum = in.sum(); - out.m_NumSamples = in.numSamples(); +} +bool operator==(CDM::enumOnOff const& lhs, SEOnOff const& rhs) +{ + switch (rhs) { + case SEOnOff::On: + return (CDM::enumOnOff::On == lhs); + case SEOnOff::Off: + return (CDM::enumOnOff::Off == lhs); + case SEOnOff::Invalid: + return ((CDM::enumOnOff::value)-1 == lhs); + default: + return false; } - void Property::UnMarshall(const RunningAverage& in, CDM::RunningAverageData& out) - { - out.sum(in.m_Sum); - out.numSamples(in.m_NumSamples); +} +bool operator==(CDM::enumErrorType const& lhs, SEErrorType const& rhs) +{ + switch (rhs) { + case SEErrorType::Standard: + return (CDM::enumErrorType::Standard == lhs); + case SEErrorType::Invalid: + return ((CDM::enumErrorType::value)-1 == lhs); + default: + return false; } } + } diff --git a/projects/biogears/libBiogears/src/io/cdm/Property.h b/projects/biogears/libBiogears/src/io/cdm/Property.h index 3802c4dae..1d98fcc84 100644 --- a/projects/biogears/libBiogears/src/io/cdm/Property.h +++ b/projects/biogears/libBiogears/src/io/cdm/Property.h @@ -13,368 +13,251 @@ specific language governing permissions and limitations under the License. #pragma once #include +#include +#include + #include -#include +#include #include +#include +#include +#include +#include +#include +#include + #include // Question: To Serialize Invalid units or not to Serialize? // TO Throw an exception when a member is invalid? -#define CDM_PROPERTY_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func && in.m_##func->IsValid()) { \ + out.func(std::make_unique::type>()); \ + io::Property::Marshall(*in.m_##func, out.func()); \ + } /* else if (in.m_##func) { \ + throw biogears::CommonDataModelException("func is InValid and cannot be Unmarshalled"); \ + }*/ + +#define CDM_PROPERTY_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func.IsValid()) { \ + out.func(std::make_unique::type>()); \ + io::Property::Marshall(in.m_##func, out.func()); \ + } /* else if (in.m_##func) { \ + throw biogears::CommonDataModelException("func is InValid and cannot be Unmarshalled"); \ + }*/ + +#define CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func && in.m_##func->IsValid()) { \ - out.func(std::make_unique::type>()); \ - io::Property::UnMarshall(*in.m_##func, out.func()); \ - }/* else if (in.m_##func) { \ + io::Property::Marshall(*in.m_##func, out.func()); \ + } /*else if (in.m_##func) { \ throw biogears::CommonDataModelException("func is InValid and cannot be Unmarshalled"); \ }*/ -#define CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, func) \ - if (in.m_##func && in.m_##func->IsValid()) { \ - io::Property::UnMarshall(*in.m_##func, out.func()); \ - } /*else if (in.m_##func) { \ +#define CDM_OPTIONAL_PROPERTY_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func.IsValid()) { \ + io::Property::Marshall(in.m_##func, out.func()); \ + } /*else if (in.m_##func) { \ throw biogears::CommonDataModelException("func is InValid and cannot be Unmarshalled"); \ }*/ -#define CDM_ENUM_UNMARSHAL_HELPER(in, out, func) \ - if (in.Has##func()) { \ - out.func(in.m_##func); \ - } +#define CDM_RUNNING_AVERAGE_PTR_MARSHALL_HELPER(in, out, func) \ + out.func(std::make_unique::type>()); \ + io::Property::Marshall(in.m_##func, out.func()); -namespace biogears { -class RunningAverage; +#define SE_PROPERTY_ENUM_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.Has##func()) { \ + out.func(std::make_unique::type>()); \ + io::Property::Marshall(in.m_##func, out.func()); \ + } -class SEDecimalFormat; -template -class SEScalarQuantity; -class SEFunctionElectricPotentialVsTime; -class SEFunction; -class SEFunctionVolumeVsTime; -class SEHistogramFractionVsLength; -class SEHistogram; -class SEProperty; -class SEScalar0To1; -class SEScalarAmount; -class SEScalarAmountPerMass; -class SEScalarAmountPerTime; -class SEScalarAmountPerVolume; -class SEScalarArea; -class SEScalarAreaPerTimePressure; -class SEScalarElectricCapacitance; -class SEScalarElectricCharge; -class SEScalarElectricCurrent; -class SEScalarElectricInductance; -class SEScalarElectricPotential; -class SEScalarElectricResistance; -class SEScalarEnergy; -class SEScalarEnergyPerAmount; -class SEScalarEnergyPerMass; -class SEScalarFlowCompliance; -class SEScalarFlowElastance; -class SEScalarFlowInertance; -class SEScalarFlowResistance; -class SEScalarForce; -class SEScalarFraction; -class SEScalarFrequency; -class SEScalar; -class SEScalarHeatCapacitance; -class SEScalarHeatCapacitancePerAmount; -class SEScalarHeatCapacitancePerMass; -class SEScalarHeatConductance; -class SEScalarHeatConductancePerArea; -class SEScalarHeatInductance; -class SEScalarHeatResistanceArea; -class SEScalarHeatResistance; -class SEScalarInversePressure; -class SEScalarInverseVolume; -class SEScalarLength; -class SEScalarLengthPerTime; -class SEScalarLengthPerTimePressure; -class SEScalarMass; -class SEScalarMassPerAmount; -class SEScalarMassPerAreaTime; -class SEScalarMassPerMass; -class SEScalarMassPerTime; -class SEScalarMassPerVolume; -class SEScalarNeg1To1; -class SEScalarOsmolality; -class SEScalarOsmolarity; -class SEScalarPower; -class SEScalarPowerPerAreaTemperatureToTheFourth; -class SEScalarPressure; -class SEScalarPressurePerVolume; -class SEScalarPressureTimePerArea; -class SEScalarPressureTimePerVolumeArea; -class SEScalarTemperature; -class SEScalarTime; -class SEScalarVolume; -class SEScalarVolumePerPressure; -class SEScalarVolumePerTimeArea; -class SEScalarVolumePerTime; -class SEScalarVolumePerTimeMass; -class SEScalarVolumePerTimePressureArea; -class SEScalarVolumePerTimePressure; -class SEUnitScalar; +#define SE_OPTIONAL_PROPERTY_ENUM_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func != decltype(in.m_##func)::Invalid) { \ + io::Property::Marshall(in.m_##func, out.func()); \ + } +namespace biogears { namespace io { class BIOGEARS_PRIVATE_API Property { public: // template option + template ::value>* = nullptr> + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); + template ::value>* = nullptr> + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out, std::default_random_engine* rd = nullptr); template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); - template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); - // template option - static void Marshall(xsd::cxx::tree::optional const& option_in, SEDecimalFormat& out); - static void UnMarshall(const SEDecimalFormat& in, xsd::cxx::tree::optional& option_out); + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); + // template class SEScalarQuantity; template - static void Marshall(const CDM::ScalarData& in, SEScalarQuantity& out); + static void UnMarshall(const CDM::ScalarData& in, SEScalarQuantity& out, std::default_random_engine* rd = nullptr); template - static void UnMarshall(const SEScalarQuantity& in, CDM::ScalarData& out); + static void Marshall(const SEScalarQuantity& in, CDM::ScalarData& out); + // SEDecimalFormat + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SEDecimalFormat& out); + static void Marshall(const SEDecimalFormat& in, xsd::cxx::tree::optional& option_out); // class SEDecimalFormat; - static void Marshall(const CDM::DecimalFormatData& in, SEDecimalFormat& out); - static void UnMarshall(const SEDecimalFormat& in, CDM::DecimalFormatData& out); + static void UnMarshall(const CDM::DecimalFormatData& in, SEDecimalFormat& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEDecimalFormat& in, CDM::DecimalFormatData& out); // class SEFunctionElectricPotentialVsTime; - static void Marshall(const CDM::FunctionElectricPotentialVsTimeData& in, SEFunctionElectricPotentialVsTime& out); - static void UnMarshall(const SEFunctionElectricPotentialVsTime& in, CDM::FunctionElectricPotentialVsTimeData& out); + static void UnMarshall(const CDM::FunctionElectricPotentialVsTimeData& in, SEFunctionElectricPotentialVsTime& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEFunctionElectricPotentialVsTime& in, CDM::FunctionElectricPotentialVsTimeData& out); // class SEFunction; - static void Marshall(const CDM::FunctionData& in, SEFunction& out); - static void UnMarshall(const SEFunction& in, CDM::FunctionData& out); + static void UnMarshall(const CDM::FunctionData& in, SEFunction& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEFunction& in, CDM::FunctionData& out); // class SEFunctionVolumeVsTime; - static void Marshall(const CDM::FunctionVolumeVsTimeData& in, SEFunctionVolumeVsTime& out); - static void UnMarshall(const SEFunctionVolumeVsTime& in, CDM::FunctionVolumeVsTimeData& out); + static void UnMarshall(const CDM::FunctionVolumeVsTimeData& in, SEFunctionVolumeVsTime& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEFunctionVolumeVsTime& in, CDM::FunctionVolumeVsTimeData& out); // class SEHistogramFractionVsLength; - static void Marshall(const CDM::HistogramFractionVsLengthData& in, SEHistogramFractionVsLength& out); - static void UnMarshall(const SEHistogramFractionVsLength& in, CDM::HistogramFractionVsLengthData& out); + static void UnMarshall(const CDM::HistogramFractionVsLengthData& in, SEHistogramFractionVsLength& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEHistogramFractionVsLength& in, CDM::HistogramFractionVsLengthData& out); // class SEHistogram; - static void Marshall(const CDM::HistogramData& in, SEHistogram& out); - static void UnMarshall(const SEHistogram& in, CDM::HistogramData& out); - // class SEScalar0To1; - static void Marshall(const CDM::Scalar0To1Data& in, SEScalar0To1& out); - static void UnMarshall(const SEScalar0To1& in, CDM::Scalar0To1Data& out); - // class SEScalarAmount; - static void Marshall(const CDM::ScalarAmountData& in, SEScalarAmount& out); - static void UnMarshall(const SEScalarAmount& in, CDM::ScalarAmountData& out); - // class SEScalarAmountPerMass; - static void Marshall(const CDM::ScalarAmountPerMassData& in, SEScalarAmountPerMass& out); - static void UnMarshall(const SEScalarAmountPerMass& in, CDM::ScalarAmountPerMassData& out); - // class SEScalarAmountPerTime; - static void Marshall(const CDM::ScalarAmountPerTimeData& in, SEScalarAmountPerTime& out); - static void UnMarshall(const SEScalarAmountPerTime& in, CDM::ScalarAmountPerTimeData& out); - // class SEScalarAmountPerVolume; - static void Marshall(const CDM::ScalarAmountPerVolumeData& in, SEScalarAmountPerVolume& out); - static void UnMarshall(const SEScalarAmountPerVolume& in, CDM::ScalarAmountPerVolumeData& out); - // class SEScalarArea; - static void Marshall(const CDM::ScalarAreaData& in, SEScalarArea& out); - static void UnMarshall(const SEScalarArea& in, CDM::ScalarAreaData& out); - // class SEScalarAreaPerTimePressure; - static void Marshall(const CDM::ScalarAreaPerTimePressureData& in, SEScalarAreaPerTimePressure& out); - static void UnMarshall(const SEScalarAreaPerTimePressure& in, CDM::ScalarAreaPerTimePressureData& out); - // class SEScalarElectricCapacitance; - static void Marshall(const CDM::ScalarElectricCapacitanceData& in, SEScalarElectricCapacitance& out); - static void UnMarshall(const SEScalarElectricCapacitance& in, CDM::ScalarElectricCapacitanceData& out); - // class SEScalarElectricCharge; - static void Marshall(const CDM::ScalarElectricChargeData& in, SEScalarElectricCharge& out); - static void UnMarshall(const SEScalarElectricCharge& in, CDM::ScalarElectricChargeData& out); - // class SEScalarElectricCurrent; - static void Marshall(const CDM::ScalarElectricCurrentData& in, SEScalarElectricCurrent& out); - static void UnMarshall(const SEScalarElectricCurrent& in, CDM::ScalarElectricCurrentData& out); - // class SEScalarElectricInductance; - static void Marshall(const CDM::ScalarElectricInductanceData& in, SEScalarElectricInductance& out); - static void UnMarshall(const SEScalarElectricInductance& in, CDM::ScalarElectricInductanceData& out); - // class SEScalarElectricPotential; - static void Marshall(const CDM::ScalarElectricPotentialData& in, SEScalarElectricPotential& out); - static void UnMarshall(const SEScalarElectricPotential& in, CDM::ScalarElectricPotentialData& out); - // class SEScalarElectricResistance; - static void Marshall(const CDM::ScalarElectricResistanceData& in, SEScalarElectricResistance& out); - static void UnMarshall(const SEScalarElectricResistance& in, CDM::ScalarElectricResistanceData& out); - // class SEScalarEnergy; - static void Marshall(const CDM::ScalarEnergyData& in, SEScalarEnergy& out); - static void UnMarshall(const SEScalarEnergy& in, CDM::ScalarEnergyData& out); - // class SEScalarEnergyPerAmount; - static void Marshall(const CDM::ScalarEnergyPerAmountData& in, SEScalarEnergyPerAmount& out); - static void UnMarshall(const SEScalarEnergyPerAmount& in, CDM::ScalarEnergyPerAmountData& out); - // class SEScalarEnergyPerMass; - static void Marshall(const CDM::ScalarEnergyPerMassData& in, SEScalarEnergyPerMass& out); - static void UnMarshall(const SEScalarEnergyPerMass& in, CDM::ScalarEnergyPerMassData& out); - // class SEScalarFlowCompliance; - static void Marshall(const CDM::ScalarFlowComplianceData& in, SEScalarFlowCompliance& out); - static void UnMarshall(const SEScalarFlowCompliance& in, CDM::ScalarFlowComplianceData& out); - // class SEScalarFlowElastance; - static void Marshall(const CDM::ScalarFlowElastanceData& in, SEScalarFlowElastance& out); - static void UnMarshall(const SEScalarFlowElastance& in, CDM::ScalarFlowElastanceData& out); - // class SEScalarFlowInertance; - static void Marshall(const CDM::ScalarFlowInertanceData& in, SEScalarFlowInertance& out); - static void UnMarshall(const SEScalarFlowInertance& in, CDM::ScalarFlowInertanceData& out); - // class SEScalarFlowResistance; - static void Marshall(const CDM::ScalarFlowResistanceData& in, SEScalarFlowResistance& out); - static void UnMarshall(const SEScalarFlowResistance& in, CDM::ScalarFlowResistanceData& out); - // class SEScalarForce; - static void Marshall(const CDM::ScalarForceData& in, SEScalarForce& out); - static void UnMarshall(const SEScalarForce& in, CDM::ScalarForceData& out); - // class SEScalarFraction; - static void Marshall(const CDM::ScalarFractionData& in, SEScalarFraction& out); - static void UnMarshall(const SEScalarFraction& in, CDM::ScalarFractionData& out); - // class SEScalarFrequency; - static void Marshall(const CDM::ScalarFrequencyData& in, SEScalarFrequency& out); - static void UnMarshall(const SEScalarFrequency& in, CDM::ScalarFrequencyData& out); - // class SEScalar; - static void Marshall(const CDM::ScalarData& in, SEScalar& out); - static void UnMarshall(const SEScalar& in, CDM::ScalarData& out); - // class SEScalarHeatCapacitance; - static void Marshall(const CDM::ScalarHeatCapacitanceData& in, SEScalarHeatCapacitance& out); - static void UnMarshall(const SEScalarHeatCapacitance& in, CDM::ScalarHeatCapacitanceData& out); - // class SEScalarHeatCapacitancePerAmount; - static void Marshall(const CDM::ScalarHeatCapacitancePerAmountData& in, SEScalarHeatCapacitancePerAmount& out); - static void UnMarshall(const SEScalarHeatCapacitancePerAmount& in, CDM::ScalarHeatCapacitancePerAmountData& out); - // class SEScalarHeatCapacitancePerMass; - static void Marshall(const CDM::ScalarHeatCapacitancePerMassData& in, SEScalarHeatCapacitancePerMass& out); - static void UnMarshall(const SEScalarHeatCapacitancePerMass& in, CDM::ScalarHeatCapacitancePerMassData& out); - // class SEScalarHeatConductance; - static void Marshall(const CDM::ScalarHeatConductanceData& in, SEScalarHeatConductance& out); - static void UnMarshall(const SEScalarHeatConductance& in, CDM::ScalarHeatConductanceData& out); - // class SEScalarHeatConductancePerArea; - static void Marshall(const CDM::ScalarHeatConductancePerAreaData& in, SEScalarHeatConductancePerArea& out); - static void UnMarshall(const SEScalarHeatConductancePerArea& in, CDM::ScalarHeatConductancePerAreaData& out); - // class SEScalarHeatInductance; - static void Marshall(const CDM::ScalarHeatInductanceData& in, SEScalarHeatInductance& out); - static void UnMarshall(const SEScalarHeatInductance& in, CDM::ScalarHeatInductanceData& out); - // class SEScalarHeatResistanceArea; - static void Marshall(const CDM::ScalarHeatResistanceAreaData& in, SEScalarHeatResistanceArea& out); - static void UnMarshall(const SEScalarHeatResistanceArea& in, CDM::ScalarHeatResistanceAreaData& out); - // class SEScalarHeatResistance; - static void Marshall(const CDM::ScalarHeatResistanceData& in, SEScalarHeatResistance& out); - static void UnMarshall(const SEScalarHeatResistance& in, CDM::ScalarHeatResistanceData& out); - // class SEScalarInversePressure; - static void Marshall(const CDM::ScalarInversePressureData& in, SEScalarInversePressure& out); - static void UnMarshall(const SEScalarInversePressure& in, CDM::ScalarInversePressureData& out); - // class SEScalarInverseVolume; - static void Marshall(const CDM::ScalarInverseVolumeData& in, SEScalarInverseVolume& out); - static void UnMarshall(const SEScalarInverseVolume& in, CDM::ScalarInverseVolumeData& out); - // class SEScalarLength; - static void Marshall(const CDM::ScalarLengthData& in, SEScalarLength& out); - static void UnMarshall(const SEScalarLength& in, CDM::ScalarLengthData& out); - // class SEScalarLengthPerTime; - static void Marshall(const CDM::ScalarLengthPerTimeData& in, SEScalarLengthPerTime& out); - static void UnMarshall(const SEScalarLengthPerTime& in, CDM::ScalarLengthPerTimeData& out); - // class SEScalarLengthPerTimePressure; - static void Marshall(const CDM::ScalarLengthPerTimePressureData& in, SEScalarLengthPerTimePressure& out); - static void UnMarshall(const SEScalarLengthPerTimePressure& in, CDM::ScalarLengthPerTimePressureData& out); - // class SEScalarMass; - static void Marshall(const CDM::ScalarMassData& in, SEScalarMass& out); - static void UnMarshall(const SEScalarMass& in, CDM::ScalarMassData& out); - // class SEScalarMassPerAmount; - static void Marshall(const CDM::ScalarMassPerAmountData& in, SEScalarMassPerAmount& out); - static void UnMarshall(const SEScalarMassPerAmount& in, CDM::ScalarMassPerAmountData& out); - // class SEScalarMassPerAreaTime; - static void Marshall(const CDM::ScalarMassPerAreaTimeData& in, SEScalarMassPerAreaTime& out); - static void UnMarshall(const SEScalarMassPerAreaTime& in, CDM::ScalarMassPerAreaTimeData& out); - // class SEScalarMassPerMass; - static void Marshall(const CDM::ScalarMassPerMassData& in, SEScalarMassPerMass& out); - static void UnMarshall(const SEScalarMassPerMass& in, CDM::ScalarMassPerMassData& out); - // class SEScalarMassPerTime; - static void Marshall(const CDM::ScalarMassPerTimeData& in, SEScalarMassPerTime& out); - static void UnMarshall(const SEScalarMassPerTime& in, CDM::ScalarMassPerTimeData& out); - // class SEScalarMassPerVolume; - static void Marshall(const CDM::ScalarMassPerVolumeData& in, SEScalarMassPerVolume& out); - static void UnMarshall(const SEScalarMassPerVolume& in, CDM::ScalarMassPerVolumeData& out); - // class SEScalarNeg1To1; - static void Marshall(const CDM::ScalarNeg1To1Data& in, SEScalarNeg1To1& out); - static void UnMarshall(const SEScalarNeg1To1& in, CDM::ScalarNeg1To1Data& out); - // class SEScalarOsmolality; - static void Marshall(const CDM::ScalarOsmolalityData& in, SEScalarOsmolality& out); - static void UnMarshall(const SEScalarOsmolality& in, CDM::ScalarOsmolalityData& out); - // class SEScalarOsmolarity; - static void Marshall(const CDM::ScalarOsmolarityData& in, SEScalarOsmolarity& out); - static void UnMarshall(const SEScalarOsmolarity& in, CDM::ScalarOsmolarityData& out); - // class SEScalarPower; - static void Marshall(const CDM::ScalarPowerData& in, SEScalarPower& out); - static void UnMarshall(const SEScalarPower& in, CDM::ScalarPowerData& out); - // class SEScalarPowerPerAreaTemperatureToTheFourth; - static void Marshall(const CDM::ScalarPowerPerAreaTemperatureToTheFourthData& in, SEScalarPowerPerAreaTemperatureToTheFourth& out); - static void UnMarshall(const SEScalarPowerPerAreaTemperatureToTheFourth& in, CDM::ScalarPowerPerAreaTemperatureToTheFourthData& out); - // class SEScalarPressure; - static void Marshall(const CDM::ScalarPressureData& in, SEScalarPressure& out); - static void UnMarshall(const SEScalarPressure& in, CDM::ScalarPressureData& out); - // class SEScalarPressurePerVolume; - static void Marshall(const CDM::ScalarPressurePerVolumeData& in, SEScalarPressurePerVolume& out); - static void UnMarshall(const SEScalarPressurePerVolume& in, CDM::ScalarPressurePerVolumeData& out); - // class SEScaMlarPressureTimePerArea; - static void Marshall(const CDM::ScalarPressureTimePerAreaData& in, SEScalarPressureTimePerArea& out); - static void UnMarshall(const SEScalarPressureTimePerArea& in, CDM::ScalarPressureTimePerAreaData& out); - // class SEScalarPressureTimePerVolumeArea; - static void Marshall(const CDM::ScalarPressureTimePerVolumeAreaData& in, SEScalarPressureTimePerVolumeArea& out); - static void UnMarshall(const SEScalarPressureTimePerVolumeArea& in, CDM::ScalarPressureTimePerVolumeAreaData& out); - // class SEScalarTemperature; - static void Marshall(const CDM::ScalarTemperatureData& in, SEScalarTemperature& out); - static void UnMarshall(const SEScalarTemperature& in, CDM::ScalarTemperatureData& out); - // class SEScalarTime; - static void Marshall(const CDM::ScalarTimeData& in, SEScalarTime& out); - static void UnMarshall(const SEScalarTime& in, CDM::ScalarTimeData& out); - // class SEScalarVolume; - static void Marshall(const CDM::ScalarVolumeData& in, SEScalarVolume& out); - static void UnMarshall(const SEScalarVolume& in, CDM::ScalarVolumeData& out); - // class SEScalarVolumePerPressure; - static void Marshall(const CDM::ScalarVolumePerPressureData& in, SEScalarVolumePerPressure& out); - static void UnMarshall(const SEScalarVolumePerPressure& in, CDM::ScalarVolumePerPressureData& out); - // class SEScalarVolumePerTimeArea; - static void Marshall(const CDM::ScalarVolumePerTimeAreaData& in, SEScalarVolumePerTimeArea& out); - static void UnMarshall(const SEScalarVolumePerTimeArea& in, CDM::ScalarVolumePerTimeAreaData& out); - // class SEScalarVolumePerTime; - static void Marshall(const CDM::ScalarVolumePerTimeData& in, SEScalarVolumePerTime& out); - static void UnMarshall(const SEScalarVolumePerTime& in, CDM::ScalarVolumePerTimeData& out); - // class SEScalarVolumePerTimeMass; - static void Marshall(const CDM::ScalarVolumePerTimeMassData& in, SEScalarVolumePerTimeMass& out); - static void UnMarshall(const SEScalarVolumePerTimeMass& in, CDM::ScalarVolumePerTimeMassData& out); - // class SEScalarVolumePerTimePressureArea; - static void Marshall(const CDM::ScalarVolumePerTimePressureAreaData& in, SEScalarVolumePerTimePressureArea& out); - static void UnMarshall(const SEScalarVolumePerTimePressureArea& in, CDM::ScalarVolumePerTimePressureAreaData& out); - // class SEScalarVolumePerTimePressure; - static void Marshall(const CDM::ScalarVolumePerTimePressureData& in, SEScalarVolumePerTimePressure& out); - static void UnMarshall(const SEScalarVolumePerTimePressure& in, CDM::ScalarVolumePerTimePressureData& out); + static void UnMarshall(const CDM::HistogramData& in, SEHistogram& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEHistogram& in, CDM::HistogramData& out); // class SERunningAverage - static void Marshall(const CDM::RunningAverageData& in, RunningAverage& out); - static void UnMarshall(const RunningAverage& in, CDM::RunningAverageData& out); + static void UnMarshall(const CDM::RunningAverageData& in, RunningAverage& out, std::default_random_engine* rd = nullptr); + static void Marshall(const RunningAverage& in, CDM::RunningAverageData& out); + // class Scalar0To1Data + static void UnMarshall(const CDM::Scalar0To1Data& in, SEScalar0To1& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEScalar0To1& in, CDM::Scalar0To1Data& out); + // class SEScalarNeg1To1 + static void UnMarshall(const CDM::ScalarNeg1To1Data& in, SEScalarNeg1To1& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEScalarNeg1To1& in, CDM::ScalarNeg1To1Data& out); + // class SEScalarFractionData + static void UnMarshall(const CDM::ScalarFractionData& in, SEScalarFraction& out, std::default_random_engine* rd); + static void Marshall(const SEScalarFraction& in, CDM::ScalarFractionData& out); + + // class SEScalar + static void UnMarshall(const CDM::ScalarData& in, SEScalar& out, std::default_random_engine* rd = nullptr); + static void Marshall(const SEScalar& in, CDM::ScalarData& out); + + // SESide + static void UnMarshall(const CDM::enumSide& in, SESide& out); + static void Marshall(const SESide& in, CDM::enumSide& out); + // SEOpenClosed + static void UnMarshall(const CDM::enumOpenClosed& in, SEOpenClosed& out); + static void Marshall(const SEOpenClosed& in, CDM::enumOpenClosed& out); + // SEOnOff + static void UnMarshall(const CDM::enumOnOff& in, SEOnOff& out); + static void Marshall(const SEOnOff& in, CDM::enumOnOff& out); + // SEErrorType + static void UnMarshall(const CDM::enumErrorType& in, SEErrorType& out); + static void Marshall(const SEErrorType& in, CDM::enumErrorType& out); }; //------------------------------------------------------------------------------- template - void Property::Marshall(const CDM::ScalarData& in, SEScalarQuantity& out) + void Property::UnMarshall(const CDM::ScalarData& in, SEScalarQuantity& out, std::default_random_engine* rd) { - out.Clear(); + out.Invalidate(); if (in.unit().present()) { - out.SetValue(in.value(), Unit::GetCompoundUnit(in.unit().get())); + if (in.deviation().present() && rd) { + auto nd = std::normal_distribution(in.value(), in.deviation().get()); + out.SetValue(nd(*rd), Unit::GetCompoundUnit(in.unit().get())); + } else { + out.SetValue(in.value(), Unit::GetCompoundUnit(in.unit().get())); + } } else { throw CommonDataModelException("ScalarQuantity attempted to load a ScalarData with no unit, must have a unit."); } out.m_readOnly = in.readOnly(); } - //------------------------------------------------------------------------------- template - void Property::UnMarshall(const SEScalarQuantity& in, CDM::ScalarData& out) + void Property::Marshall(const SEScalarQuantity& in, CDM::ScalarData& out) { out.value(in.m_value); out.unit(in.m_unit->GetString()); out.readOnly(in.m_readOnly); + + // out.value(std::make_unique::type>(in.m_value)); + // out.unit(std::make_unique::type>(in.m_unit->GetString())); + // out.readOnly(std::make_unique::type>(in.m_readOnly)); } //---------------------------------------------------------------------------------- - template - void Property::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + + template ::value>*> + void Property::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) + { + if (!option_in.present() || option_in->empty()) { + out = SE::Invalid; + } else { + UnMarshall(option_in.get(), out); + } + } + + template ::value>*> + void Property::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out, std::default_random_engine* rd) { if (!option_in.present()) { out.Invalidate(); } else { - Marshall(option_in.get(), out); + UnMarshall(option_in.get(), out, rd); } } - //---------------------------------------------------------------------------------- + template - void Property::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void Property::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); - option_out.set(*item); + Marshall(in, *item); + option_out.set(std::move(item)); } +} // namespace io + +// Operators +bool operator==(CDM::enumSide const& lhs, SESide const& rhs); +bool operator==(CDM::enumOpenClosed const& lhs, SEOpenClosed const& rhs); +bool operator==(CDM::enumOnOff const& lhs, SEOnOff const& rhs); +bool operator==(CDM::enumErrorType const& lhs, SEErrorType const& rhs); + +inline bool operator==(SESide const& lhs, CDM::enumSide const& rhs) +{ + return rhs == lhs; +} +inline bool operator==(SEOpenClosed const& lhs, CDM::enumOpenClosed const& rhs) +{ + return rhs == lhs; +} +inline bool operator==(SEOnOff const& lhs, CDM::enumOnOff const& rhs) +{ + return rhs == lhs; +} +inline bool operator==(SEErrorType const& lhs, CDM::enumErrorType const& rhs) +{ + return rhs == lhs; +} + +inline bool operator!=(CDM::enumSide const& lhs, SESide const& rhs) +{ + return !(lhs == rhs); +} +inline bool operator!=(CDM::enumOpenClosed const& lhs, SEOpenClosed const& rhs) +{ + return !(lhs == rhs); +} +inline bool operator!=(CDM::enumOnOff const& lhs, SEOnOff const& rhs) +{ + return !(lhs == rhs); +} +inline bool operator!=(CDM::enumErrorType const& lhs, SEErrorType const& rhs) +{ + return !(lhs == rhs); } +inline bool operator!=(SESide const& lhs, CDM::enumSide const& rhs) +{ + return !(rhs == lhs); +} +inline bool operator!=(SEOpenClosed const& lhs, CDM::enumOpenClosed const& rhs) +{ + return !(rhs == lhs); +} +inline bool operator!=(SEOnOff const& lhs, CDM::enumOnOff const& rhs) +{ + return !(rhs == lhs); } +inline bool operator!=(SEErrorType const& lhs, CDM::enumErrorType const& rhs) +{ + return !(rhs == lhs); +} + +} // namespace biogears diff --git a/projects/biogears/libBiogears/src/io/cdm/Scenario.cpp b/projects/biogears/libBiogears/src/io/cdm/Scenario.cpp index 71aebc4a9..88308a44f 100644 --- a/projects/biogears/libBiogears/src/io/cdm/Scenario.cpp +++ b/projects/biogears/libBiogears/src/io/cdm/Scenario.cpp @@ -1,14 +1,16 @@ #include "Scenario.h" +#include "Actions.h" +#include "AnesthesiaActions.h" +#include "DataRequests.h" #include "EngineConfiguration.h" +#include "EnvironmentActions.h" +#include "InhalerActions.h" #include "Patient.h" -#include "PatientConditions.h" #include "PatientActions.h" -#include "InhalerActions.h" -#include "AnesthesiaActions.h" -#include "EnvironmentActions.h" #include "PatientConditions.h" #include "Property.h" +#include "DataRequests.h" #include #include @@ -35,16 +37,7 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + #include #include #include @@ -52,233 +45,45 @@ namespace biogears { namespace io { - void Scenario::Marshall(const CDM::ConditionData& in, SECondition& out) - { - out.Clear(); - if (in.Comment().present()) { - out.m_Comment = in.Comment().get(); - } - } - void Scenario::UnMarshall(const SECondition& in, CDM::ConditionData& out) - { - if (in.HasComment()) { - out.Comment(in.m_Comment); - } - } - //----------------------------------------------------------------------------- - // class SEAction - void Scenario::Marshall(const CDM::ActionData& in, SEAction& out) - { - out.Clear(); - if (in.Comment().present()) { - out.m_Comment = in.Comment().get(); - } - } - void Scenario::UnMarshall(const SEAction& in, CDM::ActionData& out) - { - if (in.HasComment()) { - out.Comment(in.m_Comment); - } - } + //----------------------------------------------------------------------------- - // class SEDataRequestManager - void Scenario::Marshall(const CDM::DataRequestManagerData& in, const SESubstanceManager& subMgr, SEDataRequestManager& out) + // class SEScenario + + void Scenario::UnMarshall(const CDM::ScenarioData& in, SEScenario& out) { - out.Clear(); - if (in.Filename().present()) - out.m_ResultsFile = in.Filename().get(); - if (in.WorkingDir().present()) - out.m_WorkingDir = in.WorkingDir().get(); - if (in.SamplesPerSecond().present()) - out.m_SamplesPerSecond = in.SamplesPerSecond().get(); - if (in.DefaultDecimalFormatting().present()) - io::Property::Marshall(in.DefaultDecimalFormatting(), out.GetDefaultDecimalFormatting()); - if (in.OverrideDecimalFormatting().present()) - io::Property::Marshall(in.OverrideDecimalFormatting(), out.GetOverrideDecimalFormatting()); - - for (auto& request : in.DataRequest()) { - auto dr = factory(request, subMgr, out.m_DefaultDecimalFormatting); - if (dr != nullptr) { - if (out.HasOverrideDecimalFormatting()) - static_cast(dr.get())->Set(*out.m_OverrideDecimalFormatting); - out.m_Requests.push_back(dr.release()); + + auto loadActions = [](SEScenario& scenario, CDM::ActionListData const* actionList) { + std::unique_ptr seed; + std::random_device random_device; + std::unique_ptr default_random_engine; + + if (actionList->RandomSeed().present() && actionList->RandomSeed().get().seed().size() != 0) { + auto seeds = actionList->RandomSeed().get().seed(); + seed = std::make_unique(seeds.begin(), seeds.end()); + default_random_engine = std::make_unique(*seed); + + std::stringstream ss; + ss << "Using seed={"; + for (auto& seed : actionList->RandomSeed().get().seed()) { + ss << seed << ", "; + } + ss.seekp(-2, ss.cur); + ss << "}" << std::endl; + scenario.m_Logger->Warning(ss.str()); + } else { + seed.reset(new std::seed_seq { random_device(), random_device(), random_device(), random_device(), random_device() }); + default_random_engine = std::make_unique(*seed); } - } - } - void Scenario::UnMarshall(const SEDataRequestManager& in, CDM::DataRequestManagerData& out) - { - out.SamplesPerSecond(in.m_SamplesPerSecond); - if (in.HasResultsFilename()) - out.Filename(in.m_ResultsFile); - if (in.HasWorkingDir()) - out.WorkingDir(in.m_WorkingDir); - if (in.HasDefaultDecimalFormatting()) - io::Property::UnMarshall(*in.m_DefaultDecimalFormatting, out.DefaultDecimalFormatting()); - if (in.HasOverrideDecimalFormatting()) - io::Property::UnMarshall(*in.m_OverrideDecimalFormatting, out.OverrideDecimalFormatting()); - for (auto* dr : in.m_Requests) { - CDM::DataRequestData data; - out.DataRequest().push_back(io::Scenario::factory(dr)); - } - } - //----------------------------------------------------------------------------- - // class SEDataRequest - void Scenario::Marshall(const CDM::DataRequestData& in, SEDataRequest& out) - { - io::Property::Marshall(static_cast(in), static_cast(out)); - out.m_Name = in.Name(); - if (in.Unit().present()) { - out.m_RequestedUnit = in.Unit().get(); - } - } - void Scenario::UnMarshall(const SEDataRequest& in, CDM::DataRequestData& out) - { - io::Property::UnMarshall(static_cast(in), static_cast(out)); - out.Name(in.m_Name); - if (in.HasUnit()) { - out.Unit(in.m_Unit->GetString()); - } else if (in.HasRequestedUnit()) { - out.Unit(in.m_RequestedUnit); - } - } - //----------------------------------------------------------------------------- - // class SEPatientDataRequest - void Scenario::Marshall(const CDM::PatientDataRequestData& in, SEPatientDataRequest& out) - { - io::Scenario::Marshall(static_cast(in), static_cast(out)); - } - void Scenario::UnMarshall(const SEPatientDataRequest& in, CDM::PatientDataRequestData& out) - { - io::Scenario::UnMarshall(static_cast(in), static_cast(out)); - } - //----------------------------------------------------------------------------- - // class SEPhysiologyDataRequest - void Scenario::Marshall(const CDM::PhysiologyDataRequestData& in, SEPhysiologyDataRequest& out) - { - io::Scenario::Marshall(static_cast(in), static_cast(out)); - } - void Scenario::UnMarshall(const SEPhysiologyDataRequest& in, CDM::PhysiologyDataRequestData& out) - { - io::Scenario::UnMarshall(static_cast(in), static_cast(out)); - } - //----------------------------------------------------------------------------- - // class SEEnvironmentDataRequest - void Scenario::Marshall(const CDM::EnvironmentDataRequestData& in, SEEnvironmentDataRequest& out) - { - io::Scenario::Marshall(static_cast(in), static_cast(out)); - } - void Scenario::UnMarshall(const SEEnvironmentDataRequest& in, CDM::EnvironmentDataRequestData& out) - { - io::Scenario::UnMarshall(static_cast(in), static_cast(out)); - } - //----------------------------------------------------------------------------- - // class SEEquipmentDataRequest - void Scenario::Marshall(const CDM::EquipmentDataRequestData& in, SEEquipmentDataRequest& out) - { - io::Scenario::Marshall(static_cast(in), static_cast(out)); - out.SetType(in.Type()); - } - void Scenario::UnMarshall(const SEEquipmentDataRequest& in, CDM::EquipmentDataRequestData& out) - { - io::Scenario::UnMarshall(static_cast(in), static_cast(out)); - if (in.HasType()) { - out.Type(in.m_Type); - } - } - //----------------------------------------------------------------------------- - // class SECompartmentDataRequest - void Scenario::Marshall(const CDM::CompartmentDataRequestData& in, SECompartmentDataRequest& out) - { - io::Scenario::Marshall(static_cast(in), static_cast(out)); - out.SetCompartment(in.Compartment()); - } - void Scenario::UnMarshall(const SECompartmentDataRequest& in, CDM::CompartmentDataRequestData& out) - { - io::Scenario::UnMarshall(static_cast(in), static_cast(out)); - out.Compartment(in.m_Compartment); - } - //----------------------------------------------------------------------------- - // class SECompartmentSubstanceDataRequest - void Scenario::Marshall(const CDM::CompartmentSubstanceDataRequestData& in, SESubstanceManager const& substances, SECompartmentSubstanceDataRequest& out) - { - io::Scenario::Marshall(static_cast(in), static_cast(out)); - if (in.Substance().present()) { - out.SetSubstance(substances.GetSubstance(in.Substance().get())); - } - } + for (auto& action : actionList->Action()) { + auto new_action = Actions::factory(&action, scenario.m_SubMgr, default_random_engine.get()); + if (new_action != nullptr) { + scenario.m_Actions.push_back(new_action.release()); + } + } + }; - void Scenario::UnMarshall(const SECompartmentSubstanceDataRequest& in, CDM::CompartmentSubstanceDataRequestData& out) - { - io::Scenario::UnMarshall(static_cast(in), static_cast(out)); - if (in.HasSubstance()) { - out.Substance(in.m_Substance->GetName()); - } - } - //----------------------------------------------------------------------------- - // class SEGasCompartmentDataRequest - void Scenario::Marshall(const CDM::GasCompartmentDataRequestData& in, SESubstanceManager const& substances, SEGasCompartmentDataRequest& out) - { - io::Scenario::Marshall(static_cast(in), substances, static_cast(out)); - } - void Scenario::UnMarshall(const SEGasCompartmentDataRequest& in, CDM::GasCompartmentDataRequestData& out) - { - io::Scenario::UnMarshall(static_cast(in), static_cast(out)); - } - //----------------------------------------------------------------------------- - // class SELiquidCompartmentDataRequest0 - void Scenario::Marshall(const CDM::LiquidCompartmentDataRequestData& in, SESubstanceManager const& substances, SELiquidCompartmentDataRequest& out) - { - io::Scenario::Marshall(static_cast(in), substances, static_cast(out)); - } - void Scenario::UnMarshall(const SELiquidCompartmentDataRequest& in, CDM::LiquidCompartmentDataRequestData& out) - { - io::Scenario::UnMarshall(static_cast(in), static_cast(out)); - } - //----------------------------------------------------------------------------- - // class SEThermalCompartmentDataRequest - void Scenario::Marshall(const CDM::ThermalCompartmentDataRequestData& in, SEThermalCompartmentDataRequest& out) - { - io::Scenario::Marshall(static_cast(in), static_cast(out)); - } - void Scenario::UnMarshall(const SEThermalCompartmentDataRequest& in, CDM::ThermalCompartmentDataRequestData& out) - { - io::Scenario::UnMarshall(static_cast(in), static_cast(out)); - } - //----------------------------------------------------------------------------- - // class SETissueCompartmentDataRequest - void Scenario::Marshall(const CDM::TissueCompartmentDataRequestData& in, SETissueCompartmentDataRequest& out) - { - io::Scenario::Marshall(static_cast(in), static_cast(out)); - } - void Scenario::UnMarshall(const SETissueCompartmentDataRequest& in, CDM::TissueCompartmentDataRequestData& out) - { - io::Scenario::UnMarshall(static_cast(in), static_cast(out)); - } - // class SESubstanceDataRequest - void Scenario::Marshall(const CDM::SubstanceDataRequestData& in, SESubstanceManager const& substances, SESubstanceDataRequest& out) - { - io::Scenario::Marshall(static_cast(in), static_cast(out)); - if (in.Compartment().present()) { - out.SetCompartment(in.Compartment().get()); - } - out.SetSubstance(substances.GetSubstance(in.Substance())); - } - void Scenario::UnMarshall(const SESubstanceDataRequest& in, CDM::SubstanceDataRequestData& out) - { - io::Scenario::UnMarshall(static_cast(in), static_cast(out)); - if (in.HasCompartment()) { - out.Compartment(in.m_Compartment); - } - if (in.HasSubstance()) { - out.Substance(in.m_Substance->GetName()); - } - } - //----------------------------------------------------------------------------- - // class SEScenario - void Scenario::Marshall(const CDM::ScenarioData& in, SEScenario& out) - { - out.Clear(); + out.Invalidate(); if (in.Name().present()) { out.m_Name = in.Name().get(); } @@ -288,16 +93,36 @@ namespace io { if (in.EngineStateFile().present()) { out.SetEngineStateFile(in.EngineStateFile().get()); } else if (in.InitialParameters().present()) { - Marshall(in.InitialParameters(), out.GetInitialParameters()); + UnMarshall(in.InitialParameters(), out.GetInitialParameters()); } else { throw CommonDataModelException("No State or Initial Parameters provided"); } + if (in.AutoSerialization().present()) { - Marshall(in.AutoSerialization(), out.GetAutoSerialization()); + UnMarshall(in.AutoSerialization(), out.GetAutoSerialization()); } + if (in.DataRequests().present()) { - Scenario::Marshall(in.DataRequests().get(), out.m_SubMgr, out.m_DataRequestMgr); + auto dataRequests = in.DataRequests().get(); + if (dataRequests.DataRequestFile().present()) { + biogears::filesystem::path requestFile = in.DataRequests()->DataRequestFile().get(); + auto weak_io = out.GetLogger()->GetIoManager(); + auto iom = weak_io.lock(); + + if (requestFile.exists()) { + auto sData = Serializer::ReadFile(requestFile.ToString(), out.GetLogger()); + if (auto requestManagerData = dynamic_cast(sData.get())) { + // We are ignoring recursive DataRequestManagerData where an DataRequestManagerData has an DataRequestFile reference + DataRequests::UnMarshall(*requestManagerData, out.m_SubMgr, out.m_DataRequestMgr); + } + } else { + throw CommonDataModelException("Can not find " + requestFile.ToString()); + } + } else { + DataRequests::UnMarshall(dataRequests, out.m_SubMgr, out.m_DataRequestMgr); + } } + if (in.Actions().ActionFile().present()) { biogears::filesystem::path actionFile = in.Actions().ActionFile().get(); auto weak_io = out.GetLogger()->GetIoManager(); @@ -307,43 +132,39 @@ namespace io { auto sData = Serializer::ReadFile(actionFile.ToString(), out.GetLogger()); if (auto actionList = dynamic_cast(sData.get())) { // We are ignoring recursive ActionListData where an ActionListData has an ActionFile reference - for (auto& action : actionList->Action()) { - auto new_action = PatientActions::factory(&action, out.m_SubMgr); - if (new_action != nullptr) { - out.m_Actions.push_back(new_action.release()); - } - } + loadActions(out, actionList); + } else { + throw CommonDataModelException("Unable to load " + actionFile.ToString() + "File is not ofrmated properly."); } } else { throw CommonDataModelException("Can not find " + actionFile.ToString()); } } else { - for (auto& action : in.Actions().Action()) { - auto new_action = PatientActions::factory(&action, out.m_SubMgr); - if (new_action != nullptr) { - out.m_Actions.push_back(new_action.release()); - } - } + loadActions(out, &in.Actions()); } + if (!out.IsValid()) { - throw CommonDataModelException("Unable Marshall SEScenario from ScenarioData"); + throw CommonDataModelException("Unable UnMarshall SEScenario from ScenarioData"); } } - void Scenario::UnMarshall(const SEScenario& in, CDM::ScenarioData& out) + + void Scenario::Marshall(const SEScenario& in, CDM::ScenarioData& out) { + out.Name(in.m_Name); out.Description(in.m_Description); if (in.HasEngineStateFile()) { out.EngineStateFile(in.m_EngineStateFile); } else if (in.HasInitialParameters()) { - out.InitialParameters(std::make_unique()); - UnMarshall(*in.m_InitialParameters, out.InitialParameters()); + Marshall(*in.m_InitialParameters, out.InitialParameters()); } + if (in.HasAutoSerialization()) { out.AutoSerialization(std::make_unique()); - UnMarshall(*in.m_AutoSerialization, out.AutoSerialization()); + Marshall(*in.m_AutoSerialization, out.AutoSerialization()); } - out.DataRequests(std::unique_ptr(in.m_DataRequestMgr.Unload())); + + io::DataRequests::Marshall(in.m_DataRequestMgr, out.DataRequests()); out.Actions(std::make_unique()); if (in.HasActionFile()) { @@ -352,77 +173,91 @@ namespace io { in.m_Logger->Debug("Use UnLoad (CDM::ActionFileListData) to populate an ActionFile Object."); } else { for (auto* action : in.m_Actions) { - CDM::ActionData data; - Scenario::UnMarshall(*action, data); - out.Actions().Action().push_back(data); + out.Actions().Action().push_back(Scenario::factory(action)); } } } + + void Scenario::Marshall(const SEScenario& in, CDM::ActionListData& out) + { + for (auto& action : in.GetActions()) { + auto actionData = std::make_unique(); + Actions::Marshall(*action, *actionData); + out.Action().push_back(std::move(actionData)); + } + } + //----------------------------------------------------------------------------- // class SEScenarioInitialParameters - void Scenario::Marshall(const CDM::ScenarioInitialParametersData& in, SEScenarioInitialParameters& out) + void Scenario::UnMarshall(const CDM::ScenarioInitialParametersData& in, SEScenarioInitialParameters& out) { - out.Clear(); + out.Invalidate(); if (in.Configuration().present()) { - out.GetConfiguration().Load(in.Configuration().get()); + io::EngineConfiguration::UnMarshall(in.Configuration(), out.GetConfiguration()); } if (in.PatientFile().present()) { out.m_PatientFile = in.PatientFile().get(); - } else if (in.Patient().present()) { - out.GetPatient().Load(in.Patient().get()); + } else if (in.Patient().present()) { + io::Patient::UnMarshall(in.Patient().get(), out.GetPatient()); } else { throw CommonDataModelException("No patient provided"); } for (auto const& conditionData : in.Condition()) { - out.m_Conditions.push_back(PatientConditions::factory(&conditionData, out.m_SubMgr).release()); + out.m_Conditions.push_back(Conditions::factory(&conditionData, out.m_SubMgr).release()); } if (!out.IsValid()) { - throw CommonDataModelException("Unable Marshall SEScenarioInitialParamaters from ScenarioInitialParamatersData"); + throw CommonDataModelException("Unable UnMarshall SEScenarioInitialParamaters from ScenarioInitialParamatersData"); } } - void Scenario::UnMarshall(const SEScenarioInitialParameters& in, CDM::ScenarioInitialParametersData& out) + void Scenario::Marshall(const SEScenarioInitialParameters& in, CDM::ScenarioInitialParametersData& out) { if (in.HasPatientFile()) { out.PatientFile(in.m_PatientFile); } else if (in.HasPatient()) { - Patient::UnMarshall(*in.m_Patient, out.Patient()); + Patient::Marshall(*in.m_Patient, out.Patient()); } for (SECondition* condition : in.m_Conditions) { - auto conditionData = PatientConditions::factory(condition); + auto conditionData = Conditions::factory(condition); out.Condition().push_back(std::move(conditionData)); } if (in.HasConfiguration()) { - EngineConfiguration::UnMarshall(*in.m_Configuration, out.Configuration()); + EngineConfiguration::Marshall(*in.m_Configuration, out.Configuration()); } } //----------------------------------------------------------------------------- // class SEScenarioAutoSerialization - void Scenario::Marshall(const CDM::ScenarioAutoSerializationData& in, SEScenarioAutoSerialization& out) + void Scenario::UnMarshall(const CDM::ScenarioAutoSerializationData& in, SEScenarioAutoSerialization& out) { - out.Clear(); - io::Property::Marshall(in.Period(), out.GetPeriod()); - out.SetPeriodTimeStamps(in.PeriodTimeStamps()); - out.SetAfterActions(in.AfterActions()); - out.SetReloadState(in.ReloadState()); + out.Invalidate(); + io::Property::UnMarshall(in.Period(), out.GetPeriod()); + + auto periodTimeStamp = out.GetPeriodTimeStamps(); + io::Property::UnMarshall(in.PeriodTimeStamps(), periodTimeStamp); + out.SetPeriodTimeStamps(periodTimeStamp); + + auto afterActions = out.GetAfterActions(); + io::Property::UnMarshall(in.AfterActions(), afterActions); + out.SetAfterActions(afterActions); + + auto reloadState = out.GetReloadState(); + io::Property::UnMarshall(in.ReloadState(), reloadState); + out.SetReloadState(reloadState); + out.SetDirectory(in.Directory()); out.SetFileName(in.FileName()); } - void Scenario::UnMarshall(const SEScenarioAutoSerialization& in, CDM::ScenarioAutoSerializationData& out) + void Scenario::Marshall(const SEScenarioAutoSerialization& in, CDM::ScenarioAutoSerializationData& out) { - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Period) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, Period) + + + SE_PROPERTY_ENUM_PTR_MARSHALL_HELPER(in, out, PeriodTimeStamps) + SE_PROPERTY_ENUM_PTR_MARSHALL_HELPER(in, out, AfterActions) + SE_PROPERTY_ENUM_PTR_MARSHALL_HELPER(in, out, ReloadState) - if (in.HasPeriodTimeStamps()) { - out.PeriodTimeStamps(in.m_PeriodTimeStamps); - } - if (in.HasAfterActions()) { - out.AfterActions(in.m_AfterActions); - } - if (in.HasReloadState()) { - out.ReloadState(in.m_ReloadState); - } if (in.HasDirectory()) { out.Directory(in.m_Directory); } @@ -430,193 +265,41 @@ namespace io { out.FileName(in.m_FileName); } } - //----------------------------------------------------------------------------- - // class SEAdvanceTime - void Scenario::Marshall(const CDM::AdvanceTimeData& in, SEAdvanceTime& out) - { - Marshall(static_cast(in), static_cast(out)); - io::Property::Marshall(in.Time(), out.GetTime()); - } - void Scenario::UnMarshall(const SEAdvanceTime& in, CDM::AdvanceTimeData& out) - { - UnMarshall(static_cast(in), static_cast(out)); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, Time) - } - //----------------------------------------------------------------------------- - // class SESerializeState - void Scenario::Marshall(const CDM::SerializeStateData& in, SESerializeState& out) - { - Marshall(static_cast(in), static_cast(out)); - out.SetType(in.Type()); - out.SetFilename(in.Filename()); - } - void Scenario::UnMarshall(const SESerializeState& in, CDM::SerializeStateData& out) - { - UnMarshall(static_cast(in), static_cast(out)); - if (in.HasFilename()) { - out.Filename(in.m_Filename); - } - if (in.HasType()) { - out.Type(in.m_Type); - } - } - //----------------------------------------------------------------------------- - std::unique_ptr Scenario::factory(const CDM::DataRequestData& in, SESubstanceManager const& substances, const SEDecimalFormat* df) - { - const CDM::DataRequestData* drData = ∈ - const CDM::PhysiologyDataRequestData* physSysData = dynamic_cast(drData); - if (physSysData != nullptr) { - auto sys = std::make_unique(df); - Scenario::Marshall(*physSysData, *sys); - return sys; - } - const CDM::GasCompartmentDataRequestData* gasData = dynamic_cast(drData); - if (gasData != nullptr) { - auto Comp = std::make_unique(df); - Scenario::Marshall(*gasData, substances, *Comp); - return Comp; - } - const CDM::LiquidCompartmentDataRequestData* liquidData = dynamic_cast(drData); - if (liquidData != nullptr) { - auto Comp = std::make_unique(df); - Scenario::Marshall(*liquidData, substances, *Comp); - return Comp; - } - const CDM::ThermalCompartmentDataRequestData* thermData = dynamic_cast(drData); - if (thermData != nullptr) { - auto Comp = std::make_unique(df); - Scenario::Marshall(*thermData, *Comp); - return Comp; - } - const CDM::TissueCompartmentDataRequestData* tissueData = dynamic_cast(drData); - if (tissueData != nullptr) { - auto Comp = std::make_unique(df); - Scenario::Marshall(*tissueData, *Comp); - return Comp; - } - const CDM::PatientDataRequestData* patData = dynamic_cast(drData); - if (patData != nullptr) { - auto sys = std::make_unique(df); - Scenario::Marshall(*patData, *sys); - return sys; - } - const CDM::SubstanceDataRequestData* subData = dynamic_cast(drData); - if (subData != nullptr) { - auto sub = std::make_unique(df); - Scenario::Marshall(*subData, substances, *sub); - return sub; - } - const CDM::EnvironmentDataRequestData* envData = dynamic_cast(drData); - if (envData != nullptr) { - auto env = std::make_unique(df); - Scenario::Marshall(*envData, *env); - return env; - } - const CDM::EquipmentDataRequestData* equipSysData = dynamic_cast(drData); - if (equipSysData != nullptr) { - auto sys = std::make_unique(df); - Scenario::Marshall(*equipSysData, *sys); - return sys; - } - - if (substances.GetLogger() != nullptr) - substances.GetLogger()->Error("Unsupported DataRequest Received", "SEDataRequest::newFromBind"); - return nullptr; - } - //----------------------------------------------------------------------------- - std::unique_ptr Scenario::factory(const SEDataRequest* in) - { - auto physSysData = dynamic_cast(in); - if (physSysData != nullptr) { - auto sys = std::make_unique(); - Scenario::UnMarshall(*physSysData, *sys); - return sys; - } - auto gasData = dynamic_cast(in); - if (gasData != nullptr) { - auto Comp = std::make_unique(); - Scenario::UnMarshall(*gasData, *Comp); - return Comp; - } - auto liquidData = dynamic_cast(in); - if (liquidData != nullptr) { - auto Comp = std::make_unique(); - Scenario::UnMarshall(*liquidData, *Comp); - return Comp; - } - auto thermData = dynamic_cast(in); - if (thermData != nullptr) { - auto Comp = std::make_unique(); - Scenario::UnMarshall(*thermData, *Comp); - return Comp; - } - auto tissueData = dynamic_cast(in); - if (tissueData != nullptr) { - auto Comp = std::make_unique(); - Scenario::UnMarshall(*tissueData, *Comp); - return Comp; - } - auto patData = dynamic_cast(in); - if (patData != nullptr) { - auto sys = std::make_unique(); - Scenario::UnMarshall(*patData, *sys); - return sys; - } - auto subData = dynamic_cast(in); - if (subData != nullptr) { - auto sub = std::make_unique(); - Scenario::UnMarshall(*subData, *sub); - return sub; - } - auto envData = dynamic_cast(in); - if (envData != nullptr) { - auto env = std::make_unique(); - Scenario::UnMarshall(*envData, *env); - return env; - } - auto equipSysData = dynamic_cast(in); - if (equipSysData != nullptr) { - auto sys = std::make_unique(); - Scenario::UnMarshall(*equipSysData, *sys); - return sys; - } - - throw CommonDataModelException("No Acceptable DataRequest Conversion Found"); - } //----------------------------------------------------------------------------- std::unique_ptr Scenario::factory(biogears::SEAction const* action) { - - if (auto patientAction = dynamic_cast(action);patientAction) { + + if (auto patientAction = dynamic_cast(action); patientAction) { return PatientActions::factory(patientAction); } - - if (auto advanceTimeAction = dynamic_cast(action);advanceTimeAction) { + + if (auto advanceTimeAction = dynamic_cast(action); advanceTimeAction) { auto advanceTimeData = std::make_unique(); - Scenario::UnMarshall(*advanceTimeAction, *advanceTimeData); + Actions::Marshall(*advanceTimeAction, *advanceTimeData); return std::move(advanceTimeData); } - - if (auto serilizeAction = dynamic_cast(action);serilizeAction) { - auto serilizeActionData = std::make_unique(); - Scenario::UnMarshall(*serilizeAction, *serilizeActionData); + + if (auto serilizeAction = dynamic_cast(action); serilizeAction) { + auto serilizeActionData = std::make_unique(); + Actions::Marshall(*serilizeAction, *serilizeActionData); return std::move(serilizeActionData); } - + if (auto environmentAction = dynamic_cast(action); environmentAction) { return EnvironmentActions::factory(environmentAction); } - + if (auto anesthesiaMachineAction = dynamic_cast(action); anesthesiaMachineAction) { return AnesthesiaActions::factory(anesthesiaMachineAction); } - + if (auto inhalerAction = dynamic_cast(action); inhalerAction) { return InhalerActions::factory(inhalerAction); } throw biogears::CommonDataModelException("Scenario::factory does not support the derived SEAction. If you are not a developer contact upstream for support."); } + } } diff --git a/projects/biogears/libBiogears/src/io/cdm/Scenario.h b/projects/biogears/libBiogears/src/io/cdm/Scenario.h index 68bb83504..069e13f5f 100644 --- a/projects/biogears/libBiogears/src/io/cdm/Scenario.h +++ b/projects/biogears/libBiogears/src/io/cdm/Scenario.h @@ -15,141 +15,77 @@ specific language governing permissions and limitations under the License. #include #include +#include "Actions.h" +#include "Conditions.h" + #include +#include #include -#define CDM_SCENARIO_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_SCENARIO_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ out.func(std::make_unique::type>()); \ - io::Scenario::UnMarshall(*in.m_##func, out.func()); \ + io::Scenario::Marshall(*in.m_##func, out.func()); \ + } + +#define CDM_OPTIONAL_SCENARIO_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func) { \ + io::Scenario::Marshall(*in.m_##func, out.func()); \ } -#define CDM_OPTIONAL_SCENARIO_UNMARSHAL_HELPER(in, out, func) \ - if (in.m_##func) { \ - io::Scenario::UnMarshall(*in.m_##func, out.func()); \ +#define CDM_SCENARIO_COPY(type, in, out) \ + { \ + CDM::type##Data middle; \ + io::Scenario::Marshall(in, middle); \ + io::Scenario::UnMarshall(middle, out); \ } + namespace biogears { -class SEDecimalFormat; -class SESubstanceManager; -class SECondition; -class SEAction; -class SEDataRequest; -class SEPatientDataRequest; -class SEPhysiologyDataRequest; -class SEEnvironmentDataRequest; -class SEEquipmentDataRequest; -class SECompartmentDataRequest; -class SECompartmentSubstanceDataRequest; -class SEGasCompartmentDataRequest; -class SELiquidCompartmentDataRequest; -class SEThermalCompartmentDataRequest; -class SETissueCompartmentDataRequest; -class SESubstanceDataRequest; -class SEDataRequestManager; class SEScenario; class SEScenarioInitialParameters; class SEScenarioAutoSerialization; -class SEAdvanceTime; -class SESerializeState; -class SEAnesthesiaMachineActionCollection; -class SEEnvironmentActionCollection; -class SEInhalerActionCollection; -class SEPatientActionCollection; namespace io { class BIOGEARS_PRIVATE_API Scenario { public: - //ActionCollection - - //template option + // class factories + static std::unique_ptr factory(const SEAction* in); + // template option template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); - //class SECondition; - static void Marshall(const CDM::ConditionData& in, SECondition& out); - static void UnMarshall(const SECondition& in, CDM::ConditionData& out); - //class SEAction; - static void Marshall(const CDM::ActionData& in, SEAction& out); - static void UnMarshall(const SEAction& in, CDM::ActionData& out); - //class SEDataRequestManager - static void Marshall(const CDM::DataRequestManagerData& in, const SESubstanceManager& subMgr, SEDataRequestManager& out); - static void UnMarshall(const SEDataRequestManager& in, CDM::DataRequestManagerData& out); - //class SEDataRequest; - static void Marshall(const CDM::DataRequestData& in, SEDataRequest& out); - static void UnMarshall(const SEDataRequest& in, CDM::DataRequestData& out); - //class SEPatientDataRequest; - static void Marshall(const CDM::PatientDataRequestData& in, SEPatientDataRequest& out); - static void UnMarshall(const SEPatientDataRequest& in, CDM::PatientDataRequestData& out); - //class SEPhysiologyDataRequest; - static void Marshall(const CDM::PhysiologyDataRequestData& in, SEPhysiologyDataRequest& out); - static void UnMarshall(const SEPhysiologyDataRequest& in, CDM::PhysiologyDataRequestData& out); - //class SEEnvironmentDataRequest; - static void Marshall(const CDM::EnvironmentDataRequestData& in, SEEnvironmentDataRequest& out); - static void UnMarshall(const SEEnvironmentDataRequest& in, CDM::EnvironmentDataRequestData& out); - //class SEEquipmentDataRequest; - static void Marshall(const CDM::EquipmentDataRequestData& in, SEEquipmentDataRequest& out); - static void UnMarshall(const SEEquipmentDataRequest& in, CDM::EquipmentDataRequestData& out); - //class SECompartmentDataRequest; - static void Marshall(const CDM::CompartmentDataRequestData& in, SECompartmentDataRequest& out); - static void UnMarshall(const SECompartmentDataRequest& in, CDM::CompartmentDataRequestData& out); - //class SECompartmentSubstanceDataRequest; - static void Marshall(const CDM::CompartmentSubstanceDataRequestData& in, SESubstanceManager const& substances, SECompartmentSubstanceDataRequest& out); - static void UnMarshall(const SECompartmentSubstanceDataRequest& in, CDM::CompartmentSubstanceDataRequestData& out); - //class SEGasCompartmentDataRequest; - static void Marshall(const CDM::GasCompartmentDataRequestData& in, SESubstanceManager const& substances, SEGasCompartmentDataRequest& out); - static void UnMarshall(const SEGasCompartmentDataRequest& in, CDM::GasCompartmentDataRequestData& out); - //class SELiquidCompartmentDataRequest; - static void Marshall(const CDM::LiquidCompartmentDataRequestData& in, SESubstanceManager const& substances, SELiquidCompartmentDataRequest& out); - static void UnMarshall(const SELiquidCompartmentDataRequest& in, CDM::LiquidCompartmentDataRequestData& out); - //class SEThermalCompartmentDataRequest; - static void Marshall(const CDM::ThermalCompartmentDataRequestData& in, SEThermalCompartmentDataRequest& out); - static void UnMarshall(const SEThermalCompartmentDataRequest& in, CDM::ThermalCompartmentDataRequestData& out); - //class SETissueCompartmentDataRequest; - static void Marshall(const CDM::TissueCompartmentDataRequestData& in, SETissueCompartmentDataRequest& out); - static void UnMarshall(const SETissueCompartmentDataRequest& in, CDM::TissueCompartmentDataRequestData& out); - //class SESubstanceDataRequest; - static void Marshall(const CDM::SubstanceDataRequestData& in, SESubstanceManager const& substances, SESubstanceDataRequest& out); - static void UnMarshall(const SESubstanceDataRequest& in, CDM::SubstanceDataRequestData& out); - //class SEScenario; - static void Marshall(const CDM::ScenarioData& in, SEScenario& out); - static void UnMarshall(const SEScenario& in, CDM::ScenarioData& out); - //class SEScenarioInitialParameters; - static void Marshall(const CDM::ScenarioInitialParametersData& in, SEScenarioInitialParameters& out); - static void UnMarshall(const SEScenarioInitialParameters& in, CDM::ScenarioInitialParametersData& out); - //class SEScenarioAutoSerialization; - static void Marshall(const CDM::ScenarioAutoSerializationData& in, SEScenarioAutoSerialization& out); - static void UnMarshall(const SEScenarioAutoSerialization& in, CDM::ScenarioAutoSerializationData& out); - //class SEAdvanceTime; - static void Marshall(const CDM::AdvanceTimeData& in, SEAdvanceTime& out); - static void UnMarshall(const SEAdvanceTime& in, CDM::AdvanceTimeData& out); - //class SESerializeState; - static void Marshall(const CDM::SerializeStateData& in, SESerializeState& out); - static void UnMarshall(const SESerializeState& in, CDM::SerializeStateData& out); + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); - static std::unique_ptr factory(const CDM::DataRequestData& in, SESubstanceManager const& substances, SEDecimalFormat const* df = nullptr); + // class SEScenario; + static void UnMarshall(const CDM::ScenarioData& in, SEScenario& out); + static void Marshall(const SEScenario& in, CDM::ScenarioData& out); + static void Marshall(const SEScenario& in, CDM::ActionListData& out); + // class SEScenarioInitialParameters; + static void UnMarshall(const CDM::ScenarioInitialParametersData& in, SEScenarioInitialParameters& out); + static void Marshall(const SEScenarioInitialParameters& in, CDM::ScenarioInitialParametersData& out); + // class SEScenarioAutoSerialization; + static void UnMarshall(const CDM::ScenarioAutoSerializationData& in, SEScenarioAutoSerialization& out); + static void Marshall(const SEScenarioAutoSerialization& in, CDM::ScenarioAutoSerializationData& out); - static std::unique_ptr factory(const SEDataRequest* in); - static std::unique_ptr factory(const SEAction* in); }; //---------------------------------------------------------------------------------- template - void Scenario::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + void Scenario::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) { if (!option_in.present()) { - out.Clear(); + out.Invalidate(); } else { - Marshall(option_in.get(), out); + io::Scenario::UnMarshall(option_in.get(), out); } } //---------------------------------------------------------------------------------- template - void Scenario::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void Scenario::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); + io::Scenario::Marshall(in, *item); option_out.set(*item); } } diff --git a/projects/biogears/libBiogears/src/io/cdm/Substance.cpp b/projects/biogears/libBiogears/src/io/cdm/Substance.cpp index 41ea003fd..f4b3cb9fc 100644 --- a/projects/biogears/libBiogears/src/io/cdm/Substance.cpp +++ b/projects/biogears/libBiogears/src/io/cdm/Substance.cpp @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -20,128 +21,124 @@ namespace biogears { namespace io { // class SESubstanceAerosolization - void Substance::Marshall(const CDM::SubstanceAerosolizationData& in, SESubstanceAerosolization& out) + void Substance::UnMarshall(const CDM::SubstanceAerosolizationData& in, SESubstanceAerosolization& out) { - out.Clear(); - io::Property::Marshall(in.BronchioleModifier(), out.GetBronchioleModifier()); - io::Property::Marshall(in.InflammationCoefficient(), out.GetInflammationCoefficient()); - io::Property::Marshall(in.ParticulateSizeDistribution(), out.GetParticulateSizeDistribution()); + out.Invalidate(); + io::Property::UnMarshall(in.BronchioleModifier(), out.GetBronchioleModifier()); + io::Property::UnMarshall(in.InflammationCoefficient(), out.GetInflammationCoefficient()); + io::Property::UnMarshall(in.ParticulateSizeDistribution(), out.GetParticulateSizeDistribution()); } - void Substance::UnMarshall(const SESubstanceAerosolization& in, CDM::SubstanceAerosolizationData& out) + void Substance::Marshall(const SESubstanceAerosolization& in, CDM::SubstanceAerosolizationData& out) { - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, BronchioleModifier) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, InflammationCoefficient) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, ParticulateSizeDistribution) + CDM_PROPERTY_MARSHALL_HELPER(in, out, BronchioleModifier) + CDM_PROPERTY_MARSHALL_HELPER(in, out, InflammationCoefficient) + CDM_PROPERTY_MARSHALL_HELPER(in, out, ParticulateSizeDistribution) } //----------------------------------------------------------------------------- // class SESubstancePharmacokinetics - void Substance::Marshall(const CDM::SubstancePharmacokineticsData& in, SESubstancePharmacokinetics& out) + void Substance::UnMarshall(const CDM::SubstancePharmacokineticsData& in, SESubstancePharmacokinetics& out) { - out.Clear(); + out.Invalidate(); if (in.Physicochemicals().present()) { - Marshall(in.Physicochemicals(), out.GetPhysicochemicals()); + UnMarshall(in.Physicochemicals(), out.GetPhysicochemicals()); } - SESubstanceTissuePharmacokinetics* fx; - const CDM::SubstanceTissuePharmacokineticsData* fxData; for (unsigned int i = 0; i < in.TissueKinetics().size(); i++) { - fxData = &in.TissueKinetics().at(i); - fx = new SESubstanceTissuePharmacokinetics(fxData->Name(), out.GetLogger()); - Marshall(*fxData, *fx); - out.m_TissueKinetics[fx->GetName()] = (fx); + auto& fxData = in.TissueKinetics().at(i); + auto fx = std::make_unique(fxData.Name(), out.GetLogger()); + UnMarshall(fxData, *fx); + out.m_TissueKinetics[fx->GetName()] = fx.get(); + fx.release(); } } - void Substance::UnMarshall(const SESubstancePharmacokinetics& in, CDM::SubstancePharmacokineticsData& out) + void Substance::Marshall(const SESubstancePharmacokinetics& in, CDM::SubstancePharmacokineticsData& out) { - CDM_OPTIONAL_SUBSTANCE_UNMARSHAL_HELPER(in, out, Physicochemicals) + CDM_OPTIONAL_SUBSTANCE_PTR_MARSHALL_HELPER(in, out, Physicochemicals) for (auto itr : in.m_TissueKinetics) { auto tk_data = CDM::SubstanceTissuePharmacokineticsData(); - UnMarshall(*itr.second, tk_data); + Marshall(*itr.second, tk_data); out.TissueKinetics().push_back(tk_data); } } //----------------------------------------------------------------------------- // class SESubstancePhysicochemical - void Substance::Marshall(const CDM::SubstancePhysicochemicalData& in, SESubstancePhysicochemical& out) + void Substance::UnMarshall(const CDM::SubstancePhysicochemicalData& in, SESubstancePhysicochemical& out) { - out.Clear(); + out.Invalidate(); for (auto pKa : in.AcidDissociationConstant()) { - SEScalar* pKScalar = new SEScalar(); - pKScalar->Load(pKa); - out.m_AcidDissociationConstants.push_back(pKScalar); + out.m_AcidDissociationConstants.push_back(new SEScalar()); + io::Property::UnMarshall(pKa, *out.m_AcidDissociationConstants.back()); } - out.m_BindingProtein = in.BindingProtein(); - io::Property::Marshall(in.BloodPlasmaRatio(), out.GetBloodPlasmaRatio()); - io::Property::Marshall(in.FractionUnboundInPlasma(), out.GetFractionUnboundInPlasma()); - out.SetIonicState(in.IonicState()); - io::Property::Marshall(in.LogP(), out.GetLogP()); - io::Property::Marshall(in.HydrogenBondCount(), out.GetHydrogenBondCount()); - io::Property::Marshall(in.PolarSurfaceArea(), out.GetPolarSurfaceArea()); + UnMarshall(in.BindingProtein(), out.m_BindingProtein); + + io::Property::UnMarshall(in.BloodPlasmaRatio(), out.GetBloodPlasmaRatio()); + io::Property::UnMarshall(in.FractionUnboundInPlasma(), out.GetFractionUnboundInPlasma()); + + UnMarshall(in.IonicState(), out.m_IonicState); + + io::Property::UnMarshall(in.LogP(), out.GetLogP()); + io::Property::UnMarshall(in.HydrogenBondCount(), out.GetHydrogenBondCount()); + io::Property::UnMarshall(in.PolarSurfaceArea(), out.GetPolarSurfaceArea()); } - void Substance::UnMarshall(const SESubstancePhysicochemical& in, CDM::SubstancePhysicochemicalData& out) + void Substance::Marshall(const SESubstancePhysicochemical& in, CDM::SubstancePhysicochemicalData& out) { out.AcidDissociationConstant().clear(); for (auto pKa : in.m_AcidDissociationConstants) { out.AcidDissociationConstant().push_back(CDM::ScalarData()); - io::Property::UnMarshall(*pKa, out.AcidDissociationConstant().back()); + io::Property::Marshall(*pKa, out.AcidDissociationConstant().back()); } - if (in.HasBindingProtein()) { - out.BindingProtein(in.m_BindingProtein); - } + SE_SUBSTANCE_ENUM_PTR_MARSHALL_HELPER(in, out, BindingProtein) + SE_SUBSTANCE_ENUM_PTR_MARSHALL_HELPER(in, out, IonicState) - if (in.HasIonicState()) { - out.IonicState(in.m_IonicState); - } - - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, BloodPlasmaRatio) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, FractionUnboundInPlasma) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, LogP) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, HydrogenBondCount) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PolarSurfaceArea) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, BloodPlasmaRatio) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, FractionUnboundInPlasma) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, LogP) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, HydrogenBondCount) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PolarSurfaceArea) } //----------------------------------------------------------------------------- // class SESubstanceTissuePharmacokinetics - void Substance::Marshall(const CDM::SubstanceTissuePharmacokineticsData& in, SESubstanceTissuePharmacokinetics& out) + void Substance::UnMarshall(const CDM::SubstanceTissuePharmacokineticsData& in, SESubstanceTissuePharmacokinetics& out) { - out.Clear(); + out.Invalidate(); out.m_Name = in.Name(); - io::Property::Marshall(in.PartitionCoefficient(), out.GetPartitionCoefficient()); + io::Property::UnMarshall(in.PartitionCoefficient(), out.GetPartitionCoefficient()); } - void Substance::UnMarshall(const SESubstanceTissuePharmacokinetics& in, CDM::SubstanceTissuePharmacokineticsData& out) + void Substance::Marshall(const SESubstanceTissuePharmacokinetics& in, CDM::SubstanceTissuePharmacokineticsData& out) { out.Name(in.m_Name); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PartitionCoefficient) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PartitionCoefficient) } //----------------------------------------------------------------------------- // class SESubstancePharmacodynamics - void Substance::Marshall(const CDM::SubstancePharmacodynamicsData& in, SESubstancePharmacodynamics& out) - { - Marshall(in.Bronchodilation(), out.GetBronchodilation()); - Marshall(in.DiastolicPressureModifier(), out.GetDiastolicPressureModifier()); - - io::Property::Marshall(in.EMaxShapeParameter(), out.GetEMaxShapeParameter()); - - Marshall(in.FeverModifier(), out.GetFeverModifier()); - Marshall(in.HeartRateModifier(), out.GetHeartRateModifier()); - Marshall(in.HemorrhageModifier(), out.GetHemorrhageModifier()); - Marshall(in.NeuromuscularBlock(), out.GetNeuromuscularBlock()); - Marshall(in.PainModifier(), out.GetPainModifier()); - Marshall(in.PupilReactivityModifier(), out.GetPupilReactivityModifier()); - Marshall(in.PupilSizeModifier(), out.GetPupilSizeModifier()); - Marshall(in.RespirationRateModifier(), out.GetRespirationRateModifier()); - Marshall(in.Sedation(), out.GetSedation()); - Marshall(in.SystolicPressureModifier(), out.GetSystolicPressureModifier()); - Marshall(in.TidalVolumeModifier(), out.GetTidalVolumeModifier()); - Marshall(in.TubularPermeabilityModifier(), out.GetTubularPermeabilityModifier()); - Marshall(in.CentralNervousModifier(), out.GetCentralNervousModifier()); - - io::Property::Marshall(in.AntibacterialEffect(), out.GetAntibacterialEffect()); - io::Property::Marshall(in.EffectSiteRateConstant(), out.GetEffectSiteRateConstant()); + void Substance::UnMarshall(const CDM::SubstancePharmacodynamicsData& in, SESubstancePharmacodynamics& out) + { + UnMarshall(in.Bronchodilation(), out.GetBronchodilation()); + UnMarshall(in.CentralNervousModifier(), out.GetCentralNervousModifier()); + UnMarshall(in.DiastolicPressureModifier(), out.GetDiastolicPressureModifier()); + UnMarshall(in.FeverModifier(), out.GetFeverModifier()); + + + UnMarshall(in.HeartRateModifier(), out.GetHeartRateModifier()); + UnMarshall(in.HemorrhageModifier(), out.GetHemorrhageModifier()); + UnMarshall(in.NeuromuscularBlock(), out.GetNeuromuscularBlock()); + UnMarshall(in.PainModifier(), out.GetPainModifier()); + UnMarshall(in.PupilReactivityModifier(), out.GetPupilReactivityModifier()); + UnMarshall(in.PupilSizeModifier(), out.GetPupilSizeModifier()); + UnMarshall(in.RespirationRateModifier(), out.GetRespirationRateModifier()); + UnMarshall(in.Sedation(), out.GetSedation()); + UnMarshall(in.SystolicPressureModifier(), out.GetSystolicPressureModifier()); + UnMarshall(in.TidalVolumeModifier(), out.GetTidalVolumeModifier()); + UnMarshall(in.TubularPermeabilityModifier(), out.GetTubularPermeabilityModifier()); + + io::Property::UnMarshall(in.EMaxShapeParameter(), out.GetEMaxShapeParameter()); + io::Property::UnMarshall(in.AntibacterialEffect(), out.GetAntibacterialEffect()); + io::Property::UnMarshall(in.EffectSiteRateConstant(), out.GetEffectSiteRateConstant()); // Set up map (Antibiotic effect not added to modifier list because it is implemented different from other modifiers) out.m_Modifiers.clear(); @@ -161,392 +158,772 @@ namespace io { out.m_Modifiers["TidalVolume"] = out.m_TidalVolumeModifier; out.m_Modifiers["TubularPermeability"] = out.m_TubularPermeabilityModifier; } - void Substance::UnMarshall(const SESubstancePharmacodynamics& in, CDM::SubstancePharmacodynamicsData& out) - { - CDM_SUBSTANCE_UNMARSHAL_HELPER(in, out, Bronchodilation) - CDM_SUBSTANCE_UNMARSHAL_HELPER(in, out, DiastolicPressureModifier) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, EMaxShapeParameter) - CDM_SUBSTANCE_UNMARSHAL_HELPER(in, out, FeverModifier) - CDM_SUBSTANCE_UNMARSHAL_HELPER(in, out, HeartRateModifier) - CDM_SUBSTANCE_UNMARSHAL_HELPER(in, out, HemorrhageModifier) - CDM_SUBSTANCE_UNMARSHAL_HELPER(in, out, NeuromuscularBlock) - CDM_SUBSTANCE_UNMARSHAL_HELPER(in, out, PainModifier) - CDM_SUBSTANCE_UNMARSHAL_HELPER(in, out, PupilReactivityModifier) - CDM_SUBSTANCE_UNMARSHAL_HELPER(in, out, PupilSizeModifier) - CDM_SUBSTANCE_UNMARSHAL_HELPER(in, out, RespirationRateModifier) - CDM_SUBSTANCE_UNMARSHAL_HELPER(in, out, Sedation) - CDM_SUBSTANCE_UNMARSHAL_HELPER(in, out, SystolicPressureModifier) - CDM_SUBSTANCE_UNMARSHAL_HELPER(in, out, TidalVolumeModifier) - CDM_SUBSTANCE_UNMARSHAL_HELPER(in, out, TubularPermeabilityModifier) - CDM_SUBSTANCE_UNMARSHAL_HELPER(in, out, CentralNervousModifier) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, AntibacterialEffect) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, EffectSiteRateConstant) + void Substance::Marshall(const SESubstancePharmacodynamics& in, CDM::SubstancePharmacodynamicsData& out) + { + if (in.m_Bronchodilation && in.m_Bronchodilation->IsValid()) { + out.Bronchodilation(std::make_unique::type>()); + io::Substance::Marshall(*in.m_Bronchodilation, out.Bronchodilation()); + } + if (in.m_DiastolicPressureModifier && in.m_DiastolicPressureModifier->IsValid()) { + out.DiastolicPressureModifier(std::make_unique::type>()); + io::Substance::Marshall(*in.m_DiastolicPressureModifier, out.DiastolicPressureModifier()); + } + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, EMaxShapeParameter) + CDM_SUBSTANCE_PTR_MARSHALL_HELPER(in, out, FeverModifier) + CDM_SUBSTANCE_PTR_MARSHALL_HELPER(in, out, HeartRateModifier) + CDM_SUBSTANCE_PTR_MARSHALL_HELPER(in, out, HemorrhageModifier) + CDM_SUBSTANCE_PTR_MARSHALL_HELPER(in, out, NeuromuscularBlock) + CDM_SUBSTANCE_PTR_MARSHALL_HELPER(in, out, PainModifier) + CDM_SUBSTANCE_PTR_MARSHALL_HELPER(in, out, PupilReactivityModifier) + CDM_SUBSTANCE_PTR_MARSHALL_HELPER(in, out, PupilSizeModifier) + CDM_SUBSTANCE_PTR_MARSHALL_HELPER(in, out, RespirationRateModifier) + CDM_SUBSTANCE_PTR_MARSHALL_HELPER(in, out, Sedation) + CDM_SUBSTANCE_PTR_MARSHALL_HELPER(in, out, SystolicPressureModifier) + CDM_SUBSTANCE_PTR_MARSHALL_HELPER(in, out, TidalVolumeModifier) + CDM_SUBSTANCE_PTR_MARSHALL_HELPER(in, out, TubularPermeabilityModifier) + CDM_SUBSTANCE_PTR_MARSHALL_HELPER(in, out, CentralNervousModifier) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, AntibacterialEffect) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, EffectSiteRateConstant) } //----------------------------------------------------------------------------- // class SESubstanceClearance - void Substance::Marshall(const CDM::SubstanceClearanceData& in, SESubstanceClearance& out) + void Substance::UnMarshall(const CDM::SubstanceClearanceData& in, SESubstanceClearance& out) { - out.Clear(); + out.Invalidate(); // Make sure dups match - if (in.Systemic().present() - && in.RenalDynamics().present() - && in.RenalDynamics()->Clearance().present() - && in.Systemic().get().RenalClearance().value() != in.RenalDynamics()->Clearance().get().value()) { - throw CommonDataModelException("Multiple Renal Clearances specified, but not the same. These must match at this time."); - } - if (in.Systemic().present() - && in.RenalDynamics().present() - && in.RenalDynamics()->Regulation().present() - && in.Systemic().get().FractionUnboundInPlasma().value() != in.RenalDynamics()->Regulation().get().FractionUnboundInPlasma().value()) { - throw CommonDataModelException("Multiple FractionUnboundInPlasma values specified, but not the same. These must match at this time."); + if (in.Systemic().present() && in.RenalDynamics().present()) { + if (in.RenalDynamics()->Clearance().present() && in.Systemic().get().RenalClearance().value() != in.RenalDynamics()->Clearance().get().value()) { + out.Warning("Multiple Renal Clearances specified, but not the same. RenalDynamics will override Systemic."); + } + } + if (in.Systemic().present() && in.RenalDynamics().present()) { + if (in.RenalDynamics()->Regulation().present() && in.Systemic().get().FractionUnboundInPlasma().value() != in.RenalDynamics()->Regulation().get().FractionUnboundInPlasma().value()) { + out.Warning("Multiple FractionUnboundInPlasma values specified, but not the same. RenalDynamics will override Systemic."); + } } if (in.Systemic().present()) { out.SetSystemic(true); - io::Property::Marshall(in.Systemic().get().FractionExcretedInFeces(), out.GetFractionExcretedInFeces()); - io::Property::Marshall(in.Systemic().get().FractionExcretedInUrine(), out.GetFractionExcretedInUrine()); - io::Property::Marshall(in.Systemic().get().FractionMetabolizedInGut(), out.GetFractionMetabolizedInGut()); - io::Property::Marshall(in.Systemic().get().FractionUnboundInPlasma(), out.GetFractionUnboundInPlasma()); - io::Property::Marshall(in.Systemic().get().IntrinsicClearance(), out.GetIntrinsicClearance()); - io::Property::Marshall(in.Systemic().get().RenalClearance(), out.GetRenalClearance()); - io::Property::Marshall(in.Systemic().get().SystemicClearance(), out.GetSystemicClearance()); + io::Property::UnMarshall(in.Systemic().get().FractionExcretedInFeces(), out.GetFractionExcretedInFeces()); + io::Property::UnMarshall(in.Systemic().get().FractionExcretedInUrine(), out.GetFractionExcretedInUrine()); + io::Property::UnMarshall(in.Systemic().get().FractionMetabolizedInGut(), out.GetFractionMetabolizedInGut()); + io::Property::UnMarshall(in.Systemic().get().FractionUnboundInPlasma(), out.GetFractionUnboundInPlasma()); + io::Property::UnMarshall(in.Systemic().get().IntrinsicClearance(), out.GetIntrinsicClearance()); + io::Property::UnMarshall(in.Systemic().get().RenalClearance(), out.GetRenalClearance()); + io::Property::UnMarshall(in.Systemic().get().SystemicClearance(), out.GetSystemicClearance()); } if (in.RenalDynamics().present()) { if (in.RenalDynamics()->Regulation().present()) { - out.m_RenalDynamic = RenalDynamic::Regulation; - out.SetChargeInBlood(in.RenalDynamics()->Regulation().get().ChargeInBlood()); - io::Property::Marshall(in.RenalDynamics()->Regulation().get().FractionUnboundInPlasma(), out.GetFractionUnboundInPlasma()); - io::Property::Marshall(in.RenalDynamics()->Regulation().get().ReabsorptionRatio(), out.GetRenalReabsorptionRatio()); - io::Property::Marshall(in.RenalDynamics()->Regulation().get().TransportMaximum(), out.GetRenalTransportMaximum()); + out.m_def.RenalDynamic = RenalDynamicsType::Regulation; + + UnMarshall(in.RenalDynamics()->Regulation().get().ChargeInBlood(), out.m_def.ChargeInBlood); + + io::Property::UnMarshall(in.RenalDynamics()->Regulation().get().FractionUnboundInPlasma(), out.GetFractionUnboundInPlasma()); + io::Property::UnMarshall(in.RenalDynamics()->Regulation().get().ReabsorptionRatio(), out.GetRenalReabsorptionRatio()); + io::Property::UnMarshall(in.RenalDynamics()->Regulation().get().TransportMaximum(), out.GetRenalTransportMaximum()); } else if (in.RenalDynamics()->Clearance().present()) { - out.m_RenalDynamic = RenalDynamic::Clearance; - io::Property::Marshall(in.RenalDynamics()->Clearance(), out.GetRenalClearance()); + out.m_def.RenalDynamic = RenalDynamicsType::Clearance; + io::Property::UnMarshall(in.RenalDynamics()->Clearance(), out.GetRenalClearance()); } if (in.RenalDynamics()->FiltrationRate().present()) { - io::Property::Marshall(in.RenalDynamics()->FiltrationRate(), out.GetRenalFiltrationRate()); + io::Property::UnMarshall(in.RenalDynamics()->FiltrationRate(), out.GetRenalFiltrationRate()); } if (in.RenalDynamics()->GlomerularFilterability().present()) { - io::Property::Marshall(in.RenalDynamics()->GlomerularFilterability(), out.GetGlomerularFilterability()); + io::Property::UnMarshall(in.RenalDynamics()->GlomerularFilterability(), out.GetGlomerularFilterability()); } if (in.RenalDynamics()->ReabsorptionRate().present()) { - io::Property::Marshall(in.RenalDynamics()->ReabsorptionRate(), out.GetRenalReabsorptionRate()); + io::Property::UnMarshall(in.RenalDynamics()->ReabsorptionRate(), out.GetRenalReabsorptionRate()); } if (in.RenalDynamics()->ExcretionRate().present()) { - io::Property::Marshall(in.RenalDynamics()->ExcretionRate(), out.GetRenalExcretionRate()); + io::Property::UnMarshall(in.RenalDynamics()->ExcretionRate(), out.GetRenalExcretionRate()); } } if (in.CellRegulation().present()) { - out.m_hasCellular = true; - io::Property::Marshall(in.CellRegulation()->CellBirthRate(), out.GetCellBirthRate()); - io::Property::Marshall(in.CellRegulation()->CellDeathRate(), out.GetCellDeathRate()); + out.m_def.HasCellular = true; + io::Property::UnMarshall(in.CellRegulation()->CellBirthRate(), out.GetCellBirthRate()); + io::Property::UnMarshall(in.CellRegulation()->CellDeathRate(), out.GetCellDeathRate()); } } - void Substance::UnMarshall(const SESubstanceClearance& in, CDM::SubstanceClearanceData& out) + void Substance::Marshall(const SESubstanceClearance& in, CDM::SubstanceClearanceData& out) { if (in.HasSystemic()) { out.Systemic(std::make_unique()); auto& sys = out.Systemic().get(); - CDM_PROPERTY_UNMARSHAL_HELPER(in, sys, FractionExcretedInFeces) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, sys, FractionExcretedInUrine) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, sys, FractionMetabolizedInGut) - CDM_PROPERTY_UNMARSHAL_HELPER(in, sys, FractionUnboundInPlasma) - CDM_PROPERTY_UNMARSHAL_HELPER(in, sys, RenalClearance) - CDM_PROPERTY_UNMARSHAL_HELPER(in, sys, IntrinsicClearance) - CDM_PROPERTY_UNMARSHAL_HELPER(in, sys, SystemicClearance) + CDM_PROPERTY_MARSHALL_HELPER(in, sys, FractionExcretedInFeces) + CDM_OPTIONAL_PROPERTY_MARSHALL_HELPER(in, sys, FractionExcretedInUrine) + CDM_OPTIONAL_PROPERTY_MARSHALL_HELPER(in, sys, FractionMetabolizedInGut) + CDM_PROPERTY_MARSHALL_HELPER(in, sys, FractionUnboundInPlasma) + if (in.m_def.RenalClearance.IsValid()) { + sys.RenalClearance(std::make_unique::type>()); + io::Property::Marshall(in.m_def.RenalClearance, sys.RenalClearance()); + } + if (in.m_def.IntrinsicClearance.IsValid()) { + sys.IntrinsicClearance(std::make_unique::type>()); + io::Property::Marshall(in.m_def.IntrinsicClearance, sys.IntrinsicClearance()); + } + if (in.m_def.SystemicClearance.IsValid()) { + sys.SystemicClearance(std::make_unique::type>()); + io::Property::Marshall(in.m_def.SystemicClearance, sys.SystemicClearance()); + } } if (in.HasRenalDynamic()) { out.RenalDynamics(std::make_unique()); auto& rd = out.RenalDynamics().get(); - if (in.m_RenalDynamic == RenalDynamic::Clearance && in.HasRenalClearance()) { - io::Property::UnMarshall(*in.m_RenalClearance, rd.Clearance()); - } else if (in.m_RenalDynamic == RenalDynamic::Regulation) { + if (in.m_def.RenalDynamic == RenalDynamicsType::Clearance && in.HasRenalClearance()) { + io::Property::Marshall(in.m_def.RenalClearance, rd.Clearance()); + } else if (in.m_def.RenalDynamic == RenalDynamicsType::Regulation) { rd.Regulation(std::make_unique()); auto& rd_regulation = rd.Regulation().get(); if (in.HasChargeInBlood()) { - rd_regulation.ChargeInBlood(in.m_ChargeInBlood); + rd_regulation.ChargeInBlood(std::make_unique::type>()); + io::Substance::Marshall(in.m_def.ChargeInBlood, rd_regulation.ChargeInBlood()); } - if (in.m_FractionUnboundInPlasma && in.m_FractionUnboundInPlasma->IsValid()) { + if (in.m_FractionUnboundInPlasma.IsValid()) { out.RenalDynamics()->Regulation()->FractionUnboundInPlasma(std::make_uniqueRegulation()->FractionUnboundInPlasma())>::type>()); - io::Property::UnMarshall(*in.m_FractionUnboundInPlasma, out.RenalDynamics()->Regulation()->FractionUnboundInPlasma()); + io::Property::Marshall(in.m_FractionUnboundInPlasma, out.RenalDynamics()->Regulation()->FractionUnboundInPlasma()); } - if (in.m_RenalReabsorptionRatio && in.m_RenalReabsorptionRatio->IsValid()) { + if (in.m_def.RenalReabsorptionRatio.IsValid()) { rd_regulation.ReabsorptionRatio(std::make_unique::type>()); - io::Property::UnMarshall(*in.m_RenalReabsorptionRatio, rd_regulation.ReabsorptionRatio()); + io::Property::Marshall(in.m_def.RenalReabsorptionRatio, rd_regulation.ReabsorptionRatio()); } - if (in.m_RenalTransportMaximum && in.m_RenalTransportMaximum->IsValid()) { + if (in.m_def.RenalTransportMaximum.IsValid()) { rd_regulation.TransportMaximum(std::make_unique::type>()); - io::Property::UnMarshall(*in.m_RenalTransportMaximum, rd_regulation.TransportMaximum()); + io::Property::Marshall(in.m_def.RenalTransportMaximum, rd_regulation.TransportMaximum()); } } if (in.HasGlomerularFilterability()) { - io::Property::UnMarshall(*in.m_GlomerularFilterability, rd.GlomerularFilterability()); + io::Property::Marshall(in.m_def.GlomerularFilterability, rd.GlomerularFilterability()); } if (in.HasRenalFiltrationRate()) { - io::Property::UnMarshall(*in.m_RenalFiltrationRate, rd.FiltrationRate()); + io::Property::Marshall(in.m_def.RenalFiltrationRate, rd.FiltrationRate()); } if (in.HasRenalReabsorptionRate()) { - io::Property::UnMarshall(*in.m_RenalReabsorptionRate, rd.ReabsorptionRate()); + io::Property::Marshall(in.m_def.RenalReabsorptionRate, rd.ReabsorptionRate()); } if (in.HasRenalExcretionRate()) { - io::Property::UnMarshall(*in.m_RenalExcretionRate, rd.ExcretionRate()); + io::Property::Marshall(in.m_def.RenalExcretionRate, rd.ExcretionRate()); + } + if (in.m_def.GlomerularFilterability.IsValid()) { + io::Property::Marshall(in.m_def.GlomerularFilterability, rd.GlomerularFilterability()); } - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, rd, GlomerularFilterability) - if (in.m_RenalFiltrationRate && in.m_RenalFiltrationRate->IsValid()) { - io::Property::UnMarshall(*in.m_RenalFiltrationRate, rd.FiltrationRate()); + if (in.m_def.RenalFiltrationRate.IsValid()) { + io::Property::Marshall(in.m_def.RenalFiltrationRate, rd.FiltrationRate()); } - if (in.m_RenalExcretionRate && in.m_RenalExcretionRate->IsValid()) { - io::Property::UnMarshall(*in.m_RenalExcretionRate, rd.ReabsorptionRate()); + if (in.m_def.RenalExcretionRate.IsValid()) { + io::Property::Marshall(in.m_def.RenalExcretionRate, rd.ReabsorptionRate()); } - if (in.m_RenalExcretionRate && in.m_RenalExcretionRate->IsValid()) { - io::Property::UnMarshall(*in.m_RenalExcretionRate, rd.ExcretionRate()); + if (in.m_def.RenalExcretionRate.IsValid()) { + io::Property::Marshall(in.m_def.RenalExcretionRate, rd.ExcretionRate()); } } if (in.HasCellular()) { out.CellRegulation(std::make_unique()); auto& cell = out.CellRegulation().get(); - CDM_PROPERTY_UNMARSHAL_HELPER(in, cell, CellDeathRate) - CDM_PROPERTY_UNMARSHAL_HELPER(in, cell, CellBirthRate) + if (in.m_def.CellDeathRate.IsValid()) { + cell.CellDeathRate(std::make_unique::type>()); + io::Property::Marshall(in.m_def.CellDeathRate, cell.CellDeathRate()); + } + if (in.m_def.CellBirthRate.IsValid()) { + cell.CellBirthRate(std::make_unique::type>()); + io::Property::Marshall(in.m_def.CellBirthRate, cell.CellBirthRate()); + } } } //----------------------------------------------------------------------------- // class SESubstance - void Substance::Marshall(const CDM::SubstanceData& in, SESubstance& out) + void Substance::UnMarshall(const CDM::SubstanceData& in, SESubstance& out) { - out.Clear(); + out.Invalidate(); + out.m_def.Name = in.Name(); + + io::Substance::UnMarshall(in.State(), out.m_def.State); + io::Substance::UnMarshall(in.Classification(), out.m_def.Classification); + + io::Property::UnMarshall(in.Density(), out.GetDensity()); + io::Property::UnMarshall(in.MolarMass(), out.GetMolarMass()); + + io::Property::UnMarshall(in.MaximumDiffusionFlux(), out.GetMaximumDiffusionFlux()); + io::Property::UnMarshall(in.MichaelisCoefficient(), out.GetMichaelisCoefficient()); + io::Property::UnMarshall(in.MembraneResistance(), out.GetMembraneResistance()); + io::Property::UnMarshall(in.BloodConcentration(), out.GetBloodConcentration()); + io::Property::UnMarshall(in.MassInBody(), out.GetMassInBody()); + io::Property::UnMarshall(in.MassInBlood(), out.GetMassInBlood()); + io::Property::UnMarshall(in.MassInTissue(), out.GetMassInTissue()); + io::Property::UnMarshall(in.PlasmaConcentration(), out.GetPlasmaConcentration()); + io::Property::UnMarshall(in.EffectSiteConcentration(), out.GetEffectSiteConcentration()); + io::Property::UnMarshall(in.SystemicMassCleared(), out.GetSystemicMassCleared()); + io::Property::UnMarshall(in.TissueConcentration(), out.GetTissueConcentration()); + io::Property::UnMarshall(in.AlveolarTransfer(), out.GetAlveolarTransfer()); + io::Property::UnMarshall(in.DiffusingCapacity(), out.GetDiffusingCapacity()); + io::Property::UnMarshall(in.EndTidalFraction(), out.GetEndTidalFraction()); + io::Property::UnMarshall(in.EndTidalPressure(), out.GetEndTidalPressure()); + io::Property::UnMarshall(in.RelativeDiffusionCoefficient(), out.GetRelativeDiffusionCoefficient()); + io::Property::UnMarshall(in.SolubilityCoefficient(), out.GetSolubilityCoefficient()); + io::Property::UnMarshall(in.AreaUnderCurve(), out.GetAreaUnderCurve()); + + UnMarshall(in.Aerosolization(), out.GetAerosolization()); + UnMarshall(in.Clearance(), out.GetClearance()); + UnMarshall(in.Pharmacokinetics(), out.GetPK()); + UnMarshall(in.Pharmacodynamics(), out.GetPD()); + + if (out.HasClearance() && out.HasPK() && out.GetPK().HasPhysicochemicals() + && out.GetClearance().HasFractionUnboundInPlasma() + && !out.GetClearance().GetFractionUnboundInPlasma().Equals(out.GetPK().GetPhysicochemicals().GetFractionUnboundInPlasma())) { + + throw CommonDataModelException("Multiple FractionUnboundInPlasma values specified, but not the same. These must match at this time."); + } + } + void Substance::Marshall(const SESubstance& in, CDM::SubstanceData& out) + { + if (in.HasName()) { + out.Name(in.m_def.Name); + } else { + out.Name("Unknown Substance"); + } + + if (in.m_def.State != decltype(in.m_def.State)::Invalid) { + io::Substance::Marshall(in.m_def.State, out.State()); + } + if (in.m_def.Classification != decltype(in.m_def.Classification)::Invalid) { + io::Substance::Marshall(in.m_def.Classification, out.Classification()); + } + + if (in.m_def.Density.IsValid()) { + io::Property::Marshall(in.m_def.Density, out.Density()); + } + if (in.m_def.MolarMass.IsValid()) { + io::Property::Marshall(in.m_def.MolarMass, out.MolarMass()); + } + + if (in.m_def.MaximumDiffusionFlux.IsValid()) { + io::Property::Marshall(in.m_def.MaximumDiffusionFlux, out.MaximumDiffusionFlux()); + } + if (in.m_def.MichaelisCoefficient.IsValid()) { + io::Property::Marshall(in.m_def.MichaelisCoefficient, out.MichaelisCoefficient()); + } + if (in.m_def.MembraneResistance.IsValid()) { + io::Property::Marshall(in.m_def.MembraneResistance, out.MembraneResistance()); + } + + CDM_OPTIONAL_PROPERTY_MARSHALL_HELPER(in, out, BloodConcentration) + CDM_OPTIONAL_PROPERTY_MARSHALL_HELPER(in, out, MassInBody) + CDM_OPTIONAL_PROPERTY_MARSHALL_HELPER(in, out, MassInBlood) + CDM_OPTIONAL_PROPERTY_MARSHALL_HELPER(in, out, MassInTissue) + CDM_OPTIONAL_PROPERTY_MARSHALL_HELPER(in, out, PlasmaConcentration) + CDM_OPTIONAL_PROPERTY_MARSHALL_HELPER(in, out, EffectSiteConcentration) + CDM_OPTIONAL_PROPERTY_MARSHALL_HELPER(in, out, SystemicMassCleared) + CDM_OPTIONAL_PROPERTY_MARSHALL_HELPER(in, out, TissueConcentration) + if (in.m_def.AreaUnderCurve.IsValid()) { + io::Property::Marshall(in.m_def.AreaUnderCurve, out.AreaUnderCurve()); + } + + if (in.m_def.AlveolarTransfer.IsValid()) { + io::Property::Marshall(in.m_def.AlveolarTransfer, out.AlveolarTransfer()); + } + if (in.m_def.DiffusingCapacity.IsValid()) { + io::Property::Marshall(in.m_def.DiffusingCapacity, out.DiffusingCapacity()); + } + CDM_OPTIONAL_PROPERTY_MARSHALL_HELPER(in, out, EndTidalFraction) + CDM_OPTIONAL_PROPERTY_MARSHALL_HELPER(in, out, EndTidalPressure) + if (in.m_def.SolubilityCoefficient.IsValid()) { + io::Property::Marshall(in.m_def.SolubilityCoefficient, out.SolubilityCoefficient()); + } + if (in.m_def.RelativeDiffusionCoefficient.IsValid()) { + io::Property::Marshall(in.m_def.RelativeDiffusionCoefficient, out.RelativeDiffusionCoefficient()); + } + + if (in.m_def.Aerosolization.IsValid()) { + io::Substance::Marshall(in.m_def.Aerosolization, out.Aerosolization()); + } + CDM_OPTIONAL_SUBSTANCE_MARSHALL_HELPER(in, out, Clearance) + if (in.m_def.Pharmacokinetics.IsValid()) { + io::Substance::Marshall(in.m_def.Pharmacokinetics, out.Pharmacokinetics()); + } + if (in.m_def.Pharmacodynamics.IsValid()) { + io::Substance::Marshall(in.m_def.Pharmacodynamics, out.Pharmacodynamics()); + } + } + //----------------------------------------------------------------------------- + // class SESubstanceCompound + void Substance::UnMarshall(const CDM::SubstanceCompoundData& in, const SESubstanceManager& subMgr, SESubstanceCompound& out) + { + out.Invalidate(); out.m_Name = in.Name(); - if (in.State().present()) { - out.m_State = in.State().get(); + if (in.BloodRHFactor().present()) { + out.SetRhFactor(in.BloodRHFactor().get()); } + if (in.Classification().present()) { - out.m_Classification = in.Classification().get(); - } - - io::Property::Marshall(in.Density(), out.GetDensity()); - io::Property::Marshall(in.MolarMass(), out.GetMolarMass()); - - io::Property::Marshall(in.MaximumDiffusionFlux(), out.GetMaximumDiffusionFlux()); - io::Property::Marshall(in.MichaelisCoefficient(), out.GetMichaelisCoefficient()); - io::Property::Marshall(in.MembraneResistance(), out.GetMembraneResistance()); - io::Property::Marshall(in.BloodConcentration(), out.GetBloodConcentration()); - io::Property::Marshall(in.MassInBody(), out.GetMassInBody()); - io::Property::Marshall(in.MassInBlood(), out.GetMassInBlood()); - io::Property::Marshall(in.MassInTissue(), out.GetMassInTissue()); - io::Property::Marshall(in.PlasmaConcentration(), out.GetPlasmaConcentration()); - io::Property::Marshall(in.EffectSiteConcentration(), out.GetEffectSiteConcentration()); - io::Property::Marshall(in.SystemicMassCleared(), out.GetSystemicMassCleared()); - io::Property::Marshall(in.TissueConcentration(), out.GetTissueConcentration()); - io::Property::Marshall(in.AlveolarTransfer(), out.GetAlveolarTransfer()); - io::Property::Marshall(in.DiffusingCapacity(), out.GetDiffusingCapacity()); - io::Property::Marshall(in.EndTidalFraction(), out.GetEndTidalFraction()); - io::Property::Marshall(in.EndTidalPressure(), out.GetEndTidalPressure()); - io::Property::Marshall(in.RelativeDiffusionCoefficient(), out.GetRelativeDiffusionCoefficient()); - io::Property::Marshall(in.SolubilityCoefficient(), out.GetSolubilityCoefficient()); - io::Property::Marshall(in.AreaUnderCurve(), out.GetAreaUnderCurve()); - - Marshall(in.Aerosolization(), out.GetAerosolization()); - Marshall(in.Clearance(), out.GetClearance()); - Marshall(in.Pharmacokinetics(), out.GetPK()); - Marshall(in.Pharmacodynamics(), out.GetPD()); - - if (out.HasClearance() && out.HasPK() && out.GetPK().HasPhysicochemicals() - && out.GetClearance().HasFractionUnboundInPlasma() - && !out.GetClearance().GetFractionUnboundInPlasma().Equals(out.GetPK().GetPhysicochemicals().GetFractionUnboundInPlasma())) { - - throw CommonDataModelException("Multiple FractionUnboundInPlasma values specified, but not the same. These must match at this time."); - } + UnMarshall(in.Classification().get(), out.m_Classification); } - void Substance::UnMarshall(const SESubstance& in, CDM::SubstanceData& out) - { - if (in.HasName()) { - out.Name(in.m_Name); - } else { - out.Name("Unknown Substance"); - } - if (in.HasState()) { - out.State(in.m_State); - } - if (in.HasClassification()) { - out.Classification(in.m_Classification); - } - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Density) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MolarMass) - - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MaximumDiffusionFlux) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MichaelisCoefficient) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MembraneResistance) - - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, BloodConcentration) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MassInBody) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MassInBlood) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MassInTissue) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PlasmaConcentration) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, EffectSiteConcentration) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SystemicMassCleared) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, TissueConcentration) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, AreaUnderCurve) - - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, AlveolarTransfer) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, DiffusingCapacity) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, EndTidalFraction) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, EndTidalPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, SolubilityCoefficient) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, RelativeDiffusionCoefficient) - - CDM_OPTIONAL_SUBSTANCE_UNMARSHAL_HELPER(in, out, Aerosolization) - CDM_OPTIONAL_SUBSTANCE_UNMARSHAL_HELPER(in, out, Clearance) - CDM_OPTIONAL_SUBSTANCE_UNMARSHAL_HELPER(in, out, Pharmacokinetics) - CDM_OPTIONAL_SUBSTANCE_UNMARSHAL_HELPER(in, out, Pharmacodynamics) - } - //----------------------------------------------------------------------------- - // class SESubstanceCompound - void Substance::Marshall(const CDM::SubstanceCompoundData& in, const SESubstanceManager& subMgr, SESubstanceCompound& out) - { - out.Clear(); - out.m_Name = in.Name(); - - if (in.BloodRHFactor().present()) { - out.SetRhFactor(in.BloodRHFactor().get()); - } - if (in.Classification().present()) { - out.SetClassification(in.Classification().get()); - } + std::string err; + SESubstance* substance = nullptr; + SESubstanceConcentration* cc; - std::string err; - SESubstance* substance = nullptr; - SESubstanceConcentration* cc; - CDM::SubstanceConcentrationData* ccData; - for (unsigned int i = 0; i < in.Component().size(); i++) { - ccData = (CDM::SubstanceConcentrationData*)&in.Component().at(i); - substance = subMgr.GetSubstance(ccData->Name()); - if (substance == nullptr) { - /// \error Could not load find substance compound component for specified substance - err = "Could not load find substance compound component : "; - err += ccData->Name(); - throw CommonDataModelException(err); - } - cc = new SESubstanceConcentration(*substance); - Marshall(*ccData, *cc); - out.m_Components.push_back(*cc); + for (auto ccData : in.Component()) { + substance = subMgr.GetSubstance(ccData.Name()); + if (substance == nullptr) { + /// \error Could not load find substance compound component for specified substance + err = "Could not load find substance compound component : "; + err += ccData.Name(); + throw CommonDataModelException(err); } + SESubstanceConcentration concentration(substance->GetDefinition()); + UnMarshall(ccData, concentration); + out.m_Components.push_back( concentration); + } + } + void Substance::Marshall(const SESubstanceCompound& in, CDM::SubstanceCompoundData& out) + { + if (in.HasName()) { + out.Name(in.m_Name); } - void Substance::UnMarshall(const SESubstanceCompound& in, CDM::SubstanceCompoundData& out) - { - if (in.HasName()) { - out.Name(in.m_Name); - } - if (in.HasRhFactor()) { - out.BloodRHFactor(in.GetRhFactor()); - } + if (in.HasRhFactor()) { + out.BloodRHFactor(in.GetRhFactor()); + } + + SE_OPTIONAL_SUBSTANCE_ENUM_PTR_MARSHALL_HELPER(in, out, Classification) - CDM_ENUM_UNMARSHAL_HELPER(in, out, Classification) + std::vector m_Components; - std::vector m_Components; + for (unsigned int i = 0; i < in.m_Components.size(); i++) { + auto data = CDM::SubstanceConcentrationData(); + Marshall(in.m_Components.at(i), data); + out.Component().push_back(data); + } + } + //----------------------------------------------------------------------------- + // class SESubstanceFraction + void Substance::UnMarshall(const CDM::SubstanceFractionData& in, SESubstanceFraction& out) + { + io::Property::UnMarshall(in.FractionAmount(), out.GetFractionAmount()); + } + void Substance::Marshall(const SESubstanceFraction& in, CDM::SubstanceFractionData& out) + { + out.Name(in.m_Substance.GetName()); + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, FractionAmount) + } + //----------------------------------------------------------------------------- + // class SESubstanceConcentration + void Substance::UnMarshall(const CDM::SubstanceConcentrationData& in, SESubstanceConcentration& out) + { + out.Invalidate(); + io::Property::UnMarshall(in.Concentration(), out.GetConcentration()); + } + void Substance::Marshall(const SESubstanceConcentration& in, CDM::SubstanceConcentrationData& out) + { + out.Name(in.m_Substance.Name); - for (unsigned int i = 0; i < in.m_Components.size(); i++) { - auto data = CDM::SubstanceConcentrationData(); - UnMarshall(in.m_Components.at(i), data); - out.Component().push_back(data); + if (in.m_Concentration.IsValid()) { + out.Concentration(std::make_unique::type>()); + io::Property::Marshall(in.m_Concentration, out.Concentration()); + } + } + //----------------------------------------------------------------------------- + void Substance::UnMarshall(const CDM::PharmacodynamicModifierData& in, SEPharmacodynamicModifier& out) + { + io::Property::UnMarshall(in.EMax(), out.GetEMax()); + io::Property::UnMarshall(in.EC50(), out.GetEC50()); + } + void Substance::Marshall(const SEPharmacodynamicModifier& in, CDM::PharmacodynamicModifierData& out) + { + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, EMax) + CDM_PROPERTY_PTR_MARSHALL_HELPER(in, out, EC50) + } + //----------------------------------------------------------------------------- + template + void Copy(const SE& in, SE& out) + { + XSD data; + Substance::Marshall(in, data); + Substance::UnMarshall(data, out); + } + //----------------------------------------------------------------------------- + template + void Copy(const SE& in, const SESubstanceManager& subMgr, SE& out) + { + XSD data; + Substance::Marshall(in, data); + Substance::UnMarshall(data, subMgr, out); + } + //----------------------------------------------------------------------------- + void Substance::Copy(const SESubstanceClearance& in, SESubstanceClearance& out) + { + ::biogears::io::Copy(in, out); + } + //----------------------------------------------------------------------------- + void Substance::Copy(const SESubstance& in, SESubstance& out) + { + ::biogears::io::Copy(in, out); + } + //----------------------------------------------------------------------------- + void Substance::Copy(const SESubstanceCompound& in, const SESubstanceManager& subMgr, SESubstanceCompound& out) + { + ::biogears::io::Copy(in, subMgr, out); + CDM::SubstanceCompoundData data; + Substance::Marshall(in, data); + Substance::UnMarshall(data, subMgr, out); + } + //----------------------------------------------------------------------------- + void Substance::Copy(const SESubstanceFraction& in, SESubstanceFraction& out) + { + ::biogears::io::Copy(in, out); + } + //----------------------------------------------------------------------------- + void Substance::Copy(const SESubstanceConcentration& in, SESubstanceConcentration& out) + { + ::biogears::io::Copy(in, out); + } + //----------------------------------------------------------------------------- + // SESubstanceState + void Substance::UnMarshall(const CDM::enumSubstanceState& in, SESubstanceState& out) + { + try { + switch (in) { + case CDM::enumSubstanceState::Solid: + out = SESubstanceState::Solid; + break; + case CDM::enumSubstanceState::Liquid: + out = SESubstanceState::Liquid; + break; + case CDM::enumSubstanceState::Gas: + out = SESubstanceState::Gas; + break; + case CDM::enumSubstanceState::Molecular: + out = SESubstanceState::Molecular; + break; + default: + out = SESubstanceState::Invalid; + break; } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SESubstanceState::Invalid; } - //----------------------------------------------------------------------------- - // class SESubstanceFraction - void Substance::Marshall(const CDM::SubstanceFractionData& in, SESubstanceFraction& out) - { - io::Property::Marshall(in.FractionAmount(), out.GetFractionAmount()); - } - void Substance::UnMarshall(const SESubstanceFraction& in, CDM::SubstanceFractionData& out) - { - out.Name(in.m_Substance.GetName()); - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, FractionAmount) - } - //----------------------------------------------------------------------------- - // class SESubstanceConcentration - void Substance::Marshall(const CDM::SubstanceConcentrationData& in, SESubstanceConcentration& out) - { - out.Clear(); - io::Property::Marshall(in.Concentration(), out.GetConcentration()); - } - void Substance::UnMarshall(const SESubstanceConcentration& in, CDM::SubstanceConcentrationData& out) - { - out.Name(in.m_Substance->GetName()); - - if (in.m_Concentration.IsValid()) { - out.Concentration(std::make_unique::type>()); - io::Property::UnMarshall(in.m_Concentration, out.Concentration()); + } + void Substance::Marshall(const SESubstanceState& in, CDM::enumSubstanceState& out) + { + switch (in) { + case SESubstanceState::Solid: + out = CDM::enumSubstanceState::Solid; + break; + case SESubstanceState::Liquid: + out = CDM::enumSubstanceState::Liquid; + break; + case SESubstanceState::Gas: + out = CDM::enumSubstanceState::Gas; + break; + case SESubstanceState::Molecular: + out = CDM::enumSubstanceState::Molecular; + break; + default: + out = ""; + break; + } + } + // SESubstanceIonicState + void Substance::UnMarshall(const CDM::enumSubstanceIonicState& in, SESubstanceIonicState& out) + { + try { + switch (in) { + case CDM::enumSubstanceIonicState::WeakBase: + out = SESubstanceIonicState::WeakBase; + break; + case CDM::enumSubstanceIonicState::Base: + out = SESubstanceIonicState::Base; + break; + case CDM::enumSubstanceIonicState::Acid: + out = SESubstanceIonicState::Acid; + break; + case CDM::enumSubstanceIonicState::Neutral: + out = SESubstanceIonicState::Neutral; + break; + case CDM::enumSubstanceIonicState::Zwitterion: + out = SESubstanceIonicState::Zwitterion; + break; + default: + out = SESubstanceIonicState::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SESubstanceIonicState::Invalid; + } + } + void Substance::Marshall(const SESubstanceIonicState& in, CDM::enumSubstanceIonicState& out) + { + switch (in) { + case SESubstanceIonicState::WeakBase: + out = CDM::enumSubstanceIonicState::WeakBase; + break; + case SESubstanceIonicState::Base: + out = CDM::enumSubstanceIonicState::Base; + break; + case SESubstanceIonicState::Acid: + out = CDM::enumSubstanceIonicState::Acid; + break; + case SESubstanceIonicState::Neutral: + out = CDM::enumSubstanceIonicState::Neutral; + break; + case SESubstanceIonicState::Zwitterion: + out = CDM::enumSubstanceIonicState::Zwitterion; + break; + default: + out = ""; + break; + } + } + // SESubstanceBindingProtein + void Substance::UnMarshall(const CDM::enumSubstanceBindingProtein& in, SESubstanceBindingProtein& out) + { + try { + switch (in) { + case CDM::enumSubstanceBindingProtein::Albumin: + out = SESubstanceBindingProtein::Albumin; + break; + case CDM::enumSubstanceBindingProtein::Lipoprotein: + out = SESubstanceBindingProtein::Lipoprotein; + break; + case CDM::enumSubstanceBindingProtein::AAG: + out = SESubstanceBindingProtein::AAG; + break; + default: + out = SESubstanceBindingProtein::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SESubstanceBindingProtein::Invalid; + } + } + void Substance::Marshall(const SESubstanceBindingProtein& in, CDM::enumSubstanceBindingProtein& out) + { + switch (in) { + case SESubstanceBindingProtein::Albumin: + out = CDM::enumSubstanceBindingProtein::Albumin; + break; + case SESubstanceBindingProtein::Lipoprotein: + out = CDM::enumSubstanceBindingProtein::Lipoprotein; + break; + case SESubstanceBindingProtein::AAG: + out = CDM::enumSubstanceBindingProtein::AAG; + break; + default: + out = ""; + break; + } + } + // SECharge + void Substance::UnMarshall(const CDM::enumCharge& in, SECharge& out) + { + try { + switch (in) { + case CDM::enumCharge::Positive: + out = SECharge::Positive; + break; + case CDM::enumCharge::Neutral: + out = SECharge::Neutral; + break; + case CDM::enumCharge::Negative: + out = SECharge::Negative; + break; + default: + out = SECharge::Invalid; + break; } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SECharge::Invalid; } - //----------------------------------------------------------------------------- - void Substance::Marshall(const CDM::PharmacodynamicModifierData& in, SEPharmacodynamicModifier& out) - { - io::Property::Marshall(in.EMax(), out.GetEMax()); - io::Property::Marshall(in.EC50(), out.GetEC50()); - } - void Substance::UnMarshall(const SEPharmacodynamicModifier& in, CDM::PharmacodynamicModifierData& out) - { - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, EMax) - CDM_PROPERTY_UNMARSHAL_HELPER(in, out, EC50) - } - //----------------------------------------------------------------------------- - template - void Copy(const SE& in, SE& out) - { - XSD data; - Substance::UnMarshall(in, data); - Substance::Marshall(data, out); - } - //----------------------------------------------------------------------------- - template - void Copy(const SE& in, const SESubstanceManager& subMgr, SE& out) - { - XSD data; - Substance::UnMarshall(in, data); - Substance::Marshall(data, subMgr, out); - } - //----------------------------------------------------------------------------- - void Substance::Copy(const SESubstanceClearance& in, SESubstanceClearance& out) - { - ::biogears::io::Copy(in, out); - } - //----------------------------------------------------------------------------- - void Substance::Copy(const SESubstance& in, SESubstance& out) - { - ::biogears::io::Copy(in, out); - } - //----------------------------------------------------------------------------- - void Substance::Copy(const SESubstanceCompound& in, const SESubstanceManager& subMgr, SESubstanceCompound& out) - { - ::biogears::io::Copy(in, subMgr, out); - CDM::SubstanceCompoundData data; - Substance::UnMarshall(in, data); - Substance::Marshall(data, subMgr, out); - } - //----------------------------------------------------------------------------- - void Substance::Copy(const SESubstanceFraction& in, SESubstanceFraction& out) - { - ::biogears::io::Copy(in, out); - } - //----------------------------------------------------------------------------- - void Substance::Copy(const SESubstanceConcentration& in, SESubstanceConcentration& out) - { - ::biogears::io::Copy(in, out); - } - //----------------------------------------------------------------------------- - } -} \ No newline at end of file + } + void Substance::Marshall(const SECharge& in, CDM::enumCharge& out) + { + switch (in) { + case SECharge::Positive: + out = CDM::enumCharge::Positive; + break; + case SECharge::Neutral: + out = CDM::enumCharge::Neutral; + break; + case SECharge::Negative: + out = CDM::enumCharge::Negative; + break; + default: + out = ""; + break; + } + } + // SESubstanceClass + void Substance::UnMarshall(const CDM::enumSubstanceClass& in, SESubstanceClass& out) + { + try { + switch (in) { + case CDM::enumSubstanceClass::Anesthetic: + out = SESubstanceClass::Anesthetic; + break; + case CDM::enumSubstanceClass::Antibiotic: + out = SESubstanceClass::Antibiotic; + break; + case CDM::enumSubstanceClass::WholeBlood: + out = SESubstanceClass::WholeBlood; + break; + case CDM::enumSubstanceClass::Ion: + out = SESubstanceClass::Ion; + break; + case CDM::enumSubstanceClass::Opioid: + out = SESubstanceClass::Opioid; + break; + case CDM::enumSubstanceClass::ReversalAgent: + out = SESubstanceClass::ReversalAgent; + break; + case CDM::enumSubstanceClass::Sedative: + out = SESubstanceClass::Sedative; + break; + default: + out = SESubstanceClass::Invalid; + break; + } + } catch (xsd::cxx::tree::unexpected_enumerator) { + out = SESubstanceClass::Invalid; + } + } + void Substance::Marshall(const SESubstanceClass& in, CDM::enumSubstanceClass& out) + { + switch (in) { + case SESubstanceClass::Anesthetic: + out = CDM::enumSubstanceClass::Anesthetic; + break; + case SESubstanceClass::Antibiotic: + out = CDM::enumSubstanceClass::Antibiotic; + break; + case SESubstanceClass::WholeBlood: + out = CDM::enumSubstanceClass::WholeBlood; + break; + case SESubstanceClass::Ion: + out = CDM::enumSubstanceClass::Ion; + break; + case SESubstanceClass::Opioid: + out = CDM::enumSubstanceClass::Opioid; + break; + case SESubstanceClass::ReversalAgent: + out = CDM::enumSubstanceClass::ReversalAgent; + break; + case SESubstanceClass::Sedative: + out = CDM::enumSubstanceClass::Sedative; + break; + default: + out = ""; + break; + } + } + +} // Namespace IO + +// Operators +bool operator==(CDM::enumSubstanceState const& lhs, SESubstanceState const& rhs) +{ + switch (rhs) { + case SESubstanceState::Solid: + return (CDM::enumSubstanceState::Solid == lhs); + case SESubstanceState::Liquid: + return (CDM::enumSubstanceState::Liquid == lhs); + case SESubstanceState::Gas: + return (CDM::enumSubstanceState::Gas == lhs); + case SESubstanceState::Molecular: + return (CDM::enumSubstanceState::Molecular == lhs); + case SESubstanceState::Invalid: + return ((CDM::enumSubstanceState::value)-1 == lhs); + default: + return false; + } +} + +bool operator==(CDM::enumSubstanceIonicState const& lhs, SESubstanceIonicState const& rhs) +{ + switch (rhs) { + case SESubstanceIonicState::WeakBase: + return (CDM::enumSubstanceIonicState::WeakBase == lhs); + case SESubstanceIonicState::Base: + return (CDM::enumSubstanceIonicState::Base == lhs); + case SESubstanceIonicState::Acid: + return (CDM::enumSubstanceIonicState::Acid == lhs); + case SESubstanceIonicState::Neutral: + return (CDM::enumSubstanceIonicState::Neutral == lhs); + case SESubstanceIonicState::Zwitterion: + return (CDM::enumSubstanceIonicState::Zwitterion == lhs); + case SESubstanceIonicState::Invalid: + return ((CDM::enumSubstanceIonicState::value)-1 == lhs); + default: + return false; + } +} + +bool operator==(CDM::enumSubstanceBindingProtein const& lhs, SESubstanceBindingProtein const& rhs) +{ + switch (rhs) { + case SESubstanceBindingProtein::Albumin: + return (CDM::enumSubstanceBindingProtein::Albumin == lhs); + case SESubstanceBindingProtein::Lipoprotein: + return (CDM::enumSubstanceBindingProtein::Lipoprotein == lhs); + case SESubstanceBindingProtein::AAG: + return (CDM::enumSubstanceBindingProtein::AAG == lhs); + case SESubstanceBindingProtein::Invalid: + return ((CDM::enumSubstanceBindingProtein::value)-1 == lhs); + default: + return false; + } +} + +bool operator==(CDM::enumCharge const& lhs, SECharge const& rhs) +{ + switch (rhs) { + case SECharge::Positive: + return (CDM::enumCharge::Positive == lhs); + case SECharge::Neutral: + return (CDM::enumCharge::Neutral == lhs); + case SECharge::Negative: + return (CDM::enumCharge::Negative == lhs); + case SECharge::Invalid: + return ((CDM::enumCharge::value)-1 == lhs); + default: + return false; + } +} + +bool operator==(CDM::enumSubstanceClass const& lhs, SESubstanceClass const& rhs) +{ + switch (rhs) { + case SESubstanceClass::Anesthetic: + return (CDM::enumSubstanceClass::Anesthetic == lhs); + case SESubstanceClass::Antibiotic: + return (CDM::enumSubstanceClass::Antibiotic == lhs); + case SESubstanceClass::WholeBlood: + return (CDM::enumSubstanceClass::WholeBlood == lhs); + case SESubstanceClass::Ion: + return (CDM::enumSubstanceClass::Ion == lhs); + case SESubstanceClass::Opioid: + return (CDM::enumSubstanceClass::Opioid == lhs); + case SESubstanceClass::ReversalAgent: + return (CDM::enumSubstanceClass::ReversalAgent == lhs); + case SESubstanceClass::Sedative: + return (CDM::enumSubstanceClass::Sedative == lhs); + case SESubstanceClass::Invalid: + return ((CDM::enumSubstanceClass::value)-1 == lhs); + default: + return false; + } +} +} // Namespace Biogears diff --git a/projects/biogears/libBiogears/src/io/cdm/Substance.h b/projects/biogears/libBiogears/src/io/cdm/Substance.h index d3b439bfb..461e38e4d 100644 --- a/projects/biogears/libBiogears/src/io/cdm/Substance.h +++ b/projects/biogears/libBiogears/src/io/cdm/Substance.h @@ -12,23 +12,50 @@ specific language governing permissions and limitations under the License. #pragma once #include +#include #include "biogears/cdm/CommonDataModel.h" +#include #include #include -#define CDM_SUBSTANCE_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_SUBSTANCE_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func && in.m_##func->IsValid()) { \ out.func(std::make_unique::type>()); \ - io::Substance::UnMarshall(*in.m_##func, out.func()); \ + io::Substance::Marshall(*in.m_##func, out.func()); \ + } +#define CDM_SUBSTANCE_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func.IsValid()) { \ + out.func(std::make_unique::type>()); \ + io::Substance::Marshall(in.m_##func, out.func()); \ + } +#define CDM_OPTIONAL_SUBSTANCE_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func && in.m_##func->IsValid()) { \ + io::Substance::Marshall(*in.m_##func, out.func()); \ + } + +#define CDM_OPTIONAL_SUBSTANCE_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func.IsValid()) { \ + io::Substance::Marshall(in.m_##func, out.func()); \ + } +#define SE_SUBSTANCE_ENUM_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.Has##func()) { \ + out.func(std::make_unique::type>()); \ + io::Substance::Marshall(in.m_##func, out.func()); \ } -#define CDM_OPTIONAL_SUBSTANCE_UNMARSHAL_HELPER(in, out, func) \ - if (in.m_##func && in.m_##func->IsValid()) { \ - io::Substance::UnMarshall(*in.m_##func, out.func()); \ +#define SE_OPTIONAL_SUBSTANCE_ENUM_PTR_MARSHALL_HELPER(in, out, func) \ + if (in.m_##func != decltype(in.m_##func)::Invalid) { \ + io::Substance::Marshall(in.m_##func, out.func()); \ } +#define CDM_SUBSTANCE_COPY(type, in, out) \ + { \ + CDM::type##Data middle; \ + io::Substance::Marshall(in, middle); \ + io::Substance::UnMarshall(middle, out); \ + } namespace biogears { class SESubstanceManager; @@ -47,75 +74,171 @@ class SEPharmacodynamicModifier; namespace io { class BIOGEARS_PRIVATE_API Substance { public: - //Enums - //class enumSubstanceState; - //class enumSubstanceIonicState; - //class enumSubstanceBindingProtein; - //class enumCharge; - //class enumSubstanceClass; - //template option - template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); + // template option + template ::value>* = nullptr> + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); + template ::value>* = nullptr> + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); - //class SESubstanceAerosolization - static void Marshall(const CDM::SubstanceAerosolizationData& in, SESubstanceAerosolization& out); - static void UnMarshall(const SESubstanceAerosolization& in, CDM::SubstanceAerosolizationData& out); - //class SESubstancePharmacokinetics - static void Marshall(const CDM::SubstancePharmacokineticsData& in, SESubstancePharmacokinetics& out); - static void UnMarshall(const SESubstancePharmacokinetics& in, CDM::SubstancePharmacokineticsData& out); - //class SESubstancePhysicochemical - static void Marshall(const CDM::SubstancePhysicochemicalData& in, SESubstancePhysicochemical& out); - static void UnMarshall(const SESubstancePhysicochemical& in, CDM::SubstancePhysicochemicalData& out); - //class SESubstanceTissuePharmacokinetics - static void Marshall(const CDM::SubstanceTissuePharmacokineticsData& in, SESubstanceTissuePharmacokinetics& out); - static void UnMarshall(const SESubstanceTissuePharmacokinetics& in, CDM::SubstanceTissuePharmacokineticsData& out); - //class SESubstancePharmacodynamics - static void Marshall(const CDM::SubstancePharmacodynamicsData& in, SESubstancePharmacodynamics& out); - static void UnMarshall(const SESubstancePharmacodynamics& in, CDM::SubstancePharmacodynamicsData& out); - //class SESubstanceClearance - static void Marshall(const CDM::SubstanceClearanceData& in, SESubstanceClearance& out); - static void UnMarshall(const SESubstanceClearance& in, CDM::SubstanceClearanceData& out); - //class SESubstance - static void Marshall(const CDM::SubstanceData& in, SESubstance& out); - static void UnMarshall(const SESubstance& in, CDM::SubstanceData& out); - //class SESubstanceCompound - static void Marshall(const CDM::SubstanceCompoundData& in, const SESubstanceManager& subMgr, SESubstanceCompound& out); - static void UnMarshall(const SESubstanceCompound& in, CDM::SubstanceCompoundData& out); - //class SESubstanceFraction - static void Marshall(const CDM::SubstanceFractionData& in, SESubstanceFraction& out); - static void UnMarshall(const SESubstanceFraction& in, CDM::SubstanceFractionData& out); - //class SESubstanceConcentration - static void Marshall(const CDM::SubstanceConcentrationData& in, SESubstanceConcentration& out); - static void UnMarshall(const SESubstanceConcentration& in, CDM::SubstanceConcentrationData& out); - //class SEPharmacodynamicModifier - static void Marshall(const CDM::PharmacodynamicModifierData& in, SEPharmacodynamicModifier& out); - static void UnMarshall(const SEPharmacodynamicModifier& in, CDM::PharmacodynamicModifierData& out); + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); + + // class SESubstanceAerosolization + static void UnMarshall(const CDM::SubstanceAerosolizationData& in, SESubstanceAerosolization& out); + static void Marshall(const SESubstanceAerosolization& in, CDM::SubstanceAerosolizationData& out); + // class SESubstancePharmacokinetics + static void UnMarshall(const CDM::SubstancePharmacokineticsData& in, SESubstancePharmacokinetics& out); + static void Marshall(const SESubstancePharmacokinetics& in, CDM::SubstancePharmacokineticsData& out); + // class SESubstancePhysicochemical + static void UnMarshall(const CDM::SubstancePhysicochemicalData& in, SESubstancePhysicochemical& out); + static void Marshall(const SESubstancePhysicochemical& in, CDM::SubstancePhysicochemicalData& out); + // class SESubstanceTissuePharmacokinetics + static void UnMarshall(const CDM::SubstanceTissuePharmacokineticsData& in, SESubstanceTissuePharmacokinetics& out); + static void Marshall(const SESubstanceTissuePharmacokinetics& in, CDM::SubstanceTissuePharmacokineticsData& out); + // class SESubstancePharmacodynamics + static void UnMarshall(const CDM::SubstancePharmacodynamicsData& in, SESubstancePharmacodynamics& out); + static void Marshall(const SESubstancePharmacodynamics& in, CDM::SubstancePharmacodynamicsData& out); + // class SESubstanceClearance + static void UnMarshall(const CDM::SubstanceClearanceData& in, SESubstanceClearance& out); + static void Marshall(const SESubstanceClearance& in, CDM::SubstanceClearanceData& out); + // class SESubstance + static void UnMarshall(const CDM::SubstanceData& in, SESubstance& out); + static void Marshall(const SESubstance& in, CDM::SubstanceData& out); + // class SESubstanceCompound + static void UnMarshall(const CDM::SubstanceCompoundData& in, const SESubstanceManager& subMgr, SESubstanceCompound& out); + static void Marshall(const SESubstanceCompound& in, CDM::SubstanceCompoundData& out); + // class SESubstanceFraction + static void UnMarshall(const CDM::SubstanceFractionData& in, SESubstanceFraction& out); + static void Marshall(const SESubstanceFraction& in, CDM::SubstanceFractionData& out); + // class SESubstanceConcentration + static void UnMarshall(const CDM::SubstanceConcentrationData& in, SESubstanceConcentration& out); + static void Marshall(const SESubstanceConcentration& in, CDM::SubstanceConcentrationData& out); + // class SEPharmacodynamicModifier + static void UnMarshall(const CDM::PharmacodynamicModifierData& in, SEPharmacodynamicModifier& out); + static void Marshall(const SEPharmacodynamicModifier& in, CDM::PharmacodynamicModifierData& out); static void Copy(const SESubstanceClearance& in, SESubstanceClearance& out); static void Copy(const SESubstance& in, SESubstance& out); static void Copy(const SESubstanceCompound& in, const SESubstanceManager& subMgr, SESubstanceCompound& out); static void Copy(const SESubstanceFraction& in, SESubstanceFraction& out); static void Copy(const SESubstanceConcentration& in, SESubstanceConcentration& out); - }; + + // SESubstanceState + static void UnMarshall(const CDM::enumSubstanceState& in, SESubstanceState& out); + static void Marshall(const SESubstanceState& in, CDM::enumSubstanceState& out); + // SESubstanceIonicState + static void UnMarshall(const CDM::enumSubstanceIonicState& in, SESubstanceIonicState& out); + static void Marshall(const SESubstanceIonicState& in, CDM::enumSubstanceIonicState& out); + // SESubstanceBindingProtein + static void UnMarshall(const CDM::enumSubstanceBindingProtein& in, SESubstanceBindingProtein& out); + static void Marshall(const SESubstanceBindingProtein& in, CDM::enumSubstanceBindingProtein& out); + // SECharge + static void UnMarshall(const CDM::enumCharge& in, SECharge& out); + static void Marshall(const SECharge& in, CDM::enumCharge& out); + // SESubstanceClass + static void UnMarshall(const CDM::enumSubstanceClass& in, SESubstanceClass& out); + static void Marshall(const SESubstanceClass& in, CDM::enumSubstanceClass& out); + }; //---------------------------------------------------------------------------------- - template - void Substance::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + template ::value>*> + void Substance::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) + { + if (!option_in.present() || option_in->empty()) { + out = SE::Invalid; + } else { + io::Substance::UnMarshall(option_in.get(), out); + } + } + + template ::value>*> + void Substance::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) { if (!option_in.present()) { - out.Clear(); + out.Invalidate(); } else { - Marshall(option_in.get(), out); + io::Substance::UnMarshall(option_in.get(), out); } } - //---------------------------------------------------------------------------------- + template - void Substance::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void Substance::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); - option_out.set(*item); + io::Substance::Marshall(in, *item); + option_out.set(std::move(item)); } } // Namespace IO -} //Namespace Biogears + +// Operators +bool operator==(CDM::enumSubstanceState const& lhs, SESubstanceState const& rhs); +bool operator==(CDM::enumSubstanceIonicState const& lhs, SESubstanceIonicState const& rhs); +bool operator==(CDM::enumSubstanceBindingProtein const& lhs, SESubstanceBindingProtein const& rhs); +bool operator==(CDM::enumCharge const& lhs, SECharge const& rhs); +bool operator==(CDM::enumSubstanceClass const& lhs, SESubstanceClass const& rhs); + +inline bool operator==(SESubstanceState const& lhs, CDM::enumSubstanceState const& rhs) +{ + return rhs == lhs; +} +inline bool operator==(SESubstanceIonicState const& lhs, CDM::enumSubstanceIonicState const& rhs) +{ + return rhs == lhs; +} +inline bool operator==(SESubstanceBindingProtein const& lhs, CDM::enumSubstanceBindingProtein const& rhs) +{ + return rhs == lhs; +} +inline bool operator==(SECharge const& lhs, CDM::enumCharge const& rhs) +{ + return rhs == lhs; +} +inline bool operator==(SESubstanceClass const& lhs, CDM::enumSubstanceClass const& rhs) +{ + return rhs == lhs; +} + +inline bool operator!=(CDM::enumSubstanceState const& lhs, SESubstanceState const& rhs) +{ + return !(lhs == rhs); +} +inline bool operator!=(CDM::enumSubstanceIonicState const& lhs, SESubstanceIonicState const& rhs) +{ + return !(lhs == rhs); +} +inline bool operator!=(CDM::enumSubstanceBindingProtein const& lhs, SESubstanceBindingProtein const& rhs) +{ + return !(lhs == rhs); +} +inline bool operator!=(CDM::enumCharge const& lhs, SECharge const& rhs) +{ + return !(lhs == rhs); +} +inline bool operator!=(CDM::enumSubstanceClass const& lhs, SESubstanceClass const& rhs) +{ + return !(lhs == rhs); +} + +inline bool operator!=(SESubstanceState const& lhs, CDM::enumSubstanceState const& rhs) +{ + return !(rhs == lhs); +} +inline bool operator!=(SESubstanceIonicState const& lhs, CDM::enumSubstanceIonicState const& rhs) +{ + return !(rhs == lhs); +} +inline bool operator!=(SESubstanceBindingProtein const& lhs, CDM::enumSubstanceBindingProtein const& rhs) +{ + return !(rhs == lhs); +} +inline bool operator!=(SECharge const& lhs, CDM::enumCharge const& rhs) +{ + return !(rhs == lhs); +} +inline bool operator!=(SESubstanceClass const& lhs, CDM::enumSubstanceClass const& rhs) +{ + return !(rhs == lhs); +} + +// Operators + +} // Namespace Biogears diff --git a/projects/biogears/libBiogears/src/io/cdm/SubstanceQuantity.cpp b/projects/biogears/libBiogears/src/io/cdm/SubstanceQuantity.cpp index db57d6642..6f498e05a 100644 --- a/projects/biogears/libBiogears/src/io/cdm/SubstanceQuantity.cpp +++ b/projects/biogears/libBiogears/src/io/cdm/SubstanceQuantity.cpp @@ -12,64 +12,68 @@ namespace biogears { namespace io { // class SESubstanceQuantity - void SubstanceQuantity::Marshall(const CDM::SubstanceQuantityData& in, SESubstanceQuantity& out) + void SubstanceQuantity::UnMarshall(const CDM::SubstanceQuantityData& in, SESubstanceQuantity& out) { - out.Clear(); + out.Invalidate(); } //----------------------------------------------------------------------------- - void SubstanceQuantity::UnMarshall(const SESubstanceQuantity& in, CDM::SubstanceQuantityData& out) + void SubstanceQuantity::Marshall(const SESubstanceQuantity& in, CDM::SubstanceQuantityData& out) { out.Substance(in.m_Substance.GetName()); } // class SEGasSubstanceQuantity - void SubstanceQuantity::Marshall(const CDM::GasSubstanceQuantityData& in, SEGasSubstanceQuantity& out) + void SubstanceQuantity::UnMarshall(const CDM::GasSubstanceQuantityData& in, SEGasSubstanceQuantity& out) { - Marshall(static_cast(in), static_cast(out)); + UnMarshall(static_cast(in), static_cast(out)); if (!out.m_Compartment.HasChildren()) { - io::Property::Marshall(in.PartialPressure(), out.GetPartialPressure()); - io::Property::Marshall(in.Volume(), out.GetVolume()); - io::Property::Marshall(in.VolumeFraction(), out.GetVolumeFraction()); + io::Property::UnMarshall(in.PartialPressure(), out.GetPartialPressure()); + io::Property::UnMarshall(in.Volume(), out.GetVolume()); + io::Property::UnMarshall(in.VolumeFraction(), out.GetVolumeFraction()); } } //----------------------------------------------------------------------------- - void SubstanceQuantity::UnMarshall(SEGasSubstanceQuantity& in, CDM::GasSubstanceQuantityData& out) + void SubstanceQuantity::Marshall(SEGasSubstanceQuantity& in, CDM::GasSubstanceQuantityData& out) { - UnMarshall(static_cast(in), static_cast(out)); + Marshall(static_cast(in), static_cast(out)); // Even if you have children, I am unloading everything, this makes the xml actually usefull... - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PartialPressure) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Volume) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, VolumeFraction) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PartialPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Volume) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, VolumeFraction) } //----------------------------------------------------------------------------- // class SELiquidSubstanceQuantity - void SubstanceQuantity::Marshall(const CDM::LiquidSubstanceQuantityData& in, SELiquidSubstanceQuantity& out) + void SubstanceQuantity::UnMarshall(const CDM::LiquidSubstanceQuantityData& in, SELiquidSubstanceQuantity& out) { - Marshall(static_cast(in), static_cast(out)); + UnMarshall(static_cast(in), static_cast(out)); if (!out.m_Compartment.HasChildren()) { - io::Property::Marshall(in.Concentration(), out.GetConcentration()); - io::Property::Marshall(in.Mass(), out.GetMass()); - io::Property::Marshall(in.MassCleared(), out.GetMassCleared()); - io::Property::Marshall(in.MassDeposited(), out.GetMassDeposited()); - io::Property::Marshall(in.MassExcreted(), out.GetMassExcreted()); - io::Property::Marshall(in.Molarity(), out.GetMolarity()); - io::Property::Marshall(in.Saturation(), out.GetSaturation()); - io::Property::Marshall(in.PartialPressure(), out.GetPartialPressure()); + io::Property::UnMarshall(in.Concentration(), out.GetConcentration()); + io::Property::UnMarshall(in.Mass(), out.GetMass()); + io::Property::UnMarshall(in.MassCleared(), out.GetMassCleared()); + io::Property::UnMarshall(in.MassDeposited(), out.GetMassDeposited()); + io::Property::UnMarshall(in.MassExcreted(), out.GetMassExcreted()); + io::Property::UnMarshall(in.Molarity(), out.GetMolarity()); + if (out.m_isO2 || out.m_isCO2 || out.m_isCO) { + io::Property::UnMarshall(in.Saturation(), out.GetSaturation()); + } + io::Property::UnMarshall(in.PartialPressure(), out.GetPartialPressure()); } } //----------------------------------------------------------------------------- - void SubstanceQuantity::UnMarshall(SELiquidSubstanceQuantity& in, CDM::LiquidSubstanceQuantityData& out) + void SubstanceQuantity::Marshall(SELiquidSubstanceQuantity& in, CDM::LiquidSubstanceQuantityData& out) { - UnMarshall(static_cast(in), static_cast(out)); + Marshall(static_cast(in), static_cast(out)); // Even if you have children, I am unloading everything, this makes the xml actually usefull... - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Concentration) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Mass) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MassCleared) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MassDeposited) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, MassExcreted) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Molarity) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, Saturation) - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PartialPressure) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Concentration) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Mass) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MassCleared) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MassDeposited) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, MassExcreted) + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Molarity) + if (in.m_isO2 || in.m_isCO2 || in.m_isCO) { + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, Saturation) + } + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PartialPressure) } } } \ No newline at end of file diff --git a/projects/biogears/libBiogears/src/io/cdm/SubstanceQuantity.h b/projects/biogears/libBiogears/src/io/cdm/SubstanceQuantity.h index b78306f43..d1a5dc464 100644 --- a/projects/biogears/libBiogears/src/io/cdm/SubstanceQuantity.h +++ b/projects/biogears/libBiogears/src/io/cdm/SubstanceQuantity.h @@ -18,15 +18,15 @@ specific language governing permissions and limitations under the License. #include -#define CDM_SUBSTANCE_QUANTITY_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_SUBSTANCE_QUANTITY_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ out.func(std::make_unique::type>()); \ - io::SubstanceQuantity::UnMarshall(*in.m_##func, out.func()); \ + io::SubstanceQuantity::Marshall(*in.m_##func, out.func()); \ } -#define CDM_OPTIONAL_SUBSTANCE_QUANTITY_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_OPTIONAL_SUBSTANCE_QUANTITY_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ - io::SubstanceQuantity::UnMarshall(*in.m_##func, out.func()); \ + io::SubstanceQuantity::Marshall(*in.m_##func, out.func()); \ } namespace biogears { @@ -40,35 +40,35 @@ namespace io { public: //template option template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); //class SESubstanceQuantity - static void Marshall(const CDM::SubstanceQuantityData& in, SESubstanceQuantity& out); - static void UnMarshall(const SESubstanceQuantity& in, CDM::SubstanceQuantityData& out); + static void UnMarshall(const CDM::SubstanceQuantityData& in, SESubstanceQuantity& out); + static void Marshall(const SESubstanceQuantity& in, CDM::SubstanceQuantityData& out); //class SEGasSubstanceQuantity - static void Marshall(const CDM::GasSubstanceQuantityData& in, SEGasSubstanceQuantity& out); - static void UnMarshall(SEGasSubstanceQuantity& in, CDM::GasSubstanceQuantityData& out); + static void UnMarshall(const CDM::GasSubstanceQuantityData& in, SEGasSubstanceQuantity& out); + static void Marshall(SEGasSubstanceQuantity& in, CDM::GasSubstanceQuantityData& out); //class SELiquidSubstanceQuantity - static void Marshall(const CDM::LiquidSubstanceQuantityData& in, SELiquidSubstanceQuantity& out); - static void UnMarshall(SELiquidSubstanceQuantity& in, CDM::LiquidSubstanceQuantityData& out); + static void UnMarshall(const CDM::LiquidSubstanceQuantityData& in, SELiquidSubstanceQuantity& out); + static void Marshall(SELiquidSubstanceQuantity& in, CDM::LiquidSubstanceQuantityData& out); }; //---------------------------------------------------------------------------------- template - void SubstanceQuantity::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + void SubstanceQuantity::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) { if (!option_in.present()) { - out.Invalidate(); + out.MakeInvalid(); } else { - Marshall(option_in.get(), out); + UnMarshall(option_in.get(), out); } } //---------------------------------------------------------------------------------- template - void SubstanceQuantity::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void SubstanceQuantity::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); + Marshall(in, *item); option_out.set(*item); } } // Namespace IO diff --git a/projects/biogears/libBiogears/src/io/cdm/System.cpp b/projects/biogears/libBiogears/src/io/cdm/System.cpp index 79bcba12e..d3ca7408e 100644 --- a/projects/biogears/libBiogears/src/io/cdm/System.cpp +++ b/projects/biogears/libBiogears/src/io/cdm/System.cpp @@ -4,13 +4,13 @@ namespace biogears { namespace io { - //class SESystem - void System::Marshall(const CDM::SystemData& in, SESystem& out) + // class SESystem + void System::UnMarshall(const CDM::SystemData& in, SESystem& out) { - out.Clear(); + out.Invalidate(); } //----------------------------------------------------------------------------- - void System::UnMarshall(const SESystem& in, CDM::SystemData& out) + void System::Marshall(const SESystem& in, CDM::SystemData& out) { } //----------------------------------------------------------------------------- diff --git a/projects/biogears/libBiogears/src/io/cdm/System.h b/projects/biogears/libBiogears/src/io/cdm/System.h index 34593d771..27e02ec82 100644 --- a/projects/biogears/libBiogears/src/io/cdm/System.h +++ b/projects/biogears/libBiogears/src/io/cdm/System.h @@ -18,15 +18,15 @@ specific language governing permissions and limitations under the License. #include -#define CDM_SYSTEM_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_SYSTEM_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ out.func(std::make_unique::type>()); \ - io::System::UnMarshall(*in.m_##func, out.func()); \ + io::System::Marshall(*in.m_##func, out.func()); \ } -#define CDM_OPTIONAL_SYSTEM_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_OPTIONAL_SYSTEM_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ - io::System::UnMarshall(*in.m_##func, out.func()); \ + io::System::Marshall(*in.m_##func, out.func()); \ } namespace biogears { @@ -36,29 +36,29 @@ namespace io { public: //template option template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); //class SESystem - static void Marshall(const CDM::SystemData& in, SESystem& out); - static void UnMarshall(const SESystem& in, CDM::SystemData& out); + static void UnMarshall(const CDM::SystemData& in, SESystem& out); + static void Marshall(const SESystem& in, CDM::SystemData& out); }; //---------------------------------------------------------------------------------- template - void System::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + void System::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) { if (!option_in.present()) { - out.Invalidate(); + out.MakeInvalid(); } else { - Marshall(option_in.get(), out); + UnMarshall(option_in.get(), out); } } //---------------------------------------------------------------------------------- template - void System::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void System::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); + Marshall(in, *item); option_out.set(*item); } } // Namespace IO diff --git a/projects/biogears/libBiogears/src/io/cdm/TestReport.cpp b/projects/biogears/libBiogears/src/io/cdm/TestReport.cpp index ddb291c5c..d5707974b 100644 --- a/projects/biogears/libBiogears/src/io/cdm/TestReport.cpp +++ b/projects/biogears/libBiogears/src/io/cdm/TestReport.cpp @@ -1,3 +1,4 @@ + #include "TestReport.h" #include "Property.h" @@ -13,7 +14,7 @@ namespace biogears { namespace io { // class SETestErrorStatistics - void TestReport::Marshall(const CDM::TestErrorStatisticsData& in, SETestErrorStatistics& out) + void TestReport::UnMarshall(const CDM::TestErrorStatisticsData& in, SETestErrorStatistics& out) { out.Reset(); out.m_MinimumError = in.MinimumError().get(); @@ -34,14 +35,14 @@ namespace io { out.m_PercentTolerance = in.PercentTolerance(); out.m_PropertyName = in.PropertyName(); - io::Property::Marshall(in.PercentToleranceVsNumErrors(), out.GetPercentToleranceVsNumErrors()); + io::Property::UnMarshall(in.PercentToleranceVsNumErrors(), out.GetPercentToleranceVsNumErrors()); if (!out.IsValid()) { throw CommonDataModelException("Unable to Marhsall SETestErrorStatistics from the given TestErrorStatisticsData"); } } //----------------------------------------------------------------------------- - void TestReport::UnMarshall(const SETestErrorStatistics& in, CDM::TestErrorStatisticsData& out) + void TestReport::Marshall(const SETestErrorStatistics& in, CDM::TestErrorStatisticsData& out) { if (!std::isnan(in.m_MinimumError)) { out.MinimumError(in.m_MinimumError); @@ -71,11 +72,11 @@ namespace io { out.PercentTolerance(in.m_PercentTolerance); out.PropertyName(in.m_PropertyName); - CDM_OPTIONAL_PROPERTY_UNMARSHAL_HELPER(in, out, PercentToleranceVsNumErrors); + CDM_OPTIONAL_PROPERTY_PTR_MARSHALL_HELPER(in, out, PercentToleranceVsNumErrors); } //----------------------------------------------------------------------------- // class SETestReport - void TestReport::Marshall(const CDM::TestReportData& in, SETestReport& out) + void TestReport::UnMarshall(const CDM::TestReportData& in, SETestReport& out) { out.Reset(); @@ -85,23 +86,23 @@ namespace io { sData = (CDM::TestSuiteData*)&in.TestSuite().at(i); if (sData != nullptr) { sx = new SETestSuite(out.GetLogger()); - Marshall(*sData, *sx); + UnMarshall(*sData, *sx); } out.m_testSuite.push_back(sx); } } //----------------------------------------------------------------------------- - void TestReport::UnMarshall(const SETestReport& in, CDM::TestReportData& out) + void TestReport::Marshall(const SETestReport& in, CDM::TestReportData& out) { for (unsigned int i = 0; i < in.m_testSuite.size(); i++) { auto data = CDM::TestSuiteData(); - UnMarshall(*in.m_testSuite.at(i), data); + Marshall(*in.m_testSuite.at(i), data); out.TestSuite().push_back(data); } } //----------------------------------------------------------------------------- // class SETestSuite - void TestReport::Marshall(const CDM::TestSuiteData& in, SETestSuite& out) + void TestReport::UnMarshall(const CDM::TestSuiteData& in, SETestSuite& out) { out.Reset(); out.m_Performed = in.Performed(); @@ -121,7 +122,7 @@ namespace io { eData = (CDM::TestErrorStatisticsData*)&in.SuiteEqualError().at(i); if (eData != nullptr) { ex = new SETestErrorStatistics(out.GetLogger()); - TestReport::Marshall(*eData, *ex); + TestReport::UnMarshall(*eData, *ex); } out.m_SuiteEqualError.push_back(ex); } @@ -132,13 +133,13 @@ namespace io { tData = (CDM::TestCaseData*)&in.TestCase().at(i); if (tData != nullptr) { tx = new SETestCase(out.m_Name, out.GetLogger()); - Marshall(*tData, *tx); + UnMarshall(*tData, *tx); } out.m_TestCase.push_back(tx); } } //----------------------------------------------------------------------------- - void TestReport::UnMarshall(const SETestSuite& in, CDM::TestSuiteData& out) + void TestReport::Marshall(const SETestSuite& in, CDM::TestSuiteData& out) { std::string sData; for (unsigned int i = 0; i < in.m_Requirements.size(); i++) { @@ -148,12 +149,12 @@ namespace io { } for (unsigned int i = 0; i < in.m_SuiteEqualError.size(); i++) { auto tesData = CDM::TestErrorStatisticsData(); - UnMarshall(*in.m_SuiteEqualError.at(i), tesData); + Marshall(*in.m_SuiteEqualError.at(i), tesData); out.SuiteEqualError().push_back(tesData); } for (unsigned int i = 0; i < in.m_TestCase.size(); i++) { auto data = CDM::TestCaseData(); - UnMarshall(*in.m_TestCase.at(i), data); + Marshall(*in.m_TestCase.at(i), data); out.TestCase().push_back(data); } @@ -165,7 +166,7 @@ namespace io { out.Tests(in.GetNumberOfTests()); if (in.m_Duration.IsValid()) { - io::Property::UnMarshall(in.m_Duration, out.Duration()); + io::Property::Marshall(in.m_Duration, out.Duration()); } out.Errors(in.GetNumberOfErrors()); } @@ -174,7 +175,7 @@ namespace io { } //----------------------------------------------------------------------------- // class SETestCase - void TestReport::Marshall(const CDM::TestCaseData& in, SETestCase& out) + void TestReport::UnMarshall(const CDM::TestCaseData& in, SETestCase& out) { SETestErrorStatistics* ex; CDM::TestErrorStatisticsData* eData; @@ -183,13 +184,13 @@ namespace io { out.m_Name = in.Name(); - io::Property::Marshall(in.Duration(), out.GetDuration()); + io::Property::UnMarshall(in.Duration(), out.GetDuration()); for (unsigned int i = 0; i < in.CaseEqualError().size(); i++) { eData = (CDM::TestErrorStatisticsData*)&in.CaseEqualError().at(i); if (eData != nullptr) { ex = new SETestErrorStatistics(out.GetLogger()); - Marshall(*eData, *ex); + UnMarshall(*eData, *ex); out.m_CaseEqualsErrors.push_back(ex); } } @@ -199,7 +200,7 @@ namespace io { } } //----------------------------------------------------------------------------- - void TestReport::UnMarshall(const SETestCase& in, CDM::TestCaseData& out) + void TestReport::Marshall(const SETestCase& in, CDM::TestCaseData& out) { out.Name(in.m_Name); @@ -208,7 +209,7 @@ namespace io { out.Duration().value(0); out.Duration().unit("s"); if (in.m_Duration.IsValid()) { - io::Property::UnMarshall(in.m_Duration, out.Duration()); + io::Property::Marshall(in.m_Duration, out.Duration()); } for (unsigned int i = 0; i < in.m_Failure.size(); i++) { @@ -217,7 +218,7 @@ namespace io { for (unsigned int i = 0; i < in.m_CaseEqualsErrors.size(); i++) { auto data = std::make_unique(); - UnMarshall(*in.m_CaseEqualsErrors.at(i), *data); + Marshall(*in.m_CaseEqualsErrors.at(i), *data); out.CaseEqualError().push_back(std::move(data)); } } diff --git a/projects/biogears/libBiogears/src/io/cdm/TestReport.h b/projects/biogears/libBiogears/src/io/cdm/TestReport.h index c4b666afc..7abf2756f 100644 --- a/projects/biogears/libBiogears/src/io/cdm/TestReport.h +++ b/projects/biogears/libBiogears/src/io/cdm/TestReport.h @@ -18,15 +18,15 @@ specific language governing permissions and limitations under the License. #include -#define CDM_TEST_REPORT_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_TEST_REPORT_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ out.func(std::make_unique::type>()); \ - io::TestReport::UnMarshall(*in.m_##func, out.func()); \ + io::TestReport::Marshall(*in.m_##func, out.func()); \ } -#define CDM_OPTIONAL_TEST_REPORT_UNMARSHAL_HELPER(in, out, func) \ +#define CDM_OPTIONAL_TEST_REPORT_PTR_MARSHALL_HELPER(in, out, func) \ if (in.m_##func) { \ - io::TestReport::UnMarshall(*in.m_##func, out.func()); \ + io::TestReport::Marshall(*in.m_##func, out.func()); \ } namespace biogears { @@ -40,38 +40,38 @@ namespace io { public: //template option template - static void Marshall(xsd::cxx::tree::optional const& option_in, SE& out); + static void UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out); template - static void UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out); + static void Marshall(const SE& in, xsd::cxx::tree::optional& option_out); //class SETestErrorStatistics - static void Marshall(const CDM::TestErrorStatisticsData& in, SETestErrorStatistics& out); - static void UnMarshall(const SETestErrorStatistics& in, CDM::TestErrorStatisticsData& out); + static void UnMarshall(const CDM::TestErrorStatisticsData& in, SETestErrorStatistics& out); + static void Marshall(const SETestErrorStatistics& in, CDM::TestErrorStatisticsData& out); //class SETestReport - static void Marshall(const CDM::TestReportData& in, SETestReport& out); - static void UnMarshall(const SETestReport& in, CDM::TestReportData& out); + static void UnMarshall(const CDM::TestReportData& in, SETestReport& out); + static void Marshall(const SETestReport& in, CDM::TestReportData& out); //class SETestSuite - static void Marshall(const CDM::TestSuiteData& in, SETestSuite& out); - static void UnMarshall(const SETestSuite& in, CDM::TestSuiteData& out); + static void UnMarshall(const CDM::TestSuiteData& in, SETestSuite& out); + static void Marshall(const SETestSuite& in, CDM::TestSuiteData& out); //class SETestCase - static void Marshall(const CDM::TestCaseData& in, SETestCase& out); - static void UnMarshall(const SETestCase& in, CDM::TestCaseData& out); + static void UnMarshall(const CDM::TestCaseData& in, SETestCase& out); + static void Marshall(const SETestCase& in, CDM::TestCaseData& out); }; //---------------------------------------------------------------------------------- template - void TestReport::Marshall(xsd::cxx::tree::optional const& option_in, SE& out) + void TestReport::UnMarshall(xsd::cxx::tree::optional const& option_in, SE& out) { if (!option_in.present()) { - out.Invalidate(); + out.MakeInvalid(); } else { - Marshall(option_in.get(), out); + UnMarshall(option_in.get(), out); } } //---------------------------------------------------------------------------------- template - void TestReport::UnMarshall(const SE& in, xsd::cxx::tree::optional& option_out) + void TestReport::Marshall(const SE& in, xsd::cxx::tree::optional& option_out) { auto item = std::make_unique(); - UnMarshall(in, *item); + Marshall(in, *item); option_out.set(*item); } } // Namespace IO diff --git a/projects/biogears/libBiogears/unit/CircuitTest/test_circuit_Gastrointestinal.cpp b/projects/biogears/libBiogears/unit/CircuitTest/test_circuit_Gastrointestinal.cpp index baf9cfb9f..08346182b 100644 --- a/projects/biogears/libBiogears/unit/CircuitTest/test_circuit_Gastrointestinal.cpp +++ b/projects/biogears/libBiogears/unit/CircuitTest/test_circuit_Gastrointestinal.cpp @@ -137,7 +137,7 @@ TEST_F(TEST_FIXTURE_NAME, ExternalTemperature_Circuit) SEThermalCircuitPath& AbsoluteReferenceToActivePath = exthermal.CreatePath(Ground, Active, BGE::ExternalTemperaturePath::GroundToActive); AbsoluteReferenceToActivePath.GetNextTemperatureSource().SetValue(0.0, TemperatureUnit::K); SEThermalCircuitPath& ActiveToClothing = exthermal.CreatePath(Active, Clothing, BGE::ExternalTemperaturePath::ActiveToClothing); - ActiveToClothing.SetNextSwitch(CDM::enumOpenClosed::Open); + ActiveToClothing.SetNextSwitch(SEOpenClosed::Open); exthermal.SetNextAndCurrentFromBaselines(); exthermal.StateChange(); diff --git a/projects/biogears/libBiogears/unit/cdm/BioGearsEngineTesting/test_core_PatientStates.cpp b/projects/biogears/libBiogears/unit/cdm/BioGearsEngineTesting/test_core_PatientStates.cpp deleted file mode 100644 index 8b849e42f..000000000 --- a/projects/biogears/libBiogears/unit/cdm/BioGearsEngineTesting/test_core_PatientStates.cpp +++ /dev/null @@ -1,355 +0,0 @@ -//------------------------------------------------------------------------------------------- -//- Copyright 2017 Applied Research Associates, Inc. -//- Licensed under the ALche License, Version 2.0 (the "License"); you may not use -//- this file except in compliance with the License. You may obtain a copy of the License -//- at: -//- http://www.aLche.org/licenses/LICENSE-2.0 -//- Unless required by applicable law or agreed to in writing, software distributed under -//- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -//- CONDITIONS OF ANY KIND, either express or implied. See the License for the -//- specific language governing permissions and limitations under the License. -//------------------------------------------------------------------------------------------- -//! -//! @author David Lee -//! @date 2017 Aug 3rd -//! -//! Unit Test for Biogears-common Config -//! -#include -#include - -#include - -#include -#include -#include -#include -#include - -#include -#include - -#ifdef DISABLE_BIOGEARS_PatientStates_TEST -#define TEST_FIXTURE_NAME DISABLED_PatientStates_Fixture -#else -#define TEST_FIXTURE_NAME PatientStates_Fixture -#endif - -using namespace biogears; -// The fixture for testing class Foo. -class TEST_FIXTURE_NAME : public ::testing::Test { -protected: - // You can do set-up work for each test here. - TEST_FIXTURE_NAME() = default; - - // You can do clean-up work that doesn't throw exceptions here. - virtual ~TEST_FIXTURE_NAME() = default; - - // If the constructor and destructor are not enough for setting up - // and cleaning up each test, you can define the following methods: - - // Code here will be called immediately after the constructor (right - // before each test). - virtual void SetUp() override; - - // Code here will be called immediately after each test (right - // before the destructor). - virtual void TearDown() override; - biogears::Logger* logger; -}; - -void TEST_FIXTURE_NAME::SetUp() -{ -} - -void TEST_FIXTURE_NAME::TearDown() -{ -} -TEST_F(TEST_FIXTURE_NAME, Bradycardic) -{ - // Create the engine and load the patient - std::unique_ptr bg = CreateBioGearsEngine("BradycardicPatientUnitTest.log"); - bg->GetLogger()->Info("Bradycard Patient Unit Test"); - if (!bg->LoadState("./states/Bradycardic@0s.xml")) { - bg->GetLogger()->Error("Could not load state, check the error"); - return; - } - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); -} -TEST_F(TEST_FIXTURE_NAME, Carol) -{ - // Create the engine and load the patient - std::unique_ptr bg = CreateBioGearsEngine("CarolPatientUnitTest.log"); - bg->GetLogger()->Info("Carol Patient Unit Test"); - if (!bg->LoadState("./states/Carol@0s.xml")) { - bg->GetLogger()->Error("Could not load state, check the error"); - return; - } - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); -} -TEST_F(TEST_FIXTURE_NAME, Cynthia) -{ - // Create the engine and load the patient - std::unique_ptr bg = CreateBioGearsEngine("CynthiaPatientUnitTest.log"); - bg->GetLogger()->Info("Cynthia Patient Unit Test"); - if (!bg->LoadState("./states/Cynthia@0s.xml")) { - bg->GetLogger()->Error("Could not load state, check the error"); - return; - } - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); -} -TEST_F(TEST_FIXTURE_NAME, DefaultFemale) -{ - // Create the engine and load the patient - std::unique_ptr bg = CreateBioGearsEngine("DefaultFemalePatientUnitTest.log"); - bg->GetLogger()->Info("Default Female Patient Unit Test"); - if (!bg->LoadState("./states/DefaultFemale@0s.xml")) { - bg->GetLogger()->Error("Could not load state, check the error"); - return; - } - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); -} -TEST_F(TEST_FIXTURE_NAME, DefaultMale) -{ - // Create the engine and load the patient - std::unique_ptr bg = CreateBioGearsEngine("DefaultMalePatientUnitTest.log"); - bg->GetLogger()->Info("Default Male Patient Unit Test"); - if (!bg->LoadState("./states/DefaultMale@0s.xml")) { - bg->GetLogger()->Error("Could not load state, check the error"); - return; - } - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); -} -TEST_F(TEST_FIXTURE_NAME, DefaultTemplateFemale) -{ - // Create the engine and load the patient - std::unique_ptr bg = CreateBioGearsEngine("DefaultTemplateFemalePatientUnitTest.log"); - bg->GetLogger()->Info("Default Template Female Patient Unit Test"); - if (!bg->LoadState("./states/DefaultTemplateFemale@0s.xml")) { - bg->GetLogger()->Error("Could not load state, check the error"); - return; - } - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); -} -TEST_F(TEST_FIXTURE_NAME, DefaultTemplateMale) -{ - // Create the engine and load the patient - std::unique_ptr bg = CreateBioGearsEngine("DefaultTemplateMalePatientUnitTest.log"); - bg->GetLogger()->Info("Default Template Male Patient Unit Test"); - if (!bg->LoadState("./states/DefaultTemplateMale@0s.xml")) { - bg->GetLogger()->Error("Could not load state, check the error"); - return; - } - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); -} -TEST_F(TEST_FIXTURE_NAME, ExtremeFemale) -{ - // Create the engine and load the patient - std::unique_ptr bg = CreateBioGearsEngine("ExtremeFemalePatientUnitTest.log"); - bg->GetLogger()->Info("Extreme Female Patient Unit Test"); - if (!bg->LoadState("./states/ExtremeFemale@0s.xml")) { - bg->GetLogger()->Error("Could not load state, check the error"); - return; - } - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); -} -TEST_F(TEST_FIXTURE_NAME, ExtremeMale) -{ - // Create the engine and load the patient - std::unique_ptr bg = CreateBioGearsEngine("ExtremeMalePatientUnitTest.log"); - bg->GetLogger()->Info("Extreme Male Patient Unit Test"); - if (!bg->LoadState("./states/ExtremeMale@0s.xml")) { - bg->GetLogger()->Error("Could not load state, check the error"); - return; - } - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); -} -TEST_F(TEST_FIXTURE_NAME, Gus) -{ - // Create the engine and load the patient - std::unique_ptr bg = CreateBioGearsEngine("GusPatientUnitTest.log"); - bg->GetLogger()->Info("Gus Patient Unit Test"); - if (!bg->LoadState("./states/Gus@0s.xml")) { - bg->GetLogger()->Error("Could not load state, check the error"); - return; - } - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); -} -TEST_F(TEST_FIXTURE_NAME, Hassan) -{ - // Create the engine and load the patient - std::unique_ptr bg = CreateBioGearsEngine("HassanPatientUnitTest.log"); - bg->GetLogger()->Info("Hassan Patient Unit Test"); - if (!bg->LoadState("./states/Hassan@0s.xml")) { - bg->GetLogger()->Error("Could not load state, check the error"); - return; - } - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); -} -TEST_F(TEST_FIXTURE_NAME, Jane) -{ - // Create the engine and load the patient - std::unique_ptr bg = CreateBioGearsEngine("JanePatientUnitTest.log"); - bg->GetLogger()->Info("Jane Patient Unit Test"); - if (!bg->LoadState("./states/Jane@0s.xml")) { - bg->GetLogger()->Error("Could not load state, check the error"); - return; - } - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); -} -TEST_F(TEST_FIXTURE_NAME, Jeff) -{ - // Create the engine and load the patient - std::unique_ptr bg = CreateBioGearsEngine("JeffPatientUnitTest.log"); - bg->GetLogger()->Info("Jeff Patient Unit Test"); - if (!bg->LoadState("./states/Jeff@0s.xml")) { - bg->GetLogger()->Error("Could not load state, check the error"); - return; - } - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); -} -TEST_F(TEST_FIXTURE_NAME, Joel) -{ - // Create the engine and load the patient - std::unique_ptr bg = CreateBioGearsEngine("JoelPatientUnitTest.log"); - bg->GetLogger()->Info("Joel Patient Unit Test"); - if (!bg->LoadState("./states/Joel@0s.xml")) { - bg->GetLogger()->Error("Could not load state, check the error"); - return; - } - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); -} -TEST_F(TEST_FIXTURE_NAME, Nathan) -{ - // Create the engine and load the patient - std::unique_ptr bg = CreateBioGearsEngine("NathanPatientUnitTest.log"); - bg->GetLogger()->Info("Nathan Patient Unit Test"); - if (!bg->LoadState("./states/Nathan@0s.xml")) { - bg->GetLogger()->Error("Could not load state, check the error"); - return; - } - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); -} -TEST_F(TEST_FIXTURE_NAME, Rick) -{ - // Create the engine and load the patient - std::unique_ptr bg = CreateBioGearsEngine("RickPatientUnitTest.log"); - bg->GetLogger()->Info("Rick Patient Unit Test"); - if (!bg->LoadState("./states/Rick@0s.xml")) { - bg->GetLogger()->Error("Could not load state, check the error"); - return; - } - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); -} -TEST_F(TEST_FIXTURE_NAME, Soldier) -{ - // Create the engine and load the patient - std::unique_ptr bg = CreateBioGearsEngine("SoldierPatientUnitTest.log"); - bg->GetLogger()->Info("Soldier Patient Unit Test"); - if (!bg->LoadState("./states/Soldier@0s.xml")) { - bg->GetLogger()->Error("Could not load state, check the error"); - return; - } - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); -} -TEST_F(TEST_FIXTURE_NAME, StandardFemale) -{ - // Create the engine and load the patient - std::unique_ptr bg = CreateBioGearsEngine("StandardFemalePatientUnitTest.log"); - bg->GetLogger()->Info("Standard Female Patient Unit Test"); - if (!bg->LoadState("./states/StandardFemale@0s.xml")) { - bg->GetLogger()->Error("Could not load state, check the error"); - return; - } - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); -} -TEST_F(TEST_FIXTURE_NAME, StandardMale) -{ - // Create the engine and load the patient - std::unique_ptr bg = CreateBioGearsEngine("StandardMalePatientUnitTest.log"); - bg->GetLogger()->Info("Standard Male Patient Unit Test"); - if (!bg->LoadState("./states/StandardMale@0s.xml")) { - bg->GetLogger()->Error("Could not load state, check the error"); - return; - } - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); -} -TEST_F(TEST_FIXTURE_NAME, Tachycardic) -{ - // Create the engine and load the patient - std::unique_ptr bg = CreateBioGearsEngine("TachycardicPatientUnitTest.log"); - bg->GetLogger()->Info("Tachycardic Patient Unit Test"); - if (!bg->LoadState("./states/Tachycardic@0s.xml")) { - bg->GetLogger()->Error("Could not load state, check the error"); - return; - } - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); -} -TEST_F(TEST_FIXTURE_NAME, ToughGirl) -{ - // Create the engine and load the patient - std::unique_ptr bg = CreateBioGearsEngine("ToughGirlPatientUnitTest.log"); - bg->GetLogger()->Info("HowToAsthmaAttack"); - if (!bg->LoadState("./states/ToughGirl@0s.xml")) { - bg->GetLogger()->Error("Could not load state, check the error"); - return; - } - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); -} -TEST_F(TEST_FIXTURE_NAME, ToughGuy) -{ - // Create the engine and load the patient - std::unique_ptr bg = CreateBioGearsEngine("ToughGuyPatientUnitTest.log"); - bg->GetLogger()->Info("Tough Guy Patient Unit Test"); - if (!bg->LoadState("./states/ToughGuy@0s.xml")) { - bg->GetLogger()->Error("Could not load state, check the error"); - return; - } - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); -} -TEST_F(TEST_FIXTURE_NAME, Tristan) -{ - // Create the engine and load the patient - std::unique_ptr bg = CreateBioGearsEngine("TristanPatientUnitTest.log"); - bg->GetLogger()->Info("HowToAsthmaAttack"); - if (!bg->LoadState("./states/Tristan@0s.xml")) { - bg->GetLogger()->Error("Could not load state, check the error"); - return; - } - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); -} -TEST_F(TEST_FIXTURE_NAME, Underweight) -{ - // Create the engine and load the patient - std::unique_ptr bg = CreateBioGearsEngine("UnderweightPatientUnitTest.log"); - bg->GetLogger()->Info("HowToAsthmaAttack"); - if (!bg->LoadState("./states/Underweight@0s.xml")) { - bg->GetLogger()->Error("Could not load state, check the error"); - return; - } - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); - EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); -} \ No newline at end of file diff --git a/projects/biogears/libBiogears/unit/cdm/BioGearsEngineTesting/test_core_Override.cpp b/projects/biogears/libBiogears/unit/cdm/BioGearsEngineTesting/test_core_cdm_Override.cpp similarity index 100% rename from projects/biogears/libBiogears/unit/cdm/BioGearsEngineTesting/test_core_Override.cpp rename to projects/biogears/libBiogears/unit/cdm/BioGearsEngineTesting/test_core_cdm_Override.cpp diff --git a/projects/biogears/libBiogears/unit/cdm/BioGearsEngineTesting/test_core_cdm_PatientStates.cpp b/projects/biogears/libBiogears/unit/cdm/BioGearsEngineTesting/test_core_cdm_PatientStates.cpp new file mode 100644 index 000000000..4f6712883 --- /dev/null +++ b/projects/biogears/libBiogears/unit/cdm/BioGearsEngineTesting/test_core_cdm_PatientStates.cpp @@ -0,0 +1,324 @@ +//------------------------------------------------------------------------------------------- +//- Copyright 2017 Applied Research Associates, Inc. +//- Licensed under the ALche License, Version 2.0 (the "License"); you may not use +//- this file except in compliance with the License. You may obtain a copy of the License +//- at: +//- http://www.aLche.org/licenses/LICENSE-2.0 +//- Unless required by applicable law or agreed to in writing, software distributed under +//- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +//- CONDITIONS OF ANY KIND, either express or implied. See the License for the +//- specific language governing permissions and limitations under the License. +//------------------------------------------------------------------------------------------- +//! +//! @author David Lee +//! @date 2017 Aug 3rd +//! +//! Unit Test for Biogears-common Config +//! +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#ifdef DISABLE_BIOGEARS_PatientStates_TEST +#define TEST_FIXTURE_NAME DISABLED_PatientStates_Fixture +#else +#define TEST_FIXTURE_NAME PatientStates_Fixture +#endif + +using namespace biogears; +// The fixture for testing class Foo. +class TEST_FIXTURE_NAME : public ::testing::Test { +protected: + // You can do set-up work for each test here. + TEST_FIXTURE_NAME() = default; + + // You can do clean-up work that doesn't throw exceptions here. + virtual ~TEST_FIXTURE_NAME() = default; + + // If the constructor and destructor are not enough for setting up + // and cleaning up each test, you can define the following methods: + + // Code here will be called immediately after the constructor (right + // before each test). + virtual void SetUp() override; + + // Code here will be called immediately after each test (right + // before the destructor). + virtual void TearDown() override; + biogears::Logger* logger; +}; + +void TEST_FIXTURE_NAME::SetUp() +{ +} + +void TEST_FIXTURE_NAME::TearDown() +{ +} + +TEST_F(TEST_FIXTURE_NAME, StateGeneration) +{ + using namespace biogears; + + // Create the engine and load the patient + std::unique_ptr bg = CreateBioGearsEngine("StateGeneration.log"); + SEPatient patient { bg->GetLogger() }; + + patient.SetName("StateGeneration"); + + patient.SetName("StandardMale"); + patient.SetSex(biogears::SESex::Male); + patient.GetAge().SetValue(44, biogears::TimeUnit::yr); + patient.GetWeight().SetValue(170, biogears::MassUnit::lb); + patient.GetHeight().SetValue(71, biogears::LengthUnit::inch); + patient.GetBodyFatFraction().SetValue(0.21); + patient.SetBloodType(SEBloodType::AB); + patient.SetBloodRh(true); + patient.GetHeartRateBaseline().SetValue(72, biogears::FrequencyUnit::Per_min); + patient.GetRespirationRateBaseline().SetValue(16, biogears::FrequencyUnit::Per_min); + patient.GetDiastolicArterialPressureBaseline().SetValue(73.5, biogears::PressureUnit::mmHg); + patient.GetSystolicArterialPressureBaseline().SetValue(114, biogears::PressureUnit::mmHg); + + bg->InitializeEngine(patient); + + std::string stateFile = asprintf("%s%s@%.0fs.xml", "UnitTest", patient.GetName().c_str()); + bg->SaveStateToFile(stateFile); + + bg->GetLogger()->Info("Bradycard Patient Unit Test"); + ASSERT_TRUE(bg->LoadState(stateFile)); + + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); +} + + +TEST_F(TEST_FIXTURE_NAME, StandardFemale) +{ + // Create the engine and load the patient + std::unique_ptr bg = CreateBioGearsEngine("BradycardicPatientUnitTest.log"); + bg->GetLogger()->Info("Bradycard Patient Unit Test"); + ASSERT_TRUE(bg->LoadState("./states/StandardFemale@0s.xml")); + + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); +} + +TEST_F(TEST_FIXTURE_NAME, DefaultTemplateFemale) +{ + // Create the engine and load the patient + std::unique_ptr bg = CreateBioGearsEngine("BradycardicPatientUnitTest.log"); + bg->GetLogger()->Info("Bradycard Patient Unit Test"); + ASSERT_TRUE(bg->LoadState("./states/DefaultTemplateFemale@0s.xml")); + + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); +} + +TEST_F(TEST_FIXTURE_NAME, DefaultTemplateMale) +{ + // Create the engine and load the patient + std::unique_ptr bg = CreateBioGearsEngine("BradycardicPatientUnitTest.log"); + bg->GetLogger()->Info("Bradycard Patient Unit Test"); + ASSERT_TRUE(bg->LoadState("./states/DefaultTemplateMale@0s.xml")); + + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); +} + +TEST_F(TEST_FIXTURE_NAME, StandardMale) +{ + // Create the engine and load the patient + std::unique_ptr bg = CreateBioGearsEngine("BradycardicPatientUnitTest.log"); + bg->GetLogger()->Info("Bradycard Patient Unit Test"); + ASSERT_TRUE(bg->LoadState("./states/StandardMale@0s.xml")); + + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); +} + + +//Female@0s.xml +TEST_F(TEST_FIXTURE_NAME, Female) +{ + // Create the engine and load the patient + std::unique_ptr bg = CreateBioGearsEngine("BradycardicPatientUnitTest.log"); + bg->GetLogger()->Info("Bradycard Patient Unit Test"); + ASSERT_TRUE(bg->LoadState("./states/Female@0s.xml")); + + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); +} + +//Female_18_Normal@0s.xml +//Female_30_Normal@0s.xml +TEST_F(TEST_FIXTURE_NAME, Female_18_Normal) +{ + // Create the engine and load the patient + std::unique_ptr bg = CreateBioGearsEngine("BradycardicPatientUnitTest.log"); + bg->GetLogger()->Info("Bradycard Patient Unit Test"); + ASSERT_TRUE(bg->LoadState("./states/Female_18_Normal@0s.xml")); + + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); +} + +TEST_F(TEST_FIXTURE_NAME, Female_30_Normal) +{ + // Create the engine and load the patient + std::unique_ptr bg = CreateBioGearsEngine("BradycardicPatientUnitTest.log"); + bg->GetLogger()->Info("Bradycard Patient Unit Test"); + ASSERT_TRUE(bg->LoadState("./states/Female_30_Normal@0s.xml")); + + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); +} +//Female_40_Overweight@0s.xml +//Male@0s.xml +TEST_F(TEST_FIXTURE_NAME, Female_40_Overweight) +{ + // Create the engine and load the patient + std::unique_ptr bg = CreateBioGearsEngine("BradycardicPatientUnitTest.log"); + bg->GetLogger()->Info("Bradycard Patient Unit Test"); + ASSERT_TRUE(bg->LoadState("./states/Female_40_Overweight@0s.xml")); + + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); +} + +TEST_F(TEST_FIXTURE_NAME, Male) +{ + // Create the engine and load the patient + std::unique_ptr bg = CreateBioGearsEngine("BradycardicPatientUnitTest.log"); + bg->GetLogger()->Info("Bradycard Patient Unit Test"); + ASSERT_TRUE(bg->LoadState("./states/Male@0s.xml")); + + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); +} +//Male_22_Fit_Soldier@0s.xml +//Male_24_Normal_hidrosis2@0s.xml +TEST_F(TEST_FIXTURE_NAME, Male_22_Fit_Soldier) +{ + // Create the engine and load the patient + std::unique_ptr bg = CreateBioGearsEngine("BradycardicPatientUnitTest.log"); + bg->GetLogger()->Info("Bradycard Patient Unit Test"); + ASSERT_TRUE(bg->LoadState("./states/Male_22_Fit_Soldier@0s.xml")); + + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); +} + +TEST_F(TEST_FIXTURE_NAME, Male_24_Normal_hidrosis2) +{ + // Create the engine and load the patient + std::unique_ptr bg = CreateBioGearsEngine("BradycardicPatientUnitTest.log"); + bg->GetLogger()->Info("Bradycard Patient Unit Test"); + ASSERT_TRUE(bg->LoadState("./states/Male_24_Normal_hidrosis2@0s.xml")); + + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); +} +//Male_25_Normal@0s.xml +//Male_28_Normal_hr109_rr18@0s.xml +TEST_F(TEST_FIXTURE_NAME, Male_25_Normal) +{ + // Create the engine and load the patient + std::unique_ptr bg = CreateBioGearsEngine("BradycardicPatientUnitTest.log"); + bg->GetLogger()->Info("Bradycard Patient Unit Test"); + ASSERT_TRUE(bg->LoadState("./states/Male_25_Normal@0s.xml")); + + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); +} + +TEST_F(TEST_FIXTURE_NAME, Male_28_Normal_hr109_rr18) +{ + // Create the engine and load the patient + std::unique_ptr bg = CreateBioGearsEngine("BradycardicPatientUnitTest.log"); + bg->GetLogger()->Info("Bradycard Patient Unit Test"); + ASSERT_TRUE(bg->LoadState("./states/Male_28_Normal_hr109_rr18@0s.xml")); + + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); +} +//Male_32_Normal_hr93_rr14@0s.xml +//Male_44_Bradycardic@0s.xml +TEST_F(TEST_FIXTURE_NAME, Male_32_Normal_hr93_rr14) +{ + // Create the engine and load the patient + std::unique_ptr bg = CreateBioGearsEngine("BradycardicPatientUnitTest.log"); + bg->GetLogger()->Info("Bradycard Patient Unit Test"); + ASSERT_TRUE(bg->LoadState("./states/Male_32_Normal_hr93_rr14@0s.xml")); + + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); +} + +TEST_F(TEST_FIXTURE_NAME, Male_44_Bradycardic) +{ + // Create the engine and load the patient + std::unique_ptr bg = CreateBioGearsEngine("BradycardicPatientUnitTest.log"); + bg->GetLogger()->Info("Bradycard Patient Unit Test"); + ASSERT_TRUE(bg->LoadState("./states/Male_44_Bradycardic@0s.xml")); + + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); +} +//Male_44_Normal_hr109_rr15@0s.xml +//Male_44_Normal_rr12@0s.xml +TEST_F(TEST_FIXTURE_NAME, Male_44_Normal_hr109_rr15) +{ + // Create the engine and load the patient + std::unique_ptr bg = CreateBioGearsEngine("BradycardicPatientUnitTest.log"); + bg->GetLogger()->Info("Bradycard Patient Unit Test"); + ASSERT_TRUE(bg->LoadState("./states/Male_44_Normal_hr109_rr15@0s.xml")); + + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); +} + +TEST_F(TEST_FIXTURE_NAME, Male_44_Normal_rr12) +{ + // Create the engine and load the patient + std::unique_ptr bg = CreateBioGearsEngine("BradycardicPatientUnitTest.log"); + bg->GetLogger()->Info("Bradycard Patient Unit Test"); + ASSERT_TRUE(bg->LoadState("./states/Male_44_Normal_rr12@0s.xml")); + + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); +} +//Male_44_SleepDeprived@0s.xml +//Male_44_Tachycardic@0s.xml +TEST_F(TEST_FIXTURE_NAME, Male_44_SleepDeprived) +{ + // Create the engine and load the patient + std::unique_ptr bg = CreateBioGearsEngine("BradycardicPatientUnitTest.log"); + bg->GetLogger()->Info("Bradycard Patient Unit Test"); + ASSERT_TRUE(bg->LoadState("./states/Male_44_SleepDeprived@0s.xml")); + + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); +} + +TEST_F(TEST_FIXTURE_NAME, Male_44_Tachycardic) +{ + // Create the engine and load the patient + std::unique_ptr bg = CreateBioGearsEngine("BradycardicPatientUnitTest.log"); + bg->GetLogger()->Info("Bradycard Patient Unit Test"); + ASSERT_TRUE(bg->LoadState("./states/Male_44_Tachycardic@0s.xml")); + + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); + EXPECT_NO_THROW(bg->AdvanceModelTime(1.0, TimeUnit::s)); +} diff --git a/projects/biogears/libBiogears/unit/cdm/patient/actions/test_core_SEBurnWound.cpp b/projects/biogears/libBiogears/unit/cdm/patient/actions/test_core_cdm_SEBurnWound.cpp similarity index 99% rename from projects/biogears/libBiogears/unit/cdm/patient/actions/test_core_SEBurnWound.cpp rename to projects/biogears/libBiogears/unit/cdm/patient/actions/test_core_cdm_SEBurnWound.cpp index 3f538ca3c..6caa54584 100644 --- a/projects/biogears/libBiogears/unit/cdm/patient/actions/test_core_SEBurnWound.cpp +++ b/projects/biogears/libBiogears/unit/cdm/patient/actions/test_core_cdm_SEBurnWound.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #define TEST_FIXTURE_NAME SEBurnWound_Fixture diff --git a/projects/biogears/libBiogears/unit/cdm/patient/actions/test_core_SEEscharotomy.cpp b/projects/biogears/libBiogears/unit/cdm/patient/actions/test_core_cdm_SEEscharotomy.cpp similarity index 98% rename from projects/biogears/libBiogears/unit/cdm/patient/actions/test_core_SEEscharotomy.cpp rename to projects/biogears/libBiogears/unit/cdm/patient/actions/test_core_cdm_SEEscharotomy.cpp index 7c7f8a1b9..3f496c3e0 100644 --- a/projects/biogears/libBiogears/unit/cdm/patient/actions/test_core_SEEscharotomy.cpp +++ b/projects/biogears/libBiogears/unit/cdm/patient/actions/test_core_cdm_SEEscharotomy.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #ifdef DISABLE_BIOGEARS_SEEscharotomy_TEST #define TEST_FIXTURE_NAME DISABLED_SEEscharotomy_Fixture diff --git a/projects/biogears/libBiogears/unit/cdm/patient/actions/test_core_SEPulmonaryShunt.cpp b/projects/biogears/libBiogears/unit/cdm/patient/actions/test_core_cdm_SEPulmonaryShunt.cpp similarity index 98% rename from projects/biogears/libBiogears/unit/cdm/patient/actions/test_core_SEPulmonaryShunt.cpp rename to projects/biogears/libBiogears/unit/cdm/patient/actions/test_core_cdm_SEPulmonaryShunt.cpp index 5e9160882..01125489b 100644 --- a/projects/biogears/libBiogears/unit/cdm/patient/actions/test_core_SEPulmonaryShunt.cpp +++ b/projects/biogears/libBiogears/unit/cdm/patient/actions/test_core_cdm_SEPulmonaryShunt.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #ifdef DISABLE_BIOGEARS_SEPulmonaryShunt_TEST #define TEST_FIXTURE_NAME DISABLED_SEPulmonaryShunt_Fixture diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalar.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalar.cpp similarity index 100% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalar.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalar.cpp diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarAmount.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarAmount.cpp similarity index 94% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarAmount.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarAmount.cpp index 49681137d..2a5342f1a 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarAmount.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarAmount.cpp @@ -57,12 +57,8 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarAmount amount = biogears::SEScalarAmount(); - auto ptr = amount.Unload(); - EXPECT_EQ(ptr, nullptr); -} +#include "io/cdm/Property.h" + TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarAmountPerMass.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarAmountPerMass.cpp similarity index 93% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarAmountPerMass.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarAmountPerMass.cpp index c778c9243..a95f34614 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarAmountPerMass.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarAmountPerMass.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarAmountPerMass AmountPerMass = biogears::SEScalarAmountPerMass(); - auto ptr = AmountPerMass.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarAmountPerTime.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarAmountPerTime.cpp similarity index 95% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarAmountPerTime.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarAmountPerTime.cpp index 444173bc5..d515e1493 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarAmountPerTime.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarAmountPerTime.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarAmountPerTime AmountPerTime = biogears::SEScalarAmountPerTime(); - auto ptr = AmountPerTime.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarAmountPerVolume.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarAmountPerVolume.cpp similarity index 95% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarAmountPerVolume.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarAmountPerVolume.cpp index b8f46a868..e3328905d 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarAmountPerVolume.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarAmountPerVolume.cpp @@ -57,13 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarAmountPerVolume AmountPerVolume = biogears::SEScalarAmountPerVolume(); - auto ptr = AmountPerVolume.Unload(); - EXPECT_EQ(ptr, nullptr); -} - TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { bool unit0 = biogears::AmountPerVolumeUnit::IsValidUnit("mol/L"); diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarArea.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarArea.cpp similarity index 94% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarArea.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarArea.cpp index 40d9497de..25ec03b02 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarArea.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarArea.cpp @@ -57,13 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarArea Area = biogears::SEScalarArea(); - auto ptr = Area.Unload(); - EXPECT_EQ(ptr, nullptr); -} - TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { bool unit0 = biogears::AreaUnit::IsValidUnit("cm^2"); diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarAreaPerTimePressure.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarAreaPerTimePressure.cpp similarity index 94% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarAreaPerTimePressure.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarAreaPerTimePressure.cpp index a8370c65a..19d9cb9d5 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarAreaPerTimePressure.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarAreaPerTimePressure.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarAreaPerTimePressure AreaPerTimePressure = biogears::SEScalarAreaPerTimePressure(); - auto ptr = AreaPerTimePressure.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarElectricCapacitance.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarElectricCapacitance.cpp similarity index 92% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarElectricCapacitance.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarElectricCapacitance.cpp index 5194cd713..afd735d9c 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarElectricCapacitance.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarElectricCapacitance.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarElectricCapacitance ElectricCapacitance = biogears::SEScalarElectricCapacitance(); - auto ptr = ElectricCapacitance.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarElectricCharge.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarElectricCharge.cpp similarity index 92% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarElectricCharge.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarElectricCharge.cpp index 1f1fc232f..465f3f108 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarElectricCharge.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarElectricCharge.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarElectricCharge ElectricCharge = biogears::SEScalarElectricCharge(); - auto ptr = ElectricCharge.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarElectricCurrent.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarElectricCurrent.cpp similarity index 92% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarElectricCurrent.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarElectricCurrent.cpp index e9c7be0e9..1405c0ece 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarElectricCurrent.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarElectricCurrent.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarElectricCurrent ElectricCurrent = biogears::SEScalarElectricCurrent(); - auto ptr = ElectricCurrent.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarElectricInductance.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarElectricInductance.cpp similarity index 92% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarElectricInductance.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarElectricInductance.cpp index 1d23561cb..f8fddb1e9 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarElectricInductance.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarElectricInductance.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarElectricInductance ElectricInductance = biogears::SEScalarElectricInductance(); - auto ptr = ElectricInductance.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarElectricPotential.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarElectricPotential.cpp similarity index 93% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarElectricPotential.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarElectricPotential.cpp index f0f81662e..0b528facc 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarElectricPotential.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarElectricPotential.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarElectricPotential ElectricPotential = biogears::SEScalarElectricPotential(); - auto ptr = ElectricPotential.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarElectricResistance.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarElectricResistance.cpp similarity index 92% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarElectricResistance.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarElectricResistance.cpp index 1e12cd576..304f034e2 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarElectricResistance.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarElectricResistance.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarElectricResistance ElectricResistance = biogears::SEScalarElectricResistance(); - auto ptr = ElectricResistance.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarEnergy.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarEnergy.cpp similarity index 94% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarEnergy.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarEnergy.cpp index b7574b7f3..b69ef9be0 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarEnergy.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarEnergy.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarEnergy Energy = biogears::SEScalarEnergy(); - auto ptr = Energy.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarEnergyPerAmount.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarEnergyPerAmount.cpp similarity index 93% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarEnergyPerAmount.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarEnergyPerAmount.cpp index 5f3d589e2..b0eba43ed 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarEnergyPerAmount.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarEnergyPerAmount.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarEnergyPerAmount EnergyPerAmount = biogears::SEScalarEnergyPerAmount(); - auto ptr = EnergyPerAmount.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarEnergyPerMass.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarEnergyPerMass.cpp similarity index 94% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarEnergyPerMass.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarEnergyPerMass.cpp index f9bb54e91..8ec2d07f6 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarEnergyPerMass.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarEnergyPerMass.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarEnergyPerMass EnergyPerMass = biogears::SEScalarEnergyPerMass(); - auto ptr = EnergyPerMass.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarFlowCompliance.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarFlowCompliance.cpp similarity index 94% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarFlowCompliance.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarFlowCompliance.cpp index 5af823ba0..ba50cdd1b 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarFlowCompliance.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarFlowCompliance.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarFlowCompliance FlowCompliance = biogears::SEScalarFlowCompliance(); - auto ptr = FlowCompliance.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarFlowElastance.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarFlowElastance.cpp similarity index 94% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarFlowElastance.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarFlowElastance.cpp index 760894ebf..e4a9ddc0d 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarFlowElastance.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarFlowElastance.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarFlowElastance FlowElastance = biogears::SEScalarFlowElastance(); - auto ptr = FlowElastance.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarFlowInertance.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarFlowInertance.cpp similarity index 94% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarFlowInertance.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarFlowInertance.cpp index ec8f76989..c8c09cee2 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarFlowInertance.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarFlowInertance.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarFlowInertance FlowInertance = biogears::SEScalarFlowInertance(); - auto ptr = FlowInertance.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarFlowResistance.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarFlowResistance.cpp similarity index 94% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarFlowResistance.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarFlowResistance.cpp index c144dbc6c..fd618826e 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarFlowResistance.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarFlowResistance.cpp @@ -57,13 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarFlowResistance FlowResistance = biogears::SEScalarFlowResistance(); - auto ptr = FlowResistance.Unload(); - EXPECT_EQ(ptr, nullptr); -} - TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { bool unit0 = biogears::FlowResistanceUnit::IsValidUnit("cmH2O s/L"); diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarForce.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarForce.cpp similarity index 94% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarForce.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarForce.cpp index 49bada6cc..a401bf321 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarForce.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarForce.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarForce Force = biogears::SEScalarForce(); - auto ptr = Force.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarFrequency.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarFrequency.cpp similarity index 94% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarFrequency.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarFrequency.cpp index 355fd8b61..a226414ba 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarFrequency.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarFrequency.cpp @@ -57,13 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarFrequency Frequency = biogears::SEScalarFrequency(); - auto ptr = Frequency.Unload(); - EXPECT_EQ(ptr, nullptr); -} - TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { bool unit0 = biogears::FrequencyUnit::IsValidUnit("1/min"); diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarHeatCapacitance.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarHeatCapacitance.cpp similarity index 94% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarHeatCapacitance.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarHeatCapacitance.cpp index 24992ef53..110be0d10 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarHeatCapacitance.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarHeatCapacitance.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarHeatCapacitance HeatCapacitance = biogears::SEScalarHeatCapacitance(); - auto ptr = HeatCapacitance.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarHeatCapacitancePerAmount.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarHeatCapacitancePerAmount.cpp similarity index 91% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarHeatCapacitancePerAmount.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarHeatCapacitancePerAmount.cpp index 495dedc21..9471a24ac 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarHeatCapacitancePerAmount.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarHeatCapacitancePerAmount.cpp @@ -57,13 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarHeatCapacitancePerAmount HeatCapacitancePerAmount = biogears::SEScalarHeatCapacitancePerAmount(); - auto ptr = HeatCapacitancePerAmount.Unload(); - EXPECT_EQ(ptr, nullptr); -} - TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { bool unit0 = biogears::HeatCapacitancePerAmountUnit::IsValidUnit("J/K mol"); diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarHeatCapacitancePerMass.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarHeatCapacitancePerMass.cpp similarity index 93% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarHeatCapacitancePerMass.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarHeatCapacitancePerMass.cpp index 28707f19d..148ce22d4 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarHeatCapacitancePerMass.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarHeatCapacitancePerMass.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarHeatCapacitancePerMass HeatCapacitancePerMass = biogears::SEScalarHeatCapacitancePerMass(); - auto ptr = HeatCapacitancePerMass.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarHeatConductance.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarHeatConductance.cpp similarity index 94% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarHeatConductance.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarHeatConductance.cpp index 495fcc7c2..90c1b36f4 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarHeatConductance.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarHeatConductance.cpp @@ -57,13 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarHeatConductance HeatConductance = biogears::SEScalarHeatConductance(); - auto ptr = HeatConductance.Unload(); - EXPECT_EQ(ptr, nullptr); -} - TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { bool unit0 = biogears::HeatConductanceUnit::IsValidUnit("W/K"); diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarHeatConductancePerArea.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarHeatConductancePerArea.cpp similarity index 93% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarHeatConductancePerArea.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarHeatConductancePerArea.cpp index 613175d2d..2877ffc7d 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarHeatConductancePerArea.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarHeatConductancePerArea.cpp @@ -57,13 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarHeatConductancePerArea HeatConductancePerArea = biogears::SEScalarHeatConductancePerArea(); - auto ptr = HeatConductancePerArea.Unload(); - EXPECT_EQ(ptr, nullptr); -} - TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { bool unit0 = biogears::HeatConductancePerAreaUnit::IsValidUnit("W/m^2 K"); diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarHeatInductance.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarHeatInductance.cpp similarity index 92% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarHeatInductance.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarHeatInductance.cpp index 635ef892f..24245dd2d 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarHeatInductance.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarHeatInductance.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarHeatInductance HeatInductance = biogears::SEScalarHeatInductance(); - auto ptr = HeatInductance.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarHeatResistance.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarHeatResistance.cpp similarity index 94% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarHeatResistance.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarHeatResistance.cpp index 6f0658d48..f0b40b7ad 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarHeatResistance.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarHeatResistance.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarHeatResistance HeatResistance = biogears::SEScalarHeatResistance(); - auto ptr = HeatResistance.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarHeatResistanceArea.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarHeatResistanceArea.cpp similarity index 94% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarHeatResistanceArea.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarHeatResistanceArea.cpp index e3c242d78..af66f82d2 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarHeatResistanceArea.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarHeatResistanceArea.cpp @@ -57,13 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarHeatResistanceArea HeatResistanceArea = biogears::SEScalarHeatResistanceArea(); - auto ptr = HeatResistanceArea.Unload(); - EXPECT_EQ(ptr, nullptr); -} - TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { bool unit0 = biogears::HeatResistanceAreaUnit::IsValidUnit("rsi"); diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarInversePressure.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarInversePressure.cpp similarity index 94% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarInversePressure.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarInversePressure.cpp index 30ad7ce76..13e7f515a 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarInversePressure.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarInversePressure.cpp @@ -57,13 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarInversePressure InversePressure = biogears::SEScalarInversePressure(); - auto ptr = InversePressure.Unload(); - EXPECT_EQ(ptr, nullptr); -} - TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { bool unit0 = biogears::InversePressureUnit::IsValidUnit("1/Pa"); diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarInverseVolume.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarInverseVolume.cpp similarity index 93% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarInverseVolume.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarInverseVolume.cpp index 95e07ec0e..900ab66d8 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarInverseVolume.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarInverseVolume.cpp @@ -57,13 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarInverseVolume InverseVolume = biogears::SEScalarInverseVolume(); - auto ptr = InverseVolume.Unload(); - EXPECT_EQ(ptr, nullptr); -} - TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { bool unit0 = biogears::InverseVolumeUnit::IsValidUnit("1/L"); diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarLength.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarLength.cpp similarity index 95% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarLength.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarLength.cpp index 309469887..16cc38426 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarLength.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarLength.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarLength Length = biogears::SEScalarLength(); - auto ptr = Length.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarLengthPerTime.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarLengthPerTime.cpp similarity index 95% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarLengthPerTime.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarLengthPerTime.cpp index 51d4f144a..b11391126 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarLengthPerTime.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarLengthPerTime.cpp @@ -57,13 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarLengthPerTime LengthPerTime = biogears::SEScalarLengthPerTime(); - auto ptr = LengthPerTime.Unload(); - EXPECT_EQ(ptr, nullptr); -} - TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { bool unit0 = biogears::LengthPerTimeUnit::IsValidUnit("m/s"); diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarLengthPerTimePressure.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarLengthPerTimePressure.cpp similarity index 94% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarLengthPerTimePressure.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarLengthPerTimePressure.cpp index ffd8672fb..d4ae9ec32 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarLengthPerTimePressure.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarLengthPerTimePressure.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarLengthPerTimePressure LengthPerTimePressure = biogears::SEScalarLengthPerTimePressure(); - auto ptr = LengthPerTimePressure.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarMass.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarMass.cpp similarity index 95% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarMass.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarMass.cpp index 9f031bf58..c85ee8342 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarMass.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarMass.cpp @@ -57,13 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarMass mass = biogears::SEScalarMass(); - auto ptr = mass.Unload(); - EXPECT_EQ(ptr, nullptr); -} - TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { bool unit0 = biogears::MassUnit::IsValidUnit("g"); diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarMassPerAmount.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarMassPerAmount.cpp similarity index 96% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarMassPerAmount.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarMassPerAmount.cpp index 67eb13e8a..1d8fc97a5 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarMassPerAmount.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarMassPerAmount.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarMassPerAmount MassPerAmount = biogears::SEScalarMassPerAmount(); - auto ptr = MassPerAmount.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarMassPerAreaTime.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarMassPerAreaTime.cpp similarity index 92% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarMassPerAreaTime.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarMassPerAreaTime.cpp index e91451f9b..d68424e3a 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarMassPerAreaTime.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarMassPerAreaTime.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarMassPerAreaTime MassPerAreaTime = biogears::SEScalarMassPerAreaTime(); - auto ptr = MassPerAreaTime.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarMassPerMass.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarMassPerMass.cpp similarity index 93% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarMassPerMass.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarMassPerMass.cpp index c6cfbcf8c..9d4159618 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarMassPerMass.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarMassPerMass.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarMassPerMass MassPerMass = biogears::SEScalarMassPerMass(); - auto ptr = MassPerMass.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarMassPerTime.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarMassPerTime.cpp similarity index 95% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarMassPerTime.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarMassPerTime.cpp index be6342dc3..0bb069801 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarMassPerTime.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarMassPerTime.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarMassPerTime MassPerTime = biogears::SEScalarMassPerTime(); - auto ptr = MassPerTime.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarMassPerVolume.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarMassPerVolume.cpp similarity index 96% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarMassPerVolume.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarMassPerVolume.cpp index bd4e67428..84c4a5746 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarMassPerVolume.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarMassPerVolume.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarMassPerVolume MassPerVolume = biogears::SEScalarMassPerVolume(); - auto ptr = MassPerVolume.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarOsmolality.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarOsmolality.cpp similarity index 93% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarOsmolality.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarOsmolality.cpp index 6c23785f5..93dbaf9ee 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarOsmolality.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarOsmolality.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarOsmolality Osmolality = biogears::SEScalarOsmolality(); - auto ptr = Osmolality.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarOsmolarity.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarOsmolarity.cpp similarity index 93% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarOsmolarity.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarOsmolarity.cpp index f3ed6227d..e12a2c95a 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarOsmolarity.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarOsmolarity.cpp @@ -57,13 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarOsmolarity Osmolarity = biogears::SEScalarOsmolarity(); - auto ptr = Osmolarity.Unload(); - EXPECT_EQ(ptr, nullptr); -} - TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { bool unit0 = biogears::OsmolarityUnit::IsValidUnit("Osm/L"); diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarPower.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarPower.cpp similarity index 95% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarPower.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarPower.cpp index 4ac3e9a02..4ae295c18 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarPower.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarPower.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarPower Power = biogears::SEScalarPower(); - auto ptr = Power.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarPowerPerAreaTemperatureToTheFourth.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarPowerPerAreaTemperatureToTheFourth.cpp similarity index 90% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarPowerPerAreaTemperatureToTheFourth.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarPowerPerAreaTemperatureToTheFourth.cpp index bed768ba8..4305bbda8 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarPowerPerAreaTemperatureToTheFourth.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarPowerPerAreaTemperatureToTheFourth.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarPowerPerAreaTemperatureToTheFourth PowerPerAreaTemperatureToTheFourth = biogears::SEScalarPowerPerAreaTemperatureToTheFourth(); - auto ptr = PowerPerAreaTemperatureToTheFourth.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarPressure.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarPressure.cpp similarity index 95% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarPressure.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarPressure.cpp index 92a7d906a..e3b68cbf9 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarPressure.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarPressure.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarPressure Pressure = biogears::SEScalarPressure(); - auto ptr = Pressure.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarPressurePerVolume.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarPressurePerVolume.cpp similarity index 93% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarPressurePerVolume.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarPressurePerVolume.cpp index 84401139d..692fa643e 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarPressurePerVolume.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarPressurePerVolume.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarPressurePerVolume PressurePerVolume = biogears::SEScalarPressurePerVolume(); - auto ptr = PressurePerVolume.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarPressureTimePerArea.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarPressureTimePerArea.cpp similarity index 93% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarPressureTimePerArea.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarPressureTimePerArea.cpp index 296bc512e..6a486a5fb 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarPressureTimePerArea.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarPressureTimePerArea.cpp @@ -57,13 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarPressureTimePerArea PressureTimePerArea = biogears::SEScalarPressureTimePerArea(); - auto ptr = PressureTimePerArea.Unload(); - EXPECT_EQ(ptr, nullptr); -} - TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { bool unit0 = biogears::PressureTimePerAreaUnit::IsValidUnit("mmHg/mL m^2"); diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarPressureTimePerVolumeArea.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarPressureTimePerVolumeArea.cpp similarity index 93% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarPressureTimePerVolumeArea.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarPressureTimePerVolumeArea.cpp index 5f5d2e539..41b7ca0bb 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarPressureTimePerVolumeArea.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarPressureTimePerVolumeArea.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarPressureTimePerVolumeArea PressureTimePerVolumeArea = biogears::SEScalarPressureTimePerVolumeArea(); - auto ptr = PressureTimePerVolumeArea.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarQuantity.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarQuantity.cpp similarity index 97% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarQuantity.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarQuantity.cpp index b604de5d2..2d3b9ec3a 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarQuantity.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarQuantity.cpp @@ -22,9 +22,12 @@ #include "biogears/cdm/properties/SEScalar.h" #include +#include #include #include #include "biogears/cdm/properties/SEScalarMass.h" +#include "biogears/cdm/properties/SEScalarQuantity.h" + #ifdef DISABLE_BIOGEARS_SEScalarQuantity_TEST #define TEST_FIXTURE_NAME DISABLED_SEScalarQuantity_Fixture @@ -95,6 +98,8 @@ using namespace biogears; const TestUnit TestUnit::kg = TestUnit{ "kg" }; const TestUnit TestUnit::lb = TestUnit{ "lb" }; + template class biogears::SEScalarQuantity; + class TestScalarQuantity : public SEScalarQuantity { public: TestScalarQuantity() = default; @@ -107,16 +112,9 @@ using namespace biogears; virtual ~TestScalarQuantity() = default; - CDM::ScalarMassData* Unload() const override - { - if (!IsValid()) - return nullptr; - CDM::ScalarMassData* data(new CDM::ScalarMassData()); - SEScalarQuantity::Unload(*data); - return data; - } }; + // The fixture for testing class Foo. class TEST_FIXTURE_NAME : public ::testing::Test { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarTemperature.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarTemperature.cpp similarity index 94% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarTemperature.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarTemperature.cpp index 117f4a50c..c9f206178 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarTemperature.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarTemperature.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarTemperature Temperature = biogears::SEScalarTemperature(); - auto ptr = Temperature.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarTime.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarTime.cpp similarity index 95% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarTime.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarTime.cpp index e9028100e..fbd53645f 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarTime.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarTime.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarTime time = biogears::SEScalarTime(); - auto ptr = time.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarVolume.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarVolume.cpp similarity index 95% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarVolume.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarVolume.cpp index a92e1ce18..29943f8ca 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarVolume.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarVolume.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarVolume Volume = biogears::SEScalarVolume(); - auto ptr = Volume.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarVolumePerPressure.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarVolumePerPressure.cpp similarity index 93% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarVolumePerPressure.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarVolumePerPressure.cpp index fd2ef93bd..dee70fd26 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarVolumePerPressure.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarVolumePerPressure.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarVolumePerPressure VolumePerPressure = biogears::SEScalarVolumePerPressure(); - auto ptr = VolumePerPressure.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarVolumePerTime.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarVolumePerTime.cpp similarity index 95% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarVolumePerTime.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarVolumePerTime.cpp index 53c70bac5..02344f1fa 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarVolumePerTime.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarVolumePerTime.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarVolumePerTime VolumePerTime = biogears::SEScalarVolumePerTime(); - auto ptr = VolumePerTime.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarVolumePerTimeArea.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarVolumePerTimeArea.cpp similarity index 93% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarVolumePerTimeArea.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarVolumePerTimeArea.cpp index c0ab88241..038290035 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarVolumePerTimeArea.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarVolumePerTimeArea.cpp @@ -57,13 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarVolumePerTimeArea VolumePerTimeArea = biogears::SEScalarVolumePerTimeArea(); - auto ptr = VolumePerTimeArea.Unload(); - EXPECT_EQ(ptr, nullptr); -} - TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { bool unit0 = biogears::VolumePerTimeAreaUnit::IsValidUnit("mL/min m^2"); diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarVolumePerTimeMass.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarVolumePerTimeMass.cpp similarity index 94% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarVolumePerTimeMass.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarVolumePerTimeMass.cpp index 3fa626cf8..40b3ef37b 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarVolumePerTimeMass.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarVolumePerTimeMass.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarVolumePerTimeMass VolumePerTimeMass = biogears::SEScalarVolumePerTimeMass(); - auto ptr = VolumePerTimeMass.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarVolumePerTimePressure.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarVolumePerTimePressure.cpp similarity index 94% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarVolumePerTimePressure.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarVolumePerTimePressure.cpp index 0b42c9e71..87a3cf85a 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarVolumePerTimePressure.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarVolumePerTimePressure.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarVolumePerTimePressure VolumePerTimePressure = biogears::SEScalarVolumePerTimePressure(); - auto ptr = VolumePerTimePressure.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarVolumePerTimePressureArea.cpp b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarVolumePerTimePressureArea.cpp similarity index 92% rename from projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarVolumePerTimePressureArea.cpp rename to projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarVolumePerTimePressureArea.cpp index 455195482..bfe64ce8d 100644 --- a/projects/biogears/libBiogears/unit/cdm/properties/test_core_SEScalarVolumePerTimePressureArea.cpp +++ b/projects/biogears/libBiogears/unit/cdm/properties/test_core_cdm_SEScalarVolumePerTimePressureArea.cpp @@ -57,12 +57,6 @@ void TEST_FIXTURE_NAME::TearDown() { } -TEST_F(TEST_FIXTURE_NAME, Unload) -{ - biogears::SEScalarVolumePerTimePressureArea VolumePerTimePressureArea = biogears::SEScalarVolumePerTimePressureArea(); - auto ptr = VolumePerTimePressureArea.Unload(); - EXPECT_EQ(ptr, nullptr); -} TEST_F(TEST_FIXTURE_NAME, IsValidUnit) { diff --git a/projects/biogears/libBiogears/unit/cdm/substance/test_core_cdm_SESubstance.cpp b/projects/biogears/libBiogears/unit/cdm/substance/test_core_cdm_SESubstance.cpp new file mode 100644 index 000000000..c62cc3ce4 --- /dev/null +++ b/projects/biogears/libBiogears/unit/cdm/substance/test_core_cdm_SESubstance.cpp @@ -0,0 +1,203 @@ +//------------------------------------------------------------------------------------------- +//- Copyright 2017 Applied Research Associates, Inc. +//- Licensed under the Apache License, Version 2.0 (the "License"); you may not use +//- this file except in compliance with the License. You may obtain a copy of the License +//- at: +//- http://www.apache.org/licenses/LICENSE-2.0 +//- Unless required by applicable law or agreed to in writing, software distributed under +//- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +//- CONDITIONS OF ANY KIND, either express or implied. See the License for the +//- specific language governing permissions and limitations under the License. +//------------------------------------------------------------------------------------------- +//! +//! @author David Lee +//! @date 2017 Aug 3rd +//! +//! Unit Test for Biogears-common Config +//! +#include + +#include + +#include +#include +#include + +#ifdef DISABLE_BIOGEARS_SESubstance_TEST +#define TEST_FIXTURE_NAME DISABLED_SESubstance_Fixture +#else +#define TEST_FIXTURE_NAME SESSubstance_Fixture +#endif + +using namespace biogears; +// The fixture for testing class Foo. +class TEST_FIXTURE_NAME : public ::testing::Test { +protected: + // You can do set-up work for each test here. + TEST_FIXTURE_NAME() = default; + + // You can do clean-up work that doesn't throw exceptions here. + virtual ~TEST_FIXTURE_NAME() = default; + + // If the constructor and destructor are not enough for setting up + // and cleaning up each test, you can define the following methods: + + // Code here will be called immediately after the constructor (right + // before each test). + virtual void SetUp() override; + + // Code here will be called immediately after each test (right + // before the destructor). + virtual void TearDown() override; + + biogears::Logger* logger; + biogears::SESubstance* cs; +}; +void TEST_FIXTURE_NAME::SetUp() +{ + logger = new biogears::Logger; + cs = new biogears::SESubstance(logger); +} +void TEST_FIXTURE_NAME::TearDown() +{ +} + +TEST_F(TEST_FIXTURE_NAME, GetScalar) +{ + EXPECT_TRUE(true); +} + +TEST_F(TEST_FIXTURE_NAME, GetName) +{ + EXPECT_TRUE(true); +} + +TEST_F(TEST_FIXTURE_NAME, GetState) +{ + EXPECT_TRUE(true); +} + +TEST_F(TEST_FIXTURE_NAME, GetClassification) +{ + EXPECT_TRUE(true); +} + +TEST_F(TEST_FIXTURE_NAME, GetDensity) +{ + EXPECT_TRUE(true); +} + +TEST_F(TEST_FIXTURE_NAME, MolarMass) +{ + EXPECT_TRUE(true); +} + +TEST_F(TEST_FIXTURE_NAME, HasMaximumDiffusionFlux) +{ + EXPECT_TRUE(true); +} + +TEST_F(TEST_FIXTURE_NAME, MichaelisCoefficient) +{ + EXPECT_TRUE(true); +} + +TEST_F(TEST_FIXTURE_NAME, MembraneResistance) +{ + EXPECT_TRUE(true); +} + +TEST_F(TEST_FIXTURE_NAME, Aerosolization) +{ + EXPECT_TRUE(true); +} + +TEST_F(TEST_FIXTURE_NAME, AreaUnderCurve) +{ + EXPECT_TRUE(true); +} + +TEST_F(TEST_FIXTURE_NAME, BloodConcentration) +{ + EXPECT_TRUE(true); +} + +TEST_F(TEST_FIXTURE_NAME, EffectSiteConcentration) +{ + +} + +TEST_F(TEST_FIXTURE_NAME, MassInBody) +{ + EXPECT_TRUE(true); +} + +TEST_F(TEST_FIXTURE_NAME, MassInBlood) +{ + EXPECT_TRUE(true); +} + +TEST_F(TEST_FIXTURE_NAME, MassInTissue) +{ + EXPECT_TRUE(true); +} + +TEST_F(TEST_FIXTURE_NAME,PlasmaConcentration) +{ + EXPECT_TRUE(true); +} + +TEST_F(TEST_FIXTURE_NAME, SystemicMassCleared) +{ + EXPECT_TRUE(true); +} + +TEST_F(TEST_FIXTURE_NAME, TissueConcentration) +{ + EXPECT_TRUE(true); +} + +TEST_F(TEST_FIXTURE_NAME, AlveolarTransfer) +{ + EXPECT_TRUE(true); +} + +TEST_F(TEST_FIXTURE_NAME, DiffusingCapacity) +{ + EXPECT_TRUE(true); +} + +TEST_F(TEST_FIXTURE_NAME, EndTidalFraction) +{ + EXPECT_TRUE(true); +} + +TEST_F(TEST_FIXTURE_NAME, EndTidalPressure) +{ + EXPECT_TRUE(true); +} + +TEST_F(TEST_FIXTURE_NAME, RelativeDiffusionCoefficient) +{ + EXPECT_TRUE(true); +} + +TEST_F(TEST_FIXTURE_NAME, SolubilityCoefficient) +{ + EXPECT_TRUE(true); +} + +TEST_F(TEST_FIXTURE_NAME, Clearance) +{ + EXPECT_TRUE(true); +} + +TEST_F(TEST_FIXTURE_NAME, PK) +{ + EXPECT_TRUE(true); +} + +TEST_F(TEST_FIXTURE_NAME, PD) +{ + EXPECT_TRUE(true); +} diff --git a/projects/biogears/libBiogears/unit/cdm/substance/test_core_cdm_SESubstanceManager.cpp b/projects/biogears/libBiogears/unit/cdm/substance/test_core_cdm_SESubstanceManager.cpp new file mode 100644 index 000000000..78d64857b --- /dev/null +++ b/projects/biogears/libBiogears/unit/cdm/substance/test_core_cdm_SESubstanceManager.cpp @@ -0,0 +1,113 @@ +//------------------------------------------------------------------------------------------- +//- Copyright 2017 Applied Research Associates, Inc. +//- Licensed under the Apache License, Version 2.0 (the "License"); you may not use +//- this file except in compliance with the License. You may obtain a copy of the License +//- at: +//- http://www.apache.org/licenses/LICENSE-2.0 +//- Unless required by applicable law or agreed to in writing, software distributed under +//- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +//- CONDITIONS OF ANY KIND, either express or implied. See the License for the +//- specific language governing permissions and limitations under the License. +//------------------------------------------------------------------------------------------- +//! +//! @author David Lee +//! @date 2017 Aug 3rd +//! +//! Unit Test for Biogears-common Config +//! +#include + +#include + +#include +#include +#include + +#ifdef DISABLE_BIOGEARS_SESubstanceManager_TEST +#define TEST_FIXTURE_NAME DISABLED_SESubstanceManager_Fixture +#else +#define TEST_FIXTURE_NAME SESSubstanceManager_Fixture +#endif + +using namespace biogears; +// The fixture for testing class Foo. +class TEST_FIXTURE_NAME : public ::testing::Test { +protected: + // You can do set-up work for each test here. + TEST_FIXTURE_NAME() = default; + + // You can do clean-up work that doesn't throw exceptions here. + virtual ~TEST_FIXTURE_NAME() = default; + + // If the constructor and destructor are not enough for setting up + // and cleaning up each test, you can define the following methods: + + // Code here will be called immediately after the constructor (right + // before each test). + virtual void SetUp() override; + + // Code here will be called immediately after each test (right + // before the destructor). + virtual void TearDown() override; + + biogears::Logger* logger; + biogears::SESubstanceManager* cs; +}; +void TEST_FIXTURE_NAME::SetUp() +{ + logger = new biogears::Logger; + cs = new biogears::SESubstanceManager(logger); +} +void TEST_FIXTURE_NAME::TearDown() +{ +} + +TEST_F(TEST_FIXTURE_NAME, Clear) +{ + +} + +TEST_F(TEST_FIXTURE_NAME, Reset) +{ + cs->LoadSubstanceDirectory(); + cs->Reset(); +} + +TEST_F(TEST_FIXTURE_NAME, LoadSubstanceDirectory) +{ + cs->LoadSubstanceDirectory(); + +} + +TEST_F(TEST_FIXTURE_NAME, Substances) +{ +} + +TEST_F(TEST_FIXTURE_NAME, ActiveSubstances) +{ +} + + +TEST_F(TEST_FIXTURE_NAME, ActiveGases) +{ +} + +TEST_F(TEST_FIXTURE_NAME, ActiveLiquids) +{ +} + +TEST_F(TEST_FIXTURE_NAME, ActiveDrugs) +{ +} + +TEST_F(TEST_FIXTURE_NAME, Compounds) +{ +} + +TEST_F(TEST_FIXTURE_NAME, ActiveCompounds) +{ +} + +TEST_F(TEST_FIXTURE_NAME, ReadSubstanceFile) +{ +} \ No newline at end of file diff --git a/projects/biogears/libBiogears/unit/cdm/system/equipment/Inhaler/test_core_SEInhaler.cpp b/projects/biogears/libBiogears/unit/cdm/system/equipment/Inhaler/test_core_cdm_SEInhaler.cpp similarity index 97% rename from projects/biogears/libBiogears/unit/cdm/system/equipment/Inhaler/test_core_SEInhaler.cpp rename to projects/biogears/libBiogears/unit/cdm/system/equipment/Inhaler/test_core_cdm_SEInhaler.cpp index e420f0a5b..a40d4025a 100644 --- a/projects/biogears/libBiogears/unit/cdm/system/equipment/Inhaler/test_core_SEInhaler.cpp +++ b/projects/biogears/libBiogears/unit/cdm/system/equipment/Inhaler/test_core_cdm_SEInhaler.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #ifdef DISABLE_BIOGEARS_SEInhaler_TEST #define TEST_FIXTURE_NAME DISABLED_SEInhaler_Fixture diff --git a/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SEBloodChemistrySystem.cpp b/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SEBloodChemistrySystem.cpp similarity index 99% rename from projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SEBloodChemistrySystem.cpp rename to projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SEBloodChemistrySystem.cpp index 47cff08ac..71dabad23 100644 --- a/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SEBloodChemistrySystem.cpp +++ b/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SEBloodChemistrySystem.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #ifdef DISABLE_BIOGEARS_SEBloodChemistrySystem_TEST #define TEST_FIXTURE_NAME DISABLED_SEBloodChemistrySystem_Fixture diff --git a/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SECardiovascularSystem.cpp b/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SECardiovascularSystem.cpp similarity index 98% rename from projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SECardiovascularSystem.cpp rename to projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SECardiovascularSystem.cpp index f9f3b0709..a4b258353 100644 --- a/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SECardiovascularSystem.cpp +++ b/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SECardiovascularSystem.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #ifdef DISABLE_BIOGEARS_SECardiovascularSystem_TEST #define TEST_FIXTURE_NAME DISABLED_SECardiovascularSystem_Fixture @@ -185,14 +185,14 @@ TEST_F(TEST_FIXTURE_NAME, HeartRhythm) { EXPECT_FALSE( cs->HasHeartRhythm()); cs->GetHeartRhythm(); - cs->SetHeartRhythm(CDM::enumHeartRhythm::Asystole); + cs->SetHeartRhythm(SEHeartRhythm::Asystole); EXPECT_TRUE( cs->HasHeartRhythm()); - EXPECT_EQ(CDM::enumHeartRhythm::Asystole, cs->GetHeartRhythm()); + EXPECT_EQ(SEHeartRhythm::Asystole, cs->GetHeartRhythm()); const biogears::SECardiovascularSystem ccs(logger); EXPECT_FALSE( ccs.HasHeartRhythm()); auto dvalue = ccs.GetHeartRhythm(); - EXPECT_EQ((CDM::enumHeartRhythm::value)-1, dvalue); + EXPECT_EQ(SEHeartRhythm::Invalid, dvalue); } TEST_F(TEST_FIXTURE_NAME, HeartStrokeVolume) { diff --git a/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SEDrugSystem.cpp b/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SEDrugSystem.cpp similarity index 99% rename from projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SEDrugSystem.cpp rename to projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SEDrugSystem.cpp index d6ae872fc..240544249 100644 --- a/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SEDrugSystem.cpp +++ b/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SEDrugSystem.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #ifdef DISABLE_BIOGEARS_SEDrugSystem_TEST #define TEST_FIXTURE_NAME DISABLED_SEDrugSystem_Fixture diff --git a/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SEEndocrineSystem.cpp b/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SEEndocrineSystem.cpp similarity index 98% rename from projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SEEndocrineSystem.cpp rename to projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SEEndocrineSystem.cpp index ecb559a5e..3def057da 100644 --- a/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SEEndocrineSystem.cpp +++ b/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SEEndocrineSystem.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #ifdef DISABLE_BIOGEARS_SEEndocrineSystem_TEST #define TEST_FIXTURE_NAME DISABLED_SEEndocrineSystem_Fixture diff --git a/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SEEnergySystem.cpp b/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SEEnergySystem.cpp similarity index 99% rename from projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SEEnergySystem.cpp rename to projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SEEnergySystem.cpp index a9e11328b..8ac470da4 100644 --- a/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SEEnergySystem.cpp +++ b/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SEEnergySystem.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #ifdef DISABLE_BIOGEARS_SEEnergySystem_TEST #define TEST_FIXTURE_NAME DISABLED_SEEnergySystem_Fixture diff --git a/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SEGastrointestinalSystem.cpp b/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SEGastrointestinalSystem.cpp similarity index 98% rename from projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SEGastrointestinalSystem.cpp rename to projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SEGastrointestinalSystem.cpp index 2e0066f7d..2386956ce 100644 --- a/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SEGastrointestinalSystem.cpp +++ b/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SEGastrointestinalSystem.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #ifdef DISABLE_BIOGEARS_SEGastrointestinalSystem_TEST #define TEST_FIXTURE_NAME DISABLED_SEGastrointestinalSystem_Fixture diff --git a/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SEHepaticSystem.cpp b/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SEHepaticSystem.cpp similarity index 98% rename from projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SEHepaticSystem.cpp rename to projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SEHepaticSystem.cpp index df339860e..d1645d0f2 100644 --- a/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SEHepaticSystem.cpp +++ b/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SEHepaticSystem.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #ifdef DISABLE_BIOGEARS_SEHepaticSystem_TEST #define TEST_FIXTURE_NAME DISABLED_SEHepaticSystem_Fixture diff --git a/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SENervousSystem.cpp b/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SENervousSystem.cpp similarity index 99% rename from projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SENervousSystem.cpp rename to projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SENervousSystem.cpp index 584ecec9d..ec2179f68 100644 --- a/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SENervousSystem.cpp +++ b/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SENervousSystem.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #ifdef DISABLE_BIOGEARS_SENervousSystem_TEST #define TEST_FIXTURE_NAME DISABLED_Core_SENervousSystem_Fixture diff --git a/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SERenalSystem.cpp b/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SERenalSystem.cpp similarity index 99% rename from projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SERenalSystem.cpp rename to projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SERenalSystem.cpp index ff5e1db9f..189cc9349 100644 --- a/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SERenalSystem.cpp +++ b/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SERenalSystem.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #ifdef DISABLE_BIOGEARS_SERenalSystem_TEST #define TEST_FIXTURE_NAME DISABLED_SERenalSystem_Fixture diff --git a/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SERespiratorySystem.cpp b/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SERespiratorySystem.cpp similarity index 99% rename from projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SERespiratorySystem.cpp rename to projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SERespiratorySystem.cpp index 9b7d91cba..a5a3af814 100644 --- a/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SERespiratorySystem.cpp +++ b/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SERespiratorySystem.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #ifdef DISABLE_BIOGEARS_SERespiratorySystem_TEST #define TEST_FIXTURE_NAME DISABLED_SERespiratorySystem_Fixture diff --git a/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SETissueSystem.cpp b/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SETissueSystem.cpp similarity index 99% rename from projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SETissueSystem.cpp rename to projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SETissueSystem.cpp index 83217a946..75de8a70e 100644 --- a/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_SETissueSystem.cpp +++ b/projects/biogears/libBiogears/unit/cdm/system/physiology/test_core_cdm_SETissueSystem.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #ifdef DISABLE_BIOGEARS_SETissueSystem_TEST #define TEST_FIXTURE_NAME DISABLED_SETissueSystem_Fixture diff --git a/projects/biogears/libBiogears/unit/engine/Controller/test_core_cdm_SESubstance.cpp b/projects/biogears/libBiogears/unit/engine/Controller/test_core_cdm_SESubstance.cpp new file mode 100644 index 000000000..9b020c7f0 --- /dev/null +++ b/projects/biogears/libBiogears/unit/engine/Controller/test_core_cdm_SESubstance.cpp @@ -0,0 +1,122 @@ +//------------------------------------------------------------------------------------------- +//- Copyright 2017 Applied Research Associates, Inc. +//- Licensed under the Apache License, Version 2.0 (the "License"); you may not use +//- this file except in compliance with the License. You may obtain a copy of the License +//- at: +//- http://www.apache.org/licenses/LICENSE-2.0 +//- Unless required by applicable law or agreed to in writing, software distributed under +//- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +//- CONDITIONS OF ANY KIND, either express or implied. See the License for the +//- specific language governing permissions and limitations under the License. +//------------------------------------------------------------------------------------------- +//! +//! @author David Lee +//! @date 2017 Aug 3rd +//! +//! Unit Test for Biogears-common Config +//! +#include + +#include + +#include +#include +#include +#include +#include + +#ifdef DISABLE_BIOGEARS_BioGearsSubstances_TEST +#define TEST_FIXTURE_NAME DISABLED_BioGearsSubstances_Fixture +#else +#define TEST_FIXTURE_NAME BioGearsSubstances_Fixture +#endif + +using namespace biogears; +// The fixture for testing class Foo. +class TEST_FIXTURE_NAME : public ::testing::Test { +protected: + // You can do set-up work for each test here. + TEST_FIXTURE_NAME() = default; + + // You can do clean-up work that doesn't throw exceptions here. + virtual ~TEST_FIXTURE_NAME() = default; + + // If the constructor and destructor are not enough for setting up + // and cleaning up each test, you can define the following methods: + + // Code here will be called immediately after the constructor (right + // before each test). + virtual void SetUp() override; + + // Code here will be called immediately after each test (right + // before the destructor). + virtual void TearDown() override; + + biogears::Logger* logger; + std::unique_ptr bg; + biogears::BioGearsSubstances* bs; +}; +void TEST_FIXTURE_NAME::SetUp() +{ + logger = new biogears::Logger; + bg = std::make_unique(logger); + bs = new biogears::BioGearsSubstances(*bg); + bs->LoadSubstanceDirectory(); +} +void TEST_FIXTURE_NAME::TearDown() +{ + bg.reset(); + delete logger; +} + +TEST_F(TEST_FIXTURE_NAME, Clear) +{ + bs->Invalidate(); +} + +TEST_F(TEST_FIXTURE_NAME, Reset) +{ + + bs->Reset(); +} + +TEST_F(TEST_FIXTURE_NAME, LoadSubstanceDirectory) +{ + bs->LoadSubstanceDirectory(); +} + +TEST_F(TEST_FIXTURE_NAME, Substances) +{ + auto& albumin = bs->GetAlbumin(); + { + auto albumin2 = albumin; + } + } + +TEST_F(TEST_FIXTURE_NAME, ActiveSubstances) +{ +} + +TEST_F(TEST_FIXTURE_NAME, ActiveGases) +{ +} + +TEST_F(TEST_FIXTURE_NAME, ActiveLiquids) +{ +} + +TEST_F(TEST_FIXTURE_NAME, ActiveDrugs) +{ +} + +TEST_F(TEST_FIXTURE_NAME, Compounds) +{ +} + +TEST_F(TEST_FIXTURE_NAME, ActiveCompounds) +{ +} + +TEST_F(TEST_FIXTURE_NAME, ReadSubstanceFile) +{ +} diff --git a/projects/biogears/libBiogears/unit/io/biogears/test_BioGears.cpp b/projects/biogears/libBiogears/unit/io/biogears/test_BioGears.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libBiogears/unit/io/biogears/test_BioGearsConfiguration.cpp b/projects/biogears/libBiogears/unit/io/biogears/test_BioGearsConfiguration.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libBiogears/unit/io/biogears/test_BioGearsEnvironment.cpp b/projects/biogears/libBiogears/unit/io/biogears/test_BioGearsEnvironment.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libBiogears/unit/io/biogears/test_BioGearsEquipment.cpp b/projects/biogears/libBiogears/unit/io/biogears/test_BioGearsEquipment.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libBiogears/unit/io/biogears/test_BioGearsPhyisiology.cpp b/projects/biogears/libBiogears/unit/io/biogears/test_BioGearsPhyisiology.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libIO/unit/io/biogears/test_core_io_BioGears.cpp b/projects/biogears/libBiogears/unit/io/biogears/test_core_io_BioGears.cpp similarity index 100% rename from projects/biogears/libIO/unit/io/biogears/test_core_io_BioGears.cpp rename to projects/biogears/libBiogears/unit/io/biogears/test_core_io_BioGears.cpp diff --git a/projects/biogears/libIO/unit/io/biogears/test_core_io_BioGearsConfiguration.cpp b/projects/biogears/libBiogears/unit/io/biogears/test_core_io_BioGearsConfiguration.cpp similarity index 100% rename from projects/biogears/libIO/unit/io/biogears/test_core_io_BioGearsConfiguration.cpp rename to projects/biogears/libBiogears/unit/io/biogears/test_core_io_BioGearsConfiguration.cpp diff --git a/projects/biogears/libIO/unit/io/biogears/test_core_io_BioGearsEnvironment.cpp b/projects/biogears/libBiogears/unit/io/biogears/test_core_io_BioGearsEnvironment.cpp similarity index 100% rename from projects/biogears/libIO/unit/io/biogears/test_core_io_BioGearsEnvironment.cpp rename to projects/biogears/libBiogears/unit/io/biogears/test_core_io_BioGearsEnvironment.cpp diff --git a/projects/biogears/libIO/unit/io/biogears/test_core_io_BioGearsEquipmentm.cpp b/projects/biogears/libBiogears/unit/io/biogears/test_core_io_BioGearsEquipmentm.cpp similarity index 100% rename from projects/biogears/libIO/unit/io/biogears/test_core_io_BioGearsEquipmentm.cpp rename to projects/biogears/libBiogears/unit/io/biogears/test_core_io_BioGearsEquipmentm.cpp diff --git a/projects/biogears/libIO/unit/io/biogears/test_core_io_BioGearsEquipmentmBioGearsPhysiology.cpp b/projects/biogears/libBiogears/unit/io/biogears/test_core_io_BioGearsEquipmentmBioGearsPhysiology.cpp similarity index 100% rename from projects/biogears/libIO/unit/io/biogears/test_core_io_BioGearsEquipmentmBioGearsPhysiology.cpp rename to projects/biogears/libBiogears/unit/io/biogears/test_core_io_BioGearsEquipmentmBioGearsPhysiology.cpp diff --git a/projects/biogears/libIO/unit/io/biogears/test_core_io_BioGearsPhysiology.cpp b/projects/biogears/libBiogears/unit/io/biogears/test_core_io_BioGearsPhysiology.cpp similarity index 100% rename from projects/biogears/libIO/unit/io/biogears/test_core_io_BioGearsPhysiology.cpp rename to projects/biogears/libBiogears/unit/io/biogears/test_core_io_BioGearsPhysiology.cpp diff --git a/projects/biogears/libBiogears/unit/io/cdm/test_Anesthesia.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_Anesthesia.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libBiogears/unit/io/cdm/test_AnesthesiaActions.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_AnesthesiaActions.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libBiogears/unit/io/cdm/test_Circuit.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_Circuit.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libBiogears/unit/io/cdm/test_Compartment.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_Compartment.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libBiogears/unit/io/cdm/test_ElectroCardioGram.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_ElectroCardioGram.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libBiogears/unit/io/cdm/test_EngineConfiguration.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_EngineConfiguration.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libBiogears/unit/io/cdm/test_EngineState.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_EngineState.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libBiogears/unit/io/cdm/test_Environment.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_Environment.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libBiogears/unit/io/cdm/test_EnvironmentActions.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_EnvironmentActions.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libBiogears/unit/io/cdm/test_EnvironmentConditions.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_EnvironmentConditions.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libBiogears/unit/io/cdm/test_Inhaler.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_Inhaler.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libBiogears/unit/io/cdm/test_InhalerActions.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_InhalerActions.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libBiogears/unit/io/cdm/test_Patient.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_Patient.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libBiogears/unit/io/cdm/test_PatientActions.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_PatientActions.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libBiogears/unit/io/cdm/test_PatientAssessments.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_PatientAssessments.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libBiogears/unit/io/cdm/test_PatientConditions.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_PatientConditions.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libBiogears/unit/io/cdm/test_PatientNutrition.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_PatientNutrition.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libBiogears/unit/io/cdm/test_Physiology.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_Physiology.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libBiogears/unit/io/cdm/test_Property.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_Property.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libBiogears/unit/io/cdm/test_Scenario.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_Scenario.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libBiogears/unit/io/cdm/test_Substance.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_Substance.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libBiogears/unit/io/cdm/test_SubstanceQuantity.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_SubstanceQuantity.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libBiogears/unit/io/cdm/test_System.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_System.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libBiogears/unit/io/cdm/test_TestReport.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_TestReport.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/biogears/libIO/unit/io/cdm/test_core_io_Anesthesia.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_Anesthesia.cpp similarity index 75% rename from projects/biogears/libIO/unit/io/cdm/test_core_io_Anesthesia.cpp rename to projects/biogears/libBiogears/unit/io/cdm/test_core_io_Anesthesia.cpp index 183c77030..82b50abfc 100644 --- a/projects/biogears/libIO/unit/io/cdm/test_core_io_Anesthesia.cpp +++ b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_Anesthesia.cpp @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -73,8 +74,8 @@ void TEST_FIXTURE_NAME::TearDown() // class SEAnesthesiaMachine; //! //! TYPE AnesthesiaMachine -//! static void Marshall(const CDM::AnesthesiaMachine& in, SEAnesthesiaMachine& out); -//! static void UnMarshall(const SEAnesthesiaMachine& in, CDM::AnesthesiaMachine& out); +//! static void UnMarshall(const CDM::AnesthesiaMachine& in, SEAnesthesiaMachine& out); +//! static void Marshall(const SEAnesthesiaMachine& in, CDM::AnesthesiaMachine& out); TEST_F(TEST_FIXTURE_NAME, AnesthesiaMachine) { USING_TYPES(AnesthesiaMachine) @@ -85,16 +86,16 @@ TEST_F(TEST_FIXTURE_NAME, AnesthesiaMachine) SEType source(mgr), sink(mgr); CDMType data; - auto oxygen = mgr.GetSubstance("Oxygen"); - auto nitrogen = mgr.GetSubstance("Nitrogen"); + auto oxygen = mgr.GetSubstance(biogears::Oxygen); + auto nitrogen = mgr.GetSubstance(biogears::Nitrogen); - source.SetConnection(CDM::enumAnesthesiaMachineConnection::Mask); + source.SetConnection(biogears::SEAnesthesiaMachineConnection::Mask); source.GetInletFlow().SetValue(33, biogears::VolumePerTimeUnit::mL_Per_day); source.GetInspiratoryExpiratoryRatio().SetValue(0.5); source.GetOxygenFraction().SetValue(.04); - source.SetOxygenSource(CDM::enumAnesthesiaMachineOxygenSource::BottleTwo); + source.SetOxygenSource(biogears::SEAnesthesiaMachineOxygenSource::BottleTwo); source.GetPositiveEndExpiredPressure().SetValue(55, biogears::PressureUnit::mmHg); - source.SetPrimaryGas(CDM::enumAnesthesiaMachinePrimaryGas::Nitrogen); + source.SetPrimaryGas(biogears::SEAnesthesiaMachinePrimaryGas::Nitrogen); source.GetRespiratoryRate().SetValue(66, biogears::FrequencyUnit::Per_hr); source.GetReliefValvePressure().SetValue(77, biogears::PressureUnit::mmHg); source.GetVentilatorPressure().SetValue(88, biogears::PressureUnit::mmHg); @@ -102,11 +103,11 @@ TEST_F(TEST_FIXTURE_NAME, AnesthesiaMachine) biogears::SEAnesthesiaMachineChamber lChamber(mgr), rChamber(mgr); biogears::SEAnesthesiaMachineOxygenBottle lBootle(&logger), rBottle(&logger); - source.GetRightChamber().SetState(CDM::enumOnOff::On); + source.GetRightChamber().SetState(biogears::SEOnOff::On); source.GetRightChamber().GetSubstanceFraction().SetValue(.05); source.GetRightChamber().SetSubstance(*oxygen); - source.GetLeftChamber().SetState(CDM::enumOnOff::On); + source.GetLeftChamber().SetState(biogears::SEOnOff::On); source.GetLeftChamber().GetSubstanceFraction().SetValue(.05); source.GetLeftChamber().SetSubstance(*nitrogen); @@ -115,8 +116,8 @@ TEST_F(TEST_FIXTURE_NAME, AnesthesiaMachine) EXPECT_NE(source, sink); - Anesthesia::UnMarshall(source, data); - Anesthesia::Marshall(data, sink); + Anesthesia::Marshall(source, data); + Anesthesia::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -124,8 +125,8 @@ TEST_F(TEST_FIXTURE_NAME, AnesthesiaMachine) // class SEAnesthesiaMachineChamber; //! //! TYPE AnesthesiaMachineChamber -//! static void Marshall(const CDM::AnesthesiaMachineChamber& in, SEAnesthesiaMachineChamber& out); -//! static void UnMarshall(const SEAnesthesiaMachineChamber& in, CDM::AnesthesiaMachineChamber& out); +//! static void UnMarshall(const CDM::AnesthesiaMachineChamber& in, SEAnesthesiaMachineChamber& out); +//! static void Marshall(const SEAnesthesiaMachineChamber& in, CDM::AnesthesiaMachineChamber& out); TEST_F(TEST_FIXTURE_NAME, AnesthesiaMachineChamber) { USING_TYPES(AnesthesiaMachineChamber) @@ -136,17 +137,17 @@ TEST_F(TEST_FIXTURE_NAME, AnesthesiaMachineChamber) SEType source(mgr), sink(mgr); CDMType data; - auto oxygen = mgr.GetSubstance("Oxygen"); - auto nitrogen = mgr.GetSubstance("Nitrogen"); + auto oxygen = mgr.GetSubstance(biogears::Oxygen); + auto nitrogen = mgr.GetSubstance(biogears::Nitrogen); - source.SetState(CDM::enumOnOff::On); + source.SetState(biogears::SEOnOff::On); source.GetSubstanceFraction().SetValue(.05); source.SetSubstance(*oxygen); EXPECT_NE(source, sink); - Anesthesia::UnMarshall(source, data); - Anesthesia::Marshall(data, sink); + Anesthesia::Marshall(source, data); + Anesthesia::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -154,8 +155,8 @@ TEST_F(TEST_FIXTURE_NAME, AnesthesiaMachineChamber) // class SEAnesthesiaMachineOxygenBottle; //! //! TYPE AnesthesiaMachineOxygenBottle -//! static void Marshall(const CDM::AnesthesiaMachineOxygenBottle& in, SEAnesthesiaMachineOxygenBottle& out); -//! static void UnMarshall(const SEAnesthesiaMachineOxygenBottle& in, CDM::AnesthesiaMachineOxygenBottle& out); +//! static void UnMarshall(const CDM::AnesthesiaMachineOxygenBottle& in, SEAnesthesiaMachineOxygenBottle& out); +//! static void Marshall(const SEAnesthesiaMachineOxygenBottle& in, CDM::AnesthesiaMachineOxygenBottle& out); TEST_F(TEST_FIXTURE_NAME, AnesthesiaMachineOxygenBottle) { USING_TYPES(AnesthesiaMachineOxygenBottle) @@ -166,15 +167,15 @@ TEST_F(TEST_FIXTURE_NAME, AnesthesiaMachineOxygenBottle) SEType source(&logger), sink(&logger); CDMType data; - auto oxygen = mgr.GetSubstance("Oxygen"); - auto nitrogen = mgr.GetSubstance("Nitrogen"); + auto oxygen = mgr.GetSubstance(biogears::Oxygen); + auto nitrogen = mgr.GetSubstance(biogears::Nitrogen); source.GetVolume().SetValue(2, biogears::VolumeUnit::L); EXPECT_NE(source, sink); - Anesthesia::UnMarshall(source, data); - Anesthesia::Marshall(data, sink); + Anesthesia::Marshall(source, data); + Anesthesia::UnMarshall(data, sink); EXPECT_EQ(source, sink); } diff --git a/projects/biogears/libIO/unit/io/cdm/test_core_io_AnesthesiaActions.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_AnesthesiaActions.cpp similarity index 68% rename from projects/biogears/libIO/unit/io/cdm/test_core_io_AnesthesiaActions.cpp rename to projects/biogears/libBiogears/unit/io/cdm/test_core_io_AnesthesiaActions.cpp index 20fdf997a..9e2032d5c 100644 --- a/projects/biogears/libIO/unit/io/cdm/test_core_io_AnesthesiaActions.cpp +++ b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_AnesthesiaActions.cpp @@ -20,6 +20,7 @@ #include +#include #include #include #include @@ -71,16 +72,16 @@ void TEST_FIXTURE_NAME::SetUp() machine = new biogears::SEAnesthesiaMachine(*mgr); } - auto oxygen = mgr->GetSubstance("Oxygen"); - auto nitrogen = mgr->GetSubstance("Nitrogen"); + auto oxygen = mgr->GetSubstance(biogears::Oxygen); + auto nitrogen = mgr->GetSubstance(biogears::Nitrogen); - machine->SetConnection(CDM::enumAnesthesiaMachineConnection::Mask); + machine->SetConnection(biogears::SEAnesthesiaMachineConnection::Mask); machine->GetInletFlow().SetValue(33, biogears::VolumePerTimeUnit::mL_Per_day); machine->GetInspiratoryExpiratoryRatio().SetValue(0.5); machine->GetOxygenFraction().SetValue(.04); - machine->SetOxygenSource(CDM::enumAnesthesiaMachineOxygenSource::BottleTwo); + machine->SetOxygenSource(biogears::SEAnesthesiaMachineOxygenSource::BottleTwo); machine->GetPositiveEndExpiredPressure().SetValue(55, biogears::PressureUnit::mmHg); - machine->SetPrimaryGas(CDM::enumAnesthesiaMachinePrimaryGas::Nitrogen); + machine->SetPrimaryGas(biogears::SEAnesthesiaMachinePrimaryGas::Nitrogen); machine->GetRespiratoryRate().SetValue(66, biogears::FrequencyUnit::Per_hr); machine->GetReliefValvePressure().SetValue(77, biogears::PressureUnit::mmHg); machine->GetVentilatorPressure().SetValue(88, biogears::PressureUnit::mmHg); @@ -88,11 +89,11 @@ void TEST_FIXTURE_NAME::SetUp() biogears::SEAnesthesiaMachineChamber lChamber(*mgr), rChamber(*mgr); biogears::SEAnesthesiaMachineOxygenBottle lBootle(&logger), rBottle(&logger); - machine->GetRightChamber().SetState(CDM::enumOnOff::On); + machine->GetRightChamber().SetState(biogears::SEOnOff::On); machine->GetRightChamber().GetSubstanceFraction().SetValue(.05); machine->GetRightChamber().SetSubstance(*oxygen); - machine->GetLeftChamber().SetState(CDM::enumOnOff::On); + machine->GetLeftChamber().SetState(biogears::SEOnOff::On); machine->GetLeftChamber().GetSubstanceFraction().SetValue(.05); machine->GetLeftChamber().SetSubstance(*nitrogen); @@ -102,7 +103,7 @@ void TEST_FIXTURE_NAME::SetUp() void TEST_FIXTURE_NAME::TearDown() { - machine->Clear(); + machine->Invalidate(); } #define USING_TYPES(name) \ @@ -115,8 +116,8 @@ void TEST_FIXTURE_NAME::TearDown() // class SEAnesthesiaMachineConfiguration; //! //! TYPE AnesthesiaMachineConfiguration -//! static void Marshall(const CDM::AnesthesiaMachineConfigurationData& in, SEAnesthesiaMachineConfiguration& out); -//! static void UnMarshall(const SEAnesthesiaMachineConfiguration& in, CDM::AnesthesiaMachineConfigurationData& out); +//! static void UnMarshall(const CDM::AnesthesiaMachineConfigurationData& in, SEAnesthesiaMachineConfiguration& out); +//! static void Marshall(const SEAnesthesiaMachineConfiguration& in, CDM::AnesthesiaMachineConfigurationData& out); TEST_F(TEST_FIXTURE_NAME, AnesthesiaMachineConfiguration) { USING_TYPES(AnesthesiaMachineConfiguration) @@ -127,23 +128,23 @@ TEST_F(TEST_FIXTURE_NAME, AnesthesiaMachineConfiguration) SEType source(mgr), sink(mgr); CDMType data; - auto oxygen = mgr.GetSubstance("Oxygen"); - auto nitrogen = mgr.GetSubstance("Nitrogen"); + auto oxygen = mgr.GetSubstance(biogears::Oxygen); + auto nitrogen = mgr.GetSubstance(biogears::Nitrogen); - source.GetConfiguration().SetConnection(CDM::enumAnesthesiaMachineConnection::Mask); + source.GetConfiguration().SetConnection(biogears::SEAnesthesiaMachineConnection::Mask); source.GetConfiguration().GetInletFlow().SetValue(33, biogears::VolumePerTimeUnit::mL_Per_day); source.GetConfiguration().GetInspiratoryExpiratoryRatio().SetValue(0.5); source.GetConfiguration().GetOxygenFraction().SetValue(0.5); - source.GetConfiguration().SetOxygenSource(CDM::enumAnesthesiaMachineOxygenSource::BottleTwo); + source.GetConfiguration().SetOxygenSource(biogears::SEAnesthesiaMachineOxygenSource::BottleTwo); source.GetConfiguration().GetPositiveEndExpiredPressure().SetValue(55, biogears::PressureUnit::mmHg); - source.GetConfiguration().SetPrimaryGas(CDM::enumAnesthesiaMachinePrimaryGas::Nitrogen); + source.GetConfiguration().SetPrimaryGas(biogears::SEAnesthesiaMachinePrimaryGas::Nitrogen); source.GetConfiguration().GetRespiratoryRate().SetValue(66, biogears::FrequencyUnit::Per_hr); source.GetConfiguration().GetReliefValvePressure().SetValue(77, biogears::PressureUnit::mmHg); source.GetConfiguration().GetVentilatorPressure().SetValue(88, biogears::PressureUnit::mmHg); - source.GetConfiguration().GetRightChamber().SetState(CDM::enumOnOff::On); + source.GetConfiguration().GetRightChamber().SetState(biogears::SEOnOff::On); source.GetConfiguration().GetRightChamber().GetSubstanceFraction().SetValue(0.5); source.GetConfiguration().GetRightChamber().SetSubstance(*oxygen); - source.GetConfiguration().GetLeftChamber().SetState(CDM::enumOnOff::On); + source.GetConfiguration().GetLeftChamber().SetState(biogears::SEOnOff::On); source.GetConfiguration().GetLeftChamber().GetSubstanceFraction().SetValue(0.5); source.GetConfiguration().GetLeftChamber().SetSubstance(*nitrogen); source.GetConfiguration().GetOxygenBottleOne().GetVolume().SetValue(3, biogears::VolumeUnit::L); @@ -151,8 +152,8 @@ TEST_F(TEST_FIXTURE_NAME, AnesthesiaMachineConfiguration) EXPECT_NE(source, sink); - AnesthesiaActions::UnMarshall(source, data); - AnesthesiaActions::Marshall(data, sink); + AnesthesiaActions::Marshall(source, data); + AnesthesiaActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -161,8 +162,8 @@ TEST_F(TEST_FIXTURE_NAME, AnesthesiaMachineConfiguration) // class SEExpiratoryValveLeak; //! //! TYPE ExpiratoryValveLeak -//! static void Marshall(const CDM::ExpiratoryValveLeakData& in, SEExpiratoryValveLeak& out); -//! static void UnMarshall(const SEExpiratoryValveLeak& in, CDM::ExpiratoryValveLeakData& out); +//! static void UnMarshall(const CDM::ExpiratoryValveLeakData& in, SEExpiratoryValveLeak& out); +//! static void Marshall(const SEExpiratoryValveLeak& in, CDM::ExpiratoryValveLeakData& out); TEST_F(TEST_FIXTURE_NAME, ExpiratoryValveLeak) { USING_TYPES(ExpiratoryValveLeak) @@ -175,8 +176,8 @@ TEST_F(TEST_FIXTURE_NAME, ExpiratoryValveLeak) EXPECT_NE(source, sink); - AnesthesiaActions::UnMarshall(source, data); - AnesthesiaActions::Marshall(data, sink); + AnesthesiaActions::Marshall(source, data); + AnesthesiaActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -185,8 +186,8 @@ TEST_F(TEST_FIXTURE_NAME, ExpiratoryValveLeak) // class SEExpiratoryValveObstruction; //! //! TYPE ExpiratoryValveObstruction -//! static void Marshall(const CDM::ExpiratoryValveObstructionData& in, SEExpiratoryValveObstruction& out); -//! static void UnMarshall(const SEExpiratoryValveObstruction& in, CDM::ExpiratoryValveObstructionData& out); +//! static void UnMarshall(const CDM::ExpiratoryValveObstructionData& in, SEExpiratoryValveObstruction& out); +//! static void Marshall(const SEExpiratoryValveObstruction& in, CDM::ExpiratoryValveObstructionData& out); TEST_F(TEST_FIXTURE_NAME, ExpiratoryValveObstruction) { USING_TYPES(ExpiratoryValveObstruction) @@ -199,8 +200,8 @@ TEST_F(TEST_FIXTURE_NAME, ExpiratoryValveObstruction) EXPECT_NE(source, sink); - AnesthesiaActions::UnMarshall(source, data); - AnesthesiaActions::Marshall(data, sink); + AnesthesiaActions::Marshall(source, data); + AnesthesiaActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -208,8 +209,8 @@ TEST_F(TEST_FIXTURE_NAME, ExpiratoryValveObstruction) // class SEInspiratoryValveLeak; //! //! TYPE InspiratoryValveLeak -//! static void Marshall(const CDM::InspiratoryValveLeakData& in, SEInspiratoryValveLeak& out); -//! static void UnMarshall(const SEInspiratoryValveLeak& in, CDM::InspiratoryValveLeakData& out); +//! static void UnMarshall(const CDM::InspiratoryValveLeakData& in, SEInspiratoryValveLeak& out); +//! static void Marshall(const SEInspiratoryValveLeak& in, CDM::InspiratoryValveLeakData& out); TEST_F(TEST_FIXTURE_NAME, InspiratoryValveLeak) { USING_TYPES(InspiratoryValveLeak) @@ -222,8 +223,8 @@ TEST_F(TEST_FIXTURE_NAME, InspiratoryValveLeak) EXPECT_NE(source, sink); - AnesthesiaActions::UnMarshall(source, data); - AnesthesiaActions::Marshall(data, sink); + AnesthesiaActions::Marshall(source, data); + AnesthesiaActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -231,8 +232,8 @@ TEST_F(TEST_FIXTURE_NAME, InspiratoryValveLeak) // class SEInspiratoryValveObstruction; //! //! TYPE InspiratoryValveObstruction -//! static void Marshall(const CDM::InspiratoryValveObstructionData& in, SEInspiratoryValveObstruction& out); -//! static void UnMarshall(const SEInspiratoryValveObstruction& in, CDM::InspiratoryValveObstructionData& out); +//! static void UnMarshall(const CDM::InspiratoryValveObstructionData& in, SEInspiratoryValveObstruction& out); +//! static void Marshall(const SEInspiratoryValveObstruction& in, CDM::InspiratoryValveObstructionData& out); TEST_F(TEST_FIXTURE_NAME, InspiratoryValveObstruction) { USING_TYPES(InspiratoryValveObstruction) @@ -245,8 +246,8 @@ TEST_F(TEST_FIXTURE_NAME, InspiratoryValveObstruction) EXPECT_NE(source, sink); - AnesthesiaActions::UnMarshall(source, data); - AnesthesiaActions::Marshall(data, sink); + AnesthesiaActions::Marshall(source, data); + AnesthesiaActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -254,8 +255,8 @@ TEST_F(TEST_FIXTURE_NAME, InspiratoryValveObstruction) // class SEMaskLeak; //! //! TYPE MaskLeak -//! static void Marshall(const CDM::MaskLeakData& in, SEMaskLeak& out); -//! static void UnMarshall(const SEMaskLeak& in, CDM::MaskLeakData& out); +//! static void UnMarshall(const CDM::MaskLeakData& in, SEMaskLeak& out); +//! static void Marshall(const SEMaskLeak& in, CDM::MaskLeakData& out); TEST_F(TEST_FIXTURE_NAME, MaskLeak) { USING_TYPES(MaskLeak) @@ -268,8 +269,8 @@ TEST_F(TEST_FIXTURE_NAME, MaskLeak) EXPECT_NE(source, sink); - AnesthesiaActions::UnMarshall(source, data); - AnesthesiaActions::Marshall(data, sink); + AnesthesiaActions::Marshall(source, data); + AnesthesiaActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -277,8 +278,8 @@ TEST_F(TEST_FIXTURE_NAME, MaskLeak) // class SESodaLimeFailure; //! //! TYPE SodaLimeFailure -//! static void Marshall(const CDM::SodaLimeFailureData& in, SESodaLimeFailure& out); -//! static void UnMarshall(const SESodaLimeFailure& in, CDM::SodaLimeFailureData& out); +//! static void UnMarshall(const CDM::SodaLimeFailureData& in, SESodaLimeFailure& out); +//! static void Marshall(const SESodaLimeFailure& in, CDM::SodaLimeFailureData& out); TEST_F(TEST_FIXTURE_NAME, SodaLimeFailure) { USING_TYPES(SodaLimeFailure) @@ -291,8 +292,8 @@ TEST_F(TEST_FIXTURE_NAME, SodaLimeFailure) EXPECT_NE(source, sink); - AnesthesiaActions::UnMarshall(source, data); - AnesthesiaActions::Marshall(data, sink); + AnesthesiaActions::Marshall(source, data); + AnesthesiaActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -300,8 +301,8 @@ TEST_F(TEST_FIXTURE_NAME, SodaLimeFailure) // class SETubeCuffLeak; //! //! TYPE TubeCuffLeak -//! static void Marshall(const CDM::TubeCuffLeakData& in, SETubeCuffLeak& out); -//! static void UnMarshall(const SETubeCuffLeak& in, CDM::TubeCuffLeakData& out); +//! static void UnMarshall(const CDM::TubeCuffLeakData& in, SETubeCuffLeak& out); +//! static void Marshall(const SETubeCuffLeak& in, CDM::TubeCuffLeakData& out); TEST_F(TEST_FIXTURE_NAME, TubeCuffLeak) { USING_TYPES(TubeCuffLeak) @@ -314,8 +315,8 @@ TEST_F(TEST_FIXTURE_NAME, TubeCuffLeak) EXPECT_NE(source, sink); - AnesthesiaActions::UnMarshall(source, data); - AnesthesiaActions::Marshall(data, sink); + AnesthesiaActions::Marshall(source, data); + AnesthesiaActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -323,8 +324,8 @@ TEST_F(TEST_FIXTURE_NAME, TubeCuffLeak) // class SEVaporizerFailure; //! //! TYPE VaporizerFailure -//! static void Marshall(const CDM::VaporizerFailureData& in, SEVaporizerFailure& out); -//! static void UnMarshall(const SEVaporizerFailure& in, CDM::VaporizerFailureData& out); +//! static void UnMarshall(const CDM::VaporizerFailureData& in, SEVaporizerFailure& out); +//! static void Marshall(const SEVaporizerFailure& in, CDM::VaporizerFailureData& out); TEST_F(TEST_FIXTURE_NAME, VaporizerFailure) { USING_TYPES(VaporizerFailure) @@ -337,8 +338,8 @@ TEST_F(TEST_FIXTURE_NAME, VaporizerFailure) EXPECT_NE(source, sink); - AnesthesiaActions::UnMarshall(source, data); - AnesthesiaActions::Marshall(data, sink); + AnesthesiaActions::Marshall(source, data); + AnesthesiaActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -346,8 +347,8 @@ TEST_F(TEST_FIXTURE_NAME, VaporizerFailure) // class SEVentilatorPressureLoss; //! //! TYPE VentilatorPressureLoss -//! static void Marshall(const CDM::VentilatorPressureLossData& in, SEVentilatorPressureLoss& out); -//! static void UnMarshall(const SEVentilatorPressureLoss& in, CDM::VentilatorPressureLossData& out); +//! static void UnMarshall(const CDM::VentilatorPressureLossData& in, SEVentilatorPressureLoss& out); +//! static void Marshall(const SEVentilatorPressureLoss& in, CDM::VentilatorPressureLossData& out); TEST_F(TEST_FIXTURE_NAME, VentilatorPressureLoss) { USING_TYPES(VentilatorPressureLoss) @@ -360,8 +361,8 @@ TEST_F(TEST_FIXTURE_NAME, VentilatorPressureLoss) EXPECT_NE(source, sink); - AnesthesiaActions::UnMarshall(source, data); - AnesthesiaActions::Marshall(data, sink); + AnesthesiaActions::Marshall(source, data); + AnesthesiaActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -369,8 +370,8 @@ TEST_F(TEST_FIXTURE_NAME, VentilatorPressureLoss) // class SEYPieceDisconnect; //! //! TYPE YPieceDisconnect -//! static void Marshall(const CDM::YPieceDisconnectData& in, SEYPieceDisconnect& out); -//! static void UnMarshall(const SEYPieceDisconnect& in, CDM::YPieceDisconnectData& out); +//! static void UnMarshall(const CDM::YPieceDisconnectData& in, SEYPieceDisconnect& out); +//! static void Marshall(const SEYPieceDisconnect& in, CDM::YPieceDisconnectData& out); TEST_F(TEST_FIXTURE_NAME, YPieceDisconnect) { USING_TYPES(YPieceDisconnect) @@ -383,8 +384,8 @@ TEST_F(TEST_FIXTURE_NAME, YPieceDisconnect) EXPECT_NE(source, sink); - AnesthesiaActions::UnMarshall(source, data); - AnesthesiaActions::Marshall(data, sink); + AnesthesiaActions::Marshall(source, data); + AnesthesiaActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -392,8 +393,8 @@ TEST_F(TEST_FIXTURE_NAME, YPieceDisconnect) // class SEOxygenWallPortPressureLoss; //! //! TYPE OxygenWallPortPressureLoss -//! static void Marshall(const CDM::OxygenWallPortPressureLossData& in, SEOxygenWallPortPressureLoss& out); -//! static void UnMarshall(const SEOxygenWallPortPressureLoss& in, CDM::OxygenWallPortPressureLossData& out); +//! static void UnMarshall(const CDM::OxygenWallPortPressureLossData& in, SEOxygenWallPortPressureLoss& out); +//! static void Marshall(const SEOxygenWallPortPressureLoss& in, CDM::OxygenWallPortPressureLossData& out); TEST_F(TEST_FIXTURE_NAME, OxygenWallPortPressureLoss) { USING_TYPES(OxygenWallPortPressureLoss) @@ -406,8 +407,8 @@ TEST_F(TEST_FIXTURE_NAME, OxygenWallPortPressureLoss) EXPECT_NE(source, sink); - AnesthesiaActions::UnMarshall(source, data); - AnesthesiaActions::Marshall(data, sink); + AnesthesiaActions::Marshall(source, data); + AnesthesiaActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -415,8 +416,8 @@ TEST_F(TEST_FIXTURE_NAME, OxygenWallPortPressureLoss) // class SEOxygenTankPressureLoss; //! //! TYPE OxygenTankPressureLoss -//! static void Marshall(const CDM::OxygenTankPressureLossData& in, SEOxygenTankPressureLoss& out); -//! static void UnMarshall(const SEOxygenTankPressureLoss& in, CDM::OxygenTankPressureLossData& out); +//! static void UnMarshall(const CDM::OxygenTankPressureLossData& in, SEOxygenTankPressureLoss& out); +//! static void Marshall(const SEOxygenTankPressureLoss& in, CDM::OxygenTankPressureLossData& out); TEST_F(TEST_FIXTURE_NAME, OxygenTankPressureLoss) { USING_TYPES(OxygenTankPressureLoss) @@ -429,8 +430,8 @@ TEST_F(TEST_FIXTURE_NAME, OxygenTankPressureLoss) EXPECT_NE(source, sink); - AnesthesiaActions::UnMarshall(source, data); - AnesthesiaActions::Marshall(data, sink); + AnesthesiaActions::Marshall(source, data); + AnesthesiaActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } \ No newline at end of file diff --git a/projects/biogears/libIO/unit/io/cdm/test_core_io_Circuit.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_Circuit.cpp similarity index 91% rename from projects/biogears/libIO/unit/io/cdm/test_core_io_Circuit.cpp rename to projects/biogears/libBiogears/unit/io/cdm/test_core_io_Circuit.cpp index 3f115219f..0cc3c8e39 100644 --- a/projects/biogears/libIO/unit/io/cdm/test_core_io_Circuit.cpp +++ b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_Circuit.cpp @@ -20,8 +20,8 @@ #include -#include -#include +#include +#include #include #include #include @@ -101,10 +101,10 @@ class SECircuitManager; //! Abstract class SEGasCircuit //! TYPE GasCircuit -//! static void Marshall(const CDM::GasCircuit& in, SEGasCircuit& out); -//! static void UnMarshall(const SEGasCircuit& in, CDM::GasCircuit& out); -#include +//! static void UnMarshall(const CDM::GasCircuit& in, SEGasCircuit& out); +//! static void Marshall(const SEGasCircuit& in, CDM::GasCircuit& out); +#include TEST_F(TEST_FIXTURE_NAME, GasCircuit) { EXPECT_TRUE(true); -} \ No newline at end of file +} diff --git a/projects/biogears/libIO/unit/io/cdm/test_core_io_Compartment.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_Compartment.cpp similarity index 87% rename from projects/biogears/libIO/unit/io/cdm/test_core_io_Compartment.cpp rename to projects/biogears/libBiogears/unit/io/cdm/test_core_io_Compartment.cpp index 8ef739d74..b6cefc6fc 100644 --- a/projects/biogears/libIO/unit/io/cdm/test_core_io_Compartment.cpp +++ b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_Compartment.cpp @@ -104,8 +104,8 @@ void TEST_FIXTURE_NAME::TearDown() //! Abstract class SEGasCompartment //! TYPE GasCompartment -//! static void Marshall(const CDM::GasCompartment& in, SEGasCompartment& out); -//! static void UnMarshall(const SEGasCompartment& in, CDM::GasCompartment& out); +//! static void UnMarshall(const CDM::GasCompartment& in, SEGasCompartment& out); +//! static void Marshall(const SEGasCompartment& in, CDM::GasCompartment& out); #include TEST_F(TEST_FIXTURE_NAME, GasCompartment) { @@ -122,16 +122,16 @@ TEST_F(TEST_FIXTURE_NAME, GasCompartment) EXPECT_NE(source, sink); - Compartment::UnMarshall(source, data); - Compartment::Marshall(data, sink, substanceManager); + Compartment::Marshall(source, data); + Compartment::UnMarshall(data, sink, substanceManager); EXPECT_EQ(source, sink); }; //! Abstract class SEGasCompartmentLink //! TYPE GasCompartmentLink -//! static void Marshall(const CDM::GasCompartmentLink& in, SEGasCompartmentLink& out); -//! static void UnMarshall(const SEGasCompartmentLink& in, CDM::GasCompartmentLink& out); +//! static void UnMarshall(const CDM::GasCompartmentLink& in, SEGasCompartmentLink& out); +//! static void Marshall(const SEGasCompartmentLink& in, CDM::GasCompartmentLink& out); #include TEST_F(TEST_FIXTURE_NAME, GasCompartmentLink) { @@ -148,16 +148,16 @@ TEST_F(TEST_FIXTURE_NAME, GasCompartmentLink) //EXPECT_NE(source, sink); - //Compartment::UnMarshall(source, data); - //Compartment::Marshall(data, sink); + //Compartment::Marshall(source, data); + //Compartment::UnMarshall(data, sink); //EXPECT_EQ(source, sink); }; //! Abstract class SEGasCompartmentGraph //! TYPE GasCompartmentGraph -// static void Marshall(const CDM::GasCompartmentGraphData& in, SEGasCompartmentGraph& out, SECompartmentManager& cmptMgr); -// static void UnMarshall(const SEGasCompartmentGraph& in, CDM::GasCompartmentGraphData& out); +// static void UnMarshall(const CDM::GasCompartmentGraphData& in, SEGasCompartmentGraph& out, SECompartmentManager& cmptMgr); +// static void Marshall(const SEGasCompartmentGraph& in, CDM::GasCompartmentGraphData& out); #include TEST_F(TEST_FIXTURE_NAME, GasCompartmentGraph) { // USING_TYPES(GasCompartmentGraph) @@ -168,8 +168,8 @@ TEST_F(TEST_FIXTURE_NAME, GasCompartmentGraph) { // EXPECT_NE(source, sink); - // Compartment::UnMarshall(source, data); - // Compartment::Marshall(data, sink, compartmentManager); + // Compartment::Marshall(source, data); + // Compartment::UnMarshall(data, sink, compartmentManager); // EXPECT_EQ(source, sink); }; \ No newline at end of file diff --git a/projects/biogears/libIO/unit/io/cdm/test_core_io_ElectroCardioGram.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_ElectroCardioGram.cpp similarity index 83% rename from projects/biogears/libIO/unit/io/cdm/test_core_io_ElectroCardioGram.cpp rename to projects/biogears/libBiogears/unit/io/cdm/test_core_io_ElectroCardioGram.cpp index 7bb64e488..d2ed9f85d 100644 --- a/projects/biogears/libIO/unit/io/cdm/test_core_io_ElectroCardioGram.cpp +++ b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_ElectroCardioGram.cpp @@ -72,8 +72,8 @@ void TEST_FIXTURE_NAME::TearDown() // class SEElectroCardioGram; //! //! TYPE ElectroCardioGram -//! static void Marshall(const CDM::ElectroCardioGram& in, SEElectroCardioGram& out); -//! static void UnMarshall(const SEElectroCardioGram& in, CDM::ElectroCardioGram& out); +//! static void UnMarshall(const CDM::ElectroCardioGram& in, SEElectroCardioGram& out); +//! static void Marshall(const SEElectroCardioGram& in, CDM::ElectroCardioGram& out); #include TEST_F(TEST_FIXTURE_NAME, ElectroCardioGram) { @@ -100,8 +100,8 @@ TEST_F(TEST_FIXTURE_NAME, ElectroCardioGram) EXPECT_NE(source, sink); - ElectroCardioGram::UnMarshall(source, data); - ElectroCardioGram::Marshall(data, sink); + ElectroCardioGram::Marshall(source, data); + ElectroCardioGram::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -110,8 +110,8 @@ TEST_F(TEST_FIXTURE_NAME, ElectroCardioGram) // class SEElectroCardioGramInterpolationWaveform; //! //! TYPE ElectroCardioGramInterpolationWaveform -//! static void Marshall(const CDM::ElectroCardioGramInterpolationWaveform& in, SEElectroCardioGramInterpolationWaveform& out); -//! static void UnMarshall(const SEElectroCardioGramInterpolationWaveform& in, CDM::ElectroCardioGramInterpolationWaveform& out); +//! static void UnMarshall(const CDM::ElectroCardioGramInterpolationWaveform& in, SEElectroCardioGramInterpolationWaveform& out); +//! static void Marshall(const SEElectroCardioGramInterpolationWaveform& in, CDM::ElectroCardioGramInterpolationWaveform& out); #include TEST_F(TEST_FIXTURE_NAME, ElectroCardioGramInterpolationWaveform) { @@ -124,7 +124,7 @@ TEST_F(TEST_FIXTURE_NAME, ElectroCardioGramInterpolationWaveform) CDMType data; source.SetLeadNumber(2); - source.SetRhythm(CDM::enumHeartRhythm::NormalSinus); + source.SetRhythm(biogears::SEHeartRhythm::NormalSinus); source.GetTimeStep().SetValue(1.0, biogears::TimeUnit::yr); auto& epVt = source.GetData(); @@ -148,8 +148,8 @@ TEST_F(TEST_FIXTURE_NAME, ElectroCardioGramInterpolationWaveform) EXPECT_NE(source, sink); - ElectroCardioGram::UnMarshall(source, data); - ElectroCardioGram::Marshall(data, sink); + ElectroCardioGram::Marshall(source, data); + ElectroCardioGram::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -158,8 +158,8 @@ TEST_F(TEST_FIXTURE_NAME, ElectroCardioGramInterpolationWaveform) // class SEElectroCardioGramInterpolator; //! //! TYPE ElectroCardioGramInterpolator -//! static void Marshall(const CDM::ElectroCardioGramInterpolator& in, SEElectroCardioGramInterpolator& out); -//! static void UnMarshall(const SEElectroCardioGramInterpolator& in, CDM::ElectroCardioGramInterpolator& out); +//! static void UnMarshall(const CDM::ElectroCardioGramInterpolator& in, SEElectroCardioGramInterpolator& out); +//! static void Marshall(const SEElectroCardioGramInterpolator& in, CDM::ElectroCardioGramInterpolator& out); #include TEST_F(TEST_FIXTURE_NAME, ElectroCardioGramWaveformLeadNumber) { @@ -175,8 +175,8 @@ TEST_F(TEST_FIXTURE_NAME, ElectroCardioGramWaveformLeadNumber) EXPECT_NE(source, sink); - ElectroCardioGram::UnMarshall(source, data); - ElectroCardioGram::Marshall(data, sink); + ElectroCardioGram::Marshall(source, data); + ElectroCardioGram::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -184,8 +184,8 @@ TEST_F(TEST_FIXTURE_NAME, ElectroCardioGramWaveformLeadNumber) // class SEElectroCardioGramInterpolator; //! //! TYPE ElectroCardioGramInterpolator -//! static void Marshall(const CDM::ElectroCardioGramInterpolator& in, SEElectroCardioGramInterpolator& out); -//! static void UnMarshall(const SEElectroCardioGramInterpolator& in, CDM::ElectroCardioGramInterpolator& out); +//! static void UnMarshall(const CDM::ElectroCardioGramInterpolator& in, SEElectroCardioGramInterpolator& out); +//! static void Marshall(const SEElectroCardioGramInterpolator& in, CDM::ElectroCardioGramInterpolator& out); #include TEST_F(TEST_FIXTURE_NAME, ElectroCardioGramInterpolator) { @@ -199,11 +199,11 @@ TEST_F(TEST_FIXTURE_NAME, ElectroCardioGramInterpolator) auto potential = biogears::SEScalarElectricPotential { 10, biogears::ElectricPotentialUnit::mV }; source.SetLeadElectricPotential(1, potential); - auto& waveform = source.GetWaveform(10, CDM::enumHeartRhythm::Asystole); + auto& waveform = source.GetWaveform(10, biogears::SEHeartRhythm::Asystole); //LeadNumber an Rythem set by GetWaveForm of Coherence. //waveform.SetLeadNumber(10) - //waveform.SetRhythm(CDM::enumHeartRhythm::NormalSinus); + //waveform.SetRhythm(biogears::SEHeartRhythm::NormalSinus); waveform.GetTimeStep().SetValue(1.0, biogears::TimeUnit::yr); auto& epVt = waveform.GetData(); @@ -227,8 +227,8 @@ TEST_F(TEST_FIXTURE_NAME, ElectroCardioGramInterpolator) EXPECT_NE(source, sink); - ElectroCardioGram::UnMarshall(source, data); - ElectroCardioGram::Marshall(data, sink); + ElectroCardioGram::Marshall(source, data); + ElectroCardioGram::UnMarshall(data, sink); EXPECT_EQ(source, sink); } \ No newline at end of file diff --git a/projects/biogears/libIO/unit/io/cdm/test_core_io_EngineConfiguration.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_EngineConfiguration.cpp similarity index 100% rename from projects/biogears/libIO/unit/io/cdm/test_core_io_EngineConfiguration.cpp rename to projects/biogears/libBiogears/unit/io/cdm/test_core_io_EngineConfiguration.cpp diff --git a/projects/biogears/libIO/unit/io/cdm/test_core_io_EngineState.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_EngineState.cpp similarity index 100% rename from projects/biogears/libIO/unit/io/cdm/test_core_io_EngineState.cpp rename to projects/biogears/libBiogears/unit/io/cdm/test_core_io_EngineState.cpp diff --git a/projects/biogears/libIO/unit/io/cdm/test_core_io_Environment.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_Environment.cpp similarity index 79% rename from projects/biogears/libIO/unit/io/cdm/test_core_io_Environment.cpp rename to projects/biogears/libBiogears/unit/io/cdm/test_core_io_Environment.cpp index 0687b197f..2dcacdbdb 100644 --- a/projects/biogears/libIO/unit/io/cdm/test_core_io_Environment.cpp +++ b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_Environment.cpp @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -86,10 +87,9 @@ class EnvironmentUnitTest : public biogears::SEEnvironment { { } - using SEEnvironment::Clear; + using SEEnvironment::Invalidate; using SEEnvironment::Load; using SEEnvironment::ProcessChange; - using SEEnvironment::Unload; using SEEnvironment::GetConditions; using SEEnvironment::GetConvectiveHeatLoss; @@ -106,8 +106,8 @@ class EnvironmentUnitTest : public biogears::SEEnvironment { // class SEEnvironmentalConditions; //! //! TYPE ThermalApplication -//! static void Marshall(const CDM::EnvironmentalConditions& in, SEEnvironmentalConditions& out); -//! static void UnMarshall(const SEEnvironmentalConditions& in, CDM::EnvironmentalConditions& out); +//! static void UnMarshall(const CDM::EnvironmentalConditions& in, SEEnvironmentalConditions& out); +//! static void Marshall(const SEEnvironmentalConditions& in, CDM::EnvironmentalConditions& out); #include TEST_F(TEST_FIXTURE_NAME, EnvironmentalConditions) { @@ -119,11 +119,11 @@ TEST_F(TEST_FIXTURE_NAME, EnvironmentalConditions) SEType source { subMgr }, sink { subMgr }; CDMType data; - auto nitrogen = subMgr.GetSubstance("Nitrogen"); - auto sarin = subMgr.GetSubstance("Sarin"); - ASSERT_NE(nullptr, nitrogen); - ASSERT_NE(nullptr, sarin); - source.SetSurroundingType(CDM::enumSurroundingType::Water); + auto nitrogen = subMgr.GetSubstance(biogears::Nitrogen)->GetDefinition(); + auto sarin = subMgr.GetSubstance(biogears::Sarin)->GetDefinition(); + //ASSERT_NE(nullptr, nitrogen); + //ASSERT_NE(nullptr, sarin); + source.SetSurroundingType(biogears::SESurroundingType::Water); source.SetName("EnvironmentalConditions"); @@ -142,12 +142,12 @@ TEST_F(TEST_FIXTURE_NAME, EnvironmentalConditions) source.GetMeanRadiantTemperature().SetValue(1.0, biogears::TemperatureUnit::C); source.GetRespirationAmbientTemperature().SetValue(1.0, biogears::TemperatureUnit::C); - source.AddAmbientGas(*nitrogen, biogears::SEScalarFraction { 0.05 }); - source.AddAmbientAerosol(*sarin, biogears::SEScalarMassPerVolume { 33, biogears::MassPerVolumeUnit::g_Per_L }); + source.AddAmbientGas(nitrogen, biogears::SEScalarFraction { 0.05 }); + source.AddAmbientAerosol(sarin, biogears::SEScalarMassPerVolume { 33, biogears::MassPerVolumeUnit::g_Per_L }); EXPECT_NE(source, sink); - Environment::UnMarshall(source, data); - Environment::Marshall(data, sink); + Environment::Marshall(source, data); + Environment::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -155,8 +155,8 @@ TEST_F(TEST_FIXTURE_NAME, EnvironmentalConditions) // class SEActiveHeating; //! //! TYPE ActiveHeating -//! static void Marshall(const CDM::ActiveHeating& in, SEActiveHeating& out); -//! static void UnMarshall(const SEActiveHeating& in, CDM::ActiveHeating& out); +//! static void UnMarshall(const CDM::ActiveHeating& in, SEActiveHeating& out); +//! static void Marshall(const SEActiveHeating& in, CDM::ActiveHeating& out); #include TEST_F(TEST_FIXTURE_NAME, ActiveHeating) { @@ -174,8 +174,8 @@ TEST_F(TEST_FIXTURE_NAME, ActiveHeating) EXPECT_NE(source, sink); - Environment::UnMarshall(source, data); - Environment::Marshall(data, sink); + Environment::Marshall(source, data); + Environment::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -183,8 +183,8 @@ TEST_F(TEST_FIXTURE_NAME, ActiveHeating) // class SEActiveCooling; //! //! TYPE ActiveCooling -//! static void Marshall(const CDM::ActiveCooling& in, SEActiveCooling& out); -//! static void UnMarshall(const SEActiveCooling& in, CDM::ActiveCooling& out); +//! static void UnMarshall(const CDM::ActiveCooling& in, SEActiveCooling& out); +//! static void Marshall(const SEActiveCooling& in, CDM::ActiveCooling& out); #include TEST_F(TEST_FIXTURE_NAME, ActiveCooling) { @@ -202,8 +202,8 @@ TEST_F(TEST_FIXTURE_NAME, ActiveCooling) EXPECT_NE(source, sink); - Environment::UnMarshall(source, data); - Environment::Marshall(data, sink); + Environment::Marshall(source, data); + Environment::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -211,8 +211,8 @@ TEST_F(TEST_FIXTURE_NAME, ActiveCooling) // class SEAppliedTemperature; //! //! TYPE AppliedTemperature -//! static void Marshall(const CDM::AppliedTemperature& in, SEAppliedTemperature& out); -//! static void UnMarshall(const SEAppliedTemperature& in, CDM::AppliedTemperature& out); +//! static void UnMarshall(const CDM::AppliedTemperature& in, SEAppliedTemperature& out); +//! static void Marshall(const SEAppliedTemperature& in, CDM::AppliedTemperature& out); #include TEST_F(TEST_FIXTURE_NAME, AppliedTemperature) { @@ -227,12 +227,12 @@ TEST_F(TEST_FIXTURE_NAME, AppliedTemperature) source.GetTemperature().SetValue(1.0, biogears::TemperatureUnit::C); source.GetSurfaceArea().SetValue(1.0, biogears::AreaUnit::m2); source.GetSurfaceAreaFraction().SetValue(1.0); - source.SetState(CDM::enumOnOff::On); + source.SetState(biogears::SEOnOff::On); EXPECT_NE(source, sink); - Environment::UnMarshall(source, data); - Environment::Marshall(data, sink); + Environment::Marshall(source, data); + Environment::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -240,8 +240,8 @@ TEST_F(TEST_FIXTURE_NAME, AppliedTemperature) // class SEEnvironment; //! //! TYPE Environment -//! static void Marshall(const CDM::Environment& in, SEEnvironment& out); -//! static void UnMarshall(const SEEnvironment& in, CDM::Environment& out); +//! static void UnMarshall(const CDM::Environment& in, SEEnvironment& out); +//! static void Marshall(const SEEnvironment& in, CDM::Environment& out); #include TEST_F(TEST_FIXTURE_NAME, Environment) { @@ -259,11 +259,11 @@ TEST_F(TEST_FIXTURE_NAME, Environment) auto& conditions = source.GetConditions(); source.SetName("Environment"); - auto nitrogen = subMgr.GetSubstance("Nitrogen"); - auto sarin = subMgr.GetSubstance("Sarin"); - ASSERT_NE(nullptr, nitrogen); - ASSERT_NE(nullptr, sarin); - conditions.SetSurroundingType(CDM::enumSurroundingType::Water); + auto nitrogen = subMgr.GetSubstance(biogears::Nitrogen)->GetDefinition(); + auto sarin = subMgr.GetSubstance(biogears::Sarin)->GetDefinition(); + //ASSERT_NE(nullptr, nitrogen); + //ASSERT_NE(nullptr, sarin); + conditions.SetSurroundingType(biogears::SESurroundingType::Water); conditions.SetName("EnvironmentalConditions"); @@ -282,8 +282,8 @@ TEST_F(TEST_FIXTURE_NAME, Environment) conditions.GetMeanRadiantTemperature().SetValue(1.0, biogears::TemperatureUnit::C); conditions.GetRespirationAmbientTemperature().SetValue(1.0, biogears::TemperatureUnit::C); - conditions.AddAmbientGas(*nitrogen, biogears::SEScalarFraction { 0.05 }); - conditions.AddAmbientAerosol(*sarin, biogears::SEScalarMassPerVolume { 33, biogears::MassPerVolumeUnit::g_Per_L }); + conditions.AddAmbientGas(nitrogen, biogears::SEScalarFraction { 0.05 }); + conditions.AddAmbientAerosol(sarin, biogears::SEScalarMassPerVolume { 33, biogears::MassPerVolumeUnit::g_Per_L }); source.GetConvectiveHeatLoss().SetValue(5.5, biogears::PowerUnit::W); source.GetEvaporativeHeatLoss().SetValue(5.5, biogears::PowerUnit::W); @@ -297,8 +297,8 @@ TEST_F(TEST_FIXTURE_NAME, Environment) EXPECT_NE(source, sink); - Environment::UnMarshall(source, data); - Environment::Marshall(data, sink); + Environment::Marshall(source, data); + Environment::UnMarshall(data, sink); EXPECT_EQ(source, sink); -} \ No newline at end of file +} diff --git a/projects/biogears/libIO/unit/io/cdm/test_core_io_EnvironmentActions.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_EnvironmentActions.cpp similarity index 85% rename from projects/biogears/libIO/unit/io/cdm/test_core_io_EnvironmentActions.cpp rename to projects/biogears/libBiogears/unit/io/cdm/test_core_io_EnvironmentActions.cpp index c08991655..88470ebd9 100644 --- a/projects/biogears/libIO/unit/io/cdm/test_core_io_EnvironmentActions.cpp +++ b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_EnvironmentActions.cpp @@ -70,8 +70,8 @@ void TEST_FIXTURE_NAME::TearDown() // class SEEnvironmentChange; //! //! TYPE EnvironmentChange -//! static void Marshall(const CDM::EnvironmentChange& in, SEEnvironmentChange& out); -//! static void UnMarshall(const SEEnvironmentChange& in, CDM::EnvironmentChange& out); +//! static void UnMarshall(const CDM::EnvironmentChange& in, SEEnvironmentChange& out); +//! static void Marshall(const SEEnvironmentChange& in, CDM::EnvironmentChange& out); #include #include TEST_F(TEST_FIXTURE_NAME, EnvironmentChange) @@ -85,14 +85,14 @@ TEST_F(TEST_FIXTURE_NAME, EnvironmentChange) CDMType data; source.SetComment("Test Comment"); - source.SetConditionsFile("ConditionFile.xml"); + source.SetConditionsFile("SubmergedFreezing.xml"); auto& conditions = source.GetConditions(); //EXPECT_NE(source, sink); - EnvironmentActions::UnMarshall(source, data); - EnvironmentActions::Marshall(data, sink); + EnvironmentActions::Marshall(source, data); + EnvironmentActions::UnMarshall(data, sink); //EXPECT_EQ(source, sink); } @@ -100,8 +100,8 @@ TEST_F(TEST_FIXTURE_NAME, EnvironmentChange) // class SEThermalApplication; //! //! TYPE ThermalApplication -//! static void Marshall(const CDM::ThermalApplication& in, SEThermalApplication& out); -//! static void UnMarshall(const SEThermalApplication& in, CDM::ThermalApplication& out); +//! static void UnMarshall(const CDM::ThermalApplication& in, SEThermalApplication& out); +//! static void Marshall(const SEThermalApplication& in, CDM::ThermalApplication& out); #include TEST_F(TEST_FIXTURE_NAME, ThermalApplication) { @@ -111,12 +111,12 @@ TEST_F(TEST_FIXTURE_NAME, ThermalApplication) CDMType data; //source.SetComment("Test Comment"); - //source.SetType(CDM::enumEnvironmentAssessment::CompleteBloodCount); + //source.SetType(biogears::SEEnvironmentAssessment::CompleteBloodCount); //EXPECT_NE(source, sink); - EnvironmentActions::UnMarshall(source, data); - EnvironmentActions::Marshall(data, sink); + EnvironmentActions::Marshall(source, data); + EnvironmentActions::UnMarshall(data, sink); //EXPECT_EQ(source, sink); } \ No newline at end of file diff --git a/projects/biogears/libIO/unit/io/cdm/test_core_io_EnvironmentConditions.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_EnvironmentConditions.cpp similarity index 81% rename from projects/biogears/libIO/unit/io/cdm/test_core_io_EnvironmentConditions.cpp rename to projects/biogears/libBiogears/unit/io/cdm/test_core_io_EnvironmentConditions.cpp index 79b9e4f99..318afd0d0 100644 --- a/projects/biogears/libIO/unit/io/cdm/test_core_io_EnvironmentConditions.cpp +++ b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_EnvironmentConditions.cpp @@ -66,15 +66,14 @@ void TEST_FIXTURE_NAME::TearDown() using SEType = biogears ::SE##name; \ using CDMType = CDM ::name##Data; -#include - +#include // class SEInitialEnvironment; //! //! TYPE InitialEnvironment -//! static void Marshall(const CDM::InitialEnvironment& in, SEInitialEnvironment& out); -//! static void UnMarshall(const SEInitialEnvironment& in, CDM::InitialEnvironment& out); +//! static void UnMarshall(const CDM::InitialEnvironment& in, SEInitialEnvironment& out); +//! static void Marshall(const SEInitialEnvironment& in, CDM::InitialEnvironment& out); #include -#include +#include #include TEST_F(TEST_FIXTURE_NAME, InitialEnvironment) { @@ -90,11 +89,11 @@ TEST_F(TEST_FIXTURE_NAME, InitialEnvironment) source.SetConditionsFile("ConditionFile.xml"); auto& conditions = source.GetConditions(); - auto nitrogen = subMgr.GetSubstance("Nitrogen"); - auto sarin = subMgr.GetSubstance("Sarin"); - ASSERT_NE(nullptr, sarin); - ASSERT_NE(nullptr, nitrogen); - conditions.SetSurroundingType(CDM::enumSurroundingType::Water); + auto nitrogen = subMgr.GetSubstance(biogears::Nitrogen)->GetDefinition(); + auto sarin = subMgr.GetSubstance(biogears::Sarin)->GetDefinition(); + //ASSERT_NE(nullptr, sarin); + //ASSERT_NE(nullptr, nitrogen); + conditions.SetSurroundingType(biogears::SESurroundingType::Water); conditions.SetName("EnvironmentalConditions"); @@ -113,13 +112,13 @@ TEST_F(TEST_FIXTURE_NAME, InitialEnvironment) conditions.GetMeanRadiantTemperature().SetValue(1.0, biogears::TemperatureUnit::C); conditions.GetRespirationAmbientTemperature().SetValue(1.0, biogears::TemperatureUnit::C); - conditions.AddAmbientGas(*nitrogen, biogears::SEScalarFraction { 0.05 }); - conditions.AddAmbientAerosol(*sarin, biogears::SEScalarMassPerVolume { 33, biogears::MassPerVolumeUnit::g_Per_L }); + conditions.AddAmbientGas(nitrogen, biogears::SEScalarFraction { 0.05 }); + conditions.AddAmbientAerosol(sarin, biogears::SEScalarMassPerVolume { 33, biogears::MassPerVolumeUnit::g_Per_L }); EXPECT_NE(source, sink); - EnvironmentConditions::UnMarshall(source, data); - EnvironmentConditions::Marshall(data, sink); + EnvironmentConditions::Marshall(source, data); + EnvironmentConditions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } diff --git a/projects/biogears/libIO/unit/io/cdm/test_core_io_Inhaler.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_Inhaler.cpp similarity index 89% rename from projects/biogears/libIO/unit/io/cdm/test_core_io_Inhaler.cpp rename to projects/biogears/libBiogears/unit/io/cdm/test_core_io_Inhaler.cpp index 97e97ce62..4f9b757a9 100644 --- a/projects/biogears/libIO/unit/io/cdm/test_core_io_Inhaler.cpp +++ b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_Inhaler.cpp @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -71,8 +72,8 @@ void TEST_FIXTURE_NAME::TearDown() // class SEInhaler; //! //! TYPE Inhaler -//! static void Marshall(const CDM::Inhaler& in, SEInhaler& out); -//! static void UnMarshall(const SEInhaler& in, CDM::Inhaler& out); +//! static void UnMarshall(const CDM::Inhaler& in, SEInhaler& out); +//! static void Marshall(const SEInhaler& in, CDM::Inhaler& out); TEST_F(TEST_FIXTURE_NAME, Inhaler) { USING_TYPES(Inhaler) @@ -83,9 +84,9 @@ TEST_F(TEST_FIXTURE_NAME, Inhaler) SEType source(mgr), sink(mgr); CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); - - source.SetState(CDM::enumOnOff::Off); + auto sarin = mgr.GetSubstance(biogears::Sarin); + + source.SetState(biogears::SEOnOff::Off); source.GetMeteredDose().SetValue(55.f, biogears::MassUnit::kg); source.GetNozzleLoss().SetValue(22.f); source.GetSpacerVolume().SetValue(55, biogears::VolumeUnit::L); @@ -93,8 +94,8 @@ TEST_F(TEST_FIXTURE_NAME, Inhaler) EXPECT_NE(source, sink); - Inhaler::UnMarshall(source, data); - Inhaler::Marshall(data, sink); + Inhaler::Marshall(source, data); + Inhaler::UnMarshall(data, sink); EXPECT_EQ(source, sink); } diff --git a/projects/biogears/libIO/unit/io/cdm/test_core_io_InhalerActions.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_InhalerActions.cpp similarity index 90% rename from projects/biogears/libIO/unit/io/cdm/test_core_io_InhalerActions.cpp rename to projects/biogears/libBiogears/unit/io/cdm/test_core_io_InhalerActions.cpp index 2dd44020a..706bf3302 100644 --- a/projects/biogears/libIO/unit/io/cdm/test_core_io_InhalerActions.cpp +++ b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_InhalerActions.cpp @@ -72,8 +72,8 @@ void TEST_FIXTURE_NAME::TearDown() // class SEInhalerActions; //! //! TYPE InhalerActions -//! static void Marshall(const CDM::InhalerActions& in, SEInhalerActions& out); -//! static void UnMarshall(const SEInhalerActions& in, CDM::InhalerActions& out); +//! static void UnMarshall(const CDM::InhalerActions& in, SEInhalerActions& out); +//! static void Marshall(const SEInhalerActions& in, CDM::InhalerActions& out); TEST_F(TEST_FIXTURE_NAME, InhalerConfiguration) { USING_TYPES(InhalerConfiguration) @@ -84,11 +84,11 @@ TEST_F(TEST_FIXTURE_NAME, InhalerConfiguration) SEType source(mgr), sink(mgr); CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); auto& conf = source.GetConfiguration(); - conf.SetState(CDM::enumOnOff::Off); + conf.SetState(biogears::SEOnOff::Off); conf.GetMeteredDose().SetValue(55.f, biogears::MassUnit::kg); conf.GetNozzleLoss().SetValue(22.f); conf.GetSpacerVolume().SetValue(55, biogears::VolumeUnit::L); @@ -96,8 +96,8 @@ TEST_F(TEST_FIXTURE_NAME, InhalerConfiguration) EXPECT_NE(source, sink); - InhalerActions::UnMarshall(source, data); - InhalerActions::Marshall(data, sink); + InhalerActions::Marshall(source, data); + InhalerActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } diff --git a/projects/biogears/libIO/unit/io/cdm/test_core_io_Patient.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_Patient.cpp similarity index 92% rename from projects/biogears/libIO/unit/io/cdm/test_core_io_Patient.cpp rename to projects/biogears/libBiogears/unit/io/cdm/test_core_io_Patient.cpp index 16b5c88ed..3d7863c25 100644 --- a/projects/biogears/libIO/unit/io/cdm/test_core_io_Patient.cpp +++ b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_Patient.cpp @@ -72,8 +72,8 @@ void TEST_FIXTURE_NAME::TearDown() // class SEPatient; //! //! TYPE Patient -//! static void Marshall(const CDM::Patient& in, SEPatient& out); -//! static void UnMarshall(const SEPatient& in, CDM::Patient& out); +//! static void UnMarshall(const CDM::Patient& in, SEPatient& out); +//! static void Marshall(const SEPatient& in, CDM::Patient& out); TEST_F(TEST_FIXTURE_NAME, Patient) { USING_TYPES(Patient) @@ -84,19 +84,19 @@ TEST_F(TEST_FIXTURE_NAME, Patient) SEType source(&logger), sink(&logger); CDMType data; - auto oxygen = mgr.GetSubstance("Oxygen"); - auto nitrogen = mgr.GetSubstance("Nitrogen"); + auto oxygen = mgr.GetSubstance(biogears::Oxygen); + auto nitrogen = mgr.GetSubstance(biogears::Nitrogen); source.SetName("unit_test"); source.SetAnnotation("Seerailization Test User"); - source.SetGender(CDM::enumSex::Female); - source.SetSex(CDM::enumSex::Female); + source.SetSex(biogears::SESex::Female); + source.SetSex(biogears::SESex::Female); source.GetAge().SetValue(55.0, biogears::TimeUnit::yr); source.GetWeight().SetValue(80.0, biogears::MassUnit::kg); source.GetHeight().SetValue(175.0, biogears::LengthUnit::cm); source.GetAlveoliSurfaceArea().SetValue(16.0, biogears::AreaUnit::cm2); source.GetBasalMetabolicRate().SetValue(15.0, biogears::PowerUnit::J_Per_s); - source.SetBloodType(CDM::enumBloodType::AB); + source.SetBloodType(biogears::SEBloodType::AB); source.SetBloodRh(true); source.GetBloodVolumeBaseline().SetValue(14.0, biogears::VolumeUnit::L); source.GetBodyDensity().SetValue(13.0, biogears::MassPerVolumeUnit::g_Per_L); @@ -129,8 +129,8 @@ TEST_F(TEST_FIXTURE_NAME, Patient) EXPECT_NE(source, sink); - Patient::UnMarshall(source, data); - Patient::Marshall(data, sink); + Patient::Marshall(source, data); + Patient::UnMarshall(data, sink); EXPECT_EQ(source, sink); } diff --git a/projects/biogears/libIO/unit/io/cdm/test_core_io_PatientActions.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_PatientActions.cpp similarity index 60% rename from projects/biogears/libIO/unit/io/cdm/test_core_io_PatientActions.cpp rename to projects/biogears/libBiogears/unit/io/cdm/test_core_io_PatientActions.cpp index 7765c0aea..62dead94b 100644 --- a/projects/biogears/libIO/unit/io/cdm/test_core_io_PatientActions.cpp +++ b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_PatientActions.cpp @@ -20,6 +20,7 @@ #include +#include #include #include @@ -67,13 +68,12 @@ void TEST_FIXTURE_NAME::TearDown() #include - #include -//class SEPatientAssessmentRequest; +// class SEPatientAssessmentRequest; //! //! TYPE PatientAssessmentRequest -//! static void Marshall(const CDM::PatientAssessmentRequestData& in, SEPatientAssessmentRequest& out); -//! static void UnMarshall(const SEPatientAssessmentRequest& in, CDM::PatientAssessmentRequestData& out); +//! static void UnMarshall(const CDM::PatientAssessmentRequestData& in, SEPatientAssessmentRequest& out); +//! static void Marshall(const SEPatientAssessmentRequest& in, CDM::PatientAssessmentRequestData& out); TEST_F(TEST_FIXTURE_NAME, PatientAssessmentRequest) { USING_TYPES(PatientAssessmentRequest) @@ -82,23 +82,23 @@ TEST_F(TEST_FIXTURE_NAME, PatientAssessmentRequest) CDMType data; source.SetComment("Test Comment"); - source.SetType(CDM::enumPatientAssessment::CompleteBloodCount); + source.SetType(biogears::SEPatientAssessmentType::CompleteBloodCount); EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include #include -//class SEAcuteStress; +// class SEAcuteStress; //! //! TYPE AcuteStress -//! static void Marshall(const CDM::AcuteStressData& in, SEAcuteStress& out); -//! static void UnMarshall(const SEAcuteStress& in, CDM::AcuteStressData& out); +//! static void UnMarshall(const CDM::AcuteStressData& in, SEAcuteStress& out); +//! static void Marshall(const SEAcuteStress& in, CDM::AcuteStressData& out); TEST_F(TEST_FIXTURE_NAME, AcuteStress) { USING_TYPES(AcuteStress) @@ -111,18 +111,18 @@ TEST_F(TEST_FIXTURE_NAME, AcuteStress) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include -//class SEAirwayObstruction; +// class SEAirwayObstruction; //! //! TYPE AirwayObstruction -//! static void Marshall(const CDM::AirwayObstructionData& in, SEAirwayObstruction& out); -//! static void UnMarshall(const SEAirwayObstruction& in, CDM::AirwayObstructionData& out); +//! static void UnMarshall(const CDM::AirwayObstructionData& in, SEAirwayObstruction& out); +//! static void Marshall(const SEAirwayObstruction& in, CDM::AirwayObstructionData& out); TEST_F(TEST_FIXTURE_NAME, AirwayObstruction) { USING_TYPES(AirwayObstruction) @@ -135,18 +135,18 @@ TEST_F(TEST_FIXTURE_NAME, AirwayObstruction) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include -//class SEApnea; +// class SEApnea; //! //! TYPE Apnea -//! static void Marshall(const CDM::ApneaData& in, SEApnea& out); -//! static void UnMarshall(const SEApnea& in, CDM::ApneaData& out); +//! static void UnMarshall(const CDM::ApneaData& in, SEApnea& out); +//! static void Marshall(const SEApnea& in, CDM::ApneaData& out); TEST_F(TEST_FIXTURE_NAME, Apnea) { USING_TYPES(Apnea) @@ -159,18 +159,18 @@ TEST_F(TEST_FIXTURE_NAME, Apnea) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include -//class SEAsthmaAttack; +// class SEAsthmaAttack; //! //! TYPE AsthmaAttack -//! static void Marshall(const CDM::AsthmaAttackData& in, SEAsthmaAttack& out); -//! static void UnMarshall(const SEAsthmaAttack& in, CDM::AsthmaAttackData& out); +//! static void UnMarshall(const CDM::AsthmaAttackData& in, SEAsthmaAttack& out); +//! static void Marshall(const SEAsthmaAttack& in, CDM::AsthmaAttackData& out); TEST_F(TEST_FIXTURE_NAME, AsthmaAttack) { USING_TYPES(AsthmaAttack) @@ -183,18 +183,18 @@ TEST_F(TEST_FIXTURE_NAME, AsthmaAttack) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include -//class SEBrainInjury; +// class SEBrainInjury; //! //! TYPE BrainInjury -//! static void Marshall(const CDM::BrainInjuryData& in, SEBrainInjury& out); -//! static void UnMarshall(const SEBrainInjury& in, CDM::BrainInjuryData& out); +//! static void UnMarshall(const CDM::BrainInjuryData& in, SEBrainInjury& out); +//! static void Marshall(const SEBrainInjury& in, CDM::BrainInjuryData& out); TEST_F(TEST_FIXTURE_NAME, BrainInjury) { USING_TYPES(BrainInjury) @@ -204,22 +204,22 @@ TEST_F(TEST_FIXTURE_NAME, BrainInjury) source.SetComment("Test Comment"); source.GetSeverity().Set(.79); - source.SetType(CDM::enumBrainInjuryType::LeftFocal); + source.SetType(biogears::SEBrainInjuryType::LeftFocal); EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include -//class SEBronchoconstriction; +// class SEBronchoconstriction; //! //! TYPE Bronchoconstriction -//! static void Marshall(const CDM::BronchoconstrictionData& in, SEBronchoconstriction& out); -//! static void UnMarshall(const SEBronchoconstriction& in, CDM::BronchoconstrictionData& out); +//! static void UnMarshall(const CDM::BronchoconstrictionData& in, SEBronchoconstriction& out); +//! static void Marshall(const SEBronchoconstriction& in, CDM::BronchoconstrictionData& out); TEST_F(TEST_FIXTURE_NAME, Bronchoconstriction) { USING_TYPES(Bronchoconstriction) @@ -232,18 +232,18 @@ TEST_F(TEST_FIXTURE_NAME, Bronchoconstriction) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include -//class SEBurnWound; +// class SEBurnWound; //! //! TYPE BurnWound -//! static void Marshall(const CDM::BurnWoundData& in, SEBurnWound& out); -//! static void UnMarshall(const SEBurnWound& in, CDM::BurnWoundData& out); +//! static void UnMarshall(const CDM::BurnWoundData& in, SEBurnWound& out); +//! static void Marshall(const SEBurnWound& in, CDM::BurnWoundData& out); TEST_F(TEST_FIXTURE_NAME, BurnWound) { USING_TYPES(BurnWound) @@ -256,18 +256,18 @@ TEST_F(TEST_FIXTURE_NAME, BurnWound) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include -//class SECardiacArrest; +// class SECardiacArrest; //! //! TYPE CardiacArrest -//! static void Marshall(const CDM::CardiacArrestData& in, SECardiacArrest& out); -//! static void UnMarshall(const SECardiacArrest& in, CDM::CardiacArrestData& out); +//! static void UnMarshall(const CDM::CardiacArrestData& in, SECardiacArrest& out); +//! static void Marshall(const SECardiacArrest& in, CDM::CardiacArrestData& out); TEST_F(TEST_FIXTURE_NAME, CardiacArrest) { USING_TYPES(CardiacArrest) @@ -279,18 +279,18 @@ TEST_F(TEST_FIXTURE_NAME, CardiacArrest) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include -//class SEChestCompression; +// class SEChestCompression; //! //! TYPE ChestCompression -//! static void Marshall(const CDM::ChestCompressionData& in, SEChestCompression& out); -//! static void UnMarshall(const SEChestCompression& in, CDM::ChestCompressionData& out); +//! static void UnMarshall(const CDM::ChestCompressionData& in, SEChestCompression& out); +//! static void Marshall(const SEChestCompression& in, CDM::ChestCompressionData& out); TEST_F(TEST_FIXTURE_NAME, ChestCompression) { USING_TYPES(ChestCompression) @@ -302,19 +302,19 @@ TEST_F(TEST_FIXTURE_NAME, ChestCompression) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include #include -//class SEChestCompressionForce; +// class SEChestCompressionForce; //! //! TYPE ChestCompressionForce -//! static void Marshall(const CDM::ChestCompressionForceData& in, SEChestCompressionForce& out); -//! static void UnMarshall(const SEChestCompressionForce& in, CDM::ChestCompressionForceData& out); +//! static void UnMarshall(const CDM::ChestCompressionForceData& in, SEChestCompressionForce& out); +//! static void Marshall(const SEChestCompressionForce& in, CDM::ChestCompressionForceData& out); TEST_F(TEST_FIXTURE_NAME, ChestCompressionForce) { USING_TYPES(ChestCompressionForce) @@ -327,19 +327,19 @@ TEST_F(TEST_FIXTURE_NAME, ChestCompressionForce) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include #include -//class SEChestCompressionForceScale; +// class SEChestCompressionForceScale; //! //! TYPE ChestCompressionForceScale -//! static void Marshall(const CDM::ChestCompressionForceScaleData& in, SEChestCompressionForceScale& out); -//! static void UnMarshall(const SEChestCompressionForceScale& in, CDM::ChestCompressionForceScaleData& out); +//! static void UnMarshall(const CDM::ChestCompressionForceScaleData& in, SEChestCompressionForceScale& out); +//! static void Marshall(const SEChestCompressionForceScale& in, CDM::ChestCompressionForceScaleData& out); TEST_F(TEST_FIXTURE_NAME, ChestCompressionForceScale) { USING_TYPES(ChestCompressionForceScale) @@ -353,18 +353,18 @@ TEST_F(TEST_FIXTURE_NAME, ChestCompressionForceScale) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include -//class SEChestOcclusiveDressing; +// class SEChestOcclusiveDressing; //! //! TYPE ChestOcclusiveDressing -//! static void Marshall(const CDM::ChestOcclusiveDressingData& in, SEChestOcclusiveDressing& out); -//! static void UnMarshall(const SEChestOcclusiveDressing& in, CDM::ChestOcclusiveDressingData& out); +//! static void UnMarshall(const CDM::ChestOcclusiveDressingData& in, SEChestOcclusiveDressing& out); +//! static void Marshall(const SEChestOcclusiveDressing& in, CDM::ChestOcclusiveDressingData& out); TEST_F(TEST_FIXTURE_NAME, ChestOcclusiveDressing) { USING_TYPES(ChestOcclusiveDressing) @@ -373,22 +373,47 @@ TEST_F(TEST_FIXTURE_NAME, ChestOcclusiveDressing) CDMType data; source.SetComment("Test Comment"); - source.SetSide(CDM::enumSide::Right); + source.SetSide(biogears::SESide::Right); source.SetActive(true); EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } +#include +// class SEChestTube; +//! +//! TYPE ChestTube +//! static void UnMarshall(const CDM::ChestTubeData& in, SEChestTube& out); +//! static void Marshall(const SEChestTube& in, CDM::ChestTubeData& out); +//! +TEST_F(TEST_FIXTURE_NAME, ChestTube) +{ + USING_TYPES(ChestTube) + + SEType source, sink; + CDMType data; + + source.SetComment("Test Comment"); + source.SetSide(biogears::SESide::Left); + source.SetActive(true); + + EXPECT_NE(source, sink); + + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); + + EXPECT_EQ(source, sink); +} #include // class SEEbola; -//static void Marshall(const CDM::EbolaData& in, SEEbola& out); -//static void UnMarshall(const SEEbola& in, CDM::EbolaData& out); +// static void UnMarshall(const CDM::EbolaData& in, SEEbola& out); +// static void Marshall(const SEEbola& in, CDM::EbolaData& out); TEST_F(TEST_FIXTURE_NAME, Ebola) { @@ -398,22 +423,22 @@ TEST_F(TEST_FIXTURE_NAME, Ebola) CDMType data; source.SetComment("Test Comment"); - source.SetSeverity(CDM::enumInfectionSeverity::Moderate); - + source.SetSeverity(biogears::SEInfectionSeverity::Moderate); + EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include -//class SEForcedInhale; +// class SEForcedInhale; //! //! TYPE ForcedInhale -//! static void Marshall(const CDM::ForcedInhaleData& in, SEForcedInhale& out); -//! static void UnMarshall(const SEForcedInhale& in, CDM::ForcedInhaleData& out); +//! static void UnMarshall(const CDM::ForcedInhaleData& in, SEForcedInhale& out); +//! static void Marshall(const SEForcedInhale& in, CDM::ForcedInhaleData& out); TEST_F(TEST_FIXTURE_NAME, ForcedInhale) { USING_TYPES(ForcedInhale) @@ -427,18 +452,18 @@ TEST_F(TEST_FIXTURE_NAME, ForcedInhale) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include -//class SEForcedExhale; +// class SEForcedExhale; //! //! TYPE ForcedExhale -//! static void Marshall(const CDM::ForcedExhaleData& in, SEForcedExhale& out); -//! static void UnMarshall(const SEForcedExhale& in, CDM::ForcedExhaleData& out); +//! static void UnMarshall(const CDM::ForcedExhaleData& in, SEForcedExhale& out); +//! static void Marshall(const SEForcedExhale& in, CDM::ForcedExhaleData& out); TEST_F(TEST_FIXTURE_NAME, ForcedExhale) { USING_TYPES(ForcedExhale) @@ -452,18 +477,18 @@ TEST_F(TEST_FIXTURE_NAME, ForcedExhale) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include -//class SEBreathHold; +// class SEBreathHold; //! //! TYPE BreathHold -//! static void Marshall(const CDM::BreathHoldData& in, SEBreathHold& out); -//! static void UnMarshall(const SEBreathHold& in, CDM::BreathHoldData& out); +//! static void UnMarshall(const CDM::BreathHoldData& in, SEBreathHold& out); +//! static void Marshall(const SEBreathHold& in, CDM::BreathHoldData& out); TEST_F(TEST_FIXTURE_NAME, BreathHold) { USING_TYPES(BreathHold) @@ -476,18 +501,18 @@ TEST_F(TEST_FIXTURE_NAME, BreathHold) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include -//class SEUseInhaler; +// class SEUseInhaler; //! //! TYPE UseInhaler -//! static void Marshall(const CDM::UseInhalerData& in, SEUseInhaler& out); -//! static void UnMarshall(const SEUseInhaler& in, CDM::UseInhalerData& out); +//! static void UnMarshall(const CDM::UseInhalerData& in, SEUseInhaler& out); +//! static void Marshall(const SEUseInhaler& in, CDM::UseInhalerData& out); TEST_F(TEST_FIXTURE_NAME, UseInhaler) { USING_TYPES(UseInhaler) @@ -499,18 +524,18 @@ TEST_F(TEST_FIXTURE_NAME, UseInhaler) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include -//class SEConsciousRespiration; +// class SEConsciousRespiration; //! //! TYPE ConsciousRespiration -//! static void Marshall(const CDM::ConsciousRespirationData& in, SEConsciousRespiration& out); -//! static void UnMarshall(const SEConsciousRespiration& in, CDM::ConsciousRespirationData& out); +//! static void UnMarshall(const CDM::ConsciousRespirationData& in, SEConsciousRespiration& out); +//! static void Marshall(const SEConsciousRespiration& in, CDM::ConsciousRespirationData& out); TEST_F(TEST_FIXTURE_NAME, ConsciousRespiration) { USING_TYPES(ConsciousRespiration) @@ -522,8 +547,8 @@ TEST_F(TEST_FIXTURE_NAME, ConsciousRespiration) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -532,11 +557,11 @@ TEST_F(TEST_FIXTURE_NAME, ConsciousRespiration) #include #include #include -//class SEConsumeNutrients; +// class SEConsumeNutrients; //! //! TYPE ConsumeNutrients -//! static void Marshall(const CDM::ConsumeNutrientsData& in, SEConsumeNutrients& out); -//! static void UnMarshall(const SEConsumeNutrients& in, CDM::ConsumeNutrientsData& out); +//! static void UnMarshall(const CDM::ConsumeNutrientsData& in, SEConsumeNutrients& out); +//! static void Marshall(const SEConsumeNutrients& in, CDM::ConsumeNutrientsData& out); TEST_F(TEST_FIXTURE_NAME, ConsumeNutrients) { USING_TYPES(ConsumeNutrients) @@ -557,18 +582,18 @@ TEST_F(TEST_FIXTURE_NAME, ConsumeNutrients) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include -//class SEExercise; +// class SEExercise; //! //! TYPE Exercise -//! static void Marshall(const CDM::ExerciseData& in, SEExercise& out); -//! static void UnMarshall(const SEExercise& in, CDM::ExerciseData& out); +//! static void UnMarshall(const CDM::ExerciseData& in, SEExercise& out); +//! static void Marshall(const SEExercise& in, CDM::ExerciseData& out); TEST_F(TEST_FIXTURE_NAME, Exercise) { USING_TYPES(Exercise) @@ -586,14 +611,14 @@ TEST_F(TEST_FIXTURE_NAME, Exercise) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); /* Generic Exercise */ data = CDMType {}; - source.Clear(); + source.Invalidate(); source.SetComment("SEGeneric"); biogears::SEExercise::SEGeneric generic; @@ -603,14 +628,14 @@ TEST_F(TEST_FIXTURE_NAME, Exercise) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); /* Strength Training*/ data = CDMType {}; - source.Clear(); + source.Invalidate(); source.SetComment("SEStrengthTraining"); biogears::SEExercise::SEStrengthTraining strength; @@ -620,14 +645,14 @@ TEST_F(TEST_FIXTURE_NAME, Exercise) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); /* Running Training*/ data = CDMType {}; - source.Clear(); + source.Invalidate(); source.SetComment("SERunning"); biogears::SEExercise::SERunning running; @@ -638,14 +663,14 @@ TEST_F(TEST_FIXTURE_NAME, Exercise) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); /* Running ALL*/ data = CDMType {}; - source.Clear(); + source.Invalidate(); source.SetComment("SERunning"); source.SetCyclingExercise(cycling); source.SetRunningExercise(running); @@ -654,19 +679,19 @@ TEST_F(TEST_FIXTURE_NAME, Exercise) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include #include -//class SEHemorrhage; +// class SEHemorrhage; //! //! TYPE Hemorrhage -//! static void Marshall(const CDM::HemorrhageData& in, SEHemorrhage& out); -//! static void UnMarshall(const SEHemorrhage& in, CDM::HemorrhageData& out); +//! static void UnMarshall(const CDM::HemorrhageData& in, SEHemorrhage& out); +//! static void Marshall(const SEHemorrhage& in, CDM::HemorrhageData& out); TEST_F(TEST_FIXTURE_NAME, Hemorrhage) { USING_TYPES(Hemorrhage) @@ -681,19 +706,19 @@ TEST_F(TEST_FIXTURE_NAME, Hemorrhage) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include #include -//class SEInfection; +// class SEInfection; //! //! TYPE Infection -//! static void Marshall(const CDM::InfectionData& in, SEInfection& out); -//! static void UnMarshall(const SEInfection& in, CDM::InfectionData& out); +//! static void UnMarshall(const CDM::InfectionData& in, SEInfection& out); +//! static void Marshall(const SEInfection& in, CDM::InfectionData& out); TEST_F(TEST_FIXTURE_NAME, Infection) { USING_TYPES(Infection) @@ -703,23 +728,23 @@ TEST_F(TEST_FIXTURE_NAME, Infection) source.SetComment("Test Comment"); source.SetLocation("Fake Compartment"); - source.SetSeverity(CDM::enumInfectionSeverity::Moderate); + source.SetSeverity(biogears::SEInfectionSeverity::Moderate); source.GetMinimumInhibitoryConcentration().SetValue(.5, biogears::MassPerVolumeUnit::g_Per_mL); EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include -//class SEIntubation; +// class SEIntubation; //! //! TYPE Intubation -//! static void Marshall(const CDM::IntubationData& in, SEIntubation& out); -//! static void UnMarshall(const SEIntubation& in, CDM::IntubationData& out); +//! static void UnMarshall(const CDM::IntubationData& in, SEIntubation& out); +//! static void Marshall(const SEIntubation& in, CDM::IntubationData& out); TEST_F(TEST_FIXTURE_NAME, Intubation) { USING_TYPES(Intubation) @@ -728,23 +753,23 @@ TEST_F(TEST_FIXTURE_NAME, Intubation) CDMType data; source.SetComment("Test Comment"); - source.SetType(CDM::enumIntubationType::LeftMainstem); + source.SetType(biogears::SEIntubationType::LeftMainstem); EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include #include -//class SEMechanicalVentilation; +// class SEMechanicalVentilation; //! //! TYPE MechanicalVentilation -//! static void Marshall(const CDM::MechanicalVentilationData& in, const SESubstanceManager& substances, SEMechanicalVentilation& out); -//! static void UnMarshall(const SEMechanicalVentilation& in, CDM::MechanicalVentilationData& out); +//! static void UnMarshall(const CDM::MechanicalVentilationData& in, const SESubstanceManager& substances, SEMechanicalVentilation& out); +//! static void Marshall(const SEMechanicalVentilation& in, CDM::MechanicalVentilationData& out); TEST_F(TEST_FIXTURE_NAME, MechanicalVentilation) { USING_TYPES(MechanicalVentilation) @@ -756,23 +781,23 @@ TEST_F(TEST_FIXTURE_NAME, MechanicalVentilation) CDMType data; source.SetComment("Test Comment"); - source.SetState(CDM::enumOnOff::Off); + source.SetState(biogears::SEOnOff::Off); source.GetFlow().SetValue(1.23, biogears::VolumePerTimeUnit::L_Per_s); source.GetPressure().SetValue(1.23, biogears::PressureUnit::cmH2O); EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, mgr, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, mgr, sink); EXPECT_EQ(source, sink); } #include // class SENasalCannula; //! -//! TYPE NasalCannula -//! static void Marshall(const CDM::NasalCannulaData& in, SENasalCannula& out); -//! static void UnMarshall(const SENasalCannula& in, CDM::NasalCannulaData& out); +//! TYPE NasalCannula +//! static void UnMarshall(const CDM::NasalCannulaData& in, SENasalCannula& out); +//! static void Marshall(const SENasalCannula& in, CDM::NasalCannulaData& out); TEST_F(TEST_FIXTURE_NAME, NasalCannula) { USING_TYPES(NasalCannula) @@ -785,23 +810,22 @@ TEST_F(TEST_FIXTURE_NAME, NasalCannula) source.SetComment("Test Comment"); source.GetFlowRate().SetValue(1.23, biogears::VolumePerTimeUnit::L_Per_s); - EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include -//class SENeedleDecompression; +// class SENeedleDecompression; //! //! TYPE NeedleDecompression -//! static void Marshall(const CDM::NeedleDecompressionData& in, SENeedleDecompression& out); -//! static void UnMarshall(const SENeedleDecompression& in, CDM::NeedleDecompressionData& out); -//! +//! static void UnMarshall(const CDM::NeedleDecompressionData& in, SENeedleDecompression& out); +//! static void Marshall(const SENeedleDecompression& in, CDM::NeedleDecompressionData& out); +//! TEST_F(TEST_FIXTURE_NAME, NeedleDecompression) { USING_TYPES(NeedleDecompression) @@ -810,23 +834,23 @@ TEST_F(TEST_FIXTURE_NAME, NeedleDecompression) CDMType data; source.SetComment("Test Comment"); - source.SetSide(CDM::enumSide::Left); + source.SetSide(biogears::SESide::Left); source.SetActive(true); EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include -//class SEPainStimulus; +// class SEPainStimulus; //! //! TYPE PainStimulus -//! static void Marshall(const CDM::PainStimulusData& in, SEPainStimulus& out); -//! static void UnMarshall(const SEPainStimulus& in, CDM::PainStimulusData& out); +//! static void UnMarshall(const CDM::PainStimulusData& in, SEPainStimulus& out); +//! static void Marshall(const SEPainStimulus& in, CDM::PainStimulusData& out); TEST_F(TEST_FIXTURE_NAME, PainStimulus) { USING_TYPES(PainStimulus) @@ -840,18 +864,18 @@ TEST_F(TEST_FIXTURE_NAME, PainStimulus) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include -//class SEPericardialEffusion; +// class SEPericardialEffusion; //! //! TYPE PericardialEffusion -//! static void Marshall(const CDM::PericardialEffusionData& in, SEPericardialEffusion& out); -//! static void UnMarshall(const SEPericardialEffusion& in, CDM::PericardialEffusionData& out); +//! static void UnMarshall(const CDM::PericardialEffusionData& in, SEPericardialEffusion& out); +//! static void Marshall(const SEPericardialEffusion& in, CDM::PericardialEffusionData& out); TEST_F(TEST_FIXTURE_NAME, PericardialEffusion) { USING_TYPES(PericardialEffusion) @@ -864,18 +888,18 @@ TEST_F(TEST_FIXTURE_NAME, PericardialEffusion) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include -//class SEPulmonaryShunt; +// class SEPulmonaryShunt; //! //! TYPE PulmonaryShunt -//! static void Marshall(const CDM::PulmonaryShuntData& in, SEPulmonaryShunt& out); -//! static void UnMarshall(const SEPulmonaryShunt& in, CDM::PulmonaryShuntData& out); +//! static void UnMarshall(const CDM::PulmonaryShuntData& in, SEPulmonaryShunt& out); +//! static void Marshall(const SEPulmonaryShunt& in, CDM::PulmonaryShuntData& out); TEST_F(TEST_FIXTURE_NAME, PulmonaryShunt) { USING_TYPES(PulmonaryShunt) @@ -888,19 +912,19 @@ TEST_F(TEST_FIXTURE_NAME, PulmonaryShunt) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include #include -//class SESubstanceBolus; +// class SESubstanceBolus; //! //! TYPE SubstanceBolus -//! static void Marshall(const CDM::SubstanceBolusData& in, SESubstanceBolus& out); -//! static void UnMarshall(const SESubstanceBolus& in, CDM::SubstanceBolusData& out); +//! static void UnMarshall(const CDM::SubstanceBolusData& in, SESubstanceBolus& out); +//! static void Marshall(const SESubstanceBolus& in, CDM::SubstanceBolusData& out); TEST_F(TEST_FIXTURE_NAME, SubstanceBolus) { USING_TYPES(SubstanceBolus) @@ -908,31 +932,31 @@ TEST_F(TEST_FIXTURE_NAME, SubstanceBolus) biogears::Logger logger; biogears::SESubstanceManager mgr { &logger }; ASSERT_TRUE(mgr.LoadSubstanceDirectory()); - auto oxygen = mgr.GetSubstance("Oxygen"); + auto oxygen = mgr.GetSubstance(biogears::Oxygen); SEType source { *oxygen }, sink { *oxygen }; CDMType data; source.SetComment("Test Comment"); - source.SetAdminRoute(CDM::enumBolusAdministration::Intramuscular); + source.SetAdminRoute(biogears::SEBolusAdministration::Intramuscular); source.GetAdminTime().SetValue(2.9, biogears::TimeUnit::s); source.GetDose().SetValue(1.9, biogears::VolumeUnit::dL); source.GetConcentration().SetValue(2.0, biogears::MassPerVolumeUnit::mg_Per_m3); EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include -//class SESubstanceBolusState; +// class SESubstanceBolusState; //! //! TYPE SubstanceBolusState -//! static void Marshall(const CDM::SubstanceBolusStateData& in, SESubstanceBolusState& out); -//! static void UnMarshall(const SESubstanceBolusState& in, CDM::SubstanceBolusStateData& out); +//! static void UnMarshall(const CDM::SubstanceBolusStateData& in, SESubstanceBolusState& out); +//! static void Marshall(const SESubstanceBolusState& in, CDM::SubstanceBolusStateData& out); TEST_F(TEST_FIXTURE_NAME, SubstanceBolusState) { USING_TYPES(SubstanceBolusState) @@ -940,7 +964,7 @@ TEST_F(TEST_FIXTURE_NAME, SubstanceBolusState) biogears::Logger logger; biogears::SESubstanceManager mgr { &logger }; ASSERT_TRUE(mgr.LoadSubstanceDirectory()); - auto oxygen = mgr.GetSubstance("Oxygen"); + auto oxygen = mgr.GetSubstance(biogears::Oxygen); SEType source { *oxygen }, sink { *oxygen }; CDMType data; @@ -950,19 +974,19 @@ TEST_F(TEST_FIXTURE_NAME, SubstanceBolusState) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include #include -//class SESubstanceCompoundInfusion; +// class SESubstanceCompoundInfusion; //! //! TYPE SubstanceCompoundInfusion -//! static void Marshall(const CDM::SubstanceCompoundInfusionData& in, SESubstanceCompoundInfusion& out); -//! static void UnMarshall(const SESubstanceCompoundInfusion& in, CDM::SubstanceCompoundInfusionData& out); +//! static void UnMarshall(const CDM::SubstanceCompoundInfusionData& in, SESubstanceCompoundInfusion& out); +//! static void Marshall(const SESubstanceCompoundInfusion& in, CDM::SubstanceCompoundInfusionData& out); TEST_F(TEST_FIXTURE_NAME, SubstanceCompoundInfusion) { USING_TYPES(SubstanceCompoundInfusion) @@ -970,7 +994,7 @@ TEST_F(TEST_FIXTURE_NAME, SubstanceCompoundInfusion) biogears::Logger logger; biogears::SESubstanceManager mgr { &logger }; ASSERT_TRUE(mgr.LoadSubstanceDirectory()); - auto saline = mgr.GetCompound("Saline"); + auto saline = mgr.GetCompound(biogears::Saline); ASSERT_TRUE(saline != nullptr); SEType source { *saline }, sink { *saline }; CDMType data; @@ -981,19 +1005,19 @@ TEST_F(TEST_FIXTURE_NAME, SubstanceCompoundInfusion) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include #include -//class SESubstanceInfusion; +// class SESubstanceInfusion; //! //! TYPE SubstanceInfusion -//! static void Marshall(const CDM::SubstanceInfusionData& in, SESubstanceInfusion& out); -//! static void UnMarshall(const SESubstanceInfusion& in, CDM::SubstanceInfusionData& out); +//! static void UnMarshall(const CDM::SubstanceInfusionData& in, SESubstanceInfusion& out); +//! static void Marshall(const SESubstanceInfusion& in, CDM::SubstanceInfusionData& out); TEST_F(TEST_FIXTURE_NAME, SubstanceInfusion) { USING_TYPES(SubstanceInfusion) @@ -1001,7 +1025,7 @@ TEST_F(TEST_FIXTURE_NAME, SubstanceInfusion) biogears::Logger logger; biogears::SESubstanceManager mgr { &logger }; ASSERT_TRUE(mgr.LoadSubstanceDirectory()); - auto oxygen = mgr.GetSubstance("Oxygen"); + auto oxygen = mgr.GetSubstance(biogears::Oxygen); SEType source { *oxygen }, sink { *oxygen }; CDMType data; @@ -1011,8 +1035,8 @@ TEST_F(TEST_FIXTURE_NAME, SubstanceInfusion) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1021,23 +1045,23 @@ TEST_F(TEST_FIXTURE_NAME, SubstanceInfusion) // class SESleep; //! //! TYPE Sleep -//! static void Marshall(const CDM::SleepData& in, SESleep& out); -//! static void UnMarshall(const SESleep& in, CDM::SleepData& out); +//! static void UnMarshall(const CDM::SleepData& in, SESleep& out); +//! static void Marshall(const SESleep& in, CDM::SleepData& out); TEST_F(TEST_FIXTURE_NAME, Sleep) { USING_TYPES(Sleep) biogears::Logger logger; - SEType source { }, sink { }; + SEType source {}, sink {}; CDMType data; source.SetComment("Test Comment"); - source.SetSleepState(CDM::enumOnOff::On); + source.SetSleepState(biogears::SEOnOff::On); EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1046,8 +1070,8 @@ TEST_F(TEST_FIXTURE_NAME, Sleep) // class SESubstanceNasalDose; //! //! TYPE SubstanceNasalDose -//! static void Marshall(const CDM::SubstanceNasalDoseData& in, SESubstanceNasalDose& out); -//! static void UnMarshall(const SESubstanceNasalDose& in, CDM::SubstanceNasalDoseData& out); +//! static void UnMarshall(const CDM::SubstanceNasalDoseData& in, SESubstanceNasalDose& out); +//! static void Marshall(const SESubstanceNasalDose& in, CDM::SubstanceNasalDoseData& out); TEST_F(TEST_FIXTURE_NAME, SubstanceNasalDose) { USING_TYPES(SubstanceNasalDose) @@ -1055,17 +1079,17 @@ TEST_F(TEST_FIXTURE_NAME, SubstanceNasalDose) biogears::Logger logger; biogears::SESubstanceManager mgr { &logger }; ASSERT_TRUE(mgr.LoadSubstanceDirectory()); - auto naloxone = mgr.GetSubstance("Naloxone"); + auto naloxone = mgr.GetSubstance(biogears::Naloxone); SEType source { *naloxone }, sink { *naloxone }; CDMType data; source.SetComment("Test Comment"); - source.GetDose().SetValue( 2.0, biogears::MassUnit::kg); + source.GetDose().SetValue(2.0, biogears::MassUnit::kg); EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1073,8 +1097,8 @@ TEST_F(TEST_FIXTURE_NAME, SubstanceNasalDose) // class NasalState; //! //! TYPE SENasalState -//! static void Marshall(const CDM::NasalStateData& in, SENasalState& out); -//! static void UnMarshall(const SENasalState& in, CDM::NasalStateData& out); +//! static void UnMarshall(const CDM::NasalStateData& in, SENasalState& out); +//! static void Marshall(const SENasalState& in, CDM::NasalStateData& out); TEST_F(TEST_FIXTURE_NAME, NasalState) { USING_TYPES(NasalState) @@ -1082,20 +1106,19 @@ TEST_F(TEST_FIXTURE_NAME, NasalState) biogears::Logger logger; biogears::SESubstanceManager mgr { &logger }; ASSERT_TRUE(mgr.LoadSubstanceDirectory()); - auto naloxone = mgr.GetSubstance("Naloxone"); + auto naloxone = mgr.GetSubstance(biogears::Naloxone); SEType source { *naloxone }, sink { *naloxone }; CDMType data; - source.GetTotalNasalDose().SetValue( 1.1, biogears::MassUnit::kg); - //source.GetVenaCavaConcentration().SetValue(2.2, biogears::MassPerVolumeUnit::g_Per_L); + source.GetTotalNasalDose().SetValue(1.1, biogears::MassUnit::kg); + // source.GetVenaCavaConcentration().SetValue(2.2, biogears::MassPerVolumeUnit::g_Per_L); source.GetUnreleasedNasalMasses().emplace_back(3.2, biogears::MassUnit::g); source.GetReleasedNasalMasses().emplace_back(4.3, biogears::MassUnit::g); - EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1104,8 +1127,8 @@ TEST_F(TEST_FIXTURE_NAME, NasalState) // class SESubstanceOralDose; //! //! TYPE SubstanceOralDose -//! static void Marshall(const CDM::SubstanceOralDoseData& in, SESubstanceOralDose& out); -//! static void UnMarshall(const SESubstanceOralDose& in, CDM::SubstanceOralDoseData& out); +//! static void UnMarshall(const CDM::SubstanceOralDoseData& in, SESubstanceOralDose& out); +//! static void Marshall(const SESubstanceOralDose& in, CDM::SubstanceOralDoseData& out); TEST_F(TEST_FIXTURE_NAME, SubstanceOralDose) { USING_TYPES(SubstanceOralDose) @@ -1113,26 +1136,26 @@ TEST_F(TEST_FIXTURE_NAME, SubstanceOralDose) biogears::Logger logger; biogears::SESubstanceManager mgr { &logger }; ASSERT_TRUE(mgr.LoadSubstanceDirectory()); - auto naloxone = mgr.GetSubstance("Naloxone"); + auto naloxone = mgr.GetSubstance(biogears::Naloxone); SEType source { *naloxone }, sink { *naloxone }; CDMType data; source.SetComment("Test Comment"); source.GetDose().SetValue(2.0, biogears::MassUnit::kg); - source.SetAdminRoute(CDM::enumOralAdministration::Transmucosal); + source.SetAdminRoute(biogears::SEOralAdministrationType::Transmucosal); EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SETransmucosalState; //! //! TYPE TransmucosalState -//! static void Marshall(const CDM::TransmucosalStateData& in, SETransmucosalState& out); -//! static void UnMarshall(const SETransmucosalState& in, CDM::TransmucosalStateData& out); +//! static void UnMarshall(const CDM::TransmucosalStateData& in, SETransmucosalState& out); +//! static void Marshall(const SETransmucosalState& in, CDM::TransmucosalStateData& out); TEST_F(TEST_FIXTURE_NAME, TransmucosalState) { USING_TYPES(TransmucosalState) @@ -1140,7 +1163,7 @@ TEST_F(TEST_FIXTURE_NAME, TransmucosalState) biogears::Logger logger; biogears::SESubstanceManager mgr { &logger }; ASSERT_TRUE(mgr.LoadSubstanceDirectory()); - auto naloxone = mgr.GetSubstance("Naloxone"); + auto naloxone = mgr.GetSubstance(biogears::Naloxone); SEType source { *naloxone }, sink { *naloxone }; CDMType data; @@ -1151,8 +1174,8 @@ TEST_F(TEST_FIXTURE_NAME, TransmucosalState) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1161,36 +1184,36 @@ TEST_F(TEST_FIXTURE_NAME, TransmucosalState) // class SETourniquet; //! //! TYPE Tourniquet -//! static void Marshall(const CDM::TourniquetData& in, SETourniquet& out); -//! static void UnMarshall(const SETourniquet& in, CDM::TourniquetData& out); -//! +//! static void UnMarshall(const CDM::TourniquetData& in, SETourniquet& out); +//! static void Marshall(const SETourniquet& in, CDM::TourniquetData& out); +//! TEST_F(TEST_FIXTURE_NAME, Tourniquet) { USING_TYPES(Tourniquet) biogears::Logger logger; - SEType source { }, sink { }; + SEType source {}, sink {}; CDMType data; source.SetComment("Test Comment"); source.SetCompartment("InferiorAnteriorLateralDistalLimb"); - source.SetTourniquetLevel(CDM::enumTourniquetApplicationLevel::Misapplied); + source.SetTourniquetLevel(biogears::SETourniquetApplicationType::Misapplied); EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include -//class SETensionPneumothorax; +// class SETensionPneumothorax; //! //! TYPE TensionPneumothorax //! -//! static void Marshall(const CDM::TensionPneumothoraxData& in, SETensionPneumothorax& out); -//! static void UnMarshall(const SETensionPneumothorax& in, CDM::TensionPneumothoraxData& out); +//! static void UnMarshall(const CDM::TensionPneumothoraxData& in, SETensionPneumothorax& out); +//! static void Marshall(const SETensionPneumothorax& in, CDM::TensionPneumothoraxData& out); TEST_F(TEST_FIXTURE_NAME, TensionPneumothorax) { USING_TYPES(TensionPneumothorax) @@ -1200,23 +1223,23 @@ TEST_F(TEST_FIXTURE_NAME, TensionPneumothorax) source.SetComment("Test Comment"); source.GetSeverity().SetValue(0.5); - source.SetSide(CDM::enumSide::Left); - source.SetType(CDM::enumPneumothoraxType::Closed); + source.SetSide(biogears::SESide::Left); + source.SetType(biogears::SEPneumothoraxType::Closed); EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include -//class SEUrinate; +// class SEUrinate; //! //! TYPE Urinate -//! static void Marshall(const CDM::UrinateData& in, SEUrinate& out); -//! static void UnMarshall(const SEUrinate& in, CDM::UrinateData& out); +//! static void UnMarshall(const CDM::UrinateData& in, SEUrinate& out); +//! static void Marshall(const SEUrinate& in, CDM::UrinateData& out); TEST_F(TEST_FIXTURE_NAME, Urinate) { USING_TYPES(Urinate) @@ -1228,18 +1251,18 @@ TEST_F(TEST_FIXTURE_NAME, Urinate) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include -//class SEOverride; +// class SEOverride; //! //! TYPE Override -//! static void Marshall(const CDM::OverrideData& in, SEOverride& out); -//! static void UnMarshall(const SEOverride& in, CDM::OverrideData& out); +//! static void UnMarshall(const CDM::OverrideData& in, SEOverride& out); +//! static void Marshall(const SEOverride& in, CDM::OverrideData& out); TEST_F(TEST_FIXTURE_NAME, Override) { USING_TYPES(Override) @@ -1251,11 +1274,8 @@ TEST_F(TEST_FIXTURE_NAME, Override) EXPECT_NE(source, sink); - PatientActions::UnMarshall(source, data); - PatientActions::Marshall(data, sink); + PatientActions::Marshall(source, data); + PatientActions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } - - - diff --git a/projects/biogears/libIO/unit/io/cdm/test_core_io_PatientAssessments.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_PatientAssessments.cpp similarity index 71% rename from projects/biogears/libIO/unit/io/cdm/test_core_io_PatientAssessments.cpp rename to projects/biogears/libBiogears/unit/io/cdm/test_core_io_PatientAssessments.cpp index da172ab30..25542c3b2 100644 --- a/projects/biogears/libIO/unit/io/cdm/test_core_io_PatientAssessments.cpp +++ b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_PatientAssessments.cpp @@ -70,8 +70,8 @@ void TEST_FIXTURE_NAME::TearDown() // class SEArterialBloodGasAnalysis; //! //! TYPE ArterialBloodGasAnalysis -//! static void Marshall(const CDM::ArterialBloodGasAnalysis& in, SEArterialBloodGasAnalysis& out); -//! static void UnMarshall(const SEArterialBloodGasAnalysis& in, CDM::ArterialBloodGasAnalysis& out); +//! static void UnMarshall(const CDM::ArterialBloodGasAnalysis& in, SEArterialBloodGasAnalysis& out); +//! static void Marshall(const SEArterialBloodGasAnalysis& in, CDM::ArterialBloodGasAnalysis& out); #include TEST_F(TEST_FIXTURE_NAME, ArterialBloodGasAnalysis) { @@ -83,7 +83,7 @@ TEST_F(TEST_FIXTURE_NAME, ArterialBloodGasAnalysis) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetpH().SetValue(5); source.GetPartialPressureOxygen().SetValue(6, biogears::PressureUnit::mmHg); @@ -94,16 +94,16 @@ TEST_F(TEST_FIXTURE_NAME, ArterialBloodGasAnalysis) EXPECT_NE(source, sink); - PatientAssessments::UnMarshall(source, data); - PatientAssessments::Marshall(data, sink); + PatientAssessments::Marshall(source, data); + PatientAssessments::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SEPulmonaryFunctionTest; //! //! TYPE PulmonaryFunctionTest -//! static void Marshall(const CDM::PulmonaryFunctionTest& in, SEPulmonaryFunctionTest& out); -//! static void UnMarshall(const SEPulmonaryFunctionTest& in, CDM::PulmonaryFunctionTest& out); +//! static void UnMarshall(const CDM::PulmonaryFunctionTest& in, SEPulmonaryFunctionTest& out); +//! static void Marshall(const SEPulmonaryFunctionTest& in, CDM::PulmonaryFunctionTest& out); #include #include TEST_F(TEST_FIXTURE_NAME, PulmonaryFunctionTest) @@ -116,7 +116,7 @@ TEST_F(TEST_FIXTURE_NAME, PulmonaryFunctionTest) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetExpiratoryReserveVolume().SetValue(4, biogears::VolumeUnit::L); source.GetForcedVitalCapacity().SetValue(5, biogears::VolumeUnit::L); @@ -136,16 +136,16 @@ TEST_F(TEST_FIXTURE_NAME, PulmonaryFunctionTest) EXPECT_NE(source, sink); - PatientAssessments::UnMarshall(source, data); - PatientAssessments::Marshall(data, sink); + PatientAssessments::Marshall(source, data); + PatientAssessments::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SECompleteBloodCount; //! //! TYPE CompleteBloodCoun -//! static void Marshall(const CDM::CompleteBloodCount& in, SECompleteBloodCount& out); -//! static void UnMarshall(const SECompleteBloodCount& in, CDM::CompleteBloodCount& out); +//! static void UnMarshall(const CDM::CompleteBloodCount& in, SECompleteBloodCount& out); +//! static void Marshall(const SECompleteBloodCount& in, CDM::CompleteBloodCount& out); #include TEST_F(TEST_FIXTURE_NAME, CompleteBloodCount) { @@ -157,7 +157,7 @@ TEST_F(TEST_FIXTURE_NAME, CompleteBloodCount) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetHematocrit().SetValue(.5); source.GetHemoglobin().SetValue(5, biogears::MassPerVolumeUnit::g_Per_L); @@ -172,16 +172,16 @@ TEST_F(TEST_FIXTURE_NAME, CompleteBloodCount) EXPECT_NE(source, sink); - PatientAssessments::UnMarshall(source, data); - PatientAssessments::Marshall(data, sink); + PatientAssessments::Marshall(source, data); + PatientAssessments::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SEComprehensiveMetabolicPanel; //! //! TYPE ComprehensiveMetabolicPanel -//! static void Marshall(const CDM::ComprehensiveMetabolicPanel& in, SEComprehensiveMetabolicPanel& out); -//! static void UnMarshall(const SEComprehensiveMetabolicPanel& in, CDM::ComprehensiveMetabolicPanel& out); +//! static void UnMarshall(const CDM::ComprehensiveMetabolicPanel& in, SEComprehensiveMetabolicPanel& out); +//! static void Marshall(const SEComprehensiveMetabolicPanel& in, CDM::ComprehensiveMetabolicPanel& out); #include TEST_F(TEST_FIXTURE_NAME, ComprehensiveMetabolicPanel) { @@ -193,7 +193,7 @@ TEST_F(TEST_FIXTURE_NAME, ComprehensiveMetabolicPanel) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetAlbumin().SetValue(1, biogears::MassPerVolumeUnit::g_Per_cm3); source.GetALP().SetValue(2, biogears::MassPerVolumeUnit::g_Per_cm3); @@ -211,16 +211,16 @@ TEST_F(TEST_FIXTURE_NAME, ComprehensiveMetabolicPanel) EXPECT_NE(source, sink); - PatientAssessments::UnMarshall(source, data); - PatientAssessments::Marshall(data, sink); + PatientAssessments::Marshall(source, data); + PatientAssessments::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SEUrinalysis; //! //! TYPE Urinalysis -//! static void Marshall(const CDM::Urinalysis& in, SEUrinalysis& out); -//! static void UnMarshall(const SEUrinalysis& in, CDM::Urinalysis& out); +//! static void UnMarshall(const CDM::Urinalysis& in, SEUrinalysis& out); +//! static void Marshall(const SEUrinalysis& in, CDM::Urinalysis& out); #include #include TEST_F(TEST_FIXTURE_NAME, Urinalysis) @@ -233,47 +233,47 @@ TEST_F(TEST_FIXTURE_NAME, Urinalysis) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); - source.SetColorResult(CDM::enumUrineColor::Pink); - source.SetAppearanceResult(CDM::enumClarityIndicator::Cloudy); - source.SetGlucoseResult(CDM::enumPresenceIndicator::Positive); - source.SetKetoneResult(CDM::enumPresenceIndicator::Negative); + source.SetColorResult(biogears::SEUrineColor::Pink); + source.SetAppearanceResult(biogears::SEClarityIndicator::Cloudy); + source.SetGlucoseResult(biogears::SEPresenceIndicator::Positive); + source.SetKetoneResult(biogears::SEPresenceIndicator::Negative); source.GetBilirubinResult().SetValue(5); source.GetSpecificGravityResult().SetValue(9); - source.SetBloodResult(CDM::enumPresenceIndicator::Positive); + source.SetBloodResult(biogears::SEPresenceIndicator::Positive); source.GetPHResult().SetValue(2); - source.SetProteinResult(CDM::enumPresenceIndicator::Negative); + source.SetProteinResult(biogears::SEPresenceIndicator::Negative); source.GetUrobilinogenResult().SetValue(88, biogears::MassPerVolumeUnit::g_Per_mL); - source.SetNitriteResult(CDM::enumPresenceIndicator::Positive); - source.SetLeukocyteEsteraseResult(CDM::enumPresenceIndicator::Negative); + source.SetNitriteResult(biogears::SEPresenceIndicator::Positive); + source.SetLeukocyteEsteraseResult(biogears::SEPresenceIndicator::Negative); auto microscopic = new biogears::SEUrinalysisMicroscopic(); - source.GetMicroscopicResult().SetObservationType(CDM::enumMicroscopicObservationType::LowPowerField); + source.GetMicroscopicResult().SetObservationType(biogears::SEMicroscopicObservationType::LowPowerField); source.GetMicroscopicResult().GetRedBloodCellsResult().SetValue(1, biogears::AmountUnit::mol); source.GetMicroscopicResult().GetWhiteBloodCellsResult().SetValue(2, biogears::AmountUnit::pmol); - source.GetMicroscopicResult().SetEpithelialCellsResult(CDM::enumMicroscopicObservationAmount::Many); + source.GetMicroscopicResult().SetEpithelialCellsResult(biogears::SEMicroscopicObservationAmount::Many); source.GetMicroscopicResult().GetCastsResult().SetValue(2, biogears::AmountUnit::pmol); - source.GetMicroscopicResult().SetCrystalsResult(CDM::enumMicroscopicObservationAmount::Few); - source.GetMicroscopicResult().SetBacteriaResult(CDM::enumMicroscopicObservationAmount::Moderate); - source.GetMicroscopicResult().SetTrichomonadsResult(CDM::enumMicroscopicObservationAmount::Many); - source.GetMicroscopicResult().SetYeastResult(CDM::enumMicroscopicObservationAmount::Few); + source.GetMicroscopicResult().SetCrystalsResult(biogears::SEMicroscopicObservationAmount::Few); + source.GetMicroscopicResult().SetBacteriaResult(biogears::SEMicroscopicObservationAmount::Moderate); + source.GetMicroscopicResult().SetTrichomonadsResult(biogears::SEMicroscopicObservationAmount::Many); + source.GetMicroscopicResult().SetYeastResult(biogears::SEMicroscopicObservationAmount::Few); EXPECT_NE(source, sink); - PatientAssessments::UnMarshall(source, data); - PatientAssessments::Marshall(data, sink); + PatientAssessments::Marshall(source, data); + PatientAssessments::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SEUrinalysisMicroscopic; //! //! TYPE UrinalysisMicroscopic -//! static void Marshall(const CDM::UrinalysisMicroscopic& in, SEUrinalysisMicroscopic& out); -//! static void UnMarshall(const SEUrinalysisMicroscopic& in, CDM::UrinalysisMicroscopic& out); +//! static void UnMarshall(const CDM::UrinalysisMicroscopic& in, SEUrinalysisMicroscopic& out); +//! static void Marshall(const SEUrinalysisMicroscopic& in, CDM::UrinalysisMicroscopic& out); #include TEST_F(TEST_FIXTURE_NAME, UrinalysisMicroscopic) { @@ -285,24 +285,24 @@ TEST_F(TEST_FIXTURE_NAME, UrinalysisMicroscopic) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); - source.SetObservationType(CDM::enumMicroscopicObservationType::LowPowerField); + source.SetObservationType(biogears::SEMicroscopicObservationType::LowPowerField); source.GetRedBloodCellsResult().SetValue(1, biogears::AmountUnit::mol); source.GetWhiteBloodCellsResult().SetValue(2, biogears::AmountUnit::pmol); - source.SetEpithelialCellsResult(CDM::enumMicroscopicObservationAmount::Many); + source.SetEpithelialCellsResult(biogears::SEMicroscopicObservationAmount::Many); source.GetCastsResult().SetValue(2, biogears::AmountUnit::pmol); - source.SetCrystalsResult(CDM::enumMicroscopicObservationAmount::Few); - source.SetBacteriaResult(CDM::enumMicroscopicObservationAmount::Moderate); - source.SetTrichomonadsResult(CDM::enumMicroscopicObservationAmount::Many); - source.SetYeastResult(CDM::enumMicroscopicObservationAmount::Few); + source.SetCrystalsResult(biogears::SEMicroscopicObservationAmount::Few); + source.SetBacteriaResult(biogears::SEMicroscopicObservationAmount::Moderate); + source.SetTrichomonadsResult(biogears::SEMicroscopicObservationAmount::Many); + source.SetYeastResult(biogears::SEMicroscopicObservationAmount::Few); EXPECT_NE(source, sink); - PatientAssessments::UnMarshall(source, data); - PatientAssessments::Marshall(data, sink); + PatientAssessments::Marshall(source, data); + PatientAssessments::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -310,8 +310,8 @@ TEST_F(TEST_FIXTURE_NAME, UrinalysisMicroscopic) // class SEProthrombinTime //! //! TYPE ProthrombinTime -//! static void Marshall(const CDM::ProthrombinTime& in, SEProthrombinTime& out); -//! static void UnMarshall(const SEProthrombinTime& in, CDM::ProthrombinTime& out); +//! static void UnMarshall(const CDM::ProthrombinTime& in, SEProthrombinTime& out); +//! static void Marshall(const SEProthrombinTime& in, CDM::ProthrombinTime& out); #include TEST_F(TEST_FIXTURE_NAME, ProthrombinTime) { @@ -323,23 +323,23 @@ TEST_F(TEST_FIXTURE_NAME, ProthrombinTime) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetInternationalNormalizedRatio().SetValue(.1); EXPECT_NE(source, sink); - PatientAssessments::UnMarshall(source, data); - PatientAssessments::Marshall(data, sink); + PatientAssessments::Marshall(source, data); + PatientAssessments::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SEPsychomotorVigilanceTask //! //! TYPE PsychomotorVigilanceTask -//! static void Marshall(const CDM::PsychomotorVigilanceTask& in, SEPsychomotorVigilanceTask& out); -//! static void UnMarshall(const SEPsychomotorVigilanceTask& in, CDM::PsychomotorVigilanceTask& out); +//! static void UnMarshall(const CDM::PsychomotorVigilanceTask& in, SEPsychomotorVigilanceTask& out); +//! static void Marshall(const SEPsychomotorVigilanceTask& in, CDM::PsychomotorVigilanceTask& out); #include TEST_F(TEST_FIXTURE_NAME, PsychomotorVigilanceTask) { @@ -351,15 +351,15 @@ TEST_F(TEST_FIXTURE_NAME, PsychomotorVigilanceTask) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetAttentionLapses().SetValue(.1); source.GetReactionTime().SetValue(.2, biogears::TimeUnit::s); EXPECT_NE(source, sink); - PatientAssessments::UnMarshall(source, data); - PatientAssessments::Marshall(data, sink); + PatientAssessments::Marshall(source, data); + PatientAssessments::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -367,8 +367,8 @@ TEST_F(TEST_FIXTURE_NAME, PsychomotorVigilanceTask) // class SESequentialOrganFailureAssessment //! //! TYPE SequentialOrganFailureAssessment -//! static void Marshall(const CDM::SequentialOrganFailureAssessment& in, SESequentialOrganFailureAssessment& out); -//! static void UnMarshall(const SESequentialOrganFailureAssessment& in, CDM::SequentialOrganFailureAssessment& out); +//! static void UnMarshall(const CDM::SequentialOrganFailureAssessment& in, SESequentialOrganFailureAssessment& out); +//! static void Marshall(const SESequentialOrganFailureAssessment& in, CDM::SequentialOrganFailureAssessment& out); #include TEST_F(TEST_FIXTURE_NAME, SequentialOrganFailureAssessment) { @@ -380,7 +380,7 @@ TEST_F(TEST_FIXTURE_NAME, SequentialOrganFailureAssessment) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetRespirationSOFA().SetValue(.1); source.GetCoagulationSOFA().SetValue(.2); @@ -391,8 +391,8 @@ TEST_F(TEST_FIXTURE_NAME, SequentialOrganFailureAssessment) EXPECT_NE(source, sink); - PatientAssessments::UnMarshall(source, data); - PatientAssessments::Marshall(data, sink); + PatientAssessments::Marshall(source, data); + PatientAssessments::UnMarshall(data, sink); EXPECT_EQ(source, sink); } \ No newline at end of file diff --git a/projects/biogears/libIO/unit/io/cdm/test_core_io_PatientConditions.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_PatientConditions.cpp similarity index 68% rename from projects/biogears/libIO/unit/io/cdm/test_core_io_PatientConditions.cpp rename to projects/biogears/libBiogears/unit/io/cdm/test_core_io_PatientConditions.cpp index 60f36b1a4..b18f1c2f3 100644 --- a/projects/biogears/libIO/unit/io/cdm/test_core_io_PatientConditions.cpp +++ b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_PatientConditions.cpp @@ -70,20 +70,20 @@ void TEST_FIXTURE_NAME::TearDown() //class SEPatientCondition // TYPE PatientCondition -//static void Marshall(const CDM::PatientConditionData& in, SEPatientCondition& out); -//static void UnMarshall(const SEPatientCondition& in, CDM::PatientConditionData& out); +//static void UnMarshall(const CDM::PatientConditionData& in, SEPatientCondition& out); +//static void Marshall(const SEPatientCondition& in, CDM::PatientConditionData& out); #include //class SEChronicAnemia // TYPE ChronicAnemia -//static void Marshall(const CDM::ChronicAnemiaData& in, SEChronicAnemia& out); -//static void UnMarshall(const SEChronicAnemia& in, CDM::ChronicAnemiaData& out); +//static void UnMarshall(const CDM::ChronicAnemiaData& in, SEChronicAnemia& out); +//static void Marshall(const SEChronicAnemia& in, CDM::ChronicAnemiaData& out); #include //class SEChronicVentricularSystolicDysfunction // TYPE ChronicVentricularSystolicDysfunction -//static void Marshall(const CDM::ChronicVentricularSystolicDysfunctionData& in, SEChronicVentricularSystolicDysfunction& out); -//static void UnMarshall(const SEChronicVentricularSystolicDysfunction& in, CDM::ChronicVentricularSystolicDysfunctionData& out); +//static void UnMarshall(const CDM::ChronicVentricularSystolicDysfunctionData& in, SEChronicVentricularSystolicDysfunction& out); +//static void Marshall(const SEChronicVentricularSystolicDysfunction& in, CDM::ChronicVentricularSystolicDysfunctionData& out); #include TEST_F(TEST_FIXTURE_NAME, ChronicVentricularSystolicDysfunction) { @@ -95,21 +95,21 @@ TEST_F(TEST_FIXTURE_NAME, ChronicVentricularSystolicDysfunction) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.SetComment("ChronicVentricularSystolicDysfunction Serial Test."); EXPECT_NE(source, sink); - PatientConditions::UnMarshall(source, data); - PatientConditions::Marshall(data, sink); + PatientConditions::Marshall(source, data); + PatientConditions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } //class SEChronicObstructivePulmonaryDisease // TYPE ChronicObstructivePulmonaryDisease -//static void Marshall(const CDM::ChronicObstructivePulmonaryDiseaseData& in, SEChronicObstructivePulmonaryDisease& out); -//static void UnMarshall(const SEChronicObstructivePulmonaryDisease& in, CDM::ChronicObstructivePulmonaryDiseaseData& out); +//static void UnMarshall(const CDM::ChronicObstructivePulmonaryDiseaseData& in, SEChronicObstructivePulmonaryDisease& out); +//static void Marshall(const SEChronicObstructivePulmonaryDisease& in, CDM::ChronicObstructivePulmonaryDiseaseData& out); #include TEST_F(TEST_FIXTURE_NAME, ChronicObstructivePulmonaryDisease) { @@ -121,22 +121,22 @@ TEST_F(TEST_FIXTURE_NAME, ChronicObstructivePulmonaryDisease) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetBronchitisSeverity().SetValue(0.3); source.GetEmphysemaSeverity().SetValue(0.3); EXPECT_NE(source, sink); - PatientConditions::UnMarshall(source, data); - PatientConditions::Marshall(data, sink); + PatientConditions::Marshall(source, data); + PatientConditions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } //class SEChronicPericardialEffusion // TYPE ChronicPericardialEffusion -//static void Marshall(const CDM::ChronicPericardialEffusionData& in, SEChronicPericardialEffusion& out); -//static void UnMarshall(const SEChronicPericardialEffusion& in, CDM::ChronicPericardialEffusionData& out); +//static void UnMarshall(const CDM::ChronicPericardialEffusionData& in, SEChronicPericardialEffusion& out); +//static void Marshall(const SEChronicPericardialEffusion& in, CDM::ChronicPericardialEffusionData& out); #include TEST_F(TEST_FIXTURE_NAME, ChronicPericardialEffusion) { @@ -148,22 +148,22 @@ TEST_F(TEST_FIXTURE_NAME, ChronicPericardialEffusion) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetAccumulatedVolume().SetValue(0.3, biogears::VolumeUnit::L); EXPECT_NE(source, sink); - PatientConditions::UnMarshall(source, data); - PatientConditions::Marshall(data, sink); + PatientConditions::Marshall(source, data); + PatientConditions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } //class SEChronicRenalStenosis // TYPE ChronicRenalStenosis -//static void Marshall(const CDM::ChronicRenalStenosisData& in, SEChronicRenalStenosis& out); -//static void UnMarshall(const SEChronicRenalStenosis& in, CDM::ChronicRenalStenosisData& out); +//static void UnMarshall(const CDM::ChronicRenalStenosisData& in, SEChronicRenalStenosis& out); +//static void Marshall(const SEChronicRenalStenosis& in, CDM::ChronicRenalStenosisData& out); #include TEST_F(TEST_FIXTURE_NAME, ChronicRenalStenosis) { @@ -175,23 +175,23 @@ TEST_F(TEST_FIXTURE_NAME, ChronicRenalStenosis) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetLeftKidneySeverity().SetValue(0.3); source.GetRightKidneySeverity().SetValue(0.3); EXPECT_NE(source, sink); - PatientConditions::UnMarshall(source, data); - PatientConditions::Marshall(data, sink); + PatientConditions::Marshall(source, data); + PatientConditions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } //class SEDehydration // TYPE Dehydration -//static void Marshall(const CDM::DehydrationData& in, SEDehydration& out); -//static void UnMarshall(const SEDehydration& in, CDM::DehydrationData& out); +//static void UnMarshall(const CDM::DehydrationData& in, SEDehydration& out); +//static void Marshall(const SEDehydration& in, CDM::DehydrationData& out); #include TEST_F(TEST_FIXTURE_NAME, Dehydration) { @@ -203,21 +203,21 @@ TEST_F(TEST_FIXTURE_NAME, Dehydration) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetDehydrationFraction().SetValue(0.3); EXPECT_NE(source, sink); - PatientConditions::UnMarshall(source, data); - PatientConditions::Marshall(data, sink); + PatientConditions::Marshall(source, data); + PatientConditions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } //class SEDiabetesType1 // TYPE DiabetesType1 -//static void Marshall(const CDM::DiabetesType1Data& in, SEDiabetesType1& out); -//static void UnMarshall(const SEDiabetesType1& in, CDM::DiabetesType1Data& out); +//static void UnMarshall(const CDM::DiabetesType1Data& in, SEDiabetesType1& out); +//static void Marshall(const SEDiabetesType1& in, CDM::DiabetesType1Data& out); #include TEST_F(TEST_FIXTURE_NAME, DiabetesType1) { @@ -229,21 +229,21 @@ TEST_F(TEST_FIXTURE_NAME, DiabetesType1) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetInsulinProductionSeverity().SetValue(0.3); EXPECT_NE(source, sink); - PatientConditions::UnMarshall(source, data); - PatientConditions::Marshall(data, sink); + PatientConditions::Marshall(source, data); + PatientConditions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } //class SEDiabetesType2 // TYPE DiabetesType2 -//static void Marshall(const CDM::DiabetesType2Data& in, SEDiabetesType2& out); -//static void UnMarshall(const SEDiabetesType2& in, CDM::DiabetesType2Data& out); +//static void UnMarshall(const CDM::DiabetesType2Data& in, SEDiabetesType2& out); +//static void Marshall(const SEDiabetesType2& in, CDM::DiabetesType2Data& out); #include TEST_F(TEST_FIXTURE_NAME, DiabetesType2) { @@ -255,22 +255,22 @@ TEST_F(TEST_FIXTURE_NAME, DiabetesType2) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetInsulinProductionSeverity().SetValue(0.3); source.GetInsulinResistanceSeverity().SetValue(0.3); EXPECT_NE(source, sink); - PatientConditions::UnMarshall(source, data); - PatientConditions::Marshall(data, sink); + PatientConditions::Marshall(source, data); + PatientConditions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } //class SEImpairedAlveolarExchange // TYPE ImpairedAlveolarExchange -//static void Marshall(const CDM::ImpairedAlveolarExchangeData& in, SEImpairedAlveolarExchange& out); -//static void UnMarshall(const SEImpairedAlveolarExchange& in, CDM::ImpairedAlveolarExchangeData& out); +//static void UnMarshall(const CDM::ImpairedAlveolarExchangeData& in, SEImpairedAlveolarExchange& out); +//static void Marshall(const SEImpairedAlveolarExchange& in, CDM::ImpairedAlveolarExchangeData& out); #include TEST_F(TEST_FIXTURE_NAME, ImpairedAlveolarExchange) { @@ -282,22 +282,22 @@ TEST_F(TEST_FIXTURE_NAME, ImpairedAlveolarExchange) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetImpairedFraction().SetValue( 0.3 ); source.GetImpairedSurfaceArea().SetValue(5, biogears::AreaUnit::cm2); EXPECT_NE(source, sink); - PatientConditions::UnMarshall(source, data); - PatientConditions::Marshall(data, sink); + PatientConditions::Marshall(source, data); + PatientConditions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } //class SELobarPneumonia // TYPE LobarPneumonia -//static void Marshall(const CDM::LobarPneumoniaData& in, SELobarPneumonia& out); -//static void UnMarshall(const SELobarPneumonia& in, CDM::LobarPneumoniaData& out); +//static void UnMarshall(const CDM::LobarPneumoniaData& in, SELobarPneumonia& out); +//static void Marshall(const SELobarPneumonia& in, CDM::LobarPneumoniaData& out); #include TEST_F(TEST_FIXTURE_NAME, LobarPneumonia) { @@ -309,7 +309,7 @@ TEST_F(TEST_FIXTURE_NAME, LobarPneumonia) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetSeverity().SetValue(0.7); source.GetLeftLungAffected().SetValue(0.2); @@ -317,15 +317,15 @@ TEST_F(TEST_FIXTURE_NAME, LobarPneumonia) EXPECT_NE(source, sink); - PatientConditions::UnMarshall(source, data); - PatientConditions::Marshall(data, sink); + PatientConditions::Marshall(source, data); + PatientConditions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } //class SEStarvation // TYPE Starvation -//static void Marshall(const CDM::StarvationData& in, SEStarvation& out); -//static void UnMarshall(const SEStarvation& in, CDM::StarvationData& out); +//static void UnMarshall(const CDM::StarvationData& in, SEStarvation& out); +//static void Marshall(const SEStarvation& in, CDM::StarvationData& out); #include TEST_F(TEST_FIXTURE_NAME, Starvation) { @@ -337,14 +337,14 @@ TEST_F(TEST_FIXTURE_NAME, Starvation) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetTimeSinceMeal().SetValue(5, biogears::TimeUnit::yr); EXPECT_NE(source, sink); - PatientConditions::UnMarshall(source, data); - PatientConditions::Marshall(data, sink); + PatientConditions::Marshall(source, data); + PatientConditions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } \ No newline at end of file diff --git a/projects/biogears/libIO/unit/io/cdm/test_core_io_PatientNutrition.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_PatientNutrition.cpp similarity index 91% rename from projects/biogears/libIO/unit/io/cdm/test_core_io_PatientNutrition.cpp rename to projects/biogears/libBiogears/unit/io/cdm/test_core_io_PatientNutrition.cpp index 091b67ccf..09208c023 100644 --- a/projects/biogears/libIO/unit/io/cdm/test_core_io_PatientNutrition.cpp +++ b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_PatientNutrition.cpp @@ -70,8 +70,8 @@ void TEST_FIXTURE_NAME::TearDown() // class SENutrition; //! //! TYPE Nutrition -//! static void Marshall(const CDM::Nutrition& in, SENutrition& out); -//! static void UnMarshall(const SENutrition& in, CDM::Nutrition& out); +//! static void UnMarshall(const CDM::Nutrition& in, SENutrition& out); +//! static void Marshall(const SENutrition& in, CDM::Nutrition& out); #include TEST_F(TEST_FIXTURE_NAME, Nutrition) { @@ -83,7 +83,7 @@ TEST_F(TEST_FIXTURE_NAME, Nutrition) SEType source { &logger }, sink { &logger }; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.SetName("Not Real nutrition"); source.GetCarbohydrate().SetValue(0.7777, biogears::MassUnit::g); @@ -95,8 +95,8 @@ TEST_F(TEST_FIXTURE_NAME, Nutrition) EXPECT_NE(source, sink); - PatientNutrition::UnMarshall(source, data); - PatientNutrition::Marshall(data, sink); + PatientNutrition::Marshall(source, data); + PatientNutrition::UnMarshall(data, sink); EXPECT_EQ(source, sink); } \ No newline at end of file diff --git a/projects/biogears/libIO/unit/io/cdm/test_core_io_Physiology.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_Physiology.cpp similarity index 87% rename from projects/biogears/libIO/unit/io/cdm/test_core_io_Physiology.cpp rename to projects/biogears/libBiogears/unit/io/cdm/test_core_io_Physiology.cpp index d8ed1b27a..b1276335b 100644 --- a/projects/biogears/libIO/unit/io/cdm/test_core_io_Physiology.cpp +++ b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_Physiology.cpp @@ -20,7 +20,9 @@ #include +#include #include + #include #include @@ -69,8 +71,8 @@ void TEST_FIXTURE_NAME::TearDown() // class SEPupillaryResponse //! TYPE PupillaryResponse -//! static void Marshall(const CDM::PupillaryResponseData& in, SEPupillaryResponse& out); -//! static void UnMarshall(const SEPupillaryResponse& in, CDM::PupillaryResponseData& out); +//! static void UnMarshall(const CDM::PupillaryResponseData& in, SEPupillaryResponse& out); +//! static void Marshall(const SEPupillaryResponse& in, CDM::PupillaryResponseData& out); #include TEST_F(TEST_FIXTURE_NAME, PupillaryResponse) { @@ -82,7 +84,7 @@ TEST_F(TEST_FIXTURE_NAME, PupillaryResponse) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetReactivityModifier().SetValue(.4); source.GetShapeModifier().SetValue(.9); @@ -90,16 +92,16 @@ TEST_F(TEST_FIXTURE_NAME, PupillaryResponse) EXPECT_NE(source, sink); - Physiology::UnMarshall(source, data); - Physiology::Marshall(data, sink); + Physiology::Marshall(source, data); + Physiology::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SEInflammatoryResponse //! TYPE InflammatoryResponse -//! static void Marshall(const CDM::InflammatoryResponseData& in, SEInflammatoryResponse& out); -//! static void UnMarshall(const SEInflammatoryResponse& in, CDM::InflammatoryResponseData& out); +//! static void UnMarshall(const CDM::InflammatoryResponseData& in, SEInflammatoryResponse& out); +//! static void Marshall(const SEInflammatoryResponse& in, CDM::InflammatoryResponseData& out); #include TEST_F(TEST_FIXTURE_NAME, InflammatoryResponse) { @@ -112,13 +114,13 @@ TEST_F(TEST_FIXTURE_NAME, InflammatoryResponse) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetLocalPathogen().SetValue(0.14); source.GetLocalMacrophage().SetValue(0.13); source.GetLocalNeutrophil().SetValue(0.12); source.GetLocalBarrier().SetValue(0.11); - source.SetActiveTLR(CDM::enumOnOff::Off); + source.SetActiveTLR(biogears::SEOnOff::Off); source.GetAutonomicResponseLevel().SetValue(0.34); source.GetCatecholamines().SetValue(0.33); source.GetConstitutiveNOS().SetValue(0.32); @@ -138,20 +140,20 @@ TEST_F(TEST_FIXTURE_NAME, InflammatoryResponse) source.GetTrauma().SetValue(0.98); source.GetTumorNecrosisFactor().SetValue(0.97); source.GetInflammationTime().SetValue(0.9, biogears::TimeUnit::s); - source.GetInflammationSources().push_back(CDM::enumInflammationSource::Hemorrhage); + source.GetInflammationSources().push_back(biogears::SEInflammationSource::Hemorrhage); EXPECT_NE(source, sink); - Physiology::UnMarshall(source, data); - Physiology::Marshall(data, sink); + Physiology::Marshall(source, data); + Physiology::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SEBloodChemistrySystem //! TYPE BloodChemistrySystem -//! static void Marshall(const CDM::BloodChemistrySystemData& in, SEBloodChemistrySystem& out); -//! static void UnMarshall(const SEBloodChemistrySystem& in, CDM::BloodChemistrySystemData& out); +//! static void UnMarshall(const CDM::BloodChemistrySystemData& in, SEBloodChemistrySystem& out); +//! static void Marshall(const SEBloodChemistrySystem& in, CDM::BloodChemistrySystemData& out); #include TEST_F(TEST_FIXTURE_NAME, BloodChemistrySystem) { @@ -163,7 +165,7 @@ TEST_F(TEST_FIXTURE_NAME, BloodChemistrySystem) SEType source { &logger }, sink { &logger }; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetArterialBloodPH().SetValue(0.1); source.GetArterialBloodPHBaseline().SetValue(0.1); @@ -207,7 +209,7 @@ TEST_F(TEST_FIXTURE_NAME, BloodChemistrySystem) source.GetInflammatoryResponse().GetLocalMacrophage().SetValue(0.13); source.GetInflammatoryResponse().GetLocalNeutrophil().SetValue(0.12); source.GetInflammatoryResponse().GetLocalBarrier().SetValue(0.11); - source.GetInflammatoryResponse().SetActiveTLR(CDM::enumOnOff::Off); + source.GetInflammatoryResponse().SetActiveTLR(biogears::SEOnOff::Off); source.GetInflammatoryResponse().GetAutonomicResponseLevel().SetValue(0.34); source.GetInflammatoryResponse().GetCatecholamines().SetValue(0.33); source.GetInflammatoryResponse().GetConstitutiveNOS().SetValue(0.32); @@ -227,20 +229,20 @@ TEST_F(TEST_FIXTURE_NAME, BloodChemistrySystem) source.GetInflammatoryResponse().GetTrauma().SetValue(0.98); source.GetInflammatoryResponse().GetTumorNecrosisFactor().SetValue(0.97); source.GetInflammatoryResponse().GetInflammationTime().SetValue(0.9, biogears::TimeUnit::s); - source.GetInflammatoryResponse().GetInflammationSources().push_back(CDM::enumInflammationSource::Hemorrhage); + source.GetInflammatoryResponse().GetInflammationSources().push_back(biogears::SEInflammationSource::Hemorrhage); EXPECT_NE(source, sink); - Physiology::UnMarshall(source, data); - Physiology::Marshall(data, sink); + Physiology::Marshall(source, data); + Physiology::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SECardiovascularSystem //! TYPE CardiovascularSystem -//! static void Marshall(const CDM::CardiovascularSystemData& in, SECardiovascularSystem& out); -//! static void UnMarshall(const SECardiovascularSystem& in, CDM::CardiovascularSystemData& out); +//! static void UnMarshall(const CDM::CardiovascularSystemData& in, SECardiovascularSystem& out); +//! static void Marshall(const SECardiovascularSystem& in, CDM::CardiovascularSystemData& out); #include TEST_F(TEST_FIXTURE_NAME, CardiovascularSystem) { @@ -252,14 +254,14 @@ TEST_F(TEST_FIXTURE_NAME, CardiovascularSystem) SEType source { &logger }, sink { &logger }; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); - source.SetHeartRhythm(CDM::enumHeartRhythm::NormalSinus); + source.SetHeartRhythm(biogears::SEHeartRhythm::NormalSinus); source.GetBloodVolume().SetValue(3.0, biogears::VolumeUnit::L); source.GetCardiacIndex().SetValue(4., biogears::VolumePerTimeAreaUnit::mL_Per_min_m2); - source.GetCardiacOutput().SetValue(3.0,biogears::VolumePerTimeUnit::L_Per_day); + source.GetCardiacOutput().SetValue(3.0, biogears::VolumePerTimeUnit::L_Per_day); source.GetHeartEjectionFraction().SetValue(1.0); @@ -300,16 +302,16 @@ TEST_F(TEST_FIXTURE_NAME, CardiovascularSystem) EXPECT_NE(source, sink); - Physiology::UnMarshall(source, data); - Physiology::Marshall(data, sink); + Physiology::Marshall(source, data); + Physiology::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SEDrugSystem //! TYPE DrugSystem -//! static void Marshall(const CDM::DrugSystemData& in, SEDrugSystem& out); -//! static void UnMarshall(const SEDrugSystem& in, CDM::DrugSystemData& out); +//! static void UnMarshall(const CDM::DrugSystemData& in, SEDrugSystem& out); +//! static void Marshall(const SEDrugSystem& in, CDM::DrugSystemData& out); #include TEST_F(TEST_FIXTURE_NAME, DrugSystem) { @@ -321,7 +323,7 @@ TEST_F(TEST_FIXTURE_NAME, DrugSystem) SEType source { &logger }, sink { &logger }; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetAntibioticActivity().SetValue(1.0); @@ -345,16 +347,16 @@ TEST_F(TEST_FIXTURE_NAME, DrugSystem) EXPECT_NE(source, sink); - Physiology::UnMarshall(source, data); - Physiology::Marshall(data, sink); + Physiology::Marshall(source, data); + Physiology::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SEEndocrineSystem //! TYPE EndocrineSystem -//! static void Marshall(const CDM::EndocrineSystemData& in, SEEndocrineSystem& out); -//! static void UnMarshall(const SEEndocrineSystem& in, CDM::EndocrineSystemData& out); +//! static void UnMarshall(const CDM::EndocrineSystemData& in, SEEndocrineSystem& out); +//! static void Marshall(const SEEndocrineSystem& in, CDM::EndocrineSystemData& out); #include TEST_F(TEST_FIXTURE_NAME, EndocrineSystem) { @@ -366,23 +368,23 @@ TEST_F(TEST_FIXTURE_NAME, EndocrineSystem) SEType source { &logger }, sink { &logger }; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetInsulinSynthesisRate().SetValue(1.0, biogears::AmountPerTimeUnit::mmol_Per_min); source.GetGlucagonSynthesisRate().SetValue(2.0, biogears::AmountPerTimeUnit::mmol_Per_min); EXPECT_NE(source, sink); - Physiology::UnMarshall(source, data); - Physiology::Marshall(data, sink); + Physiology::Marshall(source, data); + Physiology::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SEEnergySystem //! TYPE EnergySystem -//! static void Marshall(const CDM::EnergySystemData& in, SEEnergySystem& out); -//! static void UnMarshall(const SEEnergySystem& in, CDM::EnergySystemData& out); +//! static void UnMarshall(const CDM::EnergySystemData& in, SEEnergySystem& out); +//! static void Marshall(const SEEnergySystem& in, CDM::EnergySystemData& out); #include TEST_F(TEST_FIXTURE_NAME, EnergySystem) { @@ -394,7 +396,7 @@ TEST_F(TEST_FIXTURE_NAME, EnergySystem) SEType source { &logger }, sink { &logger }; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetCreatinineProductionRate().SetValue(1.0, biogears::AmountPerTimeUnit::mol_Per_s); source.GetLactateProductionRate().SetValue(1.0, biogears::AmountPerTimeUnit::mol_Per_s); @@ -420,16 +422,16 @@ TEST_F(TEST_FIXTURE_NAME, EnergySystem) EXPECT_NE(source, sink); - Physiology::UnMarshall(source, data); - Physiology::Marshall(data, sink); + Physiology::Marshall(source, data); + Physiology::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SEGastrointestinalSystem //! TYPE GastrointestinalSystem -//! static void Marshall(const CDM::GastrointestinalSystemData& in, SEGastrointestinalSystem& out); -//! static void UnMarshall(const SEGastrointestinalSystem& in, CDM::GastrointestinalSystemData& out); +//! static void UnMarshall(const CDM::GastrointestinalSystemData& in, SEGastrointestinalSystem& out); +//! static void Marshall(const SEGastrointestinalSystem& in, CDM::GastrointestinalSystemData& out); #include #include TEST_F(TEST_FIXTURE_NAME, GastrointestinalSystem) @@ -442,7 +444,7 @@ TEST_F(TEST_FIXTURE_NAME, GastrointestinalSystem) SEType source { &logger }, sink { &logger }; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetChymeAbsorptionRate().SetValue(1.0, biogears::VolumePerTimeUnit::L_Per_s); @@ -473,16 +475,16 @@ TEST_F(TEST_FIXTURE_NAME, GastrointestinalSystem) EXPECT_NE(source, sink); - Physiology::UnMarshall(source, data); - Physiology::Marshall(data, sink); + Physiology::Marshall(source, data); + Physiology::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SEHepaticSystem //! TYPE HepaticSystem -//! static void Marshall(const CDM::HepaticSystemData& in, SEHepaticSystem& out); -//! static void UnMarshall(const SEHepaticSystem& in, CDM::HepaticSystemData& out); +//! static void UnMarshall(const CDM::HepaticSystemData& in, SEHepaticSystem& out); +//! static void Marshall(const SEHepaticSystem& in, CDM::HepaticSystemData& out); #include TEST_F(TEST_FIXTURE_NAME, HepaticSystem) { @@ -494,23 +496,23 @@ TEST_F(TEST_FIXTURE_NAME, HepaticSystem) SEType source { &logger }, sink { &logger }; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetKetoneProductionRate().SetValue(1.0, biogears::AmountPerTimeUnit::mol_Per_day); source.GetHepaticGluconeogenesisRate().SetValue(1.0, biogears::MassPerTimeUnit::g_Per_day); EXPECT_NE(source, sink); - Physiology::UnMarshall(source, data); - Physiology::Marshall(data, sink); + Physiology::Marshall(source, data); + Physiology::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SENervousSystem //! TYPE NervousSystem -//! static void Marshall(const CDM::NervousSystemData& in, SENervousSystem& out); -//! static void UnMarshall(const SENervousSystem& in, CDM::NervousSystemData& out); +//! static void UnMarshall(const CDM::NervousSystemData& in, SENervousSystem& out); +//! static void Marshall(const SENervousSystem& in, CDM::NervousSystemData& out); #include #include TEST_F(TEST_FIXTURE_NAME, NervousSystem) @@ -523,9 +525,9 @@ TEST_F(TEST_FIXTURE_NAME, NervousSystem) SEType source { &logger }, sink { &logger }; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); - source.SetSleepState(CDM::enumSleepState::Asleep); + source.SetSleepState(biogears::SESleepState::Sleeping); source.GetComplianceScale().SetValue(1.0); source.GetHeartRateScale().SetValue(2.0); @@ -555,16 +557,16 @@ TEST_F(TEST_FIXTURE_NAME, NervousSystem) EXPECT_NE(source, sink); - Physiology::UnMarshall(source, data); - Physiology::Marshall(data, sink); + Physiology::Marshall(source, data); + Physiology::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SERenalSystem //! TYPE RenalSystem -//! static void Marshall(const CDM::RenalSystemData& in, SERenalSystem& out); -//! static void UnMarshall(const SERenalSystem& in, CDM::RenalSystemData& out); +//! static void UnMarshall(const CDM::RenalSystemData& in, SERenalSystem& out); +//! static void Marshall(const SERenalSystem& in, CDM::RenalSystemData& out); #include TEST_F(TEST_FIXTURE_NAME, RenalSystem) { @@ -576,7 +578,7 @@ TEST_F(TEST_FIXTURE_NAME, RenalSystem) SEType source { &logger }, sink { &logger }; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetBladderPressure().SetValue(1.0, biogears::PressureUnit::mmHg); @@ -648,16 +650,16 @@ TEST_F(TEST_FIXTURE_NAME, RenalSystem) EXPECT_NE(source, sink); - Physiology::UnMarshall(source, data); - Physiology::Marshall(data, sink); + Physiology::Marshall(source, data); + Physiology::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SERenalSystem //! TYPE RenalSystem -//! static void Marshall(const CDM::RespiratorySystemData& in, SERespiratorySystem& out); -//! static void UnMarshall(const SERespiratorySystem& in, CDM::RespiratorySystemData& out); +//! static void UnMarshall(const CDM::RespiratorySystemData& in, SERespiratorySystem& out); +//! static void Marshall(const SERespiratorySystem& in, CDM::RespiratorySystemData& out); #include TEST_F(TEST_FIXTURE_NAME, RespiratorySystem) { @@ -669,7 +671,7 @@ TEST_F(TEST_FIXTURE_NAME, RespiratorySystem) SEType source { &logger }, sink { &logger }; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetInspiratoryExpiratoryRatio().SetValue(1.0); source.GetSpecificVentilation().SetValue(1.0); @@ -703,16 +705,16 @@ TEST_F(TEST_FIXTURE_NAME, RespiratorySystem) EXPECT_NE(source, sink); - Physiology::UnMarshall(source, data); - Physiology::Marshall(data, sink); + Physiology::Marshall(source, data); + Physiology::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SETissueSystem //! TYPE TissueSystem -//! static void Marshall(const CDM::TissueSystemData& in, SETissueSystem& out); -//! static void UnMarshall(const SETissueSystem& in, CDM::TissueSystemData& out); +//! static void UnMarshall(const CDM::TissueSystemData& in, SETissueSystem& out); +//! static void Marshall(const SETissueSystem& in, CDM::TissueSystemData& out); #include TEST_F(TEST_FIXTURE_NAME, TissueSystem) @@ -725,7 +727,7 @@ TEST_F(TEST_FIXTURE_NAME, TissueSystem) SEType source { &logger }, sink { &logger }; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetIntracellularFluidPH().SetValue(1.0); source.GetRespiratoryExchangeRatio().SetValue(1.0); @@ -755,8 +757,8 @@ TEST_F(TEST_FIXTURE_NAME, TissueSystem) EXPECT_NE(source, sink); - Physiology::UnMarshall(source, data); - Physiology::Marshall(data, sink); + Physiology::Marshall(source, data); + Physiology::UnMarshall(data, sink); EXPECT_EQ(source, sink); } \ No newline at end of file diff --git a/projects/biogears/libIO/unit/io/cdm/test_core_io_Property.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_Property.cpp similarity index 60% rename from projects/biogears/libIO/unit/io/cdm/test_core_io_Property.cpp rename to projects/biogears/libBiogears/unit/io/cdm/test_core_io_Property.cpp index 9e2a4db16..e0f3e2e7b 100644 --- a/projects/biogears/libIO/unit/io/cdm/test_core_io_Property.cpp +++ b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_Property.cpp @@ -62,13 +62,13 @@ void TEST_FIXTURE_NAME::TearDown() using SEType = biogears :: SE ## name; \ using CDMType = CDM :: name ## Data; -#include +#include #include //! //!DecimalFormat; -//! static void Marshall(const CDM::DecimalFormatData& in, SEDecimalFormat& out); -//! static void UnMarshall(const SEDecimalFormat& in, CDM::DecimalFormatData& out); +//! static void UnMarshall(const CDM::DecimalFormatData& in, SEDecimalFormat& out); +//! static void Marshall(const SEDecimalFormat& in, CDM::DecimalFormatData& out); TEST_F(TEST_FIXTURE_NAME, DecimalFormat) { @@ -82,8 +82,8 @@ TEST_F(TEST_FIXTURE_NAME, DecimalFormat) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -91,8 +91,8 @@ TEST_F(TEST_FIXTURE_NAME, DecimalFormat) #include #include //! TYPE FunctionElectricPotentialVsTime -//! static void Marshall(const CDM::FunctionElectricPotentialVsTimeData& in, SEFunctionElectricPotentialVsTime& out); -//! static void UnMarshall(const SEFunctionElectricPotentialVsTime& in, CDM::FunctionElectricPotentialVsTimeData& out); +//! static void UnMarshall(const CDM::FunctionElectricPotentialVsTimeData& in, SEFunctionElectricPotentialVsTime& out); +//! static void Marshall(const SEFunctionElectricPotentialVsTime& in, CDM::FunctionElectricPotentialVsTimeData& out); TEST_F(TEST_FIXTURE_NAME, FunctionElectricPotentialVsTime) { USING_TYPES(FunctionElectricPotentialVsTime) @@ -116,8 +116,8 @@ TEST_F(TEST_FIXTURE_NAME, FunctionElectricPotentialVsTime) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -125,8 +125,8 @@ TEST_F(TEST_FIXTURE_NAME, FunctionElectricPotentialVsTime) #include //! //! TYPE Function; -//! static void Marshall(const CDM::FunctionData& in, SEFunction& out); -//! static void UnMarshall(const SEFunction& in, CDM::FunctionData& out); +//! static void UnMarshall(const CDM::FunctionData& in, SEFunction& out); +//! static void Marshall(const SEFunction& in, CDM::FunctionData& out); TEST_F(TEST_FIXTURE_NAME, Function) { USING_TYPES(Function) @@ -146,8 +146,8 @@ TEST_F(TEST_FIXTURE_NAME, Function) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -155,8 +155,8 @@ TEST_F(TEST_FIXTURE_NAME, Function) #include //! //! TYPE FunctionVolumeVsTime; -//! static void Marshall(const CDM::FunctionVolumeVsTimeData& in, SEFunctionVolumeVsTime& out); -//! static void UnMarshall(const SEFunctionVolumeVsTime& in, CDM::FunctionVolumeVsTimeData& out); +//! static void UnMarshall(const CDM::FunctionVolumeVsTimeData& in, SEFunctionVolumeVsTime& out); +//! static void Marshall(const SEFunctionVolumeVsTime& in, CDM::FunctionVolumeVsTimeData& out); TEST_F(TEST_FIXTURE_NAME, FunctionVolumeVsTime) { USING_TYPES(FunctionVolumeVsTime) @@ -179,16 +179,16 @@ TEST_F(TEST_FIXTURE_NAME, FunctionVolumeVsTime) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include //! //! TYPE HistogramFractionVsLength; -//! static void Marshall(const CDM::HistogramFractionVsLengthData& in, SEHistogramFractionVsLength& out); -//! static void UnMarshall(const SEHistogramFractionVsLength& in, CDM::HistogramFractionVsLengthData& out); +//! static void UnMarshall(const CDM::HistogramFractionVsLengthData& in, SEHistogramFractionVsLength& out); +//! static void Marshall(const SEHistogramFractionVsLength& in, CDM::HistogramFractionVsLengthData& out); TEST_F(TEST_FIXTURE_NAME, HistogramFractionVsLength) { USING_TYPES(HistogramFractionVsLength) @@ -210,16 +210,16 @@ TEST_F(TEST_FIXTURE_NAME, HistogramFractionVsLength) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include //! //! TYPE Histogram -//! static void Marshall(const CDM::HistogramData& in, SEHistogram& out); -//! static void UnMarshall(const SEHistogram& in, CDM::HistogramData& out); +//! static void UnMarshall(const CDM::HistogramData& in, SEHistogram& out); +//! static void Marshall(const SEHistogram& in, CDM::HistogramData& out); TEST_F(TEST_FIXTURE_NAME, Histogram) { USING_TYPES(Histogram) @@ -239,16 +239,16 @@ TEST_F(TEST_FIXTURE_NAME, Histogram) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include //! //! TYPE Scalar0To1 -//! static void Marshall(const CDM::Scalar0To1Data& in, SEScalar0To1& out); -//! static void UnMarshall(const SEScalar0To1& in, CDM::Scalar0To1Data& out); +//! static void UnMarshall(const CDM::Scalar0To1Data& in, SEScalar0To1& out); +//! static void Marshall(const SEScalar0To1& in, CDM::Scalar0To1Data& out); TEST_F(TEST_FIXTURE_NAME, 0To1) { USING_TYPES(Scalar0To1) @@ -260,16 +260,16 @@ TEST_F(TEST_FIXTURE_NAME, 0To1) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include //! //! TYPE ScalarAmount -//! static void Marshall(const CDM::ScalarAmountData& in, SEScalarAmount& out); -//! static void UnMarshall(const SEScalarAmount& in, CDM::ScalarAmountData& out); +//! static void UnMarshall(const CDM::ScalarAmountData& in, SEScalarAmount& out); +//! static void Marshall(const SEScalarAmount& in, CDM::ScalarAmountData& out); TEST_F(TEST_FIXTURE_NAME, Amount) { USING_TYPES(ScalarAmount) @@ -281,8 +281,8 @@ TEST_F(TEST_FIXTURE_NAME, Amount) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -290,8 +290,8 @@ TEST_F(TEST_FIXTURE_NAME, Amount) #include //! //! TYPE ScalarAmountPerMass -//! static void Marshall(const CDM::ScalarAmountPerMassData& in, SEScalarAmountPerMass& out); -//! static void UnMarshall(const SEScalarAmountPerMass& in, CDM::ScalarAmountPerMassData& out); +//! static void UnMarshall(const CDM::ScalarAmountPerMassData& in, SEScalarAmountPerMass& out); +//! static void Marshall(const SEScalarAmountPerMass& in, CDM::ScalarAmountPerMassData& out); TEST_F(TEST_FIXTURE_NAME, AmountPerMass) { USING_TYPES(ScalarAmountPerMass) @@ -303,8 +303,8 @@ TEST_F(TEST_FIXTURE_NAME, AmountPerMass) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -312,8 +312,8 @@ TEST_F(TEST_FIXTURE_NAME, AmountPerMass) #include //! //! TYPE ScalarAmountPerTime -//! static void Marshall(const CDM::ScalarAmountPerTimeData& in, SEScalarAmountPerTime& out); -//! static void UnMarshall(const SEScalarAmountPerTime& in, CDM::ScalarAmountPerTimeData& out); +//! static void UnMarshall(const CDM::ScalarAmountPerTimeData& in, SEScalarAmountPerTime& out); +//! static void Marshall(const SEScalarAmountPerTime& in, CDM::ScalarAmountPerTimeData& out); TEST_F(TEST_FIXTURE_NAME, AmountPerTime) { USING_TYPES(ScalarAmountPerTime) @@ -325,16 +325,16 @@ TEST_F(TEST_FIXTURE_NAME, AmountPerTime) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include //! //! TYPE ScalarAmountPerVolume -//! static void Marshall(const CDM::ScalarAmountPerVolumeData& in, SEScalarAmountPerVolume& out); -//! static void UnMarshall(const SEScalarAmountPerVolume& in, CDM::ScalarAmountPerVolumeData& out); +//! static void UnMarshall(const CDM::ScalarAmountPerVolumeData& in, SEScalarAmountPerVolume& out); +//! static void Marshall(const SEScalarAmountPerVolume& in, CDM::ScalarAmountPerVolumeData& out); TEST_F(TEST_FIXTURE_NAME, AmountPerVolume) { USING_TYPES(ScalarAmountPerVolume) @@ -346,16 +346,16 @@ TEST_F(TEST_FIXTURE_NAME, AmountPerVolume) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include //! //! TYPE ScalarArea -//! static void Marshall(const CDM::ScalarAreaData& in, SEScalarArea& out); -//! static void UnMarshall(const SEScalarArea& in, CDM::ScalarAreaData& out); +//! static void UnMarshall(const CDM::ScalarAreaData& in, SEScalarArea& out); +//! static void Marshall(const SEScalarArea& in, CDM::ScalarAreaData& out); TEST_F(TEST_FIXTURE_NAME, Area) { USING_TYPES(ScalarArea) @@ -367,16 +367,16 @@ TEST_F(TEST_FIXTURE_NAME, Area) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } #include //! //! TYPE ScalarAreaPerTimePressure -//! static void Marshall(const CDM::ScalarAreaPerTimePressureData& in, SEScalarAreaPerTimePressure& out); -//! static void UnMarshall(const SEScalarAreaPerTimePressure& in, CDM::ScalarAreaPerTimePressureData& out); +//! static void UnMarshall(const CDM::ScalarAreaPerTimePressureData& in, SEScalarAreaPerTimePressure& out); +//! static void Marshall(const SEScalarAreaPerTimePressure& in, CDM::ScalarAreaPerTimePressureData& out); TEST_F(TEST_FIXTURE_NAME, AreaPerTimePressure) { USING_TYPES(ScalarAreaPerTimePressure) @@ -388,8 +388,8 @@ TEST_F(TEST_FIXTURE_NAME, AreaPerTimePressure) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -397,8 +397,8 @@ TEST_F(TEST_FIXTURE_NAME, AreaPerTimePressure) //! //! TYPE ScalarElectricCapacitance -//! static void Marshall(const CDM::ScalarElectricCapacitanceData& in, SEScalarElectricCapacitance& out); -//! static void UnMarshall(const SEScalarElectricCapacitance& in, CDM::ScalarElectricCapacitanceData& out); +//! static void UnMarshall(const CDM::ScalarElectricCapacitanceData& in, SEScalarElectricCapacitance& out); +//! static void Marshall(const SEScalarElectricCapacitance& in, CDM::ScalarElectricCapacitanceData& out); TEST_F(TEST_FIXTURE_NAME, ElectricCapacitance) { USING_TYPES(ScalarElectricCapacitance) @@ -410,8 +410,8 @@ TEST_F(TEST_FIXTURE_NAME, ElectricCapacitance) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -419,8 +419,8 @@ TEST_F(TEST_FIXTURE_NAME, ElectricCapacitance) //! //! TYPE ScalarElectricCharge -//! static void Marshall(const CDM::ScalarElectricChargeData& in, SEScalarElectricCharge& out); -//! static void UnMarshall(const SEScalarElectricCharge& in, CDM::ScalarElectricChargeData& out); +//! static void UnMarshall(const CDM::ScalarElectricChargeData& in, SEScalarElectricCharge& out); +//! static void Marshall(const SEScalarElectricCharge& in, CDM::ScalarElectricChargeData& out); TEST_F(TEST_FIXTURE_NAME, ElectricCharge) { USING_TYPES(ScalarElectricCharge) @@ -432,8 +432,8 @@ TEST_F(TEST_FIXTURE_NAME, ElectricCharge) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -441,8 +441,8 @@ TEST_F(TEST_FIXTURE_NAME, ElectricCharge) //! //! TYPE ScalarElectricCurrent -//! static void Marshall(const CDM::ScalarElectricCurrentData& in, SEScalarElectricCurrent& out); -//! static void UnMarshall(const SEScalarElectricCurrent& in, CDM::ScalarElectricCurrentData& out); +//! static void UnMarshall(const CDM::ScalarElectricCurrentData& in, SEScalarElectricCurrent& out); +//! static void Marshall(const SEScalarElectricCurrent& in, CDM::ScalarElectricCurrentData& out); TEST_F(TEST_FIXTURE_NAME, ElectricCurrent) { USING_TYPES(ScalarElectricCurrent) @@ -454,8 +454,8 @@ TEST_F(TEST_FIXTURE_NAME, ElectricCurrent) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -463,8 +463,8 @@ TEST_F(TEST_FIXTURE_NAME, ElectricCurrent) //! //! TYPE ScalarElectricInductance -//! static void Marshall(const CDM::ScalarElectricInductanceData& in, SEScalarElectricInductance& out); -//! static void UnMarshall(const SEScalarElectricInductance& in, CDM::ScalarElectricInductanceData& out); +//! static void UnMarshall(const CDM::ScalarElectricInductanceData& in, SEScalarElectricInductance& out); +//! static void Marshall(const SEScalarElectricInductance& in, CDM::ScalarElectricInductanceData& out); TEST_F(TEST_FIXTURE_NAME, ElectricInductance) { USING_TYPES(ScalarElectricInductance) @@ -476,8 +476,8 @@ TEST_F(TEST_FIXTURE_NAME, ElectricInductance) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -485,8 +485,8 @@ TEST_F(TEST_FIXTURE_NAME, ElectricInductance) //! //! TYPE ScalarElectricPotential -//! static void Marshall(const CDM::ScalarElectricPotentialData& in, SEScalarElectricPotential& out); -//! static void UnMarshall(const SEScalarElectricPotential& in, CDM::ScalarElectricPotentialData& out); +//! static void UnMarshall(const CDM::ScalarElectricPotentialData& in, SEScalarElectricPotential& out); +//! static void Marshall(const SEScalarElectricPotential& in, CDM::ScalarElectricPotentialData& out); TEST_F(TEST_FIXTURE_NAME, ElectricPotential) { USING_TYPES(ScalarElectricPotential) @@ -498,8 +498,8 @@ TEST_F(TEST_FIXTURE_NAME, ElectricPotential) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -507,8 +507,8 @@ TEST_F(TEST_FIXTURE_NAME, ElectricPotential) //! //! TYPE ScalarElectricResistance -//! static void Marshall(const CDM::ScalarElectricResistanceData& in, SEScalarElectricResistance& out); -//! static void UnMarshall(const SEScalarElectricResistance& in, CDM::ScalarElectricResistanceData& out); +//! static void UnMarshall(const CDM::ScalarElectricResistanceData& in, SEScalarElectricResistance& out); +//! static void Marshall(const SEScalarElectricResistance& in, CDM::ScalarElectricResistanceData& out); TEST_F(TEST_FIXTURE_NAME, ElectricResistance) { USING_TYPES(ScalarElectricResistance) @@ -520,8 +520,8 @@ TEST_F(TEST_FIXTURE_NAME, ElectricResistance) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -529,8 +529,8 @@ TEST_F(TEST_FIXTURE_NAME, ElectricResistance) //! //! TYPE ScalarEnergy -//! static void Marshall(const CDM::ScalarEnergyData& in, SEScalarEnergy& out); -//! static void UnMarshall(const SEScalarEnergy& in, CDM::ScalarEnergyData& out); +//! static void UnMarshall(const CDM::ScalarEnergyData& in, SEScalarEnergy& out); +//! static void Marshall(const SEScalarEnergy& in, CDM::ScalarEnergyData& out); TEST_F(TEST_FIXTURE_NAME, Energy) { USING_TYPES(ScalarEnergy) @@ -542,8 +542,8 @@ TEST_F(TEST_FIXTURE_NAME, Energy) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -551,8 +551,8 @@ TEST_F(TEST_FIXTURE_NAME, Energy) //! //! TYPE ScalarEnergyPerAmount -//! static void Marshall(const CDM::ScalarEnergyPerAmountData& in, SEScalarEnergyPerAmount& out); -//! static void UnMarshall(const SEScalarEnergyPerAmount& in, CDM::ScalarEnergyPerAmountData& out); +//! static void UnMarshall(const CDM::ScalarEnergyPerAmountData& in, SEScalarEnergyPerAmount& out); +//! static void Marshall(const SEScalarEnergyPerAmount& in, CDM::ScalarEnergyPerAmountData& out); TEST_F(TEST_FIXTURE_NAME, EnergyPerAmount) { USING_TYPES(ScalarEnergyPerAmount) @@ -564,8 +564,8 @@ TEST_F(TEST_FIXTURE_NAME, EnergyPerAmount) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -573,8 +573,8 @@ TEST_F(TEST_FIXTURE_NAME, EnergyPerAmount) //! //! TYPE ScalarEnergyPerMass -//! static void Marshall(const CDM::ScalarEnergyPerMassData& in, SEScalarEnergyPerMass& out); -//! static void UnMarshall(const SEScalarEnergyPerMass& in, CDM::ScalarEnergyPerMassData& out); +//! static void UnMarshall(const CDM::ScalarEnergyPerMassData& in, SEScalarEnergyPerMass& out); +//! static void Marshall(const SEScalarEnergyPerMass& in, CDM::ScalarEnergyPerMassData& out); TEST_F(TEST_FIXTURE_NAME, EnergyPerMass) { USING_TYPES(ScalarEnergyPerMass) @@ -586,8 +586,8 @@ TEST_F(TEST_FIXTURE_NAME, EnergyPerMass) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -595,8 +595,8 @@ TEST_F(TEST_FIXTURE_NAME, EnergyPerMass) //! //! TYPE ScalarFlowCompliance -//! static void Marshall(const CDM::ScalarFlowComplianceData& in, SEScalarFlowCompliance& out); -//! static void UnMarshall(const SEScalarFlowCompliance& in, CDM::ScalarFlowComplianceData& out); +//! static void UnMarshall(const CDM::ScalarFlowComplianceData& in, SEScalarFlowCompliance& out); +//! static void Marshall(const SEScalarFlowCompliance& in, CDM::ScalarFlowComplianceData& out); TEST_F(TEST_FIXTURE_NAME, FlowCompliance) { USING_TYPES(ScalarFlowCompliance) @@ -608,8 +608,8 @@ TEST_F(TEST_FIXTURE_NAME, FlowCompliance) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -617,8 +617,8 @@ TEST_F(TEST_FIXTURE_NAME, FlowCompliance) //! //! TYPE ScalarFlowElastance -//! static void Marshall(const CDM::ScalarFlowElastanceData& in, SEScalarFlowElastance& out); -//! static void UnMarshall(const SEScalarFlowElastance& in, CDM::ScalarFlowElastanceData& out); +//! static void UnMarshall(const CDM::ScalarFlowElastanceData& in, SEScalarFlowElastance& out); +//! static void Marshall(const SEScalarFlowElastance& in, CDM::ScalarFlowElastanceData& out); TEST_F(TEST_FIXTURE_NAME, FlowElastance) { USING_TYPES(ScalarFlowElastance) @@ -630,8 +630,8 @@ TEST_F(TEST_FIXTURE_NAME, FlowElastance) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -639,8 +639,8 @@ TEST_F(TEST_FIXTURE_NAME, FlowElastance) //! //! TYPE ScalarFlowInertance -//! static void Marshall(const CDM::ScalarFlowInertanceData& in, SEScalarFlowInertance& out); -//! static void UnMarshall(const SEScalarFlowInertance& in, CDM::ScalarFlowInertanceData& out); +//! static void UnMarshall(const CDM::ScalarFlowInertanceData& in, SEScalarFlowInertance& out); +//! static void Marshall(const SEScalarFlowInertance& in, CDM::ScalarFlowInertanceData& out); TEST_F(TEST_FIXTURE_NAME, FlowInertance) { USING_TYPES(ScalarFlowInertance) @@ -652,8 +652,8 @@ TEST_F(TEST_FIXTURE_NAME, FlowInertance) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -661,8 +661,8 @@ TEST_F(TEST_FIXTURE_NAME, FlowInertance) //! //! TYPE ScalarFlowResistance -//! static void Marshall(const CDM::ScalarFlowResistanceData& in, SEScalarFlowResistance& out); -//! static void UnMarshall(const SEScalarFlowResistance& in, CDM::ScalarFlowResistanceData& out); +//! static void UnMarshall(const CDM::ScalarFlowResistanceData& in, SEScalarFlowResistance& out); +//! static void Marshall(const SEScalarFlowResistance& in, CDM::ScalarFlowResistanceData& out); TEST_F(TEST_FIXTURE_NAME, FlowResistance) { USING_TYPES(ScalarFlowResistance) @@ -674,8 +674,8 @@ TEST_F(TEST_FIXTURE_NAME, FlowResistance) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -683,8 +683,8 @@ TEST_F(TEST_FIXTURE_NAME, FlowResistance) //! //! TYPE ScalarForce -//! static void Marshall(const CDM::ScalarForceData& in, SEScalarForce& out); -//! static void UnMarshall(const SEScalarForce& in, CDM::ScalarForceData& out); +//! static void UnMarshall(const CDM::ScalarForceData& in, SEScalarForce& out); +//! static void Marshall(const SEScalarForce& in, CDM::ScalarForceData& out); TEST_F(TEST_FIXTURE_NAME, Force) { USING_TYPES(ScalarForce) @@ -696,8 +696,8 @@ TEST_F(TEST_FIXTURE_NAME, Force) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -705,8 +705,8 @@ TEST_F(TEST_FIXTURE_NAME, Force) //! //! TYPE ScalarFraction -//! static void Marshall(const CDM::ScalarFractionData& in, SEScalarFraction& out); -//! static void UnMarshall(const SEScalarFraction& in, CDM::ScalarFractionData& out); +//! static void UnMarshall(const CDM::ScalarFractionData& in, SEScalarFraction& out); +//! static void Marshall(const SEScalarFraction& in, CDM::ScalarFractionData& out); TEST_F(TEST_FIXTURE_NAME, Fraction) { USING_TYPES(ScalarFraction) @@ -718,8 +718,8 @@ TEST_F(TEST_FIXTURE_NAME, Fraction) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -727,8 +727,8 @@ TEST_F(TEST_FIXTURE_NAME, Fraction) //! //! TYPE ScalarFrequency -//! static void Marshall(const CDM::ScalarFrequencyData& in, SEScalarFrequency& out); -//! static void UnMarshall(const SEScalarFrequency& in, CDM::ScalarFrequencyData& out); +//! static void UnMarshall(const CDM::ScalarFrequencyData& in, SEScalarFrequency& out); +//! static void Marshall(const SEScalarFrequency& in, CDM::ScalarFrequencyData& out); TEST_F(TEST_FIXTURE_NAME, Frequency) { USING_TYPES(ScalarFrequency) @@ -740,8 +740,8 @@ TEST_F(TEST_FIXTURE_NAME, Frequency) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -749,8 +749,8 @@ TEST_F(TEST_FIXTURE_NAME, Frequency) //! //! TYPE Scalar -//! static void Marshall(const CDM::ScalarData& in, SEScalar& out); -//! static void UnMarshall(const SEScalar& in, CDM::ScalarData& out); +//! static void UnMarshall(const CDM::ScalarData& in, SEScalar& out); +//! static void Marshall(const SEScalar& in, CDM::ScalarData& out); TEST_F(TEST_FIXTURE_NAME, Scalar) { USING_TYPES(Scalar) @@ -762,8 +762,8 @@ TEST_F(TEST_FIXTURE_NAME, Scalar) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -771,8 +771,8 @@ TEST_F(TEST_FIXTURE_NAME, Scalar) //! //! TYPE ScalarHeatCapacitance -//! static void Marshall(const CDM::ScalarHeatCapacitanceData& in, SEScalarHeatCapacitance& out); -//! static void UnMarshall(const SEScalarHeatCapacitance& in, CDM::ScalarHeatCapacitanceData& out); +//! static void UnMarshall(const CDM::ScalarHeatCapacitanceData& in, SEScalarHeatCapacitance& out); +//! static void Marshall(const SEScalarHeatCapacitance& in, CDM::ScalarHeatCapacitanceData& out); TEST_F(TEST_FIXTURE_NAME, HeatCapacitance) { USING_TYPES(ScalarHeatCapacitance) @@ -784,8 +784,8 @@ TEST_F(TEST_FIXTURE_NAME, HeatCapacitance) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -793,8 +793,8 @@ TEST_F(TEST_FIXTURE_NAME, HeatCapacitance) //! //! TYPE ScalarHeatCapacitancePerAmount -//! static void Marshall(const CDM::ScalarHeatCapacitancePerAmountData& in, SEScalarHeatCapacitancePerAmount& out); -//! static void UnMarshall(const SEScalarHeatCapacitancePerAmount& in, CDM::ScalarHeatCapacitancePerAmountData& out); +//! static void UnMarshall(const CDM::ScalarHeatCapacitancePerAmountData& in, SEScalarHeatCapacitancePerAmount& out); +//! static void Marshall(const SEScalarHeatCapacitancePerAmount& in, CDM::ScalarHeatCapacitancePerAmountData& out); TEST_F(TEST_FIXTURE_NAME, HeatCapacitancePerAmount) { USING_TYPES(ScalarHeatCapacitancePerAmount) @@ -806,8 +806,8 @@ TEST_F(TEST_FIXTURE_NAME, HeatCapacitancePerAmount) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -815,8 +815,8 @@ TEST_F(TEST_FIXTURE_NAME, HeatCapacitancePerAmount) //! //! TYPE ScalarHeatCapacitancePerMass -//! static void Marshall(const CDM::ScalarHeatCapacitancePerMassData& in, SEScalarHeatCapacitancePerMass& out); -//! static void UnMarshall(const SEScalarHeatCapacitancePerMass& in, CDM::ScalarHeatCapacitancePerMassData& out); +//! static void UnMarshall(const CDM::ScalarHeatCapacitancePerMassData& in, SEScalarHeatCapacitancePerMass& out); +//! static void Marshall(const SEScalarHeatCapacitancePerMass& in, CDM::ScalarHeatCapacitancePerMassData& out); TEST_F(TEST_FIXTURE_NAME, HeatCapacitancePerMass) { USING_TYPES(ScalarHeatCapacitancePerMass) @@ -828,8 +828,8 @@ TEST_F(TEST_FIXTURE_NAME, HeatCapacitancePerMass) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -837,8 +837,8 @@ TEST_F(TEST_FIXTURE_NAME, HeatCapacitancePerMass) //! //! TYPE ScalarHeatConductance -//! static void Marshall(const CDM::ScalarHeatConductanceData& in, SEScalarHeatConductance& out); -//! static void UnMarshall(const SEScalarHeatConductance& in, CDM::ScalarHeatConductanceData& out); +//! static void UnMarshall(const CDM::ScalarHeatConductanceData& in, SEScalarHeatConductance& out); +//! static void Marshall(const SEScalarHeatConductance& in, CDM::ScalarHeatConductanceData& out); TEST_F(TEST_FIXTURE_NAME, HeatConductance) { USING_TYPES(ScalarHeatConductance) @@ -850,8 +850,8 @@ TEST_F(TEST_FIXTURE_NAME, HeatConductance) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -859,8 +859,8 @@ TEST_F(TEST_FIXTURE_NAME, HeatConductance) //! //! TYPE ScalarHeatConductancePerArea -//! static void Marshall(const CDM::ScalarHeatConductancePerAreaData& in, SEScalarHeatConductancePerArea& out); -//! static void UnMarshall(const SEScalarHeatConductancePerArea& in, CDM::ScalarHeatConductancePerAreaData& out); +//! static void UnMarshall(const CDM::ScalarHeatConductancePerAreaData& in, SEScalarHeatConductancePerArea& out); +//! static void Marshall(const SEScalarHeatConductancePerArea& in, CDM::ScalarHeatConductancePerAreaData& out); TEST_F(TEST_FIXTURE_NAME, HeatConductancePerArea) { USING_TYPES(ScalarHeatConductancePerArea) @@ -872,8 +872,8 @@ TEST_F(TEST_FIXTURE_NAME, HeatConductancePerArea) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -881,8 +881,8 @@ TEST_F(TEST_FIXTURE_NAME, HeatConductancePerArea) //! //! TYPE ScalarHeatInductance -//! static void Marshall(const CDM::ScalarHeatInductanceData& in, SEScalarHeatInductance& out); -//! static void UnMarshall(const SEScalarHeatInductance& in, CDM::ScalarHeatInductanceData& out); +//! static void UnMarshall(const CDM::ScalarHeatInductanceData& in, SEScalarHeatInductance& out); +//! static void Marshall(const SEScalarHeatInductance& in, CDM::ScalarHeatInductanceData& out); TEST_F(TEST_FIXTURE_NAME, HeatInductance) { USING_TYPES(ScalarHeatInductance) @@ -894,8 +894,8 @@ TEST_F(TEST_FIXTURE_NAME, HeatInductance) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -903,8 +903,8 @@ TEST_F(TEST_FIXTURE_NAME, HeatInductance) //! //! TYPE ScalarHeatResistanceArea -//! static void Marshall(const CDM::ScalarHeatResistanceAreaData& in, SEScalarHeatResistanceArea& out); -//! static void UnMarshall(const SEScalarHeatResistanceArea& in, CDM::ScalarHeatResistanceAreaData& out); +//! static void UnMarshall(const CDM::ScalarHeatResistanceAreaData& in, SEScalarHeatResistanceArea& out); +//! static void Marshall(const SEScalarHeatResistanceArea& in, CDM::ScalarHeatResistanceAreaData& out); TEST_F(TEST_FIXTURE_NAME, HeatResistanceArea) { USING_TYPES(ScalarHeatResistanceArea) @@ -916,8 +916,8 @@ TEST_F(TEST_FIXTURE_NAME, HeatResistanceArea) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -925,8 +925,8 @@ TEST_F(TEST_FIXTURE_NAME, HeatResistanceArea) //! //! TYPE ScalarHeatResistance -//! static void Marshall(const CDM::ScalarHeatResistanceData& in, SEScalarHeatResistance& out); -//! static void UnMarshall(const SEScalarHeatResistance& in, CDM::ScalarHeatResistanceData& out); +//! static void UnMarshall(const CDM::ScalarHeatResistanceData& in, SEScalarHeatResistance& out); +//! static void Marshall(const SEScalarHeatResistance& in, CDM::ScalarHeatResistanceData& out); TEST_F(TEST_FIXTURE_NAME, HeatResistance) { USING_TYPES(ScalarHeatResistance) @@ -938,8 +938,8 @@ TEST_F(TEST_FIXTURE_NAME, HeatResistance) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -947,8 +947,8 @@ TEST_F(TEST_FIXTURE_NAME, HeatResistance) //! //! TYPE ScalarInversePressure -//! static void Marshall(const CDM::ScalarInversePressureData& in, SEScalarInversePressure& out); -//! static void UnMarshall(const SEScalarInversePressure& in, CDM::ScalarInversePressureData& out); +//! static void UnMarshall(const CDM::ScalarInversePressureData& in, SEScalarInversePressure& out); +//! static void Marshall(const SEScalarInversePressure& in, CDM::ScalarInversePressureData& out); TEST_F(TEST_FIXTURE_NAME, InversePressure) { USING_TYPES(ScalarInversePressure) @@ -960,8 +960,8 @@ TEST_F(TEST_FIXTURE_NAME, InversePressure) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -969,8 +969,8 @@ TEST_F(TEST_FIXTURE_NAME, InversePressure) //! //! TYPE ScalarInverseVolume -//! static void Marshall(const CDM::ScalarInverseVolumeData& in, SEScalarInverseVolume& out); -//! static void UnMarshall(const SEScalarInverseVolume& in, CDM::ScalarInverseVolumeData& out); +//! static void UnMarshall(const CDM::ScalarInverseVolumeData& in, SEScalarInverseVolume& out); +//! static void Marshall(const SEScalarInverseVolume& in, CDM::ScalarInverseVolumeData& out); TEST_F(TEST_FIXTURE_NAME, InverseVolume) { USING_TYPES(ScalarInverseVolume) @@ -982,8 +982,8 @@ TEST_F(TEST_FIXTURE_NAME, InverseVolume) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -991,8 +991,8 @@ TEST_F(TEST_FIXTURE_NAME, InverseVolume) //! //! TYPE ScalarLength -//! static void Marshall(const CDM::ScalarLengthData& in, SEScalarLength& out); -//! static void UnMarshall(const SEScalarLength& in, CDM::ScalarLengthData& out); +//! static void UnMarshall(const CDM::ScalarLengthData& in, SEScalarLength& out); +//! static void Marshall(const SEScalarLength& in, CDM::ScalarLengthData& out); TEST_F(TEST_FIXTURE_NAME, Length) { USING_TYPES(ScalarLength) @@ -1004,8 +1004,8 @@ TEST_F(TEST_FIXTURE_NAME, Length) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1013,8 +1013,8 @@ TEST_F(TEST_FIXTURE_NAME, Length) //! //! TYPE ScalarLengthPerTime -//! static void Marshall(const CDM::ScalarLengthPerTimeData& in, SEScalarLengthPerTime& out); -//! static void UnMarshall(const SEScalarLengthPerTime& in, CDM::ScalarLengthPerTimeData& out); +//! static void UnMarshall(const CDM::ScalarLengthPerTimeData& in, SEScalarLengthPerTime& out); +//! static void Marshall(const SEScalarLengthPerTime& in, CDM::ScalarLengthPerTimeData& out); TEST_F(TEST_FIXTURE_NAME, LengthPerTime) { USING_TYPES(ScalarLengthPerTime) @@ -1026,8 +1026,8 @@ TEST_F(TEST_FIXTURE_NAME, LengthPerTime) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1035,8 +1035,8 @@ TEST_F(TEST_FIXTURE_NAME, LengthPerTime) //! //! TYPE ScalarLengthPerTimePressure -//! static void Marshall(const CDM::ScalarLengthPerTimePressureData& in, SEScalarLengthPerTimePressure& out); -//! static void UnMarshall(const SEScalarLengthPerTimePressure& in, CDM::ScalarLengthPerTimePressureData& out); +//! static void UnMarshall(const CDM::ScalarLengthPerTimePressureData& in, SEScalarLengthPerTimePressure& out); +//! static void Marshall(const SEScalarLengthPerTimePressure& in, CDM::ScalarLengthPerTimePressureData& out); TEST_F(TEST_FIXTURE_NAME, LengthPerTimePressure) { USING_TYPES(ScalarLengthPerTimePressure) @@ -1048,8 +1048,8 @@ TEST_F(TEST_FIXTURE_NAME, LengthPerTimePressure) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1057,8 +1057,8 @@ TEST_F(TEST_FIXTURE_NAME, LengthPerTimePressure) //! //! TYPE ScalarMass -//! static void Marshall(const CDM::ScalarMassData& in, SEScalarMass& out); -//! static void UnMarshall(const SEScalarMass& in, CDM::ScalarMassData& out); +//! static void UnMarshall(const CDM::ScalarMassData& in, SEScalarMass& out); +//! static void Marshall(const SEScalarMass& in, CDM::ScalarMassData& out); TEST_F(TEST_FIXTURE_NAME, Mass) { USING_TYPES(ScalarMass) @@ -1070,8 +1070,8 @@ TEST_F(TEST_FIXTURE_NAME, Mass) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1079,8 +1079,8 @@ TEST_F(TEST_FIXTURE_NAME, Mass) //! //! TYPE ScalarMassPerAmount -//! static void Marshall(const CDM::ScalarMassPerAmountData& in, SEScalarMassPerAmount& out); -//! static void UnMarshall(const SEScalarMassPerAmount& in, CDM::ScalarMassPerAmountData& out); +//! static void UnMarshall(const CDM::ScalarMassPerAmountData& in, SEScalarMassPerAmount& out); +//! static void Marshall(const SEScalarMassPerAmount& in, CDM::ScalarMassPerAmountData& out); TEST_F(TEST_FIXTURE_NAME, MassPerAmount) { USING_TYPES(ScalarMassPerAmount) @@ -1092,8 +1092,8 @@ TEST_F(TEST_FIXTURE_NAME, MassPerAmount) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1101,8 +1101,8 @@ TEST_F(TEST_FIXTURE_NAME, MassPerAmount) //! //! TYPE ScalarMassPerAreaTime -//! static void Marshall(const CDM::ScalarMassPerAreaTimeData& in, SEScalarMassPerAreaTime& out); -//! static void UnMarshall(const SEScalarMassPerAreaTime& in, CDM::ScalarMassPerAreaTimeData& out); +//! static void UnMarshall(const CDM::ScalarMassPerAreaTimeData& in, SEScalarMassPerAreaTime& out); +//! static void Marshall(const SEScalarMassPerAreaTime& in, CDM::ScalarMassPerAreaTimeData& out); TEST_F(TEST_FIXTURE_NAME, MassPerAreaTime) { USING_TYPES(ScalarMassPerAreaTime) @@ -1114,8 +1114,8 @@ TEST_F(TEST_FIXTURE_NAME, MassPerAreaTime) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1123,8 +1123,8 @@ TEST_F(TEST_FIXTURE_NAME, MassPerAreaTime) //! //! TYPE ScalarMassPerMass -//! static void Marshall(const CDM::ScalarMassPerMassData& in, SEScalarMassPerMass& out); -//! static void UnMarshall(const SEScalarMassPerMass& in, CDM::ScalarMassPerMassData& out); +//! static void UnMarshall(const CDM::ScalarMassPerMassData& in, SEScalarMassPerMass& out); +//! static void Marshall(const SEScalarMassPerMass& in, CDM::ScalarMassPerMassData& out); TEST_F(TEST_FIXTURE_NAME, MassPerMass) { USING_TYPES(ScalarMassPerMass) @@ -1136,8 +1136,8 @@ TEST_F(TEST_FIXTURE_NAME, MassPerMass) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1145,8 +1145,8 @@ TEST_F(TEST_FIXTURE_NAME, MassPerMass) //! //! TYPE ScalarMassPerTime -//! static void Marshall(const CDM::ScalarMassPerTimeData& in, SEScalarMassPerTime& out); -//! static void UnMarshall(const SEScalarMassPerTime& in, CDM::ScalarMassPerTimeData& out); +//! static void UnMarshall(const CDM::ScalarMassPerTimeData& in, SEScalarMassPerTime& out); +//! static void Marshall(const SEScalarMassPerTime& in, CDM::ScalarMassPerTimeData& out); TEST_F(TEST_FIXTURE_NAME, MassPerTime) { USING_TYPES(ScalarMassPerTime) @@ -1158,8 +1158,8 @@ TEST_F(TEST_FIXTURE_NAME, MassPerTime) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1167,8 +1167,8 @@ TEST_F(TEST_FIXTURE_NAME, MassPerTime) //! //! TYPE ScalarMassPerVolume -//! static void Marshall(const CDM::ScalarMassPerVolumeData& in, SEScalarMassPerVolume& out); -//! static void UnMarshall(const SEScalarMassPerVolume& in, CDM::ScalarMassPerVolumeData& out); +//! static void UnMarshall(const CDM::ScalarMassPerVolumeData& in, SEScalarMassPerVolume& out); +//! static void Marshall(const SEScalarMassPerVolume& in, CDM::ScalarMassPerVolumeData& out); TEST_F(TEST_FIXTURE_NAME, MassPerVolume) { USING_TYPES(ScalarMassPerVolume) @@ -1180,8 +1180,8 @@ TEST_F(TEST_FIXTURE_NAME, MassPerVolume) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1189,8 +1189,8 @@ TEST_F(TEST_FIXTURE_NAME, MassPerVolume) //! //! TYPE ScalarNeg1To1 -//! static void Marshall(const CDM::ScalarNeg1To1Data& in, SEScalarNeg1To1& out); -//! static void UnMarshall(const SEScalarNeg1To1& in, CDM::ScalarNeg1To1Data& out); +//! static void UnMarshall(const CDM::ScalarNeg1To1Data& in, SEScalarNeg1To1& out); +//! static void Marshall(const SEScalarNeg1To1& in, CDM::ScalarNeg1To1Data& out); TEST_F(TEST_FIXTURE_NAME, Neg1To1) { USING_TYPES(ScalarNeg1To1) @@ -1202,8 +1202,8 @@ TEST_F(TEST_FIXTURE_NAME, Neg1To1) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1211,8 +1211,8 @@ TEST_F(TEST_FIXTURE_NAME, Neg1To1) //! //! TYPE ScalarOsmolality -//! static void Marshall(const CDM::ScalarOsmolalityData& in, SEScalarOsmolality& out); -//! static void UnMarshall(const SEScalarOsmolality& in, CDM::ScalarOsmolalityData& out); +//! static void UnMarshall(const CDM::ScalarOsmolalityData& in, SEScalarOsmolality& out); +//! static void Marshall(const SEScalarOsmolality& in, CDM::ScalarOsmolalityData& out); TEST_F(TEST_FIXTURE_NAME, Osmolality) { USING_TYPES(ScalarOsmolality) @@ -1224,8 +1224,8 @@ TEST_F(TEST_FIXTURE_NAME, Osmolality) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1233,8 +1233,8 @@ TEST_F(TEST_FIXTURE_NAME, Osmolality) //! //! TYPE ScalarOsmolarity -//! static void Marshall(const CDM::ScalarOsmolarityData& in, SEScalarOsmolarity& out); -//! static void UnMarshall(const SEScalarOsmolarity& in, CDM::ScalarOsmolarityData& out); +//! static void UnMarshall(const CDM::ScalarOsmolarityData& in, SEScalarOsmolarity& out); +//! static void Marshall(const SEScalarOsmolarity& in, CDM::ScalarOsmolarityData& out); TEST_F(TEST_FIXTURE_NAME, Osmolarity) { USING_TYPES(ScalarOsmolarity) @@ -1246,8 +1246,8 @@ TEST_F(TEST_FIXTURE_NAME, Osmolarity) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1255,8 +1255,8 @@ TEST_F(TEST_FIXTURE_NAME, Osmolarity) //! //! TYPE ScalarPower -//! static void Marshall(const CDM::ScalarPowerData& in, SEScalarPower& out); -//! static void UnMarshall(const SEScalarPower& in, CDM::ScalarPowerData& out); +//! static void UnMarshall(const CDM::ScalarPowerData& in, SEScalarPower& out); +//! static void Marshall(const SEScalarPower& in, CDM::ScalarPowerData& out); TEST_F(TEST_FIXTURE_NAME, Power) { USING_TYPES(ScalarPower) @@ -1268,8 +1268,8 @@ TEST_F(TEST_FIXTURE_NAME, Power) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1277,8 +1277,8 @@ TEST_F(TEST_FIXTURE_NAME, Power) //! //! TYPE ScalarPowerPerAreaTemperatureToTheFourth -//! static void Marshall(const CDM::ScalarPowerPerAreaTemperatureToTheFourthData& in, SEScalarPowerPerAreaTemperatureToTheFourth& out); -//! static void UnMarshall(const SEScalarPowerPerAreaTemperatureToTheFourth& in, CDM::ScalarPowerPerAreaTemperatureToTheFourthData& out); +//! static void UnMarshall(const CDM::ScalarPowerPerAreaTemperatureToTheFourthData& in, SEScalarPowerPerAreaTemperatureToTheFourth& out); +//! static void Marshall(const SEScalarPowerPerAreaTemperatureToTheFourth& in, CDM::ScalarPowerPerAreaTemperatureToTheFourthData& out); TEST_F(TEST_FIXTURE_NAME, PowerPerAreaTemperatureToTheFourth) { USING_TYPES(ScalarPowerPerAreaTemperatureToTheFourth) @@ -1290,8 +1290,8 @@ TEST_F(TEST_FIXTURE_NAME, PowerPerAreaTemperatureToTheFourth) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1299,8 +1299,8 @@ TEST_F(TEST_FIXTURE_NAME, PowerPerAreaTemperatureToTheFourth) //! //! TYPE ScalarPressure -//! static void Marshall(const CDM::ScalarPressureData& in, SEScalarPressure& out); -//! static void UnMarshall(const SEScalarPressure& in, CDM::ScalarPressureData& out); +//! static void UnMarshall(const CDM::ScalarPressureData& in, SEScalarPressure& out); +//! static void Marshall(const SEScalarPressure& in, CDM::ScalarPressureData& out); TEST_F(TEST_FIXTURE_NAME, Pressure) { USING_TYPES(ScalarPressure) @@ -1312,8 +1312,8 @@ TEST_F(TEST_FIXTURE_NAME, Pressure) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1321,8 +1321,8 @@ TEST_F(TEST_FIXTURE_NAME, Pressure) //! //! TYPE ScalarPressurePerVolume -//! static void Marshall(const CDM::ScalarPressurePerVolumeData& in, SEScalarPressurePerVolume& out); -//! static void UnMarshall(const SEScalarPressurePerVolume& in, CDM::ScalarPressurePerVolumeData& out); +//! static void UnMarshall(const CDM::ScalarPressurePerVolumeData& in, SEScalarPressurePerVolume& out); +//! static void Marshall(const SEScalarPressurePerVolume& in, CDM::ScalarPressurePerVolumeData& out); TEST_F(TEST_FIXTURE_NAME, PressurePerVolume) { USING_TYPES(ScalarPressurePerVolume) @@ -1334,8 +1334,8 @@ TEST_F(TEST_FIXTURE_NAME, PressurePerVolume) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1343,8 +1343,8 @@ TEST_F(TEST_FIXTURE_NAME, PressurePerVolume) //! //! TYPE ScaMlarPressureTimePerArea -//! static void Marshall(const CDM::ScalarPressureTimePerAreaData& in, SEScalarPressureTimePerArea& out); -//! static void UnMarshall(const SEScalarPressureTimePerArea& in, CDM::ScalarPressureTimePerAreaData& out); +//! static void UnMarshall(const CDM::ScalarPressureTimePerAreaData& in, SEScalarPressureTimePerArea& out); +//! static void Marshall(const SEScalarPressureTimePerArea& in, CDM::ScalarPressureTimePerAreaData& out); TEST_F(TEST_FIXTURE_NAME, PressureTimePerArea) { USING_TYPES(ScalarPressureTimePerArea) @@ -1356,8 +1356,8 @@ TEST_F(TEST_FIXTURE_NAME, PressureTimePerArea) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1365,8 +1365,8 @@ TEST_F(TEST_FIXTURE_NAME, PressureTimePerArea) //! //! TYPE ScalarPressureTimePerVolumeArea -//! static void Marshall(const CDM::ScalarPressureTimePerVolumeAreaData& in, SEScalarPressureTimePerVolumeArea& out); -//! static void UnMarshall(const SEScalarPressureTimePerVolumeArea& in, CDM::ScalarPressureTimePerVolumeAreaData& out); +//! static void UnMarshall(const CDM::ScalarPressureTimePerVolumeAreaData& in, SEScalarPressureTimePerVolumeArea& out); +//! static void Marshall(const SEScalarPressureTimePerVolumeArea& in, CDM::ScalarPressureTimePerVolumeAreaData& out); TEST_F(TEST_FIXTURE_NAME, PressureTimePerVolumeArea) { USING_TYPES(ScalarPressureTimePerVolumeArea) @@ -1378,8 +1378,8 @@ TEST_F(TEST_FIXTURE_NAME, PressureTimePerVolumeArea) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1387,8 +1387,8 @@ TEST_F(TEST_FIXTURE_NAME, PressureTimePerVolumeArea) //! //! TYPE ScalarTemperature -//! static void Marshall(const CDM::ScalarTemperatureData& in, SEScalarTemperature& out); -//! static void UnMarshall(const SEScalarTemperature& in, CDM::ScalarTemperatureData& out); +//! static void UnMarshall(const CDM::ScalarTemperatureData& in, SEScalarTemperature& out); +//! static void Marshall(const SEScalarTemperature& in, CDM::ScalarTemperatureData& out); TEST_F(TEST_FIXTURE_NAME, Temperature) { USING_TYPES(ScalarTemperature) @@ -1400,8 +1400,8 @@ TEST_F(TEST_FIXTURE_NAME, Temperature) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1409,8 +1409,8 @@ TEST_F(TEST_FIXTURE_NAME, Temperature) //! //! TYPE ScalarTime -//! static void Marshall(const CDM::ScalarTimeData& in, SEScalarTime& out); -//! static void UnMarshall(const SEScalarTime& in, CDM::ScalarTimeData& out); +//! static void UnMarshall(const CDM::ScalarTimeData& in, SEScalarTime& out); +//! static void Marshall(const SEScalarTime& in, CDM::ScalarTimeData& out); TEST_F(TEST_FIXTURE_NAME, Time) { USING_TYPES(ScalarTime) @@ -1422,8 +1422,8 @@ TEST_F(TEST_FIXTURE_NAME, Time) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1431,8 +1431,8 @@ TEST_F(TEST_FIXTURE_NAME, Time) //! //! TYPE ScalarVolume -//! static void Marshall(const CDM::ScalarVolumeData& in, SEScalarVolume& out); -//! static void UnMarshall(const SEScalarVolume& in, CDM::ScalarVolumeData& out); +//! static void UnMarshall(const CDM::ScalarVolumeData& in, SEScalarVolume& out); +//! static void Marshall(const SEScalarVolume& in, CDM::ScalarVolumeData& out); TEST_F(TEST_FIXTURE_NAME, Volume) { USING_TYPES(ScalarVolume) @@ -1444,8 +1444,8 @@ TEST_F(TEST_FIXTURE_NAME, Volume) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1453,8 +1453,8 @@ TEST_F(TEST_FIXTURE_NAME, Volume) //! //! TYPE ScalarVolumePerPressure -//! static void Marshall(const CDM::ScalarVolumePerPressureData& in, SEScalarVolumePerPressure& out); -//! static void UnMarshall(const SEScalarVolumePerPressure& in, CDM::ScalarVolumePerPressureData& out); +//! static void UnMarshall(const CDM::ScalarVolumePerPressureData& in, SEScalarVolumePerPressure& out); +//! static void Marshall(const SEScalarVolumePerPressure& in, CDM::ScalarVolumePerPressureData& out); TEST_F(TEST_FIXTURE_NAME, VolumePerPressure) { USING_TYPES(ScalarVolumePerPressure) @@ -1466,8 +1466,8 @@ TEST_F(TEST_FIXTURE_NAME, VolumePerPressure) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1475,8 +1475,8 @@ TEST_F(TEST_FIXTURE_NAME, VolumePerPressure) //! //! TYPE ScalarVolumePerTimeArea -//! static void Marshall(const CDM::ScalarVolumePerTimeAreaData& in, SEScalarVolumePerTimeArea& out); -//! static void UnMarshall(const SEScalarVolumePerTimeArea& in, CDM::ScalarVolumePerTimeAreaData& out); +//! static void UnMarshall(const CDM::ScalarVolumePerTimeAreaData& in, SEScalarVolumePerTimeArea& out); +//! static void Marshall(const SEScalarVolumePerTimeArea& in, CDM::ScalarVolumePerTimeAreaData& out); TEST_F(TEST_FIXTURE_NAME, VolumePerTimeArea) { USING_TYPES(ScalarVolumePerTimeArea) @@ -1488,8 +1488,8 @@ TEST_F(TEST_FIXTURE_NAME, VolumePerTimeArea) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1497,8 +1497,8 @@ TEST_F(TEST_FIXTURE_NAME, VolumePerTimeArea) //! //! TYPE ScalarVolumePerTime -//! static void Marshall(const CDM::ScalarVolumePerTimeData& in, SEScalarVolumePerTime& out); -//! static void UnMarshall(const SEScalarVolumePerTime& in, CDM::ScalarVolumePerTimeData& out); +//! static void UnMarshall(const CDM::ScalarVolumePerTimeData& in, SEScalarVolumePerTime& out); +//! static void Marshall(const SEScalarVolumePerTime& in, CDM::ScalarVolumePerTimeData& out); TEST_F(TEST_FIXTURE_NAME, VolumePerTime) { USING_TYPES(ScalarVolumePerTime) @@ -1510,8 +1510,8 @@ TEST_F(TEST_FIXTURE_NAME, VolumePerTime) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1519,8 +1519,8 @@ TEST_F(TEST_FIXTURE_NAME, VolumePerTime) //! //! TYPE ScalarVolumePerTimeMass -//! static void Marshall(const CDM::ScalarVolumePerTimeMassData& in, SEScalarVolumePerTimeMass& out); -//! static void UnMarshall(const SEScalarVolumePerTimeMass& in, CDM::ScalarVolumePerTimeMassData& out); +//! static void UnMarshall(const CDM::ScalarVolumePerTimeMassData& in, SEScalarVolumePerTimeMass& out); +//! static void Marshall(const SEScalarVolumePerTimeMass& in, CDM::ScalarVolumePerTimeMassData& out); TEST_F(TEST_FIXTURE_NAME, VolumePerTimeMass) { USING_TYPES(ScalarVolumePerTimeMass) @@ -1532,8 +1532,8 @@ TEST_F(TEST_FIXTURE_NAME, VolumePerTimeMass) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1541,8 +1541,8 @@ TEST_F(TEST_FIXTURE_NAME, VolumePerTimeMass) //! //! TYPE ScalarVolumePerTimePressureArea -//! static void Marshall(const CDM::ScalarVolumePerTimePressureAreaData& in, SEScalarVolumePerTimePressureArea& out); -//! static void UnMarshall(const SEScalarVolumePerTimePressureArea& in, CDM::ScalarVolumePerTimePressureAreaData& out); +//! static void UnMarshall(const CDM::ScalarVolumePerTimePressureAreaData& in, SEScalarVolumePerTimePressureArea& out); +//! static void Marshall(const SEScalarVolumePerTimePressureArea& in, CDM::ScalarVolumePerTimePressureAreaData& out); TEST_F(TEST_FIXTURE_NAME, VolumePerTimePressureArea) { USING_TYPES(ScalarVolumePerTimePressureArea) @@ -1554,8 +1554,8 @@ TEST_F(TEST_FIXTURE_NAME, VolumePerTimePressureArea) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } @@ -1563,8 +1563,8 @@ TEST_F(TEST_FIXTURE_NAME, VolumePerTimePressureArea) //! //! TYPE ScalarVolumePerTimePressure -//! static void Marshall(const CDM::ScalarVolumePerTimePressureData& in, SEScalarVolumePerTimePressure& out); -//! static void UnMarshall(const SEScalarVolumePerTimePressure& in, CDM::ScalarVolumePerTimePressureData& out); +//! static void UnMarshall(const CDM::ScalarVolumePerTimePressureData& in, SEScalarVolumePerTimePressure& out); +//! static void Marshall(const SEScalarVolumePerTimePressure& in, CDM::ScalarVolumePerTimePressureData& out); TEST_F(TEST_FIXTURE_NAME, VolumePerTimePressure) { USING_TYPES(ScalarVolumePerTimePressure) @@ -1576,8 +1576,8 @@ TEST_F(TEST_FIXTURE_NAME, VolumePerTimePressure) EXPECT_NE(source, sink); - Property::UnMarshall(source, data); - Property::Marshall(data, sink); + Property::Marshall(source, data); + Property::UnMarshall(data, sink); EXPECT_EQ(source, sink); } \ No newline at end of file diff --git a/projects/biogears/libIO/unit/io/cdm/test_core_io_Scenario.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_Scenario.cpp similarity index 79% rename from projects/biogears/libIO/unit/io/cdm/test_core_io_Scenario.cpp rename to projects/biogears/libBiogears/unit/io/cdm/test_core_io_Scenario.cpp index 0f9d0a416..9150547f7 100644 --- a/projects/biogears/libIO/unit/io/cdm/test_core_io_Scenario.cpp +++ b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_Scenario.cpp @@ -21,11 +21,13 @@ #include #include +#include #include #include #include #include +#include #ifdef DISABLE_BIOGEARS_Scenario_TEST #define TEST_FIXTURE_NAME DISABLED_ScenarioFixture @@ -73,26 +75,26 @@ void TEST_FIXTURE_NAME::TearDown() // class SECondition; // TYPE Condition -// static void Marshall(const CDM::ConditionData& in, SECondition& out); -// static void UnMarshall(const SECondition& in, CDM::ConditionData& out); +// static void UnMarshall(const CDM::ConditionData& in, SECondition& out); +// static void Marshall(const SECondition& in, CDM::ConditionData& out); #include // class SEAction; // TYPE Action -// static void Marshall(const CDM::ActionData& in, SEAction& out); -// static void UnMarshall(const SEAction& in, CDM::ActionData& out); +// static void UnMarshall(const CDM::ActionData& in, SEAction& out); +// static void Marshall(const SEAction& in, CDM::ActionData& out); #include // class SEDataRequest; // TYPE DataRequest -// static void Marshall(const CDM::DataRequestData& in, SEDataRequest& out); -// static void UnMarshall(const SEDataRequest& in, CDM::DataRequestData& out); +// static void UnMarshall(const CDM::DataRequestData& in, SEDataRequest& out); +// static void Marshall(const SEDataRequest& in, CDM::DataRequestData& out); #include // class SEPatientDataRequest; // TYPE PatientDataRequest -// static void Marshall(const CDM::PatientDataRequestData& in, SEPatientDataRequest& out); -// static void UnMarshall(const SEPatientDataRequest& in, CDM::PatientDataRequestData& out); +// static void UnMarshall(const CDM::PatientDataRequestData& in, SEPatientDataRequest& out); +// static void Marshall(const SEPatientDataRequest& in, CDM::PatientDataRequestData& out); #include TEST_F(TEST_FIXTURE_NAME, PatientDataRequest) { @@ -104,22 +106,22 @@ TEST_F(TEST_FIXTURE_NAME, PatientDataRequest) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.SetNotation(biogears::DecimalNotation::Fixed); source.SetPrecision(3); EXPECT_NE(source, sink); - Scenario::UnMarshall(source, data); - Scenario::Marshall(data, sink); + DataRequests::Marshall(source, data); + DataRequests::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SEPhysiologyDataRequest; // TYPE PhysiologyDataRequest -// static void Marshall(const CDM::PhysiologyDataRequestData& in, SEPhysiologyDataRequest& out); -// static void UnMarshall(const SEPhysiologyDataRequest& in, CDM::PhysiologyDataRequestData& out); +// static void UnMarshall(const CDM::PhysiologyDataRequestData& in, SEPhysiologyDataRequest& out); +// static void Marshall(const SEPhysiologyDataRequest& in, CDM::PhysiologyDataRequestData& out); #include TEST_F(TEST_FIXTURE_NAME, PhysiologyDataRequest) { @@ -131,22 +133,22 @@ TEST_F(TEST_FIXTURE_NAME, PhysiologyDataRequest) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.SetNotation(biogears::DecimalNotation::Fixed); source.SetPrecision(3); EXPECT_NE(source, sink); - Scenario::UnMarshall(source, data); - Scenario::Marshall(data, sink); + DataRequests::Marshall(source, data); + DataRequests::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SEEnvironmentDataRequest; // TYPE EnvironmentDataRequest -// static void Marshall(const CDM::EnvironmentDataRequestData& in, SEEnvironmentDataRequest& out); -// static void UnMarshall(const SEEnvironmentDataRequest& in, CDM::EnvironmentDataRequestData& out); +// static void UnMarshall(const CDM::EnvironmentDataRequestData& in, SEEnvironmentDataRequest& out); +// static void Marshall(const SEEnvironmentDataRequest& in, CDM::EnvironmentDataRequestData& out); #include TEST_F(TEST_FIXTURE_NAME, EnvironmentDataRequest) { @@ -158,7 +160,7 @@ TEST_F(TEST_FIXTURE_NAME, EnvironmentDataRequest) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.SetName("Leg"); source.SetNotation(biogears::DecimalNotation::Fixed); @@ -166,15 +168,15 @@ TEST_F(TEST_FIXTURE_NAME, EnvironmentDataRequest) EXPECT_NE(source, sink); - Scenario::UnMarshall(source, data); - Scenario::Marshall(data, sink); + DataRequests::Marshall(source, data); + DataRequests::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SEEquipmentDataRequest; // TYPE EquipmentDataRequest -// static void Marshall(const CDM::EquipmentDataRequestData& in, SEEquipmentDataRequest& out); -// static void UnMarshall(const SEEquipmentDataRequest& in, CDM::EquipmentDataRequestData& out); +// static void UnMarshall(const CDM::EquipmentDataRequestData& in, SEEquipmentDataRequest& out); +// static void Marshall(const SEEquipmentDataRequest& in, CDM::EquipmentDataRequestData& out); #include TEST_F(TEST_FIXTURE_NAME, EquipmentDataRequest) { @@ -186,33 +188,33 @@ TEST_F(TEST_FIXTURE_NAME, EquipmentDataRequest) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.SetType("A TYPE"); EXPECT_NE(source, sink); - Scenario::UnMarshall(source, data); - Scenario::Marshall(data, sink); + DataRequests::Marshall(source, data); + DataRequests::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SECompartmentDataRequest; // TYPE CompartmentDataRequest -// static void Marshall(const CDM::CompartmentDataRequestData& in, SECompartmentDataRequest& out); -// static void UnMarshall(const SECompartmentDataRequest& in, CDM::CompartmentDataRequestData& out); +// static void UnMarshall(const CDM::CompartmentDataRequestData& in, SECompartmentDataRequest& out); +// static void Marshall(const SECompartmentDataRequest& in, CDM::CompartmentDataRequestData& out); #include // class SECompartmentSubstanceDataRequest; // TYPE CompartmentSubstanceDataRequest -// static void Marshall(const CDM::CompartmentSubstanceDataRequestData& in, SECompartmentSubstanceDataRequest& out); -// static void UnMarshall(const SECompartmentSubstanceDataRequest& in, CDM::CompartmentSubstanceDataRequestData& out); +// static void UnMarshall(const CDM::CompartmentSubstanceDataRequestData& in, SECompartmentSubstanceDataRequest& out); +// static void Marshall(const SECompartmentSubstanceDataRequest& in, CDM::CompartmentSubstanceDataRequestData& out); #include // class SEGasCompartmentDataRequest; // TYPE GasCompartmentDataRequest -// static void Marshall(const CDM::GasCompartmentDataRequestData& in, SEGasCompartmentDataRequest& out); -// static void UnMarshall(const SEGasCompartmentDataRequest& in, CDM::GasCompartmentDataRequestData& out); +// static void UnMarshall(const CDM::GasCompartmentDataRequestData& in, SEGasCompartmentDataRequest& out); +// static void Marshall(const SEGasCompartmentDataRequest& in, CDM::GasCompartmentDataRequestData& out); #include TEST_F(TEST_FIXTURE_NAME, GasCompartmentDataRequest) { @@ -224,21 +226,21 @@ TEST_F(TEST_FIXTURE_NAME, GasCompartmentDataRequest) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.SetCompartment("Leg"); EXPECT_NE(source, sink); - Scenario::UnMarshall(source, data); - Scenario::Marshall(data, sink); + DataRequests::Marshall(source, data); + DataRequests::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SELiquidCompartmentDataRequest; // TYPE LiquidCompartmentDataRequest -// static void Marshall(const CDM::LiquidCompartmentDataRequestData& in, SELiquidCompartmentDataRequest& out); -// static void UnMarshall(const SELiquidCompartmentDataRequest& in, CDM::LiquidCompartmentDataRequestData& out); +// static void UnMarshall(const CDM::LiquidCompartmentDataRequestData& in, SELiquidCompartmentDataRequest& out); +// static void Marshall(const SELiquidCompartmentDataRequest& in, CDM::LiquidCompartmentDataRequestData& out); #include TEST_F(TEST_FIXTURE_NAME, LiquidCompartmentDataRequest) { @@ -250,21 +252,21 @@ TEST_F(TEST_FIXTURE_NAME, LiquidCompartmentDataRequest) SEType source {}, sink {}; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.SetCompartment("Leg"); EXPECT_NE(source, sink); - Scenario::UnMarshall(source, data); - Scenario::Marshall(data, sink); + DataRequests::Marshall(source, data); + DataRequests::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SEThermalCompartmentDataRequest; // TYPE ThermalCompartmentDataRequest -// static void Marshall(const CDM::ThermalCompartmentDataRequestData& in, SEThermalCompartmentDataRequest& out); -// static void UnMarshall(const SEThermalCompartmentDataRequest& in, CDM::ThermalCompartmentDataRequestData& out); +// static void UnMarshall(const CDM::ThermalCompartmentDataRequestData& in, SEThermalCompartmentDataRequest& out); +// static void Marshall(const SEThermalCompartmentDataRequest& in, CDM::ThermalCompartmentDataRequestData& out); #include TEST_F(TEST_FIXTURE_NAME, ThermalCompartmentDataRequest) { @@ -276,21 +278,21 @@ TEST_F(TEST_FIXTURE_NAME, ThermalCompartmentDataRequest) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.SetCompartment("Leg"); EXPECT_NE(source, sink); - Scenario::UnMarshall(source, data); - Scenario::Marshall(data, sink); + DataRequests::Marshall(source, data); + DataRequests::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SETissueCompartmentDataRequest; // TYPE TissueCompartmentDataRequest -// static void Marshall(const CDM::TissueCompartmentDataRequestData& in, SETissueCompartmentDataRequest& out); -// static void UnMarshall(const SETissueCompartmentDataRequest& in, CDM::TissueCompartmentDataRequestData& out); +// static void UnMarshall(const CDM::TissueCompartmentDataRequestData& in, SETissueCompartmentDataRequest& out); +// static void Marshall(const SETissueCompartmentDataRequest& in, CDM::TissueCompartmentDataRequestData& out); #include TEST_F(TEST_FIXTURE_NAME, TissueCompartmentDataRequest) { @@ -302,21 +304,21 @@ TEST_F(TEST_FIXTURE_NAME, TissueCompartmentDataRequest) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.SetCompartment("Leg"); EXPECT_NE(source, sink); - Scenario::UnMarshall(source, data); - Scenario::Marshall(data, sink); + DataRequests::Marshall(source, data); + DataRequests::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SESubstanceDataRequest; // TYPE SubstanceDataRequest -// static void Marshall(const CDM::SubstanceDataRequestData& in, SESubstanceDataRequest& out); -// static void UnMarshall(const SESubstanceDataRequest& in, CDM::SubstanceDataRequestData& out); +// static void UnMarshall(const CDM::SubstanceDataRequestData& in, SESubstanceDataRequest& out); +// static void Marshall(const SESubstanceDataRequest& in, CDM::SubstanceDataRequestData& out); #include TEST_F(TEST_FIXTURE_NAME, SubstanceDataRequest) { @@ -328,22 +330,22 @@ TEST_F(TEST_FIXTURE_NAME, SubstanceDataRequest) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.SetCompartment("Leg"); source.SetSubstance(sarin); EXPECT_NE(source, sink); - Scenario::UnMarshall(source, data); - Scenario::Marshall(data, mgr, sink); + DataRequests::Marshall(source, data); + DataRequests::UnMarshall(data, mgr, sink); EXPECT_EQ(source, sink); } // class SEDataRequestManager; // TYPE DataRequestManager -// static void Marshall(const CDM::DataRequestManagerData& in, SEDataRequestManager& out); -// static void UnMarshall(const SEDataRequestManager& in, CDM::DataRequestManagerData& out); +// static void UnMarshall(const CDM::DataRequestManagerData& in, SEDataRequestManager& out); +// static void Marshall(const SEDataRequestManager& in, CDM::DataRequestManagerData& out); #include TEST_F(TEST_FIXTURE_NAME, DataRequestManager) { @@ -355,7 +357,7 @@ TEST_F(TEST_FIXTURE_NAME, DataRequestManager) SEType source { &logger }, sink { &logger }; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.SetSamplesPerSecond(60); @@ -367,15 +369,15 @@ TEST_F(TEST_FIXTURE_NAME, DataRequestManager) EXPECT_NE(source, sink); - Scenario::UnMarshall(source, data); - Scenario::Marshall(data, mgr, sink); + DataRequests::Marshall(source, data); + DataRequests::UnMarshall(data, mgr, sink); EXPECT_EQ(source, sink); } // class SEScenario; // TYPE Scenario -// static void Marshall(const CDM::ScenarioData& in, SEScenario& out); -// static void UnMarshall(const SEScenario& in, CDM::ScenarioData& out); +// static void UnMarshall(const CDM::ScenarioData& in, SEScenario& out); +// static void Marshall(const SEScenario& in, CDM::ScenarioData& out); #include #include #include @@ -383,8 +385,8 @@ TEST_F(TEST_FIXTURE_NAME, DataRequestManager) #include #include #include -#include #include +#include TEST_F(TEST_FIXTURE_NAME, Scenario) { USING_TYPES(Scenario) @@ -395,7 +397,7 @@ TEST_F(TEST_FIXTURE_NAME, Scenario) SEType source { mgr }, sink { mgr }; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.SetName("SetName"); source.SetDescription("SetDescription"); @@ -435,18 +437,17 @@ TEST_F(TEST_FIXTURE_NAME, Scenario) source.GetInitialParameters().GetConfiguration().GetDynamicStabilizationCriteria().GetStabilizationDuration().SetValue(10, biogears::TimeUnit::s); source.GetInitialParameters().GetConfiguration().GetTimeStep().SetValue(0.02, biogears::TimeUnit::s); - source.GetInitialParameters().GetConfiguration().SetWritePatientBaselineFile(CDM::enumOnOff::Off); + source.GetInitialParameters().GetConfiguration().SetWritePatientBaselineFile(biogears::SEOnOff::Off); source.GetInitialParameters().GetPatient().SetName("unit_test"); source.GetInitialParameters().GetPatient().SetAnnotation("Seerailization Test User"); - source.GetInitialParameters().GetPatient().SetGender(CDM::enumSex::Female); - source.GetInitialParameters().GetPatient().SetSex(CDM::enumSex::Female); + source.GetInitialParameters().GetPatient().SetSex(biogears::SESex::Female); source.GetInitialParameters().GetPatient().GetAge().SetValue(55.0, biogears::TimeUnit::yr); source.GetInitialParameters().GetPatient().GetWeight().SetValue(80.0, biogears::MassUnit::kg); source.GetInitialParameters().GetPatient().GetHeight().SetValue(175.0, biogears::LengthUnit::cm); source.GetInitialParameters().GetPatient().GetAlveoliSurfaceArea().SetValue(16.0, biogears::AreaUnit::cm2); source.GetInitialParameters().GetPatient().GetBasalMetabolicRate().SetValue(15.0, biogears::PowerUnit::J_Per_s); - source.GetInitialParameters().GetPatient().SetBloodType(CDM::enumBloodType::AB); + source.GetInitialParameters().GetPatient().SetBloodType(biogears::SEBloodType::AB); source.GetInitialParameters().GetPatient().SetBloodRh(true); source.GetInitialParameters().GetPatient().GetBloodVolumeBaseline().SetValue(14.0, biogears::VolumeUnit::L); source.GetInitialParameters().GetPatient().GetBodyDensity().SetValue(13.0, biogears::MassPerVolumeUnit::g_Per_L); @@ -478,9 +479,9 @@ TEST_F(TEST_FIXTURE_NAME, Scenario) source.GetInitialParameters().GetPatient().GetVitalCapacity().SetValue(30.0, biogears::VolumeUnit::L); source.GetAutoSerialization().GetPeriod().SetValue(10, biogears::TimeUnit::s); - source.GetAutoSerialization().SetPeriodTimeStamps(CDM::enumOnOff::On); - source.GetAutoSerialization().SetAfterActions(CDM::enumOnOff::On); - source.GetAutoSerialization().SetReloadState(CDM::enumOnOff::On); + source.GetAutoSerialization().SetPeriodTimeStamps(biogears::SEOnOff::On); + source.GetAutoSerialization().SetAfterActions(biogears::SEOnOff::On); + source.GetAutoSerialization().SetReloadState(biogears::SEOnOff::On); source.GetAutoSerialization().SetDirectory("SetDirectory:"); source.GetAutoSerialization().SetFileName("SetFileName:"); source.GetDataRequestManager(); @@ -492,15 +493,15 @@ TEST_F(TEST_FIXTURE_NAME, Scenario) EXPECT_NE(source, sink); - Scenario::UnMarshall(source, data); - Scenario::Marshall(data, sink); + Scenario::Marshall(source, data); + Scenario::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SEScenarioInitialParameters; // TYPE ScenarioInitialParameters -// static void Marshall(const CDM::ScenarioInitialParametersData& in, SEScenarioInitialParameters& out); -// static void UnMarshall(const SEScenarioInitialParameters& in, CDM::ScenarioInitialParametersData& out); +// static void UnMarshall(const CDM::ScenarioInitialParametersData& in, SEScenarioInitialParameters& out); +// static void Marshall(const SEScenarioInitialParameters& in, CDM::ScenarioInitialParametersData& out); #include #include @@ -515,7 +516,7 @@ TEST_F(TEST_FIXTURE_NAME, ScenarioInitialParameters) CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetConfiguration().GetECGInterpolator(); @@ -550,18 +551,17 @@ TEST_F(TEST_FIXTURE_NAME, ScenarioInitialParameters) source.GetConfiguration().GetTimeStep().SetValue(0.02, biogears::TimeUnit::s); - source.GetConfiguration().SetWritePatientBaselineFile(CDM::enumOnOff::Off); + source.GetConfiguration().SetWritePatientBaselineFile(biogears::SEOnOff::Off); source.GetPatient().SetName("unit_test"); source.GetPatient().SetAnnotation("Seerailization Test User"); - source.GetPatient().SetGender(CDM::enumSex::Female); - source.GetPatient().SetSex(CDM::enumSex::Female); + source.GetPatient().SetSex(biogears::SESex::Female); source.GetPatient().GetAge().SetValue(55.0, biogears::TimeUnit::yr); source.GetPatient().GetWeight().SetValue(80.0, biogears::MassUnit::kg); source.GetPatient().GetHeight().SetValue(175.0, biogears::LengthUnit::cm); source.GetPatient().GetAlveoliSurfaceArea().SetValue(16.0, biogears::AreaUnit::cm2); source.GetPatient().GetBasalMetabolicRate().SetValue(15.0, biogears::PowerUnit::J_Per_s); - source.GetPatient().SetBloodType(CDM::enumBloodType::AB); + source.GetPatient().SetBloodType(biogears::SEBloodType::AB); source.GetPatient().SetBloodRh(true); source.GetPatient().GetBloodVolumeBaseline().SetValue(14.0, biogears::VolumeUnit::L); source.GetPatient().GetBodyDensity().SetValue(13.0, biogears::MassPerVolumeUnit::g_Per_L); @@ -597,22 +597,22 @@ TEST_F(TEST_FIXTURE_NAME, ScenarioInitialParameters) biogears::SEChronicAnemia condition; condition.SetComment("SEChronicAnemia"); condition.GetReductionFactor().SetValue(0.4); - + source.AddCondition(condition); source.SetTrackStabilization(false); EXPECT_NE(source, sink); - Scenario::UnMarshall(source, data); - Scenario::Marshall(data, sink); + Scenario::Marshall(source, data); + Scenario::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SEScenarioAutoSerialization; // TYPE ScenarioAutoSerialization -// static void Marshall(const CDM::ScenarioAutoSerializationData& in, SEScenarioAutoSerialization& out); -// static void UnMarshall(const SEScenarioAutoSerialization& in, CDM::ScenarioAutoSerializationData& out); +// static void UnMarshall(const CDM::ScenarioAutoSerializationData& in, SEScenarioAutoSerialization& out); +// static void Marshall(const SEScenarioAutoSerialization& in, CDM::ScenarioAutoSerializationData& out); #include TEST_F(TEST_FIXTURE_NAME, ScenarioAutoSerialization) { @@ -624,29 +624,29 @@ TEST_F(TEST_FIXTURE_NAME, ScenarioAutoSerialization) SEType source { &logger }, sink { &logger }; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetPeriod().SetValue(1.0, biogears::TimeUnit::hr); - source.SetPeriodTimeStamps(CDM::enumOnOff::Off); - source.SetAfterActions(CDM::enumOnOff::On); - source.SetReloadState(CDM::enumOnOff::Off); + source.SetPeriodTimeStamps(biogears::SEOnOff::Off); + source.SetAfterActions(biogears::SEOnOff::On); + source.SetReloadState(biogears::SEOnOff::Off); source.SetDirectory("Something Something"); source.SetFileName("Nothing Nothing"); EXPECT_NE(source, sink); - Scenario::UnMarshall(source, data); - Scenario::Marshall(data, sink); + Scenario::Marshall(source, data); + Scenario::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SEAdvanceTime // TYPE AdvanceTime -// static void Marshall(const CDM::AdvanceTimeData& in, SEAdvanceTime& out); -// static void UnMarshall(const SEAdvanceTime& in, CDM::AdvanceTimeData& out); +// static void UnMarshall(const CDM::AdvanceTimeData& in, SEAdvanceTime& out); +// static void Marshall(const SEAdvanceTime& in, CDM::AdvanceTimeData& out); #include TEST_F(TEST_FIXTURE_NAME, AdvanceTime) { @@ -658,22 +658,22 @@ TEST_F(TEST_FIXTURE_NAME, AdvanceTime) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetTime().SetValue(1.0, biogears::TimeUnit::hr); EXPECT_NE(source, sink); - Scenario::UnMarshall(source, data); - Scenario::Marshall(data, sink); + Actions::Marshall(source, data); + Actions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SESerializeState // TYPE SerializeState -// static void Marshall(const CDM::SerializeStateData& in, SESerializeState& out); -// static void UnMarshall(const SESerializeState& in, CDM::SerializeStateData& out); +// static void UnMarshall(const CDM::SerializeStateData& in, SESerializeState& out); +// static void Marshall(const SESerializeState& in, CDM::SerializeStateData& out); #include TEST_F(TEST_FIXTURE_NAME, SerializeState) { @@ -685,16 +685,16 @@ TEST_F(TEST_FIXTURE_NAME, SerializeState) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.SetComment("SerializeState Test"); source.SetFilename("State.txt"); - source.SetType(CDM::enumSerializationType::Save); + source.SetType(biogears::SESerializationType::Save); EXPECT_NE(source, sink); - Scenario::UnMarshall(source, data); - Scenario::Marshall(data, sink); + Actions::Marshall(source, data); + Actions::UnMarshall(data, sink); EXPECT_EQ(source, sink); } \ No newline at end of file diff --git a/projects/biogears/libIO/unit/io/cdm/test_core_io_Substance.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_Substance.cpp similarity index 69% rename from projects/biogears/libIO/unit/io/cdm/test_core_io_Substance.cpp rename to projects/biogears/libBiogears/unit/io/cdm/test_core_io_Substance.cpp index 1956bd775..1c31175db 100644 --- a/projects/biogears/libIO/unit/io/cdm/test_core_io_Substance.cpp +++ b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_Substance.cpp @@ -20,6 +20,7 @@ #include +#include #include #include #include @@ -74,8 +75,8 @@ void TEST_FIXTURE_NAME::TearDown() // class SESubstanceManager; // TYPE SubstanceManager -// static void Marshall(const CDM::SubstanceManagerData& in, SESubstanceManager& out); -// static void UnMarshall(const SESubstanceManager& in, CDM::SubstanceManagerData& out); +// static void UnMarshall(const CDM::SubstanceManagerData& in, SESubstanceManager& out); +// static void Marshall(const SESubstanceManager& in, CDM::SubstanceManagerData& out); #include #include TEST_F(TEST_FIXTURE_NAME, SubstanceManager) @@ -90,8 +91,8 @@ TEST_F(TEST_FIXTURE_NAME, SubstanceManager) } // class SESubstanceAerosolization; // TYPE SubstanceAerosolization -// static void Marshall(const CDM::SubstanceAerosolizationData& in, SESubstanceAerosolization& out); -// static void UnMarshall(const SESubstanceAerosolization& in, CDM::SubstanceAerosolizationData& out); +// static void UnMarshall(const CDM::SubstanceAerosolizationData& in, SESubstanceAerosolization& out); +// static void Marshall(const SESubstanceAerosolization& in, CDM::SubstanceAerosolizationData& out); #include TEST_F(TEST_FIXTURE_NAME, SubstanceAerosolization) @@ -104,7 +105,7 @@ TEST_F(TEST_FIXTURE_NAME, SubstanceAerosolization) SEType source { &logger }, sink { &logger }; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetBronchioleModifier().SetValue(1.0); source.GetInflammationCoefficient().SetValue(1.0); @@ -117,15 +118,15 @@ TEST_F(TEST_FIXTURE_NAME, SubstanceAerosolization) source.GetParticulateSizeDistribution().SetLengthUnit(biogears::LengthUnit::m); EXPECT_NE(source, sink); - Substance::UnMarshall(source, data); - Substance::Marshall(data, sink); + Substance::Marshall(source, data); + Substance::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SESubstancePharmacokinetics; // TYPE SubstancePharmacokinetics -// static void Marshall(const CDM::SubstancePharmacokineticsData& in, SESubstancePharmacokinetics& out); -// static void UnMarshall(const v& in, CDM::SubstancePharmacokineticsData& out); +// static void UnMarshall(const CDM::SubstancePharmacokineticsData& in, SESubstancePharmacokinetics& out); +// static void Marshall(const v& in, CDM::SubstancePharmacokineticsData& out); #include TEST_F(TEST_FIXTURE_NAME, SubstancePharmacokinetics) @@ -139,34 +140,34 @@ TEST_F(TEST_FIXTURE_NAME, SubstancePharmacokinetics) SEType source { &logger }, sink { &logger }; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); auto& chemicals = source.GetPhysicochemicals(); - chemicals.SetBindingProtein(CDM::enumSubstanceBindingProtein::AAG); + chemicals.SetBindingProtein(biogears::SESubstanceBindingProtein::AAG); chemicals.GetPrimaryPKA().SetValue(9); chemicals.GetSecondaryPKA().SetValue(4); chemicals.GetBloodPlasmaRatio().SetValue(1.0); chemicals.GetFractionUnboundInPlasma().SetValue(1.0); - chemicals.SetIonicState(CDM::enumSubstanceIonicState::Acid); + chemicals.SetIonicState(biogears::SESubstanceIonicState::Acid); chemicals.GetLogP().SetValue(1.0); chemicals.GetHydrogenBondCount().SetValue(1.0); chemicals.GetPolarSurfaceArea().SetValue(1.0); - auto& kenetics = source.GetTissueKinetics("sarin") ; + auto& kenetics = source.GetTissueKinetics("sarin"); kenetics.GetPartitionCoefficient().SetValue(2); EXPECT_NE(source, sink); - Substance::UnMarshall(source, data); - Substance::Marshall(data, sink); + Substance::Marshall(source, data); + Substance::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SESubstancePhysicochemical; // TYPE SubstancePhysicochemicals -// static void Marshall(const CDM::SubstancePhysicochemicalsData& in, SESubstancePhysicochemical& out); -// static void UnMarshall(const SESubstancePhysicochemical& in, CDM::SubstancePhysicochemicalsData& out); +// static void UnMarshall(const CDM::SubstancePhysicochemicalsData& in, SESubstancePhysicochemical& out); +// static void Marshall(const SESubstancePhysicochemical& in, CDM::SubstancePhysicochemicalsData& out); #include TEST_F(TEST_FIXTURE_NAME, SubstancePhysicochemical) @@ -179,29 +180,29 @@ TEST_F(TEST_FIXTURE_NAME, SubstancePhysicochemical) SEType source { &logger }, sink { &logger }; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); - source.SetBindingProtein(CDM::enumSubstanceBindingProtein::AAG); + source.SetBindingProtein(biogears::SESubstanceBindingProtein::AAG); source.GetPrimaryPKA().SetValue(9); source.GetSecondaryPKA().SetValue(4); source.GetBloodPlasmaRatio().SetValue(1.0); source.GetFractionUnboundInPlasma().SetValue(1.0); - source.SetIonicState(CDM::enumSubstanceIonicState::Acid); + source.SetIonicState(biogears::SESubstanceIonicState::Acid); source.GetLogP().SetValue(1.0); source.GetHydrogenBondCount().SetValue(1.0); source.GetPolarSurfaceArea().SetValue(1.0); EXPECT_NE(source, sink); - Substance::UnMarshall(source, data); - Substance::Marshall(data, sink); + Substance::Marshall(source, data); + Substance::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SESubstanceTissuePharmacokinetics; // TYPE SubstanceTissuePharmacokinetics -// static void Marshall(const CDM::SubstanceTissuePharmacokineticsData& in, SESubstanceTissuePharmacokinetics& out); -// static void UnMarshall(const SESubstanceTissuePharmacokinetics& in, CDM::SubstanceTissuePharmacokineticsData& out); +// static void UnMarshall(const CDM::SubstanceTissuePharmacokineticsData& in, SESubstanceTissuePharmacokinetics& out); +// static void Marshall(const SESubstanceTissuePharmacokinetics& in, CDM::SubstanceTissuePharmacokineticsData& out); #include TEST_F(TEST_FIXTURE_NAME, SubstanceTissuePharmacokinetics) { @@ -213,21 +214,21 @@ TEST_F(TEST_FIXTURE_NAME, SubstanceTissuePharmacokinetics) SEType source { "SubstanceTissuePharmcoKineticsTest", &logger }, sink { "SINK", &logger }; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetPartitionCoefficient().SetValue(100.0); EXPECT_NE(source, sink); - Substance::UnMarshall(source, data); - Substance::Marshall(data, sink); + Substance::Marshall(source, data); + Substance::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SESubstancePharmacodynamics; // TYPE SubstancePharmacodynamics -// static void Marshall(const CDM::SubstancePharmacodynamicsData& in, SESubstancePharmacodynamics& out); -// static void UnMarshall(const SESubstancePharmacodynamics& in, CDM::SubstancePharmacodynamicsData& out); +// static void UnMarshall(const CDM::SubstancePharmacodynamicsData& in, SESubstancePharmacodynamics& out); +// static void Marshall(const SESubstancePharmacodynamics& in, CDM::SubstancePharmacodynamicsData& out); #include TEST_F(TEST_FIXTURE_NAME, SubstancePharmacodynamics) @@ -243,23 +244,21 @@ TEST_F(TEST_FIXTURE_NAME, SubstancePharmacodynamics) auto modifier = std::make_unique(biogears::SEScalarMassPerVolume { 1.0, biogears::MassPerVolumeUnit::g_Per_dL }, 1.0); source.GetPharmacodynamicModifiers()["TEST"] = modifier.release(); - source.GetBronchodilation().Set({ 1.0 }, { 1.0, biogears::MassPerVolumeUnit::g_Per_dL }); - source.GetDiastolicPressureModifier().Set({ 2.0 }, { 3.0, biogears::MassPerVolumeUnit::g_Per_dL }); - - source.GetFeverModifier().Set({ 5 }, { 10, biogears::MassPerVolumeUnit::g_Per_dL }); - - source.GetHeartRateModifier().Set({ 5 }, { 110, biogears::MassPerVolumeUnit::g_Per_dL }); - source.GetHemorrhageModifier().Set({ 6 }, { 210, biogears::MassPerVolumeUnit::g_Per_dL }); - source.GetNeuromuscularBlock().Set({ 7 }, { 310, biogears::MassPerVolumeUnit::g_Per_dL }); - source.GetPainModifier().Set({ 8 }, { 410, biogears::MassPerVolumeUnit::g_Per_dL }); - source.GetPupilReactivityModifier().Set({ 5 }, { 510, biogears::MassPerVolumeUnit::g_Per_dL }); - source.GetPupilSizeModifier().Set({ 9 }, { 610, biogears::MassPerVolumeUnit::g_Per_dL }); - source.GetRespirationRateModifier().Set({ 10 }, { 710, biogears::MassPerVolumeUnit::g_Per_dL }); - source.GetSystolicPressureModifier().Set({ 11 }, { 810, biogears::MassPerVolumeUnit::g_Per_dL }); - source.GetTidalVolumeModifier().Set({ 12 }, { 910, biogears::MassPerVolumeUnit::g_Per_dL }); - source.GetCentralNervousModifier().Set({ 13 }, { 190, biogears::MassPerVolumeUnit::g_Per_dL }); - source.GetTubularPermeabilityModifier().Set({ 14 }, { 180, biogears::MassPerVolumeUnit::g_Per_dL }); - source.GetSedation().Set({ 15 }, { 10, biogears::MassPerVolumeUnit::g_Per_dL }); + source.GetBronchodilation().Set({ 1.0 }, biogears::SEScalarMassPerVolume(1.0, biogears::MassPerVolumeUnit::g_Per_dL)); + source.GetDiastolicPressureModifier().Set({ 2.0 }, biogears::SEScalarMassPerVolume( 3.0, biogears::MassPerVolumeUnit::g_Per_dL)); + source.GetFeverModifier().Set({ 5 }, biogears::SEScalarMassPerVolume(10, biogears::MassPerVolumeUnit::g_Per_dL)); + source.GetHeartRateModifier().Set({ 5 }, biogears::SEScalarMassPerVolume(110, biogears::MassPerVolumeUnit::g_Per_dL)); + source.GetHemorrhageModifier().Set({ 6 }, biogears::SEScalarMassPerVolume(210, biogears::MassPerVolumeUnit::g_Per_dL)); + source.GetNeuromuscularBlock().Set({ 7 }, biogears::SEScalarMassPerVolume(310, biogears::MassPerVolumeUnit::g_Per_dL)); + source.GetPainModifier().Set({ 8 }, biogears::SEScalarMassPerVolume(410, biogears::MassPerVolumeUnit::g_Per_dL)); + source.GetPupilReactivityModifier().Set({ 5 }, biogears::SEScalarMassPerVolume(510, biogears::MassPerVolumeUnit::g_Per_dL)); + source.GetPupilSizeModifier().Set({ 9 }, biogears::SEScalarMassPerVolume(610, biogears::MassPerVolumeUnit::g_Per_dL)); + source.GetRespirationRateModifier().Set({ 10 }, biogears::SEScalarMassPerVolume(710, biogears::MassPerVolumeUnit::g_Per_dL)); + source.GetSystolicPressureModifier().Set({ 11 }, biogears::SEScalarMassPerVolume(810, biogears::MassPerVolumeUnit::g_Per_dL)); + source.GetTidalVolumeModifier().Set({ 12 }, biogears::SEScalarMassPerVolume(910, biogears::MassPerVolumeUnit::g_Per_dL)); + source.GetCentralNervousModifier().Set({ 13 }, biogears::SEScalarMassPerVolume(190, biogears::MassPerVolumeUnit::g_Per_dL)); + source.GetTubularPermeabilityModifier().Set({ 14 }, biogears::SEScalarMassPerVolume(180, biogears::MassPerVolumeUnit::g_Per_dL)); + source.GetSedation().Set({ 15 }, biogears::SEScalarMassPerVolume(10, biogears::MassPerVolumeUnit::g_Per_dL)); source.GetEffectSiteRateConstant().SetValue(1.0, biogears::FrequencyUnit::Per_min); source.GetAntibacterialEffect().SetValue(1.0, biogears::FrequencyUnit::Per_min); @@ -267,16 +266,16 @@ TEST_F(TEST_FIXTURE_NAME, SubstancePharmacodynamics) EXPECT_NE(source, sink); - Substance::UnMarshall(source, data); - Substance::Marshall(data, sink); + Substance::Marshall(source, data); + Substance::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SESubstanceClearance; // TYPE SubstanceClearance -// static void Marshall(const CDM::SubstanceClearanceData& in, SESubstanceClearance& out); -// static void UnMarshall(const SESubstanceClearance& in, CDM::SubstanceClearanceData& out); +// static void UnMarshall(const CDM::SubstanceClearanceData& in, SESubstanceClearance& out); +// static void Marshall(const SESubstanceClearance& in, CDM::SubstanceClearanceData& out); #include TEST_F(TEST_FIXTURE_NAME, SubstanceClearance) @@ -289,11 +288,11 @@ TEST_F(TEST_FIXTURE_NAME, SubstanceClearance) SEType source { &logger }, sink { &logger }; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.SetSystemic(true); source.SetCellular(false); - source.SetChargeInBlood(CDM::enumCharge::Negative); + source.SetChargeInBlood(biogears::SECharge::Negative); source.GetCellBirthRate().SetValue(1.0, biogears::FrequencyUnit::Hz); source.GetCellDeathRate().SetValue(1.0, biogears::FrequencyUnit::Hz); @@ -303,7 +302,7 @@ TEST_F(TEST_FIXTURE_NAME, SubstanceClearance) source.GetFractionMetabolizedInGut().SetValue(0.6); source.GetFractionUnboundInPlasma().SetValue(0.8); - source.SetRenalDynamic(biogears::RenalDynamic::Regulation); + source.SetRenalDynamic(biogears::RenalDynamicsType::Regulation); source.GetIntrinsicClearance().SetValue(1.0, biogears::VolumePerTimeMassUnit::mL_Per_s_g); source.GetRenalClearance().SetValue(1.0, biogears::VolumePerTimeMassUnit::mL_Per_s_g); @@ -319,15 +318,15 @@ TEST_F(TEST_FIXTURE_NAME, SubstanceClearance) EXPECT_NE(source, sink); - Substance::UnMarshall(source, data); - Substance::Marshall(data, sink); + Substance::Marshall(source, data); + Substance::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SESubstance; // TYPE Substance -// static void Marshall(const CDM::SubstanceData& in, SESubstance& out); -// static void UnMarshall(const SESubstance& in, CDM::SubstanceData& out); +// static void UnMarshall(const CDM::SubstanceData& in, SESubstance& out); +// static void Marshall(const SESubstance& in, CDM::SubstanceData& out); #include TEST_F(TEST_FIXTURE_NAME, Substance) { @@ -340,8 +339,8 @@ TEST_F(TEST_FIXTURE_NAME, Substance) CDMType data; source.SetName("SubstanceTest"); - source.SetClassification(CDM::enumSubstanceClass::Anesthetic); - source.SetState(CDM::enumSubstanceState::Solid); + source.SetClassification(biogears::SESubstanceClass::Anesthetic); + source.SetState(biogears::SESubstanceState::Solid); source.GetMichaelisCoefficient().SetValue(1.0); source.GetRelativeDiffusionCoefficient().SetValue(1.0); @@ -387,7 +386,7 @@ TEST_F(TEST_FIXTURE_NAME, Substance) source.GetAerosolization().GetParticulateSizeDistribution().SetLengthUnit(biogears::LengthUnit::m); source.GetClearance().SetSystemic(true); source.GetClearance().SetCellular(false); - source.GetClearance().SetChargeInBlood(CDM::enumCharge::Negative); + source.GetClearance().SetChargeInBlood(biogears::SECharge::Negative); source.GetClearance().GetCellBirthRate().SetValue(1.0, biogears::FrequencyUnit::Hz); source.GetClearance().GetCellDeathRate().SetValue(1.0, biogears::FrequencyUnit::Hz); @@ -397,7 +396,7 @@ TEST_F(TEST_FIXTURE_NAME, Substance) source.GetClearance().GetFractionMetabolizedInGut().SetValue(0.6); source.GetClearance().GetFractionUnboundInPlasma().SetValue(0.8); - source.GetClearance().SetRenalDynamic(biogears::RenalDynamic::Regulation); + source.GetClearance().SetRenalDynamic(biogears::RenalDynamicsType::Regulation); source.GetClearance().GetIntrinsicClearance().SetValue(1.0, biogears::VolumePerTimeMassUnit::mL_Per_s_g); source.GetClearance().GetRenalClearance().SetValue(1.0, biogears::VolumePerTimeMassUnit::mL_Per_s_g); @@ -411,22 +410,22 @@ TEST_F(TEST_FIXTURE_NAME, Substance) source.GetClearance().GetRenalReabsorptionRate().SetValue(1.0, biogears::MassPerTimeUnit::g_Per_s); source.GetClearance().GetRenalExcretionRate().SetValue(1.0, biogears::MassPerTimeUnit::g_Per_s); - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetPK(); source.GetPD(); EXPECT_NE(source, sink); - Substance::UnMarshall(source, data); - Substance::Marshall(data, sink); + Substance::Marshall(source, data); + Substance::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SESubstanceCompound; // TYPE SubstanceCompound -// static void Marshall(const CDM::SubstanceCompoundData& in, SESubstanceCompound& out); -// static void UnMarshall(const SESubstanceCompound& in, CDM::SubstanceCompoundData& out); +// static void UnMarshall(const CDM::SubstanceCompoundData& in, SESubstanceCompound& out); +// static void Marshall(const SESubstanceCompound& in, CDM::SubstanceCompoundData& out); #include TEST_F(TEST_FIXTURE_NAME, SubstanceCompound) @@ -439,28 +438,28 @@ TEST_F(TEST_FIXTURE_NAME, SubstanceCompound) SEType source { &logger }, sink { &logger }; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.SetName("SubstanceCompoundTest"); - source.SetClassification(CDM::enumSubstanceClass::Anesthetic); + source.SetClassification(biogears::SESubstanceClass::Anesthetic); source.SetRhFactor(true); - biogears::SESubstanceConcentration sub { *sarin }; + biogears::SESubstanceConcentration sub { sarin->GetDefinition() }; sub.GetConcentration().SetValue(30, biogears::MassPerVolumeUnit::g_Per_dL); source.GetComponents().push_back(sub); EXPECT_NE(source, sink); - Substance::UnMarshall(source, data); - Substance::Marshall(data, mgr, sink); + Substance::Marshall(source, data); + Substance::UnMarshall(data, mgr, sink); EXPECT_EQ(source, sink); } // class SESubstanceFraction; // TYPE SubstanceFraction -// static void Marshall(const CDM::SubstanceFractionData& in, SESubstanceFraction& out); -// static void UnMarshall(const SESubstanceFraction& in, CDM::SubstanceFractionData& out); +// static void UnMarshall(const CDM::SubstanceFractionData& in, SESubstanceFraction& out); +// static void Marshall(const SESubstanceFraction& in, CDM::SubstanceFractionData& out); #include TEST_F(TEST_FIXTURE_NAME, SubstanceFraction) @@ -471,24 +470,24 @@ TEST_F(TEST_FIXTURE_NAME, SubstanceFraction) biogears::SESubstanceManager mgr { &logger }; ASSERT_TRUE(mgr.LoadSubstanceDirectory()); - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); SEType source { *sarin }, sink { *sarin }; CDMType data; -source.GetFractionAmount().SetValue( 0.99); + source.GetFractionAmount().SetValue(0.99); EXPECT_NE(source, sink); - Substance::UnMarshall(source, data); - Substance::Marshall(data, sink); + Substance::Marshall(source, data); + Substance::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SESubstanceConcentration; // TYPE SubstanceConcentration -// static void Marshall(const CDM::SubstanceConcentrationData& in, SESubstanceConcentration& out); -// static void UnMarshall(const SESubstanceConcentration& in, CDM::SubstanceConcentrationData& out); +// static void UnMarshall(const CDM::SubstanceConcentrationData& in, SESubstanceConcentration& out); +// static void Marshall(const SESubstanceConcentration& in, CDM::SubstanceConcentrationData& out); #include TEST_F(TEST_FIXTURE_NAME, SubstanceConcentration) @@ -499,25 +498,25 @@ TEST_F(TEST_FIXTURE_NAME, SubstanceConcentration) biogears::SESubstanceManager mgr { &logger }; ASSERT_TRUE(mgr.LoadSubstanceDirectory()); - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); - SEType source { *sarin }, sink { *sarin }; + SEType source { sarin->GetDefinition() }, sink { sarin->GetDefinition() }; CDMType data; source.GetConcentration().SetValue(1.0, biogears::MassPerVolumeUnit::g_Per_mL); EXPECT_NE(source, sink); - Substance::UnMarshall(source, data); - Substance::Marshall(data, sink); + Substance::Marshall(source, data); + Substance::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SEPharmacodynamicModifier; // TYPE PharmacodynamicModifier -// static void Marshall(const CDM::PharmacodynamicModifierData& in, SEPharmacodynamicModifier& out); -// static void UnMarshall(const SEPharmacodynamicModifier& in, CDM::PharmacodynamicModifierData& out); +// static void UnMarshall(const CDM::PharmacodynamicModifierData& in, SEPharmacodynamicModifier& out); +// static void Marshall(const SEPharmacodynamicModifier& in, CDM::PharmacodynamicModifierData& out); #include TEST_F(TEST_FIXTURE_NAME, PharmacodynamicModifier) @@ -530,15 +529,15 @@ TEST_F(TEST_FIXTURE_NAME, PharmacodynamicModifier) SEType source, sink; CDMType data; - auto sarin = mgr.GetSubstance("Sarin"); + auto sarin = mgr.GetSubstance(biogears::Sarin); source.GetEC50().SetValue(1.0, biogears::MassPerVolumeUnit::g_Per_dL); source.GetEMax().SetValue(1.0); EXPECT_NE(source, sink); - Substance::UnMarshall(source, data); - Substance::Marshall(data, sink); + Substance::Marshall(source, data); + Substance::UnMarshall(data, sink); EXPECT_EQ(source, sink); } \ No newline at end of file diff --git a/projects/biogears/libIO/unit/io/cdm/test_core_io_SubstanceQuantity.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_SubstanceQuantity.cpp similarity index 86% rename from projects/biogears/libIO/unit/io/cdm/test_core_io_SubstanceQuantity.cpp rename to projects/biogears/libBiogears/unit/io/cdm/test_core_io_SubstanceQuantity.cpp index 4d3258b43..69e2c3833 100644 --- a/projects/biogears/libIO/unit/io/cdm/test_core_io_SubstanceQuantity.cpp +++ b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_SubstanceQuantity.cpp @@ -77,11 +77,11 @@ void TEST_FIXTURE_NAME::TearDown() // class SEGasSubstanceQuantity // TYPE GasSubstanceQuantity -// static void Marshall(const CDM::GasSubstanceQuantityData& in, SEGasSubstanceQuantity& out); -// static void UnMarshall(const SEGasSubstanceQuantity& in, CDM::GasSubstanceQuantityData& out); +// static void UnMarshall(const CDM::GasSubstanceQuantityData& in, SEGasSubstanceQuantity& out); +// static void Marshall(const SEGasSubstanceQuantity& in, CDM::GasSubstanceQuantityData& out); #include #include -namespace BGE = mil::tatrc::physiology::biogears; + TEST_F(TEST_FIXTURE_NAME, GasSubstanceQuantity) { @@ -95,12 +95,12 @@ TEST_F(TEST_FIXTURE_NAME, GasSubstanceQuantity) ASSERT_TRUE(subMgr.LoadSubstanceDirectory()); - auto sarin = subMgr.GetSubstance("Sarin"); + auto sarin = subMgr.GetSubstance(biogears::Sarin); auto& pRightChestLeak = compMgr.CreateGasCompartment(BGE::PulmonaryCompartment::RightChestLeak); auto& pLeftChestLeak = compMgr.CreateGasCompartment(BGE::PulmonaryCompartment::LeftChestLeak); - SEType source { *sarin, pRightChestLeak }, sink { *sarin, pLeftChestLeak }; + SEType source { *sarin, pRightChestLeak }, sink { *sarin, pRightChestLeak }; CDMType data; source.GetPartialPressure().SetValue(1.0, biogears::PressureUnit::mmHg); @@ -109,16 +109,16 @@ TEST_F(TEST_FIXTURE_NAME, GasSubstanceQuantity) EXPECT_NE(source, sink); - SubstanceQuantity::UnMarshall(source, data); - SubstanceQuantity::Marshall(data, sink); + SubstanceQuantity::Marshall(source, data); + SubstanceQuantity::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SELiquidSubstanceQuantity // TYPE LiquidSubstanceQuantity -// static void Marshall(const CDM::LiquidSubstanceQuantityData& in, SELiquidSubstanceQuantity& out); -// static void UnMarshall(const SELiquidSubstanceQuantity& in, CDM::LiquidSubstanceQuantityData& out); +// static void UnMarshall(const CDM::LiquidSubstanceQuantityData& in, SELiquidSubstanceQuantity& out); +// static void Marshall(const SELiquidSubstanceQuantity& in, CDM::LiquidSubstanceQuantityData& out); #include TEST_F(TEST_FIXTURE_NAME, LiquidSubstanceQuantity) @@ -147,7 +147,7 @@ TEST_F(TEST_FIXTURE_NAME, LiquidSubstanceQuantity) source.GetMassDeposited().SetValue(1.0, biogears::MassUnit::g); source.GetMassExcreted().SetValue(1.0, biogears::MassUnit::g); source.GetMolarity().SetValue(1.0, biogears::AmountPerVolumeUnit::ct_Per_uL); - source.GetSaturation().SetValue(0.22); + /*source.GetSaturation().SetValue(0.22);*/ //Only O2,CO2, and CO have Saturations //Don't get me started on tis EXPECT_THROW(source.GetPartialPressure().SetValue(1.0, biogears::PressureUnit::mmHg), biogears::CommonDataModelException); @@ -155,8 +155,8 @@ TEST_F(TEST_FIXTURE_NAME, LiquidSubstanceQuantity) EXPECT_NE(source, sink); - SubstanceQuantity::UnMarshall(source, data); - SubstanceQuantity::Marshall(data, sink); + SubstanceQuantity::Marshall(source, data); + SubstanceQuantity::UnMarshall(data, sink); EXPECT_EQ(source, sink); } \ No newline at end of file diff --git a/projects/biogears/libIO/unit/io/cdm/test_core_io_System.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_System.cpp similarity index 91% rename from projects/biogears/libIO/unit/io/cdm/test_core_io_System.cpp rename to projects/biogears/libBiogears/unit/io/cdm/test_core_io_System.cpp index cfde331fa..66013f151 100644 --- a/projects/biogears/libIO/unit/io/cdm/test_core_io_System.cpp +++ b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_System.cpp @@ -77,10 +77,10 @@ void TEST_FIXTURE_NAME::TearDown() // class SEGasSystem // TYPE GasSystem -// static void Marshall(const CDM::GasSystemData& in, SEGasSystem& out); -// static void UnMarshall(const SEGasSystem& in, CDM::GasSystemData& out); +// static void UnMarshall(const CDM::GasSystemData& in, SEGasSystem& out); +// static void Marshall(const SEGasSystem& in, CDM::GasSystemData& out); #include -namespace BGE = mil::tatrc::physiology::biogears; + TEST_F(TEST_FIXTURE_NAME, System) { @@ -92,8 +92,8 @@ TEST_F(TEST_FIXTURE_NAME, System) // EXPECT_NE(source, sink); - // System::UnMarshall(source, data); - // System::Marshall(data, sink); + // System::Marshall(source, data); + // System::UnMarshall(data, sink); // EXPECT_EQ(source, sink); diff --git a/projects/biogears/libIO/unit/io/cdm/test_core_io_TestReport.cpp b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_TestReport.cpp similarity index 90% rename from projects/biogears/libIO/unit/io/cdm/test_core_io_TestReport.cpp rename to projects/biogears/libBiogears/unit/io/cdm/test_core_io_TestReport.cpp index d020c1e58..b1a4f8312 100644 --- a/projects/biogears/libIO/unit/io/cdm/test_core_io_TestReport.cpp +++ b/projects/biogears/libBiogears/unit/io/cdm/test_core_io_TestReport.cpp @@ -83,12 +83,12 @@ void TEST_FIXTURE_NAME::TearDown() using SEType = biogears ::SE##name; \ using CDMType = CDM ::name##Data; -namespace BGE = mil::tatrc::physiology::biogears; + // class SEGasTestReport // TYPE GasTestReport -// static void Marshall(const CDM::GasTestReportData& in, SEGasTestReport& out); -// static void UnMarshall(const SEGasTestReport& in, CDM::GasTestReportData& out); +// static void UnMarshall(const CDM::GasTestReportData& in, SEGasTestReport& out); +// static void Marshall(const SEGasTestReport& in, CDM::GasTestReportData& out); #include TEST_F(TEST_FIXTURE_NAME, TestErrorStatistics) { @@ -118,16 +118,16 @@ TEST_F(TEST_FIXTURE_NAME, TestErrorStatistics) EXPECT_NE(source, sink); - TestReport::UnMarshall(source, data); - TestReport::Marshall(data, sink); + TestReport::Marshall(source, data); + TestReport::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SETestCase // TYPE TestCase -// static void Marshall(const CDM::TestCase& in, SETestCase& out); -// static void UnMarshall(const SETestCase& in, CDM::TestCase& out); +// static void UnMarshall(const CDM::TestCase& in, SETestCase& out); +// static void Marshall(const SETestCase& in, CDM::TestCase& out); #include TEST_F(TEST_FIXTURE_NAME, TestCase) { @@ -162,16 +162,16 @@ TEST_F(TEST_FIXTURE_NAME, TestCase) EXPECT_NE(source, sink); - TestReport::UnMarshall(source, data); - TestReport::Marshall(data, sink); + TestReport::Marshall(source, data); + TestReport::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SETestSuite // TYPE TestSuite -// static void Marshall(const CDM::TestSuite& in, SETestSuite& out); -// static void UnMarshall(const SETestSuite& in, CDM::TestSuite& out); +// static void UnMarshall(const CDM::TestSuite& in, SETestSuite& out); +// static void Marshall(const SETestSuite& in, CDM::TestSuite& out); #include TEST_F(TEST_FIXTURE_NAME, TestSuite) { @@ -234,16 +234,16 @@ TEST_F(TEST_FIXTURE_NAME, TestSuite) EXPECT_NE(source, sink); - TestReport::UnMarshall(source, data); - TestReport::Marshall(data, sink); + TestReport::Marshall(source, data); + TestReport::UnMarshall(data, sink); EXPECT_EQ(source, sink); } // class SEGasTestReport // TYPE GasTestReport -// static void Marshall(const CDM::GasTestReportData& in, SEGasTestReport& out); -// static void UnMarshall(const SEGasTestReport& in, CDM::GasTestReportData& out); +// static void UnMarshall(const CDM::GasTestReportData& in, SEGasTestReport& out); +// static void Marshall(const SEGasTestReport& in, CDM::GasTestReportData& out); #include TEST_F(TEST_FIXTURE_NAME, TestReport) { @@ -304,8 +304,8 @@ TEST_F(TEST_FIXTURE_NAME, TestReport) EXPECT_NE(source, sink); - TestReport::UnMarshall(source, data); - TestReport::Marshall(data, sink); + TestReport::Marshall(source, data); + TestReport::UnMarshall(data, sink); EXPECT_EQ(source, sink); } diff --git a/projects/biogears/libIO/unit/io/test_core_io_BioGearsDataModel.cpp b/projects/biogears/libBiogears/unit/io/test_core_io_BioGearsDataModel.cpp similarity index 100% rename from projects/biogears/libIO/unit/io/test_core_io_BioGearsDataModel.cpp rename to projects/biogears/libBiogears/unit/io/test_core_io_BioGearsDataModel.cpp diff --git a/projects/biogears/libIO/unit/io/test_core_io_CommonDataModel.cpp b/projects/biogears/libBiogears/unit/io/test_core_io_CommonDataModel.cpp similarity index 100% rename from projects/biogears/libIO/unit/io/test_core_io_CommonDataModel.cpp rename to projects/biogears/libBiogears/unit/io/test_core_io_CommonDataModel.cpp diff --git a/projects/biogears/libBiogears/unit/io/test_core_IOManager.cpp b/projects/biogears/libBiogears/unit/io/test_core_io_IOManager.cpp similarity index 100% rename from projects/biogears/libBiogears/unit/io/test_core_IOManager.cpp rename to projects/biogears/libBiogears/unit/io/test_core_io_IOManager.cpp diff --git a/projects/biogears/libCircuitTest/CMakeLists.txt b/projects/biogears/libCircuitTest/CMakeLists.txt index d52661de2..c0125faf1 100644 --- a/projects/biogears/libCircuitTest/CMakeLists.txt +++ b/projects/biogears/libCircuitTest/CMakeLists.txt @@ -26,7 +26,7 @@ if( Biogears_BUILD_CIRCUIT_TESTS) COMPILE_PDB_NAME "biogears_circuit_test" PROJECT_LABEL "libbiogears_circuit_test" DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}" - CXX_STANDARD 14 + CXX_STANDARD 20 ) set_target_properties(libbiogears_circuit_test PROPERTIES SOVERSION "${Biogears_LIB_VERSION}") ############################################################################### diff --git a/projects/biogears/libCircuitTest/src/Circuits/AcidBaseTests.cpp b/projects/biogears/libCircuitTest/src/Circuits/AcidBaseTests.cpp index 97bb0c33b..1fc06e896 100644 --- a/projects/biogears/libCircuitTest/src/Circuits/AcidBaseTests.cpp +++ b/projects/biogears/libCircuitTest/src/Circuits/AcidBaseTests.cpp @@ -755,7 +755,7 @@ void BioGearsEngineTest::AcidBaseBloodGasTest(BioGears& bg, bloodType bloodCompa SESubstanceManager& subMgr = bg.GetSubstances(); SaturationCalculator& c = bg.GetSaturationCalculator(); SECompartmentManager& cmptMgr = bg.GetCompartments(); - cmptMgr.Clear(); + cmptMgr.Invalidate(); SETestCase& testCase = testSuite.CreateTestCase(); switch (bloodCompartment) { diff --git a/projects/biogears/libCircuitTest/src/Circuits/AdvancedCircuitTest.cpp b/projects/biogears/libCircuitTest/src/Circuits/AdvancedCircuitTest.cpp index c7b23b52c..332ed5648 100644 --- a/projects/biogears/libCircuitTest/src/Circuits/AdvancedCircuitTest.cpp +++ b/projects/biogears/libCircuitTest/src/Circuits/AdvancedCircuitTest.cpp @@ -169,7 +169,7 @@ void CommonDataModelTest::ElectricalCircuitTest(const std::string& sTestDirector } } trk1.WriteTrackToFile(sOutputFile.c_str()); - m_Circuits.Clear(); + m_Circuits.Invalidate(); } void CommonDataModelTest::FluidCircuitTest(const std::string& sTestDirectory) @@ -233,7 +233,7 @@ void CommonDataModelTest::FluidCircuitTest(const std::string& sTestDirectory) } } trk1.WriteTrackToFile(sOutputFile.c_str()); - m_Circuits.Clear(); + m_Circuits.Invalidate(); } void CommonDataModelTest::ThermalCircuitTest(const std::string& sTestDirectory) @@ -309,7 +309,7 @@ void CommonDataModelTest::ThermalCircuitTest(const std::string& sTestDirectory) } } trk1.WriteTrackToFile(sOutputFile.c_str()); - m_Circuits.Clear(); + m_Circuits.Invalidate(); } //-------------------------------------------------------------------------------------------------- @@ -418,7 +418,7 @@ void CommonDataModelTest::CombinedCircuitTest(const std::string& sTestDirectory) } std::string sOutputFile = sTestDirectory + "/CombinedCircuit.csv"; trk1.WriteTrackToFile(sOutputFile.c_str()); - m_Circuits.Clear(); + m_Circuits.Invalidate(); } void CommonDataModelTest::InterCircuitComparisonTest(const std::string& sTestDirectory) @@ -485,7 +485,7 @@ void CommonDataModelTest::InterCircuitComparisonTest(const std::string& sTestDir } std::string sOutputFile = sTestDirectory + "/InterCircuitComparison.csv"; trk1.WriteTrackToFile(sOutputFile.c_str()); - m_Circuits.Clear(); + m_Circuits.Invalidate(); } void CommonDataModelTest::InterCircuitIndividualTest(const std::string& sTestDirectory) @@ -571,7 +571,7 @@ void CommonDataModelTest::InterCircuitIndividualTest(const std::string& sTestDir std::string sOutputFile2 = sTestDirectory + "/InterCircuitIndividual2.csv"; trk1.WriteTrackToFile(sOutputFile.c_str()); trk2.WriteTrackToFile(sOutputFile2.c_str()); - m_Circuits.Clear(); + m_Circuits.Invalidate(); } //-------------------------------------------------------------------------------------------------- @@ -700,7 +700,7 @@ void CommonDataModelTest::CircuitErrorTest(const std::string& sTestDirectory) // None, as of yet, moving to templates enforced a lot of stuff Path2.GetNextCompliance().SetValue(25, FlowComplianceUnit::m3_Per_Pa); Path2.HasValidElements(); - m_Circuits.Clear(); + m_Circuits.Invalidate(); } //-------------------------------------------------------------------------------------------------- @@ -800,7 +800,7 @@ void CommonDataModelTest::DynamicallyChangingCircuitTest(const std::string& sTes } std::string sOutputFile = sTestDirectory + "/DynamicallyChangingCircuit.csv"; trk1.WriteTrackToFile(sOutputFile.c_str()); - m_Circuits.Clear(); + m_Circuits.Invalidate(); } //-------------------------------------------------------------------------------------------------- @@ -873,7 +873,7 @@ void CommonDataModelTest::NonZeroReferencePositive(const std::string& sTestDirec } std::string sOutputFile = sTestDirectory + "/NonZeroReferencePositive.csv"; trk1.WriteTrackToFile(sOutputFile.c_str()); - m_Circuits.Clear(); + m_Circuits.Invalidate(); } //-------------------------------------------------------------------------------------------------- @@ -945,7 +945,7 @@ void CommonDataModelTest::NonZeroReferenceNegative(const std::string& sTestDirec } std::string sOutputFile = sTestDirectory + "/NonZeroReferenceNegative.csv"; trk1.WriteTrackToFile(sOutputFile.c_str()); - m_Circuits.Clear(); + m_Circuits.Invalidate(); } //-------------------------------------------------------------------------------------------------- @@ -982,7 +982,7 @@ void CommonDataModelTest::PolarizedCapacitorTest(const std::string& sTestDirecto //Paths SEFluidCircuitPath& Path2 = fluidCircuit->CreatePath(Node2, Node1, "Path2"); Path2.GetNextCompliance().SetValue(1, FlowComplianceUnit::m3_Per_Pa); - Path2.SetNextPolarizedState(CDM::enumOpenClosed::Closed); + Path2.SetNextPolarizedState(SEOpenClosed::Closed); Path2.GetSourceNode().GetNextVolume().SetValue(0, VolumeUnit::m3); SEFluidCircuitPath& Path3 = fluidCircuit->CreatePath(Node2, Node3, "Path3"); Path3.GetNextResistance().SetValue(1, FlowResistanceUnit::Pa_s_Per_m3); @@ -1019,7 +1019,7 @@ void CommonDataModelTest::PolarizedCapacitorTest(const std::string& sTestDirecto } std::string sOutputFile = sTestDirectory + "/PolarizedCapacitor.csv"; trk1.WriteTrackToFile(sOutputFile.c_str()); - m_Circuits.Clear(); + m_Circuits.Invalidate(); } void CommonDataModelTest::PreChargeComplianceZeroVolume(const std::string& sTestDirectory) @@ -1064,7 +1064,7 @@ void CommonDataModelTest::PreChargeComplianceZeroVolume(const std::string& sTest } std::string sOutputFile1 = sTestDirectory + "/PreChargeComplianceZeroVolume.csv"; trk1.WriteTrackToFile(sOutputFile1.c_str()); - m_Circuits.Clear(); + m_Circuits.Invalidate(); } void CommonDataModelTest::PreChargeComplianceNonZeroVolume(const std::string& sTestDirectory) @@ -1109,7 +1109,7 @@ void CommonDataModelTest::PreChargeComplianceNonZeroVolume(const std::string& sT } std::string sOutputFile2 = sTestDirectory + "/PreChargeComplianceNonZeroVolume.csv"; trk1.WriteTrackToFile(sOutputFile2.c_str()); - m_Circuits.Clear(); + m_Circuits.Invalidate(); } void CommonDataModelTest::CircuitLockingTest(const std::string& sOutputDirectory) @@ -1380,6 +1380,6 @@ void CommonDataModelTest::CircuitLockingTest(const std::string& sOutputDirectory std::string sOutputFile = sOutputDirectory + "/CircuitLockingTestReport.xml"; testReport.WriteFile(sOutputFile); - m_Circuits.Clear(); + m_Circuits.Invalidate(); } } \ No newline at end of file diff --git a/projects/biogears/libCircuitTest/src/Circuits/AnesthesiaCircuit.cpp b/projects/biogears/libCircuitTest/src/Circuits/AnesthesiaCircuit.cpp index e6001e8c8..8da09ecbd 100644 --- a/projects/biogears/libCircuitTest/src/Circuits/AnesthesiaCircuit.cpp +++ b/projects/biogears/libCircuitTest/src/Circuits/AnesthesiaCircuit.cpp @@ -50,8 +50,8 @@ void BioGearsEngineTest::AnesthesiaMachineCircuitAndTransportTest(RespiratoryCon BioGears bg(sTestDirectory + "/AnesthesiaMachineCircuitAndTransportTest.log"); bg.GetPatient().Load("StandardMale.xml"); bg.SetupPatient(); - bg.m_Config->EnableRenal(CDM::enumOnOff::Off); - bg.m_Config->EnableTissue(CDM::enumOnOff::Off); + bg.m_Configuration->EnableRenal(SEOnOff::Off); + bg.m_Configuration->EnableTissue(SEOnOff::Off); bg.CreateCircuitsAndCompartments(); SEEnvironmentalConditions env(bg.GetSubstances()); env.Load("StandardEnvironment.xml"); diff --git a/projects/biogears/libCircuitTest/src/Circuits/BasicCircuitTest.cpp b/projects/biogears/libCircuitTest/src/Circuits/BasicCircuitTest.cpp index 2520ad9b4..c17d95b0a 100644 --- a/projects/biogears/libCircuitTest/src/Circuits/BasicCircuitTest.cpp +++ b/projects/biogears/libCircuitTest/src/Circuits/BasicCircuitTest.cpp @@ -11,7 +11,10 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ #include +#include "io/cdm/Circuit.h" + #include +#include #include #include #include @@ -839,7 +842,7 @@ void CommonDataModelTest::TestSetup15SwitchRCDC() Path1.GetNextPressureSource().SetValue(20, PressureUnit::Pa); SEFluidCircuitPath& Path2 = fluidCircuit.CreatePath(Node1, Node2, "Path2"); - Path2.SetNextSwitch(CDM::enumOpenClosed::Open); + Path2.SetNextSwitch(SEOpenClosed::Open); SEFluidCircuitPath& Path3 = fluidCircuit.CreatePath(Node2, Node3, "Path3"); Path3.GetNextResistance().SetValue(1000, FlowResistanceUnit::Pa_s_Per_m3); SEFluidCircuitPath& Path4 = fluidCircuit.CreatePath(Node3, Node4, "Path4"); @@ -873,7 +876,7 @@ void CommonDataModelTest::TestSetup15SwitchRCSIN() Path1.GetNextPressureSource().SetValue(20, PressureUnit::Pa); SEFluidCircuitPath& Path2 = fluidCircuit.CreatePath(Node1, Node2, "Path2"); - Path2.SetNextSwitch(CDM::enumOpenClosed::Open); + Path2.SetNextSwitch(SEOpenClosed::Open); SEFluidCircuitPath& Path3 = fluidCircuit.CreatePath(Node2, Node3, "Path3"); Path3.GetNextResistance().SetValue(1000, FlowResistanceUnit::Pa_s_Per_m3); SEFluidCircuitPath& Path4 = fluidCircuit.CreatePath(Node3, Node4, "Path4"); @@ -907,7 +910,7 @@ void CommonDataModelTest::TestSetup15SwitchRCPULSE() Path1.GetNextPressureSource().SetValue(20, PressureUnit::Pa); SEFluidCircuitPath& Path2 = fluidCircuit.CreatePath(Node1, Node2, "Path2"); - Path2.SetNextSwitch(CDM::enumOpenClosed::Open); + Path2.SetNextSwitch(SEOpenClosed::Open); SEFluidCircuitPath& Path3 = fluidCircuit.CreatePath(Node2, Node3, "Path3"); Path3.GetNextResistance().SetValue(1000, FlowResistanceUnit::Pa_s_Per_m3); SEFluidCircuitPath& Path4 = fluidCircuit.CreatePath(Node3, Node4, "Path4"); @@ -943,7 +946,7 @@ void CommonDataModelTest::TestSetup16Comprehensive1DC() SEFluidCircuitPath& Path2 = fluidCircuit.CreatePath(Node1, Node2, "Path2"); Path2.GetNextResistance().SetValue(10, FlowResistanceUnit::Pa_s_Per_m3); SEFluidCircuitPath& Path3 = fluidCircuit.CreatePath(Node2, Node3, "Path3"); - Path3.SetNextSwitch(CDM::enumOpenClosed::Open); + Path3.SetNextSwitch(SEOpenClosed::Open); SEFluidCircuitPath& Path4 = fluidCircuit.CreatePath(Node3, Node4, "Path4"); Path4.GetNextInertance().SetValue(0.1, FlowInertanceUnit::Pa_s2_Per_m3); Path4.GetFlow().SetValue(0, VolumePerTimeUnit::m3_Per_s); @@ -987,7 +990,7 @@ void CommonDataModelTest::TestSetup16Comprehensive1SIN() SEFluidCircuitPath& Path2 = fluidCircuit.CreatePath(Node1, Node2, "Path2"); Path2.GetNextResistance().SetValue(10, FlowResistanceUnit::Pa_s_Per_m3); SEFluidCircuitPath& Path3 = fluidCircuit.CreatePath(Node2, Node3, "Path3"); - Path3.SetNextSwitch(CDM::enumOpenClosed::Open); + Path3.SetNextSwitch(SEOpenClosed::Open); SEFluidCircuitPath& Path4 = fluidCircuit.CreatePath(Node3, Node4, "Path4"); Path4.GetNextInertance().SetValue(0.1, FlowInertanceUnit::Pa_s2_Per_m3); Path4.GetFlow().SetValue(0, VolumePerTimeUnit::m3_Per_s); @@ -1031,7 +1034,7 @@ void CommonDataModelTest::TestSetup16Comprehensive1PULSE() SEFluidCircuitPath& Path2 = fluidCircuit.CreatePath(Node1, Node2, "Path2"); Path2.GetNextResistance().SetValue(10, FlowResistanceUnit::Pa_s_Per_m3); SEFluidCircuitPath& Path3 = fluidCircuit.CreatePath(Node2, Node3, "Path3"); - Path3.SetNextSwitch(CDM::enumOpenClosed::Open); + Path3.SetNextSwitch(SEOpenClosed::Open); SEFluidCircuitPath& Path4 = fluidCircuit.CreatePath(Node3, Node4, "Path4"); Path4.GetNextInertance().SetValue(0.1, FlowInertanceUnit::Pa_s2_Per_m3); Path4.GetFlow().SetValue(0, VolumePerTimeUnit::m3_Per_s); @@ -1077,7 +1080,7 @@ void CommonDataModelTest::TestSetup17BasicDiodeDC() Path3.GetNextCompliance().SetValue(0.001, FlowComplianceUnit::m3_Per_Pa); Path3.GetSourceNode().GetNextVolume().SetValue(5, VolumeUnit::m3); SEFluidCircuitPath& Path4 = fluidCircuit.CreatePath(Node3, Node2, "Path4"); - Path4.SetNextValve(CDM::enumOpenClosed::Closed); + Path4.SetNextValve(SEOpenClosed::Closed); } void CommonDataModelTest::TestSetup17BasicDiodeSIN() @@ -1110,7 +1113,7 @@ void CommonDataModelTest::TestSetup17BasicDiodeSIN() Path3.GetNextCompliance().SetValue(0.001, FlowComplianceUnit::m3_Per_Pa); Path3.GetSourceNode().GetNextVolume().SetValue(5, VolumeUnit::m3); SEFluidCircuitPath& Path4 = fluidCircuit.CreatePath(Node3, Node2, "Path4"); - Path4.SetNextValve(CDM::enumOpenClosed::Closed); + Path4.SetNextValve(SEOpenClosed::Closed); } void CommonDataModelTest::TestSetup17BasicDiodePULSE() @@ -1143,7 +1146,7 @@ void CommonDataModelTest::TestSetup17BasicDiodePULSE() Path3.GetNextCompliance().SetValue(0.001, FlowComplianceUnit::m3_Per_Pa); Path3.GetSourceNode().GetNextVolume().SetValue(5, VolumeUnit::m3); SEFluidCircuitPath& Path4 = fluidCircuit.CreatePath(Node3, Node2, "Path4"); - Path4.SetNextValve(CDM::enumOpenClosed::Closed); + Path4.SetNextValve(SEOpenClosed::Closed); // Basic Description // Scenario 1 DC Pressure Source => Capacitor charges and turns into an infinite impedance circuit element (0 flow across at steady state) // Scenario 2 Sinusoidal Pressure Source => Capacitor Flow will be relative to the derivative of the pressure source, should see volume change at nodes 2 and 3 @@ -1187,7 +1190,7 @@ void CommonDataModelTest::TestSetup17BasicDiodePULSE() // SEFluidCircuitPath& Path2 = fluidCircuit.CreatePath(Node1,Node2,"Path2"); // Path2.GetNextResistance().SetValue(1000, FlowResistanceUnit::Pa_s_Per_m3); // SEFluidCircuitPath& Path3 = fluidCircuit.CreatePath(Node2,Node3,"Path3"); -// Path3.SetSwitch(CDM::enumOpenClosed::Open); +// Path3.SetSwitch(SEOpenClosed::Open); // SEFluidCircuitPath& Path4 = fluidCircuit.CreatePath(Node3,Node4,"Path4"); // Path4.GetNextInertance().SetValue(0.001, FlowInertanceUnit::Pa_s2_Per_m3); // SEFluidCircuitPath& Path5 = fluidCircuit.CreatePath(Node1,Node4,"Path5"); @@ -1612,13 +1615,13 @@ void CommonDataModelTest::TestSetup22CurrentCompDC() SEFluidCircuitPath& Path2 = fluidCircuit.CreatePath(Node1, Node2, "Path2"); Path2.GetNextResistance().SetValue(1000, FlowResistanceUnit::Pa_s_Per_m3); SEFluidCircuitPath& Path3 = fluidCircuit.CreatePath(Node2, Node3, "Path3"); - Path3.SetNextSwitch(CDM::enumOpenClosed::Open); + Path3.SetNextSwitch(SEOpenClosed::Open); SEFluidCircuitPath& Path4 = fluidCircuit.CreatePath(Node3, Node4, "Path4"); Path4.GetNextResistance().SetValue(500, FlowResistanceUnit::Pa_s_Per_m3); SEFluidCircuitPath& Path5 = fluidCircuit.CreatePath(Node2, Node4, "Path5"); Path5.GetNextResistance().SetValue(100, FlowResistanceUnit::Pa_s_Per_m3); SEFluidCircuitPath& Path6 = fluidCircuit.CreatePath(Node2, Node4, "Path6"); - Path6.SetNextValve(CDM::enumOpenClosed::Closed); + Path6.SetNextValve(SEOpenClosed::Closed); } void CommonDataModelTest::TestSetup22CurrentCompSIN() @@ -1646,13 +1649,13 @@ void CommonDataModelTest::TestSetup22CurrentCompSIN() SEFluidCircuitPath& Path2 = fluidCircuit.CreatePath(Node1, Node2, "Path2"); Path2.GetNextResistance().SetValue(1000, FlowResistanceUnit::Pa_s_Per_m3); SEFluidCircuitPath& Path3 = fluidCircuit.CreatePath(Node2, Node3, "Path3"); - Path3.SetNextSwitch(CDM::enumOpenClosed::Open); + Path3.SetNextSwitch(SEOpenClosed::Open); SEFluidCircuitPath& Path4 = fluidCircuit.CreatePath(Node3, Node4, "Path4"); Path4.GetNextResistance().SetValue(500, FlowResistanceUnit::Pa_s_Per_m3); SEFluidCircuitPath& Path5 = fluidCircuit.CreatePath(Node2, Node4, "Path5"); Path5.GetNextResistance().SetValue(100, FlowResistanceUnit::Pa_s_Per_m3); SEFluidCircuitPath& Path6 = fluidCircuit.CreatePath(Node2, Node4, "Path6"); - Path6.SetNextValve(CDM::enumOpenClosed::Closed); + Path6.SetNextValve(SEOpenClosed::Closed); } void CommonDataModelTest::TestSetup22CurrentCompPulse() @@ -1680,13 +1683,13 @@ void CommonDataModelTest::TestSetup22CurrentCompPulse() SEFluidCircuitPath& Path2 = fluidCircuit.CreatePath(Node1, Node2, "Path2"); Path2.GetNextResistance().SetValue(1000, FlowResistanceUnit::Pa_s_Per_m3); SEFluidCircuitPath& Path3 = fluidCircuit.CreatePath(Node2, Node3, "Path3"); - Path3.SetNextSwitch(CDM::enumOpenClosed::Open); + Path3.SetNextSwitch(SEOpenClosed::Open); SEFluidCircuitPath& Path4 = fluidCircuit.CreatePath(Node3, Node4, "Path4"); Path4.GetNextResistance().SetValue(500, FlowResistanceUnit::Pa_s_Per_m3); SEFluidCircuitPath& Path5 = fluidCircuit.CreatePath(Node2, Node4, "Path5"); Path5.GetNextResistance().SetValue(100, FlowResistanceUnit::Pa_s_Per_m3); SEFluidCircuitPath& Path6 = fluidCircuit.CreatePath(Node2, Node4, "Path6"); - Path6.SetNextValve(CDM::enumOpenClosed::Closed); + Path6.SetNextValve(SEOpenClosed::Closed); } void CommonDataModelTest::TestSetup23SeriesRLDCCurrent() @@ -1902,7 +1905,7 @@ void CommonDataModelTest::TestSetup25BasicDiodeDCCurrent() Path3.GetNextCompliance().SetValue(0.001, FlowComplianceUnit::m3_Per_Pa); Path3.GetSourceNode().GetNextVolume().SetValue(5, VolumeUnit::m3); SEFluidCircuitPath& Path4 = fluidCircuit.CreatePath(Node3, Node2, "Path4"); - Path4.SetNextValve(CDM::enumOpenClosed::Closed); + Path4.SetNextValve(SEOpenClosed::Closed); } void CommonDataModelTest::TestSetup25BasicDiodeSINCurrent() @@ -1935,7 +1938,7 @@ void CommonDataModelTest::TestSetup25BasicDiodeSINCurrent() Path3.GetNextCompliance().SetValue(0.001, FlowComplianceUnit::m3_Per_Pa); Path3.GetSourceNode().GetNextVolume().SetValue(5, VolumeUnit::m3); SEFluidCircuitPath& Path4 = fluidCircuit.CreatePath(Node3, Node2, "Path4"); - Path4.SetNextValve(CDM::enumOpenClosed::Closed); + Path4.SetNextValve(SEOpenClosed::Closed); } void CommonDataModelTest::TestSetup25BasicDiodePULSECurrent() @@ -1968,7 +1971,7 @@ void CommonDataModelTest::TestSetup25BasicDiodePULSECurrent() Path3.GetNextCompliance().SetValue(0.001, FlowComplianceUnit::m3_Per_Pa); Path3.GetSourceNode().GetNextVolume().SetValue(5, VolumeUnit::m3); SEFluidCircuitPath& Path4 = fluidCircuit.CreatePath(Node3, Node2, "Path4"); - Path4.SetNextValve(CDM::enumOpenClosed::Closed); + Path4.SetNextValve(SEOpenClosed::Closed); } void CommonDataModelTest::TestSetup26SwitchRCDCCurrent() @@ -1997,7 +2000,7 @@ void CommonDataModelTest::TestSetup26SwitchRCDCCurrent() Path7.GetNextFlowSource().SetValue(3, VolumePerTimeUnit::m3_Per_s); SEFluidCircuitPath& Path2 = fluidCircuit.CreatePath(Node1, Node2, "Path2"); - Path2.SetNextSwitch(CDM::enumOpenClosed::Open); + Path2.SetNextSwitch(SEOpenClosed::Open); SEFluidCircuitPath& Path3 = fluidCircuit.CreatePath(Node2, Node3, "Path3"); Path3.GetNextResistance().SetValue(1000, FlowResistanceUnit::Pa_s_Per_m3); SEFluidCircuitPath& Path4 = fluidCircuit.CreatePath(Node3, Node4, "Path4"); @@ -2031,7 +2034,7 @@ void CommonDataModelTest::TestSetup26SwitchRCSINCurrent() Path7.GetNextFlowSource().SetValue(3, VolumePerTimeUnit::m3_Per_s); SEFluidCircuitPath& Path2 = fluidCircuit.CreatePath(Node1, Node2, "Path2"); - Path2.SetNextSwitch(CDM::enumOpenClosed::Open); + Path2.SetNextSwitch(SEOpenClosed::Open); SEFluidCircuitPath& Path3 = fluidCircuit.CreatePath(Node2, Node3, "Path3"); Path3.GetNextResistance().SetValue(1000, FlowResistanceUnit::Pa_s_Per_m3); SEFluidCircuitPath& Path4 = fluidCircuit.CreatePath(Node3, Node4, "Path4"); @@ -2065,7 +2068,7 @@ void CommonDataModelTest::TestSetup26SwitchRCPULSECurrent() Path7.GetNextFlowSource().SetValue(3, VolumePerTimeUnit::m3_Per_s); SEFluidCircuitPath& Path2 = fluidCircuit.CreatePath(Node1, Node2, "Path2"); - Path2.SetNextSwitch(CDM::enumOpenClosed::Open); + Path2.SetNextSwitch(SEOpenClosed::Open); SEFluidCircuitPath& Path3 = fluidCircuit.CreatePath(Node2, Node3, "Path3"); Path3.GetNextResistance().SetValue(1000, FlowResistanceUnit::Pa_s_Per_m3); SEFluidCircuitPath& Path4 = fluidCircuit.CreatePath(Node3, Node4, "Path4"); @@ -3344,7 +3347,7 @@ void CommonDataModelTest::TestSetup40BadDiodeDC() Path1.GetNextPressureSource().SetValue(20, PressureUnit::Pa); SEFluidCircuitPath& Path2 = fluidCircuit.CreatePath(Node2, Node1, "Path2"); - Path2.SetNextValve(CDM::enumOpenClosed::Closed); + Path2.SetNextValve(SEOpenClosed::Closed); // should fail if working properly } @@ -3371,7 +3374,7 @@ void CommonDataModelTest::TestSetup40BadDiodeSIN() Path1.GetNextPressureSource().SetValue(20, PressureUnit::Pa); SEFluidCircuitPath& Path2 = fluidCircuit.CreatePath(Node2, Node1, "Path2"); - Path2.SetNextValve(CDM::enumOpenClosed::Closed); + Path2.SetNextValve(SEOpenClosed::Closed); // should fail if working properly } @@ -3399,7 +3402,7 @@ void CommonDataModelTest::TestSetup40BadDiodePulse() Path1.GetNextPressureSource().SetValue(20, PressureUnit::Pa); SEFluidCircuitPath& Path2 = fluidCircuit.CreatePath(Node2, Node1, "Path2"); - Path2.SetNextValve(CDM::enumOpenClosed::Closed); + Path2.SetNextValve(SEOpenClosed::Closed); // should fail if working properly } @@ -3439,11 +3442,11 @@ void CommonDataModelTest::TestSetup41ValidationComprehensive1DC() //Switch SEFluidCircuitPath& Path2 = fluidCircuit.CreatePath(Node5, Node6, "Path2"); - Path2.SetNextSwitch(CDM::enumOpenClosed::Open); + Path2.SetNextSwitch(SEOpenClosed::Open); //Diode SEFluidCircuitPath& Path4 = fluidCircuit.CreatePath(Node3, Node2, "Path4"); - Path4.SetNextValve(CDM::enumOpenClosed::Closed); + Path4.SetNextValve(SEOpenClosed::Closed); //Resistors SEFluidCircuitPath& Path11 = fluidCircuit.CreatePath(Node1, Node2, "Path11"); @@ -3503,11 +3506,11 @@ void CommonDataModelTest::TestSetup41ValidationComprehensive1SIN() //Switch SEFluidCircuitPath& Path2 = fluidCircuit.CreatePath(Node5, Node6, "Path2"); - Path2.SetNextSwitch(CDM::enumOpenClosed::Open); + Path2.SetNextSwitch(SEOpenClosed::Open); //Diode SEFluidCircuitPath& Path4 = fluidCircuit.CreatePath(Node3, Node2, "Path4"); - Path4.SetNextValve(CDM::enumOpenClosed::Closed); + Path4.SetNextValve(SEOpenClosed::Closed); //Resistors SEFluidCircuitPath& Path11 = fluidCircuit.CreatePath(Node1, Node2, "Path11"); @@ -3567,11 +3570,11 @@ void CommonDataModelTest::TestSetup41ValidationComprehensive1Pulse() //Switch SEFluidCircuitPath& Path2 = fluidCircuit.CreatePath(Node5, Node6, "Path2"); - Path2.SetNextSwitch(CDM::enumOpenClosed::Open); + Path2.SetNextSwitch(SEOpenClosed::Open); //Diode SEFluidCircuitPath& Path4 = fluidCircuit.CreatePath(Node3, Node2, "Path4"); - Path4.SetNextValve(CDM::enumOpenClosed::Closed); + Path4.SetNextValve(SEOpenClosed::Closed); //Resistors SEFluidCircuitPath& Path11 = fluidCircuit.CreatePath(Node2, Node1, "Path11"); @@ -3632,11 +3635,11 @@ void CommonDataModelTest::TestSetup41ValidationComprehensive1SINCentered() //Switch SEFluidCircuitPath& Path2 = fluidCircuit.CreatePath(Node5, Node6, "Path2"); - Path2.SetNextSwitch(CDM::enumOpenClosed::Open); + Path2.SetNextSwitch(SEOpenClosed::Open); //Diode SEFluidCircuitPath& Path4 = fluidCircuit.CreatePath(Node3, Node2, "Path4"); - Path4.SetNextValve(CDM::enumOpenClosed::Closed); + Path4.SetNextValve(SEOpenClosed::Closed); //Resistors SEFluidCircuitPath& Path11 = fluidCircuit.CreatePath(Node1, Node2, "Path11"); @@ -3699,7 +3702,7 @@ void CommonDataModelTest::TestSetup42ValidationComprehensive2DC() //Diode SEFluidCircuitPath& Path4 = fluidCircuit.CreatePath(Node3, Node1, "Path4"); - Path4.SetNextValve(CDM::enumOpenClosed::Closed); + Path4.SetNextValve(SEOpenClosed::Closed); //Resistors SEFluidCircuitPath& Path2 = fluidCircuit.CreatePath(Node2, Node3, "Path2"); @@ -3762,7 +3765,7 @@ void CommonDataModelTest::TestSetup42ValidationComprehensive2SIN() //Diode SEFluidCircuitPath& Path4 = fluidCircuit.CreatePath(Node3, Node1, "Path4"); - Path4.SetNextValve(CDM::enumOpenClosed::Closed); + Path4.SetNextValve(SEOpenClosed::Closed); //Resistors SEFluidCircuitPath& Path2 = fluidCircuit.CreatePath(Node2, Node3, "Path2"); @@ -3825,7 +3828,7 @@ void CommonDataModelTest::TestSetup42ValidationComprehensive2Pulse() //Diode SEFluidCircuitPath& Path4 = fluidCircuit.CreatePath(Node3, Node1, "Path4"); - Path4.SetNextValve(CDM::enumOpenClosed::Closed); + Path4.SetNextValve(SEOpenClosed::Closed); //Resistors SEFluidCircuitPath& Path2 = fluidCircuit.CreatePath(Node2, Node3, "Path2"); @@ -3888,7 +3891,7 @@ void CommonDataModelTest::TestSetup42ValidationComprehensive2SINCentered() //Diode SEFluidCircuitPath& Path4 = fluidCircuit.CreatePath(Node3, Node1, "Path4"); - Path4.SetNextValve(CDM::enumOpenClosed::Closed); + Path4.SetNextValve(SEOpenClosed::Closed); //Resistors SEFluidCircuitPath& Path2 = fluidCircuit.CreatePath(Node3, Node2, "Path2"); @@ -3986,15 +3989,15 @@ void CommonDataModelTest::TestPreProcess1(double dT, int i) if (SWITCHPRESENT) { if (i == 8 || i == 34 || i == 19) { if (dT < 5) { - m_Circuits.GetFluidPath("Path2")->SetNextSwitch(CDM::enumOpenClosed::Open); + m_Circuits.GetFluidPath("Path2")->SetNextSwitch(SEOpenClosed::Open); } else { - m_Circuits.GetFluidPath("Path2")->SetNextSwitch(CDM::enumOpenClosed::Closed); + m_Circuits.GetFluidPath("Path2")->SetNextSwitch(SEOpenClosed::Closed); } } else if (i == 9 || i == 15) { if (dT < 5) { - m_Circuits.GetFluidPath("Path3")->SetNextSwitch(CDM::enumOpenClosed::Open); + m_Circuits.GetFluidPath("Path3")->SetNextSwitch(SEOpenClosed::Open); } else { - m_Circuits.GetFluidPath("Path3")->SetNextSwitch(CDM::enumOpenClosed::Closed); + m_Circuits.GetFluidPath("Path3")->SetNextSwitch(SEOpenClosed::Closed); } } } @@ -4074,15 +4077,15 @@ void CommonDataModelTest::TestPreProcess2(double dT, int i) if (SWITCHPRESENT) { if (i == 8 || i == 34 || i == 19) { if (dT < 5) { - m_Circuits.GetFluidPath("Path2")->SetNextSwitch(CDM::enumOpenClosed::Open); + m_Circuits.GetFluidPath("Path2")->SetNextSwitch(SEOpenClosed::Open); } else { - m_Circuits.GetFluidPath("Path2")->SetNextSwitch(CDM::enumOpenClosed::Closed); + m_Circuits.GetFluidPath("Path2")->SetNextSwitch(SEOpenClosed::Closed); } } else if (i == 9 || i == 15) { if (dT < 5) { - m_Circuits.GetFluidPath("Path3")->SetNextSwitch(CDM::enumOpenClosed::Open); + m_Circuits.GetFluidPath("Path3")->SetNextSwitch(SEOpenClosed::Open); } else { - m_Circuits.GetFluidPath("Path3")->SetNextSwitch(CDM::enumOpenClosed::Closed); + m_Circuits.GetFluidPath("Path3")->SetNextSwitch(SEOpenClosed::Closed); } } } @@ -4191,15 +4194,15 @@ void CommonDataModelTest::TestPreProcess3(double dT, int i) if (SWITCHPRESENT) { if (i == 8 || i == 34 || i == 19) { if (dT < 5) { - m_Circuits.GetFluidPath("Path2")->SetNextSwitch(CDM::enumOpenClosed::Open); + m_Circuits.GetFluidPath("Path2")->SetNextSwitch(SEOpenClosed::Open); } else { - m_Circuits.GetFluidPath("Path2")->SetNextSwitch(CDM::enumOpenClosed::Closed); + m_Circuits.GetFluidPath("Path2")->SetNextSwitch(SEOpenClosed::Closed); } } else if (i == 9 || i == 15) { if (dT < 5) { - m_Circuits.GetFluidPath("Path3")->SetNextSwitch(CDM::enumOpenClosed::Open); + m_Circuits.GetFluidPath("Path3")->SetNextSwitch(SEOpenClosed::Open); } else { - m_Circuits.GetFluidPath("Path3")->SetNextSwitch(CDM::enumOpenClosed::Closed); + m_Circuits.GetFluidPath("Path3")->SetNextSwitch(SEOpenClosed::Closed); } } } @@ -4280,15 +4283,15 @@ void CommonDataModelTest::TestPreProcess4(double dT, int i) if (SWITCHPRESENT) { if (i == 8 || i == 34) { if (dT < 5) { - m_Circuits.GetFluidPath("Path2")->SetNextSwitch(CDM::enumOpenClosed::Open); + m_Circuits.GetFluidPath("Path2")->SetNextSwitch(SEOpenClosed::Open); } else { - m_Circuits.GetFluidPath("Path2")->SetNextSwitch(CDM::enumOpenClosed::Closed); + m_Circuits.GetFluidPath("Path2")->SetNextSwitch(SEOpenClosed::Closed); } } else if (i == 9 || i == 15) { if (dT < 5) { - m_Circuits.GetFluidPath("Path3")->SetNextSwitch(CDM::enumOpenClosed::Open); + m_Circuits.GetFluidPath("Path3")->SetNextSwitch(SEOpenClosed::Open); } else { - m_Circuits.GetFluidPath("Path3")->SetNextSwitch(CDM::enumOpenClosed::Closed); + m_Circuits.GetFluidPath("Path3")->SetNextSwitch(SEOpenClosed::Closed); } } } @@ -4389,7 +4392,7 @@ void CommonDataModelTest::BasicCircuitTest(const std::string& outputDirectory) } } - m_Circuits.Clear(); + m_Circuits.Invalidate(); std::string sOutputFile = outputDirectory + "/BasicCircuit.csv"; trk1.WriteTrackToFile(sOutputFile.c_str()); } @@ -5125,7 +5128,7 @@ void CommonDataModelTest::RunTest(const std::string& outputDirectory, const std: trk1.WriteTrackToFile(sOutputFile.c_str()); } } - m_Circuits.Clear(); + m_Circuits.Invalidate(); } void CommonDataModelTest::TestCircuitSerialization(const std::string& fileName) @@ -5134,14 +5137,18 @@ void CommonDataModelTest::TestCircuitSerialization(const std::string& fileName) std::ofstream stream(io->ResolveResultsFileLocation(fileName)); xml_schema::namespace_infomap map; map[""].name = "uri:/mil/tatrc/physiology/datamodel"; - - CDM::CircuitManager(stream, dynamic_cast(*m_Circuits.Unload()), map); + auto cdmData = std::make_unique(); + io::Circuit::Marshall(m_Circuits, *cdmData); + CDM::CircuitManager(stream, *cdmData, map); stream.close(); std::unique_ptr bind = Serializer::ReadFile(fileName, m_Logger); CDM::CircuitManagerData* data = dynamic_cast(bind.get()); if (data != nullptr) { - if (!m_Circuits.Load(*data)) - Error("Could not load Circuit Data"); + try { + io::Circuit::UnMarshall(*data, m_Circuits); + } catch (CommonDataModelException ex) { + Error(biogears::asprintf("When loading Circuit: %s", ex.what() )); + } } else Error("Could not cast loaded Circuit Data"); } diff --git a/projects/biogears/libCircuitTest/src/Circuits/CardiovascularCircuit.cpp b/projects/biogears/libCircuitTest/src/Circuits/CardiovascularCircuit.cpp index 16de65fc2..e13ce0517 100644 --- a/projects/biogears/libCircuitTest/src/Circuits/CardiovascularCircuit.cpp +++ b/projects/biogears/libCircuitTest/src/Circuits/CardiovascularCircuit.cpp @@ -31,6 +31,7 @@ specific language governing permissions and limitations under the License. #include #include +#include "io/cdm/Patient.h" namespace biogears { enum Driver { Sinusoid = 0, Heart }; @@ -71,7 +72,7 @@ void BioGearsEngineTest::TuneCardiovascularCircuitTest(const std::string& sTestD SEPatient patient(nullptr); patient.SetName("TuneTest"); - patient.SetSex(CDM::enumSex::Male); + patient.SetSex(SESex::Male); double HRLower = 60; double HRUpper = 100; @@ -125,9 +126,10 @@ void BioGearsEngineTest::TuneCardiovascularCircuitTest(SETestSuite& testSuite, c timer.Start("TestCase"); BioGears bg(testSuite.GetLogger() ); testSuite.GetLogger()->Info("Running " + sTestName); - CDM_COPY((&patient), (&bg.GetPatient())); - bg.m_Config->EnableRenal(CDM::enumOnOff::On); - bg.m_Config->EnableTissue(CDM::enumOnOff::On); + + CDM_PATIENT_COPY(Patient, patient, bg.GetPatient()) + bg.m_Configuration->EnableRenal(SEOnOff::On); + bg.m_Configuration->EnableTissue(SEOnOff::On); bg.SetupPatient(); bg.CreateCircuitsAndCompartments(); @@ -189,8 +191,8 @@ void BioGearsEngineTest::CardiovascularCircuitAndTransportTest(CardiovascularDri bg.GetPatient().GetHeartRateBaseline().SetValue(heartRate_bpm, FrequencyUnit::Per_min); } - bg.m_Config->EnableRenal(connectRenal ? CDM::enumOnOff::On : CDM::enumOnOff::Off); - bg.m_Config->EnableTissue(connectTissue ? CDM::enumOnOff::On : CDM::enumOnOff::Off); + bg.m_Configuration->EnableRenal(connectRenal ? SEOnOff::On : SEOnOff::Off); + bg.m_Configuration->EnableTissue(connectTissue ? SEOnOff::On : SEOnOff::Off); bg.CreateCircuitsAndCompartments(); std::vector subs2Track; diff --git a/projects/biogears/libCircuitTest/src/Circuits/NervousTests.cpp b/projects/biogears/libCircuitTest/src/Circuits/NervousTests.cpp index 7e84d6333..bc4a5f737 100644 --- a/projects/biogears/libCircuitTest/src/Circuits/NervousTests.cpp +++ b/projects/biogears/libCircuitTest/src/Circuits/NervousTests.cpp @@ -72,8 +72,8 @@ void BioGearsEngineTest::BrainInjuryTest(const std::string& sTestDirectory) bg.SetupPatient(); //Renal and Tissue are on - bg.m_Config->EnableRenal(CDM::enumOnOff::On); - bg.m_Config->EnableTissue(CDM::enumOnOff::On); + bg.m_Configuration->EnableRenal(SEOnOff::On); + bg.m_Configuration->EnableTissue(SEOnOff::On); bg.CreateCircuitsAndCompartments(); Cardiovascular& cv = (Cardiovascular&)bg.GetCardiovascular(); diff --git a/projects/biogears/libCircuitTest/src/Circuits/RenalCircuit.cpp b/projects/biogears/libCircuitTest/src/Circuits/RenalCircuit.cpp index bad59c957..dcef48a60 100644 --- a/projects/biogears/libCircuitTest/src/Circuits/RenalCircuit.cpp +++ b/projects/biogears/libCircuitTest/src/Circuits/RenalCircuit.cpp @@ -41,8 +41,8 @@ void BioGearsEngineTest::RenalCircuitAndTransportTest(const std::string& sTestDi BioGears bg(sTestDirectory + "/RenalCircuitAndTransportTest.log"); bg.GetPatient().Load("StandardMale.xml"); bg.SetupPatient(); - bg.m_Config->EnableRenal(CDM::enumOnOff::On); - bg.m_Config->EnableTissue(CDM::enumOnOff::Off); + bg.m_Configuration->EnableRenal(SEOnOff::On); + bg.m_Configuration->EnableTissue(SEOnOff::Off); bg.CreateCircuitsAndCompartments(); // Renal needs these tissue compartments // Let's make them manually, without the tissue circuit @@ -52,7 +52,7 @@ void BioGearsEngineTest::RenalCircuitAndTransportTest(const std::string& sTestDi bg.GetCompartments().CreateLiquidCompartment(BGE::ExtravascularCompartment::RightKidneyExtracellular); bg.GetCompartments().CreateLiquidCompartment(BGE::ExtravascularCompartment::LeftKidneyIntracellular); bg.GetCompartments().CreateLiquidCompartment(BGE::ExtravascularCompartment::RightKidneyIntracellular); - bg.m_Config->EnableTissue(CDM::enumOnOff::On); // This needs to be on for making the tissue to extravascular mapping + bg.m_Configuration->EnableTissue(SEOnOff::On); // This needs to be on for making the tissue to extravascular mapping bg.GetCompartments().StateChange(); //Add just N2 bg.GetSubstances().AddActiveSubstance(bg.GetSubstances().GetN2()); @@ -165,8 +165,8 @@ void BioGearsEngineTest::RenalFeedbackTest(RenalFeedback feedback, const std::st BioGears bg(sTestDirectory + "/" + "RenalFeedbackTest.log"); bg.GetPatient().Load("StandardMale.xml"); bg.SetupPatient(); - bg.m_Config->EnableRenal(CDM::enumOnOff::On); - bg.m_Config->EnableTissue(CDM::enumOnOff::Off); + bg.m_Configuration->EnableRenal(SEOnOff::On); + bg.m_Configuration->EnableTissue(SEOnOff::Off); bg.CreateCircuitsAndCompartments(); // Renal needs these tissue compartments // Let's make them manually, without the tissue circuit @@ -176,7 +176,7 @@ void BioGearsEngineTest::RenalFeedbackTest(RenalFeedback feedback, const std::st bg.GetCompartments().CreateLiquidCompartment(BGE::ExtravascularCompartment::RightKidneyExtracellular); bg.GetCompartments().CreateLiquidCompartment(BGE::ExtravascularCompartment::LeftKidneyIntracellular); bg.GetCompartments().CreateLiquidCompartment(BGE::ExtravascularCompartment::RightKidneyIntracellular); - bg.m_Config->EnableTissue(CDM::enumOnOff::On); // This needs to be on for making the tissue to extravascular mapping + bg.m_Configuration->EnableTissue(SEOnOff::On); // This needs to be on for making the tissue to extravascular mapping bg.GetCompartments().StateChange(); SEPatient* patient = (SEPatient*)&bg.GetPatient(); @@ -306,7 +306,7 @@ void BioGearsEngineTest::RenalFeedbackTest(RenalFeedback feedback, const std::st // Stabilize the circuit for (unsigned int i = 0; i < 3e6; i++) { //Flag beginning of cardiac cycle - this will make it just use the current value instead of a running average - patient->SetEvent(CDM::enumPatientEvent::StartOfCardiacCycle, true, eventTime); + patient->SetEvent(SEPatientEventType::StartOfCardiacCycle, true, eventTime); GFRSteady = false; RBFSteady = false; @@ -467,8 +467,8 @@ void BioGearsEngineTest::RenalSystemTest(RenalSystems systemtest, const std::str BioGears bg(sTestDirectory + "/" + "RenalSystemTest.log"); bg.GetPatient().Load("StandardMale.xml"); bg.SetupPatient(); - bg.m_Config->EnableRenal(CDM::enumOnOff::On); - bg.m_Config->EnableTissue(CDM::enumOnOff::Off); + bg.m_Configuration->EnableRenal(SEOnOff::On); + bg.m_Configuration->EnableTissue(SEOnOff::Off); bg.CreateCircuitsAndCompartments(); // Renal needs these tissue compartments // Let's make them manually, without the tissue circuit @@ -478,7 +478,7 @@ void BioGearsEngineTest::RenalSystemTest(RenalSystems systemtest, const std::str bg.GetCompartments().CreateLiquidCompartment(BGE::ExtravascularCompartment::RightKidneyExtracellular); bg.GetCompartments().CreateLiquidCompartment(BGE::ExtravascularCompartment::LeftKidneyIntracellular); bg.GetCompartments().CreateLiquidCompartment(BGE::ExtravascularCompartment::RightKidneyIntracellular); - bg.m_Config->EnableTissue(CDM::enumOnOff::On); // This needs to be on for making the tissue to extravascular mapping + bg.m_Configuration->EnableTissue(SEOnOff::On); // This needs to be on for making the tissue to extravascular mapping bg.GetCompartments().StateChange(); SEPatient* patient = (SEPatient*)&bg.GetPatient(); SESubstance& potassium = bg.GetSubstances().GetPotassium(); diff --git a/projects/biogears/libCircuitTest/src/Circuits/RespiratoryCircuit.cpp b/projects/biogears/libCircuitTest/src/Circuits/RespiratoryCircuit.cpp index a1cbdfbd4..5320adf9f 100644 --- a/projects/biogears/libCircuitTest/src/Circuits/RespiratoryCircuit.cpp +++ b/projects/biogears/libCircuitTest/src/Circuits/RespiratoryCircuit.cpp @@ -45,8 +45,8 @@ void BioGearsEngineTest::RespiratoryCircuitAndTransportTest(RespiratoryConfigura BioGears bg(sTestDirectory + "/" + "RespiratoryCircuitAndTransportTest.log"); bg.GetPatient().Load("StandardMale.xml"); bg.SetupPatient(); - bg.m_Config->EnableRenal(CDM::enumOnOff::Off); - bg.m_Config->EnableTissue(CDM::enumOnOff::Off); + bg.m_Configuration->EnableRenal(SEOnOff::Off); + bg.m_Configuration->EnableTissue(SEOnOff::Off); bg.CreateCircuitsAndCompartments(); bg.GetSubstances().InitializeGasCompartments(); SEEnvironmentalConditions& env = bg.GetEnvironment().GetConditions(); @@ -180,8 +180,8 @@ void BioGearsEngineTest::RespiratoryDriverTest(const std::string& sTestDirectory BioGears bg(sTestDirectory + "/" + "RespiratoryDriverTest.log"); bg.GetPatient().Load("StandardMale.xml"); bg.SetupPatient(); - bg.m_Config->EnableRenal(CDM::enumOnOff::Off); - bg.m_Config->EnableTissue(CDM::enumOnOff::Off); + bg.m_Configuration->EnableRenal(SEOnOff::Off); + bg.m_Configuration->EnableTissue(SEOnOff::Off); bg.CreateCircuitsAndCompartments(); SEEnvironmentalConditions env(bg.GetSubstances()); env.Load("StandardEnvironment.xml"); diff --git a/projects/biogears/libCircuitTest/src/Circuits/TemperatureCircuit.cpp b/projects/biogears/libCircuitTest/src/Circuits/TemperatureCircuit.cpp index 3b79b91ce..7cab9d3b3 100644 --- a/projects/biogears/libCircuitTest/src/Circuits/TemperatureCircuit.cpp +++ b/projects/biogears/libCircuitTest/src/Circuits/TemperatureCircuit.cpp @@ -40,8 +40,8 @@ void BioGearsEngineTest::InternalTemperatureVariableBMRCircuitTest(const std::st BioGears bg(sTestDirectory + "/" + "InternalTemperatureVariableBMRCircuitTest.log"); bg.GetPatient().Load("StandardMale.xml"); bg.SetupPatient(); - bg.m_Config->EnableRenal(CDM::enumOnOff::Off); - bg.m_Config->EnableTissue(CDM::enumOnOff::Off); + bg.m_Configuration->EnableRenal(SEOnOff::Off); + bg.m_Configuration->EnableTissue(SEOnOff::Off); bg.CreateCircuitsAndCompartments(); SEThermalCircuit& m_TCircuit = bg.GetCircuits().GetInternalTemperatureCircuit(); @@ -52,7 +52,7 @@ void BioGearsEngineTest::InternalTemperatureVariableBMRCircuitTest(const std::st SEThermalCircuitNode* Core = m_TCircuit.GetNode(BGE::InternalTemperatureNode::InternalCore); Core->GetTemperature().SetValue(36.85, TemperatureUnit::C); Core->GetNextTemperature().SetValue(36.85, TemperatureUnit::C); - SEThermalCircuitNode* Skin = m_TCircuit.GetNode(BGE::InternalTemperatureNode::InternalSkin); + SEThermalCircuitNode* Skin = m_TCircuit.GetNode(BGE::InternalTemperatureNode::InternalTorsoSkin); Skin->GetTemperature().SetValue(33.0, TemperatureUnit::C); Skin->GetNextTemperature().SetValue(33.0, TemperatureUnit::C); SEThermalCircuitNode* Ground = m_TCircuit.GetNode(BGE::InternalTemperatureNode::InternalGround); @@ -109,8 +109,8 @@ void BioGearsEngineTest::InternalTemperatureVariableSkinCircuitTest(const std::s BioGears bg(sTestDirectory + "/InternalTemperatureVariableSkinCircuitTest.log"); bg.GetPatient().Load("StandardMale.xml"); bg.SetupPatient(); - bg.m_Config->EnableRenal(CDM::enumOnOff::Off); - bg.m_Config->EnableTissue(CDM::enumOnOff::Off); + bg.m_Configuration->EnableRenal(SEOnOff::Off); + bg.m_Configuration->EnableTissue(SEOnOff::Off); bg.CreateCircuitsAndCompartments(); SEThermalCircuit& m_TCircuit = bg.GetCircuits().GetInternalTemperatureCircuit(); @@ -122,7 +122,7 @@ void BioGearsEngineTest::InternalTemperatureVariableSkinCircuitTest(const std::s SEThermalCircuitNode* Core = m_TCircuit.GetNode(BGE::InternalTemperatureNode::InternalCore); Core->GetTemperature().SetValue(36.85, TemperatureUnit::C); Core->GetNextTemperature().SetValue(36.85, TemperatureUnit::C); - SEThermalCircuitNode* Skin = m_TCircuit.GetNode(BGE::InternalTemperatureNode::InternalSkin); + SEThermalCircuitNode* Skin = m_TCircuit.GetNode(BGE::InternalTemperatureNode::InternalTorsoSkin); Skin->GetTemperature().SetValue(33.0, TemperatureUnit::C); Skin->GetNextTemperature().SetValue(33.0, TemperatureUnit::C); SEThermalCircuitNode* Ground = m_TCircuit.GetNode(BGE::InternalTemperatureNode::InternalGround); @@ -193,8 +193,8 @@ void BioGearsEngineTest::InternalTemperatureVariableCoreCircuitTest(const std::s BioGears bg(sTestDirectory + "/InternalTemperatureVariableCoreCircuitTest.log"); bg.GetPatient().Load("StandardMale.xml"); bg.SetupPatient(); - bg.m_Config->EnableRenal(CDM::enumOnOff::Off); - bg.m_Config->EnableTissue(CDM::enumOnOff::Off); + bg.m_Configuration->EnableRenal(SEOnOff::Off); + bg.m_Configuration->EnableTissue(SEOnOff::Off); bg.CreateCircuitsAndCompartments(); SEThermalCircuit& m_TCircuit = bg.GetCircuits().GetInternalTemperatureCircuit(); @@ -206,7 +206,7 @@ void BioGearsEngineTest::InternalTemperatureVariableCoreCircuitTest(const std::s SEThermalCircuitNode* Core = m_TCircuit.GetNode(BGE::InternalTemperatureNode::InternalCore); Core->GetTemperature().SetValue(36.85, TemperatureUnit::C); Core->GetNextTemperature().SetValue(36.85, TemperatureUnit::C); - SEThermalCircuitNode* Skin = m_TCircuit.GetNode(BGE::InternalTemperatureNode::InternalSkin); + SEThermalCircuitNode* Skin = m_TCircuit.GetNode(BGE::InternalTemperatureNode::InternalTorsoSkin); Skin->GetTemperature().SetValue(33.0, TemperatureUnit::C); Skin->GetNextTemperature().SetValue(33.0, TemperatureUnit::C); SEThermalCircuitNode* Ground = m_TCircuit.GetNode(BGE::InternalTemperatureNode::InternalGround); @@ -276,8 +276,8 @@ void BioGearsEngineTest::EnvironmentVariableTemperatureCircuitTest(const std::st BioGears bg(sTestDirectory + "/EnvironmentVariableTemperatureCircuitTest.log"); bg.GetPatient().Load("StandardMale.xml"); bg.SetupPatient(); - bg.m_Config->EnableRenal(CDM::enumOnOff::Off); - bg.m_Config->EnableTissue(CDM::enumOnOff::Off); + bg.m_Configuration->EnableRenal(SEOnOff::Off); + bg.m_Configuration->EnableTissue(SEOnOff::Off); bg.CreateCircuitsAndCompartments(); //Grab the circuit @@ -285,7 +285,7 @@ void BioGearsEngineTest::EnvironmentVariableTemperatureCircuitTest(const std::st double testBMR = 1700; - SEThermalCircuitPath* SkinToClothing = m_ECircuit.GetPath(BGE::ExternalTemperaturePath::ExternalSkinToClothing); + SEThermalCircuitPath* SkinToClothing = m_ECircuit.GetPath(BGE::ExternalTemperaturePath::ExternalTorsoSkinToClothing); SEThermalCircuitPath* ClothingToEnclosure = m_ECircuit.GetPath(BGE::ExternalTemperaturePath::ClothingToEnclosure); SEThermalCircuitPath* GroundToEnvironment = m_ECircuit.GetPath(BGE::ExternalTemperaturePath::GroundToEnvironment); SEThermalCircuitPath* ClothingToEnvironment = m_ECircuit.GetPath(BGE::ExternalTemperaturePath::ClothingToEnvironment); @@ -300,7 +300,7 @@ void BioGearsEngineTest::EnvironmentVariableTemperatureCircuitTest(const std::st // Make a new source attached to Environment circuit to take the place of the Energy circuit SEThermalCircuitNode* Core = m_ECircuit.GetNode(BGE::ExternalTemperatureNode::ExternalCore); - SEThermalCircuitNode* Skin = m_ECircuit.GetNode(BGE::ExternalTemperatureNode::ExternalSkin); + SEThermalCircuitNode* Skin = m_ECircuit.GetNode(BGE::ExternalTemperatureNode::ExternalTorsoSkin); SEThermalCircuitNode* Ground = m_ECircuit.GetNode(BGE::ExternalTemperatureNode::ExternalGround); SEThermalCircuitNode& MetabolicNode = m_ECircuit.CreateNode("Metabolic"); @@ -385,17 +385,17 @@ void BioGearsEngineTest::CombinedInternalAndEnvironmentVariableBMRandTemperature BioGears bg(sTestDirectory + "/CombinedInternalAndEnvironmentVariableBMRandTemperatureCircuitTest.log"); bg.GetPatient().Load("StandardMale.xml"); bg.SetupPatient(); - bg.m_Config->EnableRenal(CDM::enumOnOff::Off); - bg.m_Config->EnableTissue(CDM::enumOnOff::Off); + bg.m_Configuration->EnableRenal(SEOnOff::Off); + bg.m_Configuration->EnableTissue(SEOnOff::Off); bg.CreateCircuitsAndCompartments(); SEThermalCircuit& m_TECircuit = bg.GetCircuits().GetTemperatureCircuit(); SEThermalCircuitPath* MetabolicPath = m_TECircuit.GetPath(BGE::InternalTemperaturePath::GroundToInternalCore); - SEThermalCircuitPath* CoreToSkin = m_TECircuit.GetPath(BGE::InternalTemperaturePath::InternalCoreToInternalSkin); + SEThermalCircuitPath* CoreToSkin = m_TECircuit.GetPath(BGE::InternalTemperaturePath::InternalCoreToInternalTorsoSkin); SEThermalCircuitPath* EnvCoreToGround = m_TECircuit.GetPath(BGE::ExternalTemperaturePath::ExternalCoreToGround); - SEThermalCircuitPath* EnvSkinToGround = m_TECircuit.GetPath(BGE::ExternalTemperaturePath::ExternalSkinToGround); - SEThermalCircuitPath* EnvSkinToClothing = m_TECircuit.GetPath(BGE::ExternalTemperaturePath::ExternalSkinToClothing); + SEThermalCircuitPath* EnvSkinToGround = m_TECircuit.GetPath(BGE::ExternalTemperaturePath::ExternalTorsoSkinToGround); + SEThermalCircuitPath* EnvSkinToClothing = m_TECircuit.GetPath(BGE::ExternalTemperaturePath::ExternalTorsoSkinToClothing); SEThermalCircuitPath* ClothingToEnclosure = m_TECircuit.GetPath(BGE::ExternalTemperaturePath::ClothingToEnclosure); SEThermalCircuitPath* GroundToEnvironment = m_TECircuit.GetPath(BGE::ExternalTemperaturePath::GroundToEnvironment); SEThermalCircuitPath* GroundToEnclosure = m_TECircuit.GetPath(BGE::ExternalTemperaturePath::GroundToEnclosure); @@ -423,7 +423,7 @@ void BioGearsEngineTest::CombinedInternalAndEnvironmentVariableBMRandTemperature //Set some initial temperatures SEThermalCircuitNode* Core = m_TECircuit.GetNode(BGE::InternalTemperatureNode::InternalCore); Core->GetTemperature().SetValue(37.0, TemperatureUnit::C); - SEThermalCircuitNode* Skin = m_TECircuit.GetNode(BGE::InternalTemperatureNode::InternalSkin); + SEThermalCircuitNode* Skin = m_TECircuit.GetNode(BGE::InternalTemperatureNode::InternalTorsoSkin); Skin->GetTemperature().SetValue(33.0, TemperatureUnit::C); SEThermalCircuitNode* Clothing = m_TECircuit.GetNode(BGE::ExternalTemperatureNode::Clothing); Clothing->GetTemperature().SetValue(30.0, TemperatureUnit::C); @@ -512,17 +512,17 @@ void BioGearsEngineTest::CombinedInternalAndEnvironmentSkinTempDropCircuitTest(c BioGears bg(sTestDirectory + "/CombinedInternalAndEnvironmentSkinTempDropCircuitTest.log"); bg.GetPatient().Load("StandardMale.xml"); bg.SetupPatient(); - bg.m_Config->EnableRenal(CDM::enumOnOff::Off); - bg.m_Config->EnableTissue(CDM::enumOnOff::Off); + bg.m_Configuration->EnableRenal(SEOnOff::Off); + bg.m_Configuration->EnableTissue(SEOnOff::Off); bg.CreateCircuitsAndCompartments(); SEThermalCircuit& m_TECircuit = bg.GetCircuits().GetTemperatureCircuit(); SEThermalCircuitPath* MetabolicPath = m_TECircuit.GetPath(BGE::InternalTemperaturePath::GroundToInternalCore); - SEThermalCircuitPath* CoreToSkin = m_TECircuit.GetPath(BGE::InternalTemperaturePath::InternalCoreToInternalSkin); + SEThermalCircuitPath* CoreToSkin = m_TECircuit.GetPath(BGE::InternalTemperaturePath::InternalCoreToInternalTorsoSkin); SEThermalCircuitPath* EnvCoreToGround = m_TECircuit.GetPath(BGE::ExternalTemperaturePath::ExternalCoreToGround); - SEThermalCircuitPath* EnvSkinToGround = m_TECircuit.GetPath(BGE::ExternalTemperaturePath::ExternalSkinToGround); - SEThermalCircuitPath* EnvSkinToClothing = m_TECircuit.GetPath(BGE::ExternalTemperaturePath::ExternalSkinToClothing); + SEThermalCircuitPath* EnvSkinToGround = m_TECircuit.GetPath(BGE::ExternalTemperaturePath::ExternalTorsoSkinToGround); + SEThermalCircuitPath* EnvSkinToClothing = m_TECircuit.GetPath(BGE::ExternalTemperaturePath::ExternalTorsoSkinToClothing); SEThermalCircuitPath* ClothingToEnclosure = m_TECircuit.GetPath(BGE::ExternalTemperaturePath::ClothingToEnclosure); SEThermalCircuitPath* GroundToEnvironment = m_TECircuit.GetPath(BGE::ExternalTemperaturePath::GroundToEnvironment); SEThermalCircuitPath* GroundToEnclosure = m_TECircuit.GetPath(BGE::ExternalTemperaturePath::GroundToEnclosure); @@ -602,8 +602,8 @@ void BioGearsEngineTest::EnvironmentISO7730ComparisonTest(const std::string& sTe BioGears bg(sTestDirectory + "/" + "EnvironmentTemperatureInput.log"); bg.GetPatient().Load("StandardMale.xml"); bg.SetupPatient(); - bg.m_Config->EnableRenal(CDM::enumOnOff::Off); - bg.m_Config->EnableTissue(CDM::enumOnOff::Off); + bg.m_Configuration->EnableRenal(SEOnOff::Off); + bg.m_Configuration->EnableTissue(SEOnOff::Off); bg.CreateCircuitsAndCompartments(); Environment& env = (Environment&)bg.GetEnvironment(); env.Initialize(); @@ -636,7 +636,7 @@ void BioGearsEngineTest::EnvironmentISO7730ComparisonTest(const std::string& sTe SEThermalCircuit& EnvironmentCircuit = bg.GetCircuits().GetExternalTemperatureCircuit(); SEThermalCircuitNode* ClothingNode = EnvironmentCircuit.GetNode(BGE::ExternalTemperatureNode::Clothing); SEThermalCircuitNode* EnvironmentCoreNode = EnvironmentCircuit.GetNode(BGE::ExternalTemperatureNode::ExternalCore); - SEThermalCircuitNode* EnvironmentSkinNode = EnvironmentCircuit.GetNode(BGE::ExternalTemperatureNode::ExternalSkin); + SEThermalCircuitNode* EnvironmentSkinNode = EnvironmentCircuit.GetNode(BGE::ExternalTemperatureNode::ExternalTorsoSkin); SEThermalCircuitNode* AbsoluteReferenceNode = EnvironmentCircuit.GetNode(BGE::ExternalTemperatureNode::ExternalGround); // Create some new stuff in the circuit diff --git a/projects/biogears/libCircuitTest/src/Circuits/TissueTests.cpp b/projects/biogears/libCircuitTest/src/Circuits/TissueTests.cpp index 66a5899db..d9c035de7 100644 --- a/projects/biogears/libCircuitTest/src/Circuits/TissueTests.cpp +++ b/projects/biogears/libCircuitTest/src/Circuits/TissueTests.cpp @@ -418,8 +418,8 @@ void BioGearsEngineTest::EigenDiffusionTest(const std::string& rptDirectory) Tissue& tsu = (Tissue&)bg.GetTissue(); bg.GetPatient().Load("StandardMale.xml"); bg.SetupPatient(); - bg.m_Config->EnableRenal(CDM::enumOnOff::Off); - bg.m_Config->EnableTissue(CDM::enumOnOff::On); + bg.m_Configuration->EnableRenal(SEOnOff::Off); + bg.m_Configuration->EnableTissue(SEOnOff::On); bg.CreateCircuitsAndCompartments(); std::string matrixFile = rptDirectory + "/EigenDiffusionTest.csv"; @@ -693,8 +693,8 @@ void BioGearsEngineTest::TissueCombinedTransportTest(const std::string& rptDirec DiffusionCalculator& diffCalc = (DiffusionCalculator&)bg.GetDiffusionCalculator(); bg.GetPatient().Load("StandardMale.xml"); bg.SetupPatient(); - bg.m_Config->EnableRenal(CDM::enumOnOff::Off); - bg.m_Config->EnableTissue(CDM::enumOnOff::Off); + bg.m_Configuration->EnableRenal(SEOnOff::Off); + bg.m_Configuration->EnableTissue(SEOnOff::Off); bg.CreateCircuitsAndCompartments(); SESubstance& Na = bg.GetSubstances().GetSodium(); @@ -827,7 +827,7 @@ void BioGearsEngineTest::TissueCombinedTransportTest(const std::string& rptDirec //Constants and circuit elements for VascExtra test SELiquidCompartmentGraph* Graph = &bg.GetCompartments().CreateLiquidGraph("Graphite"); - Graph->Clear(); //Empty graph so we just add what we want + Graph->Invalidate(); //Empty graph so we just add what we want Graph->StateChange(); SEFluidCircuit* EVcircuit = &circuits.CreateFluidCircuit("FlyingCircuit"); diff --git a/projects/biogears/libCircuitTest/src/CommonDataModelTest.cpp b/projects/biogears/libCircuitTest/src/CommonDataModelTest.cpp index b2cf507fd..3e44e06da 100644 --- a/projects/biogears/libCircuitTest/src/CommonDataModelTest.cpp +++ b/projects/biogears/libCircuitTest/src/CommonDataModelTest.cpp @@ -13,11 +13,15 @@ specific language governing permissions and limitations under the License. #include +#include "io/cdm/Circuit.h" +#include "io/cdm/Compartment.h" + #include #include #include #include #include +#include namespace biogears { CommonDataModelTest::CommonDataModelTest() @@ -46,7 +50,7 @@ bool CommonDataModelTest::RunTest(const std::string& testName, const std::string { const std::string variant_name = testName + "Test"; try { - //If you find the test name, run it + // If you find the test name, run it if (cdmMap.find(testName) != cdmMap.end()) { testFunction func = cdmMap.at(testName); (this->*func)(sOutputDirectory); @@ -72,7 +76,7 @@ bool CommonDataModelTest::RunTest(const std::string& testName, const std::string void CommonDataModelTest::FillFunctionMap() { - //Fill a map that ties unit test names to their actual functions + // Fill a map that ties unit test names to their actual functions cdmMap.insert(std::make_pair("BasicCircuitTest", &CommonDataModelTest::BasicCircuitTest)); cdmMap.insert(std::make_pair("SeriesRCDCTest", &CommonDataModelTest::SeriesRCDCTest)); @@ -262,13 +266,19 @@ void CommonDataModelTest::TestCompartmentSerialization(SECompartmentManager& mgr xml_schema::namespace_infomap map; map[""].name = "uri:/mil/tatrc/physiology/datamodel"; - CDM::CompartmentManager(stream, dynamic_cast(*mgr.Unload()), map); + auto cdm_mgr = std::make_unique(); + io::Compartment::Marshall(mgr, *cdm_mgr.get()); + CDM::CompartmentManager(stream, *cdm_mgr, map); + stream.close(); std::unique_ptr bind = Serializer::ReadFile(fileName, m_Logger); CDM::CompartmentManagerData* data = dynamic_cast(bind.get()); if (data != nullptr) { - if (!mgr.Load(*data, &m_Circuits)) - Error("Could not load Compartment Manager Data"); + try { + io::Compartment::UnMarshall(*data, mgr, &m_Circuits); + } catch (CommonDataModelException ex) { + Error(biogears::asprintf("When loading Circuit: %s", ex.what())); + } } else { Error("Could not cast loaded Compartment Manager Data"); } diff --git a/projects/biogears/libCircuitTest/src/Compartments/GasCompartmentTest.cpp b/projects/biogears/libCircuitTest/src/Compartments/GasCompartmentTest.cpp index 16249b502..be95dda0c 100644 --- a/projects/biogears/libCircuitTest/src/Compartments/GasCompartmentTest.cpp +++ b/projects/biogears/libCircuitTest/src/Compartments/GasCompartmentTest.cpp @@ -663,7 +663,7 @@ void CommonDataModelTest::TestGasCircuitVolumesPressuresAndFlows(SETestSuite& te TimingProfile pTimer; pTimer.Start("Test"); - m_Circuits.Clear(); + m_Circuits.Invalidate(); SEFluidCircuit& circuit = m_Circuits.CreateFluidCircuit("TestCircuit"); // Left Nodes SEFluidCircuitNode& l1 = circuit.CreateNode("Left1"); diff --git a/projects/biogears/libCircuitTest/src/Compartments/LiquidCompartmentTest.cpp b/projects/biogears/libCircuitTest/src/Compartments/LiquidCompartmentTest.cpp index 84eaf3ba3..cd792342d 100644 --- a/projects/biogears/libCircuitTest/src/Compartments/LiquidCompartmentTest.cpp +++ b/projects/biogears/libCircuitTest/src/Compartments/LiquidCompartmentTest.cpp @@ -622,7 +622,7 @@ void CommonDataModelTest::TestLiquidCircuitVolumesPressuresAndFlows(SETestSuite& TimingProfile pTimer; pTimer.Start("Test"); - m_Circuits.Clear(); + m_Circuits.Invalidate(); SEFluidCircuit& circuit = m_Circuits.CreateFluidCircuit("TestCircuit"); // Left Nodes SEFluidCircuitNode& l1 = circuit.CreateNode("Left1"); diff --git a/projects/biogears/libCircuitTest/src/Engine/AerosolTest.cpp b/projects/biogears/libCircuitTest/src/Engine/AerosolTest.cpp index a9ccbcec8..aab842248 100644 --- a/projects/biogears/libCircuitTest/src/Engine/AerosolTest.cpp +++ b/projects/biogears/libCircuitTest/src/Engine/AerosolTest.cpp @@ -254,8 +254,8 @@ void BioGearsEngineTest::DepositionFractionTest(SETestSuite& suite, SESubstance& BioGears bg(m_Logger); bg.GetPatient().Load("StandardMale.xml"); bg.SetupPatient(); - bg.m_Config->EnableRenal(CDM::enumOnOff::Off); - bg.m_Config->EnableTissue(CDM::enumOnOff::Off); + bg.m_Configuration->EnableRenal(SEOnOff::Off); + bg.m_Configuration->EnableTissue(SEOnOff::Off); bg.CreateCircuitsAndCompartments(); bg.GetSubstances().InitializeGasCompartments(); SEEnvironmentalConditions& env = bg.GetEnvironment().GetConditions(); diff --git a/projects/biogears/libCircuitTest/src/Engine/BloodChemistryTest.cpp b/projects/biogears/libCircuitTest/src/Engine/BloodChemistryTest.cpp index 562cb38d3..a0d022a32 100644 --- a/projects/biogears/libCircuitTest/src/Engine/BloodChemistryTest.cpp +++ b/projects/biogears/libCircuitTest/src/Engine/BloodChemistryTest.cpp @@ -121,7 +121,7 @@ void BioGearsEngineTest::AcuteInflammationTest(const std::string& rptDirectory) //Circuit Construction SEFluidCircuit* bgCircuit = &circuits.CreateFluidCircuit("BgCircuit"); SELiquidCompartmentGraph* bgGraph = &bg.GetCompartments().CreateLiquidGraph("BgGraph"); - bgGraph->Clear(); + bgGraph->Invalidate(); bgGraph->StateChange(); //Nodes SEFluidCircuitNode& nAorta1 = bgCircuit->CreateNode("nAorta1"); diff --git a/projects/biogears/libCircuitTest/src/Engine/FourCompartmentTest.cpp b/projects/biogears/libCircuitTest/src/Engine/FourCompartmentTest.cpp index 355f891e3..d99b19a11 100644 --- a/projects/biogears/libCircuitTest/src/Engine/FourCompartmentTest.cpp +++ b/projects/biogears/libCircuitTest/src/Engine/FourCompartmentTest.cpp @@ -75,8 +75,8 @@ void BioGearsEngineTest::FourCompartmentTest(bool usingAcidBase, bool usingProdu Tissue& tsu = (Tissue&)bg.GetTissue(); bg.GetPatient().Load("StandardMale.xml"); bg.SetupPatient(); - bg.m_Config->EnableRenal(CDM::enumOnOff::Off); - bg.m_Config->EnableTissue(CDM::enumOnOff::Off); + bg.m_Configuration->EnableRenal(SEOnOff::Off); + bg.m_Configuration->EnableTissue(SEOnOff::Off); bg.CreateCircuitsAndCompartments(); bg.GetSubstances().InitializeGasCompartments(); diff --git a/projects/biogears/libCircuitTest/src/Engine/SerializationTest.cpp b/projects/biogears/libCircuitTest/src/Engine/SerializationTest.cpp index 30d06862e..d5d06ab99 100644 --- a/projects/biogears/libCircuitTest/src/Engine/SerializationTest.cpp +++ b/projects/biogears/libCircuitTest/src/Engine/SerializationTest.cpp @@ -127,7 +127,7 @@ void BioGearsEngineTest::InjectSuccsState(PhysiologyEngine* bg, HowToTracker& tr } SESubstanceBolus injection(succs); - injection.SetAdminRoute(CDM::enumBolusAdministration::Intravenous); + injection.SetAdminRoute(SEBolusAdministration::Intravenous); injection.GetConcentration().SetValue(4820, MassPerVolumeUnit::ug_Per_mL); injection.GetDose().SetValue(30, VolumeUnit::mL); bg->ProcessAction(injection); @@ -148,13 +148,13 @@ void BioGearsEngineTest::InjectSuccsState(PhysiologyEngine* bg, HowToTracker& tr tracker.AdvanceModelTime(15); SEAnesthesiaMachineConfiguration amConfig(bg->GetSubstanceManager()); - amConfig.GetConfiguration().SetConnection(CDM::enumAnesthesiaMachineConnection::Mask); + amConfig.GetConfiguration().SetConnection(SEAnesthesiaMachineConnection::Mask); amConfig.GetConfiguration().GetInletFlow().SetValue(5, VolumePerTimeUnit::L_Per_min); amConfig.GetConfiguration().GetInspiratoryExpiratoryRatio().SetValue(0.5); amConfig.GetConfiguration().GetOxygenFraction().SetValue(0.4); - amConfig.GetConfiguration().SetOxygenSource(CDM::enumAnesthesiaMachineOxygenSource::Wall); + amConfig.GetConfiguration().SetOxygenSource(SEAnesthesiaMachineOxygenSource::Wall); amConfig.GetConfiguration().GetPositiveEndExpiredPressure().SetValue(3.0, PressureUnit::cmH2O); - amConfig.GetConfiguration().SetPrimaryGas(CDM::enumAnesthesiaMachinePrimaryGas::Nitrogen); + amConfig.GetConfiguration().SetPrimaryGas(SEAnesthesiaMachinePrimaryGas::Nitrogen); amConfig.GetConfiguration().GetReliefValvePressure().SetValue(20, PressureUnit::cmH2O); amConfig.GetConfiguration().GetRespiratoryRate().SetValue(16.0, FrequencyUnit::Per_min); amConfig.GetConfiguration().GetVentilatorPressure().SetValue(10, PressureUnit::cmH2O); @@ -184,16 +184,16 @@ void BioGearsEngineTest::SerializationTest(const std::string& sTestDirectory) SECompartmentDataRequest* cmptRequest; cmptRequest = new SECompartmentDataRequest(); - cmptRequest->Set("Aorta", CDM::enumCompartmentType::Liquid, *O2, "PartialPressure", PressureUnit::mmHg); + cmptRequest->Set("Aorta", SECompartmentType::Liquid, *O2, "PartialPressure", PressureUnit::mmHg); tracker.m_Requests.push_back(cmptRequest); cmptRequest = new SECompartmentDataRequest(); - cmptRequest->Set("Carina", CDM::enumCompartmentType::Gas, *O2, "PartialPressure", PressureUnit::cmH2O); + cmptRequest->Set("Carina", SECompartmentType::Gas, *O2, "PartialPressure", PressureUnit::cmH2O); tracker.m_Requests.push_back(cmptRequest); cmptRequest = new SECompartmentDataRequest(); - cmptRequest->Set("Aorta", CDM::enumCompartmentType::Liquid, *CO2, "PartialPressure", PressureUnit::mmHg); + cmptRequest->Set("Aorta", SECompartmentType::Liquid, *CO2, "PartialPressure", PressureUnit::mmHg); tracker.m_Requests.push_back(cmptRequest); cmptRequest = new SECompartmentDataRequest(); - cmptRequest->Set("Carina", CDM::enumCompartmentType::Gas, *CO2, "PartialPressure", PressureUnit::cmH2O); + cmptRequest->Set("Carina", SECompartmentType::Gas, *CO2, "PartialPressure", PressureUnit::cmH2O); tracker.m_Requests.push_back(cmptRequest); diff --git a/projects/biogears/libCircuitTest/src/Engine/SolverTests.cpp b/projects/biogears/libCircuitTest/src/Engine/SolverTests.cpp index 47f7c2db5..c4cdb0a97 100644 --- a/projects/biogears/libCircuitTest/src/Engine/SolverTests.cpp +++ b/projects/biogears/libCircuitTest/src/Engine/SolverTests.cpp @@ -9,8 +9,10 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **************************************************************************************/ +#include #include -//Project Includes +#include +// Project Includes #include #include #include @@ -44,64 +46,74 @@ void BioGearsEngineTest::SolverSpeedTest(const std::string& rptDirectory) std::stringstream ss; TimingProfile timer; double deltaT_s = 1.0 / 90.0; - bool showAllOutput = true; //toggle this to show all Info outputs for all circuits, which will show first-pass solve times and fail rates + bool showAllOutput = true; // toggle this to show all Info outputs for all circuits, which will show first-pass solve times and fail rates BioGears bg(tsSolverSpeed.GetLogger()); bg.GetPatient().Load("StandardMale.xml"); bg.SetupPatient(); - bg.m_Config->EnableRenal(CDM::enumOnOff::On); - bg.m_Config->EnableTissue(CDM::enumOnOff::On); + bg.m_Configuration->EnableRenal(SEOnOff::On); + bg.m_Configuration->EnableTissue(SEOnOff::On); bg.CreateCircuitsAndCompartments(); SEFluidCircuitCalculator fluidCalc(tsSolverSpeed.GetLogger()); SEThermalCircuitCalculator thermalCalc(tsSolverSpeed.GetLogger()); - //Hold the average solving times for each solver - std::vector anesthesiaMachineTimes; - std::vector anesthesiaMachineWithRespTimes; - std::vector respiratoryTimes; - std::vector respiratoryWithInhalerTimes; - std::vector cardiovascularTimes; - std::vector renalTimes; - std::vector internalTempTimes; - std::vector externalTempTimes; - std::vector temperatureTimes; - - //Hold the solving time of Process the first time for each solver - std::vector anesthesiaMachineInitialTime; - std::vector anesthesiaMachineWithRespInitialTime; - std::vector respiratoryInitialTime; - std::vector respiratoryWithInhalerInitialTime; - std::vector cardiovascularInitialTime; - std::vector renalInitialTime; - std::vector internalTempInitialTime; - std::vector externalTempInitialTime; - std::vector temperatureInitialTime; - - //Hold the failure percentage for each solver - std::vector anesthesiaMachineFailureRate; - std::vector anesthesiaMachineWithRespFailureRate; - std::vector respiratoryFailureRate; - std::vector respiratoryWithInhalerFailureRate; - std::vector cardiovascularFailureRate; - std::vector renalFailureRate; - std::vector internalTempFailureRate; - std::vector externalTempFailureRate; - std::vector temperatureFailureRate; - - int numSolves = 50; //How many times we'll solve the circuit (not counting the initial time) to get our averages - - //For each of the solver types - //Direct, PartialPivLu, FullPivLu, JacobiSvd, HouseholderQr, Ldlt, Llt, SparseLU, SparseQR, BiCGSTAB, ConjugateGradient - //Test each circuit and record solving times - EigenCircuitSolver solver; - for (int i = 0; i < EigenCircuitSolver::_size; i++, solver++) { + // Hold the average solving times for each solver + std::map anesthesiaMachineTimes; + std::map anesthesiaMachineWithRespTimes; + std::map respiratoryTimes; + std::map respiratoryWithInhalerTimes; + std::map cardiovascularTimes; + std::map renalTimes; + std::map internalTempTimes; + std::map externalTempTimes; + std::map temperatureTimes; + + // Hold the solving time of Process the first time for each solver + std::map anesthesiaMachineInitialTime; + std::map anesthesiaMachineWithRespInitialTime; + std::map respiratoryInitialTime; + std::map respiratoryWithInhalerInitialTime; + std::map cardiovascularInitialTime; + std::map renalInitialTime; + std::map internalTempInitialTime; + std::map externalTempInitialTime; + std::map temperatureInitialTime; + + // Hold the failure percentage for each solver + std::map anesthesiaMachineFailureRate; + std::map anesthesiaMachineWithRespFailureRate; + std::map respiratoryFailureRate; + std::map respiratoryWithInhalerFailureRate; + std::map cardiovascularFailureRate; + std::map renalFailureRate; + std::map internalTempFailureRate; + std::map externalTempFailureRate; + std::map temperatureFailureRate; + + int numSolves = 50; // How many times we'll solve the circuit (not counting the initial time) to get our averages + + // For each of the solver types + // Direct, PartialPivLu, FullPivLu, JacobiSvd, HouseholderQr, Ldlt, Llt, SparseLU, SparseQR, BiCGSTAB, ConjugateGradient + // Test each circuit and record solving times + + auto SolverTypes = { EigenCircuitSolver::Direct, + EigenCircuitSolver::PartialPivLu, + EigenCircuitSolver::FullPivLu, + EigenCircuitSolver::JacobiSvd, + EigenCircuitSolver::HouseholderQr, + EigenCircuitSolver::Ldlt, + EigenCircuitSolver::Llt, + EigenCircuitSolver::SparseLU, + EigenCircuitSolver::SparseQR, + EigenCircuitSolver::BiCGSTAB }; + for (auto solver : SolverTypes) { bool failed = false; - //Anesthesia Machine alone + // Anesthesia Machine alone SEFluidCircuit* fCircuit = &bg.GetCircuits().GetAnesthesiaMachineCircuit(); - //Set the solver type + // Set the solver type fluidCalc.SetEigenSolver(solver); int numFails = 0; @@ -122,10 +134,10 @@ void BioGearsEngineTest::SolverSpeedTest(const std::string& rptDirectory) timer.Stop("AnesthesiaMachineSolo"); if (!failed) { ss << "Anesthesia circuit initially solved in " << timer.GetElapsedTime("AnesthesiaMachineSolo") << " microseconds, "; - anesthesiaMachineInitialTime.push_back(timer.GetElapsedTime("AnesthesiaMachineSolo")); + anesthesiaMachineInitialTime[solver] = (timer.GetElapsedTime("AnesthesiaMachineSolo")); } else { ss << "Anesthesia circuit failed initially, "; - anesthesiaMachineInitialTime.push_back(INT_MAX); + anesthesiaMachineInitialTime[solver] = (INT_MAX); } std::vector times; @@ -153,13 +165,13 @@ void BioGearsEngineTest::SolverSpeedTest(const std::string& rptDirectory) times.push_back(timer.GetElapsedTime("AnesthesiaMachineSolo")); } - anesthesiaMachineTimes.push_back(vectorAverage(times)); - anesthesiaMachineFailureRate.push_back(100 * numFails / numSolves); - ss << "and over " << numSolves - numFails << "/" << numSolves << " successful solves, took an average of " << anesthesiaMachineTimes.back() << " microseconds with " << solver.string() << " solver."; + anesthesiaMachineTimes[solver] = (vectorAverage(times)); + anesthesiaMachineFailureRate[solver] = (100 * numFails / numSolves); + ss << "and over " << numSolves - numFails << "/" << numSolves << " successful solves, took an average of " << anesthesiaMachineTimes[solver] << " microseconds with " << solver << " solver."; if (showAllOutput) Info(ss); - //Anesthesia Machine with Respiratory + // Anesthesia Machine with Respiratory fCircuit = &bg.GetCircuits().GetRespiratoryAndAnesthesiaMachineCircuit(); numFails = 0; @@ -179,10 +191,10 @@ void BioGearsEngineTest::SolverSpeedTest(const std::string& rptDirectory) timer.Stop("AnesthesiaMachineWithRespiratory"); if (!failed) { ss << "Anesthesia circuit with respiratory initially solved in " << timer.GetElapsedTime("AnesthesiaMachineWithRespiratory") << " microseconds, "; - anesthesiaMachineWithRespInitialTime.push_back(timer.GetElapsedTime("AnesthesiaMachineWithRespiratory")); + anesthesiaMachineWithRespInitialTime[solver] =(timer.GetElapsedTime("AnesthesiaMachineWithRespiratory")); } else { ss << "Anesthesia circuit with respiratory failed initially, "; - anesthesiaMachineWithRespInitialTime.push_back(INT_MAX); + anesthesiaMachineWithRespInitialTime[solver] =(INT_MAX); } times.clear(); @@ -210,13 +222,13 @@ void BioGearsEngineTest::SolverSpeedTest(const std::string& rptDirectory) times.push_back(timer.GetElapsedTime("AnesthesiaMachineWithRespiratory")); } - anesthesiaMachineWithRespTimes.push_back(vectorAverage(times)); - anesthesiaMachineWithRespFailureRate.push_back(100 * numFails / numSolves); - ss << "and over " << numSolves - numFails << "/" << numSolves << " successful solves, took an average of " << anesthesiaMachineWithRespTimes.back() << " microseconds with " << solver.string() << " solver."; + anesthesiaMachineWithRespTimes[solver] =(vectorAverage(times)); + anesthesiaMachineWithRespFailureRate[solver] =(100 * numFails / numSolves); + ss << "and over " << numSolves - numFails << "/" << numSolves << " successful solves, took an average of " << anesthesiaMachineWithRespTimes[solver] << " microseconds with " << solver << " solver."; if (showAllOutput) Info(ss); - //Respiratory Only + // Respiratory Only fCircuit = &bg.GetCircuits().GetRespiratoryCircuit(); numFails = 0; @@ -237,10 +249,10 @@ void BioGearsEngineTest::SolverSpeedTest(const std::string& rptDirectory) timer.Stop("Respiratory"); if (!failed) { ss << "Respiratory circuit initially solved in " << timer.GetElapsedTime("Respiratory") << " microseconds, "; - respiratoryInitialTime.push_back(timer.GetElapsedTime("Respiratory")); + respiratoryInitialTime[solver] =(timer.GetElapsedTime("Respiratory")); } else { ss << "Respiratory circuit failed initially, "; - respiratoryInitialTime.push_back(INT_MAX); + respiratoryInitialTime[solver] =(INT_MAX); } times.clear(); @@ -268,13 +280,13 @@ void BioGearsEngineTest::SolverSpeedTest(const std::string& rptDirectory) times.push_back(timer.GetElapsedTime("Respiratory")); } - respiratoryTimes.push_back(vectorAverage(times)); - respiratoryFailureRate.push_back(100 * numFails / numSolves); - ss << "and over " << numSolves - numFails << "/" << numSolves << " successful solves, took an average of " << respiratoryTimes.back() << " microseconds with " << solver.string() << " solver."; + respiratoryTimes[solver] =(vectorAverage(times)); + respiratoryFailureRate[solver] =(100 * numFails / numSolves); + ss << "and over " << numSolves - numFails << "/" << numSolves << " successful solves, took an average of " << respiratoryTimes[solver] << " microseconds with " << solver << " solver."; if (showAllOutput) Info(ss); - //Respiratory with Inhaler + // Respiratory with Inhaler fCircuit = &bg.GetCircuits().GetRespiratoryAndInhalerCircuit(); numFails = 0; @@ -295,10 +307,10 @@ void BioGearsEngineTest::SolverSpeedTest(const std::string& rptDirectory) timer.Stop("RespiratoryWithInhaler"); if (!failed) { ss << "Respiratory circuit with inhaler initially solved in " << timer.GetElapsedTime("RespiratoryWithInhaler") << " microseconds, "; - respiratoryWithInhalerInitialTime.push_back(timer.GetElapsedTime("RespiratoryWithInhaler")); + respiratoryWithInhalerInitialTime[solver] =(timer.GetElapsedTime("RespiratoryWithInhaler")); } else { ss << "Respiratory circuit with inhaler failed initially, "; - respiratoryWithInhalerInitialTime.push_back(INT_MAX); + respiratoryWithInhalerInitialTime[solver] =(INT_MAX); } times.clear(); @@ -326,13 +338,13 @@ void BioGearsEngineTest::SolverSpeedTest(const std::string& rptDirectory) times.push_back(timer.GetElapsedTime("RespiratoryWithInhaler")); } - respiratoryWithInhalerTimes.push_back(vectorAverage(times)); - respiratoryWithInhalerFailureRate.push_back(100 * numFails / numSolves); - ss << "and over " << numSolves - numFails << "/" << numSolves << " successful solves, took an average of " << respiratoryWithInhalerTimes.back() << " microseconds with " << solver.string() << " solver."; + respiratoryWithInhalerTimes[solver] =(vectorAverage(times)); + respiratoryWithInhalerFailureRate[solver] =(100 * numFails / numSolves); + ss << "and over " << numSolves - numFails << "/" << numSolves << " successful solves, took an average of " << respiratoryWithInhalerTimes[solver] << " microseconds with " << solver << " solver."; if (showAllOutput) Info(ss); - //Cardiovascular + // Cardiovascular fCircuit = &bg.GetCircuits().GetActiveCardiovascularCircuit(); numFails = 0; @@ -352,10 +364,10 @@ void BioGearsEngineTest::SolverSpeedTest(const std::string& rptDirectory) timer.Stop("Cardiovascular"); if (!failed) { ss << "Active CV circuit initially solved in " << timer.GetElapsedTime("Cardiovascular") << " microseconds, "; - cardiovascularInitialTime.push_back(timer.GetElapsedTime("Cardiovascular")); + cardiovascularInitialTime[solver] =(timer.GetElapsedTime("Cardiovascular")); } else { ss << "Active CV circuit failed initially, "; - cardiovascularInitialTime.push_back(INT_MAX); + cardiovascularInitialTime[solver] =(INT_MAX); } times.clear(); @@ -383,13 +395,13 @@ void BioGearsEngineTest::SolverSpeedTest(const std::string& rptDirectory) times.push_back(timer.GetElapsedTime("Cardiovascular")); } - cardiovascularTimes.push_back(vectorAverage(times)); - cardiovascularFailureRate.push_back(100 * numFails / numSolves); - ss << "and over " << numSolves - numFails << "/" << numSolves << " successful solves, took an average of " << cardiovascularTimes.back() << " microseconds with " << solver.string() << " solver."; + cardiovascularTimes[solver] =(vectorAverage(times)); + cardiovascularFailureRate[solver] =(100 * numFails / numSolves); + ss << "and over " << numSolves - numFails << "/" << numSolves << " successful solves, took an average of " << cardiovascularTimes[solver] << " microseconds with " << solver << " solver."; if (showAllOutput) Info(ss); - //Renal + // Renal fCircuit = &bg.GetCircuits().GetRenalCircuit(); numFails = 0; @@ -409,10 +421,10 @@ void BioGearsEngineTest::SolverSpeedTest(const std::string& rptDirectory) timer.Stop("Renal"); if (!failed) { ss << "Renal circuit initially solved in " << timer.GetElapsedTime("Renal") << " microseconds, "; - renalInitialTime.push_back(timer.GetElapsedTime("Renal")); + renalInitialTime[solver] =(timer.GetElapsedTime("Renal")); } else { ss << "Renal circuit failed initially, "; - renalInitialTime.push_back(INT_MAX); + renalInitialTime[solver] =(INT_MAX); } times.clear(); @@ -440,13 +452,13 @@ void BioGearsEngineTest::SolverSpeedTest(const std::string& rptDirectory) times.push_back(timer.GetElapsedTime("Renal")); } - renalTimes.push_back(vectorAverage(times)); - renalFailureRate.push_back(100 * numFails / numSolves); - ss << "and over " << numSolves - numFails << "/" << numSolves << " successful solves, took an average of " << renalTimes.back() << " microseconds with " << solver.string() << " solver."; + renalTimes[solver] =(vectorAverage(times)); + renalFailureRate[solver] =(100 * numFails / numSolves); + ss << "and over " << numSolves - numFails << "/" << numSolves << " successful solves, took an average of " << renalTimes[solver] << " microseconds with " << solver << " solver."; if (showAllOutput) Info(ss); - //Internal Temp + // Internal Temp SEThermalCircuit* tCircuit = &bg.GetCircuits().GetInternalTemperatureCircuit(); thermalCalc.SetEigenSolver(solver); numFails = 0; @@ -467,10 +479,10 @@ void BioGearsEngineTest::SolverSpeedTest(const std::string& rptDirectory) timer.Stop("InternalTemperature"); if (!failed) { ss << "Internal Temperature circuit initially solved in " << timer.GetElapsedTime("InternalTemperature") << " microseconds, "; - internalTempInitialTime.push_back(timer.GetElapsedTime("InternalTemperature")); + internalTempInitialTime[solver] =(timer.GetElapsedTime("InternalTemperature")); } else { ss << "Internal Temperature circuit failed initially, "; - internalTempInitialTime.push_back(INT_MAX); + internalTempInitialTime[solver] =(INT_MAX); } times.clear(); @@ -498,13 +510,13 @@ void BioGearsEngineTest::SolverSpeedTest(const std::string& rptDirectory) times.push_back(timer.GetElapsedTime("InternalTemperature")); } - internalTempTimes.push_back(vectorAverage(times)); - internalTempFailureRate.push_back(100 * numFails / numSolves); - ss << "and over " << numSolves - numFails << "/" << numSolves << " successful solves, took an average of " << internalTempTimes.back() << " microseconds with " << solver.string() << " solver."; + internalTempTimes[solver] =(vectorAverage(times)); + internalTempFailureRate[solver] =(100 * numFails / numSolves); + ss << "and over " << numSolves - numFails << "/" << numSolves << " successful solves, took an average of " << internalTempTimes[solver] << " microseconds with " << solver << " solver."; if (showAllOutput) Info(ss); - //External Temp + // External Temp tCircuit = &bg.GetCircuits().GetExternalTemperatureCircuit(); numFails = 0; @@ -524,10 +536,10 @@ void BioGearsEngineTest::SolverSpeedTest(const std::string& rptDirectory) timer.Stop("ExternalTemperature"); if (!failed) { ss << "External Temperature circuit initially solved in " << timer.GetElapsedTime("ExternalTemperature") << " microseconds, "; - externalTempInitialTime.push_back(timer.GetElapsedTime("ExternalTemperature")); + externalTempInitialTime[solver] =(timer.GetElapsedTime("ExternalTemperature")); } else { ss << "External Temperature circuit failed initially, "; - externalTempInitialTime.push_back(INT_MAX); + externalTempInitialTime[solver] =(INT_MAX); } times.clear(); @@ -555,13 +567,13 @@ void BioGearsEngineTest::SolverSpeedTest(const std::string& rptDirectory) times.push_back(timer.GetElapsedTime("ExternalTemperature")); } - externalTempTimes.push_back(vectorAverage(times)); - externalTempFailureRate.push_back(100 * numFails / numSolves); - ss << "and over " << numSolves - numFails << "/" << numSolves << " successful solves, took an average of " << externalTempTimes.back() << " microseconds with " << solver.string() << " solver."; + externalTempTimes[solver] =(vectorAverage(times)); + externalTempFailureRate[solver] =(100 * numFails / numSolves); + ss << "and over " << numSolves - numFails << "/" << numSolves << " successful solves, took an average of " << externalTempTimes[solver] << " microseconds with " << solver << " solver."; if (showAllOutput) Info(ss); - //Temperature + // Temperature tCircuit = &bg.GetCircuits().GetTemperatureCircuit(); numFails = 0; @@ -581,10 +593,10 @@ void BioGearsEngineTest::SolverSpeedTest(const std::string& rptDirectory) timer.Stop("Temperature"); if (!failed) { ss << "Temperature circuit initially solved in " << timer.GetElapsedTime("Temperature") << " microseconds, "; - temperatureInitialTime.push_back(timer.GetElapsedTime("Temperature")); + temperatureInitialTime[solver] =(timer.GetElapsedTime("Temperature")); } else { ss << "Temperature circuit failed initially, "; - temperatureInitialTime.push_back(INT_MAX); + temperatureInitialTime[solver] =(INT_MAX); } times.clear(); @@ -612,53 +624,53 @@ void BioGearsEngineTest::SolverSpeedTest(const std::string& rptDirectory) times.push_back(timer.GetElapsedTime("Temperature")); } - temperatureTimes.push_back(vectorAverage(times)); - temperatureFailureRate.push_back(100 * numFails / numSolves); - ss << "and over " << numSolves - numFails << "/" << numSolves << " successful solves, took an average of " << temperatureTimes.back() << " microseconds with " << solver.string() << " solver."; + temperatureTimes[solver] =(vectorAverage(times)); + temperatureFailureRate[solver] =(100 * numFails / numSolves); + ss << "and over " << numSolves - numFails << "/" << numSolves << " successful solves, took an average of " << temperatureTimes[solver] << " microseconds with " << solver << " solver."; if (showAllOutput) Info(ss); } - //Now find the quickest time for each circuit - int minAnesthesiaMachineIndex, minAMWithRespIndex, minRespiratoryIndex, minRespWithInhalerIndex, minCVIndex, minRenalIndex, minInternalIndex, minExternalIndex, minTempIndex; - minAnesthesiaMachineIndex = minAMWithRespIndex = minRespiratoryIndex = minRespWithInhalerIndex = minCVIndex = minRenalIndex = minInternalIndex = minExternalIndex = minTempIndex = 0; - - for (int i = 0; i < EigenCircuitSolver::_size; i++) { - minAnesthesiaMachineIndex = anesthesiaMachineTimes.at(i) < anesthesiaMachineTimes.at(minAnesthesiaMachineIndex) ? i : minAnesthesiaMachineIndex; - minAMWithRespIndex = anesthesiaMachineWithRespTimes.at(i) < anesthesiaMachineWithRespTimes.at(minAMWithRespIndex) ? i : minAMWithRespIndex; - minRespiratoryIndex = respiratoryTimes.at(i) < respiratoryTimes.at(minRespiratoryIndex) ? i : minRespiratoryIndex; - minRespWithInhalerIndex = respiratoryWithInhalerTimes.at(i) < respiratoryWithInhalerTimes.at(minRespWithInhalerIndex) ? i : minRespWithInhalerIndex; - minCVIndex = cardiovascularTimes.at(i) < cardiovascularTimes.at(minCVIndex) ? i : minCVIndex; - minRenalIndex = renalTimes.at(i) < renalTimes.at(minRenalIndex) ? i : minRenalIndex; - minInternalIndex = internalTempTimes.at(i) < internalTempTimes.at(minInternalIndex) ? i : minInternalIndex; - minExternalIndex = externalTempTimes.at(i) < externalTempTimes.at(minExternalIndex) ? i : minExternalIndex; - minTempIndex = temperatureTimes.at(i) < temperatureTimes.at(minTempIndex) ? i : minTempIndex; + // Now find the quickest time for each circuit + EigenCircuitSolver::Type minAnesthesiaMachineIndex, minAMWithRespIndex, minRespiratoryIndex, minRespWithInhalerIndex, minCVIndex, minRenalIndex, minInternalIndex, minExternalIndex, minTempIndex; + minAnesthesiaMachineIndex = minAMWithRespIndex = minRespiratoryIndex = minRespWithInhalerIndex = minCVIndex = minRenalIndex = minInternalIndex = minExternalIndex = minTempIndex = EigenCircuitSolver::PartialPivLu; + + for (auto solver : SolverTypes) { + minAnesthesiaMachineIndex = anesthesiaMachineTimes[solver] < anesthesiaMachineTimes[minAnesthesiaMachineIndex] ? solver : minAnesthesiaMachineIndex; + minAMWithRespIndex = anesthesiaMachineWithRespTimes[solver] < anesthesiaMachineWithRespTimes[minAMWithRespIndex] ? solver : minAMWithRespIndex; + minRespiratoryIndex = respiratoryTimes[solver] < respiratoryTimes[minRespiratoryIndex] ? solver : minRespiratoryIndex; + minRespWithInhalerIndex = respiratoryWithInhalerTimes[solver] < respiratoryWithInhalerTimes[minRespWithInhalerIndex] ? solver : minRespWithInhalerIndex; + minCVIndex = cardiovascularTimes[solver] < cardiovascularTimes[minCVIndex] ? solver : minCVIndex; + minRenalIndex = renalTimes[solver] < renalTimes[minRenalIndex] ? solver : minRenalIndex; + minInternalIndex = internalTempTimes[solver] < internalTempTimes[minInternalIndex] ? solver : minInternalIndex; + minExternalIndex = externalTempTimes[solver] < externalTempTimes[minExternalIndex] ? solver : minExternalIndex; + minTempIndex = temperatureTimes[solver] < temperatureTimes[minTempIndex] ? solver : minTempIndex; } - //Output - //This just goes to the log for now + // Output + // This just goes to the log for now ss.str(""); ss.clear(); - ss << "The quickest solver for the Anesthesia Machine circuit was " << EigenCircuitSolver::Value(minAnesthesiaMachineIndex) << " at an average of " << anesthesiaMachineTimes.at(minAnesthesiaMachineIndex) << " microseconds and a failure rate of " << anesthesiaMachineFailureRate.at(minAnesthesiaMachineIndex) << "%."; + ss << "The quickest solver for the Anesthesia Machine circuit was " << EigenCircuitSolver::Value(minAnesthesiaMachineIndex) << " at an average of " << anesthesiaMachineTimes[minAnesthesiaMachineIndex] << " microseconds and a failure rate of " << anesthesiaMachineFailureRate[minAnesthesiaMachineIndex] << "%."; Info(ss); - ss << "The quickest solver for the Anesthesia Machine plus Respiratory circuit was " << EigenCircuitSolver::Value(minAMWithRespIndex) << " at an average of " << anesthesiaMachineWithRespTimes.at(minAMWithRespIndex) << " microseconds and a failure rate of " << anesthesiaMachineWithRespFailureRate.at(minAMWithRespIndex) << "%."; + ss << "The quickest solver for the Anesthesia Machine plus Respiratory circuit was " << EigenCircuitSolver::Value(minAMWithRespIndex) << " at an average of " << anesthesiaMachineWithRespTimes[minAMWithRespIndex] << " microseconds and a failure rate of " << anesthesiaMachineWithRespFailureRate[minAMWithRespIndex] << "%."; Info(ss); - ss << "The quickest solver for the Respiratory circuit was " << EigenCircuitSolver::Value(minRespiratoryIndex) << " at an average of " << respiratoryTimes.at(minRespiratoryIndex) << " microseconds and a failure rate of " << respiratoryFailureRate.at(minRespiratoryIndex) << "%."; + ss << "The quickest solver for the Respiratory circuit was " << EigenCircuitSolver::Value(minRespiratoryIndex) << " at an average of " << respiratoryTimes[minRespiratoryIndex] << " microseconds and a failure rate of " << respiratoryFailureRate[minRespiratoryIndex] << "%."; Info(ss); - ss << "The quickest solver for the Respiratory plus Inhaler circuit was " << EigenCircuitSolver::Value(minRespWithInhalerIndex) << " at an average of " << respiratoryWithInhalerTimes.at(minRespWithInhalerIndex) << " microseconds and a failure rate of " << respiratoryWithInhalerFailureRate.at(minRespWithInhalerIndex) << "%."; + ss << "The quickest solver for the Respiratory plus Inhaler circuit was " << EigenCircuitSolver::Value(minRespWithInhalerIndex) << " at an average of " << respiratoryWithInhalerTimes[minRespWithInhalerIndex] << " microseconds and a failure rate of " << respiratoryWithInhalerFailureRate[minRespWithInhalerIndex] << "%."; Info(ss); - ss << "The quickest solver for the active CV circuit was " << EigenCircuitSolver::Value(minCVIndex) << " at an average of " << cardiovascularTimes.at(minCVIndex) << " microseconds and a failure rate of " << cardiovascularFailureRate.at(minCVIndex) << "%."; + ss << "The quickest solver for the active CV circuit was " << EigenCircuitSolver::Value(minCVIndex) << " at an average of " << cardiovascularTimes[minCVIndex] << " microseconds and a failure rate of " << cardiovascularFailureRate[minCVIndex] << "%."; Info(ss); - ss << "The quickest solver for the Renal circuit was " << EigenCircuitSolver::Value(minRenalIndex) << " at an average of " << renalTimes.at(minRenalIndex) << " microseconds and a failure rate of " << renalFailureRate.at(minRenalIndex) << "%."; + ss << "The quickest solver for the Renal circuit was " << EigenCircuitSolver::Value(minRenalIndex) << " at an average of " << renalTimes[minRenalIndex] << " microseconds and a failure rate of " << renalFailureRate[minRenalIndex] << "%."; Info(ss); - ss << "The quickest solver for the Internal Temperature circuit was " << EigenCircuitSolver::Value(minInternalIndex) << " at an average of " << internalTempTimes.at(minInternalIndex) << " microseconds and a failure rate of " << internalTempFailureRate.at(minInternalIndex) << "%."; + ss << "The quickest solver for the Internal Temperature circuit was " << EigenCircuitSolver::Value(minInternalIndex) << " at an average of " << internalTempTimes[minInternalIndex] << " microseconds and a failure rate of " << internalTempFailureRate[minInternalIndex] << "%."; Info(ss); - ss << "The quickest solver for the External Temperature circuit was " << EigenCircuitSolver::Value(minExternalIndex) << " at an average of " << externalTempTimes.at(minExternalIndex) << " microseconds and a failure rate of " << externalTempFailureRate.at(minExternalIndex) << "%."; + ss << "The quickest solver for the External Temperature circuit was " << EigenCircuitSolver::Value(minExternalIndex) << " at an average of " << externalTempTimes[minExternalIndex] << " microseconds and a failure rate of " << externalTempFailureRate[minExternalIndex] << "%."; Info(ss); - ss << "The quickest solver for the combined Temperature circuit was " << EigenCircuitSolver::Value(minTempIndex) << " at an average of " << temperatureTimes.at(minTempIndex) << " microseconds and a failure rate of " << temperatureFailureRate.at(minTempIndex) << "%."; + ss << "The quickest solver for the combined Temperature circuit was " << EigenCircuitSolver::Value(minTempIndex) << " at an average of " << temperatureTimes[minTempIndex] << " microseconds and a failure rate of " << temperatureFailureRate[minTempIndex] << "%."; Info(ss); - //What should we write out in the report and/or Track? - //testReport.WriteFile(rptDirectory + "/SolverSpeedTest.xml"); + // What should we write out in the report and/or Track? + // testReport.WriteFile(rptDirectory + "/SolverSpeedTest.xml"); } } \ No newline at end of file diff --git a/projects/biogears/libCircuitTest/src/Substances/SubstanceTransport.cpp b/projects/biogears/libCircuitTest/src/Substances/SubstanceTransport.cpp index e65e8a3f7..481d6fda2 100644 --- a/projects/biogears/libCircuitTest/src/Substances/SubstanceTransport.cpp +++ b/projects/biogears/libCircuitTest/src/Substances/SubstanceTransport.cpp @@ -130,8 +130,8 @@ void CommonDataModelTest::LargeFlowTransportTest(const std::string& sTestDirecto } } file.close(); - outTrk.Clear(); - m_Circuits.Clear(); + outTrk.Invalidate(); + m_Circuits.Invalidate(); } else { m_Logger->Error("Unable to Load BioGears Substances!"); } @@ -307,8 +307,8 @@ void CommonDataModelTest::LiquidTransportTest(const std::string& rptDirectory) time += deltaT_s; } file.close(); - outTrk.Clear(); - m_Circuits.Clear(); + outTrk.Invalidate(); + m_Circuits.Invalidate(); } else { m_Logger->Error("Unable to Load BioGears Substances!"); } @@ -484,8 +484,8 @@ void CommonDataModelTest::GasTransportTest(const std::string& rptDirectory) time += deltaT_s; } file.close(); - outTrk.Clear(); - m_Circuits.Clear(); + outTrk.Invalidate(); + m_Circuits.Invalidate(); } else { m_Logger->Error("Unable to Load BioGears Substances!"); } diff --git a/projects/biogears/swig_bindings/bindings/biogears/cdm/patient/actions/SEFracture.swg b/projects/biogears/swig_bindings/bindings/biogears/cdm/patient/actions/SEFracture.swg new file mode 100644 index 000000000..78d4109fe --- /dev/null +++ b/projects/biogears/swig_bindings/bindings/biogears/cdm/patient/actions/SEFracture.swg @@ -0,0 +1,18 @@ + + +%{ +#include +%} + +%import +%import +%import +%import +%import + +%nspace biogears::SEFracture; + +%ignore biogears::SEFracture::Unload; +%ignore biogears::SEFracture::Load; + +%include diff --git a/projects/biogears/swig_bindings/csharp/CMakeLists.txt b/projects/biogears/swig_bindings/csharp/CMakeLists.txt index 17d3bc4f6..260a61740 100644 --- a/projects/biogears/swig_bindings/csharp/CMakeLists.txt +++ b/projects/biogears/swig_bindings/csharp/CMakeLists.txt @@ -40,7 +40,7 @@ if(SWIG_csharp_FOUND AND Biogears_SWIG_CSHARP_BINDINGS) set_target_properties(biogears_csharp PROPERTIES POSITION_INDEPENDENT_CODE ON FOLDER Libraries - CXX_STANDARD 14 + CXX_STANDARD 20 ) get_property(support_files TARGET biogears_csharp PROPERTY SWIG_SUPPORT_FILES) diff --git a/projects/circuit_profiler/CMakeLists.txt b/projects/circuit_profiler/CMakeLists.txt index c5ac0a8a1..48b4259f9 100644 --- a/projects/circuit_profiler/CMakeLists.txt +++ b/projects/circuit_profiler/CMakeLists.txt @@ -73,7 +73,7 @@ set_target_properties(circuit_profiler COMPILE_PDB_NAME "circuit_profiler" PROJECT_LABEL "circuit_profiler" DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}" - CXX_STANDARD 14 + CXX_STANDARD 20 VS_DEBUGGER_WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/runtime VS_DEBUGGER_ENVIRONMENT "${VS_DEBUGGER_ENVIRONMENT_LIST}" diff --git a/projects/circuit_profiler/src/BioGearsCircuitProfiler.h b/projects/circuit_profiler/src/BioGearsCircuitProfiler.h index 690a155d5..a6fcda07a 100644 --- a/projects/circuit_profiler/src/BioGearsCircuitProfiler.h +++ b/projects/circuit_profiler/src/BioGearsCircuitProfiler.h @@ -2,7 +2,6 @@ #include #include -#include #include diff --git a/projects/circuit_profiler/src/circuit_tester/circuit_tester.h b/projects/circuit_profiler/src/circuit_tester/circuit_tester.h index 5ec83d218..6a5da2e2a 100644 --- a/projects/circuit_profiler/src/circuit_tester/circuit_tester.h +++ b/projects/circuit_profiler/src/circuit_tester/circuit_tester.h @@ -258,15 +258,15 @@ void FluidCircuitTester::TestPreProcess1(double dT, int i) if (SWITCHPRESENT) { if (i == 8 || i == 34 || i == 19) { if (dT < 5) { - m_Circuits->GetFluidPath("Path2")->SetNextSwitch(CDM::enumOpenClosed::Open); + m_Circuits->GetFluidPath("Path2")->SetNextSwitch(SEOpenClosed::Open); } else { - m_Circuits->GetFluidPath("Path2")->SetNextSwitch(CDM::enumOpenClosed::Closed); + m_Circuits->GetFluidPath("Path2")->SetNextSwitch(SEOpenClosed::Closed); } } else if (i == 9 || i == 15) { if (dT < 5) { - m_Circuits->GetFluidPath("Path3")->SetNextSwitch(CDM::enumOpenClosed::Open); + m_Circuits->GetFluidPath("Path3")->SetNextSwitch(SEOpenClosed::Open); } else { - m_Circuits->GetFluidPath("Path3")->SetNextSwitch(CDM::enumOpenClosed::Closed); + m_Circuits->GetFluidPath("Path3")->SetNextSwitch(SEOpenClosed::Closed); } } } @@ -327,15 +327,15 @@ void FluidCircuitTester::TestPreProcess2(double dT, int i) if (SWITCHPRESENT) { if (i == 8 || i == 34 || i == 19) { if (dT < 5) { - m_Circuits->GetFluidPath("Path2")->SetNextSwitch(CDM::enumOpenClosed::Open); + m_Circuits->GetFluidPath("Path2")->SetNextSwitch(SEOpenClosed::Open); } else { - m_Circuits->GetFluidPath("Path2")->SetNextSwitch(CDM::enumOpenClosed::Closed); + m_Circuits->GetFluidPath("Path2")->SetNextSwitch(SEOpenClosed::Closed); } } else if (i == 9 || i == 15) { if (dT < 5) { - m_Circuits->GetFluidPath("Path3")->SetNextSwitch(CDM::enumOpenClosed::Open); + m_Circuits->GetFluidPath("Path3")->SetNextSwitch(SEOpenClosed::Open); } else { - m_Circuits->GetFluidPath("Path3")->SetNextSwitch(CDM::enumOpenClosed::Closed); + m_Circuits->GetFluidPath("Path3")->SetNextSwitch(SEOpenClosed::Closed); } } } @@ -427,15 +427,15 @@ void FluidCircuitTester::TestPreProcess3(double dT, int i) if (SWITCHPRESENT) { if (i == 8 || i == 34 || i == 19) { if (dT < 5) { - m_Circuits->GetFluidPath("Path2")->SetNextSwitch(CDM::enumOpenClosed::Open); + m_Circuits->GetFluidPath("Path2")->SetNextSwitch(SEOpenClosed::Open); } else { - m_Circuits->GetFluidPath("Path2")->SetNextSwitch(CDM::enumOpenClosed::Closed); + m_Circuits->GetFluidPath("Path2")->SetNextSwitch(SEOpenClosed::Closed); } } else if (i == 9 || i == 15) { if (dT < 5) { - m_Circuits->GetFluidPath("Path3")->SetNextSwitch(CDM::enumOpenClosed::Open); + m_Circuits->GetFluidPath("Path3")->SetNextSwitch(SEOpenClosed::Open); } else { - m_Circuits->GetFluidPath("Path3")->SetNextSwitch(CDM::enumOpenClosed::Closed); + m_Circuits->GetFluidPath("Path3")->SetNextSwitch(SEOpenClosed::Closed); } } } @@ -503,15 +503,15 @@ void FluidCircuitTester::TestPreProcess4(double dT, int i) if (SWITCHPRESENT) { if (i == 8 || i == 34) { if (dT < 5) { - m_Circuits->GetFluidPath("Path2")->SetNextSwitch(CDM::enumOpenClosed::Open); + m_Circuits->GetFluidPath("Path2")->SetNextSwitch(SEOpenClosed::Open); } else { - m_Circuits->GetFluidPath("Path2")->SetNextSwitch(CDM::enumOpenClosed::Closed); + m_Circuits->GetFluidPath("Path2")->SetNextSwitch(SEOpenClosed::Closed); } } else if (i == 9 || i == 15) { if (dT < 5) { - m_Circuits->GetFluidPath("Path3")->SetNextSwitch(CDM::enumOpenClosed::Open); + m_Circuits->GetFluidPath("Path3")->SetNextSwitch(SEOpenClosed::Open); } else { - m_Circuits->GetFluidPath("Path3")->SetNextSwitch(CDM::enumOpenClosed::Closed); + m_Circuits->GetFluidPath("Path3")->SetNextSwitch(SEOpenClosed::Closed); } } } @@ -705,6 +705,6 @@ void FluidCircuitTester::ParallelRLCDCTest() //7 Path3.GetNextCompliance().SetValue(0.001, biogears::FlowComplianceUnit::m3_Per_Pa); Path3.GetSourceNode().GetNextVolume().SetValue(5, biogears::VolumeUnit::m3); biogears::SEFluidCircuitPath& Path4 = fluidCircuit.CreatePath(Node3, Node2, "Path4"); - Path4.SetNextValve(CDM::enumOpenClosed::Closed); + Path4.SetNextValve(SEOpenClosed::Closed); RunDCTest("BasicDiodeDCCurrent", 18); } \ No newline at end of file diff --git a/projects/cli/bg-cli-main.cpp b/projects/cli/bg-cli-main.cpp index 9eaddf092..bfb65fd6a 100644 --- a/projects/cli/bg-cli-main.cpp +++ b/projects/cli/bg-cli-main.cpp @@ -91,8 +91,8 @@ void print_help(int rc) std::cout << "\n patient : Equivilant to bg-cli CONFIG config/ValidationPatient.config"; std::cout << "\n drug : Equivilant to bg-cli CONFIG config/ValidationDrug.config"; std::cout << "\n system : Equivilant to bg-cli CONFIG config/ValidationSystem.config"; + std::cout << "\n scenario : Equivilant to bg-cli CONFIG config/VerificationScenarios.config"; std::cout << "\n all : Equivilant to bg-cli VALIDATE patient drug system VERIFY"; - std::cout << "\nVerify : Equivilant to bg-cli CONFIG config/VerificatioNScenarios.config"; std::cout << "\nTest : Runs a series of predetermined unit test and generates ar report"; std::cout << "\n cdm : Equivilant to bg-cli CONFIG config/CDMUnitTest.config"; std::cout << "\n bge : Equivilant to bg-cli CONFIG config/BGEUnitTest.config"; @@ -121,9 +121,7 @@ bool genRuntime(std::string pathName) // This function parses the multword value list of a GENERATE // keyword and proeprly queues the correct operations needed to process // the command -void parse_generate_arguments - - (biogears::Arguments::MultiwordValue&& args) +void parse_generate_arguments (biogears::Arguments::MultiwordValue&& args) { auto is_keyword = [](const std::string& v) { return v == "data" || v == "population" || v == "scenarios" @@ -401,6 +399,8 @@ int main(int argc, char** argv) g_run_drug_validation = true; } else if (test == "system") { g_run_system_validation = true; + } else if (test == "ver") { + g_run_verification_routine = true; } else if (test == "all") { g_run_patient_validation = g_run_drug_validation = g_run_system_validation = g_run_verification_routine = true; } else if (test == "custom") { diff --git a/projects/cli/bg-scenario-main.cpp b/projects/cli/bg-scenario-main.cpp index 4052b0c1b..59ade4591 100644 --- a/projects/cli/bg-scenario-main.cpp +++ b/projects/cli/bg-scenario-main.cpp @@ -19,7 +19,6 @@ #include "exec/Driver.h" #include "utils/Executor.h" -#include #include #include #include @@ -114,19 +113,15 @@ int execute_scenario(Executor& ex, Logger::LogLevel log_level) return static_cast(ExecutionErrors::SCENARIO_IO_ERROR); } using biogears::filesystem::path; - using mil::tatrc::physiology::datamodel::ScenarioData; - std::unique_ptr scenario; + auto scenario = std::make_unique(eng->GetSubstanceManager()); try { std::cout << "Reading " << ex.Scenario() << std::endl; - auto obj = biogears::Serializer::ReadFile(resolved_filepath, - eng->GetLogger()); - scenario.reset(reinterpret_cast(obj.release())); + scenario->Load(resolved_filepath); + if (scenario == nullptr) { throw std::runtime_error("Unable to load " + ex.Scenario()); } - if (scenario->Actions().RandomSeed().present()) { - std::cout << "Using seed=" << scenario->Actions().RandomSeed() << std::endl; - } + } catch (std::runtime_error e) { std::cout << e.what() << std::endl; return static_cast(ExecutionErrors::SCENARIO_PARSE_ERROR); @@ -134,15 +129,14 @@ int execute_scenario(Executor& ex, Logger::LogLevel log_level) std::cout << e << std::endl; return static_cast(ExecutionErrors::SCENARIO_PARSE_ERROR); } - biogears::SEPatient patient { sce.GetLogger() }; - if (scenario->EngineStateFile().present()) { - sce.SetEngineStateFile(scenario->EngineStateFile().get()); - } else if (scenario->InitialParameters()->PatientFile().present()) { - sce.GetInitialParameters().SetPatientFile(scenario->InitialParameters()->PatientFile().get()); - } else if (scenario->InitialParameters()->Patient().present()) { - ex.Patient(scenario->InitialParameters()->Patient().get().Name()); - patient.Load(scenario->InitialParameters()->Patient().get()); - sce.GetInitialParameters().SetPatient(patient); + + if (scenario->HasEngineStateFile()) { + sce.SetEngineStateFile(scenario->GetEngineStateFile()); + } else if (scenario->HasInitialParameters() && scenario->GetInitialParameters().HasPatientFile()) { + sce.GetInitialParameters().SetPatientFile(scenario->GetInitialParameters().GetPatientFile()); + } else if (scenario->HasInitialParameters() && scenario->GetInitialParameters().HasPatient()) { + ex.Patient(scenario->GetInitialParameters().GetPatient().GetName()); + sce.GetInitialParameters().SetPatient(scenario->GetInitialParameters().GetPatient()); } else { std::cerr << "A Patient or State file is required to run " << ex.Scenario() << std::endl; return static_cast(ExecutionErrors::PATIENT_IO_ERROR); diff --git a/projects/cli/src/data/PatientGenerator.cpp b/projects/cli/src/data/PatientGenerator.cpp index 696840d92..b3d68aeb6 100644 --- a/projects/cli/src/data/PatientGenerator.cpp +++ b/projects/cli/src/data/PatientGenerator.cpp @@ -148,24 +148,24 @@ bool PatientGenerator::process(const std::string& name, const std::string& value } catch (std::exception e) { rValue = false; } - } else if ("RightLungFraction" == name) { - PatientData::RightLungRatio_type rlr_data; - try { - rlr_data.value(std::stod(value)); - patient.RightLungRatio(rlr_data); - } catch (std::exception e) { - rValue = false; - } - } else if ("SkinSurfaceArea" == name) { - size_t pos; - PatientData::SkinSurfaceArea_type ssa_data; - try { - ssa_data.value(std::stod(value, &pos)); - ssa_data.unit(biogears::trim(value.substr(pos))); - patient.SkinSurfaceArea(ssa_data); - } catch (std::exception e) { - rValue = false; - } + //} else if ("RightLungFraction" == name) { + // PatientData::RightLungRatio_type rlr_data; + // try { + // rlr_data.value(std::stod(value)); + // patient.RightLungRatio(rlr_data); + // } catch (std::exception e) { + // rValue = false; + // } + //} else if ("SkinSurfaceArea" == name) { + // size_t pos; + // PatientData::SkinSurfaceArea_type ssa_data; + // try { + // ssa_data.value(std::stod(value, &pos)); + // ssa_data.unit(biogears::trim(value.substr(pos))); + // patient.SkinSurfaceArea(ssa_data); + // } catch (std::exception e) { + // rValue = false; + // } } else if ("BasalMetabolicRate" == name) { size_t pos; PatientData::BasalMetabolicRate_type bmr_data; diff --git a/projects/cli/src/exec/Driver.cpp b/projects/cli/src/exec/Driver.cpp index 3cdcae7a9..77272b893 100644 --- a/projects/cli/src/exec/Driver.cpp +++ b/projects/cli/src/exec/Driver.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #if defined(BIOGEARS_SUBPROCESS_SUPPORT) #define WIN32_LEAN_AND_MEAN @@ -30,13 +31,13 @@ #include "../utils/Executor.h" -#include #include #include #include #include #include #include +#include #include #include @@ -59,6 +60,8 @@ #include #include + + #if defined(BIOGEARS_SUBPROCESS_SUPPORT) inline std::string fmt_localtime() { @@ -99,6 +102,7 @@ Driver::Driver(char* exe_name, size_t thread_count) , _thread_count(0) , _process_count(0) , _total_work(0) + , _content_buffer(5 * 1024 * 1024,'\0') { biogears::filesystem::path p { exe_name }; _relative_path = p.parent_path(); @@ -302,14 +306,35 @@ void Driver::queue_Scenario(Executor exec, bool as_subprocess) std::cerr << "Failed to open Scenarios/" << exec.Scenario() << " skipping\n"; return; } - obj = Serializer::ReadBuffer((XMLByte*)content, content_size, &logger); + + auto xmlObj = biogears::Serializer::ReadBuffer((XMLByte*)content, content_size, &logger); + if (dynamic_cast(xmlObj.get())) { + scenario = std::unique_ptr(dynamic_cast(xmlObj.release())); + } + else { + std::cerr << exec.Scenario() << " did not contain a valid CDM::ScenarioData file\n"; + return; + } + #endif } else { std::cout << "Reading " << exec.Scenario() << std::endl; - obj = Serializer::ReadFile(resolved_filepath, - &logger); + size_t content_size = 0; + memset(&_content_buffer.front(), '\0', 5 * 1024 * 1024); + + content_size = io.read_resource_file(resolved_filepath.ToString().c_str(), &_content_buffer.front(), 5 * 1024 * 1024); + if (content_size == 0) { + std::cerr << "Failed to open Scenarios/" << exec.Scenario() << " skipping\n"; + return; + } + + std::istringstream is = std::istringstream(std::string(&_content_buffer.front(), content_size)); + ::xml_schema::properties properties; + properties.schema_location("uri:/mil/tatrc/physiology/datamodel", "xsd/BioGearsDataModel.xsd"); + properties.no_namespace_schema_location(); + scenario = CDM::Scenario(is, 0, properties); } - scenario.reset(reinterpret_cast(obj.release())); + if (scenario == nullptr) { throw std::runtime_error(exec.Scenario() + " is not a valid Scenario file."); } @@ -410,6 +435,7 @@ void Driver::queue_Scenario(Executor exec, bool as_subprocess) return; } } + //Historically biogears auto falls back on a assumed directory structure //If the given exist in patients/ and is a directory we will treat it as //if ALL was given but for the provided directory @@ -754,12 +780,27 @@ void Driver::async_execute(biogears::Executor& ex, bool multi_patient_run) } scenario_stream.close(); - auto split_scenario_path = filesystem::path(trimed_scenario_path); - auto scenario_no_extension = split(split_scenario_path.back(), '.').front(); + std::string patient_no_extension = ""; + std::string scenario_no_extension = ""; + filesystem::path split_scenario_path = ""; + + if (ex.State().size()) { + split_scenario_path = filesystem::path(trimed_scenario_path); + scenario_no_extension = split(split_scenario_path.back(), '.').front(); + + std::string trimed_patient_path(trim(ex.State())); + auto split_patient_path = filesystem::path(trimed_patient_path); + patient_no_extension = split(split_patient_path.back(), '.').front(); + } + + if (ex.Patient().size()) { + split_scenario_path = filesystem::path(trimed_scenario_path); + scenario_no_extension = split(split_scenario_path.back(), '.').front(); - std::string trimed_patient_path(trim(ex.Patient())); - auto split_patient_path = filesystem::path(trimed_patient_path); - auto patient_no_extension = split(split_patient_path.back(), '.').front(); + std::string trimed_patient_path(trim(ex.Patient())); + auto split_patient_path = filesystem::path(trimed_patient_path); + patient_no_extension = split(split_patient_path.back(), '.').front(); + } // NOTE: This loses non relative prefixes as the split will eat the leading path_separator filesystem::path parent_dir = split_scenario_path.parent_path(); @@ -768,7 +809,7 @@ void Driver::async_execute(biogears::Executor& ex, bool multi_patient_run) // ex.Name(ex.Name() + "-" + patient_no_extension); // } - std::string base_file_name = (multi_patient_run) ? scenario_no_extension + "-" + patient_no_extension : scenario_no_extension; + std::string base_file_name = (multi_patient_run && patient_no_extension.size() ) ? scenario_no_extension + "-" + patient_no_extension : scenario_no_extension; std::string console_file = base_file_name + ".log"; std::string log_file = base_file_name + "Results.log"; std::string results_file = base_file_name + "Results.csv"; @@ -779,14 +820,15 @@ void Driver::async_execute(biogears::Executor& ex, bool multi_patient_run) ex.Computed(""); } filesystem::path logfilepath = filesystem::path(ex.Computed()) / parent_dir / console_file; - Logger file_logger(logfilepath); + try { - file_logger.SetConsoleLogLevel(Logger::eWarning); - file_logger.SetConsoleConversionPattern("[{%H:%M}] " + ex.Name() + " <:priority:> :message::endline:"); + console_logger.SetConsoleConversionPattern("[{%H:%M}] :message::endline:"); console_logger.FormatMessages(true); - eng = std::make_unique(&file_logger); + eng = std::make_unique(logfilepath); + eng->GetLogger()->SetConsoleLogLevel(Logger::eWarning); + eng->GetLogger()->SetConsoleConversionPattern("[{%H:%M}] " + ex.Name() + " <:priority:> :message::endline:"); } catch (std::exception e) { std::cout << e.what(); _thread_count -= 1; @@ -805,7 +847,11 @@ void Driver::async_execute(biogears::Executor& ex, bool multi_patient_run) if (!ex.Patient().empty()) { sce.GetInitialParameters().SetPatientFile(ex.Patient()); - } else if (!ex.Scenario().empty()) { + } + else if (!ex.State().empty()) { + sce.SetEngineStateFile(ex.State()); + } + else if (!ex.Scenario().empty()) { sce.GetInitialParameters().SetPatientFile(ex.Scenario()); } else { auto logger = eng->GetLogger(); @@ -818,19 +864,14 @@ void Driver::async_execute(biogears::Executor& ex, bool multi_patient_run) return; } using biogears::filesystem::path; - using mil::tatrc::physiology::datamodel::ScenarioData; - std::unique_ptr scenario; + auto scenario = std::make_unique(eng->GetSubstanceManager()); try { std::cout << "Reading " << ex.Scenario() << std::endl; - auto obj = Serializer::ReadFile(resolved_filepath, - eng->GetLogger()); - scenario.reset(reinterpret_cast(obj.release())); + scenario->Load(resolved_filepath); + if (scenario == nullptr) { throw std::runtime_error(ex.Scenario() + " is not a valid Scenario file."); } - if (scenario->Actions().RandomSeed().present()) { - std::cout << "Using seed=" << scenario->Actions().RandomSeed() << std::endl; - } } catch (std::runtime_error e) { std::cout << "Error while processing " << ex.Scenario() << "\n"; std::cout << e.what() << "\n" @@ -847,10 +888,9 @@ void Driver::async_execute(biogears::Executor& ex, bool multi_patient_run) return; } - biogears::SEPatient patient { sce.GetLogger() }; - ex.Patient(scenario->InitialParameters()->Patient().get().Name()); - patient.Load(scenario->InitialParameters()->Patient().get()); - sce.GetInitialParameters().SetPatient(patient); + + ex.Patient(scenario->GetInitialParameters().GetPatient().GetName()); + sce.GetInitialParameters().SetPatient(scenario->GetInitialParameters().GetPatient()); } console_logger.Info("Starting " + ex.Name()); diff --git a/projects/cli/src/exec/Driver.h b/projects/cli/src/exec/Driver.h index 10e5fc034..35a8bf9ff 100644 --- a/projects/cli/src/exec/Driver.h +++ b/projects/cli/src/exec/Driver.h @@ -68,6 +68,8 @@ class Driver : biogears::Runnable { std::atomic _process_count; size_t _total_work; size_t _jobs; + + std::vector _content_buffer; }; } //namespace biogears diff --git a/projects/cli/src/exec/PopulationGenerator.cpp b/projects/cli/src/exec/PopulationGenerator.cpp index ccfc1f9cf..447f316a2 100644 --- a/projects/cli/src/exec/PopulationGenerator.cpp +++ b/projects/cli/src/exec/PopulationGenerator.cpp @@ -33,7 +33,14 @@ #include #include #include +#include + +#ifdef WIN32 +#include +#endif + +#include #include namespace mil { @@ -89,7 +96,7 @@ std::pair, std::string> find_best_match(std::set, std::string> find_best_match(std::set, std::string> find_best_match(std::set, std::string> find_best_match(std::set, std::string> find_best_match(std::set, std::string> find_best_match(std::set, std::string> find_best_match(std::set key, DistributionCollection // when the user gives a bad min and max std::chrono::steady_clock::time_point begin = std::chrono::steady_clock::now(); std::chrono::steady_clock::time_point now = begin; - while (roll_value < min_value || roll_value > max_value && std::chrono::duration_cast(now - begin).count() < 1) { + while (roll_value < min_value || (roll_value > max_value && std::chrono::duration_cast(now - begin).count() < 1)) { roll_value = distribution(rd); now = std::chrono::steady_clock::now(); } @@ -394,7 +401,7 @@ eType generate_cdm_enum(std::set key, DistributionCollection& colle auto& [key, distribution] = *ptr; auto roll_value = distribution(rd); - return eType::value(std::round(roll_value)); + return typename eType::value(std::round(roll_value)); } if (auto ptr = collection.weighted_discrete_distributions.find(key); ptr != collection.weighted_discrete_distributions.end()) { @@ -408,26 +415,26 @@ eType generate_cdm_enum(std::set key, DistributionCollection& colle auto& [key, distribution] = *ptr; auto roll_value = distribution(rd); - return eType::value(std::round(roll_value)); + return typename eType::value(std::round(roll_value)); } if (auto ptr = collection.discrete_uniform_distributions.find(key); ptr != collection.discrete_uniform_distributions.end()) { auto& [key, distribution] = *ptr; auto roll_value = distribution(rd); - return eType::value(roll_value); + return typename eType::value(roll_value); } if (auto ptr = collection.bernoulli_distributions.find(key); ptr != collection.bernoulli_distributions.end()) { auto& [key, distribution] = *ptr; auto roll_value = distribution(rd); - return eType::value(roll_value); + return typename eType::value(roll_value); } if (auto ptr = collection.sequence_values.find(key); ptr != collection.sequence_values.end()) { auto& [key, count] = *ptr; - return eType::value(count++); + return typename eType::value(count++); } if (auto ptr = collection.cycles_positions.find(key); ptr != collection.cycles_positions.end()) { @@ -437,7 +444,7 @@ eType generate_cdm_enum(std::set key, DistributionCollection& colle return eType(v); } - return eType::value(0); + return typename eType::value(0); } //------------------------------------------------------------------------------- @@ -452,8 +459,15 @@ void PopulationGenerator::Generate() std::mt19937 gen { rd() }; std::string unit_str = ""; - auto const time = std::chrono::current_zone()->to_local(std::chrono::system_clock::now()); - std::string population_pool_dir = std::format("Patients_{:%Y%m%dT%H%M}/", time); + #ifdef WIN32 + auto const time = std::chrono::current_zone()->to_local(std::chrono::system_clock::now()); + std::string population_pool_dir = std::format("Patients_{:%Y%m%dT%H%M}/", time); + #else + auto end = std::chrono::system_clock::now(); + std::time_t now = std::chrono::system_clock::to_time_t(end); + std::stringstream ss; ss << std::put_time(std::localtime(&now), "Patients_%Y%m%dT%H%M/"); + std::string population_pool_dir = ss.str(); + #endif for (auto& run : _runs) { auto const& config_file = run; @@ -482,8 +496,11 @@ void PopulationGenerator::Generate() for (auto i = 0; i < profile.count; ++i) { CDM::PatientData patient; - - patient.Name(std::format("id{1:03}_{0}", profile.name, ++file_count)); + #ifdef WIN32 + patient.Name(std::format("id{1:03}_{0}", profile.name, ++file_count)); + #else + patient.Name(biogears::asprintf("id%03d_%s", ++file_count, profile.name.c_str())); + #endif if (distributions.find(Heterogametic_Sex) != distributions.end()) { auto [best_match, unit] = find_best_match(profile.tags, distributions[Heterogametic_Sex]); if (best_match.size() != 0) { diff --git a/projects/cli/src/exec/ScenarioGenerator.cpp b/projects/cli/src/exec/ScenarioGenerator.cpp index b7c85fa74..4a4601c16 100644 --- a/projects/cli/src/exec/ScenarioGenerator.cpp +++ b/projects/cli/src/exec/ScenarioGenerator.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #ifdef _WIN32 #include @@ -35,7 +36,6 @@ #include #include -#include #include namespace mil { @@ -125,11 +125,14 @@ static void WriteScenarioFile(std::string const directory, std::string const nam biogears::Logger logger; - auto result = Serializer::ReadBuffer((XMLByte*)contents.data(), contents.size(), &logger); - - CDM::Scenario(oFileStream, *((CDM::ScenarioData*)result.get()), info); - std::cout << std::format("Saved {}/", PREFIX_DIR) + directory.c_str() + "/" + name - << "\n"; + std::istringstream is {contents.data()}; + auto ScenarioData = CDM::Scenario(is); + CDM::Scenario(oFileStream, *ScenarioData, info); + #ifdef WIN32 + std::cout << std::format("Saved {}/{}/{}\n", PREFIX_DIR,directory.c_str(),name); + #else + std::cout << biogears::asprintf("Saved %s/%s/%s\n", PREFIX_DIR, directory.c_str(),name.c_str()); + #endif } oFileStream.close(); @@ -157,10 +160,15 @@ void ScenarioGenerator::Generate() std::random_device rd {}; std::mt19937 gen { rd() }; std::string unit_str = ""; - +#ifdef WIN32 auto const time = std::chrono::current_zone()->to_local(std::chrono::system_clock::now()); std::string template_directory = std::format("Templates_{:%Y%m%dT%H%M}", time); - +#else + auto end = std::chrono::system_clock::now(); + std::time_t now = std::chrono::system_clock::to_time_t(end); + std::stringstream ss; ss << std::put_time(std::localtime(&now), "Templates_%Y%m%dT%H%M/"); + std::string template_directory= ss.str(); +#endif // STEP 1 : Iterate over command arguments of CDM::ScenarioGeneratorData for (auto& run : _runs) { auto const& config_file = run; @@ -207,7 +215,11 @@ void ScenarioGenerator::Generate() } if (!std::filesystem::exists(path_to_timeline)) { + #ifdef WIN32 std::cerr << std::format("Unable to find {}", scenarioTemplate.templateFile().c_str()); + #else + std::cerr << biogears::asprintf("Unable to find %s", scenarioTemplate.templateFile().c_str()); + #endif continue; } @@ -215,7 +227,11 @@ void ScenarioGenerator::Generate() master_timeline_content_size = ioManager.read_resource_file(path_to_timeline.string().c_str(), reinterpret_cast(&_buffer[0]), _buffer.size()); if (master_timeline_content_size == 0) { + #ifdef WIN32 std::cerr << std::format("Unable to read {}", path_to_timeline.string()); + #else + std::cerr << biogears::asprintf("Unable to read %s", path_to_timeline.string().c_str()); + #endif continue; } @@ -230,34 +246,76 @@ void ScenarioGenerator::Generate() std::string modified_scenario_contents = master_timeline_contents; for (auto& [key, distribution] : processed_template.normals) { - std::string regex = std::format("@{}@", key); + std::string regex; + #ifdef WIN32 + regex = std::format("@{}@", key); + #else + regex = biogears::asprintf("@%s@", key.c_str()); + #endif const std::regex re(regex); - auto clmaped_value = std::max(processed_template.limits_of_normals[key].first, + auto clamped_value = std::max(processed_template.limits_of_normals[key].first, std::min(processed_template.limits_of_normals[key].second, distribution(gen))); - modified_scenario_contents = std::regex_replace(modified_scenario_contents, re, std::format("{}", clmaped_value)); + std::string clamped_value_str; + #ifdef WIN32 + clamped_value_str = std::format("@{}@", clamped_value); + #else + clamped_value_str = biogears::asprintf("@%f@", clamped_value); + #endif + modified_scenario_contents = std::regex_replace(modified_scenario_contents, re, clamped_value_str); } for (auto& [key, distribution] : processed_template.discrete_uniforms) { - std::string regex = std::format("@{}@", key); + std::string regex; + #ifdef WIN32 + regex = std::format("@{}@", key); + #else + regex = biogears::asprintf("@%s@", key.c_str()); + #endif const std::regex re(regex); - modified_scenario_contents = std::regex_replace(modified_scenario_contents, re, std::format("{}", distribution(gen))); + std::string generated_value_str; + #ifdef WIN32 + generated_value_str = std::format("@{}@", distribution(gen)); + #else + generated_value_str = biogears::asprintf("@%f@", distribution(gen)); + #endif + modified_scenario_contents = std::regex_replace(modified_scenario_contents, re, generated_value_str); } for (auto& [key, distribution] : processed_template.continuous_uniforms) { - std::string regex = std::format("@{}@", key); + std::string regex; + #ifdef WIN32 + regex = std::format("@{}@", key); + #else + regex = biogears::asprintf("@%s@", key.c_str()); + #endif const std::regex re(regex); - modified_scenario_contents = std::regex_replace(modified_scenario_contents, re, std::format("{}", distribution(gen))); + std::string generated_value_str; + #ifdef WIN32 + generated_value_str = std::format("@{}@", distribution(gen)); + #else + generated_value_str = biogears::asprintf("@%f@", distribution(gen)); + #endif + modified_scenario_contents = std::regex_replace(modified_scenario_contents, re, generated_value_str); } for (auto& [key, distribution] : processed_template.weighted_discretes) { - const std::regex re(std::format("@{}@", key)); + std::regex regex; + #ifdef WIN32 + regex = std::format("@{}@", key); + #else + regex = biogears::asprintf("@%s@", key.c_str()); + #endif auto intermediate_value = distribution(gen); auto intended_values = processed_template.weighted_descrete_values[key].Value(); std::string value = intended_values[intermediate_value]; - modified_scenario_contents = std::regex_replace(modified_scenario_contents, re, std::format("{}", value)); + modified_scenario_contents = std::regex_replace(modified_scenario_contents, regex, value); } +#ifdef WIN32 std::string output_name = std::format("{}_{:02}.xml", processed_template.name, template_count + 1); +#else + std::string output_name = biogears::asprintf("%s_%02d.xml", processed_template.name.c_str(), template_count + 1); +#endif WriteScenarioFile(template_directory, output_name, modified_scenario_contents); } } diff --git a/projects/cli/src/utils/Tokenizer.cpp b/projects/cli/src/utils/Tokenizer.cpp index 6dd7d857c..eb5c25572 100644 --- a/projects/cli/src/utils/Tokenizer.cpp +++ b/projects/cli/src/utils/Tokenizer.cpp @@ -70,7 +70,7 @@ double Token::as_double() //----------------------------------------------------------------------------- int Token::as_integral() { - return strtol(value.c_str(), nullptr, 0); + return (int)strtol(value.c_str(), nullptr, 0); } //----------------------------------------------------------------------------- bool Token::operator==(const std::string& rhs) const diff --git a/projects/howto/API_Callbacks/src/HowTo-PatientEvents.cpp b/projects/howto/API_Callbacks/src/HowTo-PatientEvents.cpp index 1502168d0..2eab3eca5 100644 --- a/projects/howto/API_Callbacks/src/HowTo-PatientEvents.cpp +++ b/projects/howto/API_Callbacks/src/HowTo-PatientEvents.cpp @@ -16,7 +16,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include #include #include #include @@ -46,8 +46,8 @@ specific language governing permissions and limitations under the License. //! Some biogears events happen very often and this class will be called everytime any event triggers //! Not just the ones you code for //! -//! virtual void HandlePatientEvent(CDM::enumPatientEvent::value type, bool active, const SEScalarTime* time = nullptr) = 0; -//! virtual void HandleAnesthesiaMachineEvent(CDM::enumAnesthesiaMachineEvent::value type, bool active, const SEScalarTime* time = nullptr) = 0; +//! virtual void HandlePatientEvent(SEPatientEventType type, bool active, const SEScalarTime* time = nullptr) = 0; +//! virtual void HandleAnesthesiaMachineEvent(SEAnesthesiaMachineEvent type, bool active, const SEScalarTime* time = nullptr) = 0; //! //! The alternative method is to provide callback functions for a single event. This is a more narrow approach where if you choose the same handler //! Could be assigned to multiple events or seperate handlers for each event you wish to react to. As of biogears 7.0 this is the preferred and more @@ -68,7 +68,7 @@ class CustomEventHandler : public SEEventHandler { : SEEventHandler() { } - virtual void HandlePatientEvent(CDM::enumPatientEvent::value type, bool active, const SEScalarTime* time = nullptr) + virtual void HandlePatientEvent(SEPatientEventType type, bool active, const SEScalarTime* time = nullptr) { static int event_count = 0; @@ -87,183 +87,186 @@ class CustomEventHandler : public SEEventHandler { std::string end = "|\n"; switch (type) { - case CDM::enumPatientEvent::AcuteLungInjury: + case SEPatientEventType::AcuteLungInjury: event = "AcuteLungInjury"; break; - case CDM::enumPatientEvent::AcuteRespiratoryDistress: + case SEPatientEventType::AcuteRespiratoryDistress: event = "AcuteRespiratoryDistress"; break; - case CDM::enumPatientEvent::Antidiuresis: + case SEPatientEventType::Antidiuresis: event = "Antidiuresis"; break; - case CDM::enumPatientEvent::Asystole: + case SEPatientEventType::Asystole: event = "Asystoley"; break; - case CDM::enumPatientEvent::Bradycardia: + case SEPatientEventType::Bradycardia: event = "Bradycardia"; break; - case CDM::enumPatientEvent::Bradypnea: + case SEPatientEventType::Bradypnea: event = "Bradypnea"; break; - case CDM::enumPatientEvent::BrainOxygenDeficit: + case SEPatientEventType::BrainOxygenDeficit: event = "BrainOxygenDeficit"; break; - case CDM::enumPatientEvent::CardiacArrest: + case SEPatientEventType::CardiacArrest: event = "CardiacArrest"; break; - case CDM::enumPatientEvent::CardiogenicShock: + case SEPatientEventType::CardiogenicShock: event = "CardiogenicShock"; break; - case CDM::enumPatientEvent::CriticalBrainOxygenDeficit: + case SEPatientEventType::CriticalBrainOxygenDeficit: event = "CriticalBrainOxygenDeficit"; break; - case CDM::enumPatientEvent::Dehydration: + case SEPatientEventType::Dehydration: event = "Dehydration"; break; - case CDM::enumPatientEvent::Diuresis: + case SEPatientEventType::Diuresis: event = "AcuteLungInjury"; break; - case CDM::enumPatientEvent::Fasciculation: + case SEPatientEventType::Fasciculation: event = "Fasciculation"; break; - case CDM::enumPatientEvent::Fatigue: + case SEPatientEventType::Fatigue: event = "Fatigue"; break; - case CDM::enumPatientEvent::FunctionalIncontinence: + case SEPatientEventType::FunctionalIncontinence: event = "FunctionalIncontinence"; break; - case CDM::enumPatientEvent::HemolyticTransfusionReaction: + case SEPatientEventType::HemolyticTransfusionReaction: event = "HemolyticTransfusionReaction"; break; - case CDM::enumPatientEvent::Hypercapnia: + case SEPatientEventType::Hypercapnia: event = "Hypercapnia"; break; - case CDM::enumPatientEvent::Hyperglycemia: + case SEPatientEventType::Hyperglycemia: event = "Hyperglycemia"; break; - case CDM::enumPatientEvent::MildHyperkalemia: + case SEPatientEventType::MildHyperkalemia: event = "MildHyperkalemia"; break; - case CDM::enumPatientEvent::SevereHyperkalemia: + case SEPatientEventType::SevereHyperkalemia: event = "SevereHyperkalemia"; break; - case CDM::enumPatientEvent::MildHypernatremia: + case SEPatientEventType::MildHypernatremia: event = "MildHypernatremia"; break; - case CDM::enumPatientEvent::SevereHypernatremia: + case SEPatientEventType::SevereHypernatremia: event = "SevereHypernatremia"; break; - case CDM::enumPatientEvent::Hyperthermia: + case SEPatientEventType::Hyperthermia: event = "Hyperthermia"; break; - case CDM::enumPatientEvent::Hypoglycemia: + case SEPatientEventType::Hypoglycemia: event = "Hypoglycemia"; break; - case CDM::enumPatientEvent::HypoglycemicShock: + case SEPatientEventType::HypoglycemicShock: event = "HypoglycemicShock"; break; - case CDM::enumPatientEvent::HypoglycemicComa: + case SEPatientEventType::HypoglycemicComa: event = "HypoglycemicComa"; break; - case CDM::enumPatientEvent::MildHypothermia: + case SEPatientEventType::MildHypothermia: event = "MildHypothermia"; break; - case CDM::enumPatientEvent::MildHypokalemia: + case SEPatientEventType::MildHypokalemia: event = "MildHypokalemia"; break; - case CDM::enumPatientEvent::SevereHypokalemia: + case SEPatientEventType::SevereHypokalemia: event = "SevereHypokalemia"; break; - case CDM::enumPatientEvent::MildHyponatremia: + case SEPatientEventType::MildHyponatremia: event = "MildHyponatremia"; break; - case CDM::enumPatientEvent::SevereHyponatremia: + case SEPatientEventType::SevereHyponatremia: event = "SevereHyponatremia"; break; - case CDM::enumPatientEvent::Hypoxia: + case SEPatientEventType::Hypoxia: event = "Hypoxia"; break; - case CDM::enumPatientEvent::HypovolemicShock: + case SEPatientEventType::HypovolemicShock: event = "HypovolemicShock"; break; - case CDM::enumPatientEvent::IntracranialHypertension: + case SEPatientEventType::IntracranialHypertension: event = "IntracranialHypertension"; break; - case CDM::enumPatientEvent::IntracranialHypotension: + case SEPatientEventType::IntracranialHypotension: event = "IntracranialHypotension"; break; - case CDM::enumPatientEvent::IrreversibleState: + case SEPatientEventType::IrreversibleState: event = "IrreversibleState"; break; - case CDM::enumPatientEvent::Ketoacidosis: + case SEPatientEventType::Ketoacidosis: event = "Ketoacidosis"; break; - case CDM::enumPatientEvent::LacticAcidosis: + case SEPatientEventType::LacticAcidosis: event = "LacticAcidosis"; break; - case CDM::enumPatientEvent::LiverGlycogenDepleted: + case SEPatientEventType::LiverGlycogenDepleted: event = "LiverGlycogenDepleted"; break; - case CDM::enumPatientEvent::MaximumPulmonaryVentilationRate: + case SEPatientEventType::MaximumPulmonaryVentilationRate: event = "MaximumPulmonaryVentilationRate"; break; - case CDM::enumPatientEvent::MetabolicAcidosis: + case SEPatientEventType::MetabolicAcidosis: event = "MetabolicAcidosis"; break; - case CDM::enumPatientEvent::MetabolicAlkalosis: + case SEPatientEventType::MetabolicAlkalosis: event = "MetabolicAlkalosis"; break; - case CDM::enumPatientEvent::MuscleCatabolism: + case SEPatientEventType::MuscleCatabolism: event = "MuscleCatabolism"; break; - case CDM::enumPatientEvent::MuscleGlycogenDepleted: + case SEPatientEventType::MuscleGlycogenDepleted: event = "MuscleGlycogenDepleted"; break; - case CDM::enumPatientEvent::MyocardiumOxygenDeficit: + case SEPatientEventType::MyocardiumOxygenDeficit: event = "MyocardiumOxygenDeficit"; break; - case CDM::enumPatientEvent::Natriuresis: + case SEPatientEventType::Natriuresis: event = "Natriuresis"; break; - case CDM::enumPatientEvent::NutritionDepleted: + case SEPatientEventType::NutritionDepleted: event = "NutritionDepleted"; break; - case CDM::enumPatientEvent::PulselessRhythm: + case SEPatientEventType::PulselessRhythm: event = "PulselessRhythm"; break; - case CDM::enumPatientEvent::RenalHypoperfusion: + case SEPatientEventType::RenalHypoperfusion: event = "RenalHypoperfusion"; break; - case CDM::enumPatientEvent::RespiratoryAcidosis: + case SEPatientEventType::RespiratoryAcidosis: event = "RespiratoryAcidosis"; break; - case CDM::enumPatientEvent::RespiratoryAlkalosis: + case SEPatientEventType::RespiratoryAlkalosis: event = "RespiratoryAlkalosis"; break; - case CDM::enumPatientEvent::SevereAcuteRespiratoryDistress: + case SEPatientEventType::SevereAcuteRespiratoryDistress: event = "SevereAcuteRespiratoryDistress"; break; - case CDM::enumPatientEvent::StartOfCardiacCycle: + case SEPatientEventType::StartOfCardiacCycle: event = "AcuteLungInjury"; break; - case CDM::enumPatientEvent::StartOfExhale: + case SEPatientEventType::StartOfExhale: event = "StartOfExhale"; break; - case CDM::enumPatientEvent::StartOfInhale: + case SEPatientEventType::StartOfInhale: event = "StartOfInhale"; break; - case CDM::enumPatientEvent::SevereSepsis: + case SEPatientEventType::SevereSepsis: event = "SevereSepsis"; break; - case CDM::enumPatientEvent::Tachycardia: + case SEPatientEventType::Tachycardia: event = "Tachycardia"; break; - case CDM::enumPatientEvent::Tachypnea: + case SEPatientEventType::Tachypnea: event = "Tachypnea"; break; - case CDM::enumPatientEvent::TotalPatientEvents: + case SEPatientEventType::_TotalPatientEvents: event = "TotalPatientEvents"; break; + default: + event = "Unknown"; + break; } std::string state = (active) ? "(On)" : "(Off)"; if (event.size() < marquee_1.size()) { @@ -286,7 +289,7 @@ class CustomEventHandler : public SEEventHandler { std::cout << " 0--0--0 0 0 0 0 0 0 0 \n"; std::cout << std::endl; } - virtual void HandleAnesthesiaMachineEvent(CDM::enumAnesthesiaMachineEvent::value type, bool active, const SEScalarTime* time = nullptr) + virtual void HandleAnesthesiaMachineEvent(SEAnesthesiaMachineEvent type, bool active, const SEScalarTime* time = nullptr) { } }; @@ -537,12 +540,12 @@ int HowToPatientEvents() } auto biogears = dynamic_cast(bg.get()); - biogears->GetPatient().SetEventCallback( CDM::enumPatientEvent::Hypoxia, hypoxia_callback); - biogears->GetPatient().SetEventCallback( CDM::enumPatientEvent::RespiratoryAcidosis, respiratory_acidosis_callback); - biogears->GetPatient().SetEventCallback( CDM::enumPatientEvent::Tachycardia, tachycardia_callback); - biogears->GetPatient().SetEventCallback( CDM::enumPatientEvent::Hypercapnia, hypercapnia_callback); - biogears->GetPatient().SetEventCallback( CDM::enumPatientEvent::AcuteRespiratoryDistress, acute_respiratory_distress_callback); - biogears->GetPatient().SetEventCallback( CDM::enumPatientEvent::IrreversibleState, irreversible_state_callback); + biogears->GetPatient().SetEventCallback( SEPatientEventType::Hypoxia, hypoxia_callback); + biogears->GetPatient().SetEventCallback( SEPatientEventType::RespiratoryAcidosis, respiratory_acidosis_callback); + biogears->GetPatient().SetEventCallback( SEPatientEventType::Tachycardia, tachycardia_callback); + biogears->GetPatient().SetEventCallback( SEPatientEventType::Hypercapnia, hypercapnia_callback); + biogears->GetPatient().SetEventCallback( SEPatientEventType::AcuteRespiratoryDistress, acute_respiratory_distress_callback); + biogears->GetPatient().SetEventCallback( SEPatientEventType::IrreversibleState, irreversible_state_callback); CustomEventHandler eventHandler; bg->SetEventHandler(&eventHandler); @@ -551,13 +554,13 @@ int HowToPatientEvents() auto& machine_config = machine.GetConfiguration(); bg->AdvanceModelTime(50.0, TimeUnit::s); - machine_config.SetConnection(CDM::enumAnesthesiaMachineConnection::Mask); + machine_config.SetConnection(SEAnesthesiaMachineConnection::Mask); machine_config.GetInletFlow().SetValue(5.0, biogears::VolumePerTimeUnit::L_Per_min); machine_config.GetInspiratoryExpiratoryRatio().SetValue(.5); machine_config.GetOxygenFraction().SetValue(0.23); - machine_config.SetOxygenSource(CDM::enumAnesthesiaMachineOxygenSource::Wall); + machine_config.SetOxygenSource(SEAnesthesiaMachineOxygenSource::Wall); machine_config.GetPositiveEndExpiredPressure().SetValue(0.0, biogears::PressureUnit::cmH2O); - machine_config.SetPrimaryGas(CDM::enumAnesthesiaMachinePrimaryGas::Nitrogen); + machine_config.SetPrimaryGas(SEAnesthesiaMachinePrimaryGas::Nitrogen); machine_config.GetRespiratoryRate().SetValue(16, biogears::FrequencyUnit::Per_min); machine_config.GetVentilatorPressure().SetValue(0.0, biogears::PressureUnit::cmH2O); machine_config.GetOxygenBottleOne().GetVolume().SetValue(660, biogears::VolumeUnit::L); @@ -567,14 +570,14 @@ int HowToPatientEvents() bg->AdvanceModelTime(50.0, TimeUnit::s); - machine_config.GetLeftChamber().SetState(CDM::enumOnOff::On); + machine_config.GetLeftChamber().SetState(SEOnOff::On); machine_config.GetLeftChamber().GetSubstanceFraction().SetValue(0.05); - machine_config.GetLeftChamber().SetSubstance(*bg->GetSubstanceManager().GetSubstance("Desflurane")); + machine_config.GetLeftChamber().SetSubstance(*bg->GetSubstanceManager().GetSubstance(StandardSubstances::Desflurane)); bg->ProcessAction(machine); bg->AdvanceModelTime(0.5, TimeUnit::hr); - machine_config.GetLeftChamber().SetState(CDM::enumOnOff::Off); + machine_config.GetLeftChamber().SetState(SEOnOff::Off); bg->ProcessAction(machine); bg->AdvanceModelTime(2, TimeUnit::hr); diff --git a/projects/howto/API_Integration/src/HowTo-API_Integration.cpp b/projects/howto/API_Integration/src/HowTo-API_Integration.cpp index b2f51762a..349eeb217 100644 --- a/projects/howto/API_Integration/src/HowTo-API_Integration.cpp +++ b/projects/howto/API_Integration/src/HowTo-API_Integration.cpp @@ -17,12 +17,13 @@ specific language governing permissions and limitations under the License. #include // Include the various types you will be using in your code +#include #include #include #include #include #include -#include +#include #include #include #include @@ -31,11 +32,9 @@ specific language governing permissions and limitations under the License. #include #include #include +#include #include #include -#include -#include - #include //! @@ -71,9 +70,9 @@ bool action_apply_hemorrhage(std::unique_ptr& engine, //! //! SETourniquet has two members //! std::string compartment -- Where the tourniquet will be applied [LeftLeg,RightLeg,LeftArm,RightArm] -//! CDM::enumTourniquetApplicationLevel -- Applied, Misapplied, None +//! SETourniquetApplicationType -- Applied, Misapplied, None bool action_apply_tourniquet(std::unique_ptr& engine, - std::string compartment, CDM::enumTourniquetApplicationLevel application) + std::string compartment, biogears::SETourniquetApplicationType application) { auto tourniquet = biogears::SETourniquet(); tourniquet.SetCompartment(compartment); @@ -95,15 +94,15 @@ bool action_env_change(std::unique_ptr& engine, biogea { auto environment = biogears::SEEnvironmentChange(engine->GetSubstanceManager()); - //This example only uses three partial gasses. You could submit a vector of name/value pairs. - //Then this section could be modified to Get every substance in the pair list. + // This example only uses three partial gasses. You could submit a vector of name/value pairs. + // Then this section could be modified to Get every substance in the pair list. // - auto* N2 = engine->GetSubstanceManager().GetSubstance("Nitrogen"); - auto* O2 = engine->GetSubstanceManager().GetSubstance("Oxygen"); - auto* CO2 = engine->GetSubstanceManager().GetSubstance("CarbonDioxide"); + auto N2 = engine->GetSubstanceManager().GetSubstance(biogears::Nitrogen)->GetDefinition(); + auto O2 = engine->GetSubstanceManager().GetSubstance(biogears::Oxygen)->GetDefinition(); + auto CO2 = engine->GetSubstanceManager().GetSubstance(biogears::CarbonDioxide)->GetDefinition(); auto conditions = environment.GetConditions(); - conditions.Clear(); //Reset he existing conditions + conditions.Invalidate(); // Reset he existing conditions conditions.SetSurroundingType(new_conditions.GetSurroundingType()); conditions.GetAirVelocity().SetValue(new_conditions.GetAirVelocity().GetValue(biogears::LengthPerTimeUnit::m_Per_s), biogears::LengthPerTimeUnit::m_Per_s); conditions.GetAmbientTemperature().SetValue(new_conditions.GetAmbientTemperature().GetValue(biogears::TemperatureUnit::C), biogears::TemperatureUnit::C); @@ -114,9 +113,9 @@ bool action_env_change(std::unique_ptr& engine, biogea conditions.GetRelativeHumidity().SetValue(new_conditions.GetRelativeHumidity().GetValue()); conditions.GetRespirationAmbientTemperature().SetValue(new_conditions.GetRespirationAmbientTemperature().GetValue(biogears::TemperatureUnit::C), biogears::TemperatureUnit::C); - conditions.GetAmbientGas(*N2).GetFractionAmount().SetValue(new_conditions.GetAmbientGas(*N2).GetFractionAmount().GetValue()); - conditions.GetAmbientGas(*O2).GetFractionAmount().SetValue(new_conditions.GetAmbientGas(*O2).GetFractionAmount().GetValue()); - conditions.GetAmbientGas(*CO2).GetFractionAmount().SetValue(new_conditions.GetAmbientGas(*CO2).GetFractionAmount().GetValue()); + conditions.GetAmbientGas(N2).GetFractionAmount().SetValue(new_conditions.GetAmbientGas(N2).GetFractionAmount().GetValue()); + conditions.GetAmbientGas(O2).GetFractionAmount().SetValue(new_conditions.GetAmbientGas(O2).GetFractionAmount().GetValue()); + conditions.GetAmbientGas(CO2).GetFractionAmount().SetValue(new_conditions.GetAmbientGas(CO2).GetFractionAmount().GetValue()); if (environment.IsValid()) { engine->ProcessAction(environment); @@ -132,7 +131,7 @@ bool action_env_change(std::unique_ptr& engine, biogea //! \param enumSide Left, Right //! \param enumPneumothoraxType Open, Closed //! \param double [0.0, 1.0] -bool action_tension_pneumothorax(std::unique_ptr& engine, CDM::enumSide side, CDM::enumPneumothoraxType type, double severity) +bool action_tension_pneumothorax(std::unique_ptr& engine, biogears::SESide side, biogears::SEPneumothoraxType type, double severity) { auto pneumothorax = biogears::SETensionPneumothorax(); pneumothorax.SetSide(side); @@ -153,7 +152,7 @@ bool action_tension_pneumothorax(std::unique_ptr& engi //! \param enumSide Left, Right //! \param bool Active/Not-Active {On/Off} -bool action_needle_decompression(std::unique_ptr& engine, CDM::enumSide side, bool active) +bool action_needle_decompression(std::unique_ptr& engine, biogears::SESide side, bool active) { auto needleD = biogears::SENeedleDecompression(); needleD.SetSide(side); @@ -183,14 +182,14 @@ bool action_o2_mask(std::unique_ptr& engine, double o2 config.GetOxygenBottleOne().GetVolume().SetValue(o2_volume1, biogears::VolumeUnit::L); config.GetOxygenBottleTwo().GetVolume().SetValue(o2_volume2, biogears::VolumeUnit::L); - //Any of these values could auso be adjusted, but I don't think its required - //for this example - config.SetConnection(CDM::enumAnesthesiaMachineConnection::Mask); + // Any of these values could auso be adjusted, but I don't think its required + // for this example + config.SetConnection(biogears::SEAnesthesiaMachineConnection::Mask); config.GetInletFlow().SetValue(2.0, biogears::VolumePerTimeUnit::L_Per_min); config.GetInspiratoryExpiratoryRatio().SetValue(.5); - config.SetOxygenSource(CDM::enumAnesthesiaMachineOxygenSource::Wall); + config.SetOxygenSource(biogears::SEAnesthesiaMachineOxygenSource::Wall); config.GetPositiveEndExpiredPressure().SetValue(0.0, biogears::PressureUnit::cmH2O); - config.SetPrimaryGas(CDM::enumAnesthesiaMachinePrimaryGas::Nitrogen); + config.SetPrimaryGas(biogears::SEAnesthesiaMachinePrimaryGas::Nitrogen); config.GetReliefValvePressure().SetValue(20.0, biogears::PressureUnit::cmH2O); config.GetRespiratoryRate().SetValue(12, biogears::FrequencyUnit::Per_min); config.GetVentilatorPressure().SetValue(0.0, biogears::PressureUnit::cmH2O); @@ -211,7 +210,7 @@ bool action_o2_mask(std::unique_ptr& engine, double o2 //! \param severity -- Eliminated, Mild, Moderate, Severe //! \param location -- Compartmant Key on where the Infection Starts //! \param mic_mg_Per_l -- Minimal Inhibitory Condition for the given infection -bool action_infection(std::unique_ptr& engine, CDM::enumInfectionSeverity severity, std::string location, double mic_mg_Per_l) +bool action_infection(std::unique_ptr& engine, biogears::SEInfectionSeverity severity, std::string location, double mic_mg_Per_l) { auto sepsis = biogears::SEInfection(); sepsis.SetSeverity(severity); @@ -235,10 +234,10 @@ bool action_infection(std::unique_ptr& engine, CDM::en //------------------------------------------------------------------------------- bool action_bloodtransfuction(std::unique_ptr& engine, double blood_volume_ml, double flowrate_ml_Per_min) { - auto* o_negative = engine->GetSubstanceManager().GetCompound("Blood_ONegative"); + auto* o_negative = engine->GetSubstanceManager().GetCompound(biogears::Blood_ONegative); auto transfusion = biogears::SESubstanceCompoundInfusion(*o_negative); - transfusion.GetBagVolume().SetValue(blood_volume_ml, biogears::VolumeUnit::mL); //the total volume in the bag - transfusion.GetRate().SetValue(flowrate_ml_Per_min, biogears::VolumePerTimeUnit::mL_Per_min); //The rate to admnister the compound in the bag + transfusion.GetBagVolume().SetValue(blood_volume_ml, biogears::VolumeUnit::mL); // the total volume in the bag + transfusion.GetRate().SetValue(flowrate_ml_Per_min, biogears::VolumePerTimeUnit::mL_Per_min); // The rate to admnister the compound in the bag if (transfusion.IsValid()) { engine->ProcessAction(transfusion); return true; @@ -296,7 +295,7 @@ bool action_active_cooling(std::unique_ptr& engine, do //! \param surface_ara_fraction -- What % [0.0,1.0] of the patients surface area is covered by the applied temp //! //! This function can not be undone. SEThermalApplication supports a State member which can be set to off to terminate -//! an active applied_temperature, you would simply need to pass the CDM::enumOnOff as an additional paramater to this function. +//! an active applied_temperature, you would simply need to pass the SEOnOff as an additional paramater to this function. bool action_applied_temperature(std::unique_ptr& engine, double degrees_c, double surface_area_fraction) { auto thermalApplication = biogears::SEThermalApplication(); @@ -359,19 +358,17 @@ bool action_get_urine_color(std::unique_ptr& engine) renalSystem->CalculateUrinalysis(urineAnalysis); if (urineAnalysis.HasColorResult()) { - mil::tatrc::physiology::datamodel::enumUrineColor eColor = urineAnalysis.GetColorResult(); - - switch (eColor) { - case mil::tatrc::physiology::datamodel::enumUrineColor::DarkYellow: + switch (urineAnalysis.GetColorResult()) { + case biogears::SEUrineColor::DarkYellow: std::cout << "Urine Color: Dark Yellow"; return true; - case mil::tatrc::physiology::datamodel::enumUrineColor::PaleYellow: + case biogears::SEUrineColor::PaleYellow: std::cout << "Urine Color: Pale Yellow"; return true; - case mil::tatrc::physiology::datamodel::enumUrineColor::Pink: + case biogears::SEUrineColor::Pink: std::cout << "Urine Color: Pink"; return true; - case mil::tatrc::physiology::datamodel::enumUrineColor::Yellow: + case biogears::SEUrineColor::Yellow: std::cout << "Urine Color: Yellow"; return true; default: @@ -384,7 +381,7 @@ bool action_get_urine_color(std::unique_ptr& engine) } //------------------------------------------------------------------------------- // -//Substance Management Functions +// Substance Management Functions // //------------------------------------------------------------------------------- std::unique_ptr substance_make_compound(std::unique_ptr& engine) @@ -404,27 +401,26 @@ std::unique_ptr substance_make_compound(std::uniq bool addCompoundComponents(std::unique_ptr& engine, std::unique_ptr& compound, const char* substance_str, double concentration, biogears::MassPerVolumeUnit unit) { - + if (biogears::SESubstance* substance = engine->GetSubstanceManager().GetSubstance(substance_str)) { - auto substance_concentration = biogears::SESubstanceConcentration(*substance); + auto substance_concentration = biogears::SESubstanceConcentration(substance->GetDefinition()); substance_concentration.GetConcentration().SetValue(10.0, biogears::MassPerVolumeUnit::mg_Per_mL); compound->GetComponents().push_back(substance_concentration); - //Because the substance isn't register atat this point, it is possible to adjust the name based on the current mix. - //Active infusions are stored by substance name so once registered and infuse you can no longer modify the mix name; + // Because the substance isn't register atat this point, it is possible to adjust the name based on the current mix. + // Active infusions are stored by substance name so once registered and infuse you can no longer modify the mix name; return true; } else if (biogears::SESubstanceCompound* source_compound = engine->GetSubstanceManager().GetCompound(substance_str)) { for (auto& source_substance : source_compound->GetComponents()) { auto& destination_concentration = compound->GetComponent(source_substance.GetSubstance()); - //The mixing of substanceCompounds is non trivial and this is mearly an example of feasability - //If one does not simply want to overwrite the existing concentration one may need to concider the - //relative volumes of the two compounds to determine the new concentration. - //Example Mixing Water 1:1 with Seawater creates a very different sodium concentration then a 1:10 mix - - destination_concentration.GetConcentration() = source_substance.GetConcentration(); + // The mixing of substanceCompounds is non trivial and this is mearly an example of feasability + // If one does not simply want to overwrite the existing concentration one may need to concider the + // relative volumes of the two compounds to determine the new concentration. + // Example Mixing Water 1:1 with Seawater creates a very different sodium concentration then a 1:10 mix + destination_concentration.GetConcentration() = source_substance.GetConcentration(); } return true; } @@ -432,8 +428,8 @@ bool addCompoundComponents(std::unique_ptr& engine, st } std::string substance_register_compound(std::unique_ptr& engine, std::unique_ptr&& compound) { - //This call registeres the substance with the substance manager. At this point we are going to release control of the memory to the biogears library who will - //delete it at the end of the run. DLL boundries being what they are we may need to introduce a make_substancecompound function to the API. + // This call registeres the substance with the substance manager. At this point we are going to release control of the memory to the biogears library who will + // delete it at the end of the run. DLL boundries being what they are we may need to introduce a make_substancecompound function to the API. std::string compound_name = compound->GetName_cStr(); engine->GetSubstanceManager().AddCompound(*compound.release()); return compound_name; @@ -478,12 +474,12 @@ BioGearsPlugin::BioGearsPlugin(std::string name) _pimpl->engine->GetLogger()->Warning("Could not load patient falling back to manually creating a patient."); biogears::SEPatient patient { _pimpl->engine->GetLogger() }; patient.SetName("StandardMale"); - patient.SetGender(CDM::enumSex::Male); + patient.SetSex(biogears::SESex::Male); patient.GetAge().SetValue(44, biogears::TimeUnit::yr); patient.GetWeight().SetValue(170, biogears::MassUnit::lb); patient.GetHeight().SetValue(71, biogears::LengthUnit::inch); patient.GetBodyFatFraction().SetValue(0.21); - patient.SetBloodType(CDM::enumBloodType::AB); + patient.SetBloodType(SEBloodType::AB); patient.SetBloodRh(true); patient.GetHeartRateBaseline().SetValue(72, biogears::FrequencyUnit::Per_min); patient.GetRespirationRateBaseline().SetValue(16, biogears::FrequencyUnit::Per_min); @@ -520,25 +516,25 @@ void BioGearsPlugin::run() _pimpl->simulation_started.store(true); while (_pimpl->simulation_running) { action_apply_hemorrhage(_pimpl->engine, "LeftLeg", 5.); - action_apply_tourniquet(_pimpl->engine, "LeftLeg", CDM::enumTourniquetApplicationLevel::Applied); + action_apply_tourniquet(_pimpl->engine, "LeftLeg", SETourniquetApplicationType::Applied); _pimpl->engine->AdvanceModelTime(1, biogears::TimeUnit::s); action_apply_hemorrhage(_pimpl->engine, "LeftLeg", 5.); - action_apply_tourniquet(_pimpl->engine, "LeftLeg", CDM::enumTourniquetApplicationLevel::Misapplied); + action_apply_tourniquet(_pimpl->engine, "LeftLeg", SETourniquetApplicationType::Misapplied); _pimpl->engine->AdvanceModelTime(1, biogears::TimeUnit::s); - action_apply_tourniquet(_pimpl->engine, "LeftLeg", CDM::enumTourniquetApplicationLevel::Applied); + action_apply_tourniquet(_pimpl->engine, "LeftLeg", SETourniquetApplicationType::Applied); _pimpl->engine->AdvanceModelTime(1, biogears::TimeUnit::s); - action_apply_tourniquet(_pimpl->engine, "LeftLeg", CDM::enumTourniquetApplicationLevel::None); + action_apply_tourniquet(_pimpl->engine, "LeftLeg", SETourniquetApplicationType::NotApplied); _pimpl->engine->AdvanceModelTime(1, biogears::TimeUnit::s); - //The effectivness of this helper-function is called in to doubt, for such a simple tutorial - //But you could imagine creating a vector of common conditions and then pushing and poping them in to - //This function as the patient changes locations. - + // The effectivness of this helper-function is called in to doubt, for such a simple tutorial + // But you could imagine creating a vector of common conditions and then pushing and poping them in to + // This function as the patient changes locations. + auto conditions = biogears::SEEnvironmentalConditions(_pimpl->engine->GetSubstanceManager()); - auto* N2 = _pimpl->engine->GetSubstanceManager().GetSubstance("Nitrogen"); - auto* O2 = _pimpl->engine->GetSubstanceManager().GetSubstance("Oxygen"); - auto* CO2 = _pimpl->engine->GetSubstanceManager().GetSubstance("CarbonDioxide"); - - conditions.SetSurroundingType(CDM::enumSurroundingType::Water); + auto N2 = _pimpl->engine->GetSubstanceManager().GetSubstance(biogears::Nitrogen)->GetDefinition(); + auto O2 = _pimpl->engine->GetSubstanceManager().GetSubstance(biogears::Oxygen)->GetDefinition(); + auto CO2 = _pimpl->engine->GetSubstanceManager().GetSubstance(biogears::CarbonDioxide)->GetDefinition(); + + conditions.SetSurroundingType(SESurroundingType::Water); conditions.GetAirVelocity().SetValue(0, LengthPerTimeUnit::m_Per_s); conditions.GetAmbientTemperature().SetValue(10.0, TemperatureUnit::C); conditions.GetAtmosphericPressure().SetValue(760., PressureUnit::mmHg); @@ -547,36 +543,36 @@ void BioGearsPlugin::run() conditions.GetMeanRadiantTemperature().SetValue(22.0, TemperatureUnit::C); conditions.GetRelativeHumidity().SetValue(1.0); conditions.GetRespirationAmbientTemperature().SetValue(22.0, TemperatureUnit::C); - conditions.GetAmbientGas(*N2).GetFractionAmount().SetValue(0.7901); - conditions.GetAmbientGas(*O2).GetFractionAmount().SetValue(0.2095); - conditions.GetAmbientGas(*CO2).GetFractionAmount().SetValue(4.0E-4); - + conditions.GetAmbientGas(N2).GetFractionAmount().SetValue(0.7901); + conditions.GetAmbientGas(O2).GetFractionAmount().SetValue(0.2095); + conditions.GetAmbientGas(CO2).GetFractionAmount().SetValue(4.0E-4); + action_env_change(_pimpl->engine, conditions); _pimpl->engine->AdvanceModelTime(1, biogears::TimeUnit::s); - action_tension_pneumothorax(_pimpl->engine, CDM::enumSide::Left, CDM::enumPneumothoraxType::Open, 0.5); + action_tension_pneumothorax(_pimpl->engine, biogears::SESide::Left, SEPneumothoraxType::Open, 0.5); _pimpl->engine->AdvanceModelTime(1, biogears::TimeUnit::s); - action_needle_decompression(_pimpl->engine, CDM::enumSide::Left, true); + action_needle_decompression(_pimpl->engine, biogears::SESide::Left, true); _pimpl->engine->AdvanceModelTime(1, biogears::TimeUnit::s); action_o2_mask(_pimpl->engine, .5, 3., 0.); _pimpl->engine->AdvanceModelTime(1, biogears::TimeUnit::s); - action_infection(_pimpl->engine, CDM::enumInfectionSeverity::Mild, "LeftLeg", 0.2); + action_infection(_pimpl->engine, SEInfectionSeverity::Mild, "LeftLeg", 0.2); _pimpl->engine->AdvanceModelTime(1, biogears::TimeUnit::s); action_bloodtransfuction(_pimpl->engine, 500, 100); /////////////////////////////////////// - ///DRUGS + /// DRUGS auto customCompound = substance_make_compound(_pimpl->engine); - auto mixSuccess = addCompoundComponents(_pimpl->engine, customCompound, "Saline", 2.17, MassPerVolumeUnit::kg_Per_L); - mixSuccess &= addCompoundComponents(_pimpl->engine, customCompound, "Albumin", 10.0, MassPerVolumeUnit::mg_Per_mL); - mixSuccess &= addCompoundComponents(_pimpl->engine, customCompound, "Morphine", 10.0, MassPerVolumeUnit::mg_Per_mL); + auto mixSuccess = addCompoundComponents(_pimpl->engine, customCompound, biogears::Saline, 2.17, MassPerVolumeUnit::kg_Per_L); + mixSuccess &= addCompoundComponents(_pimpl->engine, customCompound, biogears::Albumin, 10.0, MassPerVolumeUnit::mg_Per_mL); + mixSuccess &= addCompoundComponents(_pimpl->engine, customCompound, biogears::Morphine, 10.0, MassPerVolumeUnit::mg_Per_mL); if (mixSuccess) { for (auto& component : customCompound->GetComponents()) { - //Example of creating data request for tracking the components of the new substance. - //Note: String based DataRequest will cause runtime instability if no Scalar matches the input string. - if (component.GetSubstance().HasPK()) { - _pimpl->engine->GetEngineTrack()->GetDataRequestManager().CreateSubstanceDataRequest().Set(*_pimpl->engine->GetSubstanceManager().GetSubstance(component.GetSubstance().GetName()), "PlasmaConcentration", MassPerVolumeUnit::ug_Per_L); + // Example of creating data request for tracking the components of the new substance. + // Note: String based DataRequest will cause runtime instability if no Scalar matches the input string. + if (component.GetSubstance().Pharmacokinetics.IsValid()) { + _pimpl->engine->GetEngineTrack()->GetDataRequestManager().CreateSubstanceDataRequest().Set(*_pimpl->engine->GetSubstanceManager().GetSubstance(component.GetSubstance().Name), "PlasmaConcentration", MassPerVolumeUnit::ug_Per_L); } } auto compound_name = substance_register_compound(_pimpl->engine, std::move(customCompound)); //< _pimpl->engine takes ownership of customCompound here and will delete it once it is removed (DLL Boundry issue need to create a make_compound function to avoid that in biogears) @@ -600,12 +596,12 @@ void BioGearsPlugin::run() action_active_heating(_pimpl->engine, 500, 0.5); _pimpl->engine->GetLogger()->Info(asprintf("ActiveHeating[%s]", _pimpl->engine->GetActions().GetEnvironmentActions().GetThermalApplication()->HasActiveHeating() ? "true" : "false")); // true _pimpl->engine->AdvanceModelTime(1, biogears::TimeUnit::s); - + _pimpl->engine->GetLogger()->Info(asprintf("ActiveCooling[%s]", _pimpl->engine->GetActions().GetEnvironmentActions().GetThermalApplication()->HasActiveCooling() ? "true" : "false")); _pimpl->engine->AdvanceModelTime(1, biogears::TimeUnit::s); action_active_cooling(_pimpl->engine, 500, 0.5); _pimpl->engine->GetLogger()->Info(asprintf("ActiveCooling[%s]", _pimpl->engine->GetActions().GetEnvironmentActions().GetThermalApplication()->HasActiveCooling() ? "true" : "false")); - + _pimpl->engine->GetLogger()->Info(asprintf("AppliedTempeture[%s]", _pimpl->engine->GetActions().GetEnvironmentActions().GetThermalApplication()->HasAppliedTemperature() ? "true" : "false")); _pimpl->engine->AdvanceModelTime(1, biogears::TimeUnit::s); action_applied_temperature(_pimpl->engine, 37, 0.5); @@ -614,9 +610,9 @@ void BioGearsPlugin::run() action_get_urine_color(_pimpl->engine); action_urinate(_pimpl->engine); try { - _pimpl->engine->SaveStateToFile("HowTo-API_Integration_FinalState.xml"); - - } catch ( xsd::cxx::exception e) { + _pimpl->engine->SaveStateToFile("HowTo-API_Integration_FinalState.xml"); + + } catch (xsd::cxx::exception e) { std::cout << e.what(); } _pimpl->simulation_finished.store(true); diff --git a/projects/howto/API_Integration/src/HowTo-API_Integration_main.cpp b/projects/howto/API_Integration/src/HowTo-API_Integration_main.cpp index 2eae9f6fc..141681e0d 100644 --- a/projects/howto/API_Integration/src/HowTo-API_Integration_main.cpp +++ b/projects/howto/API_Integration/src/HowTo-API_Integration_main.cpp @@ -2,26 +2,79 @@ #include #include -#include #include +#include + +#include +#include +#include +#include +#include + int main(int argc, char* argv[]) { - BioGearsPlugin plugin("HowTo-API_Integration"); - plugin.run(); - std::this_thread::sleep_for(std::chrono::seconds(15)); - plugin.stop(); - auto start_time = std::chrono::steady_clock::now(); - std::stringstream ss; - while (plugin.isRunning()) { - using namespace std::chrono_literals; - auto duration = std::chrono::steady_clock::now() - start_time; - - ss.str(""); - ss << "Biogears has been running for " << std::chrono::duration_cast(duration).count() << "\n"; - std::cout << ss.str(); - - std::this_thread::sleep_for(15s); + // BioGearsPlugin plugin("HowTo-API_Integration"); + // plugin.run(); + // std::this_thread::sleep_for(std::chrono::seconds(15)); + // plugin.stop(); + // auto start_time = std::chrono::steady_clock::now(); + // std::stringstream ss; + // while (plugin.isRunning()) { + // using namespace std::chrono_literals; + // auto duration = std::chrono::steady_clock::now() - start_time; + + // ss.str(""); + // ss << "Biogears has been running for " << std::chrono::duration_cast(duration).count() << "\n"; + // std::cout << ss.str(); + + // std::this_thread::sleep_for(15s); + //} + // plugin.join(); + + auto logger = std::make_unique(); + auto substances = std::make_unique(logger.get()); + substances->LoadSubstanceDirectory(); + + auto substance1 = substances->GetSubstance(biogears::Oxygen)->GetDefinition(); + auto substance2 = substances->GetSubstance(biogears::Nitrogen)->GetDefinition(); + auto substance3 = substances->GetSubstance(biogears::Sarin)->GetDefinition(); + + auto biogears = std::make_unique(logger.get()); + auto patient = std::make_unique(logger.get()); + patient->Load("DefaultTemplateMale.xml"); + + biogears->LoadState("DefaultTemplateMale@0s.xml"); + + for (int i = 0; i < 1000; ++i) { + biogears->AdvanceModelTime(); + biogears->AdvanceModelTime(); + biogears->AdvanceModelTime(); + biogears->AdvanceModelTime(); + biogears->AdvanceModelTime(); + + biogears->AdvanceModelTime(); + biogears->AdvanceModelTime(); + biogears->AdvanceModelTime(); + biogears->AdvanceModelTime(); + biogears->AdvanceModelTime(); + + biogears->AdvanceModelTime(); + biogears->AdvanceModelTime(); + biogears->AdvanceModelTime(); + biogears->AdvanceModelTime(); + biogears->AdvanceModelTime(); + + biogears->AdvanceModelTime(); + biogears->AdvanceModelTime(); + biogears->AdvanceModelTime(); + biogears->AdvanceModelTime(); + biogears->AdvanceModelTime(); + + biogears->AdvanceModelTime(); + biogears->AdvanceModelTime(); + biogears->AdvanceModelTime(); + biogears->AdvanceModelTime(); + biogears->AdvanceModelTime(); } - plugin.join(); } \ No newline at end of file diff --git a/projects/howto/API_WorkingDirectory/src/HowTo-CWD_Change.cpp b/projects/howto/API_WorkingDirectory/src/HowTo-CWD_Change.cpp index 514ddaeaa..0ebf17793 100644 --- a/projects/howto/API_WorkingDirectory/src/HowTo-CWD_Change.cpp +++ b/projects/howto/API_WorkingDirectory/src/HowTo-CWD_Change.cpp @@ -15,7 +15,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include #include #include #include diff --git a/projects/howto/AirwayObstruction/src/HowTo-AirwayObstruction.cpp b/projects/howto/AirwayObstruction/src/HowTo-AirwayObstruction.cpp index 45c117188..b9b371211 100644 --- a/projects/howto/AirwayObstruction/src/HowTo-AirwayObstruction.cpp +++ b/projects/howto/AirwayObstruction/src/HowTo-AirwayObstruction.cpp @@ -18,7 +18,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include #include #include #include diff --git a/projects/howto/AnesthesiaMachine/src/HowTo-AnesthesiaMachine.cpp b/projects/howto/AnesthesiaMachine/src/HowTo-AnesthesiaMachine.cpp index 180da8a04..0b23cdc4a 100644 --- a/projects/howto/AnesthesiaMachine/src/HowTo-AnesthesiaMachine.cpp +++ b/projects/howto/AnesthesiaMachine/src/HowTo-AnesthesiaMachine.cpp @@ -25,7 +25,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include #include #include @@ -46,20 +46,20 @@ using biogears::asprintf; int HowToAnesthesiaMachine() { // Create the engine and load the patient - std::unique_ptr bg = CreateBioGearsEngine("HowToAnesthesiaMachine.log"); + std::unique_ptr bg = CreateBioGearsEngine("HowToAnesthesiaMachine.log"); bg->GetLogger()->Info("HowToAnesthesiaMachine"); - if (!bg->LoadState("./states/StandardMale@0s.xml")) + if (!bg->LoadState("./states/StandardMale@0s.xml")) { bg->GetLogger()->Error("Could not load state, check the error"); return 1; } // The tracker is responsible for advancing the engine time and outputting the data requests below at each time step - + - // Create data requests for each value that should be written to the output log as the engine is executing - // Physiology System Names are defined on the System Objects - // defined in the Physiology.xsd file + // Create data requests for each value that should be written to the output log as the engine is executing + // Physiology System Names are defined on the System Objects + // defined in the Physiology.xsd file bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("HeartRate", FrequencyUnit::Per_min); bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("MeanArterialPressure", PressureUnit::mmHg); bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("SystolicArterialPressure", PressureUnit::mmHg); @@ -69,161 +69,161 @@ int HowToAnesthesiaMachine() bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("TotalLungVolume", VolumeUnit::mL); bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("OxygenSaturation"); bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("SedationLevel"); - // Create an Anesthesia Machine and configure it as needed - SEAnesthesiaMachineConfiguration AMConfig(bg->GetSubstanceManager()); + // Create an Anesthesia Machine and configure it as needed + SEAnesthesiaMachineConfiguration AMConfig(bg->GetSubstanceManager()); bg->GetEngineTrack()->GetDataRequestManager().SetResultsFilename("HowToAnesthesiaMachine.csv"); - bg->GetLogger()->Info("The patient is nice and healthy"); - bg->GetLogger()->Info(asprintf("Tidal Volume : %f %s", bg->GetRespiratorySystem()->GetTidalVolume(VolumeUnit::mL), "mL")); - bg->GetLogger()->Info(asprintf("Systolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetSystolicArterialPressure(PressureUnit::mmHg), "mmHg")); - bg->GetLogger()->Info(asprintf("Diastolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetDiastolicArterialPressure(PressureUnit::mmHg), "mmHg")); - bg->GetLogger()->Info(asprintf("Heart Rate : %f %s", bg->GetCardiovascularSystem()->GetHeartRate(FrequencyUnit::Per_min), "bpm")); - bg->GetLogger()->Info(asprintf("Respiration Rate : %f %s", bg->GetRespiratorySystem()->GetRespirationRate(FrequencyUnit::Per_min), "bpm")); - bg->GetLogger()->Info(asprintf("Oxygen Saturation : %f", bg->GetBloodChemistrySystem()->GetOxygenSaturation())); - - bg->AdvanceModelTime(50, TimeUnit::s); - - // Turn the anesthesia machine on and get it configured for spontaneous breathing - - - // You can set configuration by modifing the configuration class directly - // Or you can point to an XML with configuration data. - // Modifying the class will keep any old settings that are not provided in the config - // Using a xml will set the anesthesia machine to only the property states specified in the file - SEIntubation intubate; - intubate.SetType(CDM::enumIntubationType::Tracheal); - SEAnesthesiaMachine& config = AMConfig.GetConfiguration(); - config.SetConnection(CDM::enumAnesthesiaMachineConnection::Mask); - config.GetInletFlow().SetValue(2.0, VolumePerTimeUnit::L_Per_min); - config.GetInspiratoryExpiratoryRatio().SetValue(.5); - config.GetOxygenFraction().SetValue(.5); - config.SetOxygenSource(CDM::enumAnesthesiaMachineOxygenSource::Wall); - config.GetPositiveEndExpiredPressure().SetValue(3.0, PressureUnit::cmH2O); - config.SetPrimaryGas(CDM::enumAnesthesiaMachinePrimaryGas::Nitrogen); - config.GetReliefValvePressure().SetValue(20.0, PressureUnit::cmH2O); - config.GetRespiratoryRate().SetValue(12, FrequencyUnit::Per_min); - config.GetVentilatorPressure().SetValue(22.0, PressureUnit::cmH2O); - config.GetOxygenBottleOne().GetVolume().SetValue(660.0, VolumeUnit::L); - config.GetOxygenBottleTwo().GetVolume().SetValue(660.0, VolumeUnit::L); - - // Process the action to propagate state into the engine - bg->ProcessAction(AMConfig); - bg->GetLogger()->Info(asprintf("Turning on the Anesthesia Machine and placing mask on patient for spontaneous breathing with machine connection.")); - - bg->AdvanceModelTime(60, TimeUnit::s); - - bg->GetLogger()->Info("The patient is attempting to breath normally with Anesthesia Machine connected"); - bg->GetLogger()->Info(asprintf("Tidal Volume : %f %s", bg->GetRespiratorySystem()->GetTidalVolume(VolumeUnit::mL), "mL")); - bg->GetLogger()->Info(asprintf("Systolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetSystolicArterialPressure(PressureUnit::mmHg), "mmHg")); - bg->GetLogger()->Info(asprintf("Diastolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetDiastolicArterialPressure(PressureUnit::mmHg), "mmHg")); - bg->GetLogger()->Info(asprintf("Heart Rate : %f %s", bg->GetCardiovascularSystem()->GetHeartRate(FrequencyUnit::Per_min), "bpm")); - bg->GetLogger()->Info(asprintf("Respiration Rate : %f %s", bg->GetRespiratorySystem()->GetRespirationRate(FrequencyUnit::Per_min), "bpm")); - bg->GetLogger()->Info(asprintf("Oxygen Saturation : %f" , bg->GetBloodChemistrySystem()->GetOxygenSaturation())); + bg->GetLogger()->Info("The patient is nice and healthy"); + bg->GetLogger()->Info(asprintf("Tidal Volume : %f %s", bg->GetRespiratorySystem()->GetTidalVolume(VolumeUnit::mL), "mL")); + bg->GetLogger()->Info(asprintf("Systolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetSystolicArterialPressure(PressureUnit::mmHg), "mmHg")); + bg->GetLogger()->Info(asprintf("Diastolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetDiastolicArterialPressure(PressureUnit::mmHg), "mmHg")); + bg->GetLogger()->Info(asprintf("Heart Rate : %f %s", bg->GetCardiovascularSystem()->GetHeartRate(FrequencyUnit::Per_min), "bpm")); + bg->GetLogger()->Info(asprintf("Respiration Rate : %f %s", bg->GetRespiratorySystem()->GetRespirationRate(FrequencyUnit::Per_min), "bpm")); + bg->GetLogger()->Info(asprintf("Oxygen Saturation : %f", bg->GetBloodChemistrySystem()->GetOxygenSaturation())); + + bg->AdvanceModelTime(50, TimeUnit::s); + + // Turn the anesthesia machine on and get it configured for spontaneous breathing + + + // You can set configuration by modifing the configuration class directly + // Or you can point to an XML with configuration data. + // Modifying the class will keep any old settings that are not provided in the config + // Using a xml will set the anesthesia machine to only the property states specified in the file + SEIntubation intubate; + intubate.SetType(SEIntubationType::Tracheal); + SEAnesthesiaMachine& config = AMConfig.GetConfiguration(); + config.SetConnection(SEAnesthesiaMachineConnection::Mask); + config.GetInletFlow().SetValue(2.0, VolumePerTimeUnit::L_Per_min); + config.GetInspiratoryExpiratoryRatio().SetValue(.5); + config.GetOxygenFraction().SetValue(.5); + config.SetOxygenSource(SEAnesthesiaMachineOxygenSource::Wall); + config.GetPositiveEndExpiredPressure().SetValue(3.0, PressureUnit::cmH2O); + config.SetPrimaryGas(SEAnesthesiaMachinePrimaryGas::Nitrogen); + config.GetReliefValvePressure().SetValue(20.0, PressureUnit::cmH2O); + config.GetRespiratoryRate().SetValue(12, FrequencyUnit::Per_min); + config.GetVentilatorPressure().SetValue(22.0, PressureUnit::cmH2O); + config.GetOxygenBottleOne().GetVolume().SetValue(660.0, VolumeUnit::L); + config.GetOxygenBottleTwo().GetVolume().SetValue(660.0, VolumeUnit::L); + + // Process the action to propagate state into the engine + bg->ProcessAction(AMConfig); + bg->GetLogger()->Info(asprintf("Turning on the Anesthesia Machine and placing mask on patient for spontaneous breathing with machine connection.")); + + bg->AdvanceModelTime(60, TimeUnit::s); + + bg->GetLogger()->Info("The patient is attempting to breath normally with Anesthesia Machine connected"); + bg->GetLogger()->Info(asprintf("Tidal Volume : %f %s", bg->GetRespiratorySystem()->GetTidalVolume(VolumeUnit::mL), "mL")); + bg->GetLogger()->Info(asprintf("Systolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetSystolicArterialPressure(PressureUnit::mmHg), "mmHg")); + bg->GetLogger()->Info(asprintf("Diastolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetDiastolicArterialPressure(PressureUnit::mmHg), "mmHg")); + bg->GetLogger()->Info(asprintf("Heart Rate : %f %s", bg->GetCardiovascularSystem()->GetHeartRate(FrequencyUnit::Per_min), "bpm")); + bg->GetLogger()->Info(asprintf("Respiration Rate : %f %s", bg->GetRespiratorySystem()->GetRespirationRate(FrequencyUnit::Per_min), "bpm")); + bg->GetLogger()->Info(asprintf("Oxygen Saturation : %f" , bg->GetBloodChemistrySystem()->GetOxygenSaturation())); // Get the Succinylcholine substance from the substance manager - const SESubstance* succs = bg->GetSubstanceManager().GetSubstance("Succinylcholine"); + const SESubstance* succs = bg->GetSubstanceManager().GetSubstance(StandardSubstances::Succinylcholine); // Create a substance bolus action to administer the substance - SESubstanceBolus bolus(*succs); - bolus.GetConcentration().SetValue(4820, MassPerVolumeUnit::ug_Per_mL); - bolus.GetDose().SetValue(20, VolumeUnit::mL); - bolus.SetAdminRoute(CDM::enumBolusAdministration::Intravenous); - bg->ProcessAction(bolus); - + SESubstanceBolus bolus(*succs); + bolus.GetConcentration().SetValue(4820, MassPerVolumeUnit::ug_Per_mL); + bolus.GetDose().SetValue(20, VolumeUnit::mL); + bolus.SetAdminRoute(SEBolusAdministration::Intravenous); + bg->ProcessAction(bolus); + bg->GetLogger()->Info("Giving the patient Succinylcholine to test machine-driven ventilation."); - bg->AdvanceModelTime(60, TimeUnit::s); - - bg->GetLogger()->Info("It has been 60s since the Succinylcholine administration."); - bg->GetLogger()->Info(asprintf("Tidal Volume : %f %s", bg->GetRespiratorySystem()->GetTidalVolume(VolumeUnit::mL), "mL")); - bg->GetLogger()->Info(asprintf("Systolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetSystolicArterialPressure(PressureUnit::mmHg), "mmHg")); - bg->GetLogger()->Info(asprintf("Diastolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetDiastolicArterialPressure(PressureUnit::mmHg), "mmHg")); - bg->GetLogger()->Info(asprintf("Heart Rate : %f %s", bg->GetCardiovascularSystem()->GetHeartRate(FrequencyUnit::Per_min), "bpm")); - bg->GetLogger()->Info(asprintf("Respiration Rate : %f %s", bg->GetRespiratorySystem()->GetRespirationRate(FrequencyUnit::Per_min), "bpm")); - bg->GetLogger()->Info(asprintf("Oxygen Saturation : %f", bg->GetBloodChemistrySystem()->GetOxygenSaturation())); - - config.GetInletFlow().SetValue(5.0, VolumePerTimeUnit::L_Per_min); - config.GetPositiveEndExpiredPressure().SetValue(3.0, PressureUnit::cmH2O); - config.GetVentilatorPressure().SetValue(22.0, PressureUnit::cmH2O); - bg->ProcessAction(AMConfig); - bg->GetLogger()->Info("Setting the ventilator pressure to drive the machine. Also increasing the inlet flow and positive end expired pressure to test machine controls."); - - bg->AdvanceModelTime(60, TimeUnit::s); - - bg->GetLogger()->Info("Patient breathing is being controlled by the machine."); - bg->GetLogger()->Info(asprintf("Tidal Volume : %f %s", bg->GetRespiratorySystem()->GetTidalVolume(VolumeUnit::mL), "mL")); - bg->GetLogger()->Info(asprintf("Systolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetSystolicArterialPressure(PressureUnit::mmHg), "mmHg")); - bg->GetLogger()->Info(asprintf("Diastolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetDiastolicArterialPressure(PressureUnit::mmHg), "mmHg")); - bg->GetLogger()->Info(asprintf("Heart Rate : %f %s", bg->GetCardiovascularSystem()->GetHeartRate(FrequencyUnit::Per_min), "bpm")); - bg->GetLogger()->Info(asprintf("Respiration Rate : %f %s", bg->GetRespiratorySystem()->GetRespirationRate(FrequencyUnit::Per_min), "bpm")); - bg->GetLogger()->Info(asprintf("Oxygen Saturation : %f", bg->GetBloodChemistrySystem()->GetOxygenSaturation())); - - config.GetInspiratoryExpiratoryRatio().SetValue(1.0); - config.GetPositiveEndExpiredPressure().SetValue(1.0, PressureUnit::cmH2O); - config.GetRespiratoryRate().SetValue(18.0, FrequencyUnit::Per_min); - config.GetVentilatorPressure().SetValue(10.0, PressureUnit::cmH2O); - bg->ProcessAction(AMConfig); - bg->GetLogger()->Info("More Anesthesia Machine control manipulation. Increasing respiratory rate, reducing driving pressure and increasing the inspiratory-expiratory ratio."); - - bg->AdvanceModelTime(60, TimeUnit::s); - - bg->GetLogger()->Info("Patient breathing is being controlled by the machine."); - bg->GetLogger()->Info(asprintf("Tidal Volume : %f %s", bg->GetRespiratorySystem()->GetTidalVolume(VolumeUnit::mL), "mL")); - bg->GetLogger()->Info(asprintf("Systolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetSystolicArterialPressure(PressureUnit::mmHg), "mmHg")); - bg->GetLogger()->Info(asprintf("Diastolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetDiastolicArterialPressure(PressureUnit::mmHg), "mmHg")); - bg->GetLogger()->Info(asprintf("Heart Rate : %f %s", bg->GetCardiovascularSystem()->GetHeartRate(FrequencyUnit::Per_min), "bpm")); - bg->GetLogger()->Info(asprintf("Respiration Rate : %f %s", bg->GetRespiratorySystem()->GetRespirationRate(FrequencyUnit::Per_min), "bpm")); - bg->GetLogger()->Info(asprintf("Oxygen Saturation : %f", bg->GetBloodChemistrySystem()->GetOxygenSaturation())); - - SEMaskLeak AMleak; - AMleak.GetSeverity().SetValue(0.5); - bg->ProcessAction(AMleak); - bg->GetLogger()->Info("Testing an anesthesia machine failure mode. The mask is leaking with a severity of 0.5."); - - bg->AdvanceModelTime(60, TimeUnit::s); - - bg->GetLogger()->Info("Patient breathing is being controlled by the machine. The mask has been leaking for 60 seconds."); - bg->GetLogger()->Info(asprintf("Tidal Volume : %f %s", bg->GetRespiratorySystem()->GetTidalVolume(VolumeUnit::mL), "mL")); - bg->GetLogger()->Info(asprintf("Systolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetSystolicArterialPressure(PressureUnit::mmHg), "mmHg")); - bg->GetLogger()->Info(asprintf("Diastolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetDiastolicArterialPressure(PressureUnit::mmHg), "mmHg")); - bg->GetLogger()->Info(asprintf("Heart Rate : %f %s", bg->GetCardiovascularSystem()->GetHeartRate(FrequencyUnit::Per_min), "bpm")); - bg->GetLogger()->Info(asprintf("Respiration Rate : %f %s", bg->GetRespiratorySystem()->GetRespirationRate(FrequencyUnit::Per_min), "bpm")); - bg->GetLogger()->Info(asprintf("Oxygen Saturation : %f", bg->GetBloodChemistrySystem()->GetOxygenSaturation())); - - AMleak.GetSeverity().SetValue(0.0); - bg->ProcessAction(AMleak); - bg->GetLogger()->Info("Removing the mask leak."); - - bg->AdvanceModelTime(60, TimeUnit::s); - - SEOxygenWallPortPressureLoss AMpressureloss; - AMpressureloss.SetActive(true); - bg->ProcessAction(AMpressureloss); - bg->GetLogger()->Info("Testing the oxygen pressure loss failure mode. The oxygen pressure from the wall source is dropping."); - - bg->AdvanceModelTime(60, TimeUnit::s); - - bg->GetLogger()->Info("Patient breathing is being controlled by the machine. The wall oxygen pressure loss occurred 60 seconds ago."); - bg->GetLogger()->Info(asprintf("Tidal Volume : %f %s", bg->GetRespiratorySystem()->GetTidalVolume(VolumeUnit::mL), "mL")); - bg->GetLogger()->Info(asprintf("Systolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetSystolicArterialPressure(PressureUnit::mmHg), "mmHg")); - bg->GetLogger()->Info(asprintf("Diastolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetDiastolicArterialPressure(PressureUnit::mmHg), "mmHg")); - bg->GetLogger()->Info(asprintf("Heart Rate : %f %s", bg->GetCardiovascularSystem()->GetHeartRate(FrequencyUnit::Per_min), "bpm")); - bg->GetLogger()->Info(asprintf("Respiration Rate : %f %s", bg->GetRespiratorySystem()->GetRespirationRate(FrequencyUnit::Per_min), "bpm")); - bg->GetLogger()->Info(asprintf("Oxygen Saturation : %f", bg->GetBloodChemistrySystem()->GetOxygenSaturation())); - - AMpressureloss.SetActive(false); - bg->ProcessAction(AMpressureloss); - bg->GetLogger()->Info("Removing the wall oxygen pressure loss action."); - - bg->AdvanceModelTime(60, TimeUnit::s); - - bg->GetLogger()->Info("The anesthesia machine is operating normally"); - bg->GetLogger()->Info(asprintf("Tidal Volume : %f %s", bg->GetRespiratorySystem()->GetTidalVolume(VolumeUnit::mL), "mL")); - bg->GetLogger()->Info(asprintf("Systolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetSystolicArterialPressure(PressureUnit::mmHg), "mmHg")); - bg->GetLogger()->Info(asprintf("Diastolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetDiastolicArterialPressure(PressureUnit::mmHg), "mmHg")); - bg->GetLogger()->Info(asprintf("Heart Rate : %f %s", bg->GetCardiovascularSystem()->GetHeartRate(FrequencyUnit::Per_min), "bpm")); - bg->GetLogger()->Info(asprintf("Respiration Rate : %f %s", bg->GetRespiratorySystem()->GetRespirationRate(FrequencyUnit::Per_min), "bpm")); - bg->GetLogger()->Info(asprintf("Oxygen Saturation : %f", bg->GetBloodChemistrySystem()->GetOxygenSaturation())); + bg->AdvanceModelTime(60, TimeUnit::s); + + bg->GetLogger()->Info("It has been 60s since the Succinylcholine administration."); + bg->GetLogger()->Info(asprintf("Tidal Volume : %f %s", bg->GetRespiratorySystem()->GetTidalVolume(VolumeUnit::mL), "mL")); + bg->GetLogger()->Info(asprintf("Systolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetSystolicArterialPressure(PressureUnit::mmHg), "mmHg")); + bg->GetLogger()->Info(asprintf("Diastolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetDiastolicArterialPressure(PressureUnit::mmHg), "mmHg")); + bg->GetLogger()->Info(asprintf("Heart Rate : %f %s", bg->GetCardiovascularSystem()->GetHeartRate(FrequencyUnit::Per_min), "bpm")); + bg->GetLogger()->Info(asprintf("Respiration Rate : %f %s", bg->GetRespiratorySystem()->GetRespirationRate(FrequencyUnit::Per_min), "bpm")); + bg->GetLogger()->Info(asprintf("Oxygen Saturation : %f", bg->GetBloodChemistrySystem()->GetOxygenSaturation())); + + config.GetInletFlow().SetValue(5.0, VolumePerTimeUnit::L_Per_min); + config.GetPositiveEndExpiredPressure().SetValue(3.0, PressureUnit::cmH2O); + config.GetVentilatorPressure().SetValue(22.0, PressureUnit::cmH2O); + bg->ProcessAction(AMConfig); + bg->GetLogger()->Info("Setting the ventilator pressure to drive the machine. Also increasing the inlet flow and positive end expired pressure to test machine controls."); + + bg->AdvanceModelTime(60, TimeUnit::s); + + bg->GetLogger()->Info("Patient breathing is being controlled by the machine."); + bg->GetLogger()->Info(asprintf("Tidal Volume : %f %s", bg->GetRespiratorySystem()->GetTidalVolume(VolumeUnit::mL), "mL")); + bg->GetLogger()->Info(asprintf("Systolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetSystolicArterialPressure(PressureUnit::mmHg), "mmHg")); + bg->GetLogger()->Info(asprintf("Diastolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetDiastolicArterialPressure(PressureUnit::mmHg), "mmHg")); + bg->GetLogger()->Info(asprintf("Heart Rate : %f %s", bg->GetCardiovascularSystem()->GetHeartRate(FrequencyUnit::Per_min), "bpm")); + bg->GetLogger()->Info(asprintf("Respiration Rate : %f %s", bg->GetRespiratorySystem()->GetRespirationRate(FrequencyUnit::Per_min), "bpm")); + bg->GetLogger()->Info(asprintf("Oxygen Saturation : %f", bg->GetBloodChemistrySystem()->GetOxygenSaturation())); + + config.GetInspiratoryExpiratoryRatio().SetValue(1.0); + config.GetPositiveEndExpiredPressure().SetValue(1.0, PressureUnit::cmH2O); + config.GetRespiratoryRate().SetValue(18.0, FrequencyUnit::Per_min); + config.GetVentilatorPressure().SetValue(10.0, PressureUnit::cmH2O); + bg->ProcessAction(AMConfig); + bg->GetLogger()->Info("More Anesthesia Machine control manipulation. Increasing respiratory rate, reducing driving pressure and increasing the inspiratory-expiratory ratio."); + + bg->AdvanceModelTime(60, TimeUnit::s); + + bg->GetLogger()->Info("Patient breathing is being controlled by the machine."); + bg->GetLogger()->Info(asprintf("Tidal Volume : %f %s", bg->GetRespiratorySystem()->GetTidalVolume(VolumeUnit::mL), "mL")); + bg->GetLogger()->Info(asprintf("Systolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetSystolicArterialPressure(PressureUnit::mmHg), "mmHg")); + bg->GetLogger()->Info(asprintf("Diastolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetDiastolicArterialPressure(PressureUnit::mmHg), "mmHg")); + bg->GetLogger()->Info(asprintf("Heart Rate : %f %s", bg->GetCardiovascularSystem()->GetHeartRate(FrequencyUnit::Per_min), "bpm")); + bg->GetLogger()->Info(asprintf("Respiration Rate : %f %s", bg->GetRespiratorySystem()->GetRespirationRate(FrequencyUnit::Per_min), "bpm")); + bg->GetLogger()->Info(asprintf("Oxygen Saturation : %f", bg->GetBloodChemistrySystem()->GetOxygenSaturation())); + + SEMaskLeak AMleak; + AMleak.GetSeverity().SetValue(0.5); + bg->ProcessAction(AMleak); + bg->GetLogger()->Info("Testing an anesthesia machine failure mode. The mask is leaking with a severity of 0.5."); + + bg->AdvanceModelTime(60, TimeUnit::s); + + bg->GetLogger()->Info("Patient breathing is being controlled by the machine. The mask has been leaking for 60 seconds."); + bg->GetLogger()->Info(asprintf("Tidal Volume : %f %s", bg->GetRespiratorySystem()->GetTidalVolume(VolumeUnit::mL), "mL")); + bg->GetLogger()->Info(asprintf("Systolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetSystolicArterialPressure(PressureUnit::mmHg), "mmHg")); + bg->GetLogger()->Info(asprintf("Diastolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetDiastolicArterialPressure(PressureUnit::mmHg), "mmHg")); + bg->GetLogger()->Info(asprintf("Heart Rate : %f %s", bg->GetCardiovascularSystem()->GetHeartRate(FrequencyUnit::Per_min), "bpm")); + bg->GetLogger()->Info(asprintf("Respiration Rate : %f %s", bg->GetRespiratorySystem()->GetRespirationRate(FrequencyUnit::Per_min), "bpm")); + bg->GetLogger()->Info(asprintf("Oxygen Saturation : %f", bg->GetBloodChemistrySystem()->GetOxygenSaturation())); + + AMleak.GetSeverity().SetValue(0.0); + bg->ProcessAction(AMleak); + bg->GetLogger()->Info("Removing the mask leak."); + + bg->AdvanceModelTime(60, TimeUnit::s); + + SEOxygenWallPortPressureLoss AMpressureloss; + AMpressureloss.SetActive(true); + bg->ProcessAction(AMpressureloss); + bg->GetLogger()->Info("Testing the oxygen pressure loss failure mode. The oxygen pressure from the wall source is dropping."); + + bg->AdvanceModelTime(60, TimeUnit::s); + + bg->GetLogger()->Info("Patient breathing is being controlled by the machine. The wall oxygen pressure loss occurred 60 seconds ago."); + bg->GetLogger()->Info(asprintf("Tidal Volume : %f %s", bg->GetRespiratorySystem()->GetTidalVolume(VolumeUnit::mL), "mL")); + bg->GetLogger()->Info(asprintf("Systolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetSystolicArterialPressure(PressureUnit::mmHg), "mmHg")); + bg->GetLogger()->Info(asprintf("Diastolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetDiastolicArterialPressure(PressureUnit::mmHg), "mmHg")); + bg->GetLogger()->Info(asprintf("Heart Rate : %f %s", bg->GetCardiovascularSystem()->GetHeartRate(FrequencyUnit::Per_min), "bpm")); + bg->GetLogger()->Info(asprintf("Respiration Rate : %f %s", bg->GetRespiratorySystem()->GetRespirationRate(FrequencyUnit::Per_min), "bpm")); + bg->GetLogger()->Info(asprintf("Oxygen Saturation : %f", bg->GetBloodChemistrySystem()->GetOxygenSaturation())); + + AMpressureloss.SetActive(false); + bg->ProcessAction(AMpressureloss); + bg->GetLogger()->Info("Removing the wall oxygen pressure loss action."); + + bg->AdvanceModelTime(60, TimeUnit::s); + + bg->GetLogger()->Info("The anesthesia machine is operating normally"); + bg->GetLogger()->Info(asprintf("Tidal Volume : %f %s", bg->GetRespiratorySystem()->GetTidalVolume(VolumeUnit::mL), "mL")); + bg->GetLogger()->Info(asprintf("Systolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetSystolicArterialPressure(PressureUnit::mmHg), "mmHg")); + bg->GetLogger()->Info(asprintf("Diastolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetDiastolicArterialPressure(PressureUnit::mmHg), "mmHg")); + bg->GetLogger()->Info(asprintf("Heart Rate : %f %s", bg->GetCardiovascularSystem()->GetHeartRate(FrequencyUnit::Per_min), "bpm")); + bg->GetLogger()->Info(asprintf("Respiration Rate : %f %s", bg->GetRespiratorySystem()->GetRespirationRate(FrequencyUnit::Per_min), "bpm")); + bg->GetLogger()->Info(asprintf("Oxygen Saturation : %f", bg->GetBloodChemistrySystem()->GetOxygenSaturation())); bg->GetLogger()->Info("Finished"); return 0; } diff --git a/projects/howto/Asthma/src/HowTo-Asthma.cpp b/projects/howto/Asthma/src/HowTo-Asthma.cpp index c9ea737d5..86d131039 100644 --- a/projects/howto/Asthma/src/HowTo-Asthma.cpp +++ b/projects/howto/Asthma/src/HowTo-Asthma.cpp @@ -14,7 +14,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include #include #include #include diff --git a/projects/howto/BolusDrug/src/HowTo-BolusDrug.cpp b/projects/howto/BolusDrug/src/HowTo-BolusDrug.cpp index 1e9485604..cd89864a7 100644 --- a/projects/howto/BolusDrug/src/HowTo-BolusDrug.cpp +++ b/projects/howto/BolusDrug/src/HowTo-BolusDrug.cpp @@ -14,7 +14,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include #include #include #include @@ -69,13 +69,13 @@ int HowToBolusDrug() bg->AdvanceModelTime(50, TimeUnit::s); // Get the Succinylcholine substance from the substance manager - const SESubstance* succs = bg->GetSubstanceManager().GetSubstance("Succinylcholine"); + const SESubstance* succs = bg->GetSubstanceManager().GetSubstance(StandardSubstances::Succinylcholine); // Create a substance bolus action to administer the substance SESubstanceBolus bolus(*succs); bolus.GetConcentration().SetValue(4820, MassPerVolumeUnit::ug_Per_mL); bolus.GetDose().SetValue(20, VolumeUnit::mL); - bolus.SetAdminRoute(CDM::enumBolusAdministration::Intravenous); + bolus.SetAdminRoute(SEBolusAdministration::Intravenous); // BioGears also supports Intramuscular as an admin route as well bg->ProcessAction(bolus); bg->GetLogger()->Info("Giving the patient Succinylcholine."); diff --git a/projects/howto/BrainInjury/src/HowTo-BrainInjury.cpp b/projects/howto/BrainInjury/src/HowTo-BrainInjury.cpp index 17bf9261b..2ad9d615f 100644 --- a/projects/howto/BrainInjury/src/HowTo-BrainInjury.cpp +++ b/projects/howto/BrainInjury/src/HowTo-BrainInjury.cpp @@ -16,7 +16,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include #include #include #include @@ -93,7 +93,7 @@ int HowToBrainInjury() // Create an SEBrainInjury object // Set the severity (a fraction between 0 and 1; for maximal injury, use 1.) SEBrainInjury tbi; - tbi.SetType(CDM::enumBrainInjuryType::Diffuse); // Can also be LeftFocal or RightFocal, and you will get pupillary effects in only one eye + tbi.SetType(SEBrainInjuryType::Diffuse); // Can also be LeftFocal or RightFocal, and you will get pupillary effects in only one eye tbi.GetSeverity().SetValue(0.2); bg->ProcessAction(tbi); bg->GetLogger()->Info("Giving the patient a brain injury."); diff --git a/projects/howto/BurnWoundPainStimulus/src/HowTo-BurnWoundPainStimulus.cpp b/projects/howto/BurnWoundPainStimulus/src/HowTo-BurnWoundPainStimulus.cpp index 65121bbb9..0577ce04c 100644 --- a/projects/howto/BurnWoundPainStimulus/src/HowTo-BurnWoundPainStimulus.cpp +++ b/projects/howto/BurnWoundPainStimulus/src/HowTo-BurnWoundPainStimulus.cpp @@ -14,6 +14,7 @@ specific language governing permissions and limitations under the License. #include // Include the various types you will be using in your code +#include #include #include #include @@ -23,7 +24,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include #include #include #include @@ -134,7 +135,7 @@ BurnThread::BurnThread(const std::string logFile, double tbsa) m_bg->GetLogger()->Error("Could not load state, check the error"); throw std::runtime_error("Could not load state, check the error"); } - SESubstance* epi = m_bg->GetSubstanceManager().GetSubstance("Epinephrine"); + SESubstance* epi = m_bg->GetSubstanceManager().GetSubstance(StandardSubstances::Epinephrine); //Create CSV results file and set up data that we want to be tracked (tracking done in AdvanceModelTime) int docTBSA = (int)(tbsa); @@ -163,9 +164,9 @@ BurnThread::BurnThread(const std::string logFile, double tbsa) m_bg->GetEngineTrack()->GetDataTrack().Probe("bagVolumeAlbumin_mL", m_ivBagVolumeAlbumin_mL); //Load substances and compounds - SESubstanceCompound* ringers = m_bg->GetSubstanceManager().GetCompound("RingersLactate"); - SESubstanceCompound* albumex = m_bg->GetSubstanceManager().GetCompound("Albuminex_4PCT"); - SESubstance* ketamine = m_bg->GetSubstanceManager().GetSubstance("Ketamine"); + SESubstanceCompound* ringers = m_bg->GetSubstanceManager().GetCompound(StandardSubstances::RingersLactate); + SESubstanceCompound* albumex = m_bg->GetSubstanceManager().GetCompound(StandardSubstances::Albuminex_4PCT); + SESubstance* ketamine = m_bg->GetSubstanceManager().GetSubstance(StandardSubstances::Ketamine); //Create infusion and bolus actions m_ringers = new SESubstanceCompoundInfusion(*ringers); m_albumex = new SESubstanceCompoundInfusion(*albumex); @@ -193,7 +194,7 @@ BurnThread::~BurnThread() void BurnThread::AdministerKetamine(double& bolus) { - m_ketamineBolus->SetAdminRoute(CDM::enumBolusAdministration::Intravenous); + m_ketamineBolus->SetAdminRoute(SEBolusAdministration::Intravenous); m_ketamineBolus->GetConcentration().SetValue(1.0, MassPerVolumeUnit::mg_Per_mL); m_ketamineBolus->GetDose().SetValue(bolus, VolumeUnit::mL); m_mutex.lock(); @@ -231,7 +232,7 @@ void BurnThread::AdvanceTime() if (m_ivBagVolume_mL < 0.0) { m_bg->GetLogger()->Info("Ringers Lactate IV bag is empty \n"); m_ivBagVolume_mL = 0.0; - m_ringers->Clear(); + m_ringers->Invalidate(); } } m_bg->GetEngineTrack()->TrackData(m_bg->GetSimulationTime(TimeUnit::s)); @@ -448,20 +449,20 @@ void BurnThread::FluidLoading(double tbsa) } } // escharotomy, uncomment below for escharotomy, should happen at next hour checkpoint - if (m_bg->GetPatient().IsEventActive(CDM::enumPatientEvent::CompartmentSyndrome_Abdominal) - || m_bg->GetPatient().IsEventActive(CDM::enumPatientEvent::CompartmentSyndrome_LeftArm) - || m_bg->GetPatient().IsEventActive(CDM::enumPatientEvent::CompartmentSyndrome_LeftLeg) - || m_bg->GetPatient().IsEventActive(CDM::enumPatientEvent::CompartmentSyndrome_RightArm) - || m_bg->GetPatient().IsEventActive(CDM::enumPatientEvent::CompartmentSyndrome_RightLeg)) { - if (m_bg->GetPatient().IsEventActive(CDM::enumPatientEvent::CompartmentSyndrome_Abdominal)) { + if (m_bg->GetPatient().IsEventActive(SEPatientEventType::CompartmentSyndromeAbdominal) + || m_bg->GetPatient().IsEventActive(SEPatientEventType::CompartmentSyndromeLeftArm) + || m_bg->GetPatient().IsEventActive(SEPatientEventType::CompartmentSyndromeLeftLeg) + || m_bg->GetPatient().IsEventActive(SEPatientEventType::CompartmentSyndromeRightArm) + || m_bg->GetPatient().IsEventActive(SEPatientEventType::CompartmentSyndromeRightLeg)) { + if (m_bg->GetPatient().IsEventActive(SEPatientEventType::CompartmentSyndromeAbdominal)) { m_escharotomy->SetLocation("Trunk"); - } else if (m_bg->GetPatient().IsEventActive(CDM::enumPatientEvent::CompartmentSyndrome_LeftArm)) { + } else if (m_bg->GetPatient().IsEventActive(SEPatientEventType::CompartmentSyndromeLeftArm)) { m_escharotomy->SetLocation("LeftArm"); - } else if (m_bg->GetPatient().IsEventActive(CDM::enumPatientEvent::CompartmentSyndrome_LeftLeg)) { + } else if (m_bg->GetPatient().IsEventActive(SEPatientEventType::CompartmentSyndromeLeftLeg)) { m_escharotomy->SetLocation("LeftLeg"); - } else if (m_bg->GetPatient().IsEventActive(CDM::enumPatientEvent::CompartmentSyndrome_RightArm)) { + } else if (m_bg->GetPatient().IsEventActive(SEPatientEventType::CompartmentSyndromeRightArm)) { m_escharotomy->SetLocation("RightArm"); - } else if (m_bg->GetPatient().IsEventActive(CDM::enumPatientEvent::CompartmentSyndrome_RightLeg)) { + } else if (m_bg->GetPatient().IsEventActive(SEPatientEventType::CompartmentSyndromeRightLeg)) { m_escharotomy->SetLocation("RightLeg"); } else { return; @@ -488,7 +489,7 @@ void BurnThread::FluidLoading(double tbsa) } //exit checks: - if (m_bg->GetPatient().IsEventActive(CDM::enumPatientEvent::IrreversibleState)) { + if (m_bg->GetPatient().IsEventActive(SEPatientEventType::IrreversibleState)) { //m_bg->GetLogger()->Info(std::stringstream() << "oh no!"); m_bg->GetLogger()->Info("///////////////////////////////////////////////////////////////"); m_runThread = false; diff --git a/projects/howto/COPD/src/HowTo-COPD.cpp b/projects/howto/COPD/src/HowTo-COPD.cpp index 2e862a464..8bff94bf3 100644 --- a/projects/howto/COPD/src/HowTo-COPD.cpp +++ b/projects/howto/COPD/src/HowTo-COPD.cpp @@ -14,7 +14,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include #include #include #include diff --git a/projects/howto/CPR/src/HowTo-CPR.cpp b/projects/howto/CPR/src/HowTo-CPR.cpp index d5fda3c58..714917f2d 100644 --- a/projects/howto/CPR/src/HowTo-CPR.cpp +++ b/projects/howto/CPR/src/HowTo-CPR.cpp @@ -17,7 +17,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include #include #include #include @@ -42,14 +42,14 @@ class MyListener : public SEEventHandler { MyListener(Logger* logger) : SEEventHandler() , log(logger) {}; - virtual void HandlePatientEvent(CDM::enumPatientEvent::value type, bool active, const SEScalarTime* time) override + void HandlePatientEvent(SEPatientEventType type, bool active, const SEScalarTime* time) override { std::stringstream ss; ss << "Recieved Patient Event : " << type; log->Info(ss); } - virtual void HandleAnesthesiaMachineEvent(CDM::enumAnesthesiaMachineEvent::value type, bool active, const SEScalarTime* time) override + void HandleAnesthesiaMachineEvent(SEAnesthesiaMachineEvent type, bool active, const SEScalarTime* time) override { std::stringstream ss; ss << "Recieved Anesthesia Machine Event : " << type; diff --git a/projects/howto/ConsumeNutrients/src/HowTo-ConsumeNutrients.cpp b/projects/howto/ConsumeNutrients/src/HowTo-ConsumeNutrients.cpp index ef89cfd21..a295ea38b 100644 --- a/projects/howto/ConsumeNutrients/src/HowTo-ConsumeNutrients.cpp +++ b/projects/howto/ConsumeNutrients/src/HowTo-ConsumeNutrients.cpp @@ -15,7 +15,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include #include #include #include diff --git a/projects/howto/CreateAPatient/src/HowTo-CreateAPatient.cpp b/projects/howto/CreateAPatient/src/HowTo-CreateAPatient.cpp index 4d2527fbf..d40225428 100644 --- a/projects/howto/CreateAPatient/src/HowTo-CreateAPatient.cpp +++ b/projects/howto/CreateAPatient/src/HowTo-CreateAPatient.cpp @@ -13,12 +13,13 @@ specific language governing permissions and limitations under the License. // Include the various types you will be using in your code +#include #include #include #include #include #include -#include +#include #include #include @@ -41,7 +42,7 @@ int HowToCreateAPatient() //Patient Gender is the only thing that is absolutely required to be set. //All value not explicitly set based or standard values or calculations. //If you do something out of bounds or set something you're not allowed to, it will alert you with a warning/error. - patient.SetGender(CDM::enumSex::Male); + patient.SetSex(biogears::SESex::Male); patient.GetAge().SetValue(44, TimeUnit::yr); patient.GetWeight().SetValue(170, MassUnit::lb); patient.GetHeight().SetValue(71, LengthUnit::inch); @@ -51,18 +52,6 @@ int HowToCreateAPatient() patient.GetRespirationRateBaseline().SetValue(16, FrequencyUnit::Per_min); patient.GetSystolicArterialPressureBaseline().SetValue(114, PressureUnit::mmHg); - // You can save off the patient if you want to use it later - CDM::PatientData* pData = patient.Unload(); - // Write out the stable patient state - std::ofstream stream("./patients/HowToCreateAPatient.xml"); - // Write out the xml file - xml_schema::namespace_infomap map; - map[""].name = "uri:/mil/tatrc/physiology/datamodel"; - //TODO: What constructor are these from - // Patient(stream, *pData, map); - stream.close(); - SAFE_DELETE(pData); - if (!bg->InitializeEngine(patient)) { bg->GetLogger()->Error("Could not load state, check the error"); return 1; diff --git a/projects/howto/EngineUse/src/HowTo-EngineUse.cpp b/projects/howto/EngineUse/src/HowTo-EngineUse.cpp index d5285bd40..c27a855a7 100644 --- a/projects/howto/EngineUse/src/HowTo-EngineUse.cpp +++ b/projects/howto/EngineUse/src/HowTo-EngineUse.cpp @@ -17,7 +17,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include #include #include #include @@ -81,8 +81,8 @@ class MyEventHandler : public SEEventHandler { : SEEventHandler() { } - virtual void HandlePatientEvent(CDM::enumPatientEvent::value type, bool active, const SEScalarTime* time = nullptr) { } - virtual void HandleAnesthesiaMachineEvent(CDM::enumAnesthesiaMachineEvent::value type, bool active, const SEScalarTime* time = nullptr) { } + void HandlePatientEvent(SEPatientEventType type, bool active, const SEScalarTime* time = nullptr) override { } + void HandleAnesthesiaMachineEvent(SEAnesthesiaMachineEvent type, bool active, const SEScalarTime* time = nullptr) override { } }; //-------------------------------------------------------------------------------------------------- @@ -144,7 +144,7 @@ int HowToEngineUse() // There are specific events that can occur while the engine runs and you submit various actions // You can either poll/query the patient object to see if it is in a specific state - bg->GetPatient().IsEventActive(CDM::enumPatientEvent::CardiacArrest); + bg->GetPatient().IsEventActive(SEPatientEventType::CardiacArrest); // You can also derive a callback class that will be called whenever an Event is entered or exited by the patient MyEventHandler myEventHandler(bg->GetLogger()); bg->SetEventHandler(&myEventHandler); @@ -154,8 +154,8 @@ int HowToEngineUse() // So it's a good idea to cache this pointer so you can reuse it when asking at various time steps // You can find all substances defined in xml files in the substances directory of your working directory // Names are in those xml files. ALL substance xml files are loaded into a substance managers when the engine is created - SESubstance* O2 = bg->GetSubstanceManager().GetSubstance("Oxygen"); - SESubstance* CO2 = bg->GetSubstanceManager().GetSubstance("CarbonDioxide"); + SESubstance* O2 = bg->GetSubstanceManager().GetSubstance(StandardSubstances::Oxygen); + SESubstance* CO2 = bg->GetSubstanceManager().GetSubstance(StandardSubstances::CarbonDioxide); // The tracker is responsible for advancing the engine time AND outputting the data requests below at each time step // If you do not wish to write data to a file, you do not need to make any data requests @@ -261,7 +261,7 @@ int HowToEngineUse() bg->GetLogger()->Info(asprintf( "OxygenSaturation : %f", bg->GetBloodChemistrySystem()->GetOxygenSaturation())); bg->GetLogger()->Info(asprintf( "ArterialBlood pH : %f", bg->GetBloodChemistrySystem()->GetArterialBloodPH())); // You should save off the SESubstanceQuantity* if you will need it more than once - bg->GetLogger()->Info(asprintf( "Lactate Concentration : %f %s", bg->GetSubstanceManager().GetSubstance("Lactate")->GetBloodConcentration(MassPerVolumeUnit::mg_Per_dL), "mg_Per_dL")); + bg->GetLogger()->Info(asprintf( "Lactate Concentration : %f %s", bg->GetSubstanceManager().GetSubstance(StandardSubstances::Lactate)->GetBloodConcentration(MassPerVolumeUnit::mg_Per_dL), "mg_Per_dL")); bg->GetLogger()->Info(asprintf( "Core Body Temperature : %f %s", bg->GetEnergySystem()->GetCoreTemperature(TemperatureUnit::C), "C")); // Save the state of the engine diff --git a/projects/howto/EnvironmentChange/src/HowTo-EnvironmentChange.cpp b/projects/howto/EnvironmentChange/src/HowTo-EnvironmentChange.cpp index 97bfed9c5..76082035e 100644 --- a/projects/howto/EnvironmentChange/src/HowTo-EnvironmentChange.cpp +++ b/projects/howto/EnvironmentChange/src/HowTo-EnvironmentChange.cpp @@ -13,7 +13,7 @@ specific language governing permissions and limitations under the License. // Include the various types you will be using in your code #include #include -#include +#include #include #include #include @@ -68,9 +68,9 @@ int HowToEnvironmentChange() } // Get some substances out we will use - SESubstance* N2 = bg->GetSubstanceManager().GetSubstance("Nitrogen"); - SESubstance* O2 = bg->GetSubstanceManager().GetSubstance("Oxygen"); - SESubstance* CO2 = bg->GetSubstanceManager().GetSubstance("CarbonDioxide"); + auto& N2 = bg->GetSubstanceManager().GetSubstance(StandardSubstances::Nitrogen)->GetDefinition(); + auto& O2 = bg->GetSubstanceManager().GetSubstance(StandardSubstances::Oxygen)->GetDefinition(); + auto& CO2 = bg->GetSubstanceManager().GetSubstance(StandardSubstances::CarbonDioxide)->GetDefinition(); // The tracker is responsible for advancing the engine time and outputting the data requests below at each time step @@ -111,7 +111,7 @@ int HowToEnvironmentChange() // The core temperature follows the skin temperature, and the metabolic rate increases due to shivering. SEEnvironmentChange env(bg->GetSubstanceManager()); SEEnvironmentalConditions& conditions = env.GetConditions(); - conditions.SetSurroundingType(CDM::enumSurroundingType::Water); + conditions.SetSurroundingType(SESurroundingType::Water); conditions.GetAirVelocity().SetValue(0, LengthPerTimeUnit::m_Per_s); conditions.GetAmbientTemperature().SetValue(10.0, TemperatureUnit::C); conditions.GetAtmosphericPressure().SetValue(760., PressureUnit::mmHg); @@ -120,9 +120,9 @@ int HowToEnvironmentChange() conditions.GetMeanRadiantTemperature().SetValue(22.0, TemperatureUnit::C); conditions.GetRelativeHumidity().SetValue(1.0); conditions.GetRespirationAmbientTemperature().SetValue(22.0, TemperatureUnit::C); - conditions.GetAmbientGas(*N2).GetFractionAmount().SetValue(0.7901); - conditions.GetAmbientGas(*O2).GetFractionAmount().SetValue(0.2095); - conditions.GetAmbientGas(*CO2).GetFractionAmount().SetValue(4.0E-4); + conditions.GetAmbientGas(N2).GetFractionAmount().SetValue(0.7901); + conditions.GetAmbientGas(O2).GetFractionAmount().SetValue(0.2095); + conditions.GetAmbientGas(CO2).GetFractionAmount().SetValue(4.0E-4); bg->ProcessAction(env); bg->AdvanceModelTime(30, TimeUnit::s); @@ -140,7 +140,7 @@ int HowToEnvironmentChange() // The patient is removed from the water and returns to the normal environment. // The skin temperature rises, leading to a subsequent rise in core temperature - conditions.SetSurroundingType(CDM::enumSurroundingType::Air); + conditions.SetSurroundingType(SESurroundingType::Air); conditions.GetAirVelocity().SetValue(0.1, LengthPerTimeUnit::m_Per_s); conditions.GetAmbientTemperature().SetValue(22.0, TemperatureUnit::C); conditions.GetAtmosphericPressure().SetValue(760., PressureUnit::mmHg); @@ -149,9 +149,9 @@ int HowToEnvironmentChange() conditions.GetMeanRadiantTemperature().SetValue(22.0, TemperatureUnit::C); conditions.GetRelativeHumidity().SetValue(0.6); conditions.GetRespirationAmbientTemperature().SetValue(19, TemperatureUnit::C); - conditions.GetAmbientGas(*N2).GetFractionAmount().SetValue(0.7896); - conditions.GetAmbientGas(*O2).GetFractionAmount().SetValue(0.21); - conditions.GetAmbientGas(*CO2).GetFractionAmount().SetValue(4.0E-4); + conditions.GetAmbientGas(N2).GetFractionAmount().SetValue(0.7896); + conditions.GetAmbientGas(O2).GetFractionAmount().SetValue(0.21); + conditions.GetAmbientGas(CO2).GetFractionAmount().SetValue(4.0E-4); bg->ProcessAction(env); bg->AdvanceModelTime(60, TimeUnit::s); diff --git a/projects/howto/Exercise/src/HowTo-Exercise.cpp b/projects/howto/Exercise/src/HowTo-Exercise.cpp index f21a4641c..ff13f6f4c 100644 --- a/projects/howto/Exercise/src/HowTo-Exercise.cpp +++ b/projects/howto/Exercise/src/HowTo-Exercise.cpp @@ -13,7 +13,7 @@ specific language governing permissions and limitations under the License. // Include the various types you will be using in your code #include #include -#include +#include #include #include #include diff --git a/projects/howto/Fasciculation/src/HowTo-Fasciculation.cpp b/projects/howto/Fasciculation/src/HowTo-Fasciculation.cpp index 188c56bcd..96099bccf 100644 --- a/projects/howto/Fasciculation/src/HowTo-Fasciculation.cpp +++ b/projects/howto/Fasciculation/src/HowTo-Fasciculation.cpp @@ -12,13 +12,12 @@ specific language governing permissions and limitations under the License. -#include - // Include the various types you will be using in your code +#include #include #include #include -#include +#include #include #include @@ -46,14 +45,14 @@ int HowToFaciculation() } //---Initialize all variables needed for scenario - SESubstance* Na = bg->GetSubstanceManager().GetSubstance("Sodium"); - SESubstance* K = bg->GetSubstanceManager().GetSubstance("Potassium"); - SESubstance* Cl = bg->GetSubstanceManager().GetSubstance("Chloride"); - SESubstance* Ca = bg->GetSubstanceManager().GetSubstance("Calcium"); + SESubstance* Na = bg->GetSubstanceManager().GetSubstance(StandardSubstances::Sodium); + SESubstance* K = bg->GetSubstanceManager().GetSubstance(StandardSubstances::Potassium); + SESubstance* Cl = bg->GetSubstanceManager().GetSubstance(StandardSubstances::Chloride); + SESubstance* Ca = bg->GetSubstanceManager().GetSubstance(StandardSubstances::Calcium); double monitorTime = 200.0; //how long we're going to be on the look out for ion imbalances in the blood - CDM::enumOnOff::value lowKActive; - lowKActive = CDM::enumOnOff::Off; + SEOnOff lowKActive; + lowKActive = SEOnOff::Off; // The tracker is responsible for advancing the engine time and outputting the data requests below at each time step @@ -75,8 +74,8 @@ int HowToFaciculation() K->GetMembraneResistance().SetValue(5.0, ElectricResistanceUnit::Ohm); while (bg->GetSimulationTime(TimeUnit::s) < monitorTime + 60.0) { - if (bg->GetPatient().IsEventActive(CDM::enumPatientEvent::MildHypokalemia) && (lowKActive == CDM::enumOnOff::Off)) { - lowKActive = CDM::enumOnOff::On; + if (bg->GetPatient().IsEventActive(SEPatientEventType::MildHypokalemia) && (lowKActive == SEOnOff::Off)) { + lowKActive = SEOnOff::On; message = "Patient has low serum potassium, muscle fasciculation may occur"; bg->GetLogger()->Info(message); } diff --git a/projects/howto/Hemorrhage/src/HowTo-Hemorrhage.cpp b/projects/howto/Hemorrhage/src/HowTo-Hemorrhage.cpp index 15ee6da4f..22a7c3ca2 100644 --- a/projects/howto/Hemorrhage/src/HowTo-Hemorrhage.cpp +++ b/projects/howto/Hemorrhage/src/HowTo-Hemorrhage.cpp @@ -15,7 +15,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include #include #include #include @@ -43,7 +43,7 @@ int HowToHemorrhage() // Create the engine and load the patient std::unique_ptr bg = CreateBioGearsEngine("HowToHemorrhage.log"); bg->GetLogger()->Info("HowToHemorrhage"); - if (!bg->LoadState("./states/StandardMale@0s.xml")) { + if (!bg->InitializeEngine("./patients/StandardMale.xml")) { bg->GetLogger()->Error("Could not load state, check the error"); return 1; } @@ -72,7 +72,6 @@ int HowToHemorrhage() bg->GetLogger()->Info(asprintf("Diastolic Pressure : %f %s", bg->GetCardiovascularSystem()->GetDiastolicArterialPressure(PressureUnit::mmHg), "mmHg")); bg->GetLogger()->Info(asprintf("Heart Rate : %f %s", bg->GetCardiovascularSystem()->GetHeartRate(FrequencyUnit::Per_min), "bpm")); - return 0; //We are going to create a hemorrhage in two different ways. One way will be to specify the location and a severity on a scale of 0-1. //The other way will be to parse an injury code and derive the location and severity @@ -135,7 +134,7 @@ int HowToHemorrhage() // Patient is stabilizing, but not great // Let's administer a saline drip, we need to get saline from the substance maganer - SESubstanceCompound* saline = bg->GetSubstanceManager().GetCompound("Saline"); + SESubstanceCompound* saline = bg->GetSubstanceManager().GetCompound(StandardSubstances::Saline); SESubstanceCompoundInfusion iVSaline(*saline); iVSaline.GetBagVolume().SetValue(500, VolumeUnit::mL); //the total volume in the bag of Saline iVSaline.GetRate().SetValue(100, VolumePerTimeUnit::mL_Per_min); //The rate to admnister the compound in the bag in this case saline @@ -153,6 +152,8 @@ int HowToHemorrhage() bg->GetLogger()->Info(asprintf("Heart Rate : %f %s", bg->GetCardiovascularSystem()->GetHeartRate(FrequencyUnit::Per_min), "bpm")); ; bg->GetLogger()->Info("Finished"); + + return 0; } void ParseMCIS(SEHemorrhage& hem, std::vector& mcis) diff --git a/projects/howto/InductionDemo/src/HowTo-induction.cpp b/projects/howto/InductionDemo/src/HowTo-induction.cpp new file mode 100644 index 000000000..0efcf2d4a --- /dev/null +++ b/projects/howto/InductionDemo/src/HowTo-induction.cpp @@ -0,0 +1,447 @@ +/************************************************************************************** +Copyright 2015 Applied Research Associates, Inc. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the License +at: +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +**************************************************************************************/ +#define _USE_MATH_DEFINES + +#include "HowTo-induction.h" +#include + +#include +#include +// Include the various types you will be using in your code +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace fs = std::filesystem; + +int main(int argc, char* argv[]) +{ + std::filesystem::path states = "./states"; + std::string state; + + for (const auto& dirEntry : fs::recursive_directory_iterator(states, std::filesystem::directory_options::skip_permission_denied)) { + std::cout << dirEntry << std::endl; + state = dirEntry.path().filename().string(); + std::string logName = "./inductionData/HowToHemorrhagepHValidation"; + logName.append(state); + logName.append(".log"); + InductionThread induction(logName, state); + induction.FluidLoading(); + } +} + + +using namespace biogears; + +InductionThread::InductionThread(const std::string logFile, std::string stateFile) + : m_inductionThread() +{ + //Create the engine and load patient state + int dochem = (int)(2); + m_bg = CreateBioGearsEngine(logFile); + m_bg->GetLogger()->Info(asprintf("Initiating %f %s", logFile.c_str(), "% hemorrhage flow rate, for patient")); + std::string statePath = "./states/"; + statePath.append(stateFile); + m_bg->GetLogger()->Info(statePath); + if (!m_bg->LoadState(statePath)) { + m_bg->GetLogger()->Error("Could not load state, check the error"); + throw std::runtime_error("Could not load state, check the error"); + } + + //Create CSV results file and set up data that we want to be tracked (tracking done in AdvanceModelTime) + std::string resultsFileInduction = std::to_string(dochem); + std::string resultsFile = "./inductionData/HowToInduction"; + resultsFile.append(resultsFileInduction); + resultsFile.append(stateFile); + resultsFile.append(".csv"); + + //Load substances and compounds + SESubstance* vas = m_bg->GetSubstanceManager().GetSubstance("Vasopressin"); + SESubstance* lactate = m_bg->GetSubstanceManager().GetSubstance("Lactate"); + SESubstance* fent = m_bg->GetSubstanceManager().GetSubstance("Fentanyl"); + SESubstance* prop = m_bg->GetSubstanceManager().GetSubstance("Propofol"); + SESubstance* roc = m_bg->GetSubstanceManager().GetSubstance("Rocuronium"); + SESubstance* des = m_bg->GetSubstanceManager().GetSubstance("Desflurane"); + + + + //we will perform a 1:1:1 infusion ration during our mtp + SESubstanceCompound* ringers = m_bg->GetSubstanceManager().GetCompound("RingersLactate"); + SESubstanceCompound* blood = m_bg->GetSubstanceManager().GetCompound("Blood_ONegative"); + SESubstanceCompound* plasma = m_bg->GetSubstanceManager().GetCompound("Plasma"); + SESubstanceCompound* platelets = m_bg->GetSubstanceManager().GetCompound("PlateletsInfusion"); + + + //Create infusion and bolus actions + m_RocuroniumBolus = new SESubstanceBolus(*roc); + m_FentanylBolus = new SESubstanceBolus(*fent); + m_PropofolBolus = new SESubstanceBolus(*prop); + m_ringers = new SESubstanceCompoundInfusion(*ringers); + m_blood = new SESubstanceCompoundInfusion(*blood); + m_plasma = new SESubstanceCompoundInfusion(*plasma); + m_platelet = new SESubstanceCompoundInfusion(*platelets); + + //set the hemorrhage + m_hemorrhage = new SEHemorrhage(); + m_hemorrhage->GetInitialRate().SetValue(200, VolumePerTimeUnit::mL_Per_min); + m_hemorrhage->SetCompartment("Aorta"); + m_bg->ProcessAction(*m_hemorrhage); + + m_bg->GetEngineTrack()->GetDataRequestManager().SetResultsFilename(resultsFile); //deposits in build/runtime + m_bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("HeartRate", "1/min"); + m_bg->GetEngineTrack()->GetDataRequestManager().CreateSubstanceDataRequest().Set(*fent, "PlasmaConcentration", MassPerVolumeUnit::ug_Per_L); + m_bg->GetEngineTrack()->GetDataRequestManager().CreateSubstanceDataRequest().Set(*prop, "PlasmaConcentration", MassPerVolumeUnit::ug_Per_L); + m_bg->GetEngineTrack()->GetDataRequestManager().CreateSubstanceDataRequest().Set(*roc, "PlasmaConcentration", MassPerVolumeUnit::ug_Per_L); + m_bg->GetEngineTrack()->GetDataRequestManager().CreateSubstanceDataRequest().Set(*des, "PlasmaConcentration", MassPerVolumeUnit::ug_Per_L); + m_bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("ArterialBloodPH", "unitless"); + m_bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("CardiacOutput", "mL/min"); + m_bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("MeanArterialPressure", "mmHg"); + m_bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("SystolicArterialPressure", "mmHg"); + m_bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("DiastolicArterialPressure", "mmHg"); + m_bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("EndTidalCarbonDioxideFraction", "unitless"); + m_bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("RespirationMusclePressure", PressureUnit::mmHg); + m_bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("PulmonaryResistance", FlowResistanceUnit::cmH2O_s_Per_L); + m_bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("PulmonaryCompliance", FlowComplianceUnit::L_Per_cmH2O); + m_bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("RespirationRate", "1/min"); + m_bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("TidalVolume", "mL"); + m_bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("BloodVolume", "mL"); + m_bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("MeanUrineOutput", "mL/hr"); + m_bg->GetEngineTrack()->GetDataRequestManager().CreateLiquidCompartmentDataRequest().Set("VenaCava", *lactate, "Molarity", AmountPerVolumeUnit::mmol_Per_L); + m_bg->GetEngineTrack()->GetDataRequestManager().CreateLiquidCompartmentDataRequest().Set("Aorta", "OutFlow", VolumePerTimeUnit::mL_Per_min); + m_bg->GetEngineTrack()->GetDataRequestManager().CreateSubstanceDataRequest().Set(*prop, "Clearance-RenalClearance", VolumePerTimeMassUnit::mL_Per_min_kg); + m_bg->GetEngineTrack()->GetDataRequestManager().CreateSubstanceDataRequest().Set(*fent, "Clearance-RenalClearance", VolumePerTimeMassUnit::mL_Per_min_kg); + m_bg->GetEngineTrack()->GetDataRequestManager().CreateSubstanceDataRequest().Set(*roc, "Clearance-RenalClearance", VolumePerTimeMassUnit::mL_Per_min_kg); + m_bg->GetEngineTrack()->GetDataRequestManager().CreateSubstanceDataRequest().Set(*des, "Clearance-RenalClearance", VolumePerTimeMassUnit::mL_Per_min_kg); + m_bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("TotalPulmonaryVentilation", VolumePerTimeUnit::L_Per_min); + m_bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("IntracranialPressure", PressureUnit::mmHg); + m_bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("CarricoIndex", PressureUnit::mmHg); + m_bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("AlveolarArterialGradient", PressureUnit::mmHg); + m_bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("SedationLevel"); + m_bg->GetEngineTrack()->GetDataRequestManager().CreatePatientDataRequest().Set("FunctionalResidualCapacity", VolumeUnit::L); + m_bg->GetEngineTrack()->GetDataRequestManager().CreatePatientDataRequest().Set("VitalCapacity", VolumeUnit::L); + m_runThread = true; +} + +InductionThread::~InductionThread() +{ + m_runThread = false; + std::this_thread::sleep_for(std::chrono::seconds(2)); + SAFE_DELETE(m_RocuroniumBolus); + SAFE_DELETE(m_FentanylBolus); + SAFE_DELETE(m_PropofolBolus); + SAFE_DELETE(m_hemorrhage); +} + +void InductionThread::AdministerInduction() +{ + //set up bolus + m_RocuroniumBolus->SetAdminRoute(biogears::SEBolusAdministration::Intravenous); + m_FentanylBolus->SetAdminRoute(SEBolusAdministration::Intravenous); + m_PropofolBolus->SetAdminRoute(SEBolusAdministration::Intravenous); + + //pull patient weight + const SEPatient& patient = m_bg->GetPatient(); + double weight_kg = patient.GetWeight(MassUnit::kg); + + double fentbolus_mg = 0.002*weight_kg; + double propofolBolus_mg = 2*weight_kg; + double rocuroniumBolus_mg = 0.6*weight_kg; + + double bolus = 10.0; + + //set concentrations + m_FentanylBolus->SetAdminRoute(SEBolusAdministration::Intravenous); + m_FentanylBolus->GetConcentration().SetValue(fentbolus_mg / 10, MassPerVolumeUnit::mg_Per_mL); + m_FentanylBolus->GetDose().SetValue(bolus, VolumeUnit::mL); + + m_PropofolBolus->SetAdminRoute(SEBolusAdministration::Intravenous); + m_PropofolBolus->GetConcentration().SetValue(propofolBolus_mg / 10, MassPerVolumeUnit::mg_Per_mL); + m_PropofolBolus->GetDose().SetValue(bolus, VolumeUnit::mL); + + m_RocuroniumBolus->SetAdminRoute(SEBolusAdministration::Intravenous); + m_RocuroniumBolus->GetConcentration().SetValue(rocuroniumBolus_mg / 10, MassPerVolumeUnit::mg_Per_mL); + m_RocuroniumBolus->GetDose().SetValue(bolus, VolumeUnit::mL); + + //process the actions + m_mutex.lock(); + m_bg->ProcessAction(*m_FentanylBolus); + m_mutex.unlock(); + m_mutex.lock(); + m_bg->ProcessAction(*m_PropofolBolus); + m_mutex.unlock(); + m_mutex.lock(); + m_bg->ProcessAction(*m_RocuroniumBolus); + m_mutex.unlock(); +} + +void InductionThread::SetBloodInfusionRate(double& volume, double& rate) +{ + m_blood->GetBagVolume().SetValue(volume, VolumeUnit::mL); + m_blood->GetRate().SetValue(rate, VolumePerTimeUnit::mL_Per_hr); + m_ivBagVolumeBlood_mL = volume; + m_mutex.lock(); + m_bg->ProcessAction(*m_blood); + m_mutex.unlock(); +} + +void InductionThread::SetPlasmaInfusionRate(double& volume, double& rate) +{ + m_plasma->GetBagVolume().SetValue(volume, VolumeUnit::mL); + m_plasma->GetRate().SetValue(rate, VolumePerTimeUnit::mL_Per_min); + m_ivBagVolumePlasma_mL = volume; + m_mutex.lock(); + m_bg->ProcessAction(*m_plasma); + m_mutex.unlock(); +} + +void InductionThread::SetPlateletInfusionRate(double& volume, double& rate) +{ + m_platelet->GetBagVolume().SetValue(volume, VolumeUnit::mL); + m_platelet->GetRate().SetValue(rate, VolumePerTimeUnit::mL_Per_hr); + m_ivBagVolumePlatelet_mL = volume; + m_mutex.lock(); + m_bg->ProcessAction(*m_blood); + m_mutex.unlock(); +} + +void InductionThread::Ventilation() +{ + SEAnesthesiaMachineConfiguration AMConfig(m_bg->GetSubstanceManager()); + // You can set configuration by modifing the configuration class directly + // Or you can point to an XML with configuration data. + // Modifying the class will keep any old settings that are not provided in the config + // Using a xml will set the anesthesia machine to only the property states specified in the file + SEIntubation intubate; + intubate.SetType(SEIntubationType::Tracheal); + m_bg->ProcessAction(intubate); + + SEAnesthesiaMachine& config = AMConfig.GetConfiguration(); + config.SetConnection(SEAnesthesiaMachineConnection::Tube); + config.GetInletFlow().SetValue(2.0, VolumePerTimeUnit::L_Per_min); + config.GetInspiratoryExpiratoryRatio().SetValue(.5); + config.GetOxygenFraction().SetValue(.6); + config.SetOxygenSource(SEAnesthesiaMachineOxygenSource::Wall); + config.GetPositiveEndExpiredPressure().SetValue(5.0, PressureUnit::cmH2O); + config.SetPrimaryGas(SEAnesthesiaMachinePrimaryGas::Nitrogen); + config.GetReliefValvePressure().SetValue(20.0, PressureUnit::cmH2O); + config.GetRespiratoryRate().SetValue(12, FrequencyUnit::Per_min); + config.GetVentilatorPressure().SetValue(22.0, PressureUnit::cmH2O); + config.GetOxygenBottleOne().GetVolume().SetValue(660.0, VolumeUnit::L); + config.GetOxygenBottleTwo().GetVolume().SetValue(660.0, VolumeUnit::L); + + // Process the action to propagate state into the engine + m_bg->ProcessAction(AMConfig); + m_bg->AdvanceModelTime(5.0, TimeUnit::s); + + //introcuce desfulrane + SEAnesthesiaMachineChamber& rightChamber = config.GetLeftChamber(); + rightChamber.SetState(SEOnOff::On); + rightChamber.GetSubstanceFraction().SetValue(0.02); + rightChamber.SetSubstance(*m_bg->GetSubstanceManager().GetSubstance("Desflurane")); + m_bg->ProcessAction(AMConfig); + + m_bg->AdvanceModelTime(5.0, TimeUnit::s); + + m_bg->GetLogger()->Info(asprintf("Turning on the Anesthesia Machine and placing mask on patient for spontaneous breathing with machine connection.")); +} + +void InductionThread::AdvanceTime() +{ + m_mutex.lock(); + m_bg->AdvanceModelTime(1.0, TimeUnit::s); + //if (m_blood->HasBagVolume() && m_blood->HasRate()) { + // m_TotalVolume_mL += (m_blood->GetRate().GetValue(VolumePerTimeUnit::mL_Per_s)); + // m_TotalVolumeBlood_mL += (m_blood->GetRate().GetValue(VolumePerTimeUnit::mL_Per_s)); + // m_ivBagVolumeBlood_mL += (-m_blood->GetRate().GetValue(VolumePerTimeUnit::mL_Per_s)); + // if (m_ivBagVolumeBlood_mL < 0.0) { + // m_bg->GetLogger()->Info("blood bag is empty \n"); + // m_ivBagVolumeBlood_mL = 0.0; + // m_blood->Clear(); + // } + //} + //repeat for plasma + //if (m_plasma->HasBagVolume() && m_plasma->HasRate()) { + // m_TotalVolume_mL += (m_plasma->GetRate().GetValue(VolumePerTimeUnit::mL_Per_s)); + // m_TotalVolumePlasma_mL += (m_plasma->GetRate().GetValue(VolumePerTimeUnit::mL_Per_s)); + // m_ivBagVolumePlasma_mL += (-m_plasma->GetRate().GetValue(VolumePerTimeUnit::mL_Per_s)); + // if (m_ivBagVolumePlasma_mL < 0.0) { + // m_bg->GetLogger()->Info("blood bag is empty \n"); + // m_ivBagVolumePlasma_mL = 0.0; + // m_plasma->Clear(); + // } + //} + m_bg->GetEngineTrack()->TrackData(m_bg->GetSimulationTime(TimeUnit::s)); + m_mutex.unlock(); + std::this_thread::sleep_for(std::chrono::milliseconds(25)); +} + +void InductionThread::Status() +{ + m_mutex.lock(); + m_bg->GetLogger()->Info(asprintf("The patient suffered a hemorrhage wound %f %s", m_bg->GetSimulationTime(TimeUnit::min), " min ago")); + m_bg->GetLogger()->Info(asprintf("Tidal Volume : %f %s", m_bg->GetRespiratorySystem()->GetTidalVolume(VolumeUnit::mL), "mL")); + m_bg->GetLogger()->Info(asprintf("Systolic Pressure : %f %s", m_bg->GetCardiovascularSystem()->GetSystolicArterialPressure(PressureUnit::mmHg), "mmHg")); + m_bg->GetLogger()->Info(asprintf("Diastolic Pressure : %f %s", m_bg->GetCardiovascularSystem()->GetDiastolicArterialPressure(PressureUnit::mmHg), "mmHg")); + m_bg->GetLogger()->Info(asprintf("Heart Rate : %f %s", m_bg->GetCardiovascularSystem()->GetHeartRate(FrequencyUnit::Per_min), "bpm")); + m_bg->GetLogger()->Info(asprintf("Respiration Rate : %f %s", m_bg->GetRespiratorySystem()->GetRespirationRate(FrequencyUnit::Per_min), "bpm")); + m_bg->GetLogger()->Info(asprintf("Oxygen Saturation : %f", m_bg->GetBloodChemistrySystem()->GetOxygenSaturation())); + m_bg->GetLogger()->Info(asprintf("Blood Volume: %f %s", m_bg->GetCardiovascularSystem()->GetBloodVolume(VolumeUnit::mL), "mL")); + m_bg->GetLogger()->Info(asprintf("Systemic Vascular Resistance : %f %s", m_bg->GetCardiovascularSystem()->GetSystemicVascularResistance(FlowResistanceUnit::mmHg_s_Per_mL), "mmHg_s_Per_mL")); + m_bg->GetLogger()->Info(asprintf("Mean Urine Output : %f %s", m_bg->GetRenalSystem()->GetMeanUrineOutput(VolumePerTimeUnit::mL_Per_hr), "mL_Per_hr")); + if (m_ringers->HasBagVolume()) { + m_bg->GetLogger()->Info(asprintf("Remaining blood Volume in bag: %f %s", m_ivBagVolumeBlood_mL, "mL")); + } + + std::cout << std::endl; + m_mutex.unlock(); +} + + +//routine to administer fluids with a goal directed therapy for urine ourput +void InductionThread::FluidLoading() +{ + //redblood cell unit volume: + double pRBCVolume_mL = 350; + + //plasma unit volume + double plasmaVolume_mL = 200; + + //platlet volume + double platletVolume_mL = 300; + + //rates: + double bloodRate_mL_Per_hr = 250; + double plasmaRate_mL_Per_min = 15; + + //we will activate the protocol when shock index reaches 1: + double shockIndex = 0.0; + + //shock index requires the heart rate and the systolic pressure: + double heartRate_min = m_bg->GetCardiovascularSystem()->GetHeartRate(FrequencyUnit::Per_min); + double systolicPressure_mmHg = m_bg->GetCardiovascularSystem()->GetSystolicArterialPressure(PressureUnit::mmHg); + + //update shock index: + shockIndex = heartRate_min / systolicPressure_mmHg; + + //time keeping + int checkTime_s = 3600; + + //how long do we want to run for? + double maxSimTime_min = 40.0; + double hemTime_min = 20.0; + double venTime_min = 15.0; + double transitTime_min = 5.0; + + //compute urine production and max fluid requirements, per parkland formula + const SEPatient& patient = m_bg->GetPatient(); + double weight_kg = patient.GetWeight(MassUnit::kg); + + double initialInfustion_mL_Per_hr = 0.0; //tbsa * 10.0; // Should start at 10*tbsa // (DayLimit_mL / 0.5) / 8.0; //half of the fluid should be loaded in the first 8 hours; + double initialInfustionAlbumin_mL_Per_hr = 50.0; //tbsa * 10.0; // Should start at 10*tbsa // (DayLimit_mL / 0.5) / 8.0; //half of the fluid should be loaded in the first 8 hours; + double temp = 0.0; + bool Labs = true; + bool fluidOn = false; + + //induce patient + m_bg->AdvanceModelTime(transitTime_min, TimeUnit::min); + + m_bg->GetLogger()->Info(asprintf("Beginning care")); + //INDUCE PATIENT + AdministerInduction(); + m_bg->AdvanceModelTime(30, TimeUnit::s); + + SetPlasmaInfusionRate(plasmaVolume_mL, plasmaRate_mL_Per_min); + SetBloodInfusionRate(pRBCVolume_mL, bloodRate_mL_Per_hr); + + m_bg->AdvanceModelTime(30, TimeUnit::s); + + //vent patient + Ventilation(); + + while (m_runThread) { + //pull the data + + //check for bleeding intervention: + if (m_bg->GetSimulationTime(TimeUnit::min) > hemTime_min && m_hemorrhage->GetInitialRate().GetValue(VolumePerTimeUnit::mL_Per_min) > ZERO_APPROX) { + m_hemorrhage->GetInitialRate().SetValue(0, VolumePerTimeUnit::mL_Per_min); + m_bg->ProcessAction(*m_hemorrhage); + } + heartRate_min = m_bg->GetCardiovascularSystem()->GetHeartRate(FrequencyUnit::Per_min); + systolicPressure_mmHg = m_bg->GetCardiovascularSystem()->GetSystolicArterialPressure(PressureUnit::mmHg); + + shockIndex = heartRate_min / systolicPressure_mmHg; + + if (shockIndex >= 1.0) { + fluidOn = true; + } + + //initial fluids: + if (fluidOn && m_ivBagVolumeBlood_mL == 0.0 && m_ivBagVolumePlasma_mL == 0.0) { + //set 1:1 fluid infusion: + SetPlasmaInfusionRate(plasmaVolume_mL, plasmaRate_mL_Per_min); + SetBloodInfusionRate(pRBCVolume_mL, bloodRate_mL_Per_hr); + m_bg->GetLogger()->Info(asprintf("Beginning Intervention with infusion at %f %s", bloodRate_mL_Per_hr, "mL_Per_hr")); + } + + //check vent time + if (m_bg->GetSimulationTime(TimeUnit::min) > venTime_min) { + + } + + //check status every hour, reset the volume while we are at it + if (((int)m_bg->GetSimulationTime(TimeUnit::s) + 1) % checkTime_s == 0) { + Status(); + } + + //exit checks: + if (m_bg->GetPatient().IsEventActive(SEPatientEventType::IrreversibleState)) { + //m_bg->GetLogger()->Info(std::stringstream() << "oh no!"); + m_bg->GetLogger()->Info("///////////////////////////////////////////////////////////////"); + m_runThread = false; + } + + if (m_bg->GetSimulationTime(TimeUnit::min) > maxSimTime_min) { + m_bg->GetLogger()->Info("This simulation has gone on too long"); + m_runThread = false; + } + + //advance time + AdvanceTime(); + } +} + diff --git a/projects/howto/InductionDemo/src/HowTo-induction.h b/projects/howto/InductionDemo/src/HowTo-induction.h new file mode 100644 index 000000000..ed0c087bd --- /dev/null +++ b/projects/howto/InductionDemo/src/HowTo-induction.h @@ -0,0 +1,82 @@ +/************************************************************************************** +Copyright 2015 Applied Research Associates, Inc. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the License +at: +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +**************************************************************************************/ + +#pragma once +#include +#include + +#include +#include + +int HowToInduction(); + +namespace biogears { +class SEHemorrhage; +class SESubstance; +class SESubstanceBolus; +class SESubstanceCompoundInfusion; +} + +class InductionThread { +public: + InductionThread(const std::string logFile, std::string stateFile); + virtual ~InductionThread(); + + void AdministerInduction(); + void SetRingersInfusionRate(double& volume, double& rate); + void SetBloodInfusionRate(double& volume, double& rate); + void SetPlasmaInfusionRate(double& volume, double& rate); + void SetPlateletInfusionRate(double& volume, double& rate); + void Ventilation(); + void Status(); + void FluidLoading(); + + enum fluidType + { + ringers, + blood + }; + + biogears::Logger* GetLogger() { return m_bg->GetLogger(); } + + protected: + void AdvanceTime(); + + + + std::thread m_inductionThread; + std::mutex m_mutex; + bool m_runThread; + + std::unique_ptr m_bg; + + biogears::SEHemorrhage* m_hemorrhage; + biogears::SESubstanceBolus* m_FentanylBolus; + biogears::SESubstanceBolus* m_PropofolBolus; + biogears::SESubstanceBolus* m_RocuroniumBolus; + biogears::SESubstanceCompoundInfusion* m_ringers; + biogears::SESubstanceCompoundInfusion* m_blood; + biogears::SESubstanceCompoundInfusion* m_plasma; + biogears::SESubstanceCompoundInfusion* m_platelet; + + double m_ivBagVolume_mL; + double m_ivBagVolumeBlood_mL; + double m_ivBagVolumePlasma_mL; + double m_ivBagVolumePlatelet_mL; + + double m_TotalVolumeBlood_mL = 0.0; + double m_TotalVolumePlasma_mL = 0.0; + double m_TotalVolume_mL = 0.0; + fluidType fluid = ringers; //set the type of fluid here + + +}; \ No newline at end of file diff --git a/projects/howto/InfusionCustomDrug/src/HowTo-InfusionCustomDrug.cpp b/projects/howto/InfusionCustomDrug/src/HowTo-InfusionCustomDrug.cpp index 12ff1d0ac..be887c511 100644 --- a/projects/howto/InfusionCustomDrug/src/HowTo-InfusionCustomDrug.cpp +++ b/projects/howto/InfusionCustomDrug/src/HowTo-InfusionCustomDrug.cpp @@ -16,7 +16,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include #include #include #include @@ -42,7 +42,7 @@ bool mixSubstanceCompound(std::unique_ptr& engine, s { SESubstance* new_substance = engine->GetSubstanceManager().GetSubstance(substance); if (new_substance) { - auto substance_concentration = SESubstanceConcentration(*new_substance); + auto substance_concentration = SESubstanceConcentration(new_substance->GetDefinition()); substance_concentration.GetConcentration().SetValue(10.0, MassPerVolumeUnit::mg_Per_mL); compound->GetComponents().push_back(substance_concentration); @@ -102,14 +102,14 @@ int HowToInfusionDrug() bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("UrineOsmolarity", OsmolalityUnit::mOsm_Per_kg); auto customCompound = makeSubstanceCompound(bg); - auto mixSuccess = mixSubstanceCompound(bg,customCompound,"Saline", 2.17, MassPerVolumeUnit::kg_Per_L ); - mixSuccess &= mixSubstanceCompound(bg, customCompound, "Albumin", 10.0, MassPerVolumeUnit::mg_Per_mL); - mixSuccess &= mixSubstanceCompound(bg, customCompound, "Morphine", 10.0, MassPerVolumeUnit::mg_Per_mL); + auto mixSuccess = mixSubstanceCompound(bg,customCompound,StandardSubstances::Saline, 2.17, MassPerVolumeUnit::kg_Per_L ); + mixSuccess &= mixSubstanceCompound(bg, customCompound, StandardSubstances::Albumin, 10.0, MassPerVolumeUnit::mg_Per_mL); + mixSuccess &= mixSubstanceCompound(bg, customCompound, StandardSubstances::Morphine, 10.0, MassPerVolumeUnit::mg_Per_mL); if (!mixSuccess) { - bg->GetEngineTrack()->GetDataRequestManager().CreateSubstanceDataRequest().Set(*bg->GetSubstanceManager().GetSubstance("Saline"), "PlasmaConcentration", MassPerVolumeUnit::ug_Per_L); - bg->GetEngineTrack()->GetDataRequestManager().CreateSubstanceDataRequest().Set(*bg->GetSubstanceManager().GetSubstance("Albumin"), "PlasmaConcentration", MassPerVolumeUnit::ug_Per_L); - bg->GetEngineTrack()->GetDataRequestManager().CreateSubstanceDataRequest().Set(*bg->GetSubstanceManager().GetSubstance("Morphine"), "PlasmaConcentration", MassPerVolumeUnit::ug_Per_L); + bg->GetEngineTrack()->GetDataRequestManager().CreateSubstanceDataRequest().Set(*bg->GetSubstanceManager().GetSubstance(StandardSubstances::Saline), "PlasmaConcentration", MassPerVolumeUnit::ug_Per_L); + bg->GetEngineTrack()->GetDataRequestManager().CreateSubstanceDataRequest().Set(*bg->GetSubstanceManager().GetSubstance(StandardSubstances::Albumin), "PlasmaConcentration", MassPerVolumeUnit::ug_Per_L); + bg->GetEngineTrack()->GetDataRequestManager().CreateSubstanceDataRequest().Set(*bg->GetSubstanceManager().GetSubstance(StandardSubstances::Morphine), "PlasmaConcentration", MassPerVolumeUnit::ug_Per_L); auto compound_name = registerCompoundbiogears(bg, std::move(customCompound)); //< BG takes ownership of customCompound here and will delete it once it is removed (DLL Boundry issue need to create a make_compound function to avoid that in biogears) infuseCompound(bg, compound_name, 1.0, VolumeUnit::L, 100., VolumePerTimeUnit::mL_Per_hr); diff --git a/projects/howto/InfusionDrug/src/HowTo-InfusionDrug.cpp b/projects/howto/InfusionDrug/src/HowTo-InfusionDrug.cpp index 210632847..09bf5a273 100644 --- a/projects/howto/InfusionDrug/src/HowTo-InfusionDrug.cpp +++ b/projects/howto/InfusionDrug/src/HowTo-InfusionDrug.cpp @@ -16,7 +16,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include #include #include #include @@ -51,7 +51,7 @@ int HowToInfusionDrug() // The tracker is responsible for advancing the engine time and outputting the data requests below at each time step - SESubstance* vas = bg->GetSubstanceManager().GetSubstance("Vasopressin"); + SESubstance* vas = bg->GetSubstanceManager().GetSubstance(StandardSubstances::Vasopressin); vas->GetPlasmaConcentration().SetValue(0.0, MassPerVolumeUnit::ug_Per_L); // Create a substance bolus action to administer the substance @@ -104,7 +104,7 @@ int HowToInfusionDrug() // The tracker is responsible for advancing the engine time and outputting the data requests below at each time step - SESubstance* txa = bg->GetSubstanceManager().GetSubstance("TranexamicAcid"); + SESubstance* txa = bg->GetSubstanceManager().GetSubstance(StandardSubstances::TranexamicAcid); txa->GetPlasmaConcentration().SetValue(0.0, MassPerVolumeUnit::ug_Per_L); // Create a substance infusion action to administer the substance @@ -153,20 +153,20 @@ int HowToInfusionDrug() //Note that while you can create new SubstanceCompounds while BioGears is running from //Existing Substances. You should not modify any substanceCompound in the Substance Manager as it will //Affect all existing volumes of that SubstanceCompound. - SESubstance* albumin = bg->GetSubstanceManager().GetSubstance("Albumin"); - SESubstance* morphine = bg->GetSubstanceManager().GetSubstance("Morphine"); - SESubstance* saline = bg->GetSubstanceManager().GetSubstance("Saline"); + SESubstance* albumin = bg->GetSubstanceManager().GetSubstance(StandardSubstances::Albumin); + SESubstance* morphine = bg->GetSubstanceManager().GetSubstance(StandardSubstances::Morphine); + SESubstance* saline = bg->GetSubstanceManager().GetSubstance(StandardSubstances::Saline); if (albumin && morphine && saline) { - auto albuminConcentration = SESubstanceConcentration(*albumin); - auto morphineConcentration = SESubstanceConcentration(*morphine); - auto salineConcentration = SESubstanceConcentration(*saline); + auto albuminConcentration = SESubstanceConcentration(albumin->GetDefinition()); + auto morphineConcentration = SESubstanceConcentration(morphine->GetDefinition()); + auto salineConcentration = SESubstanceConcentration(saline->GetDefinition()); albuminConcentration.GetConcentration().SetValue (10.0, MassPerVolumeUnit::mg_Per_mL); morphineConcentration.GetConcentration().SetValue(10.0, MassPerVolumeUnit::mg_Per_mL); salineConcentration.GetConcentration().SetValue (2.17, MassPerVolumeUnit::kg_Per_L); auto morphine_albumin_compound = std::make_unique("morphine_albumin_compound", bg->GetLogger()); - morphine_albumin_compound->SetClassification(CDM::enumSubstanceClass::Sedative); + morphine_albumin_compound->SetClassification(biogears::SESubstanceClass::Sedative); morphine_albumin_compound->GetComponents().push_back(albuminConcentration); morphine_albumin_compound->GetComponents().push_back(morphineConcentration); morphine_albumin_compound->GetComponents().push_back(salineConcentration); diff --git a/projects/howto/LobarPneumonia/src/HowTo-LobarPneumonia.cpp b/projects/howto/LobarPneumonia/src/HowTo-LobarPneumonia.cpp index 56cf74120..73d9d5f88 100644 --- a/projects/howto/LobarPneumonia/src/HowTo-LobarPneumonia.cpp +++ b/projects/howto/LobarPneumonia/src/HowTo-LobarPneumonia.cpp @@ -14,7 +14,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include #include #include #include diff --git a/projects/howto/MechanicalVentilation/src/HowTo-MechanicalVentilation.cpp b/projects/howto/MechanicalVentilation/src/HowTo-MechanicalVentilation.cpp index 2562e908d..c7a33e7c9 100644 --- a/projects/howto/MechanicalVentilation/src/HowTo-MechanicalVentilation.cpp +++ b/projects/howto/MechanicalVentilation/src/HowTo-MechanicalVentilation.cpp @@ -29,7 +29,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include #include #include #include @@ -53,31 +53,31 @@ class MechVentHandler : public SEEventHandler { , m_Logger(logger) { } - virtual void HandlePatientEvent(CDM::enumPatientEvent::value type, bool active, const SEScalarTime* time = nullptr) + virtual void HandlePatientEvent(biogears::SEPatientEventType type, bool active, const SEScalarTime* time = nullptr) { switch (type) { - case CDM::enumPatientEvent::AcuteLungInjury: { + case biogears::SEPatientEventType::AcuteLungInjury: { if (active) m_Logger->Info("Do something for MildAcuteRespiratoryDistress"); else m_Logger->Info("Stop doing something for MildAcuteRespiratoryDistress"); break; } - case CDM::enumPatientEvent::AcuteRespiratoryDistress: { + case biogears::SEPatientEventType::AcuteRespiratoryDistress: { if (active) m_Logger->Info("Do something for ModerateAcuteRespiratoryDistress"); else m_Logger->Info("Stop doing something for ModerateAcuteRespiratoryDistress"); break; } - case CDM::enumPatientEvent::SevereAcuteRespiratoryDistress: { + case biogears::SEPatientEventType::SevereAcuteRespiratoryDistress: { if (active) m_Logger->Info("Do something for SevereAcuteRespiratoryDistress"); else m_Logger->Info("Stop doing something for SevereAcuteRespiratoryDistress"); break; } - case CDM::enumPatientEvent::CardiogenicShock: { + case biogears::SEPatientEventType::CardiogenicShock: { if (active) m_Logger->Info("Do something for CardiogenicShock"); else @@ -88,7 +88,7 @@ class MechVentHandler : public SEEventHandler { return; //Unhandled Event } } - virtual void HandleAnesthesiaMachineEvent(CDM::enumAnesthesiaMachineEvent::value type, bool active, const SEScalarTime* time = nullptr) + virtual void HandleAnesthesiaMachineEvent(biogears::SEAnesthesiaMachineEvent type, bool active, const SEScalarTime* time = nullptr) { } }; @@ -195,10 +195,10 @@ int HowToMechanicalVentialtion() bg->GetEngineTrack()->GetDataRequestManager().CreatePatientDataRequest().Set("VitalCapacity", VolumeUnit::L); //Compartment data //Arteriole bicarbonate - SESubstance* HCO3 = bg->GetSubstanceManager().GetSubstance("Bicarbonate"); + SESubstance* HCO3 = bg->GetSubstanceManager().GetSubstance(StandardSubstances::Bicarbonate); bg->GetEngineTrack()->GetDataRequestManager().CreateLiquidCompartmentDataRequest().Set(BGE::VascularCompartment::Aorta, *HCO3, "Concentration", MassPerVolumeUnit::ug_Per_mL); //Lactate - this should have a relationship to lactic acid - SESubstance* Lactate = bg->GetSubstanceManager().GetSubstance("Lactate"); + SESubstance* Lactate = bg->GetSubstanceManager().GetSubstance(StandardSubstances::Lactate); bg->GetEngineTrack()->GetDataRequestManager().CreateSubstanceDataRequest().Set(*Lactate, "BloodConcentration", MassPerVolumeUnit::ug_Per_mL); bg->GetEngineTrack()->GetDataRequestManager().SetResultsFilename("HowToMechanicalVentilation.csv"); @@ -258,12 +258,11 @@ int HowToMechanicalVentialtion() // Set the severity (a fraction between 0 and 1) SETensionPneumothorax pneumo; // You can have a Closed or Open Tension Pneumothorax - pneumo.SetType(CDM::enumPneumothoraxType::Open); - //pneumo.SetType(CDM::enumPneumothoraxType::Open); + pneumo.SetType(SEPneumothoraxType::Open); pneumo.GetSeverity().SetValue(0.3); // It can be on the Left or right side - pneumo.SetSide(CDM::enumSide::Right); - //pneumo.SetSide(CDM::enumSide::Left); + pneumo.SetSide(SESide::Right); + //pneumo.SetSide(SESide::Left); bg->ProcessAction(pneumo); bg->AdvanceModelTime(60.0, TimeUnit::s); @@ -281,7 +280,7 @@ int HowToMechanicalVentialtion() //TBI //See HowTo-BrainInjury for an example of getting the Glasgow Scale SEBrainInjury tbi; - tbi.SetType(CDM::enumBrainInjuryType::Diffuse); // Can also be LeftFocal or RightFocal, and you will get pupillary effects in only one eye + tbi.SetType(SEBrainInjuryType::Diffuse); // Can also be LeftFocal or RightFocal, and you will get pupillary effects in only one eye tbi.GetSeverity().SetValue(0.2); bg->ProcessAction(tbi); @@ -305,12 +304,12 @@ int HowToMechanicalVentialtion() //Succs //Make the patient stop breathing // Get the Succinylcholine substance from the substance manager - const SESubstance* succs = bg->GetSubstanceManager().GetSubstance("Succinylcholine"); + const SESubstance* succs = bg->GetSubstanceManager().GetSubstance(StandardSubstances::Succinylcholine); // Create a substance bolus action to administer the substance SESubstanceBolus bolus(*succs); bolus.GetConcentration().SetValue(4820, MassPerVolumeUnit::ug_Per_mL); bolus.GetDose().SetValue(20, VolumeUnit::mL); - bolus.SetAdminRoute(CDM::enumBolusAdministration::Intravenous); + bolus.SetAdminRoute(SEBolusAdministration::Intravenous); bg->ProcessAction(bolus); bg->AdvanceModelTime(60.0, TimeUnit::s); @@ -318,11 +317,11 @@ int HowToMechanicalVentialtion() //Mechanical Ventilation // Create an SEMechanicalVentilation object SEMechanicalVentilation mechVent; - mechVent.SetState(CDM::enumOnOff::On); // Turn it on + mechVent.SetState(SEOnOff::On); // Turn it on // Grab the substance fractions so we can quickly modify them - SESubstanceFraction& O2frac = mechVent.GetGasFraction(*bg->GetSubstanceManager().GetSubstance("Oxygen")); - SESubstanceFraction& CO2frac = mechVent.GetGasFraction(*bg->GetSubstanceManager().GetSubstance("CarbonDioxide")); - SESubstanceFraction& N2frac = mechVent.GetGasFraction(*bg->GetSubstanceManager().GetSubstance("Nitrogen")); + SESubstanceFraction& O2frac = mechVent.GetGasFraction(*bg->GetSubstanceManager().GetSubstance(StandardSubstances::Oxygen)); + SESubstanceFraction& CO2frac = mechVent.GetGasFraction(*bg->GetSubstanceManager().GetSubstance(StandardSubstances::CarbonDioxide)); + SESubstanceFraction& N2frac = mechVent.GetGasFraction(*bg->GetSubstanceManager().GetSubstance(StandardSubstances::Nitrogen)); //We'll mimic inputs from real-time sensors by just driving the mechanical ventilation pressure using a sinusoid //Pressure waveform parameters diff --git a/projects/howto/NaloxoneNasal/src/HowTo-NaloxoneNasal.cpp b/projects/howto/NaloxoneNasal/src/HowTo-NaloxoneNasal.cpp index 5b9c12870..acb9497d0 100644 --- a/projects/howto/NaloxoneNasal/src/HowTo-NaloxoneNasal.cpp +++ b/projects/howto/NaloxoneNasal/src/HowTo-NaloxoneNasal.cpp @@ -24,7 +24,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include #include #include #include @@ -37,7 +37,7 @@ specific language governing permissions and limitations under the License. int main(int argc, char* argv[]) { // To run multiple Morphine/Fentanyl overdose values - std::string overdoseSubstance = "Fentanyl"; // Morphine or fentanyl + std::string overdoseSubstance = biogears::Fentanyl; // Morphine or fentanyl double lowestOverDose = 0.02; // mg/mL for a 10 ml bolus push double highestOverDose = 0.20; // mg/mL double doseInc = 0.01; @@ -82,7 +82,7 @@ NaloxoneThread::NaloxoneThread(const std::string logFile, double opioidDose, con throw std::runtime_error("Could not load state, check the error"); } SESubstance* opioidSub = m_bg->GetSubstanceManager().GetSubstance(opioidName); - SESubstance* nal = m_bg->GetSubstanceManager().GetSubstance("Naloxone"); + SESubstance* nal = m_bg->GetSubstanceManager().GetSubstance(StandardSubstances::Naloxone); //Create CSV results file and set up data that we want to be tracked (tracking done in AdvanceModelTime) double opDose_ug = opioidDose * 1000; @@ -121,7 +121,7 @@ NaloxoneThread::NaloxoneThread(const std::string logFile, double opioidDose, con m_opioid = new SESubstanceInfusion(*opioidSub); m_opiodBolus = new SESubstanceBolus(*opioidSub); - m_opiodBolus->SetAdminRoute(CDM::enumBolusAdministration::Intravenous); + m_opiodBolus->SetAdminRoute(SEBolusAdministration::Intravenous); m_naloxone = new SESubstanceNasalDose(*nal); @@ -290,7 +290,7 @@ void NaloxoneThread::FluidLoading(std::string overdoseSubstance, double opioidDo m_bg->GetEngineTrack()->GetDataTrack().Probe("totalNaloxone_mg", m_totalNaloxone_mg); //exit checks: - if (m_bg->GetPatient().IsEventActive(CDM::enumPatientEvent::IrreversibleState)) { + if (m_bg->GetPatient().IsEventActive(SEPatientEventType::IrreversibleState)) { //m_bg->GetLogger()->Info(std::stringstream() << "oh no!"); m_bg->GetLogger()->Info("///////////////////////////////////////////////////////////////"); m_runThread = false; diff --git a/projects/howto/PainStimulus/src/HowTo-PainStimulus.cpp b/projects/howto/PainStimulus/src/HowTo-PainStimulus.cpp index 0ee9c8443..e99eb302c 100644 --- a/projects/howto/PainStimulus/src/HowTo-PainStimulus.cpp +++ b/projects/howto/PainStimulus/src/HowTo-PainStimulus.cpp @@ -16,7 +16,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include #include #include #include @@ -63,15 +63,15 @@ int HowToPainStimulus() //Set up substances. Initialized morphine plasma concentration to 0. Note that saline is technically a compound--this is //so the engine knows to look for multiple components within the same substance file (i.e. Na, Cl, etc) - SESubstance* epi = bg->GetSubstanceManager().GetSubstance("Epinephrine"); + SESubstance* epi = bg->GetSubstanceManager().GetSubstance(StandardSubstances::Epinephrine); // Get the Morphine substance from the substance manager - const SESubstance* morphine = bg->GetSubstanceManager().GetSubstance("Morphine"); + const SESubstance* morphine = bg->GetSubstanceManager().GetSubstance(StandardSubstances::Morphine); // Create a substance bolus action to administer the substance SESubstanceBolus bolus(*morphine); bolus.GetConcentration().SetValue(1000, MassPerVolumeUnit::ug_Per_mL); bolus.GetDose().SetValue(10.5, VolumeUnit::mL); - bolus.SetAdminRoute(CDM::enumBolusAdministration::Intravenous); + bolus.SetAdminRoute(SEBolusAdministration::Intravenous); // Create data requests for each value that should be written to the output log as the engine is executing // Physiology System Names are defined on the System Objects diff --git a/projects/howto/ParameterOverride/src/HowTo-ParameterOverride.cpp b/projects/howto/ParameterOverride/src/HowTo-ParameterOverride.cpp index d1828e8c4..71cb0d444 100644 --- a/projects/howto/ParameterOverride/src/HowTo-ParameterOverride.cpp +++ b/projects/howto/ParameterOverride/src/HowTo-ParameterOverride.cpp @@ -23,7 +23,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include #include #include #include @@ -74,8 +74,8 @@ int HowToParameterOverride() // Set a parameter change (based on individual parameter units.) // Does ordering matter? Unlike in a scenario action call, the ordering does not matter for SDK calls SEOverride override; - override.SetOverrideState(CDM::enumOnOff::On); - override.SetOverrideConformance(CDM::enumOnOff::On); + override.SetOverrideState(SEOnOff::On); + override.SetOverrideConformance(SEOnOff::On); override.GetHeartRateOverride().SetValue(70, FrequencyUnit::Per_min); bg->ProcessAction(override); bg->GetLogger()->Info("Overriding BioGears Parameter."); @@ -92,9 +92,9 @@ int HowToParameterOverride() bg->GetLogger()->Info(asprintf("Oxygen Saturation : %f", bg->GetBloodChemistrySystem()->GetOxygenSaturation())); // Turn off and add another, this time with conformance off. NOTE: unlike in a patient action, here the heart rate override must be cleared to not be listed in the logger - override.SetOverrideState(CDM::enumOnOff::Off); - override.SetOverrideConformance(CDM::enumOnOff::On); - override.GetHeartRateOverride().Clear(); + override.SetOverrideState(SEOnOff::Off); + override.SetOverrideConformance(SEOnOff::On); + override.GetHeartRateOverride().Invalidate(); bg->ProcessAction(override); bg->GetLogger()->Info("Override Turning Off."); @@ -109,8 +109,8 @@ int HowToParameterOverride() bg->GetLogger()->Info(asprintf("Respiration Rate : %f %s", bg->GetRespiratorySystem()->GetRespirationRate(FrequencyUnit::Per_min), "bpm")); bg->GetLogger()->Info(asprintf("Oxygen Saturation : %f", bg->GetBloodChemistrySystem()->GetOxygenSaturation())); - override.SetOverrideState(CDM::enumOnOff::On); - override.SetOverrideConformance(CDM::enumOnOff::Off); + override.SetOverrideState(SEOnOff::On); + override.SetOverrideConformance(SEOnOff::Off); override.GetRespirationRateOverride().SetValue(20, FrequencyUnit::Per_min); override.GetHeartRateOverride().SetValue(90, FrequencyUnit::Per_min); bg->ProcessAction(override); @@ -128,8 +128,8 @@ int HowToParameterOverride() bg->GetLogger()->Info(asprintf("Oxygen Saturation : %f", bg->GetBloodChemistrySystem()->GetOxygenSaturation())); // Adding an override parameter while keeping the last override in place. Do NOT turn off the override, just add to it with an on call - override.SetOverrideState(CDM::enumOnOff::On); - override.SetOverrideConformance(CDM::enumOnOff::Off); + override.SetOverrideState(SEOnOff::On); + override.SetOverrideConformance(SEOnOff::Off); override.GetTidalVolumeOverride().SetValue(650, VolumeUnit::mL); bg->ProcessAction(override); bg->GetLogger()->Info("Overriding BioGears Parameter."); diff --git a/projects/howto/PatientGeneration/src/HowTo-PatientGeneration.cpp b/projects/howto/PatientGeneration/src/HowTo-PatientGeneration.cpp index d3eb7001f..ed27abbc4 100644 --- a/projects/howto/PatientGeneration/src/HowTo-PatientGeneration.cpp +++ b/projects/howto/PatientGeneration/src/HowTo-PatientGeneration.cpp @@ -29,7 +29,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include #include #include #include @@ -180,7 +180,7 @@ void PatientRun::refresh_treatment() _refresh_state = RefreshState::NOREPINEPHRINE_TITRATE; _Saline_bag->GetBagVolume().SetValue(250, VolumeUnit::mL); _Saline_bag->GetRate().SetValue(250, VolumePerTimeUnit::mL_Per_hr); - if (ua.GetBloodResult() == CDM::enumPresenceIndicator::Positive + if (ua.GetBloodResult() == biogears::SEPresenceIndicator::Positive || _bg->GetRenalSystem()->GetMeanUrineOutput(VolumePerTimeUnit::mL_Per_hr) < 20) { //Because body fluids are so low apply an additional 1000nl bolus over the hour _Saline_bag->GetBagVolume().SetValue(1250, VolumeUnit::mL); @@ -208,7 +208,7 @@ void PatientRun::refresh_treatment() << "\n\tRespiration Rate : " << _bg->GetRespiratorySystem()->GetRespirationRate(FrequencyUnit::Per_min) << "bpm" << "\n\tMean Urine Output : " << _bg->GetRenalSystem()->GetMeanUrineOutput(VolumePerTimeUnit::mL_Per_min) << VolumePerTimeUnit::mL_Per_min << "\n\tTemperature : " << _bg->GetEnergySystem()->GetCoreTemperature(TemperatureUnit::C) << "deg C" - << "\n\tBlood Lactate : " << _bg->GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Aorta)->GetSubstanceQuantity(*_bg->GetSubstanceManager().GetSubstance("Lactate"))->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) << AmountPerVolumeUnit::mmol_Per_L + << "\n\tBlood Lactate : " << _bg->GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Aorta)->GetSubstanceQuantity(*_bg->GetSubstanceManager().GetSubstance(StandardSubstances::Lactate))->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) << AmountPerVolumeUnit::mmol_Per_L << "\n\tBacteria Count (Blood) : " << _bg->GetBloodChemistrySystem()->GetInflammatoryResponse().GetBloodPathogen().GetValue() << "\n\tAntibiotic Activity : " << _bg->GetDrugSystem()->GetAntibioticActivity(); _bg->GetLogger()->Info(ss); @@ -258,7 +258,7 @@ void PatientRun::egdt_treatment() auto is_septic = _bg->GetCardiovascularSystem()->GetMeanArterialPressure(PressureUnit::mmHg) < 65. || _bg->GetCardiovascularSystem()->GetSystolicArterialPressure(PressureUnit::mmHg) <= 90; - auto is_not_euvolaemic = ua.GetBloodResult() == CDM::enumPresenceIndicator::Positive + auto is_not_euvolaemic = ua.GetBloodResult() == biogears::SEPresenceIndicator::Positive || _bg->GetRenalSystem()->GetMeanUrineOutput(VolumePerTimeUnit::mL_Per_hr) < 20; if (is_septic && is_not_euvolaemic) { @@ -372,7 +372,7 @@ void PatientRun::egdt_treatment() _Saline_bag->GetBagVolume().SetValue(500, VolumeUnit::mL); _Saline_bag->GetRate().SetValue(1000, VolumePerTimeUnit::mL_Per_hr); - if (ua.GetBloodResult() == CDM::enumPresenceIndicator::Positive + if (ua.GetBloodResult() == biogears::SEPresenceIndicator::Positive || _bg->GetRenalSystem()->GetMeanUrineOutput(VolumePerTimeUnit::mL_Per_hr) < 20) { //Because body fluids are so low apply an additional 500ml bolus over the hour _Saline_bag->GetBagVolume().SetValue(1000, VolumeUnit::mL); @@ -406,7 +406,7 @@ void PatientRun::egdt_treatment() << "\n\tRespiration Rate : " << _bg->GetRespiratorySystem()->GetRespirationRate(FrequencyUnit::Per_min) << "bpm" << "\n\tMean Urine Output : " << _bg->GetRenalSystem()->GetMeanUrineOutput(VolumePerTimeUnit::mL_Per_min) << VolumePerTimeUnit::mL_Per_min << "\n\tTemperature : " << _bg->GetEnergySystem()->GetCoreTemperature(TemperatureUnit::C) << "deg C" - << "\n\tBlood Lactate : " << _bg->GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Aorta)->GetSubstanceQuantity(*_bg->GetSubstanceManager().GetSubstance("Lactate"))->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) << AmountPerVolumeUnit::mmol_Per_L + << "\n\tBlood Lactate : " << _bg->GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Aorta)->GetSubstanceQuantity(*_bg->GetSubstanceManager().GetSubstance(StandardSubstances::Lactate))->GetMolarity(AmountPerVolumeUnit::mmol_Per_L) << AmountPerVolumeUnit::mmol_Per_L << "\n\tBacteria Count (Blood) : " << _bg->GetBloodChemistrySystem()->GetInflammatoryResponse().GetBloodPathogen().GetValue() << "\n\tAntibiotic Activity : " << _bg->GetDrugSystem()->GetAntibioticActivity(); _bg->GetLogger()->Info(ss); @@ -492,11 +492,11 @@ void PatientRun::run() _bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("CoreTemperature", TemperatureUnit::C); _bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("SkinTemperature", TemperatureUnit::C); - _bg->GetEngineTrack()->GetDataRequestManager().CreateSubstanceDataRequest().Set(*_bg->GetSubstanceManager().GetSubstance("Bicarbonate"), "BloodConcentration", MassPerVolumeUnit::mg_Per_dL); - _bg->GetEngineTrack()->GetDataRequestManager().CreateSubstanceDataRequest().Set(*_bg->GetSubstanceManager().GetSubstance("Creatinine"), "BloodConcentration", MassPerVolumeUnit::mg_Per_dL); - _bg->GetEngineTrack()->GetDataRequestManager().CreateSubstanceDataRequest().Set(*_bg->GetSubstanceManager().GetSubstance("Lactate"), "BloodConcentration", MassPerVolumeUnit::mg_Per_dL); - _bg->GetEngineTrack()->GetDataRequestManager().CreateSubstanceDataRequest().Set(*_bg->GetSubstanceManager().GetSubstance("Piperacillin"), "BloodConcentration", MassPerVolumeUnit::mg_Per_dL); - _bg->GetEngineTrack()->GetDataRequestManager().CreateSubstanceDataRequest().Set(*_bg->GetSubstanceManager().GetSubstance("Tazobactam"), "BloodConcentration", MassPerVolumeUnit::mg_Per_dL); + _bg->GetEngineTrack()->GetDataRequestManager().CreateSubstanceDataRequest().Set(*_bg->GetSubstanceManager().GetSubstance(StandardSubstances::Bicarbonate), "BloodConcentration", MassPerVolumeUnit::mg_Per_dL); + _bg->GetEngineTrack()->GetDataRequestManager().CreateSubstanceDataRequest().Set(*_bg->GetSubstanceManager().GetSubstance(StandardSubstances::Creatinine), "BloodConcentration", MassPerVolumeUnit::mg_Per_dL); + _bg->GetEngineTrack()->GetDataRequestManager().CreateSubstanceDataRequest().Set(*_bg->GetSubstanceManager().GetSubstance(StandardSubstances::Lactate), "BloodConcentration", MassPerVolumeUnit::mg_Per_dL); + _bg->GetEngineTrack()->GetDataRequestManager().CreateSubstanceDataRequest().Set(*_bg->GetSubstanceManager().GetSubstance(StandardSubstances::Piperacillin), "BloodConcentration", MassPerVolumeUnit::mg_Per_dL); + _bg->GetEngineTrack()->GetDataRequestManager().CreateSubstanceDataRequest().Set(*_bg->GetSubstanceManager().GetSubstance(StandardSubstances::Tazobactam), "BloodConcentration", MassPerVolumeUnit::mg_Per_dL); _bg->GetEngineTrack()->GetDataRequestManager().SetResultsFilename(long_name + ".csv"); _bg->GetEngineTrack()->GetDataRequestManager().SetSamplesPerSecond(1. / (5. * 60.)); @@ -511,17 +511,17 @@ void PatientRun::run() _bg->ProcessAction(infection); auto& substances = _bg->GetSubstanceManager(); - SESubstanceCompound* PiperacillinTazobactam = _bg->GetSubstanceManager().GetCompound("PiperacillinTazobactam"); + SESubstanceCompound* PiperacillinTazobactam = _bg->GetSubstanceManager().GetCompound(StandardSubstances::PiperacillinTazobactam); _PiperacillinTazobactam_bag = std::make_unique(*PiperacillinTazobactam).release(); _PiperacillinTazobactam_bag->GetRate().SetValue(0.75, VolumePerTimeUnit::mL_Per_min); _PiperacillinTazobactam_bag->GetBagVolume().SetValue(0, VolumeUnit::mL); - SESubstanceCompound* Saline = _bg->GetSubstanceManager().GetCompound("Saline"); + SESubstanceCompound* Saline = _bg->GetSubstanceManager().GetCompound(StandardSubstances::Saline); _Saline_bag = std::make_unique(*Saline).release(); _Saline_bag->GetRate().SetValue(10, VolumePerTimeUnit::mL_Per_min); _Saline_bag->GetBagVolume().SetValue(0, VolumeUnit::mL); - SESubstanceCompound* SalinelowDrip = _bg->GetSubstanceManager().GetCompound("SalineSlowDrip"); + SESubstanceCompound* SalinelowDrip = _bg->GetSubstanceManager().GetCompound(StandardSubstances::SalineSlowDrip); _maintenance_bag = std::make_unique(*SalinelowDrip).release(); _maintenance_bag->GetRate().SetValue(10, VolumePerTimeUnit::mL_Per_min); _maintenance_bag->GetBagVolume().SetValue(0, VolumeUnit::mL); @@ -595,13 +595,13 @@ PatientRun& PatientRun::infection_severity(std::string severity) { std::transform(severity.begin(), severity.end(), severity.begin(), [](unsigned char c) { return std::tolower(c); }); if (severity == "mild") { - _infection_severity = CDM::enumInfectionSeverity::value::Mild; + _infection_severity = SEInfectionSeverity::Mild; _infection_severity_str = "Mild"; } else if (severity == "") { - _infection_severity = CDM::enumInfectionSeverity::value::Moderate; + _infection_severity = SEInfectionSeverity::Moderate; _infection_severity_str = "Moderate"; } else if (severity == "severe") { - _infection_severity = CDM::enumInfectionSeverity::value::Severe; + _infection_severity = SEInfectionSeverity::Severe; _infection_severity_str = "Severe"; } return *this; diff --git a/projects/howto/PatientGeneration/src/HowTo-PatientGeneration.h b/projects/howto/PatientGeneration/src/HowTo-PatientGeneration.h index 0a2635a57..008035e40 100644 --- a/projects/howto/PatientGeneration/src/HowTo-PatientGeneration.h +++ b/projects/howto/PatientGeneration/src/HowTo-PatientGeneration.h @@ -12,18 +12,18 @@ specific language governing permissions and limitations under the License. #pragma once +#include "biogears/BiogearsEnums.h" #include "biogears/cdm/engine/PhysiologyEngine.h" #include "biogears/cdm/patient/actions/SESubstanceCompoundInfusion.h" #include "biogears/cdm/patient/actions/SESubstanceInfusion.h" #include - constexpr double weeks(double n_weeks) { return n_weeks * 7. * 24. * 60.; } //< weeks -> minutes -constexpr double days(double n_days) { return n_days * 24. * 60.; }//< days -> minutes -constexpr double hours(double n_hours) { return n_hours * 60.; }//< hours -> minutes -constexpr double minutes(double n_minutes) { return n_minutes; }//< minutes -> minutes -constexpr double seconds(double n_seconds) { return n_seconds / 60.; }//< seconds -> minutes -constexpr double to_seconds(double n_minutes) { return n_minutes * 60; }//< minutes -> seconds +constexpr double days(double n_days) { return n_days * 24. * 60.; } //< days -> minutes +constexpr double hours(double n_hours) { return n_hours * 60.; } //< hours -> minutes +constexpr double minutes(double n_minutes) { return n_minutes; } //< minutes -> minutes +constexpr double seconds(double n_seconds) { return n_seconds / 60.; } //< seconds -> minutes +constexpr double to_seconds(double n_minutes) { return n_minutes * 60; } //< minutes -> seconds enum class TreatmentPlan { NONE, @@ -93,10 +93,10 @@ class PatientRun { void nutrition_regimen(); private: - //Configuration Details + // Configuration Details std::string _patient_name; char const* _infection_severity_str; - CDM::enumInfectionSeverity::value _infection_severity = CDM::enumInfectionSeverity::value::Eliminated; + biogears::SEInfectionSeverity _infection_severity = biogears::SEInfectionSeverity::Eliminated; char const* _treatment_plan_str; TreatmentPlan _treatment_plan = TreatmentPlan::STANDARD; @@ -107,7 +107,7 @@ class PatientRun { double _application_interval_m; double _duration_hr; - //Implementation Details + // Implementation Details biogears::SESubstanceCompoundInfusion* _PiperacillinTazobactam_bag = nullptr; biogears::SESubstanceCompoundInfusion* _Saline_bag = nullptr; biogears::SESubstanceCompoundInfusion* _maintenance_bag = nullptr; @@ -125,15 +125,15 @@ class PatientRun { bool _first_treatment_occured = false; bool _applying_antibiotics = false; - //REFRESH Implementation Details + // REFRESH Implementation Details RefreshState _refresh_state = RefreshState::NONE; double _time_to_reassessment_min = 60.; double _maintenance_fluids_remaining_min = 0.; - bool _norepinphrine_titrate_active = false; + bool _norepinphrine_titrate_active = false; double _time_since_norepinphrine_titrage_active_min = 0.0; double _treatment_time_remaining_min = 360; - //EGDT Implementation Details + // EGDT Implementation Details EGDTState _egdt_state = EGDTState::NONE; double _persistent_low_map_min = 0.; double _persistant_stable_map_min = 0.; diff --git a/projects/howto/PulmonaryFunctionTest/src/HowTo-PulmonaryFunctionTest.cpp b/projects/howto/PulmonaryFunctionTest/src/HowTo-PulmonaryFunctionTest.cpp index 11db9115d..c1ecdb486 100644 --- a/projects/howto/PulmonaryFunctionTest/src/HowTo-PulmonaryFunctionTest.cpp +++ b/projects/howto/PulmonaryFunctionTest/src/HowTo-PulmonaryFunctionTest.cpp @@ -13,7 +13,7 @@ specific language governing permissions and limitations under the License. // Include the various types you will be using in your code #include -#include +#include #include #include #include diff --git a/projects/howto/PupillaryResponse/src/HowTo-PupillaryResponse.cpp b/projects/howto/PupillaryResponse/src/HowTo-PupillaryResponse.cpp index 6512a90f8..1ed571546 100644 --- a/projects/howto/PupillaryResponse/src/HowTo-PupillaryResponse.cpp +++ b/projects/howto/PupillaryResponse/src/HowTo-PupillaryResponse.cpp @@ -16,7 +16,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include #include #include #include @@ -50,7 +50,7 @@ int HowToPupillaryResponse() // The tracker is responsible for advancing the engine time and outputting the data requests below at each time step - SESubstance* morphine = bg->GetSubstanceManager().GetSubstance("Morphine"); + SESubstance* morphine = bg->GetSubstanceManager().GetSubstance(StandardSubstances::Morphine); morphine->GetPlasmaConcentration().SetValue(0.0, MassPerVolumeUnit::ug_Per_L); // Create a substance bolus action to administer the substance diff --git a/projects/howto/SarinExposure/src/HowTo-SarinExposure.cpp b/projects/howto/SarinExposure/src/HowTo-SarinExposure.cpp index 7a0e5a569..810a559d1 100644 --- a/projects/howto/SarinExposure/src/HowTo-SarinExposure.cpp +++ b/projects/howto/SarinExposure/src/HowTo-SarinExposure.cpp @@ -12,12 +12,11 @@ specific language governing permissions and limitations under the License. -#include // Include the various types you will be using in your code #include #include #include -#include +#include #include #include #include @@ -54,9 +53,9 @@ int HowToSarinExposure() //---Initialize all variables needed for scenario //Substances - SESubstance* Sarin = bg->GetSubstanceManager().GetSubstance("Sarin"); - SESubstance* CO2 = bg->GetSubstanceManager().GetSubstance("CarbonDioxide"); - SESubstance* O2 = bg->GetSubstanceManager().GetSubstance("Oxygen"); + auto& Sarin = bg->GetSubstanceManager().GetSubstance(StandardSubstances::Sarin)->GetDefinition(); + auto CO2 = bg->GetSubstanceManager().GetSubstance(StandardSubstances::CarbonDioxide); + auto O2 = bg->GetSubstanceManager().GetSubstance(StandardSubstances::Oxygen); //Numerical values double exposureTime = 5.0; //Establish how long the patient will be exposed to Sarin @@ -67,12 +66,12 @@ int HowToSarinExposure() double FractionRbcAcheInhibited = 0.0; //The fraction of red blood cell acetylcholinesterase that has been inhibited by Sarin binding. This value will be used to trigger events. //System states - CDM::enumOnOff::value SarinActive; //Track whether the patient is currently being exposed to Sarin + SEOnOff SarinActive; //Track whether the patient is currently being exposed to Sarin std::vector eventList = { "Rhinorrhea", "Nausea", "Gastrointestinal Sounds" }; //The list of patient states you want to monitor--note that BioGears track many events already; this is a way to track other states you might want to add - std::map> eventMap; //Each state has a threshold level at which it is triggered and an associated on/off switch - eventMap["Rhinorrhea"] = std::make_pair(0.1, CDM::enumOnOff::Off); //Put the states in the map with the threshold inhibition at which they start and make them all inactive initially - eventMap["Nausea"] = std::make_pair(0.25, CDM::enumOnOff::Off); - eventMap["Gastrointestinal Sounds"] = std::make_pair(0.5, CDM::enumOnOff::Off); + std::map> eventMap; //Each state has a threshold level at which it is triggered and an associated on/off switch + eventMap["Rhinorrhea"] = std::make_pair(0.1, SEOnOff::Off); //Put the states in the map with the threshold inhibition at which they start and make them all inactive initially + eventMap["Nausea"] = std::make_pair(0.25, SEOnOff::Off); + eventMap["Gastrointestinal Sounds"] = std::make_pair(0.5, SEOnOff::Off); // The tracker is responsible for advancing the engine time and outputting the data requests below at each time step @@ -104,22 +103,22 @@ int HowToSarinExposure() // Sarin is introduced as an ambient aerosol and the concentration is set with units of mg/m^3 SEEnvironmentChange env(bg->GetSubstanceManager()); SEEnvironmentalConditions& conditions = env.GetConditions(); - conditions.GetAmbientAerosol(*Sarin).GetConcentration().SetValue(SarinAerosol_mg_Per_m3, MassPerVolumeUnit::mg_Per_m3); - SarinActive = CDM::enumOnOff::On; //Sarin exposure is active + conditions.GetAmbientAerosol(Sarin).GetConcentration().SetValue(SarinAerosol_mg_Per_m3, MassPerVolumeUnit::mg_Per_m3); + SarinActive = SEOnOff::On; //Sarin exposure is active bg->ProcessAction(env); // We maintain this loop so that we can periodically check events while advancing data tracker while (bg->GetSimulationTime(TimeUnit::min) < simulationTime) { //Break out of loop if patient enters irreversible state - if (bg->GetPatient().IsEventActive(CDM::enumPatientEvent::IrreversibleState)) + if (bg->GetPatient().IsEventActive(SEPatientEventType::IrreversibleState)) break; //Check if we have reached the end of the exposure time to Sarin. If so, remove it from the environment and deactivate it - if ((bg->GetSimulationTime(TimeUnit::min) > exposureTime + 1) && (SarinActive == CDM::enumOnOff::On)) { - conditions.RemoveAmbientAerosol(*Sarin); + if ((bg->GetSimulationTime(TimeUnit::min) > exposureTime + 1) && (SarinActive == SEOnOff::On)) { + conditions.RemoveAmbientAerosol(Sarin); bg->ProcessAction(env); - bg->GetLogger()->Info(std::string{ Sarin->GetName() } +" removed from environment"); - SarinActive = CDM::enumOnOff::Off; + bg->GetLogger()->Info(std::string{ Sarin.Name } +" removed from environment"); + SarinActive = SEOnOff::Off; } //Get the fraction of inactive red blood cell acetylcholinesterase by converting active M concentration to nM, dividing by baseline, and subtracting from 1 @@ -131,15 +130,15 @@ int HowToSarinExposure() //Check each event in the event list specified above. An event is active if the fraction of red blood cell acetylcholinesterase inhibited //is greater than the threshold provided for the event in the event map for (auto e : eventList) { - if ((FractionRbcAcheInhibited > eventMap[e].first) && (eventMap[e].second == CDM::enumOnOff::Off)) //Only display state when it is triggered, not every time point when the event is active + if ((FractionRbcAcheInhibited > eventMap[e].first) && (eventMap[e].second == SEOnOff::Off)) //Only display state when it is triggered, not every time point when the event is active { bg->GetLogger()->Info("Patient is exhibiting " + e); - eventMap[e].second = CDM::enumOnOff::On; + eventMap[e].second = SEOnOff::On; } - if ((FractionRbcAcheInhibited < eventMap[e].first) && (eventMap[e].second == CDM::enumOnOff::On)) //Remove state if levels drop below threshold. Probably won't happen for Sarin because the red blood cell acetylcholinesterase is inhibited for a very long time (days to weeks) + if ((FractionRbcAcheInhibited < eventMap[e].first) && (eventMap[e].second == SEOnOff::On)) //Remove state if levels drop below threshold. Probably won't happen for Sarin because the red blood cell acetylcholinesterase is inhibited for a very long time (days to weeks) { bg->GetLogger()->Info( "Patient no longer exhibiting " + e); - eventMap[e].second = CDM::enumOnOff::Off; + eventMap[e].second = SEOnOff::Off; } } diff --git a/projects/howto/SceanrioBase/src/HowTo-SceanrioBase.cpp b/projects/howto/SceanrioBase/src/HowTo-SceanrioBase.cpp index a1bd6a842..9e977389c 100644 --- a/projects/howto/SceanrioBase/src/HowTo-SceanrioBase.cpp +++ b/projects/howto/SceanrioBase/src/HowTo-SceanrioBase.cpp @@ -18,7 +18,6 @@ specific language governing permissions and limitations under the License. #include #include #include -#include #include @@ -37,9 +36,12 @@ int HowToScenarioBase() bg->GetLogger()->Info("HowToScenarioBase"); - //Let's read the scenario we want to base this engine on + //Load will search for a file in several fall back locations listed in + // io-manager.h. The primary places are the current_directory and + // the current_directory/Scenarios. Each Scenario file may have references to + // Additional Patient and DataRequest files. See AsthmaAttack.xml for an example SEScenario sce(bg->GetSubstanceManager()); - sce.Load("YourScenario.xml"); + sce.Load("Showcase/AsthmaAttack.xml"); if (sce.HasEngineStateFile()) { @@ -75,20 +77,6 @@ int HowToScenarioBase() } } } - CDM::DataRequestManagerData* drData; - // NOTE : You can just make a DataRequests xml file that holds only data requests - // And serialize that in instead of a sceanrio file, if all you want is a consistent - // set of data requests for all your scenarios - std::unique_ptr obj = Serializer::ReadFile("YourDataRequestsFile.xml", bg->GetLogger()); - drData = dynamic_cast(obj.get()); - bg->GetEngineTrack()->GetDataRequestManager().Load(*drData, bg->GetSubstanceManager()); - // Don't need to delete drData as obj is wrapped in a unique_ptr - - // Make a copy of the data requests, not this clears out data requests from the engine - // This will clear out the data requests if any exist in the DataRequestManager - drData = sce.GetDataRequestManager().Unload(); - bg->GetEngineTrack()->GetDataRequestManager().Load(*drData, bg->GetSubstanceManager()); - delete drData; if (!bg->GetEngineTrack()->GetDataRequestManager().HasResultsFilename()) { bg->GetEngineTrack()->GetDataRequestManager().SetResultsFilename("./ResultsFileName.csv"); diff --git a/projects/howto/SepsisDynamic/src/HowTo-SepsisDynamic.cpp b/projects/howto/SepsisDynamic/src/HowTo-SepsisDynamic.cpp index 9c20d6677..16d718779 100644 --- a/projects/howto/SepsisDynamic/src/HowTo-SepsisDynamic.cpp +++ b/projects/howto/SepsisDynamic/src/HowTo-SepsisDynamic.cpp @@ -22,7 +22,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include #include #include #include @@ -132,10 +132,10 @@ DynamicSepsis::DynamicSepsis(const std::string& logfile, int infectionInput) //Load substances we might use - SESubstanceCompound* antibiotic = m_bg->GetSubstanceManager().GetCompound("PiperacillinTazobactam"); - SESubstanceCompound* saline = m_bg->GetSubstanceManager().GetCompound("Saline"); - SESubstanceCompound* ringers = m_bg->GetSubstanceManager().GetCompound("RingersLactate"); - SESubstance* norepinephrine = m_bg->GetSubstanceManager().GetSubstance("Norepinephrine"); + SESubstanceCompound* antibiotic = m_bg->GetSubstanceManager().GetCompound(StandardSubstances::PiperacillinTazobactam); + SESubstanceCompound* saline = m_bg->GetSubstanceManager().GetCompound(StandardSubstances::Saline); + SESubstanceCompound* ringers = m_bg->GetSubstanceManager().GetCompound(StandardSubstances::RingersLactate); + SESubstance* norepinephrine = m_bg->GetSubstanceManager().GetSubstance(StandardSubstances::Norepinephrine); // Create and initialize our actions (infusion constructed in BioGearsThread) m_antibiotic = new SESubstanceCompoundInfusion(*antibiotic); m_saline = new SESubstanceCompoundInfusion(*saline); @@ -196,7 +196,7 @@ void DynamicSepsis::UpdateMIC(double mic) { m_septicInfection = new SEInfection(); //This will not override current infection because inflammation model is already active m_septicInfection->SetLocation("Gut"); //Assume stomach infection--will not change outcome - m_septicInfection->SetSeverity(CDM::enumInfectionSeverity::Severe); //Again, this will not change model outcome, as inflammation is already active + m_septicInfection->SetSeverity(SEInfectionSeverity::Severe); //Again, this will not change model outcome, as inflammation is already active m_septicInfection->GetMinimumInhibitoryConcentration().SetValue(mic, MassPerVolumeUnit::mg_Per_L); m_mutex.lock(); m_bg->ProcessAction(*m_septicInfection); @@ -217,7 +217,7 @@ void DynamicSepsis::Status() m_bg->GetLogger()->Info(asprintf("Respiration Rate : %f %s", m_bg->GetRespiratorySystem()->GetRespirationRate(FrequencyUnit::Per_min), "bpm")); m_bg->GetLogger()->Info(asprintf("Mean Urine Output : %f %s", m_bg->GetRenalSystem()->GetMeanUrineOutput(VolumePerTimeUnit::mL_Per_min), "mL_Per_min")); m_bg->GetLogger()->Info(asprintf("Temperature : %f %s", m_bg->GetEnergySystem()->GetCoreTemperature(TemperatureUnit::C), "deg C")); - m_bg->GetLogger()->Info(asprintf("Blood Lactate : %f %s", m_bg->GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Aorta)->GetSubstanceQuantity(*m_bg->GetSubstanceManager().GetSubstance("Lactate"))->GetMolarity(AmountPerVolumeUnit::mmol_Per_L), "mmol_Per_L")); + m_bg->GetLogger()->Info(asprintf("Blood Lactate : %f %s", m_bg->GetCompartments().GetLiquidCompartment(BGE::VascularCompartment::Aorta)->GetSubstanceQuantity(*m_bg->GetSubstanceManager().GetSubstance(StandardSubstances::Lactate))->GetMolarity(AmountPerVolumeUnit::mmol_Per_L), "mmol_Per_L")); m_bg->GetLogger()->Info(asprintf("Bacteria Count (Blood) : %f", m_bg->GetBloodChemistrySystem()->GetInflammatoryResponse().GetBloodPathogen().GetValue())); m_bg->GetLogger()->Info(asprintf("Antibiotic Activity : %f", m_bg->GetDrugSystem()->GetAntibioticActivity())); diff --git a/projects/howto/SepsisDynamic/src/HowTo-SepsisDynamic.h b/projects/howto/SepsisDynamic/src/HowTo-SepsisDynamic.h index 4dd64970e..ce5164ee4 100644 --- a/projects/howto/SepsisDynamic/src/HowTo-SepsisDynamic.h +++ b/projects/howto/SepsisDynamic/src/HowTo-SepsisDynamic.h @@ -16,6 +16,7 @@ specific language governing permissions and limitations under the License. #include #include +#include namespace biogears { class SEInfection; diff --git a/projects/howto/Smoke/src/HowTo-Smoke.cpp b/projects/howto/Smoke/src/HowTo-Smoke.cpp index df86f2375..013803db3 100644 --- a/projects/howto/Smoke/src/HowTo-Smoke.cpp +++ b/projects/howto/Smoke/src/HowTo-Smoke.cpp @@ -16,7 +16,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include #include #include #include @@ -66,11 +66,11 @@ int HowToSmoke() } // Get some substances out we will use - SESubstance* N2 = bg->GetSubstanceManager().GetSubstance("Nitrogen"); - SESubstance* O2 = bg->GetSubstanceManager().GetSubstance("Oxygen"); - SESubstance* CO2 = bg->GetSubstanceManager().GetSubstance("CarbonDioxide"); - SESubstance* CO = bg->GetSubstanceManager().GetSubstance("CarbonMonoxide"); - SESubstance* Particulate = bg->GetSubstanceManager().GetSubstance("ForestFireParticulate"); + SESubstanceDefinition N2 = bg->GetSubstanceManager().GetSubstance(StandardSubstances::Nitrogen)->GetDefinition(); + SESubstanceDefinition O2 = bg->GetSubstanceManager().GetSubstance(StandardSubstances::Oxygen)->GetDefinition(); + SESubstanceDefinition CO2 = bg->GetSubstanceManager().GetSubstance(StandardSubstances::CarbonDioxide)->GetDefinition(); + SESubstanceDefinition CO = bg->GetSubstanceManager().GetSubstance(StandardSubstances::CarbonMonoxide)->GetDefinition(); + SESubstanceDefinition Particulate = bg->GetSubstanceManager().GetSubstance(StandardSubstances::ForestFireParticulate)->GetDefinition(); // The tracker is responsible for advancing the engine time and outputting the data requests below at each time step @@ -117,12 +117,12 @@ int HowToSmoke() // Here we will put this healty patient into a smokey environment. SEEnvironmentChange envChange(bg->GetSubstanceManager()); // NOTE YOUR FRACTIONS MUST ADD UP TO 1.0 - envChange.GetConditions().GetAmbientGas(*N2).GetFractionAmount().SetValue(0.79008); - envChange.GetConditions().GetAmbientGas(*O2).GetFractionAmount().SetValue(0.2095); - envChange.GetConditions().GetAmbientGas(*CO2).GetFractionAmount().SetValue(4.0E-4); - envChange.GetConditions().GetAmbientGas(*CO).GetFractionAmount().SetValue(2.0E-5); + envChange.GetConditions().GetAmbientGas(N2).GetFractionAmount().SetValue(0.79008); + envChange.GetConditions().GetAmbientGas(O2).GetFractionAmount().SetValue(0.2095); + envChange.GetConditions().GetAmbientGas(CO2).GetFractionAmount().SetValue(4.0E-4); + envChange.GetConditions().GetAmbientGas(CO).GetFractionAmount().SetValue(2.0E-5); // Concentrations are independent and do not need to add up to 1.0 - envChange.GetConditions().GetAmbientAerosol(*Particulate).GetConcentration().SetValue(2.9, MassPerVolumeUnit::mg_Per_m3); + envChange.GetConditions().GetAmbientAerosol(Particulate).GetConcentration().SetValue(2.9, MassPerVolumeUnit::mg_Per_m3); bg->ProcessAction(envChange); bg->AdvanceModelTime(30, TimeUnit::s); @@ -131,7 +131,7 @@ int HowToSmoke() bg->GetLogger()->Info(asprintf("Carbon Monoxide Saturation : %f", bg->GetBloodChemistrySystem()->GetCarbonMonoxideSaturation())); bg->GetLogger()->Info(asprintf("Pulse Oximetry : %f", bg->GetBloodChemistrySystem()->GetPulseOximetry())); // There are liquid compartments for each of the gas pulmonary compartments, these track the trasportation of liquid and solid substances through the pulmonary tract, and their deposition - bg->GetLogger()->Info(asprintf("Particulate Deposition : %f %s", bg->GetCompartments().GetLiquidCompartment(BGE::PulmonaryCompartment::RightAlveoli)->GetSubstanceQuantity(*Particulate)->GetMassDeposited(MassUnit::ug), "ug")); + bg->GetLogger()->Info(asprintf("Particulate Deposition : %f %s", bg->GetCompartments().GetLiquidCompartment(BGE::PulmonaryCompartment::RightAlveoli)->GetSubstanceQuantity(Particulate)->GetMassDeposited(MassUnit::ug), "ug")); bg->GetLogger()->Info(asprintf("Cardiac Output : %f %s", bg->GetCardiovascularSystem()->GetCardiacOutput(VolumePerTimeUnit::mL_Per_min), "mL_Per_min")); bg->GetLogger()->Info(asprintf("Mean Arterial Pressure : %f %s", bg->GetCardiovascularSystem()->GetMeanArterialPressure(PressureUnit::mmHg), "mmHg")); diff --git a/projects/howto/StateLoading/src/HowTo-StateLoading.cpp b/projects/howto/StateLoading/src/HowTo-StateLoading.cpp index cba8da7c4..961eac218 100644 --- a/projects/howto/StateLoading/src/HowTo-StateLoading.cpp +++ b/projects/howto/StateLoading/src/HowTo-StateLoading.cpp @@ -11,7 +11,6 @@ specific language governing permissions and limitations under the License. **************************************************************************************/ // Include the various types you will be using in your code -#include #include #include #include diff --git a/projects/howto/TensionPneumothorax/src/HowTo-TensionPneumothorax.cpp b/projects/howto/TensionPneumothorax/src/HowTo-TensionPneumothorax.cpp index b5f10628e..487e1a37c 100644 --- a/projects/howto/TensionPneumothorax/src/HowTo-TensionPneumothorax.cpp +++ b/projects/howto/TensionPneumothorax/src/HowTo-TensionPneumothorax.cpp @@ -16,7 +16,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include #include #include #include @@ -75,13 +75,13 @@ int HowToTensionPneumothorax() SETensionPneumothorax pneumo; // You can have a Closed or Open Tension Pneumothorax - pneumo.SetType(CDM::enumPneumothoraxType::Closed); - //pneumo.SetType(CDM::enumPneumothoraxType::Open); + pneumo.SetType(SEPneumothoraxType::Closed); + //pneumo.SetType(SEPneumothoraxType::Open); pneumo.GetSeverity().SetValue(0.75); // It can be on the Left or right side - pneumo.SetSide(CDM::enumSide::Right); - //pneumo.SetSide(CDM::enumSide::Left); + pneumo.SetSide(biogears::SESide ::Right); + //pneumo.SetSide(biogears::SESide ::Left); pneumo.SetComment("ICD-9: 860.0"); //pneumo.SetComment('ICD-9: 860.0'); bg->ProcessAction(pneumo); @@ -108,8 +108,8 @@ int HowToTensionPneumothorax() needleDecomp.SetActive(false); // It can be on the Left or right side (it's a good idea to do it on the side of the pneumothorax ;) - needleDecomp.SetSide(CDM::enumSide::Right); - //needleDecomp.SetSide(CDM::enumSide::Left); + needleDecomp.SetSide(biogears::SESide ::Right); + //needleDecomp.SetSide(biogears::SESide ::Left); bg->ProcessAction(needleDecomp); bg->GetLogger()->Info("Giving the patient a needle decompression"); diff --git a/projects/howto/VasopressinShockTherapy/src/HowTo-VasopressinShockTherapy.cpp b/projects/howto/VasopressinShockTherapy/src/HowTo-VasopressinShockTherapy.cpp index a104c5192..01a494690 100644 --- a/projects/howto/VasopressinShockTherapy/src/HowTo-VasopressinShockTherapy.cpp +++ b/projects/howto/VasopressinShockTherapy/src/HowTo-VasopressinShockTherapy.cpp @@ -15,7 +15,7 @@ specific language governing permissions and limitations under the License. #include #include #include -#include +#include #include #include #include @@ -40,9 +40,9 @@ int HowToVasopressinShockTherapy() //Set up substances. Initialized vasopressin plasma concentration to 0. Note that saline is technically a compound--this is //so the engine knows to look for multiple components within the same substance file (i.e. Na, Cl, etc) - SESubstance* vas = bg->GetSubstanceManager().GetSubstance("Vasopressin"); + SESubstance* vas = bg->GetSubstanceManager().GetSubstance(StandardSubstances::Vasopressin); vas->GetPlasmaConcentration().SetValue(0.0, MassPerVolumeUnit::ug_Per_L); - SESubstanceCompound* sal = bg->GetSubstanceManager().GetCompound("Saline"); + SESubstanceCompound* sal = bg->GetSubstanceManager().GetCompound(StandardSubstances::Saline); //Each infusion is managed by a separate object //This object is the vasopressin infusion. It requires a concentration and an admin rate. The infusion will continue unabated until the diff --git a/projects/howto/common-source/HowTo-ThreadedBioGears.cpp b/projects/howto/common-source/HowTo-ThreadedBioGears.cpp index d760793d7..6e9ddb1bd 100644 --- a/projects/howto/common-source/HowTo-ThreadedBioGears.cpp +++ b/projects/howto/common-source/HowTo-ThreadedBioGears.cpp @@ -16,7 +16,7 @@ specific language governing permissions and limitations under the License. #include #include -#include +#include #include #include #include @@ -75,7 +75,7 @@ BioGearsThread::BioGearsThread(const std::string& logfile) { // Create our engine with the standard patient m_bg = CreateBioGearsEngine(logfile); - SESubstanceCompound* saline = m_bg->GetSubstanceManager().GetCompound("Saline"); + SESubstanceCompound* saline = m_bg->GetSubstanceManager().GetCompound(StandardSubstances::Saline); if (!m_bg->LoadState("./states/StandardMale@0s.xml")) { m_bg->GetLogger()->Error("Could not load state, check the error"); diff --git a/projects/howto/common-source/HowTo-ThreadedBioGears.h b/projects/howto/common-source/HowTo-ThreadedBioGears.h index 2a6b0ed5d..5fdd431e9 100644 --- a/projects/howto/common-source/HowTo-ThreadedBioGears.h +++ b/projects/howto/common-source/HowTo-ThreadedBioGears.h @@ -13,7 +13,6 @@ specific language governing permissions and limitations under the License. #include #include -// #include #include #include // This class will run BioGears in it's own thread and accept changes to hemorrage and iv flow as the engine is running diff --git a/projects/unit/CMakeLists.txt b/projects/unit/CMakeLists.txt index ac561e62c..c4d7e19a8 100644 --- a/projects/unit/CMakeLists.txt +++ b/projects/unit/CMakeLists.txt @@ -3,7 +3,7 @@ CMAKE_POLICY(VERSION 3.18.0) enable_language(CXX) -#find_package(GTest) +find_package(GTest) option(Biogears_BUILD_TEST "Select to Build Tests." ${GTest_FOUND}) @@ -18,6 +18,15 @@ if(Biogears_BUILD_TEST) ##################################################################V############# option(UNITTEST_biogears-common "Enable Biogears-Common UnitTest " ON) option(UNITTEST_biogears-core "Enable libBiogears UnitTest " ON) + if(UNITTEST_biogears-core) + option(UNITTEST_biogears-core_cdm "Enable libBiogears CommonDataModel UnitTests From biogears/cdm/*" ON) + option(UNITTEST_biogears-core_engine "Enable libBiogears Engine UnitTests biogears/engine/*" ON) + option(UNITTEST_biogears-core_io "Enable libBiogearsCircuitTest UnitTest biogears/io/*" ON) + #option(UNITTEST_biogears-core_CalculatorTest "Enable libBiogears CalculatorTest UnitTest " ON) + option(UNITTEST_biogears-core_CircuitTestTest "Enable libBiogears CircuitTestTest UnitTest " ON) + #option(UNITTEST_biogears-core_RebaseTool "Enable libBiogears RebaseTool UnitTest " ON) + #option(UNITTEST_biogears-core_TimingProfileTest "Enable libBiogears TimingProfileTest UnitTest " ON) + endif() option(UNITTEST_biogears-cmd "Enable Biogears command line UnitTest " ON) @@ -41,22 +50,49 @@ if(Biogears_BUILD_TEST) LIST(APPEND UNITTEST_SOURCES ${BIOGEARS_COMMON_UNITTEST_SOURCES}) endif() if(UNITTEST_biogears-core) - add_source_files(BIOGEARS_CORE_UNITTEST_HEADERS LOCATION "${PROJECT_SOURCE_DIR}/projects/biogears/libBiogears/unit/" REGEX "test_core*.h" SOURCE_GROUP "core\\") - add_source_files(BIOGEARS_CORE_UNITTEST_SOURCES LOCATION "${PROJECT_SOURCE_DIR}/projects/biogears/libBiogears/unit/" REGEX "test_core*.cpp" SOURCE_GROUP "core\\") - LIST(APPEND UNITTEST_HEADERS ${BIOGEARS_CORE_UNITTEST_HEADERS}) - LIST(APPEND UNITTEST_SOURCES ${BIOGEARS_CORE_UNITTEST_SOURCES}) - endif() - if(UNITTEST_biogears-core_cdm) - add_source_files(BIOGEARS_CORE_CDM_UNITTEST_HEADERS LOCATION "${PROJECT_SOURCE_DIR}/projects/biogears/libCDM/unit/" REGEX "test_core_cdm*.h" SOURCE_GROUP "core_cdm\\") - add_source_files(BIOGEARS_CORE_CDM_UNITTEST_SOURCES LOCATION "${PROJECT_SOURCE_DIR}/projects/biogears/libCDM/unit/" REGEX "test_core_cdm*.cpp" SOURCE_GROUP "core_cdm\\") - LIST(APPEND UNITTEST_HEADERS ${BIOGEARS_CORE_CDM_UNITTEST_HEADERS}) - LIST(APPEND UNITTEST_SOURCES ${BIOGEARS_CORE_CDM_UNITTEST_SOURCES}) - endif() - if(UNITTEST_biogears-core_io) - add_source_files(BIOGEARS_CORE_IO_UNITTEST_HEADERS LOCATION "${PROJECT_SOURCE_DIR}/projects/biogears/libIO/unit/" REGEX "test_core_io*.h" SOURCE_GROUP "core_io\\") - add_source_files(BIOGEARS_CORE_IO_UNITTEST_SOURCES LOCATION "${PROJECT_SOURCE_DIR}/projects/biogears/libIO/unit/" REGEX "test_core_io*.cpp" SOURCE_GROUP "core_io\\") - LIST(APPEND UNITTEST_HEADERS ${BIOGEARS_CORE_IO_UNITTEST_HEADERS}) - LIST(APPEND UNITTEST_SOURCES ${BIOGEARS_CORE_IO_UNITTEST_SOURCES}) + if(UNITTEST_biogears-core_cdm) + add_source_files(BIOGEARS_CORE_CDM_UNITTEST_HEADERS LOCATION "${PROJECT_SOURCE_DIR}/projects/biogears/libBiogears/unit/" REGEX "test_core_cdm*.h" SOURCE_GROUP "core_cdm\\") + add_source_files(BIOGEARS_CORE_CDM_UNITTEST_SOURCES LOCATION "${PROJECT_SOURCE_DIR}/projects/biogears/libBiogears/unit/" REGEX "test_core_cdm*.cpp" SOURCE_GROUP "core_cdm\\") + LIST(APPEND UNITTEST_HEADERS ${BIOGEARS_CORE_CDM_UNITTEST_HEADERS}) + LIST(APPEND UNITTEST_SOURCES ${BIOGEARS_CORE_CDM_UNITTEST_SOURCES}) + endif() + if(UNITTEST_biogears-core_engine) + add_source_files(BIOGEARS_CORE_ENGINE_UNITTEST_HEADERS LOCATION "${PROJECT_SOURCE_DIR}/projects/biogears/libBiogears/unit/" REGEX "test_core_engine*.h" SOURCE_GROUP "core_engine\\") + add_source_files(BIOGEARS_CORE_ENGINE_UNITTEST_SOURCES LOCATION "${PROJECT_SOURCE_DIR}/projects/biogears/libBiogears/unit/" REGEX "test_core_engine*.cpp" SOURCE_GROUP "core_engine\\") + LIST(APPEND UNITTEST_HEADERS ${BIOGEARS_CORE_ENGINE_UNITTEST_HEADERS}) + LIST(APPEND UNITTEST_SOURCES ${BIOGEARS_CORE_ENGINE_UNITTEST_SOURCES}) + endif() + if(UNITTEST_biogears-core_io) + add_source_files(BIOGEARS_CORE_IO_UNITTEST_HEADERS LOCATION "${PROJECT_SOURCE_DIR}/projects/biogears/libBiogears/unit/" REGEX "test_core_io*.h" SOURCE_GROUP "core_io\\") + add_source_files(BIOGEARS_CORE_IO_UNITTEST_SOURCES LOCATION "${PROJECT_SOURCE_DIR}/projects/biogears/libBiogears/unit/" REGEX "test_core_io*.cpp" SOURCE_GROUP "core_io\\") + LIST(APPEND UNITTEST_HEADERS ${BIOGEARS_CORE_IO_UNITTEST_HEADERS}) + LIST(APPEND UNITTEST_SOURCES ${BIOGEARS_CORE_IO_UNITTEST_SOURCES}) + endif() + if(UNITTEST_biogears-core_CalculatorTest ) + add_source_files(BIOGEARS_CORE_CALC_UNITTEST_HEADERS LOCATION "${PROJECT_SOURCE_DIR}/projects/biogears/libBiogears/unit/CalculatorTest/" REGEX "test_core_calc*.h" SOURCE_GROUP "core\\") + add_source_files(BIOGEARS_CORE_CALC_UNITTEST_SOURCES LOCATION "${PROJECT_SOURCE_DIR}/projects/biogears/libBiogears/unit/CalculatorTest/" REGEX "test_core_calc*.cpp" SOURCE_GROUP "core\\") + LIST(APPEND UNITTEST_HEADERS ${BIOGEARS_CORE_CALC_UNITTEST_HEADERS}) + LIST(APPEND UNITTEST_SOURCES ${BIOGEARS_CORE_CALC_UNITTEST_SOURCES}) + endif() + if(UNITTEST_biogears-core_CircuitTestTest ) + add_source_files(BIOGEARS_CORE_CIRCUIT_UNITTEST_HEADERS LOCATION "${PROJECT_SOURCE_DIR}/projects/biogears/libBiogears/unit/CircuitTest/" REGEX "test_core_circuit*.h" SOURCE_GROUP "core\\") + add_source_files(BIOGEARS_CORE_CIRCUIT_UNITTEST_SOURCES LOCATION "${PROJECT_SOURCE_DIR}/projects/biogears/libBiogears/unit/CircuitTest/" REGEX "test_core_circuit*.cpp" SOURCE_GROUP "core\\") + LIST(APPEND UNITTEST_HEADERS ${BIOGEARS_CORE_CIRCUIT_UNITTEST_HEADERS}) + LIST(APPEND UNITTEST_SOURCES ${BIOGEARS_CORE_CIRCUIT_UNITTEST_SOURCES}) + endif() + if(UNITTEST_biogears-core_RebaseTool ) + add_source_files(BIOGEARS_CORE_REBASE_UNITTEST_HEADERS LOCATION "${PROJECT_SOURCE_DIR}/projects/biogears/libBiogears/unit/RebaseTool/" REGEX "test_core_rebase*.h" SOURCE_GROUP "core\\") + add_source_files(BIOGEARS_CORE_REBASE_UNITTEST_SOURCES LOCATION "${PROJECT_SOURCE_DIR}/projects/biogears/libBiogears/unit/RebaseTool/" REGEX "test_core_rebase*.cpp" SOURCE_GROUP "core\\") + LIST(APPEND UNITTEST_HEADERS ${BIOGEARS_CORE_REBASE_UNITTEST_HEADERS}) + LIST(APPEND UNITTEST_SOURCES ${BIOGEARS_CORE_REBASE_UNITTEST_SOURCES}) + endif() + if(UNITTEST_biogears-core_TimingProfileTest ) + add_source_files(BIOGEARS_CORE_TIMING_UNITTEST_HEADERS LOCATION "${PROJECT_SOURCE_DIR}/projects/biogears/libBiogears/unit/TimingProfileTest/" REGEX "test_core_timing*.h" SOURCE_GROUP "core\\") + add_source_files(BIOGEARS_CORE_TIMING_UNITTEST_SOURCES LOCATION "${PROJECT_SOURCE_DIR}/projects/biogears/libBiogears/unit/TimingProfileTest/" REGEX "test_core_timing*.cpp" SOURCE_GROUP "core\\") + LIST(APPEND UNITTEST_HEADERS ${BIOGEARS_CORE_TIMING_UNITTEST_HEADERS}) + LIST(APPEND UNITTEST_SOURCES ${BIOGEARS_CORE_TIMING_UNITTEST_SOURCES}) + endif() + endif() if(UNITTEST_biogears-cmd) add_source_files(BIOGEARS_CMDLINE_UNITTEST_HEADERS LOCATION "${PROJECT_SOURCE_DIR}/projects/cli/unit/" REGEX "test_cli*.h" SOURCE_GROUP "cmdline\\" ) @@ -165,6 +201,10 @@ if(Biogears_BUILD_TEST) set(CORE_TEST_LIST ${BIOGEARS_CORE_CDM_UNITTEST_SOURCES}) setup_unittest( GROUP biogears-core_cdm PREFIX core_cdm TESTS ${CORE_TEST_LIST}) +set(CORE_TEST_LIST ${BIOGEARS_CORE_ENGINE_UNITTEST_SOURCES}) + setup_unittest( GROUP biogears-core_engine PREFIX core_engine + TESTS ${CORE_TEST_LIST}) + set(CMDLINE_TEST_LIST ${BIOGEARS_CMDLINE_UNITTEST_SOURCES}) setup_unittest( GROUP biogears-cmd PREFIX cmd TESTS ${CMDLINE_TEST_LIST}) @@ -183,7 +223,6 @@ if(Biogears_BUILD_TEST) target_include_directories(unittest PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src - ${GTEST_INCLUDE_DIR} ${bio_INCLUDE_DIR} ) if(UNITTEST_biogears-core) diff --git a/share/Scenarios/Burncare/BurnWoundCSMultipleCompts.xml b/share/Scenarios/Burncare/BurnWoundCSMultipleCompts.xml index adaa236e6..db4a94f05 100644 --- a/share/Scenarios/Burncare/BurnWoundCSMultipleCompts.xml +++ b/share/Scenarios/Burncare/BurnWoundCSMultipleCompts.xml @@ -2,7 +2,7 @@ BurnWound20 Patient with burn covering 20% of body surface area - ./states/StandardMale@0s.xml + StandardMale.xml @@ -21,7 +21,7 @@ - + @@ -30,31 +30,31 @@ - + - + - + - - + + - - + + - + @@ -75,54 +75,54 @@ - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/share/Scenarios/Burncare/BurnWoundCSPartialHighFluid.xml b/share/Scenarios/Burncare/BurnWoundCSPartialHighFluid.xml index a1dd461d3..d7745aee4 100644 --- a/share/Scenarios/Burncare/BurnWoundCSPartialHighFluid.xml +++ b/share/Scenarios/Burncare/BurnWoundCSPartialHighFluid.xml @@ -2,7 +2,7 @@ BurnWound20 Patient with burn covering 20% of body surface area - ./states/StandardMale@0s.xml + StandardMale.xml @@ -21,7 +21,7 @@ - + @@ -30,31 +30,31 @@ - + - + - + - - + + - - + + - + @@ -75,56 +75,57 @@ - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + diff --git a/share/Scenarios/Burncare/BurnWoundCSwithEscharotomy.xml b/share/Scenarios/Burncare/BurnWoundCSwithEscharotomy.xml index c6926dd63..b41870dc6 100644 --- a/share/Scenarios/Burncare/BurnWoundCSwithEscharotomy.xml +++ b/share/Scenarios/Burncare/BurnWoundCSwithEscharotomy.xml @@ -2,7 +2,7 @@ BurnWound20 Patient with burn covering 20% of body surface area - ./states/StandardMale@0s.xml + StandardMale.xml @@ -21,7 +21,7 @@ - + @@ -30,31 +30,31 @@ - + - + - + - - + + + - + @@ -75,54 +75,55 @@ - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + diff --git a/share/Scenarios/Drug/Naloxone_FentanylNasalStandardScenario.xml b/share/Scenarios/Drug/Naloxone_FentanylNasalStandardScenario.xml index 5ee7e72bf..ece37394c 100644 --- a/share/Scenarios/Drug/Naloxone_FentanylNasalStandardScenario.xml +++ b/share/Scenarios/Drug/Naloxone_FentanylNasalStandardScenario.xml @@ -7,24 +7,24 @@ - - + + - + - - + + - - + + @@ -38,30 +38,30 @@ - + - + - + - + - + - + - - + + @@ -70,25 +70,25 @@ - - + + - + - + - - + + @@ -99,11 +99,11 @@ - + - - + + @@ -113,15 +113,15 @@ - + - + - + @@ -139,13 +139,13 @@ - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - < - - - + + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - diff --git a/share/Scenarios/EnergyEnvironment/ExtendedExercise_EnvCondition.xml b/share/Scenarios/EnergyEnvironment/ExtendedExercise_EnvCondition.xml index 0610aa103..e9860c26d 100644 --- a/share/Scenarios/EnergyEnvironment/ExtendedExercise_EnvCondition.xml +++ b/share/Scenarios/EnergyEnvironment/ExtendedExercise_EnvCondition.xml @@ -5,7 +5,7 @@ StandardMale.xml - Standard.xml + StandardEnvironment.xml @@ -126,4 +126,4 @@ - \ No newline at end of file + diff --git a/share/Scenarios/EnergyEnvironment/InitialHighAltitudeEnvironmentState.xml b/share/Scenarios/EnergyEnvironment/InitialHighAltitudeEnvironmentState.xml index 3afd8a439..4d2fe1aff 100644 --- a/share/Scenarios/EnergyEnvironment/InitialHighAltitudeEnvironmentState.xml +++ b/share/Scenarios/EnergyEnvironment/InitialHighAltitudeEnvironmentState.xml @@ -1,125 +1,125 @@ - InitialHighAltitudeEnvironmentState + InitialHighAltitudeEnvironmentState The patient is stabilized to an environment that mimics high altitude conditions. - StandardMale.xml - - - LocalEnvironment - Air - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + StandardMale.xml + + + LocalEnvironment + Air + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - + + + + + + + + + - - - - + + + + - - - - - - - - + + + + + + + + - - - + + + diff --git a/share/Scenarios/EnergyEnvironment/SarinLethal.xml b/share/Scenarios/EnergyEnvironment/SarinLethal.xml index f42da8707..2ef8dfc31 100644 --- a/share/Scenarios/EnergyEnvironment/SarinLethal.xml +++ b/share/Scenarios/EnergyEnvironment/SarinLethal.xml @@ -2,7 +2,7 @@ Sarin Moderate Long Exposure to a lethal dose of Sarin, catalyzing entry into irreversible state - ./states/StandardMale@0s.xml + StandardMale.xml diff --git a/share/Scenarios/EnergyEnvironment/SarinSevereWithIntervention.xml b/share/Scenarios/EnergyEnvironment/SarinSevereWithIntervention.xml index c6c14d8a8..b4a9f076e 100644 --- a/share/Scenarios/EnergyEnvironment/SarinSevereWithIntervention.xml +++ b/share/Scenarios/EnergyEnvironment/SarinSevereWithIntervention.xml @@ -2,8 +2,7 @@ Sarin Moderate Long Exposure to low concentration of Sarin for an extended time period, provoking moderate physiological response - ./states/StandardMale@0s.xml - + StandardMale.xml diff --git a/share/Scenarios/EnergyEnvironment/ThermalApplication.xml b/share/Scenarios/EnergyEnvironment/ThermalApplication.xml index bed5d6ee8..d94730d80 100644 --- a/share/Scenarios/EnergyEnvironment/ThermalApplication.xml +++ b/share/Scenarios/EnergyEnvironment/ThermalApplication.xml @@ -74,7 +74,7 @@ - + @@ -88,7 +88,7 @@ - + @@ -122,7 +122,7 @@ - + @@ -137,7 +137,7 @@ - + @@ -157,4 +157,3 @@ - diff --git a/share/Scenarios/Miscellaneous/HouseFireSmoke.xml b/share/Scenarios/Miscellaneous/HouseFireSmoke.xml index cf9df62cb..f6c52eaff 100644 --- a/share/Scenarios/Miscellaneous/HouseFireSmoke.xml +++ b/share/Scenarios/Miscellaneous/HouseFireSmoke.xml @@ -108,7 +108,7 @@ - LocalEnvironment + HouseFireSmokeEnvironment diff --git a/share/Scenarios/Miscellaneous/VasopressinShockTherapy_Treatment.xml b/share/Scenarios/Miscellaneous/VasopressinShockTherapy_Treatment.xml index bf6349133..2e92d8757 100644 --- a/share/Scenarios/Miscellaneous/VasopressinShockTherapy_Treatment.xml +++ b/share/Scenarios/Miscellaneous/VasopressinShockTherapy_Treatment.xml @@ -52,11 +52,11 @@ - + @@ -87,4 +87,3 @@ - diff --git a/share/Scenarios/Patient/Anemia30.xml b/share/Scenarios/Patient/Anemia30.xml index 75c5c3a4e..f2aa4824a 100644 --- a/share/Scenarios/Patient/Anemia30.xml +++ b/share/Scenarios/Patient/Anemia30.xml @@ -80,10 +80,8 @@ - + - - diff --git a/share/Scenarios/Patient/BasicStandard.xml b/share/Scenarios/Patient/BasicStandard.xml index 576846c5e..e40af99b4 100644 --- a/share/Scenarios/Patient/BasicStandard.xml +++ b/share/Scenarios/Patient/BasicStandard.xml @@ -19,21 +19,21 @@ - + - + - + @@ -46,7 +46,7 @@ - + @@ -55,21 +55,21 @@ - + - + - + - + @@ -78,34 +78,34 @@ - + - + - + - - + + - - - - - + + + + + - - - - + + + + diff --git a/share/Scenarios/Patient/EbolaSevere.xml b/share/Scenarios/Patient/EbolaSevere.xml index 58cda296c..5df54dfe5 100644 --- a/share/Scenarios/Patient/EbolaSevere.xml +++ b/share/Scenarios/Patient/EbolaSevere.xml @@ -2,104 +2,107 @@ EbolaSevere A ebola viral exposure. - ./states/StandardMale@0s.xml + + StandardMale.xml + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + - + + diff --git a/share/Scenarios/Patient/InfectionMild.xml b/share/Scenarios/Patient/InfectionMild.xml index 65ddcbfeb..1ca14bac4 100644 --- a/share/Scenarios/Patient/InfectionMild.xml +++ b/share/Scenarios/Patient/InfectionMild.xml @@ -84,7 +84,7 @@ - Agua + Agua_1 @@ -93,7 +93,7 @@ - Agua + Agua_2 @@ -102,7 +102,7 @@ - Agua + Agua_3 @@ -125,7 +125,7 @@ - Agua + Agua_4 @@ -134,7 +134,7 @@ - Agua + Agua_5 @@ -143,7 +143,7 @@ - Agua + Agua_6 @@ -152,7 +152,7 @@ - Agua + Agua_7 @@ -175,7 +175,7 @@ - Agua + Agua_7 @@ -184,7 +184,7 @@ - Agua + Agua_8 @@ -197,7 +197,7 @@ - Agua + Agua_9 @@ -206,7 +206,7 @@ - Agua + Agua_10 @@ -215,7 +215,7 @@ - Agua + Agua_11 @@ -224,7 +224,7 @@ - Agua + Agua_13 @@ -233,7 +233,7 @@ - Agua + Agua_14 @@ -242,7 +242,7 @@ - Agua + Agua_15 @@ -251,7 +251,7 @@ - Agua + Agua_16 @@ -260,7 +260,7 @@ - Agua + Agua_17 @@ -269,7 +269,7 @@ - Agua + Agua_18 @@ -278,7 +278,7 @@ - Agua + Agua_20 @@ -287,7 +287,7 @@ - Agua + Agua_21 @@ -296,7 +296,7 @@ - Agua + Agua_22 diff --git a/share/Scenarios/Showcase/AsthmaAttack.xml b/share/Scenarios/Showcase/AsthmaAttack.xml index 652c9a6f6..c11bc0b14 100644 --- a/share/Scenarios/Showcase/AsthmaAttack.xml +++ b/share/Scenarios/Showcase/AsthmaAttack.xml @@ -1,17 +1,15 @@ AsthmaAttack - Showcase scenario: Patient is afflicted with an severe acute asthma attack. Albuterol is administered. - - Female_40_Overweight.xml - + Showcase scenario: Patient is afflicted with an severe acute asthma attack. Albuterol is administered. + Female_30_Normal@0s.xml - DataRequests/Standard.xml + DataRequests/StandardDataRequests.xml - Timelines/AsthmaAttack.xml + timelines/AsthmaAttack.xml - \ No newline at end of file + diff --git a/share/data/config/VerificationScenarios.config b/share/data/config/VerificationScenarios.config index 92a2be634..bf5844d77 100644 --- a/share/data/config/VerificationScenarios.config +++ b/share/data/config/VerificationScenarios.config @@ -25,82 +25,81 @@ Driver ScenarioTest : ScenarioTestDriver { ScenarioTest( BasicStandard, Scenario=Patient/BasicStandard.xml ) @group Patient -ScenarioTest( AcuteRespiratoryDistress, Scenario=Patient/AcuteRespiratoryDistress.xml ) -ScenarioTest( AcuteRespiratoryDistress_Ventilation, Scenario=Patient/AcuteRespiratoryDistress_Ventilation.xml ) -ScenarioTest( AirwayObstructionVaried, Scenario=Patient/AirwayObstructionVaried.xml ) -ScenarioTest( AcuteStress, Scenario=Patient/AcuteStress.xml ) -ScenarioTest( AsthmaAttackModerateAcute, Scenario=Patient/AsthmaAttackModerateAcute.xml ) -ScenarioTest( AsthmaAttackSevereAcute, Scenario=Patient/AsthmaAttackSevereAcute.xml ) -ScenarioTest( AsthmaAttackLifeThreateningAcute, Scenario=Patient/AsthmaAttackLifeThreateningAcute.xml ) -ScenarioTest( Anemia30, Scenario=Patient/Anemia30.xml ) -ScenarioTest( ApneaVaried, Scenario=Patient/ApneaVaried.xml ) -ScenarioTest( Baroreceptors, Scenario=Patient/Baroreceptors.xml ) -ScenarioTest( BrainInjury, Scenario=Patient/BrainInjury.xml ) -ScenarioTest( BronchoConstrictionVaried, Scenario=Patient/BronchoConstrictionVaried.xml ) -ScenarioTest( BurnWound, Scenario=Patient/BurnWound.xml ) -ScenarioTest( COPDSevereEmphysema, Scenario=Patient/COPDSevereEmphysema.xml ) -ScenarioTest( COPDSevereBronchitis, Scenario=Patient/COPDSevereBronchitis.xml ) -ScenarioTest( Cough, Scenario=Patient/Cough.xml ) -ScenarioTest( CPRForceScaleMax, Scenario=Patient/CPRForceScaleMax.xml ) -ScenarioTest( CPRForceScale, Scenario=Patient/CPRForceScale.xml ) -ScenarioTest( CPRForce, Scenario=Patient/CPRForce.xml ) -ScenarioTest( Dehydrate, Scenario=Patient/Dehydrate.xml ) +#ScenarioTest( AcuteRespiratoryDistress, Scenario=Patient/AcuteRespiratoryDistress.xml ) +#ScenarioTest( AcuteRespiratoryDistress_Ventilation, Scenario=Patient/AcuteRespiratoryDistress_Ventilation.xml ) +#ScenarioTest( AirwayObstructionVaried, Scenario=Patient/AirwayObstructionVaried.xml ) +#ScenarioTest( AcuteStress, Scenario=Patient/AcuteStress.xml ) +#ScenarioTest( AsthmaAttackModerateAcute, Scenario=Patient/AsthmaAttackModerateAcute.xml ) +#ScenarioTest( AsthmaAttackSevereAcute, Scenario=Patient/AsthmaAttackSevereAcute.xml ) +#ScenarioTest( AsthmaAttackLifeThreateningAcute, Scenario=Patient/AsthmaAttackLifeThreateningAcute.xml ) +#ScenarioTest( Anemia30, Scenario=Patient/Anemia30.xml ) +#ScenarioTest( ApneaVaried, Scenario=Patient/ApneaVaried.xml ) +#ScenarioTest( Baroreceptors, Scenario=Patient/Baroreceptors.xml ) +#ScenarioTest( BrainInjury, Scenario=Patient/BrainInjury.xml ) +#ScenarioTest( BronchoConstrictionVaried, Scenario=Patient/BronchoConstrictionVaried.xml ) +#ScenarioTest( BurnWound, Scenario=Patient/BurnWound.xml ) +#ScenarioTest( COPDSevereEmphysema, Scenario=Patient/COPDSevereEmphysema.xml ) +#ScenarioTest( COPDSevereBronchitis, Scenario=Patient/COPDSevereBronchitis.xml ) +#ScenarioTest( Cough, Scenario=Patient/Cough.xml ) +#ScenarioTest( CPRForceScaleMax, Scenario=Patient/CPRForceScaleMax.xml ) +#ScenarioTest( CPRForceScale, Scenario=Patient/CPRForceScale.xml ) +#ScenarioTest( CPRForce, Scenario=Patient/CPRForce.xml ) +#ScenarioTest( Dehydrate, Scenario=Patient/Dehydrate.xml ) ScenarioTest( EbolaSevere, Scenario=Patient/EbolaSevere.xml ) -ScenarioTest( EffusionCondition, Scenario=Patient/EffusionCondition.xml ) -ScenarioTest( EffusionConditionPlus, Scenario=Patient/EffusionConditionPlus.xml ) -ScenarioTest( EsophagealIntubation, Scenario=Patient/EsophagealIntubation.xml ) -ScenarioTest( HemorrhageBloodTransfusionReaction, Scenario=Patient/HemorrhageBloodTransfusionReaction.xml ) -ScenarioTest( HemorrhageClass2NoFluid, Scenario=Patient/HemorrhageClass2NoFluid.xml ) -ScenarioTest( HemorrhageClass2Blood, Scenario=Patient/HemorrhageClass2Blood.xml ) -ScenarioTest( HemorrhageClass2Saline, Scenario=Patient/HemorrhageClass2Saline.xml ) -ScenarioTest( HemorrhageClass4NoFluid, Scenario=Patient/HemorrhageClass4NoFluid.xml ) -ScenarioTest( HemorrhageCM1, Scenario=Patient/HemorrhageCM1.xml ) -ScenarioTest( HemorrhageCM2, Scenario=Patient/HemorrhageCM2.xml ) -ScenarioTest( InfectionMild, Scenario=Patient/InfectionMild.xml ) -ScenarioTest( InfectionModerate, Scenario=Patient/InfectionModerate.xml ) -ScenarioTest( InfectionSevere, Scenario=Patient/InfectionSevere.xml ) -ScenarioTest( Inhaler_OneActuation, Scenario=Patient/Inhaler_OneActuation.xml ) -ScenarioTest( Inhaler_OneActuationWithSpacer, Scenario=Patient/Inhaler_OneActuationWithSpacer.xml ) -ScenarioTest( Inhaler_OneActuationIncorrectUse, Scenario=Patient/Inhaler_OneActuationIncorrectUse.xml ) -ScenarioTest( Inhaler_OneActuationWithSpacerIncorrectUse, Scenario=Patient/Inhaler_OneActuationWithSpacerIncorrectUse.xml ) -ScenarioTest( Inhaler_TwoActuations, Scenario=Patient/Inhaler_TwoActuations.xml ) -ScenarioTest( IVFluids, Scenario=Patient/IVFluids.xml ) -ScenarioTest( LobarPneumoniaModerateBothLungs, Scenario=Patient/LobarPneumoniaModerateBothLungs.xml ) -ScenarioTest( LobarPneumoniaSevereLeftLobe, Scenario=Patient/LobarPneumoniaSevereLeftLobe.xml ) -ScenarioTest( LobarPneumoniaSevereRightLung, Scenario=Patient/LobarPneumoniaSevereRightLung.xml ) -ScenarioTest( MainstemIntubation, Scenario=Patient/MainstemIntubation.xml ) -ScenarioTest( Medic1Scenario1, Scenario=Patient/Medic1Scenario1.xml ) -ScenarioTest( Medic1Scenario2, Scenario=Patient/Medic1Scenario2.xml ) -ScenarioTest( Medic1Scenario3, Scenario=Patient/Medic1Scenario3.xml ) -ScenarioTest( Medic1Scenario4, Scenario=Patient/Medic1Scenario4.xml ) -ScenarioTest( NasalCannula, Scenario=Patient/NasalCannula.xml ) -ScenarioTest( PainStimulusModerate, Scenario=Patient/PainStimulusModerate.xml ) -ScenarioTest( PulmonaryShunt, Scenario=Patient/PulmonaryShunt.xml ) -ScenarioTest( RadiationModerateDose, Scenario=Patient/RadiationModerateDose.xml ) -ScenarioTest( SalineInfusion, Scenario=Patient/SalineInfusion.xml ) -ScenarioTest( Sepsis, Scenario=Patient/Sepsis.xml ) -ScenarioTest( SepticShock, Scenario=Patient/SepticShock.xml ) -ScenarioTest( SepticShock_Treatment, Scenario=Patient/SepticShock_Treatment.xml ) -ScenarioTest( RenalStenosisSevereBilateral, Scenario=Patient/RenalStenosisSevereBilateral.xml ) -ScenarioTest( RenalStenosisModerateUnilateral, Scenario=Patient/RenalStenosisModerateUnilateral.xml ) -ScenarioTest( SinusBradycardia, Scenario=Patient/SinusBradycardia.xml ) -ScenarioTest( SinusTachycardia, Scenario=Patient/SinusTachycardia.xml ) -ScenarioTest( SleepStudy, Scenario=Patient/SleepStudy.xml ) -ScenarioTest( TensionPneumothoraxBilateral, Scenario=Patient/TensionPneumothoraxBilateral.xml ) -ScenarioTest( TensionPneumothoraxClosedVaried, Scenario=Patient/TensionPneumothoraxClosedVaried.xml ) -ScenarioTest( TensionPneumothoraxOpenVaried, Scenario=Patient/TensionPneumothoraxOpenVaried.xml ) -ScenarioTest( TXALowHemorrhage, Scenario=Patient/TXALowHemorrhage.xml ) -ScenarioTest( VentricularSystolicDysfunction, Scenario=Patient/VentricularSystolicDysfunction.xml ) - -@group EnergyEnvironment -ScenarioTest( CarbonMonoxideExtreme, Scenario=EnergyEnvironment/CarbonMonoxideExtreme.xml ) -ScenarioTest( CarbonMonoxideThreshold, Scenario=EnergyEnvironment/CarbonMonoxideThreshold.xml ) -ScenarioTest( CarbonMonoxideThresholdLong, Scenario=EnergyEnvironment/CarbonMonoxideThresholdLong.xml ) +#ScenarioTest( EffusionCondition, Scenario=Patient/EffusionCondition.xml ) +#ScenarioTest( EffusionConditionPlus, Scenario=Patient/EffusionConditionPlus.xml ) +#ScenarioTest( EsophagealIntubation, Scenario=Patient/EsophagealIntubation.xml ) +#ScenarioTest( HemorrhageBloodTransfusionReaction, Scenario=Patient/HemorrhageBloodTransfusionReaction.xml ) +#ScenarioTest( HemorrhageClass2NoFluid, Scenario=Patient/HemorrhageClass2NoFluid.xml ) +#ScenarioTest( HemorrhageClass2Blood, Scenario=Patient/HemorrhageClass2Blood.xml ) +#ScenarioTest( HemorrhageClass2Saline, Scenario=Patient/HemorrhageClass2Saline.xml ) +#ScenarioTest( HemorrhageClass4NoFluid, Scenario=Patient/HemorrhageClass4NoFluid.xml ) +#ScenarioTest( HemorrhageCM1, Scenario=Patient/HemorrhageCM1.xml ) +#ScenarioTest( HemorrhageCM2, Scenario=Patient/HemorrhageCM2.xml ) +#ScenarioTest( InfectionMild, Scenario=Patient/InfectionMild.xml ) +#ScenarioTest( InfectionModerate, Scenario=Patient/InfectionModerate.xml ) +#ScenarioTest( InfectionSevere, Scenario=Patient/InfectionSevere.xml ) +#ScenarioTest( Inhaler_OneActuation, Scenario=Patient/Inhaler_OneActuation.xml ) +#ScenarioTest( Inhaler_OneActuationWithSpacer, Scenario=Patient/Inhaler_OneActuationWithSpacer.xml ) +#ScenarioTest( Inhaler_OneActuationIncorrectUse, Scenario=Patient/Inhaler_OneActuationIncorrectUse.xml ) +#ScenarioTest( Inhaler_OneActuationWithSpacerIncorrectUse, Scenario=Patient/Inhaler_OneActuationWithSpacerIncorrectUse.xml ) +#ScenarioTest( Inhaler_TwoActuations, Scenario=Patient/Inhaler_TwoActuations.xml ) +#ScenarioTest( IVFluids, Scenario=Patient/IVFluids.xml ) +#ScenarioTest( LobarPneumoniaModerateBothLungs, Scenario=Patient/LobarPneumoniaModerateBothLungs.xml ) +#ScenarioTest( LobarPneumoniaSevereLeftLobe, Scenario=Patient/LobarPneumoniaSevereLeftLobe.xml ) +#ScenarioTest( LobarPneumoniaSevereRightLung, Scenario=Patient/LobarPneumoniaSevereRightLung.xml ) +#ScenarioTest( MainstemIntubation, Scenario=Patient/MainstemIntubation.xml ) +#ScenarioTest( Medic1Scenario1, Scenario=Patient/Medic1Scenario1.xml ) +#ScenarioTest( Medic1Scenario2, Scenario=Patient/Medic1Scenario2.xml ) +#ScenarioTest( Medic1Scenario3, Scenario=Patient/Medic1Scenario3.xml ) +#ScenarioTest( Medic1Scenario4, Scenario=Patient/Medic1Scenario4.xml ) +#ScenarioTest( NasalCannula, Scenario=Patient/NasalCannula.xml ) +#ScenarioTest( PainStimulusModerate, Scenario=Patient/PainStimulusModerate.xml ) +#ScenarioTest( PulmonaryShunt, Scenario=Patient/PulmonaryShunt.xml ) +#ScenarioTest( RadiationModerateDose, Scenario=Patient/RadiationModerateDose.xml ) +#ScenarioTest( SalineInfusion, Scenario=Patient/SalineInfusion.xml ) +#ScenarioTest( Sepsis, Scenario=Patient/Sepsis.xml ) +#ScenarioTest( SepticShock, Scenario=Patient/SepticShock.xml ) +#ScenarioTest( SepticShock_Treatment, Scenario=Patient/SepticShock_Treatment.xml ) +#ScenarioTest( RenalStenosisSevereBilateral, Scenario=Patient/RenalStenosisSevereBilateral.xml ) +#ScenarioTest( RenalStenosisModerateUnilateral, Scenario=Patient/RenalStenosisModerateUnilateral.xml ) +#ScenarioTest( SinusBradycardia, Scenario=Patient/SinusBradycardia.xml ) +#ScenarioTest( SinusTachycardia, Scenario=Patient/SinusTachycardia.xml ) +#ScenarioTest( SleepStudy, Scenario=Patient/SleepStudy.xml ) +#ScenarioTest( TensionPneumothoraxBilateral, Scenario=Patient/TensionPneumothoraxBilateral.xml ) +#ScenarioTest( TensionPneumothoraxClosedVaried, Scenario=Patient/TensionPneumothoraxClosedVaried.xml ) +#ScenarioTest( TensionPneumothoraxOpenVaried, Scenario=Patient/TensionPneumothoraxOpenVaried.xml ) +#ScenarioTest( TXALowHemorrhage, Scenario=Patient/TXALowHemorrhage.xml ) +#ScenarioTest( VentricularSystolicDysfunction, Scenario=Patient/VentricularSystolicDysfunction.xml ) +# +#@group EnergyEnvironment +#ScenarioTest( CarbonMonoxideExtreme, Scenario=EnergyEnvironment/CarbonMonoxideExtreme.xml ) +#ScenarioTest( CarbonMonoxideThreshold, Scenario=EnergyEnvironment/CarbonMonoxideThreshold.xml ) +#ScenarioTest( CarbonMonoxideThresholdLong, Scenario=EnergyEnvironment/CarbonMonoxideThresholdLong.xml ) ScenarioTest( ColdWaterSubmersion, Scenario=EnergyEnvironment/ColdWaterSubmersion.xml ) ScenarioTest( ExerciseRun, Scenario=EnergyEnvironment/ExerciseRun.xml ) ScenarioTest( ExerciseRunWithPack, Scenario=EnergyEnvironment/ExerciseRunWithPack.xml ) ScenarioTest( ExerciseStrengthTraining, Scenario=EnergyEnvironment/ExerciseStrengthTraining.xml ) -ScenarioTest( ExerciseVO2cycle, Scenario=EnergyEnvironment/ExerciseVO2cycle.xml ) ScenarioTest( ExerciseTemperatureTest, Scenario=EnergyEnvironment/ExerciseTemperatureTest.xml ) ScenarioTest( ExtendedExercise_EnvAction, Scenario=EnergyEnvironment/ExtendedExercise_EnvAction.xml ) ScenarioTest( ExtendedExercise_EnvCondition, Scenario=EnergyEnvironment/ExtendedExercise_EnvCondition.xml ) @@ -114,14 +113,14 @@ ScenarioTest( HighAltitudeEnvironmentChange, Scenario=EnergyEnvironment/HighAlti ScenarioTest( HighAltitudeEnvironmentFileChange, Scenario=EnergyEnvironment/HighAltitudeEnvironmentFileChange.xml ) ScenarioTest( InitialHighAltitudeEnvironmentFile, Scenario=EnergyEnvironment/InitialHighAltitudeEnvironmentFile.xml ) ScenarioTest( InitialHighAltitudeEnvironmentState, Scenario=EnergyEnvironment/InitialHighAltitudeEnvironmentState.xml ) -ScenarioTest( SarinLethal, Scenario=EnergyEnvironment/SarinLethal.xml ) -ScenarioTest( SarinLethal, Scenario=EnergyEnvironment/Sarin65Severe.xml ) -ScenarioTest( SarinLethal, Scenario=EnergyEnvironment/Sarin80Severe.xml ) -ScenarioTest( SarinModerateLong, Scenario=EnergyEnvironment/SarinModerateLong.xml ) -ScenarioTest( SarinModerateShort, Scenario=EnergyEnvironment/SarinModerateShort.xml ) -ScenarioTest( SarinSevere, Scenario=EnergyEnvironment/SarinSevere.xml ) -ScenarioTest( SarinSevereWithIntervention, Scenario=EnergyEnvironment/SarinSevereWithIntervention.xml ) -ScenarioTest( SarinThreshold, Scenario=EnergyEnvironment/SarinThreshold.xml ) +#ScenarioTest( SarinLethal, Scenario=EnergyEnvironment/SarinLethal.xml ) +#ScenarioTest( SarinLethal, Scenario=EnergyEnvironment/Sarin65Severe.xml ) +#ScenarioTest( SarinLethal, Scenario=EnergyEnvironment/Sarin80Severe.xml ) +#ScenarioTest( SarinModerateLong, Scenario=EnergyEnvironment/SarinModerateLong.xml ) +#ScenarioTest( SarinModerateShort, Scenario=EnergyEnvironment/SarinModerateShort.xml ) +#ScenarioTest( SarinSevere, Scenario=EnergyEnvironment/SarinSevere.xml ) +#ScenarioTest( SarinSevereWithIntervention, Scenario=EnergyEnvironment/SarinSevereWithIntervention.xml ) +#ScenarioTest( SarinThreshold, Scenario=EnergyEnvironment/SarinThreshold.xml ) ScenarioTest( ThermalApplication, Scenario=EnergyEnvironment/ThermalApplication.xml ) @group Anesthesia Machine @@ -300,4 +299,4 @@ ScenarioTest( BurnWoundTreatment, Scenario=Burncare/BurnWoundTreatment.xml ) ScenarioTest( BurnWound10, Scenario=Burncare/BurnWound10.xml ) ScenarioTest( BurnWound20, Scenario=Burncare/BurnWound20.xml ) ScenarioTest( BurnWound25, Scenario=Burncare/BurnWound25.xml ) -ScenarioTest( BurnWound40, Scenario=Burncare/BurnWound40.xml ) \ No newline at end of file +ScenarioTest( BurnWound40, Scenario=Burncare/BurnWound40.xml ) diff --git a/share/data/datarequests/standard.xml b/share/data/datarequests/StandardDataRequests.xml similarity index 100% rename from share/data/datarequests/standard.xml rename to share/data/datarequests/StandardDataRequests.xml diff --git a/share/data/patients/Male_44_Normal.xml b/share/data/patients/Male_44_Normal.xml index 5bda0868f..0b742789b 100644 --- a/share/data/patients/Male_44_Normal.xml +++ b/share/data/patients/Male_44_Normal.xml @@ -1,6 +1,10 @@ +<<<<<<< HEAD Male_25_Normal +======= + Male_44_Normal +>>>>>>> b609a3f6 (abaird - making sure that the patient name and file name are the same to reduce state generation confusion) Male diff --git a/share/data/states/DefaultTemplateFemale@0s.xml b/share/data/states/DefaultTemplateFemale@0s.xml index a493abc28..75ea26e8e 100644 --- a/share/data/states/DefaultTemplateFemale@0s.xml +++ b/share/data/states/DefaultTemplateFemale@0s.xml @@ -1,5 +1,5 @@ - + DefaultTemplateFemale @@ -180,7 +180,7 @@ - + @@ -316,7 +316,7 @@ - + @@ -366,7 +366,7 @@ - + @@ -389,7 +389,7 @@ - + @@ -422,7 +422,7 @@ - + @@ -447,7 +447,7 @@ - + @@ -470,7 +470,7 @@ - + @@ -518,7 +518,7 @@ - + @@ -574,7 +574,7 @@ - + @@ -597,7 +597,7 @@ - + @@ -610,7 +610,7 @@ Liquid - + @@ -622,7 +622,7 @@ - + @@ -647,7 +647,7 @@ - + @@ -688,7 +688,7 @@ - + @@ -915,7 +915,6 @@ - false true false @@ -1014,6 +1013,7 @@ + @@ -1163,16 +1163,13 @@ - - - @@ -1219,15 +1216,15 @@ false - + - - + + @@ -1240,9 +1237,9 @@ 58.2915 25.7632479747953 - - - + + + @@ -1304,8 +1301,8 @@ - - + + @@ -1320,6 +1317,9 @@ 6 + + + @@ -1327,20 +1327,12 @@ Ambient Ambient - - - - Aorta Aorta1 Aorta2 Aorta3 - - - - Nitrogen @@ -1603,10 +1595,6 @@ Bladder Bladder - - - - Nitrogen @@ -1872,8 +1860,6 @@ BoneE3 BoneL1 BoneL2 - - Nitrogen @@ -2136,8 +2122,6 @@ BoneTissueIntracellular BoneI - - Nitrogen @@ -2401,10 +2385,6 @@ BoneVasculature Bone1 Bone2 - - - - Nitrogen @@ -2671,8 +2651,6 @@ BrainE3 BrainL1 BrainL2 - - Nitrogen @@ -2935,8 +2913,6 @@ BrainTissueIntracellular BrainI - - Nitrogen @@ -3201,276 +3177,269 @@ CerebralArteries CerebralCapillaries CerebralVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + CerebralArteries CerebralArteries1 CerebralArteries2 - - - - Nitrogen @@ -3733,10 +3702,6 @@ CerebralCapillaries CerebralCapillaries - - - - Nitrogen @@ -3999,8 +3964,6 @@ CerebralSpinalFluid SpinalFluid - - Nitrogen @@ -4264,10 +4227,6 @@ CerebralVeins1 CerebralVeins2 CerebralVeinsCheck - - - - Nitrogen @@ -4534,8 +4493,6 @@ FatE3 FatL1 FatL2 - - Nitrogen @@ -4798,8 +4755,6 @@ FatTissueIntracellular FatI - - Nitrogen @@ -5063,10 +5018,6 @@ FatVasculature Fat1 Fat2 - - - - Nitrogen @@ -5329,9 +5280,6 @@ Ground Ground - - - Nitrogen @@ -5452,8 +5400,6 @@ GutE3 GutL1 GutL2 - - Nitrogen @@ -5716,8 +5662,6 @@ GutTissueIntracellular GutI - - Nitrogen @@ -5982,266 +5926,263 @@ SplanchnicVasculature SmallIntestineVasculature LargeIntestineVasculature - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -6250,541 +6191,529 @@ LeftHeart RightHeart Pericardium - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + KidneyVasculature LeftKidneyVasculature RightKidneyVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LargeIntestineVasculature LargeIntestine1 - - - - Nitrogen @@ -7047,10 +6976,6 @@ LeftAfferentArteriole LeftAfferentArteriole - - - - Nitrogen @@ -7313,26 +7238,15 @@ LeftAlveoli LeftAlveoli - - - - LeftAlveoliLeak LeftAlveoliLeak - - - LeftArmVasculature LeftArm1 LeftArm2 - - - - Nitrogen @@ -7596,10 +7510,6 @@ LeftAtrium LeftAtrium1 LeftAtrium2 - - - - Nitrogen @@ -7863,10 +7773,6 @@ LeftBowmansCapsules LeftBowmansCapsules LeftNetBowmansCapsules - - - - Nitrogen @@ -8129,25 +8035,14 @@ LeftBronchi LeftBronchi - - - - LeftChestLeak LeftChestLeak - - - LeftEfferentArteriole LeftEfferentArteriole - - - - Nitrogen @@ -8411,10 +8306,6 @@ LeftGlomerularCapillaries LeftGlomerularCapillaries LeftNetGlomerularCapillaries - - - - Nitrogen @@ -8678,266 +8569,262 @@ LeftHeart LeftAtrium LeftVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -8947,8 +8834,6 @@ LeftKidneyE3 LeftKidneyL1 LeftKidneyL2 - - Nitrogen @@ -9211,8 +9096,6 @@ LeftKidneyTissueIntracellular LeftKidneyI - - Nitrogen @@ -9477,276 +9360,269 @@ LeftRenalArtery LeftNephron LeftRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftLegVasculature LeftLeg1 LeftLeg2 - - - - Nitrogen @@ -10010,10 +9886,6 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - - LeftLungTissueExtracellular @@ -10022,10 +9894,6 @@ LeftLungE3 LeftLungL1 LeftLungL2 - - - - Nitrogen @@ -10288,8 +10156,6 @@ LeftLungTissueIntracellular LeftLungI - - Nitrogen @@ -10554,266 +10420,263 @@ LeftPulmonaryArteries LeftPulmonaryCapillaries LeftPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -10824,276 +10687,269 @@ LeftPeritubularCapillaries LeftBowmansCapsules LeftTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftPeritubularCapillaries LeftPeritubularCapillaries LeftNetPeritubularCapillaries - - - - Nitrogen @@ -11357,19 +11213,11 @@ LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - LeftPulmonaryArteries LeftPulmonaryArteries LeftIntermediatePulmonaryArteries - - - - Nitrogen @@ -11632,10 +11480,6 @@ LeftPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen @@ -11898,10 +11742,6 @@ LeftPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen @@ -12164,10 +12004,6 @@ LeftRenalArtery LeftRenalArtery - - - - Nitrogen @@ -12430,10 +12266,6 @@ LeftRenalVein LeftRenalVein - - - - Nitrogen @@ -12697,10 +12529,6 @@ LeftTubules LeftTubules LeftNetTubules - - - - Nitrogen @@ -12963,10 +12791,6 @@ LeftUreter LeftUreter - - - - Nitrogen @@ -13229,10 +13053,6 @@ LeftVentricle LeftVentricle1 LeftVentricle2 - - - - Nitrogen @@ -13499,8 +13319,6 @@ LiverE3 LiverL1 LiverL2 - - Nitrogen @@ -13763,8 +13581,6 @@ LiverTissueIntracellular LiverI - - Nitrogen @@ -14030,9 +13846,6 @@ Liver2 PortalVein1 - - - Nitrogen @@ -14296,273 +14109,267 @@ LungsVasculature LeftLungVasculature RightLungVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + Lymph Lymph - - Nitrogen @@ -14824,16 +14631,10 @@ Mouth Mouth - - - - Mouthpiece Mouthpiece - - MuscleTissueExtracellular @@ -14842,8 +14643,6 @@ MuscleE3 MuscleL1 MuscleL2 - - Nitrogen @@ -15106,8 +14905,6 @@ MuscleTissueIntracellular MuscleI - - Nitrogen @@ -15371,10 +15168,6 @@ MuscleVasculature Muscle1 Muscle2 - - - - Nitrogen @@ -15641,8 +15434,6 @@ MyocardiumE3 MyocardiumL1 MyocardiumL2 - - Nitrogen @@ -15905,8 +15696,6 @@ MyocardiumTissueIntracellular MyocardiumI - - Nitrogen @@ -16170,10 +15959,6 @@ MyocardiumVasculature Myocardium1 Myocardium2 - - - - Nitrogen @@ -16436,10 +16221,6 @@ NeckArteries NeckArteries - - - - Nitrogen @@ -16702,10 +16483,6 @@ NeckVeins NeckVeins - - - - Nitrogen @@ -16968,8 +16745,6 @@ Pericardium Pericardium1 - - Nitrogen @@ -17233,825 +17008,801 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - PulmonaryArteries RightPulmonaryArteries LeftPulmonaryArteries - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryCapillaries RightPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - - PulmonaryVeins RightPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightAfferentArteriole RightAfferentArteriole - - - - Nitrogen @@ -18314,26 +18065,15 @@ RightAlveoli RightAlveoli - - - - RightAlveoliLeak RightAlveoliLeak - - - RightArmVasculature RightArm1 RightArm2 - - - - Nitrogen @@ -18597,10 +18337,6 @@ RightAtrium RightAtrium1 RightAtrium2 - - - - Nitrogen @@ -18864,10 +18600,6 @@ RightBowmansCapsules RightBowmansCapsules RightNetBowmansCapsules - - - - Nitrogen @@ -19130,25 +18862,14 @@ RightBronchi RightBronchi - - - - RightChestLeak RightChestLeak - - - RightEfferentArteriole RightEfferentArteriole - - - - Nitrogen @@ -19412,10 +19133,6 @@ RightGlomerularCapillaries RightGlomerularCapillaries RightNetGlomerularCapillaries - - - - Nitrogen @@ -19679,266 +19396,262 @@ RightHeart RightAtrium RightVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -19948,8 +19661,6 @@ RightKidneyE3 RightKidneyL1 RightKidneyL2 - - Nitrogen @@ -20212,8 +19923,6 @@ RightKidneyTissueIntracellular RightKidneyI - - Nitrogen @@ -20478,276 +20187,269 @@ RightRenalArtery RightNephron RightRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightLegVasculature RightLeg1 RightLeg2 - - - - Nitrogen @@ -21011,10 +20713,6 @@ RightLungPulmonary RightBronchi RightAlveoli - - - - RightLungTissueExtracellular @@ -21023,8 +20721,6 @@ RightLungE3 RightLungL1 RightLungL2 - - Nitrogen @@ -21287,8 +20983,6 @@ RightLungTissueIntracellular RightLungI - - Nitrogen @@ -21553,266 +21247,263 @@ RightPulmonaryArteries RightPulmonaryCapillaries RightPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -21823,276 +21514,269 @@ RightPeritubularCapillaries RightBowmansCapsules RightTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightPeritubularCapillaries RightPeritubularCapillaries RightNetPeritubularCapillaries - - - - Nitrogen @@ -22356,19 +22040,11 @@ RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - RightPulmonaryArteries RightPulmonaryArteries RightIntermediatePulmonaryArteries - - - - Nitrogen @@ -22631,10 +22307,6 @@ RightPulmonaryCapillaries RightPulmonaryCapillaries - - - - Nitrogen @@ -22897,10 +22569,6 @@ RightPulmonaryVeins RightPulmonaryVeins - - - - Nitrogen @@ -23163,10 +22831,6 @@ RightRenalArtery RightRenalArtery - - - - Nitrogen @@ -23429,10 +23093,6 @@ RightRenalVein RightRenalVein - - - - Nitrogen @@ -23696,10 +23356,6 @@ RightTubules RightTubules RightNetTubules - - - - Nitrogen @@ -23962,10 +23618,6 @@ RightUreter RightUreter - - - - Nitrogen @@ -24229,10 +23881,6 @@ RightVentricle1 RightVentricle2 MainPulmonaryArteries - - - - Nitrogen @@ -24499,8 +24147,6 @@ SkinE3 SkinL1 SkinL2 - - Nitrogen @@ -24763,8 +24409,6 @@ SkinTissueIntracellular SkinI - - Nitrogen @@ -25028,10 +24672,6 @@ SkinVasculature Skin1 Skin2 - - - - Nitrogen @@ -25294,8 +24934,6 @@ SmallIntestineChyme SmallIntestineC1 - - Nitrogen @@ -25557,10 +25195,6 @@ SmallIntestineVasculature SmallIntestine1 - - - - Nitrogen @@ -25823,10 +25457,6 @@ SplanchnicVasculature Splanchnic1 - - - - Nitrogen @@ -26093,8 +25723,6 @@ SpleenE3 SpleenL1 SpleenL2 - - Nitrogen @@ -26357,8 +25985,6 @@ SpleenTissueIntracellular SpleenI - - Nitrogen @@ -26621,10 +26247,6 @@ SpleenVasculature Spleen1 - - - - Nitrogen @@ -26887,290 +26509,276 @@ Stomach Stomach - - - - Trachea Trachea - - - - Ureters RightUreter LeftUreter - - - - Nitrogen - - + + - - + + Oxygen - - + + - - + + + CarbonDioxide - - + + - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + VenaCava VenaCava - - - - Nitrogen @@ -27435,189 +27043,162 @@ AortaBleed Aorta Ground - AortaToBone Aorta1ToBone1 Aorta BoneVasculature - AortaToFat Aorta1ToFat1 Aorta FatVasculature - AortaToLargeIntestine Aorta1ToLargeIntestine Aorta LargeIntestineVasculature - AortaToLeftArm Aorta1ToLeftArm1 Aorta LeftArmVasculature - AortaToLeftKidney LeftAortaConnectionToRenalArtery Aorta LeftRenalArtery - AortaToLeftLeg Aorta1ToLeftLeg1 Aorta LeftLegVasculature - AortaToLiver Aorta1ToLiver1 Aorta LiverVasculature - AortaToMuscle Aorta1ToMuscle1 Aorta MuscleVasculature - AortaToMyocardium Aorta1ToMyocardium1 Aorta MyocardiumVasculature - AortaToNeckArteries Aorta1ToNeckArteries Aorta NeckArteries - AortaToRightArm Aorta1ToRightArm1 Aorta RightArmVasculature - AortaToRightKidney RightAortaConnectionToRenalArtery Aorta RightRenalArtery - AortaToRightLeg Aorta1ToRightLeg1 Aorta RightLegVasculature - AortaToSkin Aorta1ToSkin1 Aorta SkinVasculature - AortaToSmallIntestine Aorta1ToSmallIntestine Aorta SmallIntestineVasculature - AortaToSplanchnic Aorta1ToSplanchnic Aorta SplanchnicVasculature - AortaToSpleen Aorta1ToSpleen Aorta SpleenVasculature - BladderToGround BladderToGroundUrinate Bladder Ground - BladderToGroundSource BladderToGroundPressure Bladder Ground - BoneToVenaCava Bone2ToVenaCava BoneVasculature VenaCava - BrainHemorrhage BrainBleed CerebralCapillaries Ground - CerebralArteriesToCerebralCapillaries CerebralArteries2ToCapillaries CerebralArteries CerebralCapillaries - CerebralCapillariesToCerebralVeins CerebralCapillariesToCerebralVeins1 CerebralCapillaries CerebralVeins - CerebralVeinsToNeckVeins CerebralVeins2ToNeckVeins CerebralVeins NeckVeins - EnvironmentToLeftChestLeak EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -27630,266 +27211,228 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - FatToVenaCava Fat2ToVenaCava FatVasculature VenaCava - HeartHemorrhage MyocardiumBleed MyocardiumVasculature Ground - LargeIntestineHemorrhage LargeIntestineBleed LargeIntestineVasculature Ground - LargeIntestineToLiver LargeIntestineToPortalVein LargeIntestineVasculature LiverVasculature - LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArteriole LeftGlomerularCapillaries - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftArmHemorrhage LeftArmBleed LeftArmVasculature Ground - LeftArmToVenaCava LeftArm2ToVenaCava LeftArmVasculature VenaCava - LeftAtriumToLeftVentricle LeftAtrium2ToLeftVentricle1 LeftAtrium LeftVentricle - LeftBowmansCapsulesToTubules LeftBowmansCapsulesToTubules LeftBowmansCapsules LeftTubules - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArteriole LeftPeritubularCapillaries - LeftGlomerularCapillariesToBowmansCapsules LeftNetGlomerularCapillariesToNetBowmansCapsules LeftGlomerularCapillaries LeftBowmansCapsules - LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillaries LeftEfferentArteriole - LeftKidneyHemorrhage LeftKidneyBleed LeftRenalVein Ground - LeftKidneyToVenaCava LeftRenalVeinToVenaCavaConnection LeftRenalVein VenaCava - LeftLegHemorrhage LeftLegBleed LeftLegVasculature Ground - LeftLegToVenaCava LeftLeg2ToVenaCava LeftLegVasculature VenaCava - LeftLungHemorrhage LeftLungBleed LeftPulmonaryArteries Ground - LeftLungVascularToTissue LeftLungVToLeftLungE1 LeftLungVasculature LeftLungTissueExtracellular - LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillaries LeftRenalVein - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - LeftPulmonaryArteriesToCapillaries LeftPulmonaryArteriesToLeftPulmonaryCapillaries LeftPulmonaryArteries LeftPulmonaryCapillaries - LeftPulmonaryArteriesToVeins LeftPulmonaryArteriesToLeftPulmonaryVeins LeftPulmonaryArteries LeftPulmonaryVeins - LeftPulmonaryCapillariesToVeins LeftPulmonaryCapillariesToLeftPulmonaryVeins LeftPulmonaryCapillaries LeftPulmonaryVeins - LeftPulmonaryVeinsToLeftAtrium LeftIntermediatePulmonaryVeinsToLeftAtrium1 LeftPulmonaryVeins LeftAtrium - LeftRenalArteryToAfferentArteriole LeftRenalArteryToAfferentArteriole LeftRenalArtery LeftAfferentArteriole - LeftTubulesToPeritubularCapillaries LeftNetTubulesToNetPeritubularCapillaries LeftTubules LeftPeritubularCapillaries - LeftTubulesToUreter LeftTubulesToUreter LeftTubules LeftUreter - LeftUreterToBladder LeftUreterToBladder LeftUreter Bladder - LeftVentricleToAorta LeftVentricle1ToAorta2 LeftVentricle Aorta - LiverHemorrhage LiverBleed LiverVasculature Ground - LiverToVenaCava Liver2ToVenaCava LiverVasculature VenaCava - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -27902,315 +27445,270 @@ Muscle2ToVenaCava MuscleVasculature VenaCava - MyocardiumToVenaCava Myocardium2ToVenaCava MyocardiumVasculature VenaCava - NeckArteriesToCerebralArteries NeckArteriesToCerebralArteries1 NeckArteries CerebralArteries - NeckVeinsToVenaCava NeckVeinsToVenaCava NeckVeins VenaCava - RightAfferentArterioleToGlomerularCapillaries RightAfferentArterioleToGlomerularCapillaries RightAfferentArteriole RightGlomerularCapillaries - RightAlveoliLeakToRightPleuralCavity RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightArmHemorrhage RightArmBleed RightArmVasculature Ground - RightArmToVenaCava RightArm2ToVenaCava RightArmVasculature VenaCava - RightAtriumToRightVentricle RightAtrium2ToRightVentricle1 RightAtrium RightVentricle - RightBowmansCapsulesToTubules RightBowmansCapsulesToTubules RightBowmansCapsules RightTubules - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightEfferentArterioleToPeritubularCapillaries RightEfferentArterioleToPeritubularCapillaries RightEfferentArteriole RightPeritubularCapillaries - RightGlomerularCapillariesToBowmansCapsules RightNetGlomerularCapillariesToNetBowmansCapsules RightGlomerularCapillaries RightBowmansCapsules - RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillaries RightEfferentArteriole - RightKidneyHemorrhage RightKidneyBleed RightRenalVein Ground - RightKidneyToVenaCava RightRenalVeinToVenaCavaConnection RightRenalVein VenaCava - RightLegHemorrhage RightLegBleed RightLegVasculature Ground - RightLegToVenaCava RightLeg2ToVenaCava RightLegVasculature VenaCava - RightLungHemorrhage RightLungBleed RightPulmonaryArteries Ground - RightPeritubularCapillariesToRenalVein RightPeritubularCapillariesToRenalVein RightPeritubularCapillaries RightRenalVein - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - RightPulmonaryArteriesToCapillaries RightPulmonaryArteriesToRightPulmonaryCapillaries RightPulmonaryArteries RightPulmonaryCapillaries - RightPulmonaryArteriesToVeins RightPulmonaryArteriesToRightPulmonaryVeins RightPulmonaryArteries RightPulmonaryVeins - RightPulmonaryCapillariesToVeins RightPulmonaryCapillariesToRightPulmonaryVeins RightPulmonaryCapillaries RightPulmonaryVeins - RightPulmonaryVeinsToLeftAtrium RightIntermediatePulmonaryVeinsToLeftAtrium1 RightPulmonaryVeins LeftAtrium - RightRenalArteryToAfferentArteriole RightRenalArteryToAfferentArteriole RightRenalArtery RightAfferentArteriole - RightTubulesToPeritubularCapillaries RightNetTubulesToNetPeritubularCapillaries RightTubules RightPeritubularCapillaries - RightTubulesToUreter RightTubulesToUreter RightTubules RightUreter - RightUreterToBladder RightUreterToBladder RightUreter Bladder - RightVentricleToLeftPulmonaryArteries MainPulmonaryArteriesToLeftIntermediatePulmonaryArteries RightVentricle LeftPulmonaryArteries - RightVentricleToRightPulmonaryArteries MainPulmonaryArteriesToRightIntermediatePulmonaryArteries RightVentricle RightPulmonaryArteries - SkinToVenaCava Skin2ToVenaCava SkinVasculature VenaCava - SmallIntestineHemorrhage SmallIntestineBleed SmallIntestineVasculature Ground - SmallIntestineToLiver SmallIntestineToPortalVein SmallIntestineVasculature LiverVasculature - SplanchnicHemorrhage SplanchnicBleed SplanchnicVasculature Ground - SplanchnicToLiver SplanchnicToPortalVein SplanchnicVasculature LiverVasculature - SpleenHemorrhage SpleenBleed SpleenVasculature Ground - SpleenToLiver SpleenToPortalVein SpleenVasculature LiverVasculature - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VenaCavaHemorrhage VenaCavaBleed VenaCava Ground - VenaCavaIV IVToVenaCava Ground VenaCava - VenaCavaToRightAtrium VenaCavaToRightAtrium1 VenaCava RightAtrium - Nitrogen Oxygen @@ -28636,10 +28134,6 @@ Ambient Ambient - - - - Nitrogen @@ -28662,10 +28156,6 @@ AnesthesiaConnection AnesthesiaConnection - - - - Nitrogen @@ -28688,7 +28178,6 @@ Connection MechanicalVentilatorConnection - Nitrogen @@ -28711,10 +28200,6 @@ ExpiratoryLimb ExpiratoryLimb - - - - Nitrogen @@ -28737,10 +28222,6 @@ GasInlet GasInlet - - - - Nitrogen @@ -28763,10 +28244,6 @@ GasSource GasSource - - - - Nitrogen @@ -28789,10 +28266,6 @@ InspiratoryLimb InspiratoryLimb - - - - Nitrogen @@ -28815,10 +28288,6 @@ LeftAlveoli LeftAlveoli - - - - Nitrogen @@ -28841,9 +28310,6 @@ LeftAlveoliLeak LeftAlveoliLeak - - - Nitrogen @@ -28857,10 +28323,6 @@ LeftBronchi LeftBronchi - - - - Nitrogen @@ -28883,9 +28345,6 @@ LeftChestLeak LeftChestLeak - - - Nitrogen @@ -28900,37 +28359,31 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - Nitrogen @@ -28953,10 +28406,6 @@ Mouth Mouth - - - - Nitrogen @@ -28979,8 +28428,6 @@ Mouthpiece Mouthpiece - - Nitrogen @@ -29003,7 +28450,6 @@ Nosepiece Nosepiece - Nitrogen @@ -29026,7 +28472,6 @@ OxygenTank OxygenTank - Nitrogen @@ -29050,62 +28495,53 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + ReliefValve ReliefValve - - - Nitrogen @@ -29128,10 +28564,6 @@ RightAlveoli RightAlveoli - - - - Nitrogen @@ -29154,9 +28586,6 @@ RightAlveoliLeak RightAlveoliLeak - - - Nitrogen @@ -29170,10 +28599,6 @@ RightBronchi RightBronchi - - - - Nitrogen @@ -29196,9 +28621,6 @@ RightChestLeak RightChestLeak - - - Nitrogen @@ -29213,37 +28635,30 @@ RightLungPulmonary RightBronchi RightAlveoli - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - Nitrogen @@ -29266,10 +28681,6 @@ Scrubber Scrubber - - - - Nitrogen @@ -29292,10 +28703,6 @@ Selector Selector - - - - Nitrogen @@ -29318,10 +28725,6 @@ Stomach Stomach - - - - Nitrogen @@ -29344,10 +28747,6 @@ Trachea Trachea - - - - Nitrogen @@ -29371,10 +28770,6 @@ Ventilator Ventilator VentilatorConnection - - - - Nitrogen @@ -29418,10 +28813,6 @@ YPiece YPiece - - - - Nitrogen @@ -29446,7 +28837,6 @@ AnesthesiaConnectionToEnvironment AnesthesiaConnection Ambient - ConnectionToMouth @@ -29459,14 +28849,12 @@ EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -29485,98 +28873,84 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - Exhaust SelectorToEnvironment Selector Ambient - ExpiratoryLimbToSelector ExpiratoryLimbToSelector ExpiratoryLimb Selector - GasInletToInspiratoryLimb GasInletToInspiratoryLimb GasInlet InspiratoryLimb - GasSourceToGasInlet GasSourceToGasInlet GasSource GasInlet - InspiratoryLimbToYPiece InspiratoryLimbToYPiece InspiratoryLimb YPiece - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - Mask AnesthesiaConnectionToMouth AnesthesiaConnection Mouth - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -29607,91 +28981,78 @@ RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - ScrubberToGasInlet ScrubberToGasInlet Scrubber GasInlet - SelectorToReliefValve SelectorToReliefValve Selector ReliefValve - SelectorToScrubber SelectorToScrubber Selector Scrubber - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VentilatorToSelector VentilatorConnectionToSelector Ventilator Selector - YPieceToAnesthesiaConnection YPieceToAnesthesiaConnection YPiece AnesthesiaConnection - YPieceToExpiratoryLimb YPieceToExpiratoryLimb YPiece ExpiratoryLimb - Nitrogen Oxygen @@ -29925,477 +29286,364 @@ Active Active - - - Ambient Ambient - - - Clothing Clothing - - - Enclosure Enclosure - - - ExternalCore ExternalCore - - - ExternalGround ExternalGround - - - ExternalHeadSkin ExternalHeadSkin - - - ExternalLeftArmSkin ExternalLeftArmSkin - - - ExternalLeftLegSkin ExternalLeftLegSkin - - - ExternalRightArmSkin ExternalRightArmSkin - - - ExternalRightLegSkin ExternalRightLegSkin - - - ExternalTorsoSkin ExternalTorsoSkin - - - InternalCore InternalCore InternalGround - - - - InternalGround - - InternalHeadSkin InternalHeadSkin - - - - InternalLeftArmSkin InternalLeftArmSkin - - - - InternalLeftLegSkin InternalLeftLegSkin - - - - InternalRightArmSkin InternalRightArmSkin - - - - InternalRightLegSkin InternalRightLegSkin - - - - InternalTorsoSkin InternalTorsoSkin - - - - ActiveToClothing ActiveToClothing Active Clothing - ClothingToEnclosure ClothingToEnclosure Clothing Enclosure - ClothingToEnvironment ClothingToEnvironment Clothing Ambient - ExternalCoreToGround ExternalCoreToGround ExternalCore ExternalGround - ExternalHeadSkinToClothing ExternalHeadSkinToClothing ExternalHeadSkin Clothing - ExternalHeadSkinToGround ExternalHeadSkinToGround ExternalHeadSkin ExternalGround - ExternalLeftArmSkinToClothing ExternalLeftArmSkinToClothing ExternalLeftArmSkin Clothing - ExternalLeftArmSkinToGround ExternalLeftArmSkinToGround ExternalLeftArmSkin ExternalGround - ExternalLeftLegSkinToClothing ExternalLeftLegSkinToClothing ExternalLeftLegSkin Clothing - ExternalLeftLegSkinToGround ExternalLeftLegSkinToGround ExternalLeftLegSkin ExternalGround - ExternalRightArmSkinToClothing ExternalRightArmSkinToClothing ExternalRightArmSkin Clothing - ExternalRightArmSkinToGround ExternalRightArmSkinToGround ExternalRightArmSkin ExternalGround - ExternalRightLegSkinToClothing ExternalRightLegSkinToClothing ExternalRightLegSkin Clothing - ExternalRightLegSkinToGround ExternalRightLegSkinToGround ExternalRightLegSkin ExternalGround - ExternalTorsoSkinToClothing ExternalTorsoSkinToClothing ExternalTorsoSkin Clothing - ExternalTorsoSkinToGround ExternalTorsoSkinToGround ExternalTorsoSkin ExternalGround - GroundToActive GroundToActive ExternalGround Active - GroundToClothing GroundToClothing ExternalGround Clothing - GroundToEnclosure GroundToEnclosure ExternalGround Enclosure - GroundToEnvironment GroundToEnvironment ExternalGround Ambient - GroundToInternalCore GroundToInternalCore InternalGround InternalCore - GroundToInternalHeadSkin GroundToInternalHeadSkin InternalGround InternalHeadSkin - GroundToInternalLeftArmSkin GroundToInternalLeftArmSkin InternalGround InternalLeftArmSkin - GroundToInternalLeftLegSkin GroundToInternalLeftLegSkin InternalGround InternalLeftLegSkin - GroundToInternalRightArmSkin GroundToInternalRightArmSkin InternalGround InternalRightArmSkin - GroundToInternalRightLegSkin GroundToInternalRightLegSkin InternalGround InternalRightLegSkin - GroundToInternalTorsoSkin GroundToInternalTorsoSkin InternalGround InternalTorsoSkin - InternalCoreToExternalCore InternalCoreToExternalCore InternalCore ExternalCore - InternalCoreToGround InternalCoreToGround InternalGround InternalCore - InternalCoreToInternalHeadSkin InternalCoreToInternalHeadSkin InternalCore InternalHeadSkin - InternalCoreToInternalLeftArmSkin InternalCoreToInternalLeftArmSkin InternalCore InternalLeftArmSkin - InternalCoreToInternalLeftLegSkin InternalCoreToInternalLeftLegSkin InternalCore InternalLeftLegSkin - InternalCoreToInternalRightArmSkin InternalCoreToInternalRightArmSkin InternalCore InternalRightArmSkin - InternalCoreToInternalRightLegSkin InternalCoreToInternalRightLegSkin InternalCore InternalRightLegSkin - InternalCoreToInternalTorsoSkin InternalCoreToInternalTorsoSkin InternalCore InternalTorsoSkin - InternalHeadSkinToExternalHeadSkin InternalHeadSkinToExternalHeadSkin InternalHeadSkin ExternalHeadSkin - InternalHeadSkinToGround InternalHeadSkinToTemperatureGround InternalGround InternalHeadSkin - InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkin ExternalLeftArmSkin - InternalLeftArmSkinToGround InternalLeftArmSkinToTemperatureGround InternalGround InternalLeftArmSkin - InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkin ExternalLeftLegSkin - InternalLeftLegSkinToGround InternalLeftLegSkinToTemperatureGround InternalGround InternalLeftLegSkin - InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkin ExternalRightArmSkin - InternalRightArmSkinToGround InternalRightArmSkinToTemperatureGround InternalGround InternalRightArmSkin - InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkin ExternalRightLegSkin - InternalRightLegSkinToGround InternalRightLegSkinToTemperatureGround InternalGround InternalRightLegSkin - InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkin ExternalTorsoSkin - InternalTorsoSkinToGround InternalTorsoSkinToTemperatureGround InternalGround InternalTorsoSkin - BoneTissue @@ -30569,7 +29817,6 @@ - Off @@ -30978,7 +30225,6 @@ - @@ -31005,15 +30251,15 @@ On - + - + - + - + @@ -32360,7 +31606,6 @@ - Extrasplanchnic @@ -32371,7 +31616,6 @@ - Extrasplanchnic @@ -32392,7 +31636,6 @@ - Splanchnic @@ -32403,7 +31646,6 @@ - Extrasplanchnic @@ -32421,7 +31663,6 @@ - Extrasplanchnic @@ -32432,7 +31673,6 @@ - Splanchnic @@ -32443,7 +31683,6 @@ - Muscle @@ -32454,7 +31693,6 @@ - Myocardium @@ -32465,7 +31703,6 @@ - Cerebral @@ -32476,7 +31713,6 @@ - Extrasplanchnic @@ -32494,7 +31730,6 @@ - Extrasplanchnic @@ -32505,7 +31740,6 @@ - Extrasplanchnic @@ -32516,7 +31750,6 @@ - Splanchnic @@ -32527,7 +31760,6 @@ - Splanchnic @@ -32538,7 +31770,6 @@ - Splanchnic @@ -32596,7 +31827,6 @@ - Extrasplanchnic @@ -32829,7 +32059,6 @@ - Cerebral @@ -32850,7 +32079,6 @@ - Cerebral @@ -32871,7 +32099,6 @@ - Cerebral @@ -32985,7 +32212,6 @@ - Extrasplanchnic @@ -33268,7 +32494,6 @@ - Splanchnic @@ -33347,7 +32572,6 @@ - Extrasplanchnic @@ -33631,7 +32855,6 @@ - Extrasplanchnic @@ -34004,7 +33227,6 @@ - Splanchnic @@ -34209,7 +33431,6 @@ - Muscle @@ -34326,7 +33547,6 @@ - Myocardium @@ -34443,7 +33663,6 @@ - Cerebral @@ -34474,7 +33693,6 @@ - Cerebral @@ -34518,7 +33736,6 @@ - Splanchnic @@ -34592,7 +33809,6 @@ - Extrasplanchnic @@ -34876,7 +34092,6 @@ - Extrasplanchnic @@ -35288,7 +34503,6 @@ - Extrasplanchnic @@ -35435,7 +34649,6 @@ - Splanchnic @@ -35496,7 +34709,6 @@ - Splanchnic @@ -35616,7 +34828,6 @@ - Splanchnic diff --git a/share/data/states/DefaultTemplateMale@0s.xml b/share/data/states/DefaultTemplateMale@0s.xml index 009caaac2..a3ffba4ff 100644 --- a/share/data/states/DefaultTemplateMale@0s.xml +++ b/share/data/states/DefaultTemplateMale@0s.xml @@ -1,5 +1,5 @@ - + DefaultTemplateMale @@ -177,7 +177,7 @@ - + @@ -313,7 +313,7 @@ - + @@ -363,7 +363,7 @@ - + @@ -386,7 +386,7 @@ - + @@ -419,7 +419,7 @@ - + @@ -444,7 +444,7 @@ - + @@ -467,7 +467,7 @@ - + @@ -515,7 +515,7 @@ - + @@ -571,7 +571,7 @@ - + @@ -594,7 +594,7 @@ - + @@ -619,7 +619,7 @@ - + @@ -644,7 +644,7 @@ - + @@ -685,7 +685,7 @@ - + @@ -912,7 +912,6 @@ - false false false @@ -1011,6 +1010,7 @@ + @@ -1160,16 +1160,13 @@ - - - @@ -1216,15 +1213,15 @@ false - + - - + + @@ -1237,9 +1234,9 @@ 68.6415 33.6765449180437 - - - + + + @@ -1301,8 +1298,8 @@ - - + + @@ -1317,6 +1314,9 @@ 28 + + + @@ -1324,20 +1324,12 @@ Ambient Ambient - - - - Aorta Aorta1 Aorta2 Aorta3 - - - - Nitrogen @@ -1600,10 +1592,6 @@ Bladder Bladder - - - - Nitrogen @@ -1869,8 +1857,6 @@ BoneE3 BoneL1 BoneL2 - - Nitrogen @@ -2133,8 +2119,6 @@ BoneTissueIntracellular BoneI - - Nitrogen @@ -2398,10 +2382,6 @@ BoneVasculature Bone1 Bone2 - - - - Nitrogen @@ -2668,8 +2648,6 @@ BrainE3 BrainL1 BrainL2 - - Nitrogen @@ -2932,8 +2910,6 @@ BrainTissueIntracellular BrainI - - Nitrogen @@ -3198,276 +3174,269 @@ CerebralArteries CerebralCapillaries CerebralVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + CerebralArteries CerebralArteries1 CerebralArteries2 - - - - Nitrogen @@ -3730,10 +3699,6 @@ CerebralCapillaries CerebralCapillaries - - - - Nitrogen @@ -3996,8 +3961,6 @@ CerebralSpinalFluid SpinalFluid - - Nitrogen @@ -4261,10 +4224,6 @@ CerebralVeins1 CerebralVeins2 CerebralVeinsCheck - - - - Nitrogen @@ -4531,8 +4490,6 @@ FatE3 FatL1 FatL2 - - Nitrogen @@ -4795,8 +4752,6 @@ FatTissueIntracellular FatI - - Nitrogen @@ -5060,10 +5015,6 @@ FatVasculature Fat1 Fat2 - - - - Nitrogen @@ -5326,9 +5277,6 @@ Ground Ground - - - Nitrogen @@ -5449,8 +5397,6 @@ GutE3 GutL1 GutL2 - - Nitrogen @@ -5713,8 +5659,6 @@ GutTissueIntracellular GutI - - Nitrogen @@ -5979,266 +5923,263 @@ SplanchnicVasculature SmallIntestineVasculature LargeIntestineVasculature - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -6247,541 +6188,529 @@ LeftHeart RightHeart Pericardium - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + KidneyVasculature LeftKidneyVasculature RightKidneyVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LargeIntestineVasculature LargeIntestine1 - - - - Nitrogen @@ -7044,10 +6973,6 @@ LeftAfferentArteriole LeftAfferentArteriole - - - - Nitrogen @@ -7310,26 +7235,15 @@ LeftAlveoli LeftAlveoli - - - - LeftAlveoliLeak LeftAlveoliLeak - - - LeftArmVasculature LeftArm1 LeftArm2 - - - - Nitrogen @@ -7593,10 +7507,6 @@ LeftAtrium LeftAtrium1 LeftAtrium2 - - - - Nitrogen @@ -7860,10 +7770,6 @@ LeftBowmansCapsules LeftBowmansCapsules LeftNetBowmansCapsules - - - - Nitrogen @@ -8126,25 +8032,14 @@ LeftBronchi LeftBronchi - - - - LeftChestLeak LeftChestLeak - - - LeftEfferentArteriole LeftEfferentArteriole - - - - Nitrogen @@ -8408,10 +8303,6 @@ LeftGlomerularCapillaries LeftGlomerularCapillaries LeftNetGlomerularCapillaries - - - - Nitrogen @@ -8675,266 +8566,262 @@ LeftHeart LeftAtrium LeftVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -8944,8 +8831,6 @@ LeftKidneyE3 LeftKidneyL1 LeftKidneyL2 - - Nitrogen @@ -9208,8 +9093,6 @@ LeftKidneyTissueIntracellular LeftKidneyI - - Nitrogen @@ -9474,276 +9357,269 @@ LeftRenalArtery LeftNephron LeftRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftLegVasculature LeftLeg1 LeftLeg2 - - - - Nitrogen @@ -10007,10 +9883,6 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - - LeftLungTissueExtracellular @@ -10019,10 +9891,6 @@ LeftLungE3 LeftLungL1 LeftLungL2 - - - - Nitrogen @@ -10285,8 +10153,6 @@ LeftLungTissueIntracellular LeftLungI - - Nitrogen @@ -10551,266 +10417,263 @@ LeftPulmonaryArteries LeftPulmonaryCapillaries LeftPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -10821,276 +10684,269 @@ LeftPeritubularCapillaries LeftBowmansCapsules LeftTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftPeritubularCapillaries LeftPeritubularCapillaries LeftNetPeritubularCapillaries - - - - Nitrogen @@ -11354,19 +11210,11 @@ LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - LeftPulmonaryArteries LeftPulmonaryArteries LeftIntermediatePulmonaryArteries - - - - Nitrogen @@ -11629,10 +11477,6 @@ LeftPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen @@ -11895,10 +11739,6 @@ LeftPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen @@ -12161,10 +12001,6 @@ LeftRenalArtery LeftRenalArtery - - - - Nitrogen @@ -12427,10 +12263,6 @@ LeftRenalVein LeftRenalVein - - - - Nitrogen @@ -12694,10 +12526,6 @@ LeftTubules LeftTubules LeftNetTubules - - - - Nitrogen @@ -12960,10 +12788,6 @@ LeftUreter LeftUreter - - - - Nitrogen @@ -13226,10 +13050,6 @@ LeftVentricle LeftVentricle1 LeftVentricle2 - - - - Nitrogen @@ -13496,8 +13316,6 @@ LiverE3 LiverL1 LiverL2 - - Nitrogen @@ -13760,8 +13578,6 @@ LiverTissueIntracellular LiverI - - Nitrogen @@ -14027,9 +13843,6 @@ Liver2 PortalVein1 - - - Nitrogen @@ -14293,273 +14106,267 @@ LungsVasculature LeftLungVasculature RightLungVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + Lymph Lymph - - Nitrogen @@ -14821,16 +14628,10 @@ Mouth Mouth - - - - Mouthpiece Mouthpiece - - MuscleTissueExtracellular @@ -14839,8 +14640,6 @@ MuscleE3 MuscleL1 MuscleL2 - - Nitrogen @@ -15103,8 +14902,6 @@ MuscleTissueIntracellular MuscleI - - Nitrogen @@ -15368,10 +15165,6 @@ MuscleVasculature Muscle1 Muscle2 - - - - Nitrogen @@ -15638,8 +15431,6 @@ MyocardiumE3 MyocardiumL1 MyocardiumL2 - - Nitrogen @@ -15902,8 +15693,6 @@ MyocardiumTissueIntracellular MyocardiumI - - Nitrogen @@ -16167,10 +15956,6 @@ MyocardiumVasculature Myocardium1 Myocardium2 - - - - Nitrogen @@ -16433,10 +16218,6 @@ NeckArteries NeckArteries - - - - Nitrogen @@ -16699,10 +16480,6 @@ NeckVeins NeckVeins - - - - Nitrogen @@ -16965,8 +16742,6 @@ Pericardium Pericardium1 - - Nitrogen @@ -17230,825 +17005,801 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - PulmonaryArteries RightPulmonaryArteries LeftPulmonaryArteries - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryCapillaries RightPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - - PulmonaryVeins RightPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightAfferentArteriole RightAfferentArteriole - - - - Nitrogen @@ -18311,26 +18062,15 @@ RightAlveoli RightAlveoli - - - - RightAlveoliLeak RightAlveoliLeak - - - RightArmVasculature RightArm1 RightArm2 - - - - Nitrogen @@ -18594,10 +18334,6 @@ RightAtrium RightAtrium1 RightAtrium2 - - - - Nitrogen @@ -18861,10 +18597,6 @@ RightBowmansCapsules RightBowmansCapsules RightNetBowmansCapsules - - - - Nitrogen @@ -19127,25 +18859,14 @@ RightBronchi RightBronchi - - - - RightChestLeak RightChestLeak - - - RightEfferentArteriole RightEfferentArteriole - - - - Nitrogen @@ -19409,10 +19130,6 @@ RightGlomerularCapillaries RightGlomerularCapillaries RightNetGlomerularCapillaries - - - - Nitrogen @@ -19676,266 +19393,262 @@ RightHeart RightAtrium RightVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -19945,8 +19658,6 @@ RightKidneyE3 RightKidneyL1 RightKidneyL2 - - Nitrogen @@ -20209,8 +19920,6 @@ RightKidneyTissueIntracellular RightKidneyI - - Nitrogen @@ -20475,276 +20184,269 @@ RightRenalArtery RightNephron RightRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightLegVasculature RightLeg1 RightLeg2 - - - - Nitrogen @@ -21008,10 +20710,6 @@ RightLungPulmonary RightBronchi RightAlveoli - - - - RightLungTissueExtracellular @@ -21020,8 +20718,6 @@ RightLungE3 RightLungL1 RightLungL2 - - Nitrogen @@ -21284,8 +20980,6 @@ RightLungTissueIntracellular RightLungI - - Nitrogen @@ -21550,266 +21244,263 @@ RightPulmonaryArteries RightPulmonaryCapillaries RightPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -21820,276 +21511,269 @@ RightPeritubularCapillaries RightBowmansCapsules RightTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightPeritubularCapillaries RightPeritubularCapillaries RightNetPeritubularCapillaries - - - - Nitrogen @@ -22353,19 +22037,11 @@ RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - RightPulmonaryArteries RightPulmonaryArteries RightIntermediatePulmonaryArteries - - - - Nitrogen @@ -22628,10 +22304,6 @@ RightPulmonaryCapillaries RightPulmonaryCapillaries - - - - Nitrogen @@ -22894,10 +22566,6 @@ RightPulmonaryVeins RightPulmonaryVeins - - - - Nitrogen @@ -23160,10 +22828,6 @@ RightRenalArtery RightRenalArtery - - - - Nitrogen @@ -23426,10 +23090,6 @@ RightRenalVein RightRenalVein - - - - Nitrogen @@ -23693,10 +23353,6 @@ RightTubules RightTubules RightNetTubules - - - - Nitrogen @@ -23959,10 +23615,6 @@ RightUreter RightUreter - - - - Nitrogen @@ -24226,10 +23878,6 @@ RightVentricle1 RightVentricle2 MainPulmonaryArteries - - - - Nitrogen @@ -24496,8 +24144,6 @@ SkinE3 SkinL1 SkinL2 - - Nitrogen @@ -24760,8 +24406,6 @@ SkinTissueIntracellular SkinI - - Nitrogen @@ -25025,10 +24669,6 @@ SkinVasculature Skin1 Skin2 - - - - Nitrogen @@ -25291,8 +24931,6 @@ SmallIntestineChyme SmallIntestineC1 - - Nitrogen @@ -25554,10 +25192,6 @@ SmallIntestineVasculature SmallIntestine1 - - - - Nitrogen @@ -25820,10 +25454,6 @@ SplanchnicVasculature Splanchnic1 - - - - Nitrogen @@ -26090,8 +25720,6 @@ SpleenE3 SpleenL1 SpleenL2 - - Nitrogen @@ -26354,8 +25982,6 @@ SpleenTissueIntracellular SpleenI - - Nitrogen @@ -26618,10 +26244,6 @@ SpleenVasculature Spleen1 - - - - Nitrogen @@ -26884,290 +26506,276 @@ Stomach Stomach - - - - Trachea Trachea - - - - Ureters RightUreter LeftUreter - - - - Nitrogen - - + + - - + + Oxygen - - + + - - + + + CarbonDioxide - - + + - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + VenaCava VenaCava - - - - Nitrogen @@ -27432,189 +27040,162 @@ AortaBleed Aorta Ground - AortaToBone Aorta1ToBone1 Aorta BoneVasculature - AortaToFat Aorta1ToFat1 Aorta FatVasculature - AortaToLargeIntestine Aorta1ToLargeIntestine Aorta LargeIntestineVasculature - AortaToLeftArm Aorta1ToLeftArm1 Aorta LeftArmVasculature - AortaToLeftKidney LeftAortaConnectionToRenalArtery Aorta LeftRenalArtery - AortaToLeftLeg Aorta1ToLeftLeg1 Aorta LeftLegVasculature - AortaToLiver Aorta1ToLiver1 Aorta LiverVasculature - AortaToMuscle Aorta1ToMuscle1 Aorta MuscleVasculature - AortaToMyocardium Aorta1ToMyocardium1 Aorta MyocardiumVasculature - AortaToNeckArteries Aorta1ToNeckArteries Aorta NeckArteries - AortaToRightArm Aorta1ToRightArm1 Aorta RightArmVasculature - AortaToRightKidney RightAortaConnectionToRenalArtery Aorta RightRenalArtery - AortaToRightLeg Aorta1ToRightLeg1 Aorta RightLegVasculature - AortaToSkin Aorta1ToSkin1 Aorta SkinVasculature - AortaToSmallIntestine Aorta1ToSmallIntestine Aorta SmallIntestineVasculature - AortaToSplanchnic Aorta1ToSplanchnic Aorta SplanchnicVasculature - AortaToSpleen Aorta1ToSpleen Aorta SpleenVasculature - BladderToGround BladderToGroundUrinate Bladder Ground - BladderToGroundSource BladderToGroundPressure Bladder Ground - BoneToVenaCava Bone2ToVenaCava BoneVasculature VenaCava - BrainHemorrhage BrainBleed CerebralCapillaries Ground - CerebralArteriesToCerebralCapillaries CerebralArteries2ToCapillaries CerebralArteries CerebralCapillaries - CerebralCapillariesToCerebralVeins CerebralCapillariesToCerebralVeins1 CerebralCapillaries CerebralVeins - CerebralVeinsToNeckVeins CerebralVeins2ToNeckVeins CerebralVeins NeckVeins - EnvironmentToLeftChestLeak EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -27627,266 +27208,228 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - FatToVenaCava Fat2ToVenaCava FatVasculature VenaCava - HeartHemorrhage MyocardiumBleed MyocardiumVasculature Ground - LargeIntestineHemorrhage LargeIntestineBleed LargeIntestineVasculature Ground - LargeIntestineToLiver LargeIntestineToPortalVein LargeIntestineVasculature LiverVasculature - LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArteriole LeftGlomerularCapillaries - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftArmHemorrhage LeftArmBleed LeftArmVasculature Ground - LeftArmToVenaCava LeftArm2ToVenaCava LeftArmVasculature VenaCava - LeftAtriumToLeftVentricle LeftAtrium2ToLeftVentricle1 LeftAtrium LeftVentricle - LeftBowmansCapsulesToTubules LeftBowmansCapsulesToTubules LeftBowmansCapsules LeftTubules - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArteriole LeftPeritubularCapillaries - LeftGlomerularCapillariesToBowmansCapsules LeftNetGlomerularCapillariesToNetBowmansCapsules LeftGlomerularCapillaries LeftBowmansCapsules - LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillaries LeftEfferentArteriole - LeftKidneyHemorrhage LeftKidneyBleed LeftRenalVein Ground - LeftKidneyToVenaCava LeftRenalVeinToVenaCavaConnection LeftRenalVein VenaCava - LeftLegHemorrhage LeftLegBleed LeftLegVasculature Ground - LeftLegToVenaCava LeftLeg2ToVenaCava LeftLegVasculature VenaCava - LeftLungHemorrhage LeftLungBleed LeftPulmonaryArteries Ground - LeftLungVascularToTissue LeftLungVToLeftLungE1 LeftLungVasculature LeftLungTissueExtracellular - LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillaries LeftRenalVein - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - LeftPulmonaryArteriesToCapillaries LeftPulmonaryArteriesToLeftPulmonaryCapillaries LeftPulmonaryArteries LeftPulmonaryCapillaries - LeftPulmonaryArteriesToVeins LeftPulmonaryArteriesToLeftPulmonaryVeins LeftPulmonaryArteries LeftPulmonaryVeins - LeftPulmonaryCapillariesToVeins LeftPulmonaryCapillariesToLeftPulmonaryVeins LeftPulmonaryCapillaries LeftPulmonaryVeins - LeftPulmonaryVeinsToLeftAtrium LeftIntermediatePulmonaryVeinsToLeftAtrium1 LeftPulmonaryVeins LeftAtrium - LeftRenalArteryToAfferentArteriole LeftRenalArteryToAfferentArteriole LeftRenalArtery LeftAfferentArteriole - LeftTubulesToPeritubularCapillaries LeftNetTubulesToNetPeritubularCapillaries LeftTubules LeftPeritubularCapillaries - LeftTubulesToUreter LeftTubulesToUreter LeftTubules LeftUreter - LeftUreterToBladder LeftUreterToBladder LeftUreter Bladder - LeftVentricleToAorta LeftVentricle1ToAorta2 LeftVentricle Aorta - LiverHemorrhage LiverBleed LiverVasculature Ground - LiverToVenaCava Liver2ToVenaCava LiverVasculature VenaCava - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -27899,315 +27442,270 @@ Muscle2ToVenaCava MuscleVasculature VenaCava - MyocardiumToVenaCava Myocardium2ToVenaCava MyocardiumVasculature VenaCava - NeckArteriesToCerebralArteries NeckArteriesToCerebralArteries1 NeckArteries CerebralArteries - NeckVeinsToVenaCava NeckVeinsToVenaCava NeckVeins VenaCava - RightAfferentArterioleToGlomerularCapillaries RightAfferentArterioleToGlomerularCapillaries RightAfferentArteriole RightGlomerularCapillaries - RightAlveoliLeakToRightPleuralCavity RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightArmHemorrhage RightArmBleed RightArmVasculature Ground - RightArmToVenaCava RightArm2ToVenaCava RightArmVasculature VenaCava - RightAtriumToRightVentricle RightAtrium2ToRightVentricle1 RightAtrium RightVentricle - RightBowmansCapsulesToTubules RightBowmansCapsulesToTubules RightBowmansCapsules RightTubules - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightEfferentArterioleToPeritubularCapillaries RightEfferentArterioleToPeritubularCapillaries RightEfferentArteriole RightPeritubularCapillaries - RightGlomerularCapillariesToBowmansCapsules RightNetGlomerularCapillariesToNetBowmansCapsules RightGlomerularCapillaries RightBowmansCapsules - RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillaries RightEfferentArteriole - RightKidneyHemorrhage RightKidneyBleed RightRenalVein Ground - RightKidneyToVenaCava RightRenalVeinToVenaCavaConnection RightRenalVein VenaCava - RightLegHemorrhage RightLegBleed RightLegVasculature Ground - RightLegToVenaCava RightLeg2ToVenaCava RightLegVasculature VenaCava - RightLungHemorrhage RightLungBleed RightPulmonaryArteries Ground - RightPeritubularCapillariesToRenalVein RightPeritubularCapillariesToRenalVein RightPeritubularCapillaries RightRenalVein - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - RightPulmonaryArteriesToCapillaries RightPulmonaryArteriesToRightPulmonaryCapillaries RightPulmonaryArteries RightPulmonaryCapillaries - RightPulmonaryArteriesToVeins RightPulmonaryArteriesToRightPulmonaryVeins RightPulmonaryArteries RightPulmonaryVeins - RightPulmonaryCapillariesToVeins RightPulmonaryCapillariesToRightPulmonaryVeins RightPulmonaryCapillaries RightPulmonaryVeins - RightPulmonaryVeinsToLeftAtrium RightIntermediatePulmonaryVeinsToLeftAtrium1 RightPulmonaryVeins LeftAtrium - RightRenalArteryToAfferentArteriole RightRenalArteryToAfferentArteriole RightRenalArtery RightAfferentArteriole - RightTubulesToPeritubularCapillaries RightNetTubulesToNetPeritubularCapillaries RightTubules RightPeritubularCapillaries - RightTubulesToUreter RightTubulesToUreter RightTubules RightUreter - RightUreterToBladder RightUreterToBladder RightUreter Bladder - RightVentricleToLeftPulmonaryArteries MainPulmonaryArteriesToLeftIntermediatePulmonaryArteries RightVentricle LeftPulmonaryArteries - RightVentricleToRightPulmonaryArteries MainPulmonaryArteriesToRightIntermediatePulmonaryArteries RightVentricle RightPulmonaryArteries - SkinToVenaCava Skin2ToVenaCava SkinVasculature VenaCava - SmallIntestineHemorrhage SmallIntestineBleed SmallIntestineVasculature Ground - SmallIntestineToLiver SmallIntestineToPortalVein SmallIntestineVasculature LiverVasculature - SplanchnicHemorrhage SplanchnicBleed SplanchnicVasculature Ground - SplanchnicToLiver SplanchnicToPortalVein SplanchnicVasculature LiverVasculature - SpleenHemorrhage SpleenBleed SpleenVasculature Ground - SpleenToLiver SpleenToPortalVein SpleenVasculature LiverVasculature - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VenaCavaHemorrhage VenaCavaBleed VenaCava Ground - VenaCavaIV IVToVenaCava Ground VenaCava - VenaCavaToRightAtrium VenaCavaToRightAtrium1 VenaCava RightAtrium - Nitrogen Oxygen @@ -28633,10 +28131,6 @@ Ambient Ambient - - - - Nitrogen @@ -28659,10 +28153,6 @@ AnesthesiaConnection AnesthesiaConnection - - - - Nitrogen @@ -28685,7 +28175,6 @@ Connection MechanicalVentilatorConnection - Nitrogen @@ -28708,10 +28197,6 @@ ExpiratoryLimb ExpiratoryLimb - - - - Nitrogen @@ -28734,10 +28219,6 @@ GasInlet GasInlet - - - - Nitrogen @@ -28760,10 +28241,6 @@ GasSource GasSource - - - - Nitrogen @@ -28786,10 +28263,6 @@ InspiratoryLimb InspiratoryLimb - - - - Nitrogen @@ -28812,10 +28285,6 @@ LeftAlveoli LeftAlveoli - - - - Nitrogen @@ -28838,9 +28307,6 @@ LeftAlveoliLeak LeftAlveoliLeak - - - Nitrogen @@ -28854,10 +28320,6 @@ LeftBronchi LeftBronchi - - - - Nitrogen @@ -28880,9 +28342,6 @@ LeftChestLeak LeftChestLeak - - - Nitrogen @@ -28897,37 +28356,31 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - Nitrogen @@ -28950,10 +28403,6 @@ Mouth Mouth - - - - Nitrogen @@ -28976,8 +28425,6 @@ Mouthpiece Mouthpiece - - Nitrogen @@ -29000,7 +28447,6 @@ Nosepiece Nosepiece - Nitrogen @@ -29023,7 +28469,6 @@ OxygenTank OxygenTank - Nitrogen @@ -29047,62 +28492,53 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + ReliefValve ReliefValve - - - Nitrogen @@ -29125,10 +28561,6 @@ RightAlveoli RightAlveoli - - - - Nitrogen @@ -29151,9 +28583,6 @@ RightAlveoliLeak RightAlveoliLeak - - - Nitrogen @@ -29167,10 +28596,6 @@ RightBronchi RightBronchi - - - - Nitrogen @@ -29193,9 +28618,6 @@ RightChestLeak RightChestLeak - - - Nitrogen @@ -29210,37 +28632,30 @@ RightLungPulmonary RightBronchi RightAlveoli - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - Nitrogen @@ -29263,10 +28678,6 @@ Scrubber Scrubber - - - - Nitrogen @@ -29289,10 +28700,6 @@ Selector Selector - - - - Nitrogen @@ -29315,10 +28722,6 @@ Stomach Stomach - - - - Nitrogen @@ -29341,10 +28744,6 @@ Trachea Trachea - - - - Nitrogen @@ -29368,10 +28767,6 @@ Ventilator Ventilator VentilatorConnection - - - - Nitrogen @@ -29415,10 +28810,6 @@ YPiece YPiece - - - - Nitrogen @@ -29443,7 +28834,6 @@ AnesthesiaConnectionToEnvironment AnesthesiaConnection Ambient - ConnectionToMouth @@ -29456,14 +28846,12 @@ EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -29482,98 +28870,84 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - Exhaust SelectorToEnvironment Selector Ambient - ExpiratoryLimbToSelector ExpiratoryLimbToSelector ExpiratoryLimb Selector - GasInletToInspiratoryLimb GasInletToInspiratoryLimb GasInlet InspiratoryLimb - GasSourceToGasInlet GasSourceToGasInlet GasSource GasInlet - InspiratoryLimbToYPiece InspiratoryLimbToYPiece InspiratoryLimb YPiece - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - Mask AnesthesiaConnectionToMouth AnesthesiaConnection Mouth - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -29604,91 +28978,78 @@ RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - ScrubberToGasInlet ScrubberToGasInlet Scrubber GasInlet - SelectorToReliefValve SelectorToReliefValve Selector ReliefValve - SelectorToScrubber SelectorToScrubber Selector Scrubber - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VentilatorToSelector VentilatorConnectionToSelector Ventilator Selector - YPieceToAnesthesiaConnection YPieceToAnesthesiaConnection YPiece AnesthesiaConnection - YPieceToExpiratoryLimb YPieceToExpiratoryLimb YPiece ExpiratoryLimb - Nitrogen Oxygen @@ -29922,477 +29283,364 @@ Active Active - - - Ambient Ambient - - - Clothing Clothing - - - Enclosure Enclosure - - - ExternalCore ExternalCore - - - ExternalGround ExternalGround - - - ExternalHeadSkin ExternalHeadSkin - - - ExternalLeftArmSkin ExternalLeftArmSkin - - - ExternalLeftLegSkin ExternalLeftLegSkin - - - ExternalRightArmSkin ExternalRightArmSkin - - - ExternalRightLegSkin ExternalRightLegSkin - - - ExternalTorsoSkin ExternalTorsoSkin - - - InternalCore InternalCore InternalGround - - - - InternalGround - - InternalHeadSkin InternalHeadSkin - - - - InternalLeftArmSkin InternalLeftArmSkin - - - - InternalLeftLegSkin InternalLeftLegSkin - - - - InternalRightArmSkin InternalRightArmSkin - - - - InternalRightLegSkin InternalRightLegSkin - - - - InternalTorsoSkin InternalTorsoSkin - - - - ActiveToClothing ActiveToClothing Active Clothing - ClothingToEnclosure ClothingToEnclosure Clothing Enclosure - ClothingToEnvironment ClothingToEnvironment Clothing Ambient - ExternalCoreToGround ExternalCoreToGround ExternalCore ExternalGround - ExternalHeadSkinToClothing ExternalHeadSkinToClothing ExternalHeadSkin Clothing - ExternalHeadSkinToGround ExternalHeadSkinToGround ExternalHeadSkin ExternalGround - ExternalLeftArmSkinToClothing ExternalLeftArmSkinToClothing ExternalLeftArmSkin Clothing - ExternalLeftArmSkinToGround ExternalLeftArmSkinToGround ExternalLeftArmSkin ExternalGround - ExternalLeftLegSkinToClothing ExternalLeftLegSkinToClothing ExternalLeftLegSkin Clothing - ExternalLeftLegSkinToGround ExternalLeftLegSkinToGround ExternalLeftLegSkin ExternalGround - ExternalRightArmSkinToClothing ExternalRightArmSkinToClothing ExternalRightArmSkin Clothing - ExternalRightArmSkinToGround ExternalRightArmSkinToGround ExternalRightArmSkin ExternalGround - ExternalRightLegSkinToClothing ExternalRightLegSkinToClothing ExternalRightLegSkin Clothing - ExternalRightLegSkinToGround ExternalRightLegSkinToGround ExternalRightLegSkin ExternalGround - ExternalTorsoSkinToClothing ExternalTorsoSkinToClothing ExternalTorsoSkin Clothing - ExternalTorsoSkinToGround ExternalTorsoSkinToGround ExternalTorsoSkin ExternalGround - GroundToActive GroundToActive ExternalGround Active - GroundToClothing GroundToClothing ExternalGround Clothing - GroundToEnclosure GroundToEnclosure ExternalGround Enclosure - GroundToEnvironment GroundToEnvironment ExternalGround Ambient - GroundToInternalCore GroundToInternalCore InternalGround InternalCore - GroundToInternalHeadSkin GroundToInternalHeadSkin InternalGround InternalHeadSkin - GroundToInternalLeftArmSkin GroundToInternalLeftArmSkin InternalGround InternalLeftArmSkin - GroundToInternalLeftLegSkin GroundToInternalLeftLegSkin InternalGround InternalLeftLegSkin - GroundToInternalRightArmSkin GroundToInternalRightArmSkin InternalGround InternalRightArmSkin - GroundToInternalRightLegSkin GroundToInternalRightLegSkin InternalGround InternalRightLegSkin - GroundToInternalTorsoSkin GroundToInternalTorsoSkin InternalGround InternalTorsoSkin - InternalCoreToExternalCore InternalCoreToExternalCore InternalCore ExternalCore - InternalCoreToGround InternalCoreToGround InternalGround InternalCore - InternalCoreToInternalHeadSkin InternalCoreToInternalHeadSkin InternalCore InternalHeadSkin - InternalCoreToInternalLeftArmSkin InternalCoreToInternalLeftArmSkin InternalCore InternalLeftArmSkin - InternalCoreToInternalLeftLegSkin InternalCoreToInternalLeftLegSkin InternalCore InternalLeftLegSkin - InternalCoreToInternalRightArmSkin InternalCoreToInternalRightArmSkin InternalCore InternalRightArmSkin - InternalCoreToInternalRightLegSkin InternalCoreToInternalRightLegSkin InternalCore InternalRightLegSkin - InternalCoreToInternalTorsoSkin InternalCoreToInternalTorsoSkin InternalCore InternalTorsoSkin - InternalHeadSkinToExternalHeadSkin InternalHeadSkinToExternalHeadSkin InternalHeadSkin ExternalHeadSkin - InternalHeadSkinToGround InternalHeadSkinToTemperatureGround InternalGround InternalHeadSkin - InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkin ExternalLeftArmSkin - InternalLeftArmSkinToGround InternalLeftArmSkinToTemperatureGround InternalGround InternalLeftArmSkin - InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkin ExternalLeftLegSkin - InternalLeftLegSkinToGround InternalLeftLegSkinToTemperatureGround InternalGround InternalLeftLegSkin - InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkin ExternalRightArmSkin - InternalRightArmSkinToGround InternalRightArmSkinToTemperatureGround InternalGround InternalRightArmSkin - InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkin ExternalRightLegSkin - InternalRightLegSkinToGround InternalRightLegSkinToTemperatureGround InternalGround InternalRightLegSkin - InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkin ExternalTorsoSkin - InternalTorsoSkinToGround InternalTorsoSkinToTemperatureGround InternalGround InternalTorsoSkin - BoneTissue @@ -30566,7 +29814,6 @@ - Off @@ -30975,7 +30222,6 @@ - @@ -31002,15 +30248,15 @@ On - + - + - + - + @@ -32357,7 +31603,6 @@ - Extrasplanchnic @@ -32368,7 +31613,6 @@ - Extrasplanchnic @@ -32389,7 +31633,6 @@ - Splanchnic @@ -32400,7 +31643,6 @@ - Extrasplanchnic @@ -32418,7 +31660,6 @@ - Extrasplanchnic @@ -32429,7 +31670,6 @@ - Splanchnic @@ -32440,7 +31680,6 @@ - Muscle @@ -32451,7 +31690,6 @@ - Myocardium @@ -32462,7 +31700,6 @@ - Cerebral @@ -32473,7 +31710,6 @@ - Extrasplanchnic @@ -32491,7 +31727,6 @@ - Extrasplanchnic @@ -32502,7 +31737,6 @@ - Extrasplanchnic @@ -32513,7 +31747,6 @@ - Splanchnic @@ -32524,7 +31757,6 @@ - Splanchnic @@ -32535,7 +31767,6 @@ - Splanchnic @@ -32593,7 +31824,6 @@ - Extrasplanchnic @@ -32826,7 +32056,6 @@ - Cerebral @@ -32847,7 +32076,6 @@ - Cerebral @@ -32868,7 +32096,6 @@ - Cerebral @@ -32982,7 +32209,6 @@ - Extrasplanchnic @@ -33265,7 +32491,6 @@ - Splanchnic @@ -33344,7 +32569,6 @@ - Extrasplanchnic @@ -33628,7 +32852,6 @@ - Extrasplanchnic @@ -34001,7 +33224,6 @@ - Splanchnic @@ -34206,7 +33428,6 @@ - Muscle @@ -34323,7 +33544,6 @@ - Myocardium @@ -34440,7 +33660,6 @@ - Cerebral @@ -34471,7 +33690,6 @@ - Cerebral @@ -34515,7 +33733,6 @@ - Splanchnic @@ -34589,7 +33806,6 @@ - Extrasplanchnic @@ -34873,7 +34089,6 @@ - Extrasplanchnic @@ -35285,7 +34500,6 @@ - Extrasplanchnic @@ -35432,7 +34646,6 @@ - Splanchnic @@ -35493,7 +34706,6 @@ - Splanchnic @@ -35613,7 +34825,6 @@ - Splanchnic diff --git a/share/data/states/Female@0s.xml b/share/data/states/Female@0s.xml index eeb0f6633..e793898f4 100644 --- a/share/data/states/Female@0s.xml +++ b/share/data/states/Female@0s.xml @@ -1,5 +1,5 @@ - + Female @@ -89,7 +89,7 @@ Gas - + @@ -177,7 +177,7 @@ - + @@ -313,7 +313,7 @@ - + @@ -363,7 +363,7 @@ - + @@ -386,7 +386,7 @@ - + @@ -419,7 +419,7 @@ - + @@ -444,7 +444,7 @@ - + @@ -467,7 +467,7 @@ - + @@ -515,7 +515,7 @@ - + @@ -571,7 +571,7 @@ - + @@ -594,7 +594,7 @@ - + @@ -619,7 +619,7 @@ - + @@ -644,7 +644,7 @@ - + @@ -685,7 +685,7 @@ - + @@ -912,7 +912,6 @@ - false true false @@ -1011,6 +1010,7 @@ + @@ -1160,16 +1160,13 @@ - - - @@ -1216,15 +1213,15 @@ false - + - - + + @@ -1237,9 +1234,9 @@ 58.289075 25.7622836874252 - - - + + + @@ -1301,8 +1298,8 @@ - - + + @@ -1317,6 +1314,9 @@ 17 + + + @@ -1324,20 +1324,12 @@ Ambient Ambient - - - - Aorta Aorta1 Aorta2 Aorta3 - - - - Nitrogen @@ -1600,10 +1592,6 @@ Bladder Bladder - - - - Nitrogen @@ -1869,8 +1857,6 @@ BoneE3 BoneL1 BoneL2 - - Nitrogen @@ -2133,8 +2119,6 @@ BoneTissueIntracellular BoneI - - Nitrogen @@ -2398,10 +2382,6 @@ BoneVasculature Bone1 Bone2 - - - - Nitrogen @@ -2668,8 +2648,6 @@ BrainE3 BrainL1 BrainL2 - - Nitrogen @@ -2932,8 +2910,6 @@ BrainTissueIntracellular BrainI - - Nitrogen @@ -3198,276 +3174,269 @@ CerebralArteries CerebralCapillaries CerebralVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + CerebralArteries CerebralArteries1 CerebralArteries2 - - - - Nitrogen @@ -3730,10 +3699,6 @@ CerebralCapillaries CerebralCapillaries - - - - Nitrogen @@ -3996,8 +3961,6 @@ CerebralSpinalFluid SpinalFluid - - Nitrogen @@ -4261,10 +4224,6 @@ CerebralVeins1 CerebralVeins2 CerebralVeinsCheck - - - - Nitrogen @@ -4531,8 +4490,6 @@ FatE3 FatL1 FatL2 - - Nitrogen @@ -4795,8 +4752,6 @@ FatTissueIntracellular FatI - - Nitrogen @@ -5060,10 +5015,6 @@ FatVasculature Fat1 Fat2 - - - - Nitrogen @@ -5326,9 +5277,6 @@ Ground Ground - - - Nitrogen @@ -5449,8 +5397,6 @@ GutE3 GutL1 GutL2 - - Nitrogen @@ -5713,8 +5659,6 @@ GutTissueIntracellular GutI - - Nitrogen @@ -5979,266 +5923,263 @@ SplanchnicVasculature SmallIntestineVasculature LargeIntestineVasculature - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -6247,541 +6188,529 @@ LeftHeart RightHeart Pericardium - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + KidneyVasculature LeftKidneyVasculature RightKidneyVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LargeIntestineVasculature LargeIntestine1 - - - - Nitrogen @@ -7044,10 +6973,6 @@ LeftAfferentArteriole LeftAfferentArteriole - - - - Nitrogen @@ -7310,26 +7235,15 @@ LeftAlveoli LeftAlveoli - - - - LeftAlveoliLeak LeftAlveoliLeak - - - LeftArmVasculature LeftArm1 LeftArm2 - - - - Nitrogen @@ -7593,10 +7507,6 @@ LeftAtrium LeftAtrium1 LeftAtrium2 - - - - Nitrogen @@ -7860,10 +7770,6 @@ LeftBowmansCapsules LeftBowmansCapsules LeftNetBowmansCapsules - - - - Nitrogen @@ -8126,25 +8032,14 @@ LeftBronchi LeftBronchi - - - - LeftChestLeak LeftChestLeak - - - LeftEfferentArteriole LeftEfferentArteriole - - - - Nitrogen @@ -8408,10 +8303,6 @@ LeftGlomerularCapillaries LeftGlomerularCapillaries LeftNetGlomerularCapillaries - - - - Nitrogen @@ -8675,266 +8566,262 @@ LeftHeart LeftAtrium LeftVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -8944,8 +8831,6 @@ LeftKidneyE3 LeftKidneyL1 LeftKidneyL2 - - Nitrogen @@ -9208,8 +9093,6 @@ LeftKidneyTissueIntracellular LeftKidneyI - - Nitrogen @@ -9474,276 +9357,269 @@ LeftRenalArtery LeftNephron LeftRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftLegVasculature LeftLeg1 LeftLeg2 - - - - Nitrogen @@ -10007,10 +9883,6 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - - LeftLungTissueExtracellular @@ -10019,10 +9891,6 @@ LeftLungE3 LeftLungL1 LeftLungL2 - - - - Nitrogen @@ -10285,8 +10153,6 @@ LeftLungTissueIntracellular LeftLungI - - Nitrogen @@ -10551,266 +10417,263 @@ LeftPulmonaryArteries LeftPulmonaryCapillaries LeftPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -10821,276 +10684,269 @@ LeftPeritubularCapillaries LeftBowmansCapsules LeftTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftPeritubularCapillaries LeftPeritubularCapillaries LeftNetPeritubularCapillaries - - - - Nitrogen @@ -11354,19 +11210,11 @@ LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - LeftPulmonaryArteries LeftPulmonaryArteries LeftIntermediatePulmonaryArteries - - - - Nitrogen @@ -11629,10 +11477,6 @@ LeftPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen @@ -11895,10 +11739,6 @@ LeftPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen @@ -12161,10 +12001,6 @@ LeftRenalArtery LeftRenalArtery - - - - Nitrogen @@ -12427,10 +12263,6 @@ LeftRenalVein LeftRenalVein - - - - Nitrogen @@ -12694,10 +12526,6 @@ LeftTubules LeftTubules LeftNetTubules - - - - Nitrogen @@ -12960,10 +12788,6 @@ LeftUreter LeftUreter - - - - Nitrogen @@ -13226,10 +13050,6 @@ LeftVentricle LeftVentricle1 LeftVentricle2 - - - - Nitrogen @@ -13496,8 +13316,6 @@ LiverE3 LiverL1 LiverL2 - - Nitrogen @@ -13760,8 +13578,6 @@ LiverTissueIntracellular LiverI - - Nitrogen @@ -14027,9 +13843,6 @@ Liver2 PortalVein1 - - - Nitrogen @@ -14293,273 +14106,267 @@ LungsVasculature LeftLungVasculature RightLungVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + Lymph Lymph - - Nitrogen @@ -14821,16 +14628,10 @@ Mouth Mouth - - - - Mouthpiece Mouthpiece - - MuscleTissueExtracellular @@ -14839,8 +14640,6 @@ MuscleE3 MuscleL1 MuscleL2 - - Nitrogen @@ -15103,8 +14902,6 @@ MuscleTissueIntracellular MuscleI - - Nitrogen @@ -15368,10 +15165,6 @@ MuscleVasculature Muscle1 Muscle2 - - - - Nitrogen @@ -15638,8 +15431,6 @@ MyocardiumE3 MyocardiumL1 MyocardiumL2 - - Nitrogen @@ -15902,8 +15693,6 @@ MyocardiumTissueIntracellular MyocardiumI - - Nitrogen @@ -16167,10 +15956,6 @@ MyocardiumVasculature Myocardium1 Myocardium2 - - - - Nitrogen @@ -16433,10 +16218,6 @@ NeckArteries NeckArteries - - - - Nitrogen @@ -16699,10 +16480,6 @@ NeckVeins NeckVeins - - - - Nitrogen @@ -16965,8 +16742,6 @@ Pericardium Pericardium1 - - Nitrogen @@ -17230,825 +17005,801 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - PulmonaryArteries RightPulmonaryArteries LeftPulmonaryArteries - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryCapillaries RightPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - - PulmonaryVeins RightPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightAfferentArteriole RightAfferentArteriole - - - - Nitrogen @@ -18311,26 +18062,15 @@ RightAlveoli RightAlveoli - - - - RightAlveoliLeak RightAlveoliLeak - - - RightArmVasculature RightArm1 RightArm2 - - - - Nitrogen @@ -18594,10 +18334,6 @@ RightAtrium RightAtrium1 RightAtrium2 - - - - Nitrogen @@ -18861,10 +18597,6 @@ RightBowmansCapsules RightBowmansCapsules RightNetBowmansCapsules - - - - Nitrogen @@ -19127,25 +18859,14 @@ RightBronchi RightBronchi - - - - RightChestLeak RightChestLeak - - - RightEfferentArteriole RightEfferentArteriole - - - - Nitrogen @@ -19409,10 +19130,6 @@ RightGlomerularCapillaries RightGlomerularCapillaries RightNetGlomerularCapillaries - - - - Nitrogen @@ -19676,266 +19393,262 @@ RightHeart RightAtrium RightVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -19945,8 +19658,6 @@ RightKidneyE3 RightKidneyL1 RightKidneyL2 - - Nitrogen @@ -20209,8 +19920,6 @@ RightKidneyTissueIntracellular RightKidneyI - - Nitrogen @@ -20475,276 +20184,269 @@ RightRenalArtery RightNephron RightRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightLegVasculature RightLeg1 RightLeg2 - - - - Nitrogen @@ -21008,10 +20710,6 @@ RightLungPulmonary RightBronchi RightAlveoli - - - - RightLungTissueExtracellular @@ -21020,8 +20718,6 @@ RightLungE3 RightLungL1 RightLungL2 - - Nitrogen @@ -21284,8 +20980,6 @@ RightLungTissueIntracellular RightLungI - - Nitrogen @@ -21550,266 +21244,263 @@ RightPulmonaryArteries RightPulmonaryCapillaries RightPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -21820,276 +21511,269 @@ RightPeritubularCapillaries RightBowmansCapsules RightTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightPeritubularCapillaries RightPeritubularCapillaries RightNetPeritubularCapillaries - - - - Nitrogen @@ -22353,19 +22037,11 @@ RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - RightPulmonaryArteries RightPulmonaryArteries RightIntermediatePulmonaryArteries - - - - Nitrogen @@ -22628,10 +22304,6 @@ RightPulmonaryCapillaries RightPulmonaryCapillaries - - - - Nitrogen @@ -22894,10 +22566,6 @@ RightPulmonaryVeins RightPulmonaryVeins - - - - Nitrogen @@ -23160,10 +22828,6 @@ RightRenalArtery RightRenalArtery - - - - Nitrogen @@ -23426,10 +23090,6 @@ RightRenalVein RightRenalVein - - - - Nitrogen @@ -23693,10 +23353,6 @@ RightTubules RightTubules RightNetTubules - - - - Nitrogen @@ -23959,10 +23615,6 @@ RightUreter RightUreter - - - - Nitrogen @@ -24226,10 +23878,6 @@ RightVentricle1 RightVentricle2 MainPulmonaryArteries - - - - Nitrogen @@ -24496,8 +24144,6 @@ SkinE3 SkinL1 SkinL2 - - Nitrogen @@ -24760,8 +24406,6 @@ SkinTissueIntracellular SkinI - - Nitrogen @@ -25025,10 +24669,6 @@ SkinVasculature Skin1 Skin2 - - - - Nitrogen @@ -25291,8 +24931,6 @@ SmallIntestineChyme SmallIntestineC1 - - Nitrogen @@ -25554,10 +25192,6 @@ SmallIntestineVasculature SmallIntestine1 - - - - Nitrogen @@ -25820,10 +25454,6 @@ SplanchnicVasculature Splanchnic1 - - - - Nitrogen @@ -26090,8 +25720,6 @@ SpleenE3 SpleenL1 SpleenL2 - - Nitrogen @@ -26354,8 +25982,6 @@ SpleenTissueIntracellular SpleenI - - Nitrogen @@ -26618,10 +26244,6 @@ SpleenVasculature Spleen1 - - - - Nitrogen @@ -26884,290 +26506,276 @@ Stomach Stomach - - - - Trachea Trachea - - - - Ureters RightUreter LeftUreter - - - - Nitrogen - - + + - - + + Oxygen - - + + - - + + + CarbonDioxide - - + + - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + VenaCava VenaCava - - - - Nitrogen @@ -27432,189 +27040,162 @@ AortaBleed Aorta Ground - AortaToBone Aorta1ToBone1 Aorta BoneVasculature - AortaToFat Aorta1ToFat1 Aorta FatVasculature - AortaToLargeIntestine Aorta1ToLargeIntestine Aorta LargeIntestineVasculature - AortaToLeftArm Aorta1ToLeftArm1 Aorta LeftArmVasculature - AortaToLeftKidney LeftAortaConnectionToRenalArtery Aorta LeftRenalArtery - AortaToLeftLeg Aorta1ToLeftLeg1 Aorta LeftLegVasculature - AortaToLiver Aorta1ToLiver1 Aorta LiverVasculature - AortaToMuscle Aorta1ToMuscle1 Aorta MuscleVasculature - AortaToMyocardium Aorta1ToMyocardium1 Aorta MyocardiumVasculature - AortaToNeckArteries Aorta1ToNeckArteries Aorta NeckArteries - AortaToRightArm Aorta1ToRightArm1 Aorta RightArmVasculature - AortaToRightKidney RightAortaConnectionToRenalArtery Aorta RightRenalArtery - AortaToRightLeg Aorta1ToRightLeg1 Aorta RightLegVasculature - AortaToSkin Aorta1ToSkin1 Aorta SkinVasculature - AortaToSmallIntestine Aorta1ToSmallIntestine Aorta SmallIntestineVasculature - AortaToSplanchnic Aorta1ToSplanchnic Aorta SplanchnicVasculature - AortaToSpleen Aorta1ToSpleen Aorta SpleenVasculature - BladderToGround BladderToGroundUrinate Bladder Ground - BladderToGroundSource BladderToGroundPressure Bladder Ground - BoneToVenaCava Bone2ToVenaCava BoneVasculature VenaCava - BrainHemorrhage BrainBleed CerebralCapillaries Ground - CerebralArteriesToCerebralCapillaries CerebralArteries2ToCapillaries CerebralArteries CerebralCapillaries - CerebralCapillariesToCerebralVeins CerebralCapillariesToCerebralVeins1 CerebralCapillaries CerebralVeins - CerebralVeinsToNeckVeins CerebralVeins2ToNeckVeins CerebralVeins NeckVeins - EnvironmentToLeftChestLeak EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -27627,266 +27208,228 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - FatToVenaCava Fat2ToVenaCava FatVasculature VenaCava - HeartHemorrhage MyocardiumBleed MyocardiumVasculature Ground - LargeIntestineHemorrhage LargeIntestineBleed LargeIntestineVasculature Ground - LargeIntestineToLiver LargeIntestineToPortalVein LargeIntestineVasculature LiverVasculature - LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArteriole LeftGlomerularCapillaries - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftArmHemorrhage LeftArmBleed LeftArmVasculature Ground - LeftArmToVenaCava LeftArm2ToVenaCava LeftArmVasculature VenaCava - LeftAtriumToLeftVentricle LeftAtrium2ToLeftVentricle1 LeftAtrium LeftVentricle - LeftBowmansCapsulesToTubules LeftBowmansCapsulesToTubules LeftBowmansCapsules LeftTubules - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArteriole LeftPeritubularCapillaries - LeftGlomerularCapillariesToBowmansCapsules LeftNetGlomerularCapillariesToNetBowmansCapsules LeftGlomerularCapillaries LeftBowmansCapsules - LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillaries LeftEfferentArteriole - LeftKidneyHemorrhage LeftKidneyBleed LeftRenalVein Ground - LeftKidneyToVenaCava LeftRenalVeinToVenaCavaConnection LeftRenalVein VenaCava - LeftLegHemorrhage LeftLegBleed LeftLegVasculature Ground - LeftLegToVenaCava LeftLeg2ToVenaCava LeftLegVasculature VenaCava - LeftLungHemorrhage LeftLungBleed LeftPulmonaryArteries Ground - LeftLungVascularToTissue LeftLungVToLeftLungE1 LeftLungVasculature LeftLungTissueExtracellular - LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillaries LeftRenalVein - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - LeftPulmonaryArteriesToCapillaries LeftPulmonaryArteriesToLeftPulmonaryCapillaries LeftPulmonaryArteries LeftPulmonaryCapillaries - LeftPulmonaryArteriesToVeins LeftPulmonaryArteriesToLeftPulmonaryVeins LeftPulmonaryArteries LeftPulmonaryVeins - LeftPulmonaryCapillariesToVeins LeftPulmonaryCapillariesToLeftPulmonaryVeins LeftPulmonaryCapillaries LeftPulmonaryVeins - LeftPulmonaryVeinsToLeftAtrium LeftIntermediatePulmonaryVeinsToLeftAtrium1 LeftPulmonaryVeins LeftAtrium - LeftRenalArteryToAfferentArteriole LeftRenalArteryToAfferentArteriole LeftRenalArtery LeftAfferentArteriole - LeftTubulesToPeritubularCapillaries LeftNetTubulesToNetPeritubularCapillaries LeftTubules LeftPeritubularCapillaries - LeftTubulesToUreter LeftTubulesToUreter LeftTubules LeftUreter - LeftUreterToBladder LeftUreterToBladder LeftUreter Bladder - LeftVentricleToAorta LeftVentricle1ToAorta2 LeftVentricle Aorta - LiverHemorrhage LiverBleed LiverVasculature Ground - LiverToVenaCava Liver2ToVenaCava LiverVasculature VenaCava - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -27899,315 +27442,270 @@ Muscle2ToVenaCava MuscleVasculature VenaCava - MyocardiumToVenaCava Myocardium2ToVenaCava MyocardiumVasculature VenaCava - NeckArteriesToCerebralArteries NeckArteriesToCerebralArteries1 NeckArteries CerebralArteries - NeckVeinsToVenaCava NeckVeinsToVenaCava NeckVeins VenaCava - RightAfferentArterioleToGlomerularCapillaries RightAfferentArterioleToGlomerularCapillaries RightAfferentArteriole RightGlomerularCapillaries - RightAlveoliLeakToRightPleuralCavity RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightArmHemorrhage RightArmBleed RightArmVasculature Ground - RightArmToVenaCava RightArm2ToVenaCava RightArmVasculature VenaCava - RightAtriumToRightVentricle RightAtrium2ToRightVentricle1 RightAtrium RightVentricle - RightBowmansCapsulesToTubules RightBowmansCapsulesToTubules RightBowmansCapsules RightTubules - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightEfferentArterioleToPeritubularCapillaries RightEfferentArterioleToPeritubularCapillaries RightEfferentArteriole RightPeritubularCapillaries - RightGlomerularCapillariesToBowmansCapsules RightNetGlomerularCapillariesToNetBowmansCapsules RightGlomerularCapillaries RightBowmansCapsules - RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillaries RightEfferentArteriole - RightKidneyHemorrhage RightKidneyBleed RightRenalVein Ground - RightKidneyToVenaCava RightRenalVeinToVenaCavaConnection RightRenalVein VenaCava - RightLegHemorrhage RightLegBleed RightLegVasculature Ground - RightLegToVenaCava RightLeg2ToVenaCava RightLegVasculature VenaCava - RightLungHemorrhage RightLungBleed RightPulmonaryArteries Ground - RightPeritubularCapillariesToRenalVein RightPeritubularCapillariesToRenalVein RightPeritubularCapillaries RightRenalVein - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - RightPulmonaryArteriesToCapillaries RightPulmonaryArteriesToRightPulmonaryCapillaries RightPulmonaryArteries RightPulmonaryCapillaries - RightPulmonaryArteriesToVeins RightPulmonaryArteriesToRightPulmonaryVeins RightPulmonaryArteries RightPulmonaryVeins - RightPulmonaryCapillariesToVeins RightPulmonaryCapillariesToRightPulmonaryVeins RightPulmonaryCapillaries RightPulmonaryVeins - RightPulmonaryVeinsToLeftAtrium RightIntermediatePulmonaryVeinsToLeftAtrium1 RightPulmonaryVeins LeftAtrium - RightRenalArteryToAfferentArteriole RightRenalArteryToAfferentArteriole RightRenalArtery RightAfferentArteriole - RightTubulesToPeritubularCapillaries RightNetTubulesToNetPeritubularCapillaries RightTubules RightPeritubularCapillaries - RightTubulesToUreter RightTubulesToUreter RightTubules RightUreter - RightUreterToBladder RightUreterToBladder RightUreter Bladder - RightVentricleToLeftPulmonaryArteries MainPulmonaryArteriesToLeftIntermediatePulmonaryArteries RightVentricle LeftPulmonaryArteries - RightVentricleToRightPulmonaryArteries MainPulmonaryArteriesToRightIntermediatePulmonaryArteries RightVentricle RightPulmonaryArteries - SkinToVenaCava Skin2ToVenaCava SkinVasculature VenaCava - SmallIntestineHemorrhage SmallIntestineBleed SmallIntestineVasculature Ground - SmallIntestineToLiver SmallIntestineToPortalVein SmallIntestineVasculature LiverVasculature - SplanchnicHemorrhage SplanchnicBleed SplanchnicVasculature Ground - SplanchnicToLiver SplanchnicToPortalVein SplanchnicVasculature LiverVasculature - SpleenHemorrhage SpleenBleed SpleenVasculature Ground - SpleenToLiver SpleenToPortalVein SpleenVasculature LiverVasculature - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VenaCavaHemorrhage VenaCavaBleed VenaCava Ground - VenaCavaIV IVToVenaCava Ground VenaCava - VenaCavaToRightAtrium VenaCavaToRightAtrium1 VenaCava RightAtrium - Nitrogen Oxygen @@ -28633,10 +28131,6 @@ Ambient Ambient - - - - Nitrogen @@ -28659,10 +28153,6 @@ AnesthesiaConnection AnesthesiaConnection - - - - Nitrogen @@ -28685,7 +28175,6 @@ Connection MechanicalVentilatorConnection - Nitrogen @@ -28708,10 +28197,6 @@ ExpiratoryLimb ExpiratoryLimb - - - - Nitrogen @@ -28734,10 +28219,6 @@ GasInlet GasInlet - - - - Nitrogen @@ -28760,10 +28241,6 @@ GasSource GasSource - - - - Nitrogen @@ -28786,10 +28263,6 @@ InspiratoryLimb InspiratoryLimb - - - - Nitrogen @@ -28812,10 +28285,6 @@ LeftAlveoli LeftAlveoli - - - - Nitrogen @@ -28838,9 +28307,6 @@ LeftAlveoliLeak LeftAlveoliLeak - - - Nitrogen @@ -28854,10 +28320,6 @@ LeftBronchi LeftBronchi - - - - Nitrogen @@ -28880,9 +28342,6 @@ LeftChestLeak LeftChestLeak - - - Nitrogen @@ -28897,37 +28356,31 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - Nitrogen @@ -28950,10 +28403,6 @@ Mouth Mouth - - - - Nitrogen @@ -28976,8 +28425,6 @@ Mouthpiece Mouthpiece - - Nitrogen @@ -29000,7 +28447,6 @@ Nosepiece Nosepiece - Nitrogen @@ -29023,7 +28469,6 @@ OxygenTank OxygenTank - Nitrogen @@ -29047,62 +28492,53 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + ReliefValve ReliefValve - - - Nitrogen @@ -29125,10 +28561,6 @@ RightAlveoli RightAlveoli - - - - Nitrogen @@ -29151,9 +28583,6 @@ RightAlveoliLeak RightAlveoliLeak - - - Nitrogen @@ -29167,10 +28596,6 @@ RightBronchi RightBronchi - - - - Nitrogen @@ -29193,9 +28618,6 @@ RightChestLeak RightChestLeak - - - Nitrogen @@ -29210,37 +28632,30 @@ RightLungPulmonary RightBronchi RightAlveoli - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - Nitrogen @@ -29263,10 +28678,6 @@ Scrubber Scrubber - - - - Nitrogen @@ -29289,10 +28700,6 @@ Selector Selector - - - - Nitrogen @@ -29315,10 +28722,6 @@ Stomach Stomach - - - - Nitrogen @@ -29341,10 +28744,6 @@ Trachea Trachea - - - - Nitrogen @@ -29368,10 +28767,6 @@ Ventilator Ventilator VentilatorConnection - - - - Nitrogen @@ -29415,10 +28810,6 @@ YPiece YPiece - - - - Nitrogen @@ -29443,7 +28834,6 @@ AnesthesiaConnectionToEnvironment AnesthesiaConnection Ambient - ConnectionToMouth @@ -29456,14 +28846,12 @@ EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -29482,98 +28870,84 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - Exhaust SelectorToEnvironment Selector Ambient - ExpiratoryLimbToSelector ExpiratoryLimbToSelector ExpiratoryLimb Selector - GasInletToInspiratoryLimb GasInletToInspiratoryLimb GasInlet InspiratoryLimb - GasSourceToGasInlet GasSourceToGasInlet GasSource GasInlet - InspiratoryLimbToYPiece InspiratoryLimbToYPiece InspiratoryLimb YPiece - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - Mask AnesthesiaConnectionToMouth AnesthesiaConnection Mouth - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -29604,91 +28978,78 @@ RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - ScrubberToGasInlet ScrubberToGasInlet Scrubber GasInlet - SelectorToReliefValve SelectorToReliefValve Selector ReliefValve - SelectorToScrubber SelectorToScrubber Selector Scrubber - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VentilatorToSelector VentilatorConnectionToSelector Ventilator Selector - YPieceToAnesthesiaConnection YPieceToAnesthesiaConnection YPiece AnesthesiaConnection - YPieceToExpiratoryLimb YPieceToExpiratoryLimb YPiece ExpiratoryLimb - Nitrogen Oxygen @@ -29922,477 +29283,364 @@ Active Active - - - Ambient Ambient - - - Clothing Clothing - - - Enclosure Enclosure - - - ExternalCore ExternalCore - - - ExternalGround ExternalGround - - - ExternalHeadSkin ExternalHeadSkin - - - ExternalLeftArmSkin ExternalLeftArmSkin - - - ExternalLeftLegSkin ExternalLeftLegSkin - - - ExternalRightArmSkin ExternalRightArmSkin - - - ExternalRightLegSkin ExternalRightLegSkin - - - ExternalTorsoSkin ExternalTorsoSkin - - - InternalCore InternalCore InternalGround - - - - InternalGround - - InternalHeadSkin InternalHeadSkin - - - - InternalLeftArmSkin InternalLeftArmSkin - - - - InternalLeftLegSkin InternalLeftLegSkin - - - - InternalRightArmSkin InternalRightArmSkin - - - - InternalRightLegSkin InternalRightLegSkin - - - - InternalTorsoSkin InternalTorsoSkin - - - - ActiveToClothing ActiveToClothing Active Clothing - ClothingToEnclosure ClothingToEnclosure Clothing Enclosure - ClothingToEnvironment ClothingToEnvironment Clothing Ambient - ExternalCoreToGround ExternalCoreToGround ExternalCore ExternalGround - ExternalHeadSkinToClothing ExternalHeadSkinToClothing ExternalHeadSkin Clothing - ExternalHeadSkinToGround ExternalHeadSkinToGround ExternalHeadSkin ExternalGround - ExternalLeftArmSkinToClothing ExternalLeftArmSkinToClothing ExternalLeftArmSkin Clothing - ExternalLeftArmSkinToGround ExternalLeftArmSkinToGround ExternalLeftArmSkin ExternalGround - ExternalLeftLegSkinToClothing ExternalLeftLegSkinToClothing ExternalLeftLegSkin Clothing - ExternalLeftLegSkinToGround ExternalLeftLegSkinToGround ExternalLeftLegSkin ExternalGround - ExternalRightArmSkinToClothing ExternalRightArmSkinToClothing ExternalRightArmSkin Clothing - ExternalRightArmSkinToGround ExternalRightArmSkinToGround ExternalRightArmSkin ExternalGround - ExternalRightLegSkinToClothing ExternalRightLegSkinToClothing ExternalRightLegSkin Clothing - ExternalRightLegSkinToGround ExternalRightLegSkinToGround ExternalRightLegSkin ExternalGround - ExternalTorsoSkinToClothing ExternalTorsoSkinToClothing ExternalTorsoSkin Clothing - ExternalTorsoSkinToGround ExternalTorsoSkinToGround ExternalTorsoSkin ExternalGround - GroundToActive GroundToActive ExternalGround Active - GroundToClothing GroundToClothing ExternalGround Clothing - GroundToEnclosure GroundToEnclosure ExternalGround Enclosure - GroundToEnvironment GroundToEnvironment ExternalGround Ambient - GroundToInternalCore GroundToInternalCore InternalGround InternalCore - GroundToInternalHeadSkin GroundToInternalHeadSkin InternalGround InternalHeadSkin - GroundToInternalLeftArmSkin GroundToInternalLeftArmSkin InternalGround InternalLeftArmSkin - GroundToInternalLeftLegSkin GroundToInternalLeftLegSkin InternalGround InternalLeftLegSkin - GroundToInternalRightArmSkin GroundToInternalRightArmSkin InternalGround InternalRightArmSkin - GroundToInternalRightLegSkin GroundToInternalRightLegSkin InternalGround InternalRightLegSkin - GroundToInternalTorsoSkin GroundToInternalTorsoSkin InternalGround InternalTorsoSkin - InternalCoreToExternalCore InternalCoreToExternalCore InternalCore ExternalCore - InternalCoreToGround InternalCoreToGround InternalGround InternalCore - InternalCoreToInternalHeadSkin InternalCoreToInternalHeadSkin InternalCore InternalHeadSkin - InternalCoreToInternalLeftArmSkin InternalCoreToInternalLeftArmSkin InternalCore InternalLeftArmSkin - InternalCoreToInternalLeftLegSkin InternalCoreToInternalLeftLegSkin InternalCore InternalLeftLegSkin - InternalCoreToInternalRightArmSkin InternalCoreToInternalRightArmSkin InternalCore InternalRightArmSkin - InternalCoreToInternalRightLegSkin InternalCoreToInternalRightLegSkin InternalCore InternalRightLegSkin - InternalCoreToInternalTorsoSkin InternalCoreToInternalTorsoSkin InternalCore InternalTorsoSkin - InternalHeadSkinToExternalHeadSkin InternalHeadSkinToExternalHeadSkin InternalHeadSkin ExternalHeadSkin - InternalHeadSkinToGround InternalHeadSkinToTemperatureGround InternalGround InternalHeadSkin - InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkin ExternalLeftArmSkin - InternalLeftArmSkinToGround InternalLeftArmSkinToTemperatureGround InternalGround InternalLeftArmSkin - InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkin ExternalLeftLegSkin - InternalLeftLegSkinToGround InternalLeftLegSkinToTemperatureGround InternalGround InternalLeftLegSkin - InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkin ExternalRightArmSkin - InternalRightArmSkinToGround InternalRightArmSkinToTemperatureGround InternalGround InternalRightArmSkin - InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkin ExternalRightLegSkin - InternalRightLegSkinToGround InternalRightLegSkinToTemperatureGround InternalGround InternalRightLegSkin - InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkin ExternalTorsoSkin - InternalTorsoSkinToGround InternalTorsoSkinToTemperatureGround InternalGround InternalTorsoSkin - BoneTissue @@ -30566,7 +29814,6 @@ - Off @@ -30975,7 +30222,6 @@ - @@ -31002,15 +30248,15 @@ On - + - + - + - + @@ -32357,7 +31603,6 @@ - Extrasplanchnic @@ -32368,7 +31613,6 @@ - Extrasplanchnic @@ -32389,7 +31633,6 @@ - Splanchnic @@ -32400,7 +31643,6 @@ - Extrasplanchnic @@ -32418,7 +31660,6 @@ - Extrasplanchnic @@ -32429,7 +31670,6 @@ - Splanchnic @@ -32440,7 +31680,6 @@ - Muscle @@ -32451,7 +31690,6 @@ - Myocardium @@ -32462,7 +31700,6 @@ - Cerebral @@ -32473,7 +31710,6 @@ - Extrasplanchnic @@ -32491,7 +31727,6 @@ - Extrasplanchnic @@ -32502,7 +31737,6 @@ - Extrasplanchnic @@ -32513,7 +31747,6 @@ - Splanchnic @@ -32524,7 +31757,6 @@ - Splanchnic @@ -32535,7 +31767,6 @@ - Splanchnic @@ -32593,7 +31824,6 @@ - Extrasplanchnic @@ -32826,7 +32056,6 @@ - Cerebral @@ -32847,7 +32076,6 @@ - Cerebral @@ -32868,7 +32096,6 @@ - Cerebral @@ -32982,7 +32209,6 @@ - Extrasplanchnic @@ -33265,7 +32491,6 @@ - Splanchnic @@ -33344,7 +32569,6 @@ - Extrasplanchnic @@ -33628,7 +32852,6 @@ - Extrasplanchnic @@ -34001,7 +33224,6 @@ - Splanchnic @@ -34206,7 +33428,6 @@ - Muscle @@ -34323,7 +33544,6 @@ - Myocardium @@ -34440,7 +33660,6 @@ - Cerebral @@ -34471,7 +33690,6 @@ - Cerebral @@ -34515,7 +33733,6 @@ - Splanchnic @@ -34589,7 +33806,6 @@ - Extrasplanchnic @@ -34873,7 +34089,6 @@ - Extrasplanchnic @@ -35285,7 +34500,6 @@ - Extrasplanchnic @@ -35432,7 +34646,6 @@ - Splanchnic @@ -35493,7 +34706,6 @@ - Splanchnic @@ -35613,7 +34825,6 @@ - Splanchnic diff --git a/share/data/states/Female_18_Normal@0s.xml b/share/data/states/Female_18_Normal@0s.xml index 44fb297b9..552ca9565 100644 --- a/share/data/states/Female_18_Normal@0s.xml +++ b/share/data/states/Female_18_Normal@0s.xml @@ -1,5 +1,5 @@ - + Female_18_Normal @@ -180,7 +180,7 @@ - + @@ -316,7 +316,7 @@ - + @@ -366,7 +366,7 @@ - + @@ -389,7 +389,7 @@ - + @@ -422,7 +422,7 @@ - + @@ -447,7 +447,7 @@ - + @@ -470,7 +470,7 @@ - + @@ -518,7 +518,7 @@ - + @@ -556,7 +556,7 @@ - + @@ -574,7 +574,7 @@ - + @@ -597,7 +597,7 @@ - + @@ -610,7 +610,7 @@ Liquid - + @@ -622,7 +622,7 @@ - + @@ -647,7 +647,7 @@ - + @@ -688,7 +688,7 @@ - + @@ -915,7 +915,6 @@ - false true false @@ -1014,6 +1013,7 @@ + @@ -1163,16 +1163,13 @@ - - - @@ -1219,15 +1216,15 @@ false - + - - + + @@ -1240,9 +1237,9 @@ 54.9325844 25.8070561217217 - - - + + + @@ -1304,8 +1301,8 @@ - - + + @@ -1320,6 +1317,9 @@ 19 + + + @@ -1327,20 +1327,12 @@ Ambient Ambient - - - - Aorta Aorta1 Aorta2 Aorta3 - - - - Nitrogen @@ -1603,10 +1595,6 @@ Bladder Bladder - - - - Nitrogen @@ -1872,8 +1860,6 @@ BoneE3 BoneL1 BoneL2 - - Nitrogen @@ -2136,8 +2122,6 @@ BoneTissueIntracellular BoneI - - Nitrogen @@ -2401,10 +2385,6 @@ BoneVasculature Bone1 Bone2 - - - - Nitrogen @@ -2671,8 +2651,6 @@ BrainE3 BrainL1 BrainL2 - - Nitrogen @@ -2935,8 +2913,6 @@ BrainTissueIntracellular BrainI - - Nitrogen @@ -3201,276 +3177,269 @@ CerebralArteries CerebralCapillaries CerebralVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + CerebralArteries CerebralArteries1 CerebralArteries2 - - - - Nitrogen @@ -3733,10 +3702,6 @@ CerebralCapillaries CerebralCapillaries - - - - Nitrogen @@ -3999,8 +3964,6 @@ CerebralSpinalFluid SpinalFluid - - Nitrogen @@ -4264,10 +4227,6 @@ CerebralVeins1 CerebralVeins2 CerebralVeinsCheck - - - - Nitrogen @@ -4534,8 +4493,6 @@ FatE3 FatL1 FatL2 - - Nitrogen @@ -4798,8 +4755,6 @@ FatTissueIntracellular FatI - - Nitrogen @@ -5063,10 +5018,6 @@ FatVasculature Fat1 Fat2 - - - - Nitrogen @@ -5329,9 +5280,6 @@ Ground Ground - - - Nitrogen @@ -5452,8 +5400,6 @@ GutE3 GutL1 GutL2 - - Nitrogen @@ -5716,8 +5662,6 @@ GutTissueIntracellular GutI - - Nitrogen @@ -5982,266 +5926,263 @@ SplanchnicVasculature SmallIntestineVasculature LargeIntestineVasculature - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -6250,541 +6191,529 @@ LeftHeart RightHeart Pericardium - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + KidneyVasculature LeftKidneyVasculature RightKidneyVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LargeIntestineVasculature LargeIntestine1 - - - - Nitrogen @@ -7047,10 +6976,6 @@ LeftAfferentArteriole LeftAfferentArteriole - - - - Nitrogen @@ -7313,26 +7238,15 @@ LeftAlveoli LeftAlveoli - - - - LeftAlveoliLeak LeftAlveoliLeak - - - LeftArmVasculature LeftArm1 LeftArm2 - - - - Nitrogen @@ -7596,10 +7510,6 @@ LeftAtrium LeftAtrium1 LeftAtrium2 - - - - Nitrogen @@ -7863,10 +7773,6 @@ LeftBowmansCapsules LeftBowmansCapsules LeftNetBowmansCapsules - - - - Nitrogen @@ -8129,25 +8035,14 @@ LeftBronchi LeftBronchi - - - - LeftChestLeak LeftChestLeak - - - LeftEfferentArteriole LeftEfferentArteriole - - - - Nitrogen @@ -8411,10 +8306,6 @@ LeftGlomerularCapillaries LeftGlomerularCapillaries LeftNetGlomerularCapillaries - - - - Nitrogen @@ -8678,266 +8569,262 @@ LeftHeart LeftAtrium LeftVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -8947,8 +8834,6 @@ LeftKidneyE3 LeftKidneyL1 LeftKidneyL2 - - Nitrogen @@ -9211,8 +9096,6 @@ LeftKidneyTissueIntracellular LeftKidneyI - - Nitrogen @@ -9477,276 +9360,269 @@ LeftRenalArtery LeftNephron LeftRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftLegVasculature LeftLeg1 LeftLeg2 - - - - Nitrogen @@ -10010,10 +9886,6 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - - LeftLungTissueExtracellular @@ -10022,10 +9894,6 @@ LeftLungE3 LeftLungL1 LeftLungL2 - - - - Nitrogen @@ -10288,8 +10156,6 @@ LeftLungTissueIntracellular LeftLungI - - Nitrogen @@ -10554,266 +10420,263 @@ LeftPulmonaryArteries LeftPulmonaryCapillaries LeftPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -10824,276 +10687,269 @@ LeftPeritubularCapillaries LeftBowmansCapsules LeftTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftPeritubularCapillaries LeftPeritubularCapillaries LeftNetPeritubularCapillaries - - - - Nitrogen @@ -11357,19 +11213,11 @@ LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - LeftPulmonaryArteries LeftPulmonaryArteries LeftIntermediatePulmonaryArteries - - - - Nitrogen @@ -11632,10 +11480,6 @@ LeftPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen @@ -11898,10 +11742,6 @@ LeftPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen @@ -12164,10 +12004,6 @@ LeftRenalArtery LeftRenalArtery - - - - Nitrogen @@ -12430,10 +12266,6 @@ LeftRenalVein LeftRenalVein - - - - Nitrogen @@ -12697,10 +12529,6 @@ LeftTubules LeftTubules LeftNetTubules - - - - Nitrogen @@ -12963,10 +12791,6 @@ LeftUreter LeftUreter - - - - Nitrogen @@ -13229,10 +13053,6 @@ LeftVentricle LeftVentricle1 LeftVentricle2 - - - - Nitrogen @@ -13499,8 +13319,6 @@ LiverE3 LiverL1 LiverL2 - - Nitrogen @@ -13763,8 +13581,6 @@ LiverTissueIntracellular LiverI - - Nitrogen @@ -14030,9 +13846,6 @@ Liver2 PortalVein1 - - - Nitrogen @@ -14296,273 +14109,267 @@ LungsVasculature LeftLungVasculature RightLungVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + Lymph Lymph - - Nitrogen @@ -14824,16 +14631,10 @@ Mouth Mouth - - - - Mouthpiece Mouthpiece - - MuscleTissueExtracellular @@ -14842,8 +14643,6 @@ MuscleE3 MuscleL1 MuscleL2 - - Nitrogen @@ -15106,8 +14905,6 @@ MuscleTissueIntracellular MuscleI - - Nitrogen @@ -15371,10 +15168,6 @@ MuscleVasculature Muscle1 Muscle2 - - - - Nitrogen @@ -15641,8 +15434,6 @@ MyocardiumE3 MyocardiumL1 MyocardiumL2 - - Nitrogen @@ -15905,8 +15696,6 @@ MyocardiumTissueIntracellular MyocardiumI - - Nitrogen @@ -16170,10 +15959,6 @@ MyocardiumVasculature Myocardium1 Myocardium2 - - - - Nitrogen @@ -16436,10 +16221,6 @@ NeckArteries NeckArteries - - - - Nitrogen @@ -16702,10 +16483,6 @@ NeckVeins NeckVeins - - - - Nitrogen @@ -16968,8 +16745,6 @@ Pericardium Pericardium1 - - Nitrogen @@ -17233,825 +17008,801 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - PulmonaryArteries RightPulmonaryArteries LeftPulmonaryArteries - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryCapillaries RightPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - - PulmonaryVeins RightPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightAfferentArteriole RightAfferentArteriole - - - - Nitrogen @@ -18314,26 +18065,15 @@ RightAlveoli RightAlveoli - - - - RightAlveoliLeak RightAlveoliLeak - - - RightArmVasculature RightArm1 RightArm2 - - - - Nitrogen @@ -18597,10 +18337,6 @@ RightAtrium RightAtrium1 RightAtrium2 - - - - Nitrogen @@ -18864,10 +18600,6 @@ RightBowmansCapsules RightBowmansCapsules RightNetBowmansCapsules - - - - Nitrogen @@ -19130,25 +18862,14 @@ RightBronchi RightBronchi - - - - RightChestLeak RightChestLeak - - - RightEfferentArteriole RightEfferentArteriole - - - - Nitrogen @@ -19412,10 +19133,6 @@ RightGlomerularCapillaries RightGlomerularCapillaries RightNetGlomerularCapillaries - - - - Nitrogen @@ -19679,266 +19396,262 @@ RightHeart RightAtrium RightVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -19948,8 +19661,6 @@ RightKidneyE3 RightKidneyL1 RightKidneyL2 - - Nitrogen @@ -20212,8 +19923,6 @@ RightKidneyTissueIntracellular RightKidneyI - - Nitrogen @@ -20478,276 +20187,269 @@ RightRenalArtery RightNephron RightRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightLegVasculature RightLeg1 RightLeg2 - - - - Nitrogen @@ -21011,10 +20713,6 @@ RightLungPulmonary RightBronchi RightAlveoli - - - - RightLungTissueExtracellular @@ -21023,8 +20721,6 @@ RightLungE3 RightLungL1 RightLungL2 - - Nitrogen @@ -21287,8 +20983,6 @@ RightLungTissueIntracellular RightLungI - - Nitrogen @@ -21553,266 +21247,263 @@ RightPulmonaryArteries RightPulmonaryCapillaries RightPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -21823,276 +21514,269 @@ RightPeritubularCapillaries RightBowmansCapsules RightTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightPeritubularCapillaries RightPeritubularCapillaries RightNetPeritubularCapillaries - - - - Nitrogen @@ -22356,19 +22040,11 @@ RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - RightPulmonaryArteries RightPulmonaryArteries RightIntermediatePulmonaryArteries - - - - Nitrogen @@ -22631,10 +22307,6 @@ RightPulmonaryCapillaries RightPulmonaryCapillaries - - - - Nitrogen @@ -22897,10 +22569,6 @@ RightPulmonaryVeins RightPulmonaryVeins - - - - Nitrogen @@ -23163,10 +22831,6 @@ RightRenalArtery RightRenalArtery - - - - Nitrogen @@ -23429,10 +23093,6 @@ RightRenalVein RightRenalVein - - - - Nitrogen @@ -23696,10 +23356,6 @@ RightTubules RightTubules RightNetTubules - - - - Nitrogen @@ -23962,10 +23618,6 @@ RightUreter RightUreter - - - - Nitrogen @@ -24229,10 +23881,6 @@ RightVentricle1 RightVentricle2 MainPulmonaryArteries - - - - Nitrogen @@ -24499,8 +24147,6 @@ SkinE3 SkinL1 SkinL2 - - Nitrogen @@ -24763,8 +24409,6 @@ SkinTissueIntracellular SkinI - - Nitrogen @@ -25028,10 +24672,6 @@ SkinVasculature Skin1 Skin2 - - - - Nitrogen @@ -25294,8 +24934,6 @@ SmallIntestineChyme SmallIntestineC1 - - Nitrogen @@ -25557,10 +25195,6 @@ SmallIntestineVasculature SmallIntestine1 - - - - Nitrogen @@ -25823,10 +25457,6 @@ SplanchnicVasculature Splanchnic1 - - - - Nitrogen @@ -26093,8 +25723,6 @@ SpleenE3 SpleenL1 SpleenL2 - - Nitrogen @@ -26357,8 +25985,6 @@ SpleenTissueIntracellular SpleenI - - Nitrogen @@ -26621,10 +26247,6 @@ SpleenVasculature Spleen1 - - - - Nitrogen @@ -26887,290 +26509,276 @@ Stomach Stomach - - - - Trachea Trachea - - - - Ureters RightUreter LeftUreter - - - - Nitrogen - - + + - - + + Oxygen - - + + - - + + + CarbonDioxide - - + + - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + VenaCava VenaCava - - - - Nitrogen @@ -27435,189 +27043,162 @@ AortaBleed Aorta Ground - AortaToBone Aorta1ToBone1 Aorta BoneVasculature - AortaToFat Aorta1ToFat1 Aorta FatVasculature - AortaToLargeIntestine Aorta1ToLargeIntestine Aorta LargeIntestineVasculature - AortaToLeftArm Aorta1ToLeftArm1 Aorta LeftArmVasculature - AortaToLeftKidney LeftAortaConnectionToRenalArtery Aorta LeftRenalArtery - AortaToLeftLeg Aorta1ToLeftLeg1 Aorta LeftLegVasculature - AortaToLiver Aorta1ToLiver1 Aorta LiverVasculature - AortaToMuscle Aorta1ToMuscle1 Aorta MuscleVasculature - AortaToMyocardium Aorta1ToMyocardium1 Aorta MyocardiumVasculature - AortaToNeckArteries Aorta1ToNeckArteries Aorta NeckArteries - AortaToRightArm Aorta1ToRightArm1 Aorta RightArmVasculature - AortaToRightKidney RightAortaConnectionToRenalArtery Aorta RightRenalArtery - AortaToRightLeg Aorta1ToRightLeg1 Aorta RightLegVasculature - AortaToSkin Aorta1ToSkin1 Aorta SkinVasculature - AortaToSmallIntestine Aorta1ToSmallIntestine Aorta SmallIntestineVasculature - AortaToSplanchnic Aorta1ToSplanchnic Aorta SplanchnicVasculature - AortaToSpleen Aorta1ToSpleen Aorta SpleenVasculature - BladderToGround BladderToGroundUrinate Bladder Ground - BladderToGroundSource BladderToGroundPressure Bladder Ground - BoneToVenaCava Bone2ToVenaCava BoneVasculature VenaCava - BrainHemorrhage BrainBleed CerebralCapillaries Ground - CerebralArteriesToCerebralCapillaries CerebralArteries2ToCapillaries CerebralArteries CerebralCapillaries - CerebralCapillariesToCerebralVeins CerebralCapillariesToCerebralVeins1 CerebralCapillaries CerebralVeins - CerebralVeinsToNeckVeins CerebralVeins2ToNeckVeins CerebralVeins NeckVeins - EnvironmentToLeftChestLeak EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -27630,266 +27211,228 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - FatToVenaCava Fat2ToVenaCava FatVasculature VenaCava - HeartHemorrhage MyocardiumBleed MyocardiumVasculature Ground - LargeIntestineHemorrhage LargeIntestineBleed LargeIntestineVasculature Ground - LargeIntestineToLiver LargeIntestineToPortalVein LargeIntestineVasculature LiverVasculature - LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArteriole LeftGlomerularCapillaries - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftArmHemorrhage LeftArmBleed LeftArmVasculature Ground - LeftArmToVenaCava LeftArm2ToVenaCava LeftArmVasculature VenaCava - LeftAtriumToLeftVentricle LeftAtrium2ToLeftVentricle1 LeftAtrium LeftVentricle - LeftBowmansCapsulesToTubules LeftBowmansCapsulesToTubules LeftBowmansCapsules LeftTubules - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArteriole LeftPeritubularCapillaries - LeftGlomerularCapillariesToBowmansCapsules LeftNetGlomerularCapillariesToNetBowmansCapsules LeftGlomerularCapillaries LeftBowmansCapsules - LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillaries LeftEfferentArteriole - LeftKidneyHemorrhage LeftKidneyBleed LeftRenalVein Ground - LeftKidneyToVenaCava LeftRenalVeinToVenaCavaConnection LeftRenalVein VenaCava - LeftLegHemorrhage LeftLegBleed LeftLegVasculature Ground - LeftLegToVenaCava LeftLeg2ToVenaCava LeftLegVasculature VenaCava - LeftLungHemorrhage LeftLungBleed LeftPulmonaryArteries Ground - LeftLungVascularToTissue LeftLungVToLeftLungE1 LeftLungVasculature LeftLungTissueExtracellular - LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillaries LeftRenalVein - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - LeftPulmonaryArteriesToCapillaries LeftPulmonaryArteriesToLeftPulmonaryCapillaries LeftPulmonaryArteries LeftPulmonaryCapillaries - LeftPulmonaryArteriesToVeins LeftPulmonaryArteriesToLeftPulmonaryVeins LeftPulmonaryArteries LeftPulmonaryVeins - LeftPulmonaryCapillariesToVeins LeftPulmonaryCapillariesToLeftPulmonaryVeins LeftPulmonaryCapillaries LeftPulmonaryVeins - LeftPulmonaryVeinsToLeftAtrium LeftIntermediatePulmonaryVeinsToLeftAtrium1 LeftPulmonaryVeins LeftAtrium - LeftRenalArteryToAfferentArteriole LeftRenalArteryToAfferentArteriole LeftRenalArtery LeftAfferentArteriole - LeftTubulesToPeritubularCapillaries LeftNetTubulesToNetPeritubularCapillaries LeftTubules LeftPeritubularCapillaries - LeftTubulesToUreter LeftTubulesToUreter LeftTubules LeftUreter - LeftUreterToBladder LeftUreterToBladder LeftUreter Bladder - LeftVentricleToAorta LeftVentricle1ToAorta2 LeftVentricle Aorta - LiverHemorrhage LiverBleed LiverVasculature Ground - LiverToVenaCava Liver2ToVenaCava LiverVasculature VenaCava - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -27902,315 +27445,270 @@ Muscle2ToVenaCava MuscleVasculature VenaCava - MyocardiumToVenaCava Myocardium2ToVenaCava MyocardiumVasculature VenaCava - NeckArteriesToCerebralArteries NeckArteriesToCerebralArteries1 NeckArteries CerebralArteries - NeckVeinsToVenaCava NeckVeinsToVenaCava NeckVeins VenaCava - RightAfferentArterioleToGlomerularCapillaries RightAfferentArterioleToGlomerularCapillaries RightAfferentArteriole RightGlomerularCapillaries - RightAlveoliLeakToRightPleuralCavity RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightArmHemorrhage RightArmBleed RightArmVasculature Ground - RightArmToVenaCava RightArm2ToVenaCava RightArmVasculature VenaCava - RightAtriumToRightVentricle RightAtrium2ToRightVentricle1 RightAtrium RightVentricle - RightBowmansCapsulesToTubules RightBowmansCapsulesToTubules RightBowmansCapsules RightTubules - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightEfferentArterioleToPeritubularCapillaries RightEfferentArterioleToPeritubularCapillaries RightEfferentArteriole RightPeritubularCapillaries - RightGlomerularCapillariesToBowmansCapsules RightNetGlomerularCapillariesToNetBowmansCapsules RightGlomerularCapillaries RightBowmansCapsules - RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillaries RightEfferentArteriole - RightKidneyHemorrhage RightKidneyBleed RightRenalVein Ground - RightKidneyToVenaCava RightRenalVeinToVenaCavaConnection RightRenalVein VenaCava - RightLegHemorrhage RightLegBleed RightLegVasculature Ground - RightLegToVenaCava RightLeg2ToVenaCava RightLegVasculature VenaCava - RightLungHemorrhage RightLungBleed RightPulmonaryArteries Ground - RightPeritubularCapillariesToRenalVein RightPeritubularCapillariesToRenalVein RightPeritubularCapillaries RightRenalVein - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - RightPulmonaryArteriesToCapillaries RightPulmonaryArteriesToRightPulmonaryCapillaries RightPulmonaryArteries RightPulmonaryCapillaries - RightPulmonaryArteriesToVeins RightPulmonaryArteriesToRightPulmonaryVeins RightPulmonaryArteries RightPulmonaryVeins - RightPulmonaryCapillariesToVeins RightPulmonaryCapillariesToRightPulmonaryVeins RightPulmonaryCapillaries RightPulmonaryVeins - RightPulmonaryVeinsToLeftAtrium RightIntermediatePulmonaryVeinsToLeftAtrium1 RightPulmonaryVeins LeftAtrium - RightRenalArteryToAfferentArteriole RightRenalArteryToAfferentArteriole RightRenalArtery RightAfferentArteriole - RightTubulesToPeritubularCapillaries RightNetTubulesToNetPeritubularCapillaries RightTubules RightPeritubularCapillaries - RightTubulesToUreter RightTubulesToUreter RightTubules RightUreter - RightUreterToBladder RightUreterToBladder RightUreter Bladder - RightVentricleToLeftPulmonaryArteries MainPulmonaryArteriesToLeftIntermediatePulmonaryArteries RightVentricle LeftPulmonaryArteries - RightVentricleToRightPulmonaryArteries MainPulmonaryArteriesToRightIntermediatePulmonaryArteries RightVentricle RightPulmonaryArteries - SkinToVenaCava Skin2ToVenaCava SkinVasculature VenaCava - SmallIntestineHemorrhage SmallIntestineBleed SmallIntestineVasculature Ground - SmallIntestineToLiver SmallIntestineToPortalVein SmallIntestineVasculature LiverVasculature - SplanchnicHemorrhage SplanchnicBleed SplanchnicVasculature Ground - SplanchnicToLiver SplanchnicToPortalVein SplanchnicVasculature LiverVasculature - SpleenHemorrhage SpleenBleed SpleenVasculature Ground - SpleenToLiver SpleenToPortalVein SpleenVasculature LiverVasculature - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VenaCavaHemorrhage VenaCavaBleed VenaCava Ground - VenaCavaIV IVToVenaCava Ground VenaCava - VenaCavaToRightAtrium VenaCavaToRightAtrium1 VenaCava RightAtrium - Nitrogen Oxygen @@ -28636,10 +28134,6 @@ Ambient Ambient - - - - Nitrogen @@ -28662,10 +28156,6 @@ AnesthesiaConnection AnesthesiaConnection - - - - Nitrogen @@ -28688,7 +28178,6 @@ Connection MechanicalVentilatorConnection - Nitrogen @@ -28711,10 +28200,6 @@ ExpiratoryLimb ExpiratoryLimb - - - - Nitrogen @@ -28737,10 +28222,6 @@ GasInlet GasInlet - - - - Nitrogen @@ -28763,10 +28244,6 @@ GasSource GasSource - - - - Nitrogen @@ -28789,10 +28266,6 @@ InspiratoryLimb InspiratoryLimb - - - - Nitrogen @@ -28815,10 +28288,6 @@ LeftAlveoli LeftAlveoli - - - - Nitrogen @@ -28841,9 +28310,6 @@ LeftAlveoliLeak LeftAlveoliLeak - - - Nitrogen @@ -28857,10 +28323,6 @@ LeftBronchi LeftBronchi - - - - Nitrogen @@ -28883,9 +28345,6 @@ LeftChestLeak LeftChestLeak - - - Nitrogen @@ -28900,37 +28359,31 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - Nitrogen @@ -28953,10 +28406,6 @@ Mouth Mouth - - - - Nitrogen @@ -28979,8 +28428,6 @@ Mouthpiece Mouthpiece - - Nitrogen @@ -29003,7 +28450,6 @@ Nosepiece Nosepiece - Nitrogen @@ -29026,7 +28472,6 @@ OxygenTank OxygenTank - Nitrogen @@ -29050,62 +28495,53 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + ReliefValve ReliefValve - - - Nitrogen @@ -29128,10 +28564,6 @@ RightAlveoli RightAlveoli - - - - Nitrogen @@ -29154,9 +28586,6 @@ RightAlveoliLeak RightAlveoliLeak - - - Nitrogen @@ -29170,10 +28599,6 @@ RightBronchi RightBronchi - - - - Nitrogen @@ -29196,9 +28621,6 @@ RightChestLeak RightChestLeak - - - Nitrogen @@ -29213,37 +28635,30 @@ RightLungPulmonary RightBronchi RightAlveoli - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - Nitrogen @@ -29266,10 +28681,6 @@ Scrubber Scrubber - - - - Nitrogen @@ -29292,10 +28703,6 @@ Selector Selector - - - - Nitrogen @@ -29318,10 +28725,6 @@ Stomach Stomach - - - - Nitrogen @@ -29344,10 +28747,6 @@ Trachea Trachea - - - - Nitrogen @@ -29371,10 +28770,6 @@ Ventilator Ventilator VentilatorConnection - - - - Nitrogen @@ -29418,10 +28813,6 @@ YPiece YPiece - - - - Nitrogen @@ -29446,7 +28837,6 @@ AnesthesiaConnectionToEnvironment AnesthesiaConnection Ambient - ConnectionToMouth @@ -29459,14 +28849,12 @@ EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -29485,98 +28873,84 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - Exhaust SelectorToEnvironment Selector Ambient - ExpiratoryLimbToSelector ExpiratoryLimbToSelector ExpiratoryLimb Selector - GasInletToInspiratoryLimb GasInletToInspiratoryLimb GasInlet InspiratoryLimb - GasSourceToGasInlet GasSourceToGasInlet GasSource GasInlet - InspiratoryLimbToYPiece InspiratoryLimbToYPiece InspiratoryLimb YPiece - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - Mask AnesthesiaConnectionToMouth AnesthesiaConnection Mouth - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -29607,91 +28981,78 @@ RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - ScrubberToGasInlet ScrubberToGasInlet Scrubber GasInlet - SelectorToReliefValve SelectorToReliefValve Selector ReliefValve - SelectorToScrubber SelectorToScrubber Selector Scrubber - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VentilatorToSelector VentilatorConnectionToSelector Ventilator Selector - YPieceToAnesthesiaConnection YPieceToAnesthesiaConnection YPiece AnesthesiaConnection - YPieceToExpiratoryLimb YPieceToExpiratoryLimb YPiece ExpiratoryLimb - Nitrogen Oxygen @@ -29925,477 +29286,364 @@ Active Active - - - Ambient Ambient - - - Clothing Clothing - - - Enclosure Enclosure - - - ExternalCore ExternalCore - - - ExternalGround ExternalGround - - - ExternalHeadSkin ExternalHeadSkin - - - ExternalLeftArmSkin ExternalLeftArmSkin - - - ExternalLeftLegSkin ExternalLeftLegSkin - - - ExternalRightArmSkin ExternalRightArmSkin - - - ExternalRightLegSkin ExternalRightLegSkin - - - ExternalTorsoSkin ExternalTorsoSkin - - - InternalCore InternalCore InternalGround - - - - InternalGround - - InternalHeadSkin InternalHeadSkin - - - - InternalLeftArmSkin InternalLeftArmSkin - - - - InternalLeftLegSkin InternalLeftLegSkin - - - - InternalRightArmSkin InternalRightArmSkin - - - - InternalRightLegSkin InternalRightLegSkin - - - - InternalTorsoSkin InternalTorsoSkin - - - - ActiveToClothing ActiveToClothing Active Clothing - ClothingToEnclosure ClothingToEnclosure Clothing Enclosure - ClothingToEnvironment ClothingToEnvironment Clothing Ambient - ExternalCoreToGround ExternalCoreToGround ExternalCore ExternalGround - ExternalHeadSkinToClothing ExternalHeadSkinToClothing ExternalHeadSkin Clothing - ExternalHeadSkinToGround ExternalHeadSkinToGround ExternalHeadSkin ExternalGround - ExternalLeftArmSkinToClothing ExternalLeftArmSkinToClothing ExternalLeftArmSkin Clothing - ExternalLeftArmSkinToGround ExternalLeftArmSkinToGround ExternalLeftArmSkin ExternalGround - ExternalLeftLegSkinToClothing ExternalLeftLegSkinToClothing ExternalLeftLegSkin Clothing - ExternalLeftLegSkinToGround ExternalLeftLegSkinToGround ExternalLeftLegSkin ExternalGround - ExternalRightArmSkinToClothing ExternalRightArmSkinToClothing ExternalRightArmSkin Clothing - ExternalRightArmSkinToGround ExternalRightArmSkinToGround ExternalRightArmSkin ExternalGround - ExternalRightLegSkinToClothing ExternalRightLegSkinToClothing ExternalRightLegSkin Clothing - ExternalRightLegSkinToGround ExternalRightLegSkinToGround ExternalRightLegSkin ExternalGround - ExternalTorsoSkinToClothing ExternalTorsoSkinToClothing ExternalTorsoSkin Clothing - ExternalTorsoSkinToGround ExternalTorsoSkinToGround ExternalTorsoSkin ExternalGround - GroundToActive GroundToActive ExternalGround Active - GroundToClothing GroundToClothing ExternalGround Clothing - GroundToEnclosure GroundToEnclosure ExternalGround Enclosure - GroundToEnvironment GroundToEnvironment ExternalGround Ambient - GroundToInternalCore GroundToInternalCore InternalGround InternalCore - GroundToInternalHeadSkin GroundToInternalHeadSkin InternalGround InternalHeadSkin - GroundToInternalLeftArmSkin GroundToInternalLeftArmSkin InternalGround InternalLeftArmSkin - GroundToInternalLeftLegSkin GroundToInternalLeftLegSkin InternalGround InternalLeftLegSkin - GroundToInternalRightArmSkin GroundToInternalRightArmSkin InternalGround InternalRightArmSkin - GroundToInternalRightLegSkin GroundToInternalRightLegSkin InternalGround InternalRightLegSkin - GroundToInternalTorsoSkin GroundToInternalTorsoSkin InternalGround InternalTorsoSkin - InternalCoreToExternalCore InternalCoreToExternalCore InternalCore ExternalCore - InternalCoreToGround InternalCoreToGround InternalGround InternalCore - InternalCoreToInternalHeadSkin InternalCoreToInternalHeadSkin InternalCore InternalHeadSkin - InternalCoreToInternalLeftArmSkin InternalCoreToInternalLeftArmSkin InternalCore InternalLeftArmSkin - InternalCoreToInternalLeftLegSkin InternalCoreToInternalLeftLegSkin InternalCore InternalLeftLegSkin - InternalCoreToInternalRightArmSkin InternalCoreToInternalRightArmSkin InternalCore InternalRightArmSkin - InternalCoreToInternalRightLegSkin InternalCoreToInternalRightLegSkin InternalCore InternalRightLegSkin - InternalCoreToInternalTorsoSkin InternalCoreToInternalTorsoSkin InternalCore InternalTorsoSkin - InternalHeadSkinToExternalHeadSkin InternalHeadSkinToExternalHeadSkin InternalHeadSkin ExternalHeadSkin - InternalHeadSkinToGround InternalHeadSkinToTemperatureGround InternalGround InternalHeadSkin - InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkin ExternalLeftArmSkin - InternalLeftArmSkinToGround InternalLeftArmSkinToTemperatureGround InternalGround InternalLeftArmSkin - InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkin ExternalLeftLegSkin - InternalLeftLegSkinToGround InternalLeftLegSkinToTemperatureGround InternalGround InternalLeftLegSkin - InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkin ExternalRightArmSkin - InternalRightArmSkinToGround InternalRightArmSkinToTemperatureGround InternalGround InternalRightArmSkin - InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkin ExternalRightLegSkin - InternalRightLegSkinToGround InternalRightLegSkinToTemperatureGround InternalGround InternalRightLegSkin - InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkin ExternalTorsoSkin - InternalTorsoSkinToGround InternalTorsoSkinToTemperatureGround InternalGround InternalTorsoSkin - BoneTissue @@ -30569,7 +29817,6 @@ - Off @@ -30978,7 +30225,6 @@ - @@ -31005,15 +30251,15 @@ On - + - + - + - + @@ -32360,7 +31606,6 @@ - Extrasplanchnic @@ -32371,7 +31616,6 @@ - Extrasplanchnic @@ -32392,7 +31636,6 @@ - Splanchnic @@ -32403,7 +31646,6 @@ - Extrasplanchnic @@ -32421,7 +31663,6 @@ - Extrasplanchnic @@ -32432,7 +31673,6 @@ - Splanchnic @@ -32443,7 +31683,6 @@ - Muscle @@ -32454,7 +31693,6 @@ - Myocardium @@ -32465,7 +31703,6 @@ - Cerebral @@ -32476,7 +31713,6 @@ - Extrasplanchnic @@ -32494,7 +31730,6 @@ - Extrasplanchnic @@ -32505,7 +31740,6 @@ - Extrasplanchnic @@ -32516,7 +31750,6 @@ - Splanchnic @@ -32527,7 +31760,6 @@ - Splanchnic @@ -32538,7 +31770,6 @@ - Splanchnic @@ -32596,7 +31827,6 @@ - Extrasplanchnic @@ -32829,7 +32059,6 @@ - Cerebral @@ -32850,7 +32079,6 @@ - Cerebral @@ -32871,7 +32099,6 @@ - Cerebral @@ -32985,7 +32212,6 @@ - Extrasplanchnic @@ -33268,7 +32494,6 @@ - Splanchnic @@ -33347,7 +32572,6 @@ - Extrasplanchnic @@ -33631,7 +32855,6 @@ - Extrasplanchnic @@ -34004,7 +33227,6 @@ - Splanchnic @@ -34209,7 +33431,6 @@ - Muscle @@ -34326,7 +33547,6 @@ - Myocardium @@ -34443,7 +33663,6 @@ - Cerebral @@ -34474,7 +33693,6 @@ - Cerebral @@ -34518,7 +33736,6 @@ - Splanchnic @@ -34592,7 +33809,6 @@ - Extrasplanchnic @@ -34876,7 +34092,6 @@ - Extrasplanchnic @@ -35288,7 +34503,6 @@ - Extrasplanchnic @@ -35435,7 +34649,6 @@ - Splanchnic @@ -35496,7 +34709,6 @@ - Splanchnic @@ -35616,7 +34828,6 @@ - Splanchnic diff --git a/share/data/states/Female_30_Normal@0s.xml b/share/data/states/Female_30_Normal@0s.xml index e014c06cb..9e0d1474f 100644 --- a/share/data/states/Female_30_Normal@0s.xml +++ b/share/data/states/Female_30_Normal@0s.xml @@ -1,5 +1,5 @@ - + Female_30_Normal @@ -177,7 +177,7 @@ - + @@ -313,7 +313,7 @@ - + @@ -363,7 +363,7 @@ - + @@ -386,7 +386,7 @@ - + @@ -419,7 +419,7 @@ - + @@ -444,7 +444,7 @@ - + @@ -467,7 +467,7 @@ - + @@ -515,7 +515,7 @@ - + @@ -571,7 +571,7 @@ - + @@ -594,7 +594,7 @@ - + @@ -619,7 +619,7 @@ - + @@ -632,7 +632,7 @@ Liquid - + @@ -644,7 +644,7 @@ - + @@ -685,7 +685,7 @@ - + @@ -912,7 +912,6 @@ - false true false @@ -1011,6 +1010,7 @@ + @@ -1160,16 +1160,13 @@ - - - @@ -1216,15 +1213,15 @@ false - + - - + + @@ -1237,9 +1234,9 @@ 59.4685081 27.8147067498513 - - - + + + @@ -1301,8 +1298,8 @@ - - + + @@ -1317,6 +1314,9 @@ 8 + + + @@ -1324,20 +1324,12 @@ Ambient Ambient - - - - Aorta Aorta1 Aorta2 Aorta3 - - - - Nitrogen @@ -1600,10 +1592,6 @@ Bladder Bladder - - - - Nitrogen @@ -1869,8 +1857,6 @@ BoneE3 BoneL1 BoneL2 - - Nitrogen @@ -2133,8 +2119,6 @@ BoneTissueIntracellular BoneI - - Nitrogen @@ -2398,10 +2382,6 @@ BoneVasculature Bone1 Bone2 - - - - Nitrogen @@ -2668,8 +2648,6 @@ BrainE3 BrainL1 BrainL2 - - Nitrogen @@ -2932,8 +2910,6 @@ BrainTissueIntracellular BrainI - - Nitrogen @@ -3198,276 +3174,269 @@ CerebralArteries CerebralCapillaries CerebralVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + CerebralArteries CerebralArteries1 CerebralArteries2 - - - - Nitrogen @@ -3730,10 +3699,6 @@ CerebralCapillaries CerebralCapillaries - - - - Nitrogen @@ -3996,8 +3961,6 @@ CerebralSpinalFluid SpinalFluid - - Nitrogen @@ -4261,10 +4224,6 @@ CerebralVeins1 CerebralVeins2 CerebralVeinsCheck - - - - Nitrogen @@ -4531,8 +4490,6 @@ FatE3 FatL1 FatL2 - - Nitrogen @@ -4795,8 +4752,6 @@ FatTissueIntracellular FatI - - Nitrogen @@ -5060,10 +5015,6 @@ FatVasculature Fat1 Fat2 - - - - Nitrogen @@ -5326,9 +5277,6 @@ Ground Ground - - - Nitrogen @@ -5449,8 +5397,6 @@ GutE3 GutL1 GutL2 - - Nitrogen @@ -5713,8 +5659,6 @@ GutTissueIntracellular GutI - - Nitrogen @@ -5979,266 +5923,263 @@ SplanchnicVasculature SmallIntestineVasculature LargeIntestineVasculature - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -6247,541 +6188,529 @@ LeftHeart RightHeart Pericardium - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + KidneyVasculature LeftKidneyVasculature RightKidneyVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LargeIntestineVasculature LargeIntestine1 - - - - Nitrogen @@ -7044,10 +6973,6 @@ LeftAfferentArteriole LeftAfferentArteriole - - - - Nitrogen @@ -7310,26 +7235,15 @@ LeftAlveoli LeftAlveoli - - - - LeftAlveoliLeak LeftAlveoliLeak - - - LeftArmVasculature LeftArm1 LeftArm2 - - - - Nitrogen @@ -7593,10 +7507,6 @@ LeftAtrium LeftAtrium1 LeftAtrium2 - - - - Nitrogen @@ -7860,10 +7770,6 @@ LeftBowmansCapsules LeftBowmansCapsules LeftNetBowmansCapsules - - - - Nitrogen @@ -8126,25 +8032,14 @@ LeftBronchi LeftBronchi - - - - LeftChestLeak LeftChestLeak - - - LeftEfferentArteriole LeftEfferentArteriole - - - - Nitrogen @@ -8408,10 +8303,6 @@ LeftGlomerularCapillaries LeftGlomerularCapillaries LeftNetGlomerularCapillaries - - - - Nitrogen @@ -8675,266 +8566,262 @@ LeftHeart LeftAtrium LeftVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -8944,8 +8831,6 @@ LeftKidneyE3 LeftKidneyL1 LeftKidneyL2 - - Nitrogen @@ -9208,8 +9093,6 @@ LeftKidneyTissueIntracellular LeftKidneyI - - Nitrogen @@ -9474,276 +9357,269 @@ LeftRenalArtery LeftNephron LeftRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftLegVasculature LeftLeg1 LeftLeg2 - - - - Nitrogen @@ -10007,10 +9883,6 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - - LeftLungTissueExtracellular @@ -10019,10 +9891,6 @@ LeftLungE3 LeftLungL1 LeftLungL2 - - - - Nitrogen @@ -10285,8 +10153,6 @@ LeftLungTissueIntracellular LeftLungI - - Nitrogen @@ -10551,266 +10417,263 @@ LeftPulmonaryArteries LeftPulmonaryCapillaries LeftPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -10821,276 +10684,269 @@ LeftPeritubularCapillaries LeftBowmansCapsules LeftTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftPeritubularCapillaries LeftPeritubularCapillaries LeftNetPeritubularCapillaries - - - - Nitrogen @@ -11354,19 +11210,11 @@ LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - LeftPulmonaryArteries LeftPulmonaryArteries LeftIntermediatePulmonaryArteries - - - - Nitrogen @@ -11629,10 +11477,6 @@ LeftPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen @@ -11895,10 +11739,6 @@ LeftPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen @@ -12161,10 +12001,6 @@ LeftRenalArtery LeftRenalArtery - - - - Nitrogen @@ -12427,10 +12263,6 @@ LeftRenalVein LeftRenalVein - - - - Nitrogen @@ -12694,10 +12526,6 @@ LeftTubules LeftTubules LeftNetTubules - - - - Nitrogen @@ -12960,10 +12788,6 @@ LeftUreter LeftUreter - - - - Nitrogen @@ -13226,10 +13050,6 @@ LeftVentricle LeftVentricle1 LeftVentricle2 - - - - Nitrogen @@ -13496,8 +13316,6 @@ LiverE3 LiverL1 LiverL2 - - Nitrogen @@ -13760,8 +13578,6 @@ LiverTissueIntracellular LiverI - - Nitrogen @@ -14027,9 +13843,6 @@ Liver2 PortalVein1 - - - Nitrogen @@ -14293,273 +14106,267 @@ LungsVasculature LeftLungVasculature RightLungVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + Lymph Lymph - - Nitrogen @@ -14821,16 +14628,10 @@ Mouth Mouth - - - - Mouthpiece Mouthpiece - - MuscleTissueExtracellular @@ -14839,8 +14640,6 @@ MuscleE3 MuscleL1 MuscleL2 - - Nitrogen @@ -15103,8 +14902,6 @@ MuscleTissueIntracellular MuscleI - - Nitrogen @@ -15368,10 +15165,6 @@ MuscleVasculature Muscle1 Muscle2 - - - - Nitrogen @@ -15638,8 +15431,6 @@ MyocardiumE3 MyocardiumL1 MyocardiumL2 - - Nitrogen @@ -15902,8 +15693,6 @@ MyocardiumTissueIntracellular MyocardiumI - - Nitrogen @@ -16167,10 +15956,6 @@ MyocardiumVasculature Myocardium1 Myocardium2 - - - - Nitrogen @@ -16433,10 +16218,6 @@ NeckArteries NeckArteries - - - - Nitrogen @@ -16699,10 +16480,6 @@ NeckVeins NeckVeins - - - - Nitrogen @@ -16965,8 +16742,6 @@ Pericardium Pericardium1 - - Nitrogen @@ -17230,825 +17005,801 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - PulmonaryArteries RightPulmonaryArteries LeftPulmonaryArteries - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryCapillaries RightPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - - PulmonaryVeins RightPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightAfferentArteriole RightAfferentArteriole - - - - Nitrogen @@ -18311,26 +18062,15 @@ RightAlveoli RightAlveoli - - - - RightAlveoliLeak RightAlveoliLeak - - - RightArmVasculature RightArm1 RightArm2 - - - - Nitrogen @@ -18594,10 +18334,6 @@ RightAtrium RightAtrium1 RightAtrium2 - - - - Nitrogen @@ -18861,10 +18597,6 @@ RightBowmansCapsules RightBowmansCapsules RightNetBowmansCapsules - - - - Nitrogen @@ -19127,25 +18859,14 @@ RightBronchi RightBronchi - - - - RightChestLeak RightChestLeak - - - RightEfferentArteriole RightEfferentArteriole - - - - Nitrogen @@ -19409,10 +19130,6 @@ RightGlomerularCapillaries RightGlomerularCapillaries RightNetGlomerularCapillaries - - - - Nitrogen @@ -19676,266 +19393,262 @@ RightHeart RightAtrium RightVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -19945,8 +19658,6 @@ RightKidneyE3 RightKidneyL1 RightKidneyL2 - - Nitrogen @@ -20209,8 +19920,6 @@ RightKidneyTissueIntracellular RightKidneyI - - Nitrogen @@ -20475,276 +20184,269 @@ RightRenalArtery RightNephron RightRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightLegVasculature RightLeg1 RightLeg2 - - - - Nitrogen @@ -21008,10 +20710,6 @@ RightLungPulmonary RightBronchi RightAlveoli - - - - RightLungTissueExtracellular @@ -21020,8 +20718,6 @@ RightLungE3 RightLungL1 RightLungL2 - - Nitrogen @@ -21284,8 +20980,6 @@ RightLungTissueIntracellular RightLungI - - Nitrogen @@ -21550,266 +21244,263 @@ RightPulmonaryArteries RightPulmonaryCapillaries RightPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -21820,276 +21511,269 @@ RightPeritubularCapillaries RightBowmansCapsules RightTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightPeritubularCapillaries RightPeritubularCapillaries RightNetPeritubularCapillaries - - - - Nitrogen @@ -22353,19 +22037,11 @@ RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - RightPulmonaryArteries RightPulmonaryArteries RightIntermediatePulmonaryArteries - - - - Nitrogen @@ -22628,10 +22304,6 @@ RightPulmonaryCapillaries RightPulmonaryCapillaries - - - - Nitrogen @@ -22894,10 +22566,6 @@ RightPulmonaryVeins RightPulmonaryVeins - - - - Nitrogen @@ -23160,10 +22828,6 @@ RightRenalArtery RightRenalArtery - - - - Nitrogen @@ -23426,10 +23090,6 @@ RightRenalVein RightRenalVein - - - - Nitrogen @@ -23693,10 +23353,6 @@ RightTubules RightTubules RightNetTubules - - - - Nitrogen @@ -23959,10 +23615,6 @@ RightUreter RightUreter - - - - Nitrogen @@ -24226,10 +23878,6 @@ RightVentricle1 RightVentricle2 MainPulmonaryArteries - - - - Nitrogen @@ -24496,8 +24144,6 @@ SkinE3 SkinL1 SkinL2 - - Nitrogen @@ -24760,8 +24406,6 @@ SkinTissueIntracellular SkinI - - Nitrogen @@ -25025,10 +24669,6 @@ SkinVasculature Skin1 Skin2 - - - - Nitrogen @@ -25291,8 +24931,6 @@ SmallIntestineChyme SmallIntestineC1 - - Nitrogen @@ -25554,10 +25192,6 @@ SmallIntestineVasculature SmallIntestine1 - - - - Nitrogen @@ -25820,10 +25454,6 @@ SplanchnicVasculature Splanchnic1 - - - - Nitrogen @@ -26090,8 +25720,6 @@ SpleenE3 SpleenL1 SpleenL2 - - Nitrogen @@ -26354,8 +25982,6 @@ SpleenTissueIntracellular SpleenI - - Nitrogen @@ -26618,10 +26244,6 @@ SpleenVasculature Spleen1 - - - - Nitrogen @@ -26884,290 +26506,276 @@ Stomach Stomach - - - - Trachea Trachea - - - - Ureters RightUreter LeftUreter - - - - Nitrogen - - + + - - + + Oxygen - - + + - - + + + CarbonDioxide - - + + - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + VenaCava VenaCava - - - - Nitrogen @@ -27432,189 +27040,162 @@ AortaBleed Aorta Ground - AortaToBone Aorta1ToBone1 Aorta BoneVasculature - AortaToFat Aorta1ToFat1 Aorta FatVasculature - AortaToLargeIntestine Aorta1ToLargeIntestine Aorta LargeIntestineVasculature - AortaToLeftArm Aorta1ToLeftArm1 Aorta LeftArmVasculature - AortaToLeftKidney LeftAortaConnectionToRenalArtery Aorta LeftRenalArtery - AortaToLeftLeg Aorta1ToLeftLeg1 Aorta LeftLegVasculature - AortaToLiver Aorta1ToLiver1 Aorta LiverVasculature - AortaToMuscle Aorta1ToMuscle1 Aorta MuscleVasculature - AortaToMyocardium Aorta1ToMyocardium1 Aorta MyocardiumVasculature - AortaToNeckArteries Aorta1ToNeckArteries Aorta NeckArteries - AortaToRightArm Aorta1ToRightArm1 Aorta RightArmVasculature - AortaToRightKidney RightAortaConnectionToRenalArtery Aorta RightRenalArtery - AortaToRightLeg Aorta1ToRightLeg1 Aorta RightLegVasculature - AortaToSkin Aorta1ToSkin1 Aorta SkinVasculature - AortaToSmallIntestine Aorta1ToSmallIntestine Aorta SmallIntestineVasculature - AortaToSplanchnic Aorta1ToSplanchnic Aorta SplanchnicVasculature - AortaToSpleen Aorta1ToSpleen Aorta SpleenVasculature - BladderToGround BladderToGroundUrinate Bladder Ground - BladderToGroundSource BladderToGroundPressure Bladder Ground - BoneToVenaCava Bone2ToVenaCava BoneVasculature VenaCava - BrainHemorrhage BrainBleed CerebralCapillaries Ground - CerebralArteriesToCerebralCapillaries CerebralArteries2ToCapillaries CerebralArteries CerebralCapillaries - CerebralCapillariesToCerebralVeins CerebralCapillariesToCerebralVeins1 CerebralCapillaries CerebralVeins - CerebralVeinsToNeckVeins CerebralVeins2ToNeckVeins CerebralVeins NeckVeins - EnvironmentToLeftChestLeak EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -27627,266 +27208,228 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - FatToVenaCava Fat2ToVenaCava FatVasculature VenaCava - HeartHemorrhage MyocardiumBleed MyocardiumVasculature Ground - LargeIntestineHemorrhage LargeIntestineBleed LargeIntestineVasculature Ground - LargeIntestineToLiver LargeIntestineToPortalVein LargeIntestineVasculature LiverVasculature - LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArteriole LeftGlomerularCapillaries - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftArmHemorrhage LeftArmBleed LeftArmVasculature Ground - LeftArmToVenaCava LeftArm2ToVenaCava LeftArmVasculature VenaCava - LeftAtriumToLeftVentricle LeftAtrium2ToLeftVentricle1 LeftAtrium LeftVentricle - LeftBowmansCapsulesToTubules LeftBowmansCapsulesToTubules LeftBowmansCapsules LeftTubules - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArteriole LeftPeritubularCapillaries - LeftGlomerularCapillariesToBowmansCapsules LeftNetGlomerularCapillariesToNetBowmansCapsules LeftGlomerularCapillaries LeftBowmansCapsules - LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillaries LeftEfferentArteriole - LeftKidneyHemorrhage LeftKidneyBleed LeftRenalVein Ground - LeftKidneyToVenaCava LeftRenalVeinToVenaCavaConnection LeftRenalVein VenaCava - LeftLegHemorrhage LeftLegBleed LeftLegVasculature Ground - LeftLegToVenaCava LeftLeg2ToVenaCava LeftLegVasculature VenaCava - LeftLungHemorrhage LeftLungBleed LeftPulmonaryArteries Ground - LeftLungVascularToTissue LeftLungVToLeftLungE1 LeftLungVasculature LeftLungTissueExtracellular - LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillaries LeftRenalVein - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - LeftPulmonaryArteriesToCapillaries LeftPulmonaryArteriesToLeftPulmonaryCapillaries LeftPulmonaryArteries LeftPulmonaryCapillaries - LeftPulmonaryArteriesToVeins LeftPulmonaryArteriesToLeftPulmonaryVeins LeftPulmonaryArteries LeftPulmonaryVeins - LeftPulmonaryCapillariesToVeins LeftPulmonaryCapillariesToLeftPulmonaryVeins LeftPulmonaryCapillaries LeftPulmonaryVeins - LeftPulmonaryVeinsToLeftAtrium LeftIntermediatePulmonaryVeinsToLeftAtrium1 LeftPulmonaryVeins LeftAtrium - LeftRenalArteryToAfferentArteriole LeftRenalArteryToAfferentArteriole LeftRenalArtery LeftAfferentArteriole - LeftTubulesToPeritubularCapillaries LeftNetTubulesToNetPeritubularCapillaries LeftTubules LeftPeritubularCapillaries - LeftTubulesToUreter LeftTubulesToUreter LeftTubules LeftUreter - LeftUreterToBladder LeftUreterToBladder LeftUreter Bladder - LeftVentricleToAorta LeftVentricle1ToAorta2 LeftVentricle Aorta - LiverHemorrhage LiverBleed LiverVasculature Ground - LiverToVenaCava Liver2ToVenaCava LiverVasculature VenaCava - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -27899,315 +27442,270 @@ Muscle2ToVenaCava MuscleVasculature VenaCava - MyocardiumToVenaCava Myocardium2ToVenaCava MyocardiumVasculature VenaCava - NeckArteriesToCerebralArteries NeckArteriesToCerebralArteries1 NeckArteries CerebralArteries - NeckVeinsToVenaCava NeckVeinsToVenaCava NeckVeins VenaCava - RightAfferentArterioleToGlomerularCapillaries RightAfferentArterioleToGlomerularCapillaries RightAfferentArteriole RightGlomerularCapillaries - RightAlveoliLeakToRightPleuralCavity RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightArmHemorrhage RightArmBleed RightArmVasculature Ground - RightArmToVenaCava RightArm2ToVenaCava RightArmVasculature VenaCava - RightAtriumToRightVentricle RightAtrium2ToRightVentricle1 RightAtrium RightVentricle - RightBowmansCapsulesToTubules RightBowmansCapsulesToTubules RightBowmansCapsules RightTubules - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightEfferentArterioleToPeritubularCapillaries RightEfferentArterioleToPeritubularCapillaries RightEfferentArteriole RightPeritubularCapillaries - RightGlomerularCapillariesToBowmansCapsules RightNetGlomerularCapillariesToNetBowmansCapsules RightGlomerularCapillaries RightBowmansCapsules - RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillaries RightEfferentArteriole - RightKidneyHemorrhage RightKidneyBleed RightRenalVein Ground - RightKidneyToVenaCava RightRenalVeinToVenaCavaConnection RightRenalVein VenaCava - RightLegHemorrhage RightLegBleed RightLegVasculature Ground - RightLegToVenaCava RightLeg2ToVenaCava RightLegVasculature VenaCava - RightLungHemorrhage RightLungBleed RightPulmonaryArteries Ground - RightPeritubularCapillariesToRenalVein RightPeritubularCapillariesToRenalVein RightPeritubularCapillaries RightRenalVein - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - RightPulmonaryArteriesToCapillaries RightPulmonaryArteriesToRightPulmonaryCapillaries RightPulmonaryArteries RightPulmonaryCapillaries - RightPulmonaryArteriesToVeins RightPulmonaryArteriesToRightPulmonaryVeins RightPulmonaryArteries RightPulmonaryVeins - RightPulmonaryCapillariesToVeins RightPulmonaryCapillariesToRightPulmonaryVeins RightPulmonaryCapillaries RightPulmonaryVeins - RightPulmonaryVeinsToLeftAtrium RightIntermediatePulmonaryVeinsToLeftAtrium1 RightPulmonaryVeins LeftAtrium - RightRenalArteryToAfferentArteriole RightRenalArteryToAfferentArteriole RightRenalArtery RightAfferentArteriole - RightTubulesToPeritubularCapillaries RightNetTubulesToNetPeritubularCapillaries RightTubules RightPeritubularCapillaries - RightTubulesToUreter RightTubulesToUreter RightTubules RightUreter - RightUreterToBladder RightUreterToBladder RightUreter Bladder - RightVentricleToLeftPulmonaryArteries MainPulmonaryArteriesToLeftIntermediatePulmonaryArteries RightVentricle LeftPulmonaryArteries - RightVentricleToRightPulmonaryArteries MainPulmonaryArteriesToRightIntermediatePulmonaryArteries RightVentricle RightPulmonaryArteries - SkinToVenaCava Skin2ToVenaCava SkinVasculature VenaCava - SmallIntestineHemorrhage SmallIntestineBleed SmallIntestineVasculature Ground - SmallIntestineToLiver SmallIntestineToPortalVein SmallIntestineVasculature LiverVasculature - SplanchnicHemorrhage SplanchnicBleed SplanchnicVasculature Ground - SplanchnicToLiver SplanchnicToPortalVein SplanchnicVasculature LiverVasculature - SpleenHemorrhage SpleenBleed SpleenVasculature Ground - SpleenToLiver SpleenToPortalVein SpleenVasculature LiverVasculature - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VenaCavaHemorrhage VenaCavaBleed VenaCava Ground - VenaCavaIV IVToVenaCava Ground VenaCava - VenaCavaToRightAtrium VenaCavaToRightAtrium1 VenaCava RightAtrium - Nitrogen Oxygen @@ -28633,10 +28131,6 @@ Ambient Ambient - - - - Nitrogen @@ -28659,10 +28153,6 @@ AnesthesiaConnection AnesthesiaConnection - - - - Nitrogen @@ -28685,7 +28175,6 @@ Connection MechanicalVentilatorConnection - Nitrogen @@ -28708,10 +28197,6 @@ ExpiratoryLimb ExpiratoryLimb - - - - Nitrogen @@ -28734,10 +28219,6 @@ GasInlet GasInlet - - - - Nitrogen @@ -28760,10 +28241,6 @@ GasSource GasSource - - - - Nitrogen @@ -28786,10 +28263,6 @@ InspiratoryLimb InspiratoryLimb - - - - Nitrogen @@ -28812,10 +28285,6 @@ LeftAlveoli LeftAlveoli - - - - Nitrogen @@ -28838,9 +28307,6 @@ LeftAlveoliLeak LeftAlveoliLeak - - - Nitrogen @@ -28854,10 +28320,6 @@ LeftBronchi LeftBronchi - - - - Nitrogen @@ -28880,9 +28342,6 @@ LeftChestLeak LeftChestLeak - - - Nitrogen @@ -28897,37 +28356,31 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - Nitrogen @@ -28950,10 +28403,6 @@ Mouth Mouth - - - - Nitrogen @@ -28976,8 +28425,6 @@ Mouthpiece Mouthpiece - - Nitrogen @@ -29000,7 +28447,6 @@ Nosepiece Nosepiece - Nitrogen @@ -29023,7 +28469,6 @@ OxygenTank OxygenTank - Nitrogen @@ -29047,62 +28492,53 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + ReliefValve ReliefValve - - - Nitrogen @@ -29125,10 +28561,6 @@ RightAlveoli RightAlveoli - - - - Nitrogen @@ -29151,9 +28583,6 @@ RightAlveoliLeak RightAlveoliLeak - - - Nitrogen @@ -29167,10 +28596,6 @@ RightBronchi RightBronchi - - - - Nitrogen @@ -29193,9 +28618,6 @@ RightChestLeak RightChestLeak - - - Nitrogen @@ -29210,37 +28632,30 @@ RightLungPulmonary RightBronchi RightAlveoli - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - Nitrogen @@ -29263,10 +28678,6 @@ Scrubber Scrubber - - - - Nitrogen @@ -29289,10 +28700,6 @@ Selector Selector - - - - Nitrogen @@ -29315,10 +28722,6 @@ Stomach Stomach - - - - Nitrogen @@ -29341,10 +28744,6 @@ Trachea Trachea - - - - Nitrogen @@ -29368,10 +28767,6 @@ Ventilator Ventilator VentilatorConnection - - - - Nitrogen @@ -29415,10 +28810,6 @@ YPiece YPiece - - - - Nitrogen @@ -29443,7 +28834,6 @@ AnesthesiaConnectionToEnvironment AnesthesiaConnection Ambient - ConnectionToMouth @@ -29456,14 +28846,12 @@ EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -29482,98 +28870,84 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - Exhaust SelectorToEnvironment Selector Ambient - ExpiratoryLimbToSelector ExpiratoryLimbToSelector ExpiratoryLimb Selector - GasInletToInspiratoryLimb GasInletToInspiratoryLimb GasInlet InspiratoryLimb - GasSourceToGasInlet GasSourceToGasInlet GasSource GasInlet - InspiratoryLimbToYPiece InspiratoryLimbToYPiece InspiratoryLimb YPiece - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - Mask AnesthesiaConnectionToMouth AnesthesiaConnection Mouth - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -29604,91 +28978,78 @@ RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - ScrubberToGasInlet ScrubberToGasInlet Scrubber GasInlet - SelectorToReliefValve SelectorToReliefValve Selector ReliefValve - SelectorToScrubber SelectorToScrubber Selector Scrubber - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VentilatorToSelector VentilatorConnectionToSelector Ventilator Selector - YPieceToAnesthesiaConnection YPieceToAnesthesiaConnection YPiece AnesthesiaConnection - YPieceToExpiratoryLimb YPieceToExpiratoryLimb YPiece ExpiratoryLimb - Nitrogen Oxygen @@ -29922,477 +29283,364 @@ Active Active - - - Ambient Ambient - - - Clothing Clothing - - - Enclosure Enclosure - - - ExternalCore ExternalCore - - - ExternalGround ExternalGround - - - ExternalHeadSkin ExternalHeadSkin - - - ExternalLeftArmSkin ExternalLeftArmSkin - - - ExternalLeftLegSkin ExternalLeftLegSkin - - - ExternalRightArmSkin ExternalRightArmSkin - - - ExternalRightLegSkin ExternalRightLegSkin - - - ExternalTorsoSkin ExternalTorsoSkin - - - InternalCore InternalCore InternalGround - - - - InternalGround - - InternalHeadSkin InternalHeadSkin - - - - InternalLeftArmSkin InternalLeftArmSkin - - - - InternalLeftLegSkin InternalLeftLegSkin - - - - InternalRightArmSkin InternalRightArmSkin - - - - InternalRightLegSkin InternalRightLegSkin - - - - InternalTorsoSkin InternalTorsoSkin - - - - ActiveToClothing ActiveToClothing Active Clothing - ClothingToEnclosure ClothingToEnclosure Clothing Enclosure - ClothingToEnvironment ClothingToEnvironment Clothing Ambient - ExternalCoreToGround ExternalCoreToGround ExternalCore ExternalGround - ExternalHeadSkinToClothing ExternalHeadSkinToClothing ExternalHeadSkin Clothing - ExternalHeadSkinToGround ExternalHeadSkinToGround ExternalHeadSkin ExternalGround - ExternalLeftArmSkinToClothing ExternalLeftArmSkinToClothing ExternalLeftArmSkin Clothing - ExternalLeftArmSkinToGround ExternalLeftArmSkinToGround ExternalLeftArmSkin ExternalGround - ExternalLeftLegSkinToClothing ExternalLeftLegSkinToClothing ExternalLeftLegSkin Clothing - ExternalLeftLegSkinToGround ExternalLeftLegSkinToGround ExternalLeftLegSkin ExternalGround - ExternalRightArmSkinToClothing ExternalRightArmSkinToClothing ExternalRightArmSkin Clothing - ExternalRightArmSkinToGround ExternalRightArmSkinToGround ExternalRightArmSkin ExternalGround - ExternalRightLegSkinToClothing ExternalRightLegSkinToClothing ExternalRightLegSkin Clothing - ExternalRightLegSkinToGround ExternalRightLegSkinToGround ExternalRightLegSkin ExternalGround - ExternalTorsoSkinToClothing ExternalTorsoSkinToClothing ExternalTorsoSkin Clothing - ExternalTorsoSkinToGround ExternalTorsoSkinToGround ExternalTorsoSkin ExternalGround - GroundToActive GroundToActive ExternalGround Active - GroundToClothing GroundToClothing ExternalGround Clothing - GroundToEnclosure GroundToEnclosure ExternalGround Enclosure - GroundToEnvironment GroundToEnvironment ExternalGround Ambient - GroundToInternalCore GroundToInternalCore InternalGround InternalCore - GroundToInternalHeadSkin GroundToInternalHeadSkin InternalGround InternalHeadSkin - GroundToInternalLeftArmSkin GroundToInternalLeftArmSkin InternalGround InternalLeftArmSkin - GroundToInternalLeftLegSkin GroundToInternalLeftLegSkin InternalGround InternalLeftLegSkin - GroundToInternalRightArmSkin GroundToInternalRightArmSkin InternalGround InternalRightArmSkin - GroundToInternalRightLegSkin GroundToInternalRightLegSkin InternalGround InternalRightLegSkin - GroundToInternalTorsoSkin GroundToInternalTorsoSkin InternalGround InternalTorsoSkin - InternalCoreToExternalCore InternalCoreToExternalCore InternalCore ExternalCore - InternalCoreToGround InternalCoreToGround InternalGround InternalCore - InternalCoreToInternalHeadSkin InternalCoreToInternalHeadSkin InternalCore InternalHeadSkin - InternalCoreToInternalLeftArmSkin InternalCoreToInternalLeftArmSkin InternalCore InternalLeftArmSkin - InternalCoreToInternalLeftLegSkin InternalCoreToInternalLeftLegSkin InternalCore InternalLeftLegSkin - InternalCoreToInternalRightArmSkin InternalCoreToInternalRightArmSkin InternalCore InternalRightArmSkin - InternalCoreToInternalRightLegSkin InternalCoreToInternalRightLegSkin InternalCore InternalRightLegSkin - InternalCoreToInternalTorsoSkin InternalCoreToInternalTorsoSkin InternalCore InternalTorsoSkin - InternalHeadSkinToExternalHeadSkin InternalHeadSkinToExternalHeadSkin InternalHeadSkin ExternalHeadSkin - InternalHeadSkinToGround InternalHeadSkinToTemperatureGround InternalGround InternalHeadSkin - InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkin ExternalLeftArmSkin - InternalLeftArmSkinToGround InternalLeftArmSkinToTemperatureGround InternalGround InternalLeftArmSkin - InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkin ExternalLeftLegSkin - InternalLeftLegSkinToGround InternalLeftLegSkinToTemperatureGround InternalGround InternalLeftLegSkin - InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkin ExternalRightArmSkin - InternalRightArmSkinToGround InternalRightArmSkinToTemperatureGround InternalGround InternalRightArmSkin - InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkin ExternalRightLegSkin - InternalRightLegSkinToGround InternalRightLegSkinToTemperatureGround InternalGround InternalRightLegSkin - InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkin ExternalTorsoSkin - InternalTorsoSkinToGround InternalTorsoSkinToTemperatureGround InternalGround InternalTorsoSkin - BoneTissue @@ -30566,7 +29814,6 @@ - Off @@ -30975,7 +30222,6 @@ - @@ -31002,15 +30248,15 @@ On - + - + - + - + @@ -32357,7 +31603,6 @@ - Extrasplanchnic @@ -32368,7 +31613,6 @@ - Extrasplanchnic @@ -32389,7 +31633,6 @@ - Splanchnic @@ -32400,7 +31643,6 @@ - Extrasplanchnic @@ -32418,7 +31660,6 @@ - Extrasplanchnic @@ -32429,7 +31670,6 @@ - Splanchnic @@ -32440,7 +31680,6 @@ - Muscle @@ -32451,7 +31690,6 @@ - Myocardium @@ -32462,7 +31700,6 @@ - Cerebral @@ -32473,7 +31710,6 @@ - Extrasplanchnic @@ -32491,7 +31727,6 @@ - Extrasplanchnic @@ -32502,7 +31737,6 @@ - Extrasplanchnic @@ -32513,7 +31747,6 @@ - Splanchnic @@ -32524,7 +31757,6 @@ - Splanchnic @@ -32535,7 +31767,6 @@ - Splanchnic @@ -32593,7 +31824,6 @@ - Extrasplanchnic @@ -32826,7 +32056,6 @@ - Cerebral @@ -32847,7 +32076,6 @@ - Cerebral @@ -32868,7 +32096,6 @@ - Cerebral @@ -32982,7 +32209,6 @@ - Extrasplanchnic @@ -33265,7 +32491,6 @@ - Splanchnic @@ -33344,7 +32569,6 @@ - Extrasplanchnic @@ -33628,7 +32852,6 @@ - Extrasplanchnic @@ -34001,7 +33224,6 @@ - Splanchnic @@ -34206,7 +33428,6 @@ - Muscle @@ -34323,7 +33544,6 @@ - Myocardium @@ -34440,7 +33660,6 @@ - Cerebral @@ -34471,7 +33690,6 @@ - Cerebral @@ -34515,7 +33733,6 @@ - Splanchnic @@ -34589,7 +33806,6 @@ - Extrasplanchnic @@ -34873,7 +34089,6 @@ - Extrasplanchnic @@ -35285,7 +34500,6 @@ - Extrasplanchnic @@ -35432,7 +34646,6 @@ - Splanchnic @@ -35493,7 +34706,6 @@ - Splanchnic @@ -35613,7 +34825,6 @@ - Splanchnic diff --git a/share/data/states/Female_40_Overweight@0s.xml b/share/data/states/Female_40_Overweight@0s.xml index 74dd3a686..5890964d5 100644 --- a/share/data/states/Female_40_Overweight@0s.xml +++ b/share/data/states/Female_40_Overweight@0s.xml @@ -1,5 +1,5 @@ - + Female_40_Overweight @@ -177,7 +177,7 @@ - + @@ -313,7 +313,7 @@ - + @@ -363,7 +363,7 @@ - + @@ -376,7 +376,7 @@ - + @@ -386,7 +386,7 @@ - + @@ -419,7 +419,7 @@ - + @@ -444,7 +444,7 @@ - + @@ -467,7 +467,7 @@ - + @@ -515,7 +515,7 @@ - + @@ -571,7 +571,7 @@ - + @@ -594,7 +594,7 @@ - + @@ -619,7 +619,7 @@ - + @@ -632,7 +632,7 @@ Liquid - + @@ -644,7 +644,7 @@ - + @@ -685,7 +685,7 @@ - + @@ -912,7 +912,6 @@ - false false false @@ -1011,6 +1010,7 @@ + @@ -1160,16 +1160,13 @@ - - - @@ -1216,15 +1213,15 @@ false - + - - + + @@ -1237,9 +1234,9 @@ 73.0762792 32.5184347109369 - - - + + + @@ -1301,8 +1298,8 @@ - - + + @@ -1317,6 +1314,9 @@ 3 + + + @@ -1324,20 +1324,12 @@ Ambient Ambient - - - - Aorta Aorta1 Aorta2 Aorta3 - - - - Nitrogen @@ -1600,10 +1592,6 @@ Bladder Bladder - - - - Nitrogen @@ -1869,8 +1857,6 @@ BoneE3 BoneL1 BoneL2 - - Nitrogen @@ -2133,8 +2119,6 @@ BoneTissueIntracellular BoneI - - Nitrogen @@ -2398,10 +2382,6 @@ BoneVasculature Bone1 Bone2 - - - - Nitrogen @@ -2668,8 +2648,6 @@ BrainE3 BrainL1 BrainL2 - - Nitrogen @@ -2932,8 +2910,6 @@ BrainTissueIntracellular BrainI - - Nitrogen @@ -3198,276 +3174,269 @@ CerebralArteries CerebralCapillaries CerebralVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + CerebralArteries CerebralArteries1 CerebralArteries2 - - - - Nitrogen @@ -3730,10 +3699,6 @@ CerebralCapillaries CerebralCapillaries - - - - Nitrogen @@ -3996,8 +3961,6 @@ CerebralSpinalFluid SpinalFluid - - Nitrogen @@ -4261,10 +4224,6 @@ CerebralVeins1 CerebralVeins2 CerebralVeinsCheck - - - - Nitrogen @@ -4531,8 +4490,6 @@ FatE3 FatL1 FatL2 - - Nitrogen @@ -4795,8 +4752,6 @@ FatTissueIntracellular FatI - - Nitrogen @@ -5060,10 +5015,6 @@ FatVasculature Fat1 Fat2 - - - - Nitrogen @@ -5326,9 +5277,6 @@ Ground Ground - - - Nitrogen @@ -5449,8 +5397,6 @@ GutE3 GutL1 GutL2 - - Nitrogen @@ -5713,8 +5659,6 @@ GutTissueIntracellular GutI - - Nitrogen @@ -5979,266 +5923,263 @@ SplanchnicVasculature SmallIntestineVasculature LargeIntestineVasculature - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -6247,541 +6188,529 @@ LeftHeart RightHeart Pericardium - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + KidneyVasculature LeftKidneyVasculature RightKidneyVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LargeIntestineVasculature LargeIntestine1 - - - - Nitrogen @@ -7044,10 +6973,6 @@ LeftAfferentArteriole LeftAfferentArteriole - - - - Nitrogen @@ -7310,26 +7235,15 @@ LeftAlveoli LeftAlveoli - - - - LeftAlveoliLeak LeftAlveoliLeak - - - LeftArmVasculature LeftArm1 LeftArm2 - - - - Nitrogen @@ -7593,10 +7507,6 @@ LeftAtrium LeftAtrium1 LeftAtrium2 - - - - Nitrogen @@ -7860,10 +7770,6 @@ LeftBowmansCapsules LeftBowmansCapsules LeftNetBowmansCapsules - - - - Nitrogen @@ -8126,25 +8032,14 @@ LeftBronchi LeftBronchi - - - - LeftChestLeak LeftChestLeak - - - LeftEfferentArteriole LeftEfferentArteriole - - - - Nitrogen @@ -8408,10 +8303,6 @@ LeftGlomerularCapillaries LeftGlomerularCapillaries LeftNetGlomerularCapillaries - - - - Nitrogen @@ -8675,266 +8566,262 @@ LeftHeart LeftAtrium LeftVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -8944,8 +8831,6 @@ LeftKidneyE3 LeftKidneyL1 LeftKidneyL2 - - Nitrogen @@ -9208,8 +9093,6 @@ LeftKidneyTissueIntracellular LeftKidneyI - - Nitrogen @@ -9474,276 +9357,269 @@ LeftRenalArtery LeftNephron LeftRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftLegVasculature LeftLeg1 LeftLeg2 - - - - Nitrogen @@ -10007,10 +9883,6 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - - LeftLungTissueExtracellular @@ -10019,10 +9891,6 @@ LeftLungE3 LeftLungL1 LeftLungL2 - - - - Nitrogen @@ -10285,8 +10153,6 @@ LeftLungTissueIntracellular LeftLungI - - Nitrogen @@ -10551,266 +10417,263 @@ LeftPulmonaryArteries LeftPulmonaryCapillaries LeftPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -10821,276 +10684,269 @@ LeftPeritubularCapillaries LeftBowmansCapsules LeftTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftPeritubularCapillaries LeftPeritubularCapillaries LeftNetPeritubularCapillaries - - - - Nitrogen @@ -11354,19 +11210,11 @@ LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - LeftPulmonaryArteries LeftPulmonaryArteries LeftIntermediatePulmonaryArteries - - - - Nitrogen @@ -11629,10 +11477,6 @@ LeftPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen @@ -11895,10 +11739,6 @@ LeftPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen @@ -12161,10 +12001,6 @@ LeftRenalArtery LeftRenalArtery - - - - Nitrogen @@ -12427,10 +12263,6 @@ LeftRenalVein LeftRenalVein - - - - Nitrogen @@ -12694,10 +12526,6 @@ LeftTubules LeftTubules LeftNetTubules - - - - Nitrogen @@ -12960,10 +12788,6 @@ LeftUreter LeftUreter - - - - Nitrogen @@ -13226,10 +13050,6 @@ LeftVentricle LeftVentricle1 LeftVentricle2 - - - - Nitrogen @@ -13496,8 +13316,6 @@ LiverE3 LiverL1 LiverL2 - - Nitrogen @@ -13760,8 +13578,6 @@ LiverTissueIntracellular LiverI - - Nitrogen @@ -14027,9 +13843,6 @@ Liver2 PortalVein1 - - - Nitrogen @@ -14293,273 +14106,267 @@ LungsVasculature LeftLungVasculature RightLungVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + Lymph Lymph - - Nitrogen @@ -14821,16 +14628,10 @@ Mouth Mouth - - - - Mouthpiece Mouthpiece - - MuscleTissueExtracellular @@ -14839,8 +14640,6 @@ MuscleE3 MuscleL1 MuscleL2 - - Nitrogen @@ -15103,8 +14902,6 @@ MuscleTissueIntracellular MuscleI - - Nitrogen @@ -15368,10 +15165,6 @@ MuscleVasculature Muscle1 Muscle2 - - - - Nitrogen @@ -15638,8 +15431,6 @@ MyocardiumE3 MyocardiumL1 MyocardiumL2 - - Nitrogen @@ -15902,8 +15693,6 @@ MyocardiumTissueIntracellular MyocardiumI - - Nitrogen @@ -16167,10 +15956,6 @@ MyocardiumVasculature Myocardium1 Myocardium2 - - - - Nitrogen @@ -16433,10 +16218,6 @@ NeckArteries NeckArteries - - - - Nitrogen @@ -16699,10 +16480,6 @@ NeckVeins NeckVeins - - - - Nitrogen @@ -16965,8 +16742,6 @@ Pericardium Pericardium1 - - Nitrogen @@ -17230,825 +17005,801 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - PulmonaryArteries RightPulmonaryArteries LeftPulmonaryArteries - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryCapillaries RightPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - - PulmonaryVeins RightPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightAfferentArteriole RightAfferentArteriole - - - - Nitrogen @@ -18311,26 +18062,15 @@ RightAlveoli RightAlveoli - - - - RightAlveoliLeak RightAlveoliLeak - - - RightArmVasculature RightArm1 RightArm2 - - - - Nitrogen @@ -18594,10 +18334,6 @@ RightAtrium RightAtrium1 RightAtrium2 - - - - Nitrogen @@ -18861,10 +18597,6 @@ RightBowmansCapsules RightBowmansCapsules RightNetBowmansCapsules - - - - Nitrogen @@ -19127,25 +18859,14 @@ RightBronchi RightBronchi - - - - RightChestLeak RightChestLeak - - - RightEfferentArteriole RightEfferentArteriole - - - - Nitrogen @@ -19409,10 +19130,6 @@ RightGlomerularCapillaries RightGlomerularCapillaries RightNetGlomerularCapillaries - - - - Nitrogen @@ -19676,266 +19393,262 @@ RightHeart RightAtrium RightVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -19945,8 +19658,6 @@ RightKidneyE3 RightKidneyL1 RightKidneyL2 - - Nitrogen @@ -20209,8 +19920,6 @@ RightKidneyTissueIntracellular RightKidneyI - - Nitrogen @@ -20475,276 +20184,269 @@ RightRenalArtery RightNephron RightRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightLegVasculature RightLeg1 RightLeg2 - - - - Nitrogen @@ -21008,10 +20710,6 @@ RightLungPulmonary RightBronchi RightAlveoli - - - - RightLungTissueExtracellular @@ -21020,8 +20718,6 @@ RightLungE3 RightLungL1 RightLungL2 - - Nitrogen @@ -21284,8 +20980,6 @@ RightLungTissueIntracellular RightLungI - - Nitrogen @@ -21550,266 +21244,263 @@ RightPulmonaryArteries RightPulmonaryCapillaries RightPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -21820,276 +21511,269 @@ RightPeritubularCapillaries RightBowmansCapsules RightTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightPeritubularCapillaries RightPeritubularCapillaries RightNetPeritubularCapillaries - - - - Nitrogen @@ -22353,19 +22037,11 @@ RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - RightPulmonaryArteries RightPulmonaryArteries RightIntermediatePulmonaryArteries - - - - Nitrogen @@ -22628,10 +22304,6 @@ RightPulmonaryCapillaries RightPulmonaryCapillaries - - - - Nitrogen @@ -22894,10 +22566,6 @@ RightPulmonaryVeins RightPulmonaryVeins - - - - Nitrogen @@ -23160,10 +22828,6 @@ RightRenalArtery RightRenalArtery - - - - Nitrogen @@ -23426,10 +23090,6 @@ RightRenalVein RightRenalVein - - - - Nitrogen @@ -23693,10 +23353,6 @@ RightTubules RightTubules RightNetTubules - - - - Nitrogen @@ -23959,10 +23615,6 @@ RightUreter RightUreter - - - - Nitrogen @@ -24226,10 +23878,6 @@ RightVentricle1 RightVentricle2 MainPulmonaryArteries - - - - Nitrogen @@ -24496,8 +24144,6 @@ SkinE3 SkinL1 SkinL2 - - Nitrogen @@ -24760,8 +24406,6 @@ SkinTissueIntracellular SkinI - - Nitrogen @@ -25025,10 +24669,6 @@ SkinVasculature Skin1 Skin2 - - - - Nitrogen @@ -25291,8 +24931,6 @@ SmallIntestineChyme SmallIntestineC1 - - Nitrogen @@ -25554,10 +25192,6 @@ SmallIntestineVasculature SmallIntestine1 - - - - Nitrogen @@ -25820,10 +25454,6 @@ SplanchnicVasculature Splanchnic1 - - - - Nitrogen @@ -26090,8 +25720,6 @@ SpleenE3 SpleenL1 SpleenL2 - - Nitrogen @@ -26354,8 +25982,6 @@ SpleenTissueIntracellular SpleenI - - Nitrogen @@ -26618,10 +26244,6 @@ SpleenVasculature Spleen1 - - - - Nitrogen @@ -26884,290 +26506,276 @@ Stomach Stomach - - - - Trachea Trachea - - - - Ureters RightUreter LeftUreter - - - - Nitrogen - - + + - - + + Oxygen - - + + - - + + + CarbonDioxide - - + + - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + VenaCava VenaCava - - - - Nitrogen @@ -27432,189 +27040,162 @@ AortaBleed Aorta Ground - AortaToBone Aorta1ToBone1 Aorta BoneVasculature - AortaToFat Aorta1ToFat1 Aorta FatVasculature - AortaToLargeIntestine Aorta1ToLargeIntestine Aorta LargeIntestineVasculature - AortaToLeftArm Aorta1ToLeftArm1 Aorta LeftArmVasculature - AortaToLeftKidney LeftAortaConnectionToRenalArtery Aorta LeftRenalArtery - AortaToLeftLeg Aorta1ToLeftLeg1 Aorta LeftLegVasculature - AortaToLiver Aorta1ToLiver1 Aorta LiverVasculature - AortaToMuscle Aorta1ToMuscle1 Aorta MuscleVasculature - AortaToMyocardium Aorta1ToMyocardium1 Aorta MyocardiumVasculature - AortaToNeckArteries Aorta1ToNeckArteries Aorta NeckArteries - AortaToRightArm Aorta1ToRightArm1 Aorta RightArmVasculature - AortaToRightKidney RightAortaConnectionToRenalArtery Aorta RightRenalArtery - AortaToRightLeg Aorta1ToRightLeg1 Aorta RightLegVasculature - AortaToSkin Aorta1ToSkin1 Aorta SkinVasculature - AortaToSmallIntestine Aorta1ToSmallIntestine Aorta SmallIntestineVasculature - AortaToSplanchnic Aorta1ToSplanchnic Aorta SplanchnicVasculature - AortaToSpleen Aorta1ToSpleen Aorta SpleenVasculature - BladderToGround BladderToGroundUrinate Bladder Ground - BladderToGroundSource BladderToGroundPressure Bladder Ground - BoneToVenaCava Bone2ToVenaCava BoneVasculature VenaCava - BrainHemorrhage BrainBleed CerebralCapillaries Ground - CerebralArteriesToCerebralCapillaries CerebralArteries2ToCapillaries CerebralArteries CerebralCapillaries - CerebralCapillariesToCerebralVeins CerebralCapillariesToCerebralVeins1 CerebralCapillaries CerebralVeins - CerebralVeinsToNeckVeins CerebralVeins2ToNeckVeins CerebralVeins NeckVeins - EnvironmentToLeftChestLeak EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -27627,266 +27208,228 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - FatToVenaCava Fat2ToVenaCava FatVasculature VenaCava - HeartHemorrhage MyocardiumBleed MyocardiumVasculature Ground - LargeIntestineHemorrhage LargeIntestineBleed LargeIntestineVasculature Ground - LargeIntestineToLiver LargeIntestineToPortalVein LargeIntestineVasculature LiverVasculature - LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArteriole LeftGlomerularCapillaries - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftArmHemorrhage LeftArmBleed LeftArmVasculature Ground - LeftArmToVenaCava LeftArm2ToVenaCava LeftArmVasculature VenaCava - LeftAtriumToLeftVentricle LeftAtrium2ToLeftVentricle1 LeftAtrium LeftVentricle - LeftBowmansCapsulesToTubules LeftBowmansCapsulesToTubules LeftBowmansCapsules LeftTubules - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArteriole LeftPeritubularCapillaries - LeftGlomerularCapillariesToBowmansCapsules LeftNetGlomerularCapillariesToNetBowmansCapsules LeftGlomerularCapillaries LeftBowmansCapsules - LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillaries LeftEfferentArteriole - LeftKidneyHemorrhage LeftKidneyBleed LeftRenalVein Ground - LeftKidneyToVenaCava LeftRenalVeinToVenaCavaConnection LeftRenalVein VenaCava - LeftLegHemorrhage LeftLegBleed LeftLegVasculature Ground - LeftLegToVenaCava LeftLeg2ToVenaCava LeftLegVasculature VenaCava - LeftLungHemorrhage LeftLungBleed LeftPulmonaryArteries Ground - LeftLungVascularToTissue LeftLungVToLeftLungE1 LeftLungVasculature LeftLungTissueExtracellular - LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillaries LeftRenalVein - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - LeftPulmonaryArteriesToCapillaries LeftPulmonaryArteriesToLeftPulmonaryCapillaries LeftPulmonaryArteries LeftPulmonaryCapillaries - LeftPulmonaryArteriesToVeins LeftPulmonaryArteriesToLeftPulmonaryVeins LeftPulmonaryArteries LeftPulmonaryVeins - LeftPulmonaryCapillariesToVeins LeftPulmonaryCapillariesToLeftPulmonaryVeins LeftPulmonaryCapillaries LeftPulmonaryVeins - LeftPulmonaryVeinsToLeftAtrium LeftIntermediatePulmonaryVeinsToLeftAtrium1 LeftPulmonaryVeins LeftAtrium - LeftRenalArteryToAfferentArteriole LeftRenalArteryToAfferentArteriole LeftRenalArtery LeftAfferentArteriole - LeftTubulesToPeritubularCapillaries LeftNetTubulesToNetPeritubularCapillaries LeftTubules LeftPeritubularCapillaries - LeftTubulesToUreter LeftTubulesToUreter LeftTubules LeftUreter - LeftUreterToBladder LeftUreterToBladder LeftUreter Bladder - LeftVentricleToAorta LeftVentricle1ToAorta2 LeftVentricle Aorta - LiverHemorrhage LiverBleed LiverVasculature Ground - LiverToVenaCava Liver2ToVenaCava LiverVasculature VenaCava - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -27899,315 +27442,270 @@ Muscle2ToVenaCava MuscleVasculature VenaCava - MyocardiumToVenaCava Myocardium2ToVenaCava MyocardiumVasculature VenaCava - NeckArteriesToCerebralArteries NeckArteriesToCerebralArteries1 NeckArteries CerebralArteries - NeckVeinsToVenaCava NeckVeinsToVenaCava NeckVeins VenaCava - RightAfferentArterioleToGlomerularCapillaries RightAfferentArterioleToGlomerularCapillaries RightAfferentArteriole RightGlomerularCapillaries - RightAlveoliLeakToRightPleuralCavity RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightArmHemorrhage RightArmBleed RightArmVasculature Ground - RightArmToVenaCava RightArm2ToVenaCava RightArmVasculature VenaCava - RightAtriumToRightVentricle RightAtrium2ToRightVentricle1 RightAtrium RightVentricle - RightBowmansCapsulesToTubules RightBowmansCapsulesToTubules RightBowmansCapsules RightTubules - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightEfferentArterioleToPeritubularCapillaries RightEfferentArterioleToPeritubularCapillaries RightEfferentArteriole RightPeritubularCapillaries - RightGlomerularCapillariesToBowmansCapsules RightNetGlomerularCapillariesToNetBowmansCapsules RightGlomerularCapillaries RightBowmansCapsules - RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillaries RightEfferentArteriole - RightKidneyHemorrhage RightKidneyBleed RightRenalVein Ground - RightKidneyToVenaCava RightRenalVeinToVenaCavaConnection RightRenalVein VenaCava - RightLegHemorrhage RightLegBleed RightLegVasculature Ground - RightLegToVenaCava RightLeg2ToVenaCava RightLegVasculature VenaCava - RightLungHemorrhage RightLungBleed RightPulmonaryArteries Ground - RightPeritubularCapillariesToRenalVein RightPeritubularCapillariesToRenalVein RightPeritubularCapillaries RightRenalVein - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - RightPulmonaryArteriesToCapillaries RightPulmonaryArteriesToRightPulmonaryCapillaries RightPulmonaryArteries RightPulmonaryCapillaries - RightPulmonaryArteriesToVeins RightPulmonaryArteriesToRightPulmonaryVeins RightPulmonaryArteries RightPulmonaryVeins - RightPulmonaryCapillariesToVeins RightPulmonaryCapillariesToRightPulmonaryVeins RightPulmonaryCapillaries RightPulmonaryVeins - RightPulmonaryVeinsToLeftAtrium RightIntermediatePulmonaryVeinsToLeftAtrium1 RightPulmonaryVeins LeftAtrium - RightRenalArteryToAfferentArteriole RightRenalArteryToAfferentArteriole RightRenalArtery RightAfferentArteriole - RightTubulesToPeritubularCapillaries RightNetTubulesToNetPeritubularCapillaries RightTubules RightPeritubularCapillaries - RightTubulesToUreter RightTubulesToUreter RightTubules RightUreter - RightUreterToBladder RightUreterToBladder RightUreter Bladder - RightVentricleToLeftPulmonaryArteries MainPulmonaryArteriesToLeftIntermediatePulmonaryArteries RightVentricle LeftPulmonaryArteries - RightVentricleToRightPulmonaryArteries MainPulmonaryArteriesToRightIntermediatePulmonaryArteries RightVentricle RightPulmonaryArteries - SkinToVenaCava Skin2ToVenaCava SkinVasculature VenaCava - SmallIntestineHemorrhage SmallIntestineBleed SmallIntestineVasculature Ground - SmallIntestineToLiver SmallIntestineToPortalVein SmallIntestineVasculature LiverVasculature - SplanchnicHemorrhage SplanchnicBleed SplanchnicVasculature Ground - SplanchnicToLiver SplanchnicToPortalVein SplanchnicVasculature LiverVasculature - SpleenHemorrhage SpleenBleed SpleenVasculature Ground - SpleenToLiver SpleenToPortalVein SpleenVasculature LiverVasculature - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VenaCavaHemorrhage VenaCavaBleed VenaCava Ground - VenaCavaIV IVToVenaCava Ground VenaCava - VenaCavaToRightAtrium VenaCavaToRightAtrium1 VenaCava RightAtrium - Nitrogen Oxygen @@ -28633,10 +28131,6 @@ Ambient Ambient - - - - Nitrogen @@ -28659,10 +28153,6 @@ AnesthesiaConnection AnesthesiaConnection - - - - Nitrogen @@ -28685,7 +28175,6 @@ Connection MechanicalVentilatorConnection - Nitrogen @@ -28708,10 +28197,6 @@ ExpiratoryLimb ExpiratoryLimb - - - - Nitrogen @@ -28734,10 +28219,6 @@ GasInlet GasInlet - - - - Nitrogen @@ -28760,10 +28241,6 @@ GasSource GasSource - - - - Nitrogen @@ -28786,10 +28263,6 @@ InspiratoryLimb InspiratoryLimb - - - - Nitrogen @@ -28812,10 +28285,6 @@ LeftAlveoli LeftAlveoli - - - - Nitrogen @@ -28838,9 +28307,6 @@ LeftAlveoliLeak LeftAlveoliLeak - - - Nitrogen @@ -28854,10 +28320,6 @@ LeftBronchi LeftBronchi - - - - Nitrogen @@ -28880,9 +28342,6 @@ LeftChestLeak LeftChestLeak - - - Nitrogen @@ -28897,37 +28356,31 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - Nitrogen @@ -28950,10 +28403,6 @@ Mouth Mouth - - - - Nitrogen @@ -28976,8 +28425,6 @@ Mouthpiece Mouthpiece - - Nitrogen @@ -29000,7 +28447,6 @@ Nosepiece Nosepiece - Nitrogen @@ -29023,7 +28469,6 @@ OxygenTank OxygenTank - Nitrogen @@ -29047,62 +28492,53 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + ReliefValve ReliefValve - - - Nitrogen @@ -29125,10 +28561,6 @@ RightAlveoli RightAlveoli - - - - Nitrogen @@ -29151,9 +28583,6 @@ RightAlveoliLeak RightAlveoliLeak - - - Nitrogen @@ -29167,10 +28596,6 @@ RightBronchi RightBronchi - - - - Nitrogen @@ -29193,9 +28618,6 @@ RightChestLeak RightChestLeak - - - Nitrogen @@ -29210,37 +28632,30 @@ RightLungPulmonary RightBronchi RightAlveoli - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - Nitrogen @@ -29263,10 +28678,6 @@ Scrubber Scrubber - - - - Nitrogen @@ -29289,10 +28700,6 @@ Selector Selector - - - - Nitrogen @@ -29315,10 +28722,6 @@ Stomach Stomach - - - - Nitrogen @@ -29341,10 +28744,6 @@ Trachea Trachea - - - - Nitrogen @@ -29368,10 +28767,6 @@ Ventilator Ventilator VentilatorConnection - - - - Nitrogen @@ -29415,10 +28810,6 @@ YPiece YPiece - - - - Nitrogen @@ -29443,7 +28834,6 @@ AnesthesiaConnectionToEnvironment AnesthesiaConnection Ambient - ConnectionToMouth @@ -29456,14 +28846,12 @@ EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -29482,98 +28870,84 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - Exhaust SelectorToEnvironment Selector Ambient - ExpiratoryLimbToSelector ExpiratoryLimbToSelector ExpiratoryLimb Selector - GasInletToInspiratoryLimb GasInletToInspiratoryLimb GasInlet InspiratoryLimb - GasSourceToGasInlet GasSourceToGasInlet GasSource GasInlet - InspiratoryLimbToYPiece InspiratoryLimbToYPiece InspiratoryLimb YPiece - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - Mask AnesthesiaConnectionToMouth AnesthesiaConnection Mouth - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -29604,91 +28978,78 @@ RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - ScrubberToGasInlet ScrubberToGasInlet Scrubber GasInlet - SelectorToReliefValve SelectorToReliefValve Selector ReliefValve - SelectorToScrubber SelectorToScrubber Selector Scrubber - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VentilatorToSelector VentilatorConnectionToSelector Ventilator Selector - YPieceToAnesthesiaConnection YPieceToAnesthesiaConnection YPiece AnesthesiaConnection - YPieceToExpiratoryLimb YPieceToExpiratoryLimb YPiece ExpiratoryLimb - Nitrogen Oxygen @@ -29922,477 +29283,364 @@ Active Active - - - Ambient Ambient - - - Clothing Clothing - - - Enclosure Enclosure - - - ExternalCore ExternalCore - - - ExternalGround ExternalGround - - - ExternalHeadSkin ExternalHeadSkin - - - ExternalLeftArmSkin ExternalLeftArmSkin - - - ExternalLeftLegSkin ExternalLeftLegSkin - - - ExternalRightArmSkin ExternalRightArmSkin - - - ExternalRightLegSkin ExternalRightLegSkin - - - ExternalTorsoSkin ExternalTorsoSkin - - - InternalCore InternalCore InternalGround - - - - InternalGround - - InternalHeadSkin InternalHeadSkin - - - - InternalLeftArmSkin InternalLeftArmSkin - - - - InternalLeftLegSkin InternalLeftLegSkin - - - - InternalRightArmSkin InternalRightArmSkin - - - - InternalRightLegSkin InternalRightLegSkin - - - - InternalTorsoSkin InternalTorsoSkin - - - - ActiveToClothing ActiveToClothing Active Clothing - ClothingToEnclosure ClothingToEnclosure Clothing Enclosure - ClothingToEnvironment ClothingToEnvironment Clothing Ambient - ExternalCoreToGround ExternalCoreToGround ExternalCore ExternalGround - ExternalHeadSkinToClothing ExternalHeadSkinToClothing ExternalHeadSkin Clothing - ExternalHeadSkinToGround ExternalHeadSkinToGround ExternalHeadSkin ExternalGround - ExternalLeftArmSkinToClothing ExternalLeftArmSkinToClothing ExternalLeftArmSkin Clothing - ExternalLeftArmSkinToGround ExternalLeftArmSkinToGround ExternalLeftArmSkin ExternalGround - ExternalLeftLegSkinToClothing ExternalLeftLegSkinToClothing ExternalLeftLegSkin Clothing - ExternalLeftLegSkinToGround ExternalLeftLegSkinToGround ExternalLeftLegSkin ExternalGround - ExternalRightArmSkinToClothing ExternalRightArmSkinToClothing ExternalRightArmSkin Clothing - ExternalRightArmSkinToGround ExternalRightArmSkinToGround ExternalRightArmSkin ExternalGround - ExternalRightLegSkinToClothing ExternalRightLegSkinToClothing ExternalRightLegSkin Clothing - ExternalRightLegSkinToGround ExternalRightLegSkinToGround ExternalRightLegSkin ExternalGround - ExternalTorsoSkinToClothing ExternalTorsoSkinToClothing ExternalTorsoSkin Clothing - ExternalTorsoSkinToGround ExternalTorsoSkinToGround ExternalTorsoSkin ExternalGround - GroundToActive GroundToActive ExternalGround Active - GroundToClothing GroundToClothing ExternalGround Clothing - GroundToEnclosure GroundToEnclosure ExternalGround Enclosure - GroundToEnvironment GroundToEnvironment ExternalGround Ambient - GroundToInternalCore GroundToInternalCore InternalGround InternalCore - GroundToInternalHeadSkin GroundToInternalHeadSkin InternalGround InternalHeadSkin - GroundToInternalLeftArmSkin GroundToInternalLeftArmSkin InternalGround InternalLeftArmSkin - GroundToInternalLeftLegSkin GroundToInternalLeftLegSkin InternalGround InternalLeftLegSkin - GroundToInternalRightArmSkin GroundToInternalRightArmSkin InternalGround InternalRightArmSkin - GroundToInternalRightLegSkin GroundToInternalRightLegSkin InternalGround InternalRightLegSkin - GroundToInternalTorsoSkin GroundToInternalTorsoSkin InternalGround InternalTorsoSkin - InternalCoreToExternalCore InternalCoreToExternalCore InternalCore ExternalCore - InternalCoreToGround InternalCoreToGround InternalGround InternalCore - InternalCoreToInternalHeadSkin InternalCoreToInternalHeadSkin InternalCore InternalHeadSkin - InternalCoreToInternalLeftArmSkin InternalCoreToInternalLeftArmSkin InternalCore InternalLeftArmSkin - InternalCoreToInternalLeftLegSkin InternalCoreToInternalLeftLegSkin InternalCore InternalLeftLegSkin - InternalCoreToInternalRightArmSkin InternalCoreToInternalRightArmSkin InternalCore InternalRightArmSkin - InternalCoreToInternalRightLegSkin InternalCoreToInternalRightLegSkin InternalCore InternalRightLegSkin - InternalCoreToInternalTorsoSkin InternalCoreToInternalTorsoSkin InternalCore InternalTorsoSkin - InternalHeadSkinToExternalHeadSkin InternalHeadSkinToExternalHeadSkin InternalHeadSkin ExternalHeadSkin - InternalHeadSkinToGround InternalHeadSkinToTemperatureGround InternalGround InternalHeadSkin - InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkin ExternalLeftArmSkin - InternalLeftArmSkinToGround InternalLeftArmSkinToTemperatureGround InternalGround InternalLeftArmSkin - InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkin ExternalLeftLegSkin - InternalLeftLegSkinToGround InternalLeftLegSkinToTemperatureGround InternalGround InternalLeftLegSkin - InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkin ExternalRightArmSkin - InternalRightArmSkinToGround InternalRightArmSkinToTemperatureGround InternalGround InternalRightArmSkin - InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkin ExternalRightLegSkin - InternalRightLegSkinToGround InternalRightLegSkinToTemperatureGround InternalGround InternalRightLegSkin - InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkin ExternalTorsoSkin - InternalTorsoSkinToGround InternalTorsoSkinToTemperatureGround InternalGround InternalTorsoSkin - BoneTissue @@ -30566,7 +29814,6 @@ - Off @@ -30975,7 +30222,6 @@ - @@ -31002,15 +30248,15 @@ On - + - + - + - + @@ -32357,7 +31603,6 @@ - Extrasplanchnic @@ -32368,7 +31613,6 @@ - Extrasplanchnic @@ -32389,7 +31633,6 @@ - Splanchnic @@ -32400,7 +31643,6 @@ - Extrasplanchnic @@ -32418,7 +31660,6 @@ - Extrasplanchnic @@ -32429,7 +31670,6 @@ - Splanchnic @@ -32440,7 +31680,6 @@ - Muscle @@ -32451,7 +31690,6 @@ - Myocardium @@ -32462,7 +31700,6 @@ - Cerebral @@ -32473,7 +31710,6 @@ - Extrasplanchnic @@ -32491,7 +31727,6 @@ - Extrasplanchnic @@ -32502,7 +31737,6 @@ - Extrasplanchnic @@ -32513,7 +31747,6 @@ - Splanchnic @@ -32524,7 +31757,6 @@ - Splanchnic @@ -32535,7 +31767,6 @@ - Splanchnic @@ -32593,7 +31824,6 @@ - Extrasplanchnic @@ -32826,7 +32056,6 @@ - Cerebral @@ -32847,7 +32076,6 @@ - Cerebral @@ -32868,7 +32096,6 @@ - Cerebral @@ -32982,7 +32209,6 @@ - Extrasplanchnic @@ -33265,7 +32491,6 @@ - Splanchnic @@ -33344,7 +32569,6 @@ - Extrasplanchnic @@ -33628,7 +32852,6 @@ - Extrasplanchnic @@ -34001,7 +33224,6 @@ - Splanchnic @@ -34206,7 +33428,6 @@ - Muscle @@ -34323,7 +33544,6 @@ - Myocardium @@ -34440,7 +33660,6 @@ - Cerebral @@ -34471,7 +33690,6 @@ - Cerebral @@ -34515,7 +33733,6 @@ - Splanchnic @@ -34589,7 +33806,6 @@ - Extrasplanchnic @@ -34873,7 +34089,6 @@ - Extrasplanchnic @@ -35285,7 +34500,6 @@ - Extrasplanchnic @@ -35432,7 +34646,6 @@ - Splanchnic @@ -35493,7 +34706,6 @@ - Splanchnic @@ -35613,7 +34825,6 @@ - Splanchnic diff --git a/share/data/states/Male@0s.xml b/share/data/states/Male@0s.xml index bdf12c1a2..ab594a528 100644 --- a/share/data/states/Male@0s.xml +++ b/share/data/states/Male@0s.xml @@ -1,5 +1,5 @@ - + Male @@ -177,7 +177,7 @@ - + @@ -313,7 +313,7 @@ - + @@ -363,7 +363,7 @@ - + @@ -386,7 +386,7 @@ - + @@ -419,7 +419,7 @@ - + @@ -444,7 +444,7 @@ - + @@ -467,7 +467,7 @@ - + @@ -515,7 +515,7 @@ - + @@ -571,7 +571,7 @@ - + @@ -594,7 +594,7 @@ - + @@ -619,7 +619,7 @@ - + @@ -644,7 +644,7 @@ - + @@ -675,7 +675,7 @@ - + @@ -685,7 +685,7 @@ - + @@ -912,7 +912,6 @@ - false true false @@ -1011,6 +1010,7 @@ + @@ -1160,16 +1160,13 @@ - - - @@ -1216,15 +1213,15 @@ false - + - - + + @@ -1237,9 +1234,9 @@ 68.642075 33.6770238663643 - - - + + + @@ -1301,8 +1298,8 @@ - - + + @@ -1317,6 +1314,9 @@ 6 + + + @@ -1324,20 +1324,12 @@ Ambient Ambient - - - - Aorta Aorta1 Aorta2 Aorta3 - - - - Nitrogen @@ -1600,10 +1592,6 @@ Bladder Bladder - - - - Nitrogen @@ -1869,8 +1857,6 @@ BoneE3 BoneL1 BoneL2 - - Nitrogen @@ -2133,8 +2119,6 @@ BoneTissueIntracellular BoneI - - Nitrogen @@ -2398,10 +2382,6 @@ BoneVasculature Bone1 Bone2 - - - - Nitrogen @@ -2668,8 +2648,6 @@ BrainE3 BrainL1 BrainL2 - - Nitrogen @@ -2932,8 +2910,6 @@ BrainTissueIntracellular BrainI - - Nitrogen @@ -3198,276 +3174,269 @@ CerebralArteries CerebralCapillaries CerebralVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + CerebralArteries CerebralArteries1 CerebralArteries2 - - - - Nitrogen @@ -3730,10 +3699,6 @@ CerebralCapillaries CerebralCapillaries - - - - Nitrogen @@ -3996,8 +3961,6 @@ CerebralSpinalFluid SpinalFluid - - Nitrogen @@ -4261,10 +4224,6 @@ CerebralVeins1 CerebralVeins2 CerebralVeinsCheck - - - - Nitrogen @@ -4531,8 +4490,6 @@ FatE3 FatL1 FatL2 - - Nitrogen @@ -4795,8 +4752,6 @@ FatTissueIntracellular FatI - - Nitrogen @@ -5060,10 +5015,6 @@ FatVasculature Fat1 Fat2 - - - - Nitrogen @@ -5326,9 +5277,6 @@ Ground Ground - - - Nitrogen @@ -5449,8 +5397,6 @@ GutE3 GutL1 GutL2 - - Nitrogen @@ -5713,8 +5659,6 @@ GutTissueIntracellular GutI - - Nitrogen @@ -5979,266 +5923,263 @@ SplanchnicVasculature SmallIntestineVasculature LargeIntestineVasculature - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -6247,541 +6188,529 @@ LeftHeart RightHeart Pericardium - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + KidneyVasculature LeftKidneyVasculature RightKidneyVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LargeIntestineVasculature LargeIntestine1 - - - - Nitrogen @@ -7044,10 +6973,6 @@ LeftAfferentArteriole LeftAfferentArteriole - - - - Nitrogen @@ -7310,26 +7235,15 @@ LeftAlveoli LeftAlveoli - - - - LeftAlveoliLeak LeftAlveoliLeak - - - LeftArmVasculature LeftArm1 LeftArm2 - - - - Nitrogen @@ -7593,10 +7507,6 @@ LeftAtrium LeftAtrium1 LeftAtrium2 - - - - Nitrogen @@ -7860,10 +7770,6 @@ LeftBowmansCapsules LeftBowmansCapsules LeftNetBowmansCapsules - - - - Nitrogen @@ -8126,25 +8032,14 @@ LeftBronchi LeftBronchi - - - - LeftChestLeak LeftChestLeak - - - LeftEfferentArteriole LeftEfferentArteriole - - - - Nitrogen @@ -8408,10 +8303,6 @@ LeftGlomerularCapillaries LeftGlomerularCapillaries LeftNetGlomerularCapillaries - - - - Nitrogen @@ -8675,266 +8566,262 @@ LeftHeart LeftAtrium LeftVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -8944,8 +8831,6 @@ LeftKidneyE3 LeftKidneyL1 LeftKidneyL2 - - Nitrogen @@ -9208,8 +9093,6 @@ LeftKidneyTissueIntracellular LeftKidneyI - - Nitrogen @@ -9474,276 +9357,269 @@ LeftRenalArtery LeftNephron LeftRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftLegVasculature LeftLeg1 LeftLeg2 - - - - Nitrogen @@ -10007,10 +9883,6 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - - LeftLungTissueExtracellular @@ -10019,10 +9891,6 @@ LeftLungE3 LeftLungL1 LeftLungL2 - - - - Nitrogen @@ -10285,8 +10153,6 @@ LeftLungTissueIntracellular LeftLungI - - Nitrogen @@ -10551,266 +10417,263 @@ LeftPulmonaryArteries LeftPulmonaryCapillaries LeftPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -10821,276 +10684,269 @@ LeftPeritubularCapillaries LeftBowmansCapsules LeftTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftPeritubularCapillaries LeftPeritubularCapillaries LeftNetPeritubularCapillaries - - - - Nitrogen @@ -11354,19 +11210,11 @@ LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - LeftPulmonaryArteries LeftPulmonaryArteries LeftIntermediatePulmonaryArteries - - - - Nitrogen @@ -11629,10 +11477,6 @@ LeftPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen @@ -11895,10 +11739,6 @@ LeftPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen @@ -12161,10 +12001,6 @@ LeftRenalArtery LeftRenalArtery - - - - Nitrogen @@ -12427,10 +12263,6 @@ LeftRenalVein LeftRenalVein - - - - Nitrogen @@ -12694,10 +12526,6 @@ LeftTubules LeftTubules LeftNetTubules - - - - Nitrogen @@ -12960,10 +12788,6 @@ LeftUreter LeftUreter - - - - Nitrogen @@ -13226,10 +13050,6 @@ LeftVentricle LeftVentricle1 LeftVentricle2 - - - - Nitrogen @@ -13496,8 +13316,6 @@ LiverE3 LiverL1 LiverL2 - - Nitrogen @@ -13760,8 +13578,6 @@ LiverTissueIntracellular LiverI - - Nitrogen @@ -14027,9 +13843,6 @@ Liver2 PortalVein1 - - - Nitrogen @@ -14293,273 +14106,267 @@ LungsVasculature LeftLungVasculature RightLungVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + Lymph Lymph - - Nitrogen @@ -14821,16 +14628,10 @@ Mouth Mouth - - - - Mouthpiece Mouthpiece - - MuscleTissueExtracellular @@ -14839,8 +14640,6 @@ MuscleE3 MuscleL1 MuscleL2 - - Nitrogen @@ -15103,8 +14902,6 @@ MuscleTissueIntracellular MuscleI - - Nitrogen @@ -15368,10 +15165,6 @@ MuscleVasculature Muscle1 Muscle2 - - - - Nitrogen @@ -15638,8 +15431,6 @@ MyocardiumE3 MyocardiumL1 MyocardiumL2 - - Nitrogen @@ -15902,8 +15693,6 @@ MyocardiumTissueIntracellular MyocardiumI - - Nitrogen @@ -16167,10 +15956,6 @@ MyocardiumVasculature Myocardium1 Myocardium2 - - - - Nitrogen @@ -16433,10 +16218,6 @@ NeckArteries NeckArteries - - - - Nitrogen @@ -16699,10 +16480,6 @@ NeckVeins NeckVeins - - - - Nitrogen @@ -16965,8 +16742,6 @@ Pericardium Pericardium1 - - Nitrogen @@ -17230,825 +17005,801 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - PulmonaryArteries RightPulmonaryArteries LeftPulmonaryArteries - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryCapillaries RightPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - - PulmonaryVeins RightPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightAfferentArteriole RightAfferentArteriole - - - - Nitrogen @@ -18311,26 +18062,15 @@ RightAlveoli RightAlveoli - - - - RightAlveoliLeak RightAlveoliLeak - - - RightArmVasculature RightArm1 RightArm2 - - - - Nitrogen @@ -18594,10 +18334,6 @@ RightAtrium RightAtrium1 RightAtrium2 - - - - Nitrogen @@ -18861,10 +18597,6 @@ RightBowmansCapsules RightBowmansCapsules RightNetBowmansCapsules - - - - Nitrogen @@ -19127,25 +18859,14 @@ RightBronchi RightBronchi - - - - RightChestLeak RightChestLeak - - - RightEfferentArteriole RightEfferentArteriole - - - - Nitrogen @@ -19409,10 +19130,6 @@ RightGlomerularCapillaries RightGlomerularCapillaries RightNetGlomerularCapillaries - - - - Nitrogen @@ -19676,266 +19393,262 @@ RightHeart RightAtrium RightVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -19945,8 +19658,6 @@ RightKidneyE3 RightKidneyL1 RightKidneyL2 - - Nitrogen @@ -20209,8 +19920,6 @@ RightKidneyTissueIntracellular RightKidneyI - - Nitrogen @@ -20475,276 +20184,269 @@ RightRenalArtery RightNephron RightRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightLegVasculature RightLeg1 RightLeg2 - - - - Nitrogen @@ -21008,10 +20710,6 @@ RightLungPulmonary RightBronchi RightAlveoli - - - - RightLungTissueExtracellular @@ -21020,8 +20718,6 @@ RightLungE3 RightLungL1 RightLungL2 - - Nitrogen @@ -21284,8 +20980,6 @@ RightLungTissueIntracellular RightLungI - - Nitrogen @@ -21550,266 +21244,263 @@ RightPulmonaryArteries RightPulmonaryCapillaries RightPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -21820,276 +21511,269 @@ RightPeritubularCapillaries RightBowmansCapsules RightTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightPeritubularCapillaries RightPeritubularCapillaries RightNetPeritubularCapillaries - - - - Nitrogen @@ -22353,19 +22037,11 @@ RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - RightPulmonaryArteries RightPulmonaryArteries RightIntermediatePulmonaryArteries - - - - Nitrogen @@ -22628,10 +22304,6 @@ RightPulmonaryCapillaries RightPulmonaryCapillaries - - - - Nitrogen @@ -22894,10 +22566,6 @@ RightPulmonaryVeins RightPulmonaryVeins - - - - Nitrogen @@ -23160,10 +22828,6 @@ RightRenalArtery RightRenalArtery - - - - Nitrogen @@ -23426,10 +23090,6 @@ RightRenalVein RightRenalVein - - - - Nitrogen @@ -23693,10 +23353,6 @@ RightTubules RightTubules RightNetTubules - - - - Nitrogen @@ -23959,10 +23615,6 @@ RightUreter RightUreter - - - - Nitrogen @@ -24226,10 +23878,6 @@ RightVentricle1 RightVentricle2 MainPulmonaryArteries - - - - Nitrogen @@ -24496,8 +24144,6 @@ SkinE3 SkinL1 SkinL2 - - Nitrogen @@ -24760,8 +24406,6 @@ SkinTissueIntracellular SkinI - - Nitrogen @@ -25025,10 +24669,6 @@ SkinVasculature Skin1 Skin2 - - - - Nitrogen @@ -25291,8 +24931,6 @@ SmallIntestineChyme SmallIntestineC1 - - Nitrogen @@ -25554,10 +25192,6 @@ SmallIntestineVasculature SmallIntestine1 - - - - Nitrogen @@ -25820,10 +25454,6 @@ SplanchnicVasculature Splanchnic1 - - - - Nitrogen @@ -26090,8 +25720,6 @@ SpleenE3 SpleenL1 SpleenL2 - - Nitrogen @@ -26354,8 +25982,6 @@ SpleenTissueIntracellular SpleenI - - Nitrogen @@ -26618,10 +26244,6 @@ SpleenVasculature Spleen1 - - - - Nitrogen @@ -26884,290 +26506,276 @@ Stomach Stomach - - - - Trachea Trachea - - - - Ureters RightUreter LeftUreter - - - - Nitrogen - - + + - - + + Oxygen - - + + - - + + + CarbonDioxide - - + + - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + VenaCava VenaCava - - - - Nitrogen @@ -27432,189 +27040,162 @@ AortaBleed Aorta Ground - AortaToBone Aorta1ToBone1 Aorta BoneVasculature - AortaToFat Aorta1ToFat1 Aorta FatVasculature - AortaToLargeIntestine Aorta1ToLargeIntestine Aorta LargeIntestineVasculature - AortaToLeftArm Aorta1ToLeftArm1 Aorta LeftArmVasculature - AortaToLeftKidney LeftAortaConnectionToRenalArtery Aorta LeftRenalArtery - AortaToLeftLeg Aorta1ToLeftLeg1 Aorta LeftLegVasculature - AortaToLiver Aorta1ToLiver1 Aorta LiverVasculature - AortaToMuscle Aorta1ToMuscle1 Aorta MuscleVasculature - AortaToMyocardium Aorta1ToMyocardium1 Aorta MyocardiumVasculature - AortaToNeckArteries Aorta1ToNeckArteries Aorta NeckArteries - AortaToRightArm Aorta1ToRightArm1 Aorta RightArmVasculature - AortaToRightKidney RightAortaConnectionToRenalArtery Aorta RightRenalArtery - AortaToRightLeg Aorta1ToRightLeg1 Aorta RightLegVasculature - AortaToSkin Aorta1ToSkin1 Aorta SkinVasculature - AortaToSmallIntestine Aorta1ToSmallIntestine Aorta SmallIntestineVasculature - AortaToSplanchnic Aorta1ToSplanchnic Aorta SplanchnicVasculature - AortaToSpleen Aorta1ToSpleen Aorta SpleenVasculature - BladderToGround BladderToGroundUrinate Bladder Ground - BladderToGroundSource BladderToGroundPressure Bladder Ground - BoneToVenaCava Bone2ToVenaCava BoneVasculature VenaCava - BrainHemorrhage BrainBleed CerebralCapillaries Ground - CerebralArteriesToCerebralCapillaries CerebralArteries2ToCapillaries CerebralArteries CerebralCapillaries - CerebralCapillariesToCerebralVeins CerebralCapillariesToCerebralVeins1 CerebralCapillaries CerebralVeins - CerebralVeinsToNeckVeins CerebralVeins2ToNeckVeins CerebralVeins NeckVeins - EnvironmentToLeftChestLeak EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -27627,266 +27208,228 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - FatToVenaCava Fat2ToVenaCava FatVasculature VenaCava - HeartHemorrhage MyocardiumBleed MyocardiumVasculature Ground - LargeIntestineHemorrhage LargeIntestineBleed LargeIntestineVasculature Ground - LargeIntestineToLiver LargeIntestineToPortalVein LargeIntestineVasculature LiverVasculature - LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArteriole LeftGlomerularCapillaries - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftArmHemorrhage LeftArmBleed LeftArmVasculature Ground - LeftArmToVenaCava LeftArm2ToVenaCava LeftArmVasculature VenaCava - LeftAtriumToLeftVentricle LeftAtrium2ToLeftVentricle1 LeftAtrium LeftVentricle - LeftBowmansCapsulesToTubules LeftBowmansCapsulesToTubules LeftBowmansCapsules LeftTubules - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArteriole LeftPeritubularCapillaries - LeftGlomerularCapillariesToBowmansCapsules LeftNetGlomerularCapillariesToNetBowmansCapsules LeftGlomerularCapillaries LeftBowmansCapsules - LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillaries LeftEfferentArteriole - LeftKidneyHemorrhage LeftKidneyBleed LeftRenalVein Ground - LeftKidneyToVenaCava LeftRenalVeinToVenaCavaConnection LeftRenalVein VenaCava - LeftLegHemorrhage LeftLegBleed LeftLegVasculature Ground - LeftLegToVenaCava LeftLeg2ToVenaCava LeftLegVasculature VenaCava - LeftLungHemorrhage LeftLungBleed LeftPulmonaryArteries Ground - LeftLungVascularToTissue LeftLungVToLeftLungE1 LeftLungVasculature LeftLungTissueExtracellular - LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillaries LeftRenalVein - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - LeftPulmonaryArteriesToCapillaries LeftPulmonaryArteriesToLeftPulmonaryCapillaries LeftPulmonaryArteries LeftPulmonaryCapillaries - LeftPulmonaryArteriesToVeins LeftPulmonaryArteriesToLeftPulmonaryVeins LeftPulmonaryArteries LeftPulmonaryVeins - LeftPulmonaryCapillariesToVeins LeftPulmonaryCapillariesToLeftPulmonaryVeins LeftPulmonaryCapillaries LeftPulmonaryVeins - LeftPulmonaryVeinsToLeftAtrium LeftIntermediatePulmonaryVeinsToLeftAtrium1 LeftPulmonaryVeins LeftAtrium - LeftRenalArteryToAfferentArteriole LeftRenalArteryToAfferentArteriole LeftRenalArtery LeftAfferentArteriole - LeftTubulesToPeritubularCapillaries LeftNetTubulesToNetPeritubularCapillaries LeftTubules LeftPeritubularCapillaries - LeftTubulesToUreter LeftTubulesToUreter LeftTubules LeftUreter - LeftUreterToBladder LeftUreterToBladder LeftUreter Bladder - LeftVentricleToAorta LeftVentricle1ToAorta2 LeftVentricle Aorta - LiverHemorrhage LiverBleed LiverVasculature Ground - LiverToVenaCava Liver2ToVenaCava LiverVasculature VenaCava - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -27899,315 +27442,270 @@ Muscle2ToVenaCava MuscleVasculature VenaCava - MyocardiumToVenaCava Myocardium2ToVenaCava MyocardiumVasculature VenaCava - NeckArteriesToCerebralArteries NeckArteriesToCerebralArteries1 NeckArteries CerebralArteries - NeckVeinsToVenaCava NeckVeinsToVenaCava NeckVeins VenaCava - RightAfferentArterioleToGlomerularCapillaries RightAfferentArterioleToGlomerularCapillaries RightAfferentArteriole RightGlomerularCapillaries - RightAlveoliLeakToRightPleuralCavity RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightArmHemorrhage RightArmBleed RightArmVasculature Ground - RightArmToVenaCava RightArm2ToVenaCava RightArmVasculature VenaCava - RightAtriumToRightVentricle RightAtrium2ToRightVentricle1 RightAtrium RightVentricle - RightBowmansCapsulesToTubules RightBowmansCapsulesToTubules RightBowmansCapsules RightTubules - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightEfferentArterioleToPeritubularCapillaries RightEfferentArterioleToPeritubularCapillaries RightEfferentArteriole RightPeritubularCapillaries - RightGlomerularCapillariesToBowmansCapsules RightNetGlomerularCapillariesToNetBowmansCapsules RightGlomerularCapillaries RightBowmansCapsules - RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillaries RightEfferentArteriole - RightKidneyHemorrhage RightKidneyBleed RightRenalVein Ground - RightKidneyToVenaCava RightRenalVeinToVenaCavaConnection RightRenalVein VenaCava - RightLegHemorrhage RightLegBleed RightLegVasculature Ground - RightLegToVenaCava RightLeg2ToVenaCava RightLegVasculature VenaCava - RightLungHemorrhage RightLungBleed RightPulmonaryArteries Ground - RightPeritubularCapillariesToRenalVein RightPeritubularCapillariesToRenalVein RightPeritubularCapillaries RightRenalVein - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - RightPulmonaryArteriesToCapillaries RightPulmonaryArteriesToRightPulmonaryCapillaries RightPulmonaryArteries RightPulmonaryCapillaries - RightPulmonaryArteriesToVeins RightPulmonaryArteriesToRightPulmonaryVeins RightPulmonaryArteries RightPulmonaryVeins - RightPulmonaryCapillariesToVeins RightPulmonaryCapillariesToRightPulmonaryVeins RightPulmonaryCapillaries RightPulmonaryVeins - RightPulmonaryVeinsToLeftAtrium RightIntermediatePulmonaryVeinsToLeftAtrium1 RightPulmonaryVeins LeftAtrium - RightRenalArteryToAfferentArteriole RightRenalArteryToAfferentArteriole RightRenalArtery RightAfferentArteriole - RightTubulesToPeritubularCapillaries RightNetTubulesToNetPeritubularCapillaries RightTubules RightPeritubularCapillaries - RightTubulesToUreter RightTubulesToUreter RightTubules RightUreter - RightUreterToBladder RightUreterToBladder RightUreter Bladder - RightVentricleToLeftPulmonaryArteries MainPulmonaryArteriesToLeftIntermediatePulmonaryArteries RightVentricle LeftPulmonaryArteries - RightVentricleToRightPulmonaryArteries MainPulmonaryArteriesToRightIntermediatePulmonaryArteries RightVentricle RightPulmonaryArteries - SkinToVenaCava Skin2ToVenaCava SkinVasculature VenaCava - SmallIntestineHemorrhage SmallIntestineBleed SmallIntestineVasculature Ground - SmallIntestineToLiver SmallIntestineToPortalVein SmallIntestineVasculature LiverVasculature - SplanchnicHemorrhage SplanchnicBleed SplanchnicVasculature Ground - SplanchnicToLiver SplanchnicToPortalVein SplanchnicVasculature LiverVasculature - SpleenHemorrhage SpleenBleed SpleenVasculature Ground - SpleenToLiver SpleenToPortalVein SpleenVasculature LiverVasculature - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VenaCavaHemorrhage VenaCavaBleed VenaCava Ground - VenaCavaIV IVToVenaCava Ground VenaCava - VenaCavaToRightAtrium VenaCavaToRightAtrium1 VenaCava RightAtrium - Nitrogen Oxygen @@ -28633,10 +28131,6 @@ Ambient Ambient - - - - Nitrogen @@ -28659,10 +28153,6 @@ AnesthesiaConnection AnesthesiaConnection - - - - Nitrogen @@ -28685,7 +28175,6 @@ Connection MechanicalVentilatorConnection - Nitrogen @@ -28708,10 +28197,6 @@ ExpiratoryLimb ExpiratoryLimb - - - - Nitrogen @@ -28734,10 +28219,6 @@ GasInlet GasInlet - - - - Nitrogen @@ -28760,10 +28241,6 @@ GasSource GasSource - - - - Nitrogen @@ -28786,10 +28263,6 @@ InspiratoryLimb InspiratoryLimb - - - - Nitrogen @@ -28812,10 +28285,6 @@ LeftAlveoli LeftAlveoli - - - - Nitrogen @@ -28838,9 +28307,6 @@ LeftAlveoliLeak LeftAlveoliLeak - - - Nitrogen @@ -28854,10 +28320,6 @@ LeftBronchi LeftBronchi - - - - Nitrogen @@ -28880,9 +28342,6 @@ LeftChestLeak LeftChestLeak - - - Nitrogen @@ -28897,37 +28356,31 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - Nitrogen @@ -28950,10 +28403,6 @@ Mouth Mouth - - - - Nitrogen @@ -28976,8 +28425,6 @@ Mouthpiece Mouthpiece - - Nitrogen @@ -29000,7 +28447,6 @@ Nosepiece Nosepiece - Nitrogen @@ -29023,7 +28469,6 @@ OxygenTank OxygenTank - Nitrogen @@ -29047,62 +28492,53 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + ReliefValve ReliefValve - - - Nitrogen @@ -29125,10 +28561,6 @@ RightAlveoli RightAlveoli - - - - Nitrogen @@ -29151,9 +28583,6 @@ RightAlveoliLeak RightAlveoliLeak - - - Nitrogen @@ -29167,10 +28596,6 @@ RightBronchi RightBronchi - - - - Nitrogen @@ -29193,9 +28618,6 @@ RightChestLeak RightChestLeak - - - Nitrogen @@ -29210,37 +28632,30 @@ RightLungPulmonary RightBronchi RightAlveoli - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - Nitrogen @@ -29263,10 +28678,6 @@ Scrubber Scrubber - - - - Nitrogen @@ -29289,10 +28700,6 @@ Selector Selector - - - - Nitrogen @@ -29315,10 +28722,6 @@ Stomach Stomach - - - - Nitrogen @@ -29341,10 +28744,6 @@ Trachea Trachea - - - - Nitrogen @@ -29368,10 +28767,6 @@ Ventilator Ventilator VentilatorConnection - - - - Nitrogen @@ -29415,10 +28810,6 @@ YPiece YPiece - - - - Nitrogen @@ -29443,7 +28834,6 @@ AnesthesiaConnectionToEnvironment AnesthesiaConnection Ambient - ConnectionToMouth @@ -29456,14 +28846,12 @@ EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -29482,98 +28870,84 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - Exhaust SelectorToEnvironment Selector Ambient - ExpiratoryLimbToSelector ExpiratoryLimbToSelector ExpiratoryLimb Selector - GasInletToInspiratoryLimb GasInletToInspiratoryLimb GasInlet InspiratoryLimb - GasSourceToGasInlet GasSourceToGasInlet GasSource GasInlet - InspiratoryLimbToYPiece InspiratoryLimbToYPiece InspiratoryLimb YPiece - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - Mask AnesthesiaConnectionToMouth AnesthesiaConnection Mouth - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -29604,91 +28978,78 @@ RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - ScrubberToGasInlet ScrubberToGasInlet Scrubber GasInlet - SelectorToReliefValve SelectorToReliefValve Selector ReliefValve - SelectorToScrubber SelectorToScrubber Selector Scrubber - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VentilatorToSelector VentilatorConnectionToSelector Ventilator Selector - YPieceToAnesthesiaConnection YPieceToAnesthesiaConnection YPiece AnesthesiaConnection - YPieceToExpiratoryLimb YPieceToExpiratoryLimb YPiece ExpiratoryLimb - Nitrogen Oxygen @@ -29922,477 +29283,364 @@ Active Active - - - Ambient Ambient - - - Clothing Clothing - - - Enclosure Enclosure - - - ExternalCore ExternalCore - - - ExternalGround ExternalGround - - - ExternalHeadSkin ExternalHeadSkin - - - ExternalLeftArmSkin ExternalLeftArmSkin - - - ExternalLeftLegSkin ExternalLeftLegSkin - - - ExternalRightArmSkin ExternalRightArmSkin - - - ExternalRightLegSkin ExternalRightLegSkin - - - ExternalTorsoSkin ExternalTorsoSkin - - - InternalCore InternalCore InternalGround - - - - InternalGround - - InternalHeadSkin InternalHeadSkin - - - - InternalLeftArmSkin InternalLeftArmSkin - - - - InternalLeftLegSkin InternalLeftLegSkin - - - - InternalRightArmSkin InternalRightArmSkin - - - - InternalRightLegSkin InternalRightLegSkin - - - - InternalTorsoSkin InternalTorsoSkin - - - - ActiveToClothing ActiveToClothing Active Clothing - ClothingToEnclosure ClothingToEnclosure Clothing Enclosure - ClothingToEnvironment ClothingToEnvironment Clothing Ambient - ExternalCoreToGround ExternalCoreToGround ExternalCore ExternalGround - ExternalHeadSkinToClothing ExternalHeadSkinToClothing ExternalHeadSkin Clothing - ExternalHeadSkinToGround ExternalHeadSkinToGround ExternalHeadSkin ExternalGround - ExternalLeftArmSkinToClothing ExternalLeftArmSkinToClothing ExternalLeftArmSkin Clothing - ExternalLeftArmSkinToGround ExternalLeftArmSkinToGround ExternalLeftArmSkin ExternalGround - ExternalLeftLegSkinToClothing ExternalLeftLegSkinToClothing ExternalLeftLegSkin Clothing - ExternalLeftLegSkinToGround ExternalLeftLegSkinToGround ExternalLeftLegSkin ExternalGround - ExternalRightArmSkinToClothing ExternalRightArmSkinToClothing ExternalRightArmSkin Clothing - ExternalRightArmSkinToGround ExternalRightArmSkinToGround ExternalRightArmSkin ExternalGround - ExternalRightLegSkinToClothing ExternalRightLegSkinToClothing ExternalRightLegSkin Clothing - ExternalRightLegSkinToGround ExternalRightLegSkinToGround ExternalRightLegSkin ExternalGround - ExternalTorsoSkinToClothing ExternalTorsoSkinToClothing ExternalTorsoSkin Clothing - ExternalTorsoSkinToGround ExternalTorsoSkinToGround ExternalTorsoSkin ExternalGround - GroundToActive GroundToActive ExternalGround Active - GroundToClothing GroundToClothing ExternalGround Clothing - GroundToEnclosure GroundToEnclosure ExternalGround Enclosure - GroundToEnvironment GroundToEnvironment ExternalGround Ambient - GroundToInternalCore GroundToInternalCore InternalGround InternalCore - GroundToInternalHeadSkin GroundToInternalHeadSkin InternalGround InternalHeadSkin - GroundToInternalLeftArmSkin GroundToInternalLeftArmSkin InternalGround InternalLeftArmSkin - GroundToInternalLeftLegSkin GroundToInternalLeftLegSkin InternalGround InternalLeftLegSkin - GroundToInternalRightArmSkin GroundToInternalRightArmSkin InternalGround InternalRightArmSkin - GroundToInternalRightLegSkin GroundToInternalRightLegSkin InternalGround InternalRightLegSkin - GroundToInternalTorsoSkin GroundToInternalTorsoSkin InternalGround InternalTorsoSkin - InternalCoreToExternalCore InternalCoreToExternalCore InternalCore ExternalCore - InternalCoreToGround InternalCoreToGround InternalGround InternalCore - InternalCoreToInternalHeadSkin InternalCoreToInternalHeadSkin InternalCore InternalHeadSkin - InternalCoreToInternalLeftArmSkin InternalCoreToInternalLeftArmSkin InternalCore InternalLeftArmSkin - InternalCoreToInternalLeftLegSkin InternalCoreToInternalLeftLegSkin InternalCore InternalLeftLegSkin - InternalCoreToInternalRightArmSkin InternalCoreToInternalRightArmSkin InternalCore InternalRightArmSkin - InternalCoreToInternalRightLegSkin InternalCoreToInternalRightLegSkin InternalCore InternalRightLegSkin - InternalCoreToInternalTorsoSkin InternalCoreToInternalTorsoSkin InternalCore InternalTorsoSkin - InternalHeadSkinToExternalHeadSkin InternalHeadSkinToExternalHeadSkin InternalHeadSkin ExternalHeadSkin - InternalHeadSkinToGround InternalHeadSkinToTemperatureGround InternalGround InternalHeadSkin - InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkin ExternalLeftArmSkin - InternalLeftArmSkinToGround InternalLeftArmSkinToTemperatureGround InternalGround InternalLeftArmSkin - InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkin ExternalLeftLegSkin - InternalLeftLegSkinToGround InternalLeftLegSkinToTemperatureGround InternalGround InternalLeftLegSkin - InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkin ExternalRightArmSkin - InternalRightArmSkinToGround InternalRightArmSkinToTemperatureGround InternalGround InternalRightArmSkin - InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkin ExternalRightLegSkin - InternalRightLegSkinToGround InternalRightLegSkinToTemperatureGround InternalGround InternalRightLegSkin - InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkin ExternalTorsoSkin - InternalTorsoSkinToGround InternalTorsoSkinToTemperatureGround InternalGround InternalTorsoSkin - BoneTissue @@ -30566,7 +29814,6 @@ - Off @@ -30975,7 +30222,6 @@ - @@ -31002,15 +30248,15 @@ On - + - + - + - + @@ -32357,7 +31603,6 @@ - Extrasplanchnic @@ -32368,7 +31613,6 @@ - Extrasplanchnic @@ -32389,7 +31633,6 @@ - Splanchnic @@ -32400,7 +31643,6 @@ - Extrasplanchnic @@ -32418,7 +31660,6 @@ - Extrasplanchnic @@ -32429,7 +31670,6 @@ - Splanchnic @@ -32440,7 +31680,6 @@ - Muscle @@ -32451,7 +31690,6 @@ - Myocardium @@ -32462,7 +31700,6 @@ - Cerebral @@ -32473,7 +31710,6 @@ - Extrasplanchnic @@ -32491,7 +31727,6 @@ - Extrasplanchnic @@ -32502,7 +31737,6 @@ - Extrasplanchnic @@ -32513,7 +31747,6 @@ - Splanchnic @@ -32524,7 +31757,6 @@ - Splanchnic @@ -32535,7 +31767,6 @@ - Splanchnic @@ -32593,7 +31824,6 @@ - Extrasplanchnic @@ -32826,7 +32056,6 @@ - Cerebral @@ -32847,7 +32076,6 @@ - Cerebral @@ -32868,7 +32096,6 @@ - Cerebral @@ -32982,7 +32209,6 @@ - Extrasplanchnic @@ -33265,7 +32491,6 @@ - Splanchnic @@ -33344,7 +32569,6 @@ - Extrasplanchnic @@ -33628,7 +32852,6 @@ - Extrasplanchnic @@ -34001,7 +33224,6 @@ - Splanchnic @@ -34206,7 +33428,6 @@ - Muscle @@ -34323,7 +33544,6 @@ - Myocardium @@ -34440,7 +33660,6 @@ - Cerebral @@ -34471,7 +33690,6 @@ - Cerebral @@ -34515,7 +33733,6 @@ - Splanchnic @@ -34589,7 +33806,6 @@ - Extrasplanchnic @@ -34873,7 +34089,6 @@ - Extrasplanchnic @@ -35285,7 +34500,6 @@ - Extrasplanchnic @@ -35432,7 +34646,6 @@ - Splanchnic @@ -35493,7 +34706,6 @@ - Splanchnic @@ -35613,7 +34825,6 @@ - Splanchnic diff --git a/share/data/states/Male_22_Fit_Soldier@0s.xml b/share/data/states/Male_22_Fit_Soldier@0s.xml index 54749bce1..2c5c17243 100644 --- a/share/data/states/Male_22_Fit_Soldier@0s.xml +++ b/share/data/states/Male_22_Fit_Soldier@0s.xml @@ -1,5 +1,5 @@ - + Male_22_Fit_Soldier @@ -177,7 +177,7 @@ - + @@ -313,7 +313,7 @@ - + @@ -363,7 +363,7 @@ - + @@ -386,7 +386,7 @@ - + @@ -419,7 +419,7 @@ - + @@ -444,7 +444,7 @@ - + @@ -467,7 +467,7 @@ - + @@ -515,7 +515,7 @@ - + @@ -571,7 +571,7 @@ - + @@ -594,7 +594,7 @@ - + @@ -619,7 +619,7 @@ - + @@ -644,7 +644,7 @@ - + @@ -685,7 +685,7 @@ - + @@ -912,7 +912,6 @@ - false false false @@ -1011,6 +1010,7 @@ + @@ -1160,16 +1160,13 @@ - - - @@ -1216,15 +1213,15 @@ false - + - - + + @@ -1237,9 +1234,9 @@ 77.6122029 38.5493429349855 - - - + + + @@ -1301,8 +1298,8 @@ - - + + @@ -1317,6 +1314,9 @@ 4 + + + @@ -1324,20 +1324,12 @@ Ambient Ambient - - - - Aorta Aorta1 Aorta2 Aorta3 - - - - Nitrogen @@ -1600,10 +1592,6 @@ Bladder Bladder - - - - Nitrogen @@ -1869,8 +1857,6 @@ BoneE3 BoneL1 BoneL2 - - Nitrogen @@ -2133,8 +2119,6 @@ BoneTissueIntracellular BoneI - - Nitrogen @@ -2398,10 +2382,6 @@ BoneVasculature Bone1 Bone2 - - - - Nitrogen @@ -2668,8 +2648,6 @@ BrainE3 BrainL1 BrainL2 - - Nitrogen @@ -2932,8 +2910,6 @@ BrainTissueIntracellular BrainI - - Nitrogen @@ -3198,276 +3174,269 @@ CerebralArteries CerebralCapillaries CerebralVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + CerebralArteries CerebralArteries1 CerebralArteries2 - - - - Nitrogen @@ -3730,10 +3699,6 @@ CerebralCapillaries CerebralCapillaries - - - - Nitrogen @@ -3996,8 +3961,6 @@ CerebralSpinalFluid SpinalFluid - - Nitrogen @@ -4261,10 +4224,6 @@ CerebralVeins1 CerebralVeins2 CerebralVeinsCheck - - - - Nitrogen @@ -4531,8 +4490,6 @@ FatE3 FatL1 FatL2 - - Nitrogen @@ -4795,8 +4752,6 @@ FatTissueIntracellular FatI - - Nitrogen @@ -5060,10 +5015,6 @@ FatVasculature Fat1 Fat2 - - - - Nitrogen @@ -5326,9 +5277,6 @@ Ground Ground - - - Nitrogen @@ -5449,8 +5397,6 @@ GutE3 GutL1 GutL2 - - Nitrogen @@ -5713,8 +5659,6 @@ GutTissueIntracellular GutI - - Nitrogen @@ -5979,266 +5923,263 @@ SplanchnicVasculature SmallIntestineVasculature LargeIntestineVasculature - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -6247,541 +6188,529 @@ LeftHeart RightHeart Pericardium - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + KidneyVasculature LeftKidneyVasculature RightKidneyVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LargeIntestineVasculature LargeIntestine1 - - - - Nitrogen @@ -7044,10 +6973,6 @@ LeftAfferentArteriole LeftAfferentArteriole - - - - Nitrogen @@ -7310,26 +7235,15 @@ LeftAlveoli LeftAlveoli - - - - LeftAlveoliLeak LeftAlveoliLeak - - - LeftArmVasculature LeftArm1 LeftArm2 - - - - Nitrogen @@ -7593,10 +7507,6 @@ LeftAtrium LeftAtrium1 LeftAtrium2 - - - - Nitrogen @@ -7860,10 +7770,6 @@ LeftBowmansCapsules LeftBowmansCapsules LeftNetBowmansCapsules - - - - Nitrogen @@ -8126,25 +8032,14 @@ LeftBronchi LeftBronchi - - - - LeftChestLeak LeftChestLeak - - - LeftEfferentArteriole LeftEfferentArteriole - - - - Nitrogen @@ -8408,10 +8303,6 @@ LeftGlomerularCapillaries LeftGlomerularCapillaries LeftNetGlomerularCapillaries - - - - Nitrogen @@ -8675,266 +8566,262 @@ LeftHeart LeftAtrium LeftVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -8944,8 +8831,6 @@ LeftKidneyE3 LeftKidneyL1 LeftKidneyL2 - - Nitrogen @@ -9208,8 +9093,6 @@ LeftKidneyTissueIntracellular LeftKidneyI - - Nitrogen @@ -9474,276 +9357,269 @@ LeftRenalArtery LeftNephron LeftRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftLegVasculature LeftLeg1 LeftLeg2 - - - - Nitrogen @@ -10007,10 +9883,6 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - - LeftLungTissueExtracellular @@ -10019,10 +9891,6 @@ LeftLungE3 LeftLungL1 LeftLungL2 - - - - Nitrogen @@ -10285,8 +10153,6 @@ LeftLungTissueIntracellular LeftLungI - - Nitrogen @@ -10551,266 +10417,263 @@ LeftPulmonaryArteries LeftPulmonaryCapillaries LeftPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -10821,276 +10684,269 @@ LeftPeritubularCapillaries LeftBowmansCapsules LeftTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftPeritubularCapillaries LeftPeritubularCapillaries LeftNetPeritubularCapillaries - - - - Nitrogen @@ -11354,19 +11210,11 @@ LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - LeftPulmonaryArteries LeftPulmonaryArteries LeftIntermediatePulmonaryArteries - - - - Nitrogen @@ -11629,10 +11477,6 @@ LeftPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen @@ -11895,10 +11739,6 @@ LeftPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen @@ -12161,10 +12001,6 @@ LeftRenalArtery LeftRenalArtery - - - - Nitrogen @@ -12427,10 +12263,6 @@ LeftRenalVein LeftRenalVein - - - - Nitrogen @@ -12694,10 +12526,6 @@ LeftTubules LeftTubules LeftNetTubules - - - - Nitrogen @@ -12960,10 +12788,6 @@ LeftUreter LeftUreter - - - - Nitrogen @@ -13226,10 +13050,6 @@ LeftVentricle LeftVentricle1 LeftVentricle2 - - - - Nitrogen @@ -13496,8 +13316,6 @@ LiverE3 LiverL1 LiverL2 - - Nitrogen @@ -13760,8 +13578,6 @@ LiverTissueIntracellular LiverI - - Nitrogen @@ -14027,9 +13843,6 @@ Liver2 PortalVein1 - - - Nitrogen @@ -14293,273 +14106,267 @@ LungsVasculature LeftLungVasculature RightLungVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + Lymph Lymph - - Nitrogen @@ -14821,16 +14628,10 @@ Mouth Mouth - - - - Mouthpiece Mouthpiece - - MuscleTissueExtracellular @@ -14839,8 +14640,6 @@ MuscleE3 MuscleL1 MuscleL2 - - Nitrogen @@ -15103,8 +14902,6 @@ MuscleTissueIntracellular MuscleI - - Nitrogen @@ -15368,10 +15165,6 @@ MuscleVasculature Muscle1 Muscle2 - - - - Nitrogen @@ -15638,8 +15431,6 @@ MyocardiumE3 MyocardiumL1 MyocardiumL2 - - Nitrogen @@ -15902,8 +15693,6 @@ MyocardiumTissueIntracellular MyocardiumI - - Nitrogen @@ -16167,10 +15956,6 @@ MyocardiumVasculature Myocardium1 Myocardium2 - - - - Nitrogen @@ -16433,10 +16218,6 @@ NeckArteries NeckArteries - - - - Nitrogen @@ -16699,10 +16480,6 @@ NeckVeins NeckVeins - - - - Nitrogen @@ -16965,8 +16742,6 @@ Pericardium Pericardium1 - - Nitrogen @@ -17230,825 +17005,801 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - PulmonaryArteries RightPulmonaryArteries LeftPulmonaryArteries - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryCapillaries RightPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - - PulmonaryVeins RightPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightAfferentArteriole RightAfferentArteriole - - - - Nitrogen @@ -18311,26 +18062,15 @@ RightAlveoli RightAlveoli - - - - RightAlveoliLeak RightAlveoliLeak - - - RightArmVasculature RightArm1 RightArm2 - - - - Nitrogen @@ -18594,10 +18334,6 @@ RightAtrium RightAtrium1 RightAtrium2 - - - - Nitrogen @@ -18861,10 +18597,6 @@ RightBowmansCapsules RightBowmansCapsules RightNetBowmansCapsules - - - - Nitrogen @@ -19127,25 +18859,14 @@ RightBronchi RightBronchi - - - - RightChestLeak RightChestLeak - - - RightEfferentArteriole RightEfferentArteriole - - - - Nitrogen @@ -19409,10 +19130,6 @@ RightGlomerularCapillaries RightGlomerularCapillaries RightNetGlomerularCapillaries - - - - Nitrogen @@ -19676,266 +19393,262 @@ RightHeart RightAtrium RightVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -19945,8 +19658,6 @@ RightKidneyE3 RightKidneyL1 RightKidneyL2 - - Nitrogen @@ -20209,8 +19920,6 @@ RightKidneyTissueIntracellular RightKidneyI - - Nitrogen @@ -20475,276 +20184,269 @@ RightRenalArtery RightNephron RightRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightLegVasculature RightLeg1 RightLeg2 - - - - Nitrogen @@ -21008,10 +20710,6 @@ RightLungPulmonary RightBronchi RightAlveoli - - - - RightLungTissueExtracellular @@ -21020,8 +20718,6 @@ RightLungE3 RightLungL1 RightLungL2 - - Nitrogen @@ -21284,8 +20980,6 @@ RightLungTissueIntracellular RightLungI - - Nitrogen @@ -21550,266 +21244,263 @@ RightPulmonaryArteries RightPulmonaryCapillaries RightPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -21820,276 +21511,269 @@ RightPeritubularCapillaries RightBowmansCapsules RightTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightPeritubularCapillaries RightPeritubularCapillaries RightNetPeritubularCapillaries - - - - Nitrogen @@ -22353,19 +22037,11 @@ RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - RightPulmonaryArteries RightPulmonaryArteries RightIntermediatePulmonaryArteries - - - - Nitrogen @@ -22628,10 +22304,6 @@ RightPulmonaryCapillaries RightPulmonaryCapillaries - - - - Nitrogen @@ -22894,10 +22566,6 @@ RightPulmonaryVeins RightPulmonaryVeins - - - - Nitrogen @@ -23160,10 +22828,6 @@ RightRenalArtery RightRenalArtery - - - - Nitrogen @@ -23426,10 +23090,6 @@ RightRenalVein RightRenalVein - - - - Nitrogen @@ -23693,10 +23353,6 @@ RightTubules RightTubules RightNetTubules - - - - Nitrogen @@ -23959,10 +23615,6 @@ RightUreter RightUreter - - - - Nitrogen @@ -24226,10 +23878,6 @@ RightVentricle1 RightVentricle2 MainPulmonaryArteries - - - - Nitrogen @@ -24496,8 +24144,6 @@ SkinE3 SkinL1 SkinL2 - - Nitrogen @@ -24760,8 +24406,6 @@ SkinTissueIntracellular SkinI - - Nitrogen @@ -25025,10 +24669,6 @@ SkinVasculature Skin1 Skin2 - - - - Nitrogen @@ -25291,8 +24931,6 @@ SmallIntestineChyme SmallIntestineC1 - - Nitrogen @@ -25554,10 +25192,6 @@ SmallIntestineVasculature SmallIntestine1 - - - - Nitrogen @@ -25820,10 +25454,6 @@ SplanchnicVasculature Splanchnic1 - - - - Nitrogen @@ -26090,8 +25720,6 @@ SpleenE3 SpleenL1 SpleenL2 - - Nitrogen @@ -26354,8 +25982,6 @@ SpleenTissueIntracellular SpleenI - - Nitrogen @@ -26618,10 +26244,6 @@ SpleenVasculature Spleen1 - - - - Nitrogen @@ -26884,290 +26506,276 @@ Stomach Stomach - - - - Trachea Trachea - - - - Ureters RightUreter LeftUreter - - - - Nitrogen - - + + - - + + Oxygen - - + + - - + + + CarbonDioxide - - + + - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + VenaCava VenaCava - - - - Nitrogen @@ -27432,189 +27040,162 @@ AortaBleed Aorta Ground - AortaToBone Aorta1ToBone1 Aorta BoneVasculature - AortaToFat Aorta1ToFat1 Aorta FatVasculature - AortaToLargeIntestine Aorta1ToLargeIntestine Aorta LargeIntestineVasculature - AortaToLeftArm Aorta1ToLeftArm1 Aorta LeftArmVasculature - AortaToLeftKidney LeftAortaConnectionToRenalArtery Aorta LeftRenalArtery - AortaToLeftLeg Aorta1ToLeftLeg1 Aorta LeftLegVasculature - AortaToLiver Aorta1ToLiver1 Aorta LiverVasculature - AortaToMuscle Aorta1ToMuscle1 Aorta MuscleVasculature - AortaToMyocardium Aorta1ToMyocardium1 Aorta MyocardiumVasculature - AortaToNeckArteries Aorta1ToNeckArteries Aorta NeckArteries - AortaToRightArm Aorta1ToRightArm1 Aorta RightArmVasculature - AortaToRightKidney RightAortaConnectionToRenalArtery Aorta RightRenalArtery - AortaToRightLeg Aorta1ToRightLeg1 Aorta RightLegVasculature - AortaToSkin Aorta1ToSkin1 Aorta SkinVasculature - AortaToSmallIntestine Aorta1ToSmallIntestine Aorta SmallIntestineVasculature - AortaToSplanchnic Aorta1ToSplanchnic Aorta SplanchnicVasculature - AortaToSpleen Aorta1ToSpleen Aorta SpleenVasculature - BladderToGround BladderToGroundUrinate Bladder Ground - BladderToGroundSource BladderToGroundPressure Bladder Ground - BoneToVenaCava Bone2ToVenaCava BoneVasculature VenaCava - BrainHemorrhage BrainBleed CerebralCapillaries Ground - CerebralArteriesToCerebralCapillaries CerebralArteries2ToCapillaries CerebralArteries CerebralCapillaries - CerebralCapillariesToCerebralVeins CerebralCapillariesToCerebralVeins1 CerebralCapillaries CerebralVeins - CerebralVeinsToNeckVeins CerebralVeins2ToNeckVeins CerebralVeins NeckVeins - EnvironmentToLeftChestLeak EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -27627,266 +27208,228 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - FatToVenaCava Fat2ToVenaCava FatVasculature VenaCava - HeartHemorrhage MyocardiumBleed MyocardiumVasculature Ground - LargeIntestineHemorrhage LargeIntestineBleed LargeIntestineVasculature Ground - LargeIntestineToLiver LargeIntestineToPortalVein LargeIntestineVasculature LiverVasculature - LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArteriole LeftGlomerularCapillaries - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftArmHemorrhage LeftArmBleed LeftArmVasculature Ground - LeftArmToVenaCava LeftArm2ToVenaCava LeftArmVasculature VenaCava - LeftAtriumToLeftVentricle LeftAtrium2ToLeftVentricle1 LeftAtrium LeftVentricle - LeftBowmansCapsulesToTubules LeftBowmansCapsulesToTubules LeftBowmansCapsules LeftTubules - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArteriole LeftPeritubularCapillaries - LeftGlomerularCapillariesToBowmansCapsules LeftNetGlomerularCapillariesToNetBowmansCapsules LeftGlomerularCapillaries LeftBowmansCapsules - LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillaries LeftEfferentArteriole - LeftKidneyHemorrhage LeftKidneyBleed LeftRenalVein Ground - LeftKidneyToVenaCava LeftRenalVeinToVenaCavaConnection LeftRenalVein VenaCava - LeftLegHemorrhage LeftLegBleed LeftLegVasculature Ground - LeftLegToVenaCava LeftLeg2ToVenaCava LeftLegVasculature VenaCava - LeftLungHemorrhage LeftLungBleed LeftPulmonaryArteries Ground - LeftLungVascularToTissue LeftLungVToLeftLungE1 LeftLungVasculature LeftLungTissueExtracellular - LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillaries LeftRenalVein - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - LeftPulmonaryArteriesToCapillaries LeftPulmonaryArteriesToLeftPulmonaryCapillaries LeftPulmonaryArteries LeftPulmonaryCapillaries - LeftPulmonaryArteriesToVeins LeftPulmonaryArteriesToLeftPulmonaryVeins LeftPulmonaryArteries LeftPulmonaryVeins - LeftPulmonaryCapillariesToVeins LeftPulmonaryCapillariesToLeftPulmonaryVeins LeftPulmonaryCapillaries LeftPulmonaryVeins - LeftPulmonaryVeinsToLeftAtrium LeftIntermediatePulmonaryVeinsToLeftAtrium1 LeftPulmonaryVeins LeftAtrium - LeftRenalArteryToAfferentArteriole LeftRenalArteryToAfferentArteriole LeftRenalArtery LeftAfferentArteriole - LeftTubulesToPeritubularCapillaries LeftNetTubulesToNetPeritubularCapillaries LeftTubules LeftPeritubularCapillaries - LeftTubulesToUreter LeftTubulesToUreter LeftTubules LeftUreter - LeftUreterToBladder LeftUreterToBladder LeftUreter Bladder - LeftVentricleToAorta LeftVentricle1ToAorta2 LeftVentricle Aorta - LiverHemorrhage LiverBleed LiverVasculature Ground - LiverToVenaCava Liver2ToVenaCava LiverVasculature VenaCava - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -27899,315 +27442,270 @@ Muscle2ToVenaCava MuscleVasculature VenaCava - MyocardiumToVenaCava Myocardium2ToVenaCava MyocardiumVasculature VenaCava - NeckArteriesToCerebralArteries NeckArteriesToCerebralArteries1 NeckArteries CerebralArteries - NeckVeinsToVenaCava NeckVeinsToVenaCava NeckVeins VenaCava - RightAfferentArterioleToGlomerularCapillaries RightAfferentArterioleToGlomerularCapillaries RightAfferentArteriole RightGlomerularCapillaries - RightAlveoliLeakToRightPleuralCavity RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightArmHemorrhage RightArmBleed RightArmVasculature Ground - RightArmToVenaCava RightArm2ToVenaCava RightArmVasculature VenaCava - RightAtriumToRightVentricle RightAtrium2ToRightVentricle1 RightAtrium RightVentricle - RightBowmansCapsulesToTubules RightBowmansCapsulesToTubules RightBowmansCapsules RightTubules - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightEfferentArterioleToPeritubularCapillaries RightEfferentArterioleToPeritubularCapillaries RightEfferentArteriole RightPeritubularCapillaries - RightGlomerularCapillariesToBowmansCapsules RightNetGlomerularCapillariesToNetBowmansCapsules RightGlomerularCapillaries RightBowmansCapsules - RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillaries RightEfferentArteriole - RightKidneyHemorrhage RightKidneyBleed RightRenalVein Ground - RightKidneyToVenaCava RightRenalVeinToVenaCavaConnection RightRenalVein VenaCava - RightLegHemorrhage RightLegBleed RightLegVasculature Ground - RightLegToVenaCava RightLeg2ToVenaCava RightLegVasculature VenaCava - RightLungHemorrhage RightLungBleed RightPulmonaryArteries Ground - RightPeritubularCapillariesToRenalVein RightPeritubularCapillariesToRenalVein RightPeritubularCapillaries RightRenalVein - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - RightPulmonaryArteriesToCapillaries RightPulmonaryArteriesToRightPulmonaryCapillaries RightPulmonaryArteries RightPulmonaryCapillaries - RightPulmonaryArteriesToVeins RightPulmonaryArteriesToRightPulmonaryVeins RightPulmonaryArteries RightPulmonaryVeins - RightPulmonaryCapillariesToVeins RightPulmonaryCapillariesToRightPulmonaryVeins RightPulmonaryCapillaries RightPulmonaryVeins - RightPulmonaryVeinsToLeftAtrium RightIntermediatePulmonaryVeinsToLeftAtrium1 RightPulmonaryVeins LeftAtrium - RightRenalArteryToAfferentArteriole RightRenalArteryToAfferentArteriole RightRenalArtery RightAfferentArteriole - RightTubulesToPeritubularCapillaries RightNetTubulesToNetPeritubularCapillaries RightTubules RightPeritubularCapillaries - RightTubulesToUreter RightTubulesToUreter RightTubules RightUreter - RightUreterToBladder RightUreterToBladder RightUreter Bladder - RightVentricleToLeftPulmonaryArteries MainPulmonaryArteriesToLeftIntermediatePulmonaryArteries RightVentricle LeftPulmonaryArteries - RightVentricleToRightPulmonaryArteries MainPulmonaryArteriesToRightIntermediatePulmonaryArteries RightVentricle RightPulmonaryArteries - SkinToVenaCava Skin2ToVenaCava SkinVasculature VenaCava - SmallIntestineHemorrhage SmallIntestineBleed SmallIntestineVasculature Ground - SmallIntestineToLiver SmallIntestineToPortalVein SmallIntestineVasculature LiverVasculature - SplanchnicHemorrhage SplanchnicBleed SplanchnicVasculature Ground - SplanchnicToLiver SplanchnicToPortalVein SplanchnicVasculature LiverVasculature - SpleenHemorrhage SpleenBleed SpleenVasculature Ground - SpleenToLiver SpleenToPortalVein SpleenVasculature LiverVasculature - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VenaCavaHemorrhage VenaCavaBleed VenaCava Ground - VenaCavaIV IVToVenaCava Ground VenaCava - VenaCavaToRightAtrium VenaCavaToRightAtrium1 VenaCava RightAtrium - Nitrogen Oxygen @@ -28633,10 +28131,6 @@ Ambient Ambient - - - - Nitrogen @@ -28659,10 +28153,6 @@ AnesthesiaConnection AnesthesiaConnection - - - - Nitrogen @@ -28685,7 +28175,6 @@ Connection MechanicalVentilatorConnection - Nitrogen @@ -28708,10 +28197,6 @@ ExpiratoryLimb ExpiratoryLimb - - - - Nitrogen @@ -28734,10 +28219,6 @@ GasInlet GasInlet - - - - Nitrogen @@ -28760,10 +28241,6 @@ GasSource GasSource - - - - Nitrogen @@ -28786,10 +28263,6 @@ InspiratoryLimb InspiratoryLimb - - - - Nitrogen @@ -28812,10 +28285,6 @@ LeftAlveoli LeftAlveoli - - - - Nitrogen @@ -28838,9 +28307,6 @@ LeftAlveoliLeak LeftAlveoliLeak - - - Nitrogen @@ -28854,10 +28320,6 @@ LeftBronchi LeftBronchi - - - - Nitrogen @@ -28880,9 +28342,6 @@ LeftChestLeak LeftChestLeak - - - Nitrogen @@ -28897,37 +28356,31 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - Nitrogen @@ -28950,10 +28403,6 @@ Mouth Mouth - - - - Nitrogen @@ -28976,8 +28425,6 @@ Mouthpiece Mouthpiece - - Nitrogen @@ -29000,7 +28447,6 @@ Nosepiece Nosepiece - Nitrogen @@ -29023,7 +28469,6 @@ OxygenTank OxygenTank - Nitrogen @@ -29047,62 +28492,53 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + ReliefValve ReliefValve - - - Nitrogen @@ -29125,10 +28561,6 @@ RightAlveoli RightAlveoli - - - - Nitrogen @@ -29151,9 +28583,6 @@ RightAlveoliLeak RightAlveoliLeak - - - Nitrogen @@ -29167,10 +28596,6 @@ RightBronchi RightBronchi - - - - Nitrogen @@ -29193,9 +28618,6 @@ RightChestLeak RightChestLeak - - - Nitrogen @@ -29210,37 +28632,30 @@ RightLungPulmonary RightBronchi RightAlveoli - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - Nitrogen @@ -29263,10 +28678,6 @@ Scrubber Scrubber - - - - Nitrogen @@ -29289,10 +28700,6 @@ Selector Selector - - - - Nitrogen @@ -29315,10 +28722,6 @@ Stomach Stomach - - - - Nitrogen @@ -29341,10 +28744,6 @@ Trachea Trachea - - - - Nitrogen @@ -29368,10 +28767,6 @@ Ventilator Ventilator VentilatorConnection - - - - Nitrogen @@ -29415,10 +28810,6 @@ YPiece YPiece - - - - Nitrogen @@ -29443,7 +28834,6 @@ AnesthesiaConnectionToEnvironment AnesthesiaConnection Ambient - ConnectionToMouth @@ -29456,14 +28846,12 @@ EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -29482,98 +28870,84 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - Exhaust SelectorToEnvironment Selector Ambient - ExpiratoryLimbToSelector ExpiratoryLimbToSelector ExpiratoryLimb Selector - GasInletToInspiratoryLimb GasInletToInspiratoryLimb GasInlet InspiratoryLimb - GasSourceToGasInlet GasSourceToGasInlet GasSource GasInlet - InspiratoryLimbToYPiece InspiratoryLimbToYPiece InspiratoryLimb YPiece - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - Mask AnesthesiaConnectionToMouth AnesthesiaConnection Mouth - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -29604,91 +28978,78 @@ RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - ScrubberToGasInlet ScrubberToGasInlet Scrubber GasInlet - SelectorToReliefValve SelectorToReliefValve Selector ReliefValve - SelectorToScrubber SelectorToScrubber Selector Scrubber - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VentilatorToSelector VentilatorConnectionToSelector Ventilator Selector - YPieceToAnesthesiaConnection YPieceToAnesthesiaConnection YPiece AnesthesiaConnection - YPieceToExpiratoryLimb YPieceToExpiratoryLimb YPiece ExpiratoryLimb - Nitrogen Oxygen @@ -29922,477 +29283,364 @@ Active Active - - - Ambient Ambient - - - Clothing Clothing - - - Enclosure Enclosure - - - ExternalCore ExternalCore - - - ExternalGround ExternalGround - - - ExternalHeadSkin ExternalHeadSkin - - - ExternalLeftArmSkin ExternalLeftArmSkin - - - ExternalLeftLegSkin ExternalLeftLegSkin - - - ExternalRightArmSkin ExternalRightArmSkin - - - ExternalRightLegSkin ExternalRightLegSkin - - - ExternalTorsoSkin ExternalTorsoSkin - - - InternalCore InternalCore InternalGround - - - - InternalGround - - InternalHeadSkin InternalHeadSkin - - - - InternalLeftArmSkin InternalLeftArmSkin - - - - InternalLeftLegSkin InternalLeftLegSkin - - - - InternalRightArmSkin InternalRightArmSkin - - - - InternalRightLegSkin InternalRightLegSkin - - - - InternalTorsoSkin InternalTorsoSkin - - - - ActiveToClothing ActiveToClothing Active Clothing - ClothingToEnclosure ClothingToEnclosure Clothing Enclosure - ClothingToEnvironment ClothingToEnvironment Clothing Ambient - ExternalCoreToGround ExternalCoreToGround ExternalCore ExternalGround - ExternalHeadSkinToClothing ExternalHeadSkinToClothing ExternalHeadSkin Clothing - ExternalHeadSkinToGround ExternalHeadSkinToGround ExternalHeadSkin ExternalGround - ExternalLeftArmSkinToClothing ExternalLeftArmSkinToClothing ExternalLeftArmSkin Clothing - ExternalLeftArmSkinToGround ExternalLeftArmSkinToGround ExternalLeftArmSkin ExternalGround - ExternalLeftLegSkinToClothing ExternalLeftLegSkinToClothing ExternalLeftLegSkin Clothing - ExternalLeftLegSkinToGround ExternalLeftLegSkinToGround ExternalLeftLegSkin ExternalGround - ExternalRightArmSkinToClothing ExternalRightArmSkinToClothing ExternalRightArmSkin Clothing - ExternalRightArmSkinToGround ExternalRightArmSkinToGround ExternalRightArmSkin ExternalGround - ExternalRightLegSkinToClothing ExternalRightLegSkinToClothing ExternalRightLegSkin Clothing - ExternalRightLegSkinToGround ExternalRightLegSkinToGround ExternalRightLegSkin ExternalGround - ExternalTorsoSkinToClothing ExternalTorsoSkinToClothing ExternalTorsoSkin Clothing - ExternalTorsoSkinToGround ExternalTorsoSkinToGround ExternalTorsoSkin ExternalGround - GroundToActive GroundToActive ExternalGround Active - GroundToClothing GroundToClothing ExternalGround Clothing - GroundToEnclosure GroundToEnclosure ExternalGround Enclosure - GroundToEnvironment GroundToEnvironment ExternalGround Ambient - GroundToInternalCore GroundToInternalCore InternalGround InternalCore - GroundToInternalHeadSkin GroundToInternalHeadSkin InternalGround InternalHeadSkin - GroundToInternalLeftArmSkin GroundToInternalLeftArmSkin InternalGround InternalLeftArmSkin - GroundToInternalLeftLegSkin GroundToInternalLeftLegSkin InternalGround InternalLeftLegSkin - GroundToInternalRightArmSkin GroundToInternalRightArmSkin InternalGround InternalRightArmSkin - GroundToInternalRightLegSkin GroundToInternalRightLegSkin InternalGround InternalRightLegSkin - GroundToInternalTorsoSkin GroundToInternalTorsoSkin InternalGround InternalTorsoSkin - InternalCoreToExternalCore InternalCoreToExternalCore InternalCore ExternalCore - InternalCoreToGround InternalCoreToGround InternalGround InternalCore - InternalCoreToInternalHeadSkin InternalCoreToInternalHeadSkin InternalCore InternalHeadSkin - InternalCoreToInternalLeftArmSkin InternalCoreToInternalLeftArmSkin InternalCore InternalLeftArmSkin - InternalCoreToInternalLeftLegSkin InternalCoreToInternalLeftLegSkin InternalCore InternalLeftLegSkin - InternalCoreToInternalRightArmSkin InternalCoreToInternalRightArmSkin InternalCore InternalRightArmSkin - InternalCoreToInternalRightLegSkin InternalCoreToInternalRightLegSkin InternalCore InternalRightLegSkin - InternalCoreToInternalTorsoSkin InternalCoreToInternalTorsoSkin InternalCore InternalTorsoSkin - InternalHeadSkinToExternalHeadSkin InternalHeadSkinToExternalHeadSkin InternalHeadSkin ExternalHeadSkin - InternalHeadSkinToGround InternalHeadSkinToTemperatureGround InternalGround InternalHeadSkin - InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkin ExternalLeftArmSkin - InternalLeftArmSkinToGround InternalLeftArmSkinToTemperatureGround InternalGround InternalLeftArmSkin - InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkin ExternalLeftLegSkin - InternalLeftLegSkinToGround InternalLeftLegSkinToTemperatureGround InternalGround InternalLeftLegSkin - InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkin ExternalRightArmSkin - InternalRightArmSkinToGround InternalRightArmSkinToTemperatureGround InternalGround InternalRightArmSkin - InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkin ExternalRightLegSkin - InternalRightLegSkinToGround InternalRightLegSkinToTemperatureGround InternalGround InternalRightLegSkin - InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkin ExternalTorsoSkin - InternalTorsoSkinToGround InternalTorsoSkinToTemperatureGround InternalGround InternalTorsoSkin - BoneTissue @@ -30566,7 +29814,6 @@ - Off @@ -30975,7 +30222,6 @@ - @@ -31002,15 +30248,15 @@ On - + - + - + - + @@ -32357,7 +31603,6 @@ - Extrasplanchnic @@ -32368,7 +31613,6 @@ - Extrasplanchnic @@ -32389,7 +31633,6 @@ - Splanchnic @@ -32400,7 +31643,6 @@ - Extrasplanchnic @@ -32418,7 +31660,6 @@ - Extrasplanchnic @@ -32429,7 +31670,6 @@ - Splanchnic @@ -32440,7 +31680,6 @@ - Muscle @@ -32451,7 +31690,6 @@ - Myocardium @@ -32462,7 +31700,6 @@ - Cerebral @@ -32473,7 +31710,6 @@ - Extrasplanchnic @@ -32491,7 +31727,6 @@ - Extrasplanchnic @@ -32502,7 +31737,6 @@ - Extrasplanchnic @@ -32513,7 +31747,6 @@ - Splanchnic @@ -32524,7 +31757,6 @@ - Splanchnic @@ -32535,7 +31767,6 @@ - Splanchnic @@ -32593,7 +31824,6 @@ - Extrasplanchnic @@ -32826,7 +32056,6 @@ - Cerebral @@ -32847,7 +32076,6 @@ - Cerebral @@ -32868,7 +32096,6 @@ - Cerebral @@ -32982,7 +32209,6 @@ - Extrasplanchnic @@ -33265,7 +32491,6 @@ - Splanchnic @@ -33344,7 +32569,6 @@ - Extrasplanchnic @@ -33628,7 +32852,6 @@ - Extrasplanchnic @@ -34001,7 +33224,6 @@ - Splanchnic @@ -34206,7 +33428,6 @@ - Muscle @@ -34323,7 +33544,6 @@ - Myocardium @@ -34440,7 +33660,6 @@ - Cerebral @@ -34471,7 +33690,6 @@ - Cerebral @@ -34515,7 +33733,6 @@ - Splanchnic @@ -34589,7 +33806,6 @@ - Extrasplanchnic @@ -34873,7 +34089,6 @@ - Extrasplanchnic @@ -35285,7 +34500,6 @@ - Extrasplanchnic @@ -35432,7 +34646,6 @@ - Splanchnic @@ -35493,7 +34706,6 @@ - Splanchnic @@ -35613,7 +34825,6 @@ - Splanchnic diff --git a/share/data/states/Male_24_Normal_hidrosis2@0s.xml b/share/data/states/Male_24_Normal_hidrosis2@0s.xml index eb21f9462..341bb9a34 100644 --- a/share/data/states/Male_24_Normal_hidrosis2@0s.xml +++ b/share/data/states/Male_24_Normal_hidrosis2@0s.xml @@ -1,5 +1,5 @@ - + Male_24_Normal_hidrosis2 @@ -177,7 +177,7 @@ - + @@ -313,7 +313,7 @@ - + @@ -363,7 +363,7 @@ - + @@ -386,7 +386,7 @@ - + @@ -419,7 +419,7 @@ - + @@ -444,7 +444,7 @@ - + @@ -467,7 +467,7 @@ - + @@ -515,7 +515,7 @@ - + @@ -571,7 +571,7 @@ - + @@ -594,7 +594,7 @@ - + @@ -619,7 +619,7 @@ - + @@ -644,7 +644,7 @@ - + @@ -685,7 +685,7 @@ - + @@ -912,7 +912,6 @@ - false false false @@ -1011,6 +1010,7 @@ + @@ -1160,16 +1160,13 @@ - - - @@ -1216,15 +1213,15 @@ false - + - - + + @@ -1237,9 +1234,9 @@ 67.5015 33.1068531987345 - - - + + + @@ -1301,8 +1298,8 @@ - - + + @@ -1317,6 +1314,9 @@ + + + @@ -1324,20 +1324,12 @@ Ambient Ambient - - - - Aorta Aorta1 Aorta2 Aorta3 - - - - Nitrogen @@ -1600,10 +1592,6 @@ Bladder Bladder - - - - Nitrogen @@ -1869,8 +1857,6 @@ BoneE3 BoneL1 BoneL2 - - Nitrogen @@ -2133,8 +2119,6 @@ BoneTissueIntracellular BoneI - - Nitrogen @@ -2398,10 +2382,6 @@ BoneVasculature Bone1 Bone2 - - - - Nitrogen @@ -2668,8 +2648,6 @@ BrainE3 BrainL1 BrainL2 - - Nitrogen @@ -2932,8 +2910,6 @@ BrainTissueIntracellular BrainI - - Nitrogen @@ -3198,276 +3174,269 @@ CerebralArteries CerebralCapillaries CerebralVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + CerebralArteries CerebralArteries1 CerebralArteries2 - - - - Nitrogen @@ -3730,10 +3699,6 @@ CerebralCapillaries CerebralCapillaries - - - - Nitrogen @@ -3996,8 +3961,6 @@ CerebralSpinalFluid SpinalFluid - - Nitrogen @@ -4261,10 +4224,6 @@ CerebralVeins1 CerebralVeins2 CerebralVeinsCheck - - - - Nitrogen @@ -4531,8 +4490,6 @@ FatE3 FatL1 FatL2 - - Nitrogen @@ -4795,8 +4752,6 @@ FatTissueIntracellular FatI - - Nitrogen @@ -5060,10 +5015,6 @@ FatVasculature Fat1 Fat2 - - - - Nitrogen @@ -5326,9 +5277,6 @@ Ground Ground - - - Nitrogen @@ -5449,8 +5397,6 @@ GutE3 GutL1 GutL2 - - Nitrogen @@ -5713,8 +5659,6 @@ GutTissueIntracellular GutI - - Nitrogen @@ -5979,266 +5923,263 @@ SplanchnicVasculature SmallIntestineVasculature LargeIntestineVasculature - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -6247,541 +6188,529 @@ LeftHeart RightHeart Pericardium - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + KidneyVasculature LeftKidneyVasculature RightKidneyVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LargeIntestineVasculature LargeIntestine1 - - - - Nitrogen @@ -7044,10 +6973,6 @@ LeftAfferentArteriole LeftAfferentArteriole - - - - Nitrogen @@ -7310,26 +7235,15 @@ LeftAlveoli LeftAlveoli - - - - LeftAlveoliLeak LeftAlveoliLeak - - - LeftArmVasculature LeftArm1 LeftArm2 - - - - Nitrogen @@ -7593,10 +7507,6 @@ LeftAtrium LeftAtrium1 LeftAtrium2 - - - - Nitrogen @@ -7860,10 +7770,6 @@ LeftBowmansCapsules LeftBowmansCapsules LeftNetBowmansCapsules - - - - Nitrogen @@ -8126,25 +8032,14 @@ LeftBronchi LeftBronchi - - - - LeftChestLeak LeftChestLeak - - - LeftEfferentArteriole LeftEfferentArteriole - - - - Nitrogen @@ -8408,10 +8303,6 @@ LeftGlomerularCapillaries LeftGlomerularCapillaries LeftNetGlomerularCapillaries - - - - Nitrogen @@ -8675,266 +8566,262 @@ LeftHeart LeftAtrium LeftVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -8944,8 +8831,6 @@ LeftKidneyE3 LeftKidneyL1 LeftKidneyL2 - - Nitrogen @@ -9208,8 +9093,6 @@ LeftKidneyTissueIntracellular LeftKidneyI - - Nitrogen @@ -9474,276 +9357,269 @@ LeftRenalArtery LeftNephron LeftRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftLegVasculature LeftLeg1 LeftLeg2 - - - - Nitrogen @@ -10007,10 +9883,6 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - - LeftLungTissueExtracellular @@ -10019,10 +9891,6 @@ LeftLungE3 LeftLungL1 LeftLungL2 - - - - Nitrogen @@ -10285,8 +10153,6 @@ LeftLungTissueIntracellular LeftLungI - - Nitrogen @@ -10551,266 +10417,263 @@ LeftPulmonaryArteries LeftPulmonaryCapillaries LeftPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -10821,276 +10684,269 @@ LeftPeritubularCapillaries LeftBowmansCapsules LeftTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftPeritubularCapillaries LeftPeritubularCapillaries LeftNetPeritubularCapillaries - - - - Nitrogen @@ -11354,19 +11210,11 @@ LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - LeftPulmonaryArteries LeftPulmonaryArteries LeftIntermediatePulmonaryArteries - - - - Nitrogen @@ -11629,10 +11477,6 @@ LeftPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen @@ -11895,10 +11739,6 @@ LeftPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen @@ -12161,10 +12001,6 @@ LeftRenalArtery LeftRenalArtery - - - - Nitrogen @@ -12427,10 +12263,6 @@ LeftRenalVein LeftRenalVein - - - - Nitrogen @@ -12694,10 +12526,6 @@ LeftTubules LeftTubules LeftNetTubules - - - - Nitrogen @@ -12960,10 +12788,6 @@ LeftUreter LeftUreter - - - - Nitrogen @@ -13226,10 +13050,6 @@ LeftVentricle LeftVentricle1 LeftVentricle2 - - - - Nitrogen @@ -13496,8 +13316,6 @@ LiverE3 LiverL1 LiverL2 - - Nitrogen @@ -13760,8 +13578,6 @@ LiverTissueIntracellular LiverI - - Nitrogen @@ -14027,9 +13843,6 @@ Liver2 PortalVein1 - - - Nitrogen @@ -14293,273 +14106,267 @@ LungsVasculature LeftLungVasculature RightLungVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + Lymph Lymph - - Nitrogen @@ -14821,16 +14628,10 @@ Mouth Mouth - - - - Mouthpiece Mouthpiece - - MuscleTissueExtracellular @@ -14839,8 +14640,6 @@ MuscleE3 MuscleL1 MuscleL2 - - Nitrogen @@ -15103,8 +14902,6 @@ MuscleTissueIntracellular MuscleI - - Nitrogen @@ -15368,10 +15165,6 @@ MuscleVasculature Muscle1 Muscle2 - - - - Nitrogen @@ -15638,8 +15431,6 @@ MyocardiumE3 MyocardiumL1 MyocardiumL2 - - Nitrogen @@ -15902,8 +15693,6 @@ MyocardiumTissueIntracellular MyocardiumI - - Nitrogen @@ -16167,10 +15956,6 @@ MyocardiumVasculature Myocardium1 Myocardium2 - - - - Nitrogen @@ -16433,10 +16218,6 @@ NeckArteries NeckArteries - - - - Nitrogen @@ -16699,10 +16480,6 @@ NeckVeins NeckVeins - - - - Nitrogen @@ -16965,8 +16742,6 @@ Pericardium Pericardium1 - - Nitrogen @@ -17230,825 +17005,801 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - PulmonaryArteries RightPulmonaryArteries LeftPulmonaryArteries - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryCapillaries RightPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - - PulmonaryVeins RightPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightAfferentArteriole RightAfferentArteriole - - - - Nitrogen @@ -18311,26 +18062,15 @@ RightAlveoli RightAlveoli - - - - RightAlveoliLeak RightAlveoliLeak - - - RightArmVasculature RightArm1 RightArm2 - - - - Nitrogen @@ -18594,10 +18334,6 @@ RightAtrium RightAtrium1 RightAtrium2 - - - - Nitrogen @@ -18861,10 +18597,6 @@ RightBowmansCapsules RightBowmansCapsules RightNetBowmansCapsules - - - - Nitrogen @@ -19127,25 +18859,14 @@ RightBronchi RightBronchi - - - - RightChestLeak RightChestLeak - - - RightEfferentArteriole RightEfferentArteriole - - - - Nitrogen @@ -19409,10 +19130,6 @@ RightGlomerularCapillaries RightGlomerularCapillaries RightNetGlomerularCapillaries - - - - Nitrogen @@ -19676,266 +19393,262 @@ RightHeart RightAtrium RightVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -19945,8 +19658,6 @@ RightKidneyE3 RightKidneyL1 RightKidneyL2 - - Nitrogen @@ -20209,8 +19920,6 @@ RightKidneyTissueIntracellular RightKidneyI - - Nitrogen @@ -20475,276 +20184,269 @@ RightRenalArtery RightNephron RightRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightLegVasculature RightLeg1 RightLeg2 - - - - Nitrogen @@ -21008,10 +20710,6 @@ RightLungPulmonary RightBronchi RightAlveoli - - - - RightLungTissueExtracellular @@ -21020,8 +20718,6 @@ RightLungE3 RightLungL1 RightLungL2 - - Nitrogen @@ -21284,8 +20980,6 @@ RightLungTissueIntracellular RightLungI - - Nitrogen @@ -21550,266 +21244,263 @@ RightPulmonaryArteries RightPulmonaryCapillaries RightPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -21820,276 +21511,269 @@ RightPeritubularCapillaries RightBowmansCapsules RightTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightPeritubularCapillaries RightPeritubularCapillaries RightNetPeritubularCapillaries - - - - Nitrogen @@ -22353,19 +22037,11 @@ RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - RightPulmonaryArteries RightPulmonaryArteries RightIntermediatePulmonaryArteries - - - - Nitrogen @@ -22628,10 +22304,6 @@ RightPulmonaryCapillaries RightPulmonaryCapillaries - - - - Nitrogen @@ -22894,10 +22566,6 @@ RightPulmonaryVeins RightPulmonaryVeins - - - - Nitrogen @@ -23160,10 +22828,6 @@ RightRenalArtery RightRenalArtery - - - - Nitrogen @@ -23426,10 +23090,6 @@ RightRenalVein RightRenalVein - - - - Nitrogen @@ -23693,10 +23353,6 @@ RightTubules RightTubules RightNetTubules - - - - Nitrogen @@ -23959,10 +23615,6 @@ RightUreter RightUreter - - - - Nitrogen @@ -24226,10 +23878,6 @@ RightVentricle1 RightVentricle2 MainPulmonaryArteries - - - - Nitrogen @@ -24496,8 +24144,6 @@ SkinE3 SkinL1 SkinL2 - - Nitrogen @@ -24760,8 +24406,6 @@ SkinTissueIntracellular SkinI - - Nitrogen @@ -25025,10 +24669,6 @@ SkinVasculature Skin1 Skin2 - - - - Nitrogen @@ -25291,8 +24931,6 @@ SmallIntestineChyme SmallIntestineC1 - - Nitrogen @@ -25554,10 +25192,6 @@ SmallIntestineVasculature SmallIntestine1 - - - - Nitrogen @@ -25820,10 +25454,6 @@ SplanchnicVasculature Splanchnic1 - - - - Nitrogen @@ -26090,8 +25720,6 @@ SpleenE3 SpleenL1 SpleenL2 - - Nitrogen @@ -26354,8 +25982,6 @@ SpleenTissueIntracellular SpleenI - - Nitrogen @@ -26618,10 +26244,6 @@ SpleenVasculature Spleen1 - - - - Nitrogen @@ -26884,290 +26506,276 @@ Stomach Stomach - - - - Trachea Trachea - - - - Ureters RightUreter LeftUreter - - - - Nitrogen - - + + - - + + Oxygen - - + + - - + + + CarbonDioxide - - + + - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + VenaCava VenaCava - - - - Nitrogen @@ -27432,189 +27040,162 @@ AortaBleed Aorta Ground - AortaToBone Aorta1ToBone1 Aorta BoneVasculature - AortaToFat Aorta1ToFat1 Aorta FatVasculature - AortaToLargeIntestine Aorta1ToLargeIntestine Aorta LargeIntestineVasculature - AortaToLeftArm Aorta1ToLeftArm1 Aorta LeftArmVasculature - AortaToLeftKidney LeftAortaConnectionToRenalArtery Aorta LeftRenalArtery - AortaToLeftLeg Aorta1ToLeftLeg1 Aorta LeftLegVasculature - AortaToLiver Aorta1ToLiver1 Aorta LiverVasculature - AortaToMuscle Aorta1ToMuscle1 Aorta MuscleVasculature - AortaToMyocardium Aorta1ToMyocardium1 Aorta MyocardiumVasculature - AortaToNeckArteries Aorta1ToNeckArteries Aorta NeckArteries - AortaToRightArm Aorta1ToRightArm1 Aorta RightArmVasculature - AortaToRightKidney RightAortaConnectionToRenalArtery Aorta RightRenalArtery - AortaToRightLeg Aorta1ToRightLeg1 Aorta RightLegVasculature - AortaToSkin Aorta1ToSkin1 Aorta SkinVasculature - AortaToSmallIntestine Aorta1ToSmallIntestine Aorta SmallIntestineVasculature - AortaToSplanchnic Aorta1ToSplanchnic Aorta SplanchnicVasculature - AortaToSpleen Aorta1ToSpleen Aorta SpleenVasculature - BladderToGround BladderToGroundUrinate Bladder Ground - BladderToGroundSource BladderToGroundPressure Bladder Ground - BoneToVenaCava Bone2ToVenaCava BoneVasculature VenaCava - BrainHemorrhage BrainBleed CerebralCapillaries Ground - CerebralArteriesToCerebralCapillaries CerebralArteries2ToCapillaries CerebralArteries CerebralCapillaries - CerebralCapillariesToCerebralVeins CerebralCapillariesToCerebralVeins1 CerebralCapillaries CerebralVeins - CerebralVeinsToNeckVeins CerebralVeins2ToNeckVeins CerebralVeins NeckVeins - EnvironmentToLeftChestLeak EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -27627,266 +27208,228 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - FatToVenaCava Fat2ToVenaCava FatVasculature VenaCava - HeartHemorrhage MyocardiumBleed MyocardiumVasculature Ground - LargeIntestineHemorrhage LargeIntestineBleed LargeIntestineVasculature Ground - LargeIntestineToLiver LargeIntestineToPortalVein LargeIntestineVasculature LiverVasculature - LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArteriole LeftGlomerularCapillaries - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftArmHemorrhage LeftArmBleed LeftArmVasculature Ground - LeftArmToVenaCava LeftArm2ToVenaCava LeftArmVasculature VenaCava - LeftAtriumToLeftVentricle LeftAtrium2ToLeftVentricle1 LeftAtrium LeftVentricle - LeftBowmansCapsulesToTubules LeftBowmansCapsulesToTubules LeftBowmansCapsules LeftTubules - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArteriole LeftPeritubularCapillaries - LeftGlomerularCapillariesToBowmansCapsules LeftNetGlomerularCapillariesToNetBowmansCapsules LeftGlomerularCapillaries LeftBowmansCapsules - LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillaries LeftEfferentArteriole - LeftKidneyHemorrhage LeftKidneyBleed LeftRenalVein Ground - LeftKidneyToVenaCava LeftRenalVeinToVenaCavaConnection LeftRenalVein VenaCava - LeftLegHemorrhage LeftLegBleed LeftLegVasculature Ground - LeftLegToVenaCava LeftLeg2ToVenaCava LeftLegVasculature VenaCava - LeftLungHemorrhage LeftLungBleed LeftPulmonaryArteries Ground - LeftLungVascularToTissue LeftLungVToLeftLungE1 LeftLungVasculature LeftLungTissueExtracellular - LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillaries LeftRenalVein - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - LeftPulmonaryArteriesToCapillaries LeftPulmonaryArteriesToLeftPulmonaryCapillaries LeftPulmonaryArteries LeftPulmonaryCapillaries - LeftPulmonaryArteriesToVeins LeftPulmonaryArteriesToLeftPulmonaryVeins LeftPulmonaryArteries LeftPulmonaryVeins - LeftPulmonaryCapillariesToVeins LeftPulmonaryCapillariesToLeftPulmonaryVeins LeftPulmonaryCapillaries LeftPulmonaryVeins - LeftPulmonaryVeinsToLeftAtrium LeftIntermediatePulmonaryVeinsToLeftAtrium1 LeftPulmonaryVeins LeftAtrium - LeftRenalArteryToAfferentArteriole LeftRenalArteryToAfferentArteriole LeftRenalArtery LeftAfferentArteriole - LeftTubulesToPeritubularCapillaries LeftNetTubulesToNetPeritubularCapillaries LeftTubules LeftPeritubularCapillaries - LeftTubulesToUreter LeftTubulesToUreter LeftTubules LeftUreter - LeftUreterToBladder LeftUreterToBladder LeftUreter Bladder - LeftVentricleToAorta LeftVentricle1ToAorta2 LeftVentricle Aorta - LiverHemorrhage LiverBleed LiverVasculature Ground - LiverToVenaCava Liver2ToVenaCava LiverVasculature VenaCava - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -27899,315 +27442,270 @@ Muscle2ToVenaCava MuscleVasculature VenaCava - MyocardiumToVenaCava Myocardium2ToVenaCava MyocardiumVasculature VenaCava - NeckArteriesToCerebralArteries NeckArteriesToCerebralArteries1 NeckArteries CerebralArteries - NeckVeinsToVenaCava NeckVeinsToVenaCava NeckVeins VenaCava - RightAfferentArterioleToGlomerularCapillaries RightAfferentArterioleToGlomerularCapillaries RightAfferentArteriole RightGlomerularCapillaries - RightAlveoliLeakToRightPleuralCavity RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightArmHemorrhage RightArmBleed RightArmVasculature Ground - RightArmToVenaCava RightArm2ToVenaCava RightArmVasculature VenaCava - RightAtriumToRightVentricle RightAtrium2ToRightVentricle1 RightAtrium RightVentricle - RightBowmansCapsulesToTubules RightBowmansCapsulesToTubules RightBowmansCapsules RightTubules - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightEfferentArterioleToPeritubularCapillaries RightEfferentArterioleToPeritubularCapillaries RightEfferentArteriole RightPeritubularCapillaries - RightGlomerularCapillariesToBowmansCapsules RightNetGlomerularCapillariesToNetBowmansCapsules RightGlomerularCapillaries RightBowmansCapsules - RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillaries RightEfferentArteriole - RightKidneyHemorrhage RightKidneyBleed RightRenalVein Ground - RightKidneyToVenaCava RightRenalVeinToVenaCavaConnection RightRenalVein VenaCava - RightLegHemorrhage RightLegBleed RightLegVasculature Ground - RightLegToVenaCava RightLeg2ToVenaCava RightLegVasculature VenaCava - RightLungHemorrhage RightLungBleed RightPulmonaryArteries Ground - RightPeritubularCapillariesToRenalVein RightPeritubularCapillariesToRenalVein RightPeritubularCapillaries RightRenalVein - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - RightPulmonaryArteriesToCapillaries RightPulmonaryArteriesToRightPulmonaryCapillaries RightPulmonaryArteries RightPulmonaryCapillaries - RightPulmonaryArteriesToVeins RightPulmonaryArteriesToRightPulmonaryVeins RightPulmonaryArteries RightPulmonaryVeins - RightPulmonaryCapillariesToVeins RightPulmonaryCapillariesToRightPulmonaryVeins RightPulmonaryCapillaries RightPulmonaryVeins - RightPulmonaryVeinsToLeftAtrium RightIntermediatePulmonaryVeinsToLeftAtrium1 RightPulmonaryVeins LeftAtrium - RightRenalArteryToAfferentArteriole RightRenalArteryToAfferentArteriole RightRenalArtery RightAfferentArteriole - RightTubulesToPeritubularCapillaries RightNetTubulesToNetPeritubularCapillaries RightTubules RightPeritubularCapillaries - RightTubulesToUreter RightTubulesToUreter RightTubules RightUreter - RightUreterToBladder RightUreterToBladder RightUreter Bladder - RightVentricleToLeftPulmonaryArteries MainPulmonaryArteriesToLeftIntermediatePulmonaryArteries RightVentricle LeftPulmonaryArteries - RightVentricleToRightPulmonaryArteries MainPulmonaryArteriesToRightIntermediatePulmonaryArteries RightVentricle RightPulmonaryArteries - SkinToVenaCava Skin2ToVenaCava SkinVasculature VenaCava - SmallIntestineHemorrhage SmallIntestineBleed SmallIntestineVasculature Ground - SmallIntestineToLiver SmallIntestineToPortalVein SmallIntestineVasculature LiverVasculature - SplanchnicHemorrhage SplanchnicBleed SplanchnicVasculature Ground - SplanchnicToLiver SplanchnicToPortalVein SplanchnicVasculature LiverVasculature - SpleenHemorrhage SpleenBleed SpleenVasculature Ground - SpleenToLiver SpleenToPortalVein SpleenVasculature LiverVasculature - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VenaCavaHemorrhage VenaCavaBleed VenaCava Ground - VenaCavaIV IVToVenaCava Ground VenaCava - VenaCavaToRightAtrium VenaCavaToRightAtrium1 VenaCava RightAtrium - Nitrogen Oxygen @@ -28633,10 +28131,6 @@ Ambient Ambient - - - - Nitrogen @@ -28659,10 +28153,6 @@ AnesthesiaConnection AnesthesiaConnection - - - - Nitrogen @@ -28685,7 +28175,6 @@ Connection MechanicalVentilatorConnection - Nitrogen @@ -28708,10 +28197,6 @@ ExpiratoryLimb ExpiratoryLimb - - - - Nitrogen @@ -28734,10 +28219,6 @@ GasInlet GasInlet - - - - Nitrogen @@ -28760,10 +28241,6 @@ GasSource GasSource - - - - Nitrogen @@ -28786,10 +28263,6 @@ InspiratoryLimb InspiratoryLimb - - - - Nitrogen @@ -28812,10 +28285,6 @@ LeftAlveoli LeftAlveoli - - - - Nitrogen @@ -28838,9 +28307,6 @@ LeftAlveoliLeak LeftAlveoliLeak - - - Nitrogen @@ -28854,10 +28320,6 @@ LeftBronchi LeftBronchi - - - - Nitrogen @@ -28880,9 +28342,6 @@ LeftChestLeak LeftChestLeak - - - Nitrogen @@ -28897,37 +28356,31 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - Nitrogen @@ -28950,10 +28403,6 @@ Mouth Mouth - - - - Nitrogen @@ -28976,8 +28425,6 @@ Mouthpiece Mouthpiece - - Nitrogen @@ -29000,7 +28447,6 @@ Nosepiece Nosepiece - Nitrogen @@ -29023,7 +28469,6 @@ OxygenTank OxygenTank - Nitrogen @@ -29047,62 +28492,53 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + ReliefValve ReliefValve - - - Nitrogen @@ -29125,10 +28561,6 @@ RightAlveoli RightAlveoli - - - - Nitrogen @@ -29151,9 +28583,6 @@ RightAlveoliLeak RightAlveoliLeak - - - Nitrogen @@ -29167,10 +28596,6 @@ RightBronchi RightBronchi - - - - Nitrogen @@ -29193,9 +28618,6 @@ RightChestLeak RightChestLeak - - - Nitrogen @@ -29210,37 +28632,30 @@ RightLungPulmonary RightBronchi RightAlveoli - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - Nitrogen @@ -29263,10 +28678,6 @@ Scrubber Scrubber - - - - Nitrogen @@ -29289,10 +28700,6 @@ Selector Selector - - - - Nitrogen @@ -29315,10 +28722,6 @@ Stomach Stomach - - - - Nitrogen @@ -29341,10 +28744,6 @@ Trachea Trachea - - - - Nitrogen @@ -29368,10 +28767,6 @@ Ventilator Ventilator VentilatorConnection - - - - Nitrogen @@ -29415,10 +28810,6 @@ YPiece YPiece - - - - Nitrogen @@ -29443,7 +28834,6 @@ AnesthesiaConnectionToEnvironment AnesthesiaConnection Ambient - ConnectionToMouth @@ -29456,14 +28846,12 @@ EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -29482,98 +28870,84 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - Exhaust SelectorToEnvironment Selector Ambient - ExpiratoryLimbToSelector ExpiratoryLimbToSelector ExpiratoryLimb Selector - GasInletToInspiratoryLimb GasInletToInspiratoryLimb GasInlet InspiratoryLimb - GasSourceToGasInlet GasSourceToGasInlet GasSource GasInlet - InspiratoryLimbToYPiece InspiratoryLimbToYPiece InspiratoryLimb YPiece - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - Mask AnesthesiaConnectionToMouth AnesthesiaConnection Mouth - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -29604,91 +28978,78 @@ RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - ScrubberToGasInlet ScrubberToGasInlet Scrubber GasInlet - SelectorToReliefValve SelectorToReliefValve Selector ReliefValve - SelectorToScrubber SelectorToScrubber Selector Scrubber - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VentilatorToSelector VentilatorConnectionToSelector Ventilator Selector - YPieceToAnesthesiaConnection YPieceToAnesthesiaConnection YPiece AnesthesiaConnection - YPieceToExpiratoryLimb YPieceToExpiratoryLimb YPiece ExpiratoryLimb - Nitrogen Oxygen @@ -29922,477 +29283,364 @@ Active Active - - - Ambient Ambient - - - Clothing Clothing - - - Enclosure Enclosure - - - ExternalCore ExternalCore - - - ExternalGround ExternalGround - - - ExternalHeadSkin ExternalHeadSkin - - - ExternalLeftArmSkin ExternalLeftArmSkin - - - ExternalLeftLegSkin ExternalLeftLegSkin - - - ExternalRightArmSkin ExternalRightArmSkin - - - ExternalRightLegSkin ExternalRightLegSkin - - - ExternalTorsoSkin ExternalTorsoSkin - - - InternalCore InternalCore InternalGround - - - - InternalGround - - InternalHeadSkin InternalHeadSkin - - - - InternalLeftArmSkin InternalLeftArmSkin - - - - InternalLeftLegSkin InternalLeftLegSkin - - - - InternalRightArmSkin InternalRightArmSkin - - - - InternalRightLegSkin InternalRightLegSkin - - - - InternalTorsoSkin InternalTorsoSkin - - - - ActiveToClothing ActiveToClothing Active Clothing - ClothingToEnclosure ClothingToEnclosure Clothing Enclosure - ClothingToEnvironment ClothingToEnvironment Clothing Ambient - ExternalCoreToGround ExternalCoreToGround ExternalCore ExternalGround - ExternalHeadSkinToClothing ExternalHeadSkinToClothing ExternalHeadSkin Clothing - ExternalHeadSkinToGround ExternalHeadSkinToGround ExternalHeadSkin ExternalGround - ExternalLeftArmSkinToClothing ExternalLeftArmSkinToClothing ExternalLeftArmSkin Clothing - ExternalLeftArmSkinToGround ExternalLeftArmSkinToGround ExternalLeftArmSkin ExternalGround - ExternalLeftLegSkinToClothing ExternalLeftLegSkinToClothing ExternalLeftLegSkin Clothing - ExternalLeftLegSkinToGround ExternalLeftLegSkinToGround ExternalLeftLegSkin ExternalGround - ExternalRightArmSkinToClothing ExternalRightArmSkinToClothing ExternalRightArmSkin Clothing - ExternalRightArmSkinToGround ExternalRightArmSkinToGround ExternalRightArmSkin ExternalGround - ExternalRightLegSkinToClothing ExternalRightLegSkinToClothing ExternalRightLegSkin Clothing - ExternalRightLegSkinToGround ExternalRightLegSkinToGround ExternalRightLegSkin ExternalGround - ExternalTorsoSkinToClothing ExternalTorsoSkinToClothing ExternalTorsoSkin Clothing - ExternalTorsoSkinToGround ExternalTorsoSkinToGround ExternalTorsoSkin ExternalGround - GroundToActive GroundToActive ExternalGround Active - GroundToClothing GroundToClothing ExternalGround Clothing - GroundToEnclosure GroundToEnclosure ExternalGround Enclosure - GroundToEnvironment GroundToEnvironment ExternalGround Ambient - GroundToInternalCore GroundToInternalCore InternalGround InternalCore - GroundToInternalHeadSkin GroundToInternalHeadSkin InternalGround InternalHeadSkin - GroundToInternalLeftArmSkin GroundToInternalLeftArmSkin InternalGround InternalLeftArmSkin - GroundToInternalLeftLegSkin GroundToInternalLeftLegSkin InternalGround InternalLeftLegSkin - GroundToInternalRightArmSkin GroundToInternalRightArmSkin InternalGround InternalRightArmSkin - GroundToInternalRightLegSkin GroundToInternalRightLegSkin InternalGround InternalRightLegSkin - GroundToInternalTorsoSkin GroundToInternalTorsoSkin InternalGround InternalTorsoSkin - InternalCoreToExternalCore InternalCoreToExternalCore InternalCore ExternalCore - InternalCoreToGround InternalCoreToGround InternalGround InternalCore - InternalCoreToInternalHeadSkin InternalCoreToInternalHeadSkin InternalCore InternalHeadSkin - InternalCoreToInternalLeftArmSkin InternalCoreToInternalLeftArmSkin InternalCore InternalLeftArmSkin - InternalCoreToInternalLeftLegSkin InternalCoreToInternalLeftLegSkin InternalCore InternalLeftLegSkin - InternalCoreToInternalRightArmSkin InternalCoreToInternalRightArmSkin InternalCore InternalRightArmSkin - InternalCoreToInternalRightLegSkin InternalCoreToInternalRightLegSkin InternalCore InternalRightLegSkin - InternalCoreToInternalTorsoSkin InternalCoreToInternalTorsoSkin InternalCore InternalTorsoSkin - InternalHeadSkinToExternalHeadSkin InternalHeadSkinToExternalHeadSkin InternalHeadSkin ExternalHeadSkin - InternalHeadSkinToGround InternalHeadSkinToTemperatureGround InternalGround InternalHeadSkin - InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkin ExternalLeftArmSkin - InternalLeftArmSkinToGround InternalLeftArmSkinToTemperatureGround InternalGround InternalLeftArmSkin - InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkin ExternalLeftLegSkin - InternalLeftLegSkinToGround InternalLeftLegSkinToTemperatureGround InternalGround InternalLeftLegSkin - InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkin ExternalRightArmSkin - InternalRightArmSkinToGround InternalRightArmSkinToTemperatureGround InternalGround InternalRightArmSkin - InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkin ExternalRightLegSkin - InternalRightLegSkinToGround InternalRightLegSkinToTemperatureGround InternalGround InternalRightLegSkin - InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkin ExternalTorsoSkin - InternalTorsoSkinToGround InternalTorsoSkinToTemperatureGround InternalGround InternalTorsoSkin - BoneTissue @@ -30566,7 +29814,6 @@ - Off @@ -30975,7 +30222,6 @@ - @@ -31002,15 +30248,15 @@ On - + - + - + - + @@ -32357,7 +31603,6 @@ - Extrasplanchnic @@ -32368,7 +31613,6 @@ - Extrasplanchnic @@ -32389,7 +31633,6 @@ - Splanchnic @@ -32400,7 +31643,6 @@ - Extrasplanchnic @@ -32418,7 +31660,6 @@ - Extrasplanchnic @@ -32429,7 +31670,6 @@ - Splanchnic @@ -32440,7 +31680,6 @@ - Muscle @@ -32451,7 +31690,6 @@ - Myocardium @@ -32462,7 +31700,6 @@ - Cerebral @@ -32473,7 +31710,6 @@ - Extrasplanchnic @@ -32491,7 +31727,6 @@ - Extrasplanchnic @@ -32502,7 +31737,6 @@ - Extrasplanchnic @@ -32513,7 +31747,6 @@ - Splanchnic @@ -32524,7 +31757,6 @@ - Splanchnic @@ -32535,7 +31767,6 @@ - Splanchnic @@ -32593,7 +31824,6 @@ - Extrasplanchnic @@ -32826,7 +32056,6 @@ - Cerebral @@ -32847,7 +32076,6 @@ - Cerebral @@ -32868,7 +32096,6 @@ - Cerebral @@ -32982,7 +32209,6 @@ - Extrasplanchnic @@ -33265,7 +32491,6 @@ - Splanchnic @@ -33344,7 +32569,6 @@ - Extrasplanchnic @@ -33628,7 +32852,6 @@ - Extrasplanchnic @@ -34001,7 +33224,6 @@ - Splanchnic @@ -34206,7 +33428,6 @@ - Muscle @@ -34323,7 +33544,6 @@ - Myocardium @@ -34440,7 +33660,6 @@ - Cerebral @@ -34471,7 +33690,6 @@ - Cerebral @@ -34515,7 +33733,6 @@ - Splanchnic @@ -34589,7 +33806,6 @@ - Extrasplanchnic @@ -34873,7 +34089,6 @@ - Extrasplanchnic @@ -35285,7 +34500,6 @@ - Extrasplanchnic @@ -35432,7 +34646,6 @@ - Splanchnic @@ -35493,7 +34706,6 @@ - Splanchnic @@ -35613,7 +34825,6 @@ - Splanchnic diff --git a/share/data/states/Male_25_Normal@0s.xml b/share/data/states/Male_25_Normal@0s.xml index 709387e25..02e26dbd9 100644 --- a/share/data/states/Male_25_Normal@0s.xml +++ b/share/data/states/Male_25_Normal@0s.xml @@ -1,5 +1,5 @@ - + Male_25_Normal @@ -177,7 +177,7 @@ - + @@ -313,7 +313,7 @@ - + @@ -363,7 +363,7 @@ - + @@ -386,7 +386,7 @@ - + @@ -401,7 +401,7 @@ - + @@ -419,7 +419,7 @@ - + @@ -444,7 +444,7 @@ - + @@ -467,7 +467,7 @@ - + @@ -515,7 +515,7 @@ - + @@ -551,7 +551,7 @@ - + @@ -571,7 +571,7 @@ - + @@ -582,7 +582,7 @@ Liquid - + @@ -594,7 +594,7 @@ - + @@ -619,7 +619,7 @@ - + @@ -644,7 +644,7 @@ - + @@ -685,7 +685,7 @@ - + @@ -912,7 +912,6 @@ - false true false @@ -1011,6 +1010,7 @@ + @@ -1160,16 +1160,13 @@ - - - @@ -1216,15 +1213,15 @@ false - + - - + + @@ -1237,9 +1234,9 @@ 77.6122029 38.5541581698666 - - - + + + @@ -1301,8 +1298,8 @@ - - + + @@ -1317,6 +1314,9 @@ 10 + + + @@ -1324,20 +1324,12 @@ Ambient Ambient - - - - Aorta Aorta1 Aorta2 Aorta3 - - - - Nitrogen @@ -1600,10 +1592,6 @@ Bladder Bladder - - - - Nitrogen @@ -1869,8 +1857,6 @@ BoneE3 BoneL1 BoneL2 - - Nitrogen @@ -2133,8 +2119,6 @@ BoneTissueIntracellular BoneI - - Nitrogen @@ -2398,10 +2382,6 @@ BoneVasculature Bone1 Bone2 - - - - Nitrogen @@ -2668,8 +2648,6 @@ BrainE3 BrainL1 BrainL2 - - Nitrogen @@ -2932,8 +2910,6 @@ BrainTissueIntracellular BrainI - - Nitrogen @@ -3198,276 +3174,269 @@ CerebralArteries CerebralCapillaries CerebralVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + CerebralArteries CerebralArteries1 CerebralArteries2 - - - - Nitrogen @@ -3730,10 +3699,6 @@ CerebralCapillaries CerebralCapillaries - - - - Nitrogen @@ -3996,8 +3961,6 @@ CerebralSpinalFluid SpinalFluid - - Nitrogen @@ -4261,10 +4224,6 @@ CerebralVeins1 CerebralVeins2 CerebralVeinsCheck - - - - Nitrogen @@ -4531,8 +4490,6 @@ FatE3 FatL1 FatL2 - - Nitrogen @@ -4795,8 +4752,6 @@ FatTissueIntracellular FatI - - Nitrogen @@ -5060,10 +5015,6 @@ FatVasculature Fat1 Fat2 - - - - Nitrogen @@ -5326,9 +5277,6 @@ Ground Ground - - - Nitrogen @@ -5449,8 +5397,6 @@ GutE3 GutL1 GutL2 - - Nitrogen @@ -5713,8 +5659,6 @@ GutTissueIntracellular GutI - - Nitrogen @@ -5979,266 +5923,263 @@ SplanchnicVasculature SmallIntestineVasculature LargeIntestineVasculature - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -6247,541 +6188,529 @@ LeftHeart RightHeart Pericardium - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + KidneyVasculature LeftKidneyVasculature RightKidneyVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LargeIntestineVasculature LargeIntestine1 - - - - Nitrogen @@ -7044,10 +6973,6 @@ LeftAfferentArteriole LeftAfferentArteriole - - - - Nitrogen @@ -7310,26 +7235,15 @@ LeftAlveoli LeftAlveoli - - - - LeftAlveoliLeak LeftAlveoliLeak - - - LeftArmVasculature LeftArm1 LeftArm2 - - - - Nitrogen @@ -7593,10 +7507,6 @@ LeftAtrium LeftAtrium1 LeftAtrium2 - - - - Nitrogen @@ -7860,10 +7770,6 @@ LeftBowmansCapsules LeftBowmansCapsules LeftNetBowmansCapsules - - - - Nitrogen @@ -8126,25 +8032,14 @@ LeftBronchi LeftBronchi - - - - LeftChestLeak LeftChestLeak - - - LeftEfferentArteriole LeftEfferentArteriole - - - - Nitrogen @@ -8408,10 +8303,6 @@ LeftGlomerularCapillaries LeftGlomerularCapillaries LeftNetGlomerularCapillaries - - - - Nitrogen @@ -8675,266 +8566,262 @@ LeftHeart LeftAtrium LeftVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -8944,8 +8831,6 @@ LeftKidneyE3 LeftKidneyL1 LeftKidneyL2 - - Nitrogen @@ -9208,8 +9093,6 @@ LeftKidneyTissueIntracellular LeftKidneyI - - Nitrogen @@ -9474,276 +9357,269 @@ LeftRenalArtery LeftNephron LeftRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftLegVasculature LeftLeg1 LeftLeg2 - - - - Nitrogen @@ -10007,10 +9883,6 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - - LeftLungTissueExtracellular @@ -10019,10 +9891,6 @@ LeftLungE3 LeftLungL1 LeftLungL2 - - - - Nitrogen @@ -10285,8 +10153,6 @@ LeftLungTissueIntracellular LeftLungI - - Nitrogen @@ -10551,266 +10417,263 @@ LeftPulmonaryArteries LeftPulmonaryCapillaries LeftPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -10821,276 +10684,269 @@ LeftPeritubularCapillaries LeftBowmansCapsules LeftTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftPeritubularCapillaries LeftPeritubularCapillaries LeftNetPeritubularCapillaries - - - - Nitrogen @@ -11354,19 +11210,11 @@ LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - LeftPulmonaryArteries LeftPulmonaryArteries LeftIntermediatePulmonaryArteries - - - - Nitrogen @@ -11629,10 +11477,6 @@ LeftPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen @@ -11895,10 +11739,6 @@ LeftPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen @@ -12161,10 +12001,6 @@ LeftRenalArtery LeftRenalArtery - - - - Nitrogen @@ -12427,10 +12263,6 @@ LeftRenalVein LeftRenalVein - - - - Nitrogen @@ -12694,10 +12526,6 @@ LeftTubules LeftTubules LeftNetTubules - - - - Nitrogen @@ -12960,10 +12788,6 @@ LeftUreter LeftUreter - - - - Nitrogen @@ -13226,10 +13050,6 @@ LeftVentricle LeftVentricle1 LeftVentricle2 - - - - Nitrogen @@ -13496,8 +13316,6 @@ LiverE3 LiverL1 LiverL2 - - Nitrogen @@ -13760,8 +13578,6 @@ LiverTissueIntracellular LiverI - - Nitrogen @@ -14027,9 +13843,6 @@ Liver2 PortalVein1 - - - Nitrogen @@ -14293,273 +14106,267 @@ LungsVasculature LeftLungVasculature RightLungVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + Lymph Lymph - - Nitrogen @@ -14821,16 +14628,10 @@ Mouth Mouth - - - - Mouthpiece Mouthpiece - - MuscleTissueExtracellular @@ -14839,8 +14640,6 @@ MuscleE3 MuscleL1 MuscleL2 - - Nitrogen @@ -15103,8 +14902,6 @@ MuscleTissueIntracellular MuscleI - - Nitrogen @@ -15368,10 +15165,6 @@ MuscleVasculature Muscle1 Muscle2 - - - - Nitrogen @@ -15638,8 +15431,6 @@ MyocardiumE3 MyocardiumL1 MyocardiumL2 - - Nitrogen @@ -15902,8 +15693,6 @@ MyocardiumTissueIntracellular MyocardiumI - - Nitrogen @@ -16167,10 +15956,6 @@ MyocardiumVasculature Myocardium1 Myocardium2 - - - - Nitrogen @@ -16433,10 +16218,6 @@ NeckArteries NeckArteries - - - - Nitrogen @@ -16699,10 +16480,6 @@ NeckVeins NeckVeins - - - - Nitrogen @@ -16965,8 +16742,6 @@ Pericardium Pericardium1 - - Nitrogen @@ -17230,825 +17005,801 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - PulmonaryArteries RightPulmonaryArteries LeftPulmonaryArteries - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryCapillaries RightPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - - PulmonaryVeins RightPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightAfferentArteriole RightAfferentArteriole - - - - Nitrogen @@ -18311,26 +18062,15 @@ RightAlveoli RightAlveoli - - - - RightAlveoliLeak RightAlveoliLeak - - - RightArmVasculature RightArm1 RightArm2 - - - - Nitrogen @@ -18594,10 +18334,6 @@ RightAtrium RightAtrium1 RightAtrium2 - - - - Nitrogen @@ -18861,10 +18597,6 @@ RightBowmansCapsules RightBowmansCapsules RightNetBowmansCapsules - - - - Nitrogen @@ -19127,25 +18859,14 @@ RightBronchi RightBronchi - - - - RightChestLeak RightChestLeak - - - RightEfferentArteriole RightEfferentArteriole - - - - Nitrogen @@ -19409,10 +19130,6 @@ RightGlomerularCapillaries RightGlomerularCapillaries RightNetGlomerularCapillaries - - - - Nitrogen @@ -19676,266 +19393,262 @@ RightHeart RightAtrium RightVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -19945,8 +19658,6 @@ RightKidneyE3 RightKidneyL1 RightKidneyL2 - - Nitrogen @@ -20209,8 +19920,6 @@ RightKidneyTissueIntracellular RightKidneyI - - Nitrogen @@ -20475,276 +20184,269 @@ RightRenalArtery RightNephron RightRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightLegVasculature RightLeg1 RightLeg2 - - - - Nitrogen @@ -21008,10 +20710,6 @@ RightLungPulmonary RightBronchi RightAlveoli - - - - RightLungTissueExtracellular @@ -21020,8 +20718,6 @@ RightLungE3 RightLungL1 RightLungL2 - - Nitrogen @@ -21284,8 +20980,6 @@ RightLungTissueIntracellular RightLungI - - Nitrogen @@ -21550,266 +21244,263 @@ RightPulmonaryArteries RightPulmonaryCapillaries RightPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -21820,276 +21511,269 @@ RightPeritubularCapillaries RightBowmansCapsules RightTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightPeritubularCapillaries RightPeritubularCapillaries RightNetPeritubularCapillaries - - - - Nitrogen @@ -22353,19 +22037,11 @@ RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - RightPulmonaryArteries RightPulmonaryArteries RightIntermediatePulmonaryArteries - - - - Nitrogen @@ -22628,10 +22304,6 @@ RightPulmonaryCapillaries RightPulmonaryCapillaries - - - - Nitrogen @@ -22894,10 +22566,6 @@ RightPulmonaryVeins RightPulmonaryVeins - - - - Nitrogen @@ -23160,10 +22828,6 @@ RightRenalArtery RightRenalArtery - - - - Nitrogen @@ -23426,10 +23090,6 @@ RightRenalVein RightRenalVein - - - - Nitrogen @@ -23693,10 +23353,6 @@ RightTubules RightTubules RightNetTubules - - - - Nitrogen @@ -23959,10 +23615,6 @@ RightUreter RightUreter - - - - Nitrogen @@ -24226,10 +23878,6 @@ RightVentricle1 RightVentricle2 MainPulmonaryArteries - - - - Nitrogen @@ -24496,8 +24144,6 @@ SkinE3 SkinL1 SkinL2 - - Nitrogen @@ -24760,8 +24406,6 @@ SkinTissueIntracellular SkinI - - Nitrogen @@ -25025,10 +24669,6 @@ SkinVasculature Skin1 Skin2 - - - - Nitrogen @@ -25291,8 +24931,6 @@ SmallIntestineChyme SmallIntestineC1 - - Nitrogen @@ -25554,10 +25192,6 @@ SmallIntestineVasculature SmallIntestine1 - - - - Nitrogen @@ -25820,10 +25454,6 @@ SplanchnicVasculature Splanchnic1 - - - - Nitrogen @@ -26090,8 +25720,6 @@ SpleenE3 SpleenL1 SpleenL2 - - Nitrogen @@ -26354,8 +25982,6 @@ SpleenTissueIntracellular SpleenI - - Nitrogen @@ -26618,10 +26244,6 @@ SpleenVasculature Spleen1 - - - - Nitrogen @@ -26884,290 +26506,276 @@ Stomach Stomach - - - - Trachea Trachea - - - - Ureters RightUreter LeftUreter - - - - Nitrogen - - + + - - + + Oxygen - - + + - - + + + CarbonDioxide - - + + - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + VenaCava VenaCava - - - - Nitrogen @@ -27432,189 +27040,162 @@ AortaBleed Aorta Ground - AortaToBone Aorta1ToBone1 Aorta BoneVasculature - AortaToFat Aorta1ToFat1 Aorta FatVasculature - AortaToLargeIntestine Aorta1ToLargeIntestine Aorta LargeIntestineVasculature - AortaToLeftArm Aorta1ToLeftArm1 Aorta LeftArmVasculature - AortaToLeftKidney LeftAortaConnectionToRenalArtery Aorta LeftRenalArtery - AortaToLeftLeg Aorta1ToLeftLeg1 Aorta LeftLegVasculature - AortaToLiver Aorta1ToLiver1 Aorta LiverVasculature - AortaToMuscle Aorta1ToMuscle1 Aorta MuscleVasculature - AortaToMyocardium Aorta1ToMyocardium1 Aorta MyocardiumVasculature - AortaToNeckArteries Aorta1ToNeckArteries Aorta NeckArteries - AortaToRightArm Aorta1ToRightArm1 Aorta RightArmVasculature - AortaToRightKidney RightAortaConnectionToRenalArtery Aorta RightRenalArtery - AortaToRightLeg Aorta1ToRightLeg1 Aorta RightLegVasculature - AortaToSkin Aorta1ToSkin1 Aorta SkinVasculature - AortaToSmallIntestine Aorta1ToSmallIntestine Aorta SmallIntestineVasculature - AortaToSplanchnic Aorta1ToSplanchnic Aorta SplanchnicVasculature - AortaToSpleen Aorta1ToSpleen Aorta SpleenVasculature - BladderToGround BladderToGroundUrinate Bladder Ground - BladderToGroundSource BladderToGroundPressure Bladder Ground - BoneToVenaCava Bone2ToVenaCava BoneVasculature VenaCava - BrainHemorrhage BrainBleed CerebralCapillaries Ground - CerebralArteriesToCerebralCapillaries CerebralArteries2ToCapillaries CerebralArteries CerebralCapillaries - CerebralCapillariesToCerebralVeins CerebralCapillariesToCerebralVeins1 CerebralCapillaries CerebralVeins - CerebralVeinsToNeckVeins CerebralVeins2ToNeckVeins CerebralVeins NeckVeins - EnvironmentToLeftChestLeak EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -27627,266 +27208,228 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - FatToVenaCava Fat2ToVenaCava FatVasculature VenaCava - HeartHemorrhage MyocardiumBleed MyocardiumVasculature Ground - LargeIntestineHemorrhage LargeIntestineBleed LargeIntestineVasculature Ground - LargeIntestineToLiver LargeIntestineToPortalVein LargeIntestineVasculature LiverVasculature - LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArteriole LeftGlomerularCapillaries - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftArmHemorrhage LeftArmBleed LeftArmVasculature Ground - LeftArmToVenaCava LeftArm2ToVenaCava LeftArmVasculature VenaCava - LeftAtriumToLeftVentricle LeftAtrium2ToLeftVentricle1 LeftAtrium LeftVentricle - LeftBowmansCapsulesToTubules LeftBowmansCapsulesToTubules LeftBowmansCapsules LeftTubules - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArteriole LeftPeritubularCapillaries - LeftGlomerularCapillariesToBowmansCapsules LeftNetGlomerularCapillariesToNetBowmansCapsules LeftGlomerularCapillaries LeftBowmansCapsules - LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillaries LeftEfferentArteriole - LeftKidneyHemorrhage LeftKidneyBleed LeftRenalVein Ground - LeftKidneyToVenaCava LeftRenalVeinToVenaCavaConnection LeftRenalVein VenaCava - LeftLegHemorrhage LeftLegBleed LeftLegVasculature Ground - LeftLegToVenaCava LeftLeg2ToVenaCava LeftLegVasculature VenaCava - LeftLungHemorrhage LeftLungBleed LeftPulmonaryArteries Ground - LeftLungVascularToTissue LeftLungVToLeftLungE1 LeftLungVasculature LeftLungTissueExtracellular - LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillaries LeftRenalVein - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - LeftPulmonaryArteriesToCapillaries LeftPulmonaryArteriesToLeftPulmonaryCapillaries LeftPulmonaryArteries LeftPulmonaryCapillaries - LeftPulmonaryArteriesToVeins LeftPulmonaryArteriesToLeftPulmonaryVeins LeftPulmonaryArteries LeftPulmonaryVeins - LeftPulmonaryCapillariesToVeins LeftPulmonaryCapillariesToLeftPulmonaryVeins LeftPulmonaryCapillaries LeftPulmonaryVeins - LeftPulmonaryVeinsToLeftAtrium LeftIntermediatePulmonaryVeinsToLeftAtrium1 LeftPulmonaryVeins LeftAtrium - LeftRenalArteryToAfferentArteriole LeftRenalArteryToAfferentArteriole LeftRenalArtery LeftAfferentArteriole - LeftTubulesToPeritubularCapillaries LeftNetTubulesToNetPeritubularCapillaries LeftTubules LeftPeritubularCapillaries - LeftTubulesToUreter LeftTubulesToUreter LeftTubules LeftUreter - LeftUreterToBladder LeftUreterToBladder LeftUreter Bladder - LeftVentricleToAorta LeftVentricle1ToAorta2 LeftVentricle Aorta - LiverHemorrhage LiverBleed LiverVasculature Ground - LiverToVenaCava Liver2ToVenaCava LiverVasculature VenaCava - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -27899,315 +27442,270 @@ Muscle2ToVenaCava MuscleVasculature VenaCava - MyocardiumToVenaCava Myocardium2ToVenaCava MyocardiumVasculature VenaCava - NeckArteriesToCerebralArteries NeckArteriesToCerebralArteries1 NeckArteries CerebralArteries - NeckVeinsToVenaCava NeckVeinsToVenaCava NeckVeins VenaCava - RightAfferentArterioleToGlomerularCapillaries RightAfferentArterioleToGlomerularCapillaries RightAfferentArteriole RightGlomerularCapillaries - RightAlveoliLeakToRightPleuralCavity RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightArmHemorrhage RightArmBleed RightArmVasculature Ground - RightArmToVenaCava RightArm2ToVenaCava RightArmVasculature VenaCava - RightAtriumToRightVentricle RightAtrium2ToRightVentricle1 RightAtrium RightVentricle - RightBowmansCapsulesToTubules RightBowmansCapsulesToTubules RightBowmansCapsules RightTubules - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightEfferentArterioleToPeritubularCapillaries RightEfferentArterioleToPeritubularCapillaries RightEfferentArteriole RightPeritubularCapillaries - RightGlomerularCapillariesToBowmansCapsules RightNetGlomerularCapillariesToNetBowmansCapsules RightGlomerularCapillaries RightBowmansCapsules - RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillaries RightEfferentArteriole - RightKidneyHemorrhage RightKidneyBleed RightRenalVein Ground - RightKidneyToVenaCava RightRenalVeinToVenaCavaConnection RightRenalVein VenaCava - RightLegHemorrhage RightLegBleed RightLegVasculature Ground - RightLegToVenaCava RightLeg2ToVenaCava RightLegVasculature VenaCava - RightLungHemorrhage RightLungBleed RightPulmonaryArteries Ground - RightPeritubularCapillariesToRenalVein RightPeritubularCapillariesToRenalVein RightPeritubularCapillaries RightRenalVein - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - RightPulmonaryArteriesToCapillaries RightPulmonaryArteriesToRightPulmonaryCapillaries RightPulmonaryArteries RightPulmonaryCapillaries - RightPulmonaryArteriesToVeins RightPulmonaryArteriesToRightPulmonaryVeins RightPulmonaryArteries RightPulmonaryVeins - RightPulmonaryCapillariesToVeins RightPulmonaryCapillariesToRightPulmonaryVeins RightPulmonaryCapillaries RightPulmonaryVeins - RightPulmonaryVeinsToLeftAtrium RightIntermediatePulmonaryVeinsToLeftAtrium1 RightPulmonaryVeins LeftAtrium - RightRenalArteryToAfferentArteriole RightRenalArteryToAfferentArteriole RightRenalArtery RightAfferentArteriole - RightTubulesToPeritubularCapillaries RightNetTubulesToNetPeritubularCapillaries RightTubules RightPeritubularCapillaries - RightTubulesToUreter RightTubulesToUreter RightTubules RightUreter - RightUreterToBladder RightUreterToBladder RightUreter Bladder - RightVentricleToLeftPulmonaryArteries MainPulmonaryArteriesToLeftIntermediatePulmonaryArteries RightVentricle LeftPulmonaryArteries - RightVentricleToRightPulmonaryArteries MainPulmonaryArteriesToRightIntermediatePulmonaryArteries RightVentricle RightPulmonaryArteries - SkinToVenaCava Skin2ToVenaCava SkinVasculature VenaCava - SmallIntestineHemorrhage SmallIntestineBleed SmallIntestineVasculature Ground - SmallIntestineToLiver SmallIntestineToPortalVein SmallIntestineVasculature LiverVasculature - SplanchnicHemorrhage SplanchnicBleed SplanchnicVasculature Ground - SplanchnicToLiver SplanchnicToPortalVein SplanchnicVasculature LiverVasculature - SpleenHemorrhage SpleenBleed SpleenVasculature Ground - SpleenToLiver SpleenToPortalVein SpleenVasculature LiverVasculature - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VenaCavaHemorrhage VenaCavaBleed VenaCava Ground - VenaCavaIV IVToVenaCava Ground VenaCava - VenaCavaToRightAtrium VenaCavaToRightAtrium1 VenaCava RightAtrium - Nitrogen Oxygen @@ -28633,10 +28131,6 @@ Ambient Ambient - - - - Nitrogen @@ -28659,10 +28153,6 @@ AnesthesiaConnection AnesthesiaConnection - - - - Nitrogen @@ -28685,7 +28175,6 @@ Connection MechanicalVentilatorConnection - Nitrogen @@ -28708,10 +28197,6 @@ ExpiratoryLimb ExpiratoryLimb - - - - Nitrogen @@ -28734,10 +28219,6 @@ GasInlet GasInlet - - - - Nitrogen @@ -28760,10 +28241,6 @@ GasSource GasSource - - - - Nitrogen @@ -28786,10 +28263,6 @@ InspiratoryLimb InspiratoryLimb - - - - Nitrogen @@ -28812,10 +28285,6 @@ LeftAlveoli LeftAlveoli - - - - Nitrogen @@ -28838,9 +28307,6 @@ LeftAlveoliLeak LeftAlveoliLeak - - - Nitrogen @@ -28854,10 +28320,6 @@ LeftBronchi LeftBronchi - - - - Nitrogen @@ -28880,9 +28342,6 @@ LeftChestLeak LeftChestLeak - - - Nitrogen @@ -28897,37 +28356,31 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - Nitrogen @@ -28950,10 +28403,6 @@ Mouth Mouth - - - - Nitrogen @@ -28976,8 +28425,6 @@ Mouthpiece Mouthpiece - - Nitrogen @@ -29000,7 +28447,6 @@ Nosepiece Nosepiece - Nitrogen @@ -29023,7 +28469,6 @@ OxygenTank OxygenTank - Nitrogen @@ -29047,62 +28492,53 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + ReliefValve ReliefValve - - - Nitrogen @@ -29125,10 +28561,6 @@ RightAlveoli RightAlveoli - - - - Nitrogen @@ -29151,9 +28583,6 @@ RightAlveoliLeak RightAlveoliLeak - - - Nitrogen @@ -29167,10 +28596,6 @@ RightBronchi RightBronchi - - - - Nitrogen @@ -29193,9 +28618,6 @@ RightChestLeak RightChestLeak - - - Nitrogen @@ -29210,37 +28632,30 @@ RightLungPulmonary RightBronchi RightAlveoli - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - Nitrogen @@ -29263,10 +28678,6 @@ Scrubber Scrubber - - - - Nitrogen @@ -29289,10 +28700,6 @@ Selector Selector - - - - Nitrogen @@ -29315,10 +28722,6 @@ Stomach Stomach - - - - Nitrogen @@ -29341,10 +28744,6 @@ Trachea Trachea - - - - Nitrogen @@ -29368,10 +28767,6 @@ Ventilator Ventilator VentilatorConnection - - - - Nitrogen @@ -29415,10 +28810,6 @@ YPiece YPiece - - - - Nitrogen @@ -29443,7 +28834,6 @@ AnesthesiaConnectionToEnvironment AnesthesiaConnection Ambient - ConnectionToMouth @@ -29456,14 +28846,12 @@ EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -29482,98 +28870,84 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - Exhaust SelectorToEnvironment Selector Ambient - ExpiratoryLimbToSelector ExpiratoryLimbToSelector ExpiratoryLimb Selector - GasInletToInspiratoryLimb GasInletToInspiratoryLimb GasInlet InspiratoryLimb - GasSourceToGasInlet GasSourceToGasInlet GasSource GasInlet - InspiratoryLimbToYPiece InspiratoryLimbToYPiece InspiratoryLimb YPiece - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - Mask AnesthesiaConnectionToMouth AnesthesiaConnection Mouth - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -29604,91 +28978,78 @@ RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - ScrubberToGasInlet ScrubberToGasInlet Scrubber GasInlet - SelectorToReliefValve SelectorToReliefValve Selector ReliefValve - SelectorToScrubber SelectorToScrubber Selector Scrubber - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VentilatorToSelector VentilatorConnectionToSelector Ventilator Selector - YPieceToAnesthesiaConnection YPieceToAnesthesiaConnection YPiece AnesthesiaConnection - YPieceToExpiratoryLimb YPieceToExpiratoryLimb YPiece ExpiratoryLimb - Nitrogen Oxygen @@ -29922,477 +29283,364 @@ Active Active - - - Ambient Ambient - - - Clothing Clothing - - - Enclosure Enclosure - - - ExternalCore ExternalCore - - - ExternalGround ExternalGround - - - ExternalHeadSkin ExternalHeadSkin - - - ExternalLeftArmSkin ExternalLeftArmSkin - - - ExternalLeftLegSkin ExternalLeftLegSkin - - - ExternalRightArmSkin ExternalRightArmSkin - - - ExternalRightLegSkin ExternalRightLegSkin - - - ExternalTorsoSkin ExternalTorsoSkin - - - InternalCore InternalCore InternalGround - - - - InternalGround - - InternalHeadSkin InternalHeadSkin - - - - InternalLeftArmSkin InternalLeftArmSkin - - - - InternalLeftLegSkin InternalLeftLegSkin - - - - InternalRightArmSkin InternalRightArmSkin - - - - InternalRightLegSkin InternalRightLegSkin - - - - InternalTorsoSkin InternalTorsoSkin - - - - ActiveToClothing ActiveToClothing Active Clothing - ClothingToEnclosure ClothingToEnclosure Clothing Enclosure - ClothingToEnvironment ClothingToEnvironment Clothing Ambient - ExternalCoreToGround ExternalCoreToGround ExternalCore ExternalGround - ExternalHeadSkinToClothing ExternalHeadSkinToClothing ExternalHeadSkin Clothing - ExternalHeadSkinToGround ExternalHeadSkinToGround ExternalHeadSkin ExternalGround - ExternalLeftArmSkinToClothing ExternalLeftArmSkinToClothing ExternalLeftArmSkin Clothing - ExternalLeftArmSkinToGround ExternalLeftArmSkinToGround ExternalLeftArmSkin ExternalGround - ExternalLeftLegSkinToClothing ExternalLeftLegSkinToClothing ExternalLeftLegSkin Clothing - ExternalLeftLegSkinToGround ExternalLeftLegSkinToGround ExternalLeftLegSkin ExternalGround - ExternalRightArmSkinToClothing ExternalRightArmSkinToClothing ExternalRightArmSkin Clothing - ExternalRightArmSkinToGround ExternalRightArmSkinToGround ExternalRightArmSkin ExternalGround - ExternalRightLegSkinToClothing ExternalRightLegSkinToClothing ExternalRightLegSkin Clothing - ExternalRightLegSkinToGround ExternalRightLegSkinToGround ExternalRightLegSkin ExternalGround - ExternalTorsoSkinToClothing ExternalTorsoSkinToClothing ExternalTorsoSkin Clothing - ExternalTorsoSkinToGround ExternalTorsoSkinToGround ExternalTorsoSkin ExternalGround - GroundToActive GroundToActive ExternalGround Active - GroundToClothing GroundToClothing ExternalGround Clothing - GroundToEnclosure GroundToEnclosure ExternalGround Enclosure - GroundToEnvironment GroundToEnvironment ExternalGround Ambient - GroundToInternalCore GroundToInternalCore InternalGround InternalCore - GroundToInternalHeadSkin GroundToInternalHeadSkin InternalGround InternalHeadSkin - GroundToInternalLeftArmSkin GroundToInternalLeftArmSkin InternalGround InternalLeftArmSkin - GroundToInternalLeftLegSkin GroundToInternalLeftLegSkin InternalGround InternalLeftLegSkin - GroundToInternalRightArmSkin GroundToInternalRightArmSkin InternalGround InternalRightArmSkin - GroundToInternalRightLegSkin GroundToInternalRightLegSkin InternalGround InternalRightLegSkin - GroundToInternalTorsoSkin GroundToInternalTorsoSkin InternalGround InternalTorsoSkin - InternalCoreToExternalCore InternalCoreToExternalCore InternalCore ExternalCore - InternalCoreToGround InternalCoreToGround InternalGround InternalCore - InternalCoreToInternalHeadSkin InternalCoreToInternalHeadSkin InternalCore InternalHeadSkin - InternalCoreToInternalLeftArmSkin InternalCoreToInternalLeftArmSkin InternalCore InternalLeftArmSkin - InternalCoreToInternalLeftLegSkin InternalCoreToInternalLeftLegSkin InternalCore InternalLeftLegSkin - InternalCoreToInternalRightArmSkin InternalCoreToInternalRightArmSkin InternalCore InternalRightArmSkin - InternalCoreToInternalRightLegSkin InternalCoreToInternalRightLegSkin InternalCore InternalRightLegSkin - InternalCoreToInternalTorsoSkin InternalCoreToInternalTorsoSkin InternalCore InternalTorsoSkin - InternalHeadSkinToExternalHeadSkin InternalHeadSkinToExternalHeadSkin InternalHeadSkin ExternalHeadSkin - InternalHeadSkinToGround InternalHeadSkinToTemperatureGround InternalGround InternalHeadSkin - InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkin ExternalLeftArmSkin - InternalLeftArmSkinToGround InternalLeftArmSkinToTemperatureGround InternalGround InternalLeftArmSkin - InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkin ExternalLeftLegSkin - InternalLeftLegSkinToGround InternalLeftLegSkinToTemperatureGround InternalGround InternalLeftLegSkin - InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkin ExternalRightArmSkin - InternalRightArmSkinToGround InternalRightArmSkinToTemperatureGround InternalGround InternalRightArmSkin - InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkin ExternalRightLegSkin - InternalRightLegSkinToGround InternalRightLegSkinToTemperatureGround InternalGround InternalRightLegSkin - InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkin ExternalTorsoSkin - InternalTorsoSkinToGround InternalTorsoSkinToTemperatureGround InternalGround InternalTorsoSkin - BoneTissue @@ -30566,7 +29814,6 @@ - Off @@ -30975,7 +30222,6 @@ - @@ -31002,15 +30248,15 @@ On - + - + - + - + @@ -32357,7 +31603,6 @@ - Extrasplanchnic @@ -32368,7 +31613,6 @@ - Extrasplanchnic @@ -32389,7 +31633,6 @@ - Splanchnic @@ -32400,7 +31643,6 @@ - Extrasplanchnic @@ -32418,7 +31660,6 @@ - Extrasplanchnic @@ -32429,7 +31670,6 @@ - Splanchnic @@ -32440,7 +31680,6 @@ - Muscle @@ -32451,7 +31690,6 @@ - Myocardium @@ -32462,7 +31700,6 @@ - Cerebral @@ -32473,7 +31710,6 @@ - Extrasplanchnic @@ -32491,7 +31727,6 @@ - Extrasplanchnic @@ -32502,7 +31737,6 @@ - Extrasplanchnic @@ -32513,7 +31747,6 @@ - Splanchnic @@ -32524,7 +31757,6 @@ - Splanchnic @@ -32535,7 +31767,6 @@ - Splanchnic @@ -32593,7 +31824,6 @@ - Extrasplanchnic @@ -32826,7 +32056,6 @@ - Cerebral @@ -32847,7 +32076,6 @@ - Cerebral @@ -32868,7 +32096,6 @@ - Cerebral @@ -32982,7 +32209,6 @@ - Extrasplanchnic @@ -33265,7 +32491,6 @@ - Splanchnic @@ -33344,7 +32569,6 @@ - Extrasplanchnic @@ -33628,7 +32852,6 @@ - Extrasplanchnic @@ -34001,7 +33224,6 @@ - Splanchnic @@ -34206,7 +33428,6 @@ - Muscle @@ -34323,7 +33544,6 @@ - Myocardium @@ -34440,7 +33660,6 @@ - Cerebral @@ -34471,7 +33690,6 @@ - Cerebral @@ -34515,7 +33733,6 @@ - Splanchnic @@ -34589,7 +33806,6 @@ - Extrasplanchnic @@ -34873,7 +34089,6 @@ - Extrasplanchnic @@ -35285,7 +34500,6 @@ - Extrasplanchnic @@ -35432,7 +34646,6 @@ - Splanchnic @@ -35493,7 +34706,6 @@ - Splanchnic @@ -35613,7 +34825,6 @@ - Splanchnic diff --git a/share/data/states/Male_28_Normal_hr109_rr18@0s.xml b/share/data/states/Male_28_Normal_hr109_rr18@0s.xml index a0bbc3808..2d2fd0ce2 100644 --- a/share/data/states/Male_28_Normal_hr109_rr18@0s.xml +++ b/share/data/states/Male_28_Normal_hr109_rr18@0s.xml @@ -1,5 +1,5 @@ - + Male_28_Normal_hr109_rr18 @@ -95,7 +95,7 @@ Gas - + @@ -183,7 +183,7 @@ - + @@ -319,7 +319,7 @@ - + @@ -369,7 +369,7 @@ - + @@ -392,7 +392,7 @@ - + @@ -425,7 +425,7 @@ - + @@ -450,7 +450,7 @@ - + @@ -521,7 +521,7 @@ - + @@ -577,7 +577,7 @@ - + @@ -600,7 +600,7 @@ - + @@ -625,7 +625,7 @@ - + @@ -650,7 +650,7 @@ - + @@ -691,7 +691,7 @@ - + @@ -918,7 +918,6 @@ - false false false @@ -1017,6 +1016,7 @@ + @@ -1166,16 +1166,13 @@ - - - @@ -1222,15 +1219,15 @@ false - + - - + + @@ -1243,9 +1240,9 @@ 84.41608845 41.8337412041608 - - - + + + @@ -1307,8 +1304,8 @@ - - + + @@ -1323,6 +1320,9 @@ 27 + + + @@ -1330,20 +1330,12 @@ Ambient Ambient - - - - Aorta Aorta1 Aorta2 Aorta3 - - - - Nitrogen @@ -1606,10 +1598,6 @@ Bladder Bladder - - - - Nitrogen @@ -1875,8 +1863,6 @@ BoneE3 BoneL1 BoneL2 - - Nitrogen @@ -2139,8 +2125,6 @@ BoneTissueIntracellular BoneI - - Nitrogen @@ -2404,10 +2388,6 @@ BoneVasculature Bone1 Bone2 - - - - Nitrogen @@ -2674,8 +2654,6 @@ BrainE3 BrainL1 BrainL2 - - Nitrogen @@ -2938,8 +2916,6 @@ BrainTissueIntracellular BrainI - - Nitrogen @@ -3204,276 +3180,269 @@ CerebralArteries CerebralCapillaries CerebralVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + CerebralArteries CerebralArteries1 CerebralArteries2 - - - - Nitrogen @@ -3736,10 +3705,6 @@ CerebralCapillaries CerebralCapillaries - - - - Nitrogen @@ -4002,8 +3967,6 @@ CerebralSpinalFluid SpinalFluid - - Nitrogen @@ -4267,10 +4230,6 @@ CerebralVeins1 CerebralVeins2 CerebralVeinsCheck - - - - Nitrogen @@ -4537,8 +4496,6 @@ FatE3 FatL1 FatL2 - - Nitrogen @@ -4801,8 +4758,6 @@ FatTissueIntracellular FatI - - Nitrogen @@ -5066,10 +5021,6 @@ FatVasculature Fat1 Fat2 - - - - Nitrogen @@ -5332,9 +5283,6 @@ Ground Ground - - - Nitrogen @@ -5455,8 +5403,6 @@ GutE3 GutL1 GutL2 - - Nitrogen @@ -5719,8 +5665,6 @@ GutTissueIntracellular GutI - - Nitrogen @@ -5985,266 +5929,263 @@ SplanchnicVasculature SmallIntestineVasculature LargeIntestineVasculature - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -6253,541 +6194,529 @@ LeftHeart RightHeart Pericardium - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + KidneyVasculature LeftKidneyVasculature RightKidneyVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LargeIntestineVasculature LargeIntestine1 - - - - Nitrogen @@ -7050,10 +6979,6 @@ LeftAfferentArteriole LeftAfferentArteriole - - - - Nitrogen @@ -7316,26 +7241,15 @@ LeftAlveoli LeftAlveoli - - - - LeftAlveoliLeak LeftAlveoliLeak - - - LeftArmVasculature LeftArm1 LeftArm2 - - - - Nitrogen @@ -7599,10 +7513,6 @@ LeftAtrium LeftAtrium1 LeftAtrium2 - - - - Nitrogen @@ -7866,10 +7776,6 @@ LeftBowmansCapsules LeftBowmansCapsules LeftNetBowmansCapsules - - - - Nitrogen @@ -8132,25 +8038,14 @@ LeftBronchi LeftBronchi - - - - LeftChestLeak LeftChestLeak - - - LeftEfferentArteriole LeftEfferentArteriole - - - - Nitrogen @@ -8414,10 +8309,6 @@ LeftGlomerularCapillaries LeftGlomerularCapillaries LeftNetGlomerularCapillaries - - - - Nitrogen @@ -8681,266 +8572,262 @@ LeftHeart LeftAtrium LeftVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -8950,8 +8837,6 @@ LeftKidneyE3 LeftKidneyL1 LeftKidneyL2 - - Nitrogen @@ -9214,8 +9099,6 @@ LeftKidneyTissueIntracellular LeftKidneyI - - Nitrogen @@ -9480,276 +9363,269 @@ LeftRenalArtery LeftNephron LeftRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftLegVasculature LeftLeg1 LeftLeg2 - - - - Nitrogen @@ -10013,10 +9889,6 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - - LeftLungTissueExtracellular @@ -10025,10 +9897,6 @@ LeftLungE3 LeftLungL1 LeftLungL2 - - - - Nitrogen @@ -10291,8 +10159,6 @@ LeftLungTissueIntracellular LeftLungI - - Nitrogen @@ -10557,266 +10423,263 @@ LeftPulmonaryArteries LeftPulmonaryCapillaries LeftPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -10827,276 +10690,269 @@ LeftPeritubularCapillaries LeftBowmansCapsules LeftTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftPeritubularCapillaries LeftPeritubularCapillaries LeftNetPeritubularCapillaries - - - - Nitrogen @@ -11360,19 +11216,11 @@ LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - LeftPulmonaryArteries LeftPulmonaryArteries LeftIntermediatePulmonaryArteries - - - - Nitrogen @@ -11635,10 +11483,6 @@ LeftPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen @@ -11901,10 +11745,6 @@ LeftPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen @@ -12167,10 +12007,6 @@ LeftRenalArtery LeftRenalArtery - - - - Nitrogen @@ -12433,10 +12269,6 @@ LeftRenalVein LeftRenalVein - - - - Nitrogen @@ -12700,10 +12532,6 @@ LeftTubules LeftTubules LeftNetTubules - - - - Nitrogen @@ -12966,10 +12794,6 @@ LeftUreter LeftUreter - - - - Nitrogen @@ -13232,10 +13056,6 @@ LeftVentricle LeftVentricle1 LeftVentricle2 - - - - Nitrogen @@ -13502,8 +13322,6 @@ LiverE3 LiverL1 LiverL2 - - Nitrogen @@ -13766,8 +13584,6 @@ LiverTissueIntracellular LiverI - - Nitrogen @@ -14033,9 +13849,6 @@ Liver2 PortalVein1 - - - Nitrogen @@ -14299,273 +14112,267 @@ LungsVasculature LeftLungVasculature RightLungVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + Lymph Lymph - - Nitrogen @@ -14827,16 +14634,10 @@ Mouth Mouth - - - - Mouthpiece Mouthpiece - - MuscleTissueExtracellular @@ -14845,8 +14646,6 @@ MuscleE3 MuscleL1 MuscleL2 - - Nitrogen @@ -15109,8 +14908,6 @@ MuscleTissueIntracellular MuscleI - - Nitrogen @@ -15374,10 +15171,6 @@ MuscleVasculature Muscle1 Muscle2 - - - - Nitrogen @@ -15644,8 +15437,6 @@ MyocardiumE3 MyocardiumL1 MyocardiumL2 - - Nitrogen @@ -15908,8 +15699,6 @@ MyocardiumTissueIntracellular MyocardiumI - - Nitrogen @@ -16173,10 +15962,6 @@ MyocardiumVasculature Myocardium1 Myocardium2 - - - - Nitrogen @@ -16439,10 +16224,6 @@ NeckArteries NeckArteries - - - - Nitrogen @@ -16705,10 +16486,6 @@ NeckVeins NeckVeins - - - - Nitrogen @@ -16971,8 +16748,6 @@ Pericardium Pericardium1 - - Nitrogen @@ -17236,825 +17011,801 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - PulmonaryArteries RightPulmonaryArteries LeftPulmonaryArteries - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryCapillaries RightPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - - PulmonaryVeins RightPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightAfferentArteriole RightAfferentArteriole - - - - Nitrogen @@ -18317,26 +18068,15 @@ RightAlveoli RightAlveoli - - - - RightAlveoliLeak RightAlveoliLeak - - - RightArmVasculature RightArm1 RightArm2 - - - - Nitrogen @@ -18600,10 +18340,6 @@ RightAtrium RightAtrium1 RightAtrium2 - - - - Nitrogen @@ -18867,10 +18603,6 @@ RightBowmansCapsules RightBowmansCapsules RightNetBowmansCapsules - - - - Nitrogen @@ -19133,25 +18865,14 @@ RightBronchi RightBronchi - - - - RightChestLeak RightChestLeak - - - RightEfferentArteriole RightEfferentArteriole - - - - Nitrogen @@ -19415,10 +19136,6 @@ RightGlomerularCapillaries RightGlomerularCapillaries RightNetGlomerularCapillaries - - - - Nitrogen @@ -19682,266 +19399,262 @@ RightHeart RightAtrium RightVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -19951,8 +19664,6 @@ RightKidneyE3 RightKidneyL1 RightKidneyL2 - - Nitrogen @@ -20215,8 +19926,6 @@ RightKidneyTissueIntracellular RightKidneyI - - Nitrogen @@ -20481,276 +20190,269 @@ RightRenalArtery RightNephron RightRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightLegVasculature RightLeg1 RightLeg2 - - - - Nitrogen @@ -21014,10 +20716,6 @@ RightLungPulmonary RightBronchi RightAlveoli - - - - RightLungTissueExtracellular @@ -21026,8 +20724,6 @@ RightLungE3 RightLungL1 RightLungL2 - - Nitrogen @@ -21290,8 +20986,6 @@ RightLungTissueIntracellular RightLungI - - Nitrogen @@ -21556,266 +21250,263 @@ RightPulmonaryArteries RightPulmonaryCapillaries RightPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -21826,276 +21517,269 @@ RightPeritubularCapillaries RightBowmansCapsules RightTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightPeritubularCapillaries RightPeritubularCapillaries RightNetPeritubularCapillaries - - - - Nitrogen @@ -22359,19 +22043,11 @@ RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - RightPulmonaryArteries RightPulmonaryArteries RightIntermediatePulmonaryArteries - - - - Nitrogen @@ -22634,10 +22310,6 @@ RightPulmonaryCapillaries RightPulmonaryCapillaries - - - - Nitrogen @@ -22900,10 +22572,6 @@ RightPulmonaryVeins RightPulmonaryVeins - - - - Nitrogen @@ -23166,10 +22834,6 @@ RightRenalArtery RightRenalArtery - - - - Nitrogen @@ -23432,10 +23096,6 @@ RightRenalVein RightRenalVein - - - - Nitrogen @@ -23699,10 +23359,6 @@ RightTubules RightTubules RightNetTubules - - - - Nitrogen @@ -23965,10 +23621,6 @@ RightUreter RightUreter - - - - Nitrogen @@ -24232,10 +23884,6 @@ RightVentricle1 RightVentricle2 MainPulmonaryArteries - - - - Nitrogen @@ -24502,8 +24150,6 @@ SkinE3 SkinL1 SkinL2 - - Nitrogen @@ -24766,8 +24412,6 @@ SkinTissueIntracellular SkinI - - Nitrogen @@ -25031,10 +24675,6 @@ SkinVasculature Skin1 Skin2 - - - - Nitrogen @@ -25297,8 +24937,6 @@ SmallIntestineChyme SmallIntestineC1 - - Nitrogen @@ -25560,10 +25198,6 @@ SmallIntestineVasculature SmallIntestine1 - - - - Nitrogen @@ -25826,10 +25460,6 @@ SplanchnicVasculature Splanchnic1 - - - - Nitrogen @@ -26096,8 +25726,6 @@ SpleenE3 SpleenL1 SpleenL2 - - Nitrogen @@ -26360,8 +25988,6 @@ SpleenTissueIntracellular SpleenI - - Nitrogen @@ -26624,10 +26250,6 @@ SpleenVasculature Spleen1 - - - - Nitrogen @@ -26890,290 +26512,276 @@ Stomach Stomach - - - - Trachea Trachea - - - - Ureters RightUreter LeftUreter - - - - Nitrogen - - + + - - + + Oxygen - - + + - - + + + CarbonDioxide - - + + - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + VenaCava VenaCava - - - - Nitrogen @@ -27438,189 +27046,162 @@ AortaBleed Aorta Ground - AortaToBone Aorta1ToBone1 Aorta BoneVasculature - AortaToFat Aorta1ToFat1 Aorta FatVasculature - AortaToLargeIntestine Aorta1ToLargeIntestine Aorta LargeIntestineVasculature - AortaToLeftArm Aorta1ToLeftArm1 Aorta LeftArmVasculature - AortaToLeftKidney LeftAortaConnectionToRenalArtery Aorta LeftRenalArtery - AortaToLeftLeg Aorta1ToLeftLeg1 Aorta LeftLegVasculature - AortaToLiver Aorta1ToLiver1 Aorta LiverVasculature - AortaToMuscle Aorta1ToMuscle1 Aorta MuscleVasculature - AortaToMyocardium Aorta1ToMyocardium1 Aorta MyocardiumVasculature - AortaToNeckArteries Aorta1ToNeckArteries Aorta NeckArteries - AortaToRightArm Aorta1ToRightArm1 Aorta RightArmVasculature - AortaToRightKidney RightAortaConnectionToRenalArtery Aorta RightRenalArtery - AortaToRightLeg Aorta1ToRightLeg1 Aorta RightLegVasculature - AortaToSkin Aorta1ToSkin1 Aorta SkinVasculature - AortaToSmallIntestine Aorta1ToSmallIntestine Aorta SmallIntestineVasculature - AortaToSplanchnic Aorta1ToSplanchnic Aorta SplanchnicVasculature - AortaToSpleen Aorta1ToSpleen Aorta SpleenVasculature - BladderToGround BladderToGroundUrinate Bladder Ground - BladderToGroundSource BladderToGroundPressure Bladder Ground - BoneToVenaCava Bone2ToVenaCava BoneVasculature VenaCava - BrainHemorrhage BrainBleed CerebralCapillaries Ground - CerebralArteriesToCerebralCapillaries CerebralArteries2ToCapillaries CerebralArteries CerebralCapillaries - CerebralCapillariesToCerebralVeins CerebralCapillariesToCerebralVeins1 CerebralCapillaries CerebralVeins - CerebralVeinsToNeckVeins CerebralVeins2ToNeckVeins CerebralVeins NeckVeins - EnvironmentToLeftChestLeak EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -27633,266 +27214,228 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - FatToVenaCava Fat2ToVenaCava FatVasculature VenaCava - HeartHemorrhage MyocardiumBleed MyocardiumVasculature Ground - LargeIntestineHemorrhage LargeIntestineBleed LargeIntestineVasculature Ground - LargeIntestineToLiver LargeIntestineToPortalVein LargeIntestineVasculature LiverVasculature - LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArteriole LeftGlomerularCapillaries - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftArmHemorrhage LeftArmBleed LeftArmVasculature Ground - LeftArmToVenaCava LeftArm2ToVenaCava LeftArmVasculature VenaCava - LeftAtriumToLeftVentricle LeftAtrium2ToLeftVentricle1 LeftAtrium LeftVentricle - LeftBowmansCapsulesToTubules LeftBowmansCapsulesToTubules LeftBowmansCapsules LeftTubules - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArteriole LeftPeritubularCapillaries - LeftGlomerularCapillariesToBowmansCapsules LeftNetGlomerularCapillariesToNetBowmansCapsules LeftGlomerularCapillaries LeftBowmansCapsules - LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillaries LeftEfferentArteriole - LeftKidneyHemorrhage LeftKidneyBleed LeftRenalVein Ground - LeftKidneyToVenaCava LeftRenalVeinToVenaCavaConnection LeftRenalVein VenaCava - LeftLegHemorrhage LeftLegBleed LeftLegVasculature Ground - LeftLegToVenaCava LeftLeg2ToVenaCava LeftLegVasculature VenaCava - LeftLungHemorrhage LeftLungBleed LeftPulmonaryArteries Ground - LeftLungVascularToTissue LeftLungVToLeftLungE1 LeftLungVasculature LeftLungTissueExtracellular - LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillaries LeftRenalVein - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - LeftPulmonaryArteriesToCapillaries LeftPulmonaryArteriesToLeftPulmonaryCapillaries LeftPulmonaryArteries LeftPulmonaryCapillaries - LeftPulmonaryArteriesToVeins LeftPulmonaryArteriesToLeftPulmonaryVeins LeftPulmonaryArteries LeftPulmonaryVeins - LeftPulmonaryCapillariesToVeins LeftPulmonaryCapillariesToLeftPulmonaryVeins LeftPulmonaryCapillaries LeftPulmonaryVeins - LeftPulmonaryVeinsToLeftAtrium LeftIntermediatePulmonaryVeinsToLeftAtrium1 LeftPulmonaryVeins LeftAtrium - LeftRenalArteryToAfferentArteriole LeftRenalArteryToAfferentArteriole LeftRenalArtery LeftAfferentArteriole - LeftTubulesToPeritubularCapillaries LeftNetTubulesToNetPeritubularCapillaries LeftTubules LeftPeritubularCapillaries - LeftTubulesToUreter LeftTubulesToUreter LeftTubules LeftUreter - LeftUreterToBladder LeftUreterToBladder LeftUreter Bladder - LeftVentricleToAorta LeftVentricle1ToAorta2 LeftVentricle Aorta - LiverHemorrhage LiverBleed LiverVasculature Ground - LiverToVenaCava Liver2ToVenaCava LiverVasculature VenaCava - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -27905,315 +27448,270 @@ Muscle2ToVenaCava MuscleVasculature VenaCava - MyocardiumToVenaCava Myocardium2ToVenaCava MyocardiumVasculature VenaCava - NeckArteriesToCerebralArteries NeckArteriesToCerebralArteries1 NeckArteries CerebralArteries - NeckVeinsToVenaCava NeckVeinsToVenaCava NeckVeins VenaCava - RightAfferentArterioleToGlomerularCapillaries RightAfferentArterioleToGlomerularCapillaries RightAfferentArteriole RightGlomerularCapillaries - RightAlveoliLeakToRightPleuralCavity RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightArmHemorrhage RightArmBleed RightArmVasculature Ground - RightArmToVenaCava RightArm2ToVenaCava RightArmVasculature VenaCava - RightAtriumToRightVentricle RightAtrium2ToRightVentricle1 RightAtrium RightVentricle - RightBowmansCapsulesToTubules RightBowmansCapsulesToTubules RightBowmansCapsules RightTubules - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightEfferentArterioleToPeritubularCapillaries RightEfferentArterioleToPeritubularCapillaries RightEfferentArteriole RightPeritubularCapillaries - RightGlomerularCapillariesToBowmansCapsules RightNetGlomerularCapillariesToNetBowmansCapsules RightGlomerularCapillaries RightBowmansCapsules - RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillaries RightEfferentArteriole - RightKidneyHemorrhage RightKidneyBleed RightRenalVein Ground - RightKidneyToVenaCava RightRenalVeinToVenaCavaConnection RightRenalVein VenaCava - RightLegHemorrhage RightLegBleed RightLegVasculature Ground - RightLegToVenaCava RightLeg2ToVenaCava RightLegVasculature VenaCava - RightLungHemorrhage RightLungBleed RightPulmonaryArteries Ground - RightPeritubularCapillariesToRenalVein RightPeritubularCapillariesToRenalVein RightPeritubularCapillaries RightRenalVein - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - RightPulmonaryArteriesToCapillaries RightPulmonaryArteriesToRightPulmonaryCapillaries RightPulmonaryArteries RightPulmonaryCapillaries - RightPulmonaryArteriesToVeins RightPulmonaryArteriesToRightPulmonaryVeins RightPulmonaryArteries RightPulmonaryVeins - RightPulmonaryCapillariesToVeins RightPulmonaryCapillariesToRightPulmonaryVeins RightPulmonaryCapillaries RightPulmonaryVeins - RightPulmonaryVeinsToLeftAtrium RightIntermediatePulmonaryVeinsToLeftAtrium1 RightPulmonaryVeins LeftAtrium - RightRenalArteryToAfferentArteriole RightRenalArteryToAfferentArteriole RightRenalArtery RightAfferentArteriole - RightTubulesToPeritubularCapillaries RightNetTubulesToNetPeritubularCapillaries RightTubules RightPeritubularCapillaries - RightTubulesToUreter RightTubulesToUreter RightTubules RightUreter - RightUreterToBladder RightUreterToBladder RightUreter Bladder - RightVentricleToLeftPulmonaryArteries MainPulmonaryArteriesToLeftIntermediatePulmonaryArteries RightVentricle LeftPulmonaryArteries - RightVentricleToRightPulmonaryArteries MainPulmonaryArteriesToRightIntermediatePulmonaryArteries RightVentricle RightPulmonaryArteries - SkinToVenaCava Skin2ToVenaCava SkinVasculature VenaCava - SmallIntestineHemorrhage SmallIntestineBleed SmallIntestineVasculature Ground - SmallIntestineToLiver SmallIntestineToPortalVein SmallIntestineVasculature LiverVasculature - SplanchnicHemorrhage SplanchnicBleed SplanchnicVasculature Ground - SplanchnicToLiver SplanchnicToPortalVein SplanchnicVasculature LiverVasculature - SpleenHemorrhage SpleenBleed SpleenVasculature Ground - SpleenToLiver SpleenToPortalVein SpleenVasculature LiverVasculature - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VenaCavaHemorrhage VenaCavaBleed VenaCava Ground - VenaCavaIV IVToVenaCava Ground VenaCava - VenaCavaToRightAtrium VenaCavaToRightAtrium1 VenaCava RightAtrium - Nitrogen Oxygen @@ -28639,10 +28137,6 @@ Ambient Ambient - - - - Nitrogen @@ -28665,10 +28159,6 @@ AnesthesiaConnection AnesthesiaConnection - - - - Nitrogen @@ -28691,7 +28181,6 @@ Connection MechanicalVentilatorConnection - Nitrogen @@ -28714,10 +28203,6 @@ ExpiratoryLimb ExpiratoryLimb - - - - Nitrogen @@ -28740,10 +28225,6 @@ GasInlet GasInlet - - - - Nitrogen @@ -28766,10 +28247,6 @@ GasSource GasSource - - - - Nitrogen @@ -28792,10 +28269,6 @@ InspiratoryLimb InspiratoryLimb - - - - Nitrogen @@ -28818,10 +28291,6 @@ LeftAlveoli LeftAlveoli - - - - Nitrogen @@ -28844,9 +28313,6 @@ LeftAlveoliLeak LeftAlveoliLeak - - - Nitrogen @@ -28860,10 +28326,6 @@ LeftBronchi LeftBronchi - - - - Nitrogen @@ -28886,9 +28348,6 @@ LeftChestLeak LeftChestLeak - - - Nitrogen @@ -28903,37 +28362,31 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - Nitrogen @@ -28956,10 +28409,6 @@ Mouth Mouth - - - - Nitrogen @@ -28982,8 +28431,6 @@ Mouthpiece Mouthpiece - - Nitrogen @@ -29006,7 +28453,6 @@ Nosepiece Nosepiece - Nitrogen @@ -29029,7 +28475,6 @@ OxygenTank OxygenTank - Nitrogen @@ -29053,62 +28498,53 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + ReliefValve ReliefValve - - - Nitrogen @@ -29131,10 +28567,6 @@ RightAlveoli RightAlveoli - - - - Nitrogen @@ -29157,9 +28589,6 @@ RightAlveoliLeak RightAlveoliLeak - - - Nitrogen @@ -29173,10 +28602,6 @@ RightBronchi RightBronchi - - - - Nitrogen @@ -29199,9 +28624,6 @@ RightChestLeak RightChestLeak - - - Nitrogen @@ -29216,37 +28638,30 @@ RightLungPulmonary RightBronchi RightAlveoli - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - Nitrogen @@ -29269,10 +28684,6 @@ Scrubber Scrubber - - - - Nitrogen @@ -29295,10 +28706,6 @@ Selector Selector - - - - Nitrogen @@ -29321,10 +28728,6 @@ Stomach Stomach - - - - Nitrogen @@ -29347,10 +28750,6 @@ Trachea Trachea - - - - Nitrogen @@ -29374,10 +28773,6 @@ Ventilator Ventilator VentilatorConnection - - - - Nitrogen @@ -29421,10 +28816,6 @@ YPiece YPiece - - - - Nitrogen @@ -29449,7 +28840,6 @@ AnesthesiaConnectionToEnvironment AnesthesiaConnection Ambient - ConnectionToMouth @@ -29462,14 +28852,12 @@ EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -29488,98 +28876,84 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - Exhaust SelectorToEnvironment Selector Ambient - ExpiratoryLimbToSelector ExpiratoryLimbToSelector ExpiratoryLimb Selector - GasInletToInspiratoryLimb GasInletToInspiratoryLimb GasInlet InspiratoryLimb - GasSourceToGasInlet GasSourceToGasInlet GasSource GasInlet - InspiratoryLimbToYPiece InspiratoryLimbToYPiece InspiratoryLimb YPiece - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - Mask AnesthesiaConnectionToMouth AnesthesiaConnection Mouth - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -29610,91 +28984,78 @@ RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - ScrubberToGasInlet ScrubberToGasInlet Scrubber GasInlet - SelectorToReliefValve SelectorToReliefValve Selector ReliefValve - SelectorToScrubber SelectorToScrubber Selector Scrubber - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VentilatorToSelector VentilatorConnectionToSelector Ventilator Selector - YPieceToAnesthesiaConnection YPieceToAnesthesiaConnection YPiece AnesthesiaConnection - YPieceToExpiratoryLimb YPieceToExpiratoryLimb YPiece ExpiratoryLimb - Nitrogen Oxygen @@ -29928,477 +29289,364 @@ Active Active - - - Ambient Ambient - - - Clothing Clothing - - - Enclosure Enclosure - - - ExternalCore ExternalCore - - - ExternalGround ExternalGround - - - ExternalHeadSkin ExternalHeadSkin - - - ExternalLeftArmSkin ExternalLeftArmSkin - - - ExternalLeftLegSkin ExternalLeftLegSkin - - - ExternalRightArmSkin ExternalRightArmSkin - - - ExternalRightLegSkin ExternalRightLegSkin - - - ExternalTorsoSkin ExternalTorsoSkin - - - InternalCore InternalCore InternalGround - - - - InternalGround - - InternalHeadSkin InternalHeadSkin - - - - InternalLeftArmSkin InternalLeftArmSkin - - - - InternalLeftLegSkin InternalLeftLegSkin - - - - InternalRightArmSkin InternalRightArmSkin - - - - InternalRightLegSkin InternalRightLegSkin - - - - InternalTorsoSkin InternalTorsoSkin - - - - ActiveToClothing ActiveToClothing Active Clothing - ClothingToEnclosure ClothingToEnclosure Clothing Enclosure - ClothingToEnvironment ClothingToEnvironment Clothing Ambient - ExternalCoreToGround ExternalCoreToGround ExternalCore ExternalGround - ExternalHeadSkinToClothing ExternalHeadSkinToClothing ExternalHeadSkin Clothing - ExternalHeadSkinToGround ExternalHeadSkinToGround ExternalHeadSkin ExternalGround - ExternalLeftArmSkinToClothing ExternalLeftArmSkinToClothing ExternalLeftArmSkin Clothing - ExternalLeftArmSkinToGround ExternalLeftArmSkinToGround ExternalLeftArmSkin ExternalGround - ExternalLeftLegSkinToClothing ExternalLeftLegSkinToClothing ExternalLeftLegSkin Clothing - ExternalLeftLegSkinToGround ExternalLeftLegSkinToGround ExternalLeftLegSkin ExternalGround - ExternalRightArmSkinToClothing ExternalRightArmSkinToClothing ExternalRightArmSkin Clothing - ExternalRightArmSkinToGround ExternalRightArmSkinToGround ExternalRightArmSkin ExternalGround - ExternalRightLegSkinToClothing ExternalRightLegSkinToClothing ExternalRightLegSkin Clothing - ExternalRightLegSkinToGround ExternalRightLegSkinToGround ExternalRightLegSkin ExternalGround - ExternalTorsoSkinToClothing ExternalTorsoSkinToClothing ExternalTorsoSkin Clothing - ExternalTorsoSkinToGround ExternalTorsoSkinToGround ExternalTorsoSkin ExternalGround - GroundToActive GroundToActive ExternalGround Active - GroundToClothing GroundToClothing ExternalGround Clothing - GroundToEnclosure GroundToEnclosure ExternalGround Enclosure - GroundToEnvironment GroundToEnvironment ExternalGround Ambient - GroundToInternalCore GroundToInternalCore InternalGround InternalCore - GroundToInternalHeadSkin GroundToInternalHeadSkin InternalGround InternalHeadSkin - GroundToInternalLeftArmSkin GroundToInternalLeftArmSkin InternalGround InternalLeftArmSkin - GroundToInternalLeftLegSkin GroundToInternalLeftLegSkin InternalGround InternalLeftLegSkin - GroundToInternalRightArmSkin GroundToInternalRightArmSkin InternalGround InternalRightArmSkin - GroundToInternalRightLegSkin GroundToInternalRightLegSkin InternalGround InternalRightLegSkin - GroundToInternalTorsoSkin GroundToInternalTorsoSkin InternalGround InternalTorsoSkin - InternalCoreToExternalCore InternalCoreToExternalCore InternalCore ExternalCore - InternalCoreToGround InternalCoreToGround InternalGround InternalCore - InternalCoreToInternalHeadSkin InternalCoreToInternalHeadSkin InternalCore InternalHeadSkin - InternalCoreToInternalLeftArmSkin InternalCoreToInternalLeftArmSkin InternalCore InternalLeftArmSkin - InternalCoreToInternalLeftLegSkin InternalCoreToInternalLeftLegSkin InternalCore InternalLeftLegSkin - InternalCoreToInternalRightArmSkin InternalCoreToInternalRightArmSkin InternalCore InternalRightArmSkin - InternalCoreToInternalRightLegSkin InternalCoreToInternalRightLegSkin InternalCore InternalRightLegSkin - InternalCoreToInternalTorsoSkin InternalCoreToInternalTorsoSkin InternalCore InternalTorsoSkin - InternalHeadSkinToExternalHeadSkin InternalHeadSkinToExternalHeadSkin InternalHeadSkin ExternalHeadSkin - InternalHeadSkinToGround InternalHeadSkinToTemperatureGround InternalGround InternalHeadSkin - InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkin ExternalLeftArmSkin - InternalLeftArmSkinToGround InternalLeftArmSkinToTemperatureGround InternalGround InternalLeftArmSkin - InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkin ExternalLeftLegSkin - InternalLeftLegSkinToGround InternalLeftLegSkinToTemperatureGround InternalGround InternalLeftLegSkin - InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkin ExternalRightArmSkin - InternalRightArmSkinToGround InternalRightArmSkinToTemperatureGround InternalGround InternalRightArmSkin - InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkin ExternalRightLegSkin - InternalRightLegSkinToGround InternalRightLegSkinToTemperatureGround InternalGround InternalRightLegSkin - InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkin ExternalTorsoSkin - InternalTorsoSkinToGround InternalTorsoSkinToTemperatureGround InternalGround InternalTorsoSkin - BoneTissue @@ -30572,7 +29820,6 @@ - Off @@ -30981,7 +30228,6 @@ - @@ -31008,15 +30254,15 @@ On - + - + - + - + @@ -32363,7 +31609,6 @@ - Extrasplanchnic @@ -32374,7 +31619,6 @@ - Extrasplanchnic @@ -32395,7 +31639,6 @@ - Splanchnic @@ -32406,7 +31649,6 @@ - Extrasplanchnic @@ -32424,7 +31666,6 @@ - Extrasplanchnic @@ -32435,7 +31676,6 @@ - Splanchnic @@ -32446,7 +31686,6 @@ - Muscle @@ -32457,7 +31696,6 @@ - Myocardium @@ -32468,7 +31706,6 @@ - Cerebral @@ -32479,7 +31716,6 @@ - Extrasplanchnic @@ -32497,7 +31733,6 @@ - Extrasplanchnic @@ -32508,7 +31743,6 @@ - Extrasplanchnic @@ -32519,7 +31753,6 @@ - Splanchnic @@ -32530,7 +31763,6 @@ - Splanchnic @@ -32541,7 +31773,6 @@ - Splanchnic @@ -32599,7 +31830,6 @@ - Extrasplanchnic @@ -32832,7 +32062,6 @@ - Cerebral @@ -32853,7 +32082,6 @@ - Cerebral @@ -32874,7 +32102,6 @@ - Cerebral @@ -32988,7 +32215,6 @@ - Extrasplanchnic @@ -33271,7 +32497,6 @@ - Splanchnic @@ -33350,7 +32575,6 @@ - Extrasplanchnic @@ -33634,7 +32858,6 @@ - Extrasplanchnic @@ -34007,7 +33230,6 @@ - Splanchnic @@ -34212,7 +33434,6 @@ - Muscle @@ -34329,7 +33550,6 @@ - Myocardium @@ -34446,7 +33666,6 @@ - Cerebral @@ -34477,7 +33696,6 @@ - Cerebral @@ -34521,7 +33739,6 @@ - Splanchnic @@ -34595,7 +33812,6 @@ - Extrasplanchnic @@ -34879,7 +34095,6 @@ - Extrasplanchnic @@ -35291,7 +34506,6 @@ - Extrasplanchnic @@ -35438,7 +34652,6 @@ - Splanchnic @@ -35499,7 +34712,6 @@ - Splanchnic @@ -35619,7 +34831,6 @@ - Splanchnic diff --git a/share/data/states/Male_32_Normal_hr93_rr14@0s.xml b/share/data/states/Male_32_Normal_hr93_rr14@0s.xml index 6827102dc..dafc4be33 100644 --- a/share/data/states/Male_32_Normal_hr93_rr14@0s.xml +++ b/share/data/states/Male_32_Normal_hr93_rr14@0s.xml @@ -1,5 +1,5 @@ - + Male_32_Normal_hr93_rr14 @@ -48,7 +48,7 @@ Gas - + @@ -180,7 +180,7 @@ - + @@ -316,7 +316,7 @@ - + @@ -366,7 +366,7 @@ - + @@ -389,7 +389,7 @@ - + @@ -422,7 +422,7 @@ - + @@ -447,7 +447,7 @@ - + @@ -470,7 +470,7 @@ - + @@ -518,7 +518,7 @@ - + @@ -574,7 +574,7 @@ - + @@ -597,7 +597,7 @@ - + @@ -622,7 +622,7 @@ - + @@ -647,7 +647,7 @@ - + @@ -688,7 +688,7 @@ - + @@ -915,7 +915,6 @@ - false true false @@ -1014,6 +1013,7 @@ + @@ -1163,16 +1163,13 @@ - - - @@ -1219,15 +1216,15 @@ false - + - - + + @@ -1240,9 +1237,9 @@ 86.6840503 42.8627511574944 - - - + + + @@ -1304,8 +1301,8 @@ - - + + @@ -1320,6 +1317,9 @@ 11 + + + @@ -1327,20 +1327,12 @@ Ambient Ambient - - - - Aorta Aorta1 Aorta2 Aorta3 - - - - Nitrogen @@ -1603,10 +1595,6 @@ Bladder Bladder - - - - Nitrogen @@ -1872,8 +1860,6 @@ BoneE3 BoneL1 BoneL2 - - Nitrogen @@ -2136,8 +2122,6 @@ BoneTissueIntracellular BoneI - - Nitrogen @@ -2401,10 +2385,6 @@ BoneVasculature Bone1 Bone2 - - - - Nitrogen @@ -2671,8 +2651,6 @@ BrainE3 BrainL1 BrainL2 - - Nitrogen @@ -2935,8 +2913,6 @@ BrainTissueIntracellular BrainI - - Nitrogen @@ -3201,276 +3177,269 @@ CerebralArteries CerebralCapillaries CerebralVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + CerebralArteries CerebralArteries1 CerebralArteries2 - - - - Nitrogen @@ -3733,10 +3702,6 @@ CerebralCapillaries CerebralCapillaries - - - - Nitrogen @@ -3999,8 +3964,6 @@ CerebralSpinalFluid SpinalFluid - - Nitrogen @@ -4264,10 +4227,6 @@ CerebralVeins1 CerebralVeins2 CerebralVeinsCheck - - - - Nitrogen @@ -4534,8 +4493,6 @@ FatE3 FatL1 FatL2 - - Nitrogen @@ -4798,8 +4755,6 @@ FatTissueIntracellular FatI - - Nitrogen @@ -5063,10 +5018,6 @@ FatVasculature Fat1 Fat2 - - - - Nitrogen @@ -5329,9 +5280,6 @@ Ground Ground - - - Nitrogen @@ -5452,8 +5400,6 @@ GutE3 GutL1 GutL2 - - Nitrogen @@ -5716,8 +5662,6 @@ GutTissueIntracellular GutI - - Nitrogen @@ -5982,266 +5926,263 @@ SplanchnicVasculature SmallIntestineVasculature LargeIntestineVasculature - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -6250,541 +6191,529 @@ LeftHeart RightHeart Pericardium - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + KidneyVasculature LeftKidneyVasculature RightKidneyVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LargeIntestineVasculature LargeIntestine1 - - - - Nitrogen @@ -7047,10 +6976,6 @@ LeftAfferentArteriole LeftAfferentArteriole - - - - Nitrogen @@ -7313,26 +7238,15 @@ LeftAlveoli LeftAlveoli - - - - LeftAlveoliLeak LeftAlveoliLeak - - - LeftArmVasculature LeftArm1 LeftArm2 - - - - Nitrogen @@ -7596,10 +7510,6 @@ LeftAtrium LeftAtrium1 LeftAtrium2 - - - - Nitrogen @@ -7863,10 +7773,6 @@ LeftBowmansCapsules LeftBowmansCapsules LeftNetBowmansCapsules - - - - Nitrogen @@ -8129,25 +8035,14 @@ LeftBronchi LeftBronchi - - - - LeftChestLeak LeftChestLeak - - - LeftEfferentArteriole LeftEfferentArteriole - - - - Nitrogen @@ -8411,10 +8306,6 @@ LeftGlomerularCapillaries LeftGlomerularCapillaries LeftNetGlomerularCapillaries - - - - Nitrogen @@ -8678,266 +8569,262 @@ LeftHeart LeftAtrium LeftVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -8947,8 +8834,6 @@ LeftKidneyE3 LeftKidneyL1 LeftKidneyL2 - - Nitrogen @@ -9211,8 +9096,6 @@ LeftKidneyTissueIntracellular LeftKidneyI - - Nitrogen @@ -9477,276 +9360,269 @@ LeftRenalArtery LeftNephron LeftRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftLegVasculature LeftLeg1 LeftLeg2 - - - - Nitrogen @@ -10010,10 +9886,6 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - - LeftLungTissueExtracellular @@ -10022,10 +9894,6 @@ LeftLungE3 LeftLungL1 LeftLungL2 - - - - Nitrogen @@ -10288,8 +10156,6 @@ LeftLungTissueIntracellular LeftLungI - - Nitrogen @@ -10554,266 +10420,263 @@ LeftPulmonaryArteries LeftPulmonaryCapillaries LeftPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -10824,276 +10687,269 @@ LeftPeritubularCapillaries LeftBowmansCapsules LeftTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftPeritubularCapillaries LeftPeritubularCapillaries LeftNetPeritubularCapillaries - - - - Nitrogen @@ -11357,19 +11213,11 @@ LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - LeftPulmonaryArteries LeftPulmonaryArteries LeftIntermediatePulmonaryArteries - - - - Nitrogen @@ -11632,10 +11480,6 @@ LeftPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen @@ -11898,10 +11742,6 @@ LeftPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen @@ -12164,10 +12004,6 @@ LeftRenalArtery LeftRenalArtery - - - - Nitrogen @@ -12430,10 +12266,6 @@ LeftRenalVein LeftRenalVein - - - - Nitrogen @@ -12697,10 +12529,6 @@ LeftTubules LeftTubules LeftNetTubules - - - - Nitrogen @@ -12963,10 +12791,6 @@ LeftUreter LeftUreter - - - - Nitrogen @@ -13229,10 +13053,6 @@ LeftVentricle LeftVentricle1 LeftVentricle2 - - - - Nitrogen @@ -13499,8 +13319,6 @@ LiverE3 LiverL1 LiverL2 - - Nitrogen @@ -13763,8 +13581,6 @@ LiverTissueIntracellular LiverI - - Nitrogen @@ -14030,9 +13846,6 @@ Liver2 PortalVein1 - - - Nitrogen @@ -14296,273 +14109,267 @@ LungsVasculature LeftLungVasculature RightLungVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + Lymph Lymph - - Nitrogen @@ -14824,16 +14631,10 @@ Mouth Mouth - - - - Mouthpiece Mouthpiece - - MuscleTissueExtracellular @@ -14842,8 +14643,6 @@ MuscleE3 MuscleL1 MuscleL2 - - Nitrogen @@ -15106,8 +14905,6 @@ MuscleTissueIntracellular MuscleI - - Nitrogen @@ -15371,10 +15168,6 @@ MuscleVasculature Muscle1 Muscle2 - - - - Nitrogen @@ -15641,8 +15434,6 @@ MyocardiumE3 MyocardiumL1 MyocardiumL2 - - Nitrogen @@ -15905,8 +15696,6 @@ MyocardiumTissueIntracellular MyocardiumI - - Nitrogen @@ -16170,10 +15959,6 @@ MyocardiumVasculature Myocardium1 Myocardium2 - - - - Nitrogen @@ -16436,10 +16221,6 @@ NeckArteries NeckArteries - - - - Nitrogen @@ -16702,10 +16483,6 @@ NeckVeins NeckVeins - - - - Nitrogen @@ -16968,8 +16745,6 @@ Pericardium Pericardium1 - - Nitrogen @@ -17233,825 +17008,801 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - PulmonaryArteries RightPulmonaryArteries LeftPulmonaryArteries - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryCapillaries RightPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - - PulmonaryVeins RightPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightAfferentArteriole RightAfferentArteriole - - - - Nitrogen @@ -18314,26 +18065,15 @@ RightAlveoli RightAlveoli - - - - RightAlveoliLeak RightAlveoliLeak - - - RightArmVasculature RightArm1 RightArm2 - - - - Nitrogen @@ -18597,10 +18337,6 @@ RightAtrium RightAtrium1 RightAtrium2 - - - - Nitrogen @@ -18864,10 +18600,6 @@ RightBowmansCapsules RightBowmansCapsules RightNetBowmansCapsules - - - - Nitrogen @@ -19130,25 +18862,14 @@ RightBronchi RightBronchi - - - - RightChestLeak RightChestLeak - - - RightEfferentArteriole RightEfferentArteriole - - - - Nitrogen @@ -19412,10 +19133,6 @@ RightGlomerularCapillaries RightGlomerularCapillaries RightNetGlomerularCapillaries - - - - Nitrogen @@ -19679,266 +19396,262 @@ RightHeart RightAtrium RightVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -19948,8 +19661,6 @@ RightKidneyE3 RightKidneyL1 RightKidneyL2 - - Nitrogen @@ -20212,8 +19923,6 @@ RightKidneyTissueIntracellular RightKidneyI - - Nitrogen @@ -20478,276 +20187,269 @@ RightRenalArtery RightNephron RightRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightLegVasculature RightLeg1 RightLeg2 - - - - Nitrogen @@ -21011,10 +20713,6 @@ RightLungPulmonary RightBronchi RightAlveoli - - - - RightLungTissueExtracellular @@ -21023,8 +20721,6 @@ RightLungE3 RightLungL1 RightLungL2 - - Nitrogen @@ -21287,8 +20983,6 @@ RightLungTissueIntracellular RightLungI - - Nitrogen @@ -21553,266 +21247,263 @@ RightPulmonaryArteries RightPulmonaryCapillaries RightPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -21823,276 +21514,269 @@ RightPeritubularCapillaries RightBowmansCapsules RightTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightPeritubularCapillaries RightPeritubularCapillaries RightNetPeritubularCapillaries - - - - Nitrogen @@ -22356,19 +22040,11 @@ RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - RightPulmonaryArteries RightPulmonaryArteries RightIntermediatePulmonaryArteries - - - - Nitrogen @@ -22631,10 +22307,6 @@ RightPulmonaryCapillaries RightPulmonaryCapillaries - - - - Nitrogen @@ -22897,10 +22569,6 @@ RightPulmonaryVeins RightPulmonaryVeins - - - - Nitrogen @@ -23163,10 +22831,6 @@ RightRenalArtery RightRenalArtery - - - - Nitrogen @@ -23429,10 +23093,6 @@ RightRenalVein RightRenalVein - - - - Nitrogen @@ -23696,10 +23356,6 @@ RightTubules RightTubules RightNetTubules - - - - Nitrogen @@ -23962,10 +23618,6 @@ RightUreter RightUreter - - - - Nitrogen @@ -24229,10 +23881,6 @@ RightVentricle1 RightVentricle2 MainPulmonaryArteries - - - - Nitrogen @@ -24499,8 +24147,6 @@ SkinE3 SkinL1 SkinL2 - - Nitrogen @@ -24763,8 +24409,6 @@ SkinTissueIntracellular SkinI - - Nitrogen @@ -25028,10 +24672,6 @@ SkinVasculature Skin1 Skin2 - - - - Nitrogen @@ -25294,8 +24934,6 @@ SmallIntestineChyme SmallIntestineC1 - - Nitrogen @@ -25557,10 +25195,6 @@ SmallIntestineVasculature SmallIntestine1 - - - - Nitrogen @@ -25823,10 +25457,6 @@ SplanchnicVasculature Splanchnic1 - - - - Nitrogen @@ -26093,8 +25723,6 @@ SpleenE3 SpleenL1 SpleenL2 - - Nitrogen @@ -26357,8 +25985,6 @@ SpleenTissueIntracellular SpleenI - - Nitrogen @@ -26621,10 +26247,6 @@ SpleenVasculature Spleen1 - - - - Nitrogen @@ -26887,290 +26509,276 @@ Stomach Stomach - - - - Trachea Trachea - - - - Ureters RightUreter LeftUreter - - - - Nitrogen - - + + - - + + Oxygen - - + + - - + + + CarbonDioxide - - + + - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + VenaCava VenaCava - - - - Nitrogen @@ -27435,189 +27043,162 @@ AortaBleed Aorta Ground - AortaToBone Aorta1ToBone1 Aorta BoneVasculature - AortaToFat Aorta1ToFat1 Aorta FatVasculature - AortaToLargeIntestine Aorta1ToLargeIntestine Aorta LargeIntestineVasculature - AortaToLeftArm Aorta1ToLeftArm1 Aorta LeftArmVasculature - AortaToLeftKidney LeftAortaConnectionToRenalArtery Aorta LeftRenalArtery - AortaToLeftLeg Aorta1ToLeftLeg1 Aorta LeftLegVasculature - AortaToLiver Aorta1ToLiver1 Aorta LiverVasculature - AortaToMuscle Aorta1ToMuscle1 Aorta MuscleVasculature - AortaToMyocardium Aorta1ToMyocardium1 Aorta MyocardiumVasculature - AortaToNeckArteries Aorta1ToNeckArteries Aorta NeckArteries - AortaToRightArm Aorta1ToRightArm1 Aorta RightArmVasculature - AortaToRightKidney RightAortaConnectionToRenalArtery Aorta RightRenalArtery - AortaToRightLeg Aorta1ToRightLeg1 Aorta RightLegVasculature - AortaToSkin Aorta1ToSkin1 Aorta SkinVasculature - AortaToSmallIntestine Aorta1ToSmallIntestine Aorta SmallIntestineVasculature - AortaToSplanchnic Aorta1ToSplanchnic Aorta SplanchnicVasculature - AortaToSpleen Aorta1ToSpleen Aorta SpleenVasculature - BladderToGround BladderToGroundUrinate Bladder Ground - BladderToGroundSource BladderToGroundPressure Bladder Ground - BoneToVenaCava Bone2ToVenaCava BoneVasculature VenaCava - BrainHemorrhage BrainBleed CerebralCapillaries Ground - CerebralArteriesToCerebralCapillaries CerebralArteries2ToCapillaries CerebralArteries CerebralCapillaries - CerebralCapillariesToCerebralVeins CerebralCapillariesToCerebralVeins1 CerebralCapillaries CerebralVeins - CerebralVeinsToNeckVeins CerebralVeins2ToNeckVeins CerebralVeins NeckVeins - EnvironmentToLeftChestLeak EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -27630,266 +27211,228 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - FatToVenaCava Fat2ToVenaCava FatVasculature VenaCava - HeartHemorrhage MyocardiumBleed MyocardiumVasculature Ground - LargeIntestineHemorrhage LargeIntestineBleed LargeIntestineVasculature Ground - LargeIntestineToLiver LargeIntestineToPortalVein LargeIntestineVasculature LiverVasculature - LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArteriole LeftGlomerularCapillaries - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftArmHemorrhage LeftArmBleed LeftArmVasculature Ground - LeftArmToVenaCava LeftArm2ToVenaCava LeftArmVasculature VenaCava - LeftAtriumToLeftVentricle LeftAtrium2ToLeftVentricle1 LeftAtrium LeftVentricle - LeftBowmansCapsulesToTubules LeftBowmansCapsulesToTubules LeftBowmansCapsules LeftTubules - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArteriole LeftPeritubularCapillaries - LeftGlomerularCapillariesToBowmansCapsules LeftNetGlomerularCapillariesToNetBowmansCapsules LeftGlomerularCapillaries LeftBowmansCapsules - LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillaries LeftEfferentArteriole - LeftKidneyHemorrhage LeftKidneyBleed LeftRenalVein Ground - LeftKidneyToVenaCava LeftRenalVeinToVenaCavaConnection LeftRenalVein VenaCava - LeftLegHemorrhage LeftLegBleed LeftLegVasculature Ground - LeftLegToVenaCava LeftLeg2ToVenaCava LeftLegVasculature VenaCava - LeftLungHemorrhage LeftLungBleed LeftPulmonaryArteries Ground - LeftLungVascularToTissue LeftLungVToLeftLungE1 LeftLungVasculature LeftLungTissueExtracellular - LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillaries LeftRenalVein - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - LeftPulmonaryArteriesToCapillaries LeftPulmonaryArteriesToLeftPulmonaryCapillaries LeftPulmonaryArteries LeftPulmonaryCapillaries - LeftPulmonaryArteriesToVeins LeftPulmonaryArteriesToLeftPulmonaryVeins LeftPulmonaryArteries LeftPulmonaryVeins - LeftPulmonaryCapillariesToVeins LeftPulmonaryCapillariesToLeftPulmonaryVeins LeftPulmonaryCapillaries LeftPulmonaryVeins - LeftPulmonaryVeinsToLeftAtrium LeftIntermediatePulmonaryVeinsToLeftAtrium1 LeftPulmonaryVeins LeftAtrium - LeftRenalArteryToAfferentArteriole LeftRenalArteryToAfferentArteriole LeftRenalArtery LeftAfferentArteriole - LeftTubulesToPeritubularCapillaries LeftNetTubulesToNetPeritubularCapillaries LeftTubules LeftPeritubularCapillaries - LeftTubulesToUreter LeftTubulesToUreter LeftTubules LeftUreter - LeftUreterToBladder LeftUreterToBladder LeftUreter Bladder - LeftVentricleToAorta LeftVentricle1ToAorta2 LeftVentricle Aorta - LiverHemorrhage LiverBleed LiverVasculature Ground - LiverToVenaCava Liver2ToVenaCava LiverVasculature VenaCava - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -27902,315 +27445,270 @@ Muscle2ToVenaCava MuscleVasculature VenaCava - MyocardiumToVenaCava Myocardium2ToVenaCava MyocardiumVasculature VenaCava - NeckArteriesToCerebralArteries NeckArteriesToCerebralArteries1 NeckArteries CerebralArteries - NeckVeinsToVenaCava NeckVeinsToVenaCava NeckVeins VenaCava - RightAfferentArterioleToGlomerularCapillaries RightAfferentArterioleToGlomerularCapillaries RightAfferentArteriole RightGlomerularCapillaries - RightAlveoliLeakToRightPleuralCavity RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightArmHemorrhage RightArmBleed RightArmVasculature Ground - RightArmToVenaCava RightArm2ToVenaCava RightArmVasculature VenaCava - RightAtriumToRightVentricle RightAtrium2ToRightVentricle1 RightAtrium RightVentricle - RightBowmansCapsulesToTubules RightBowmansCapsulesToTubules RightBowmansCapsules RightTubules - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightEfferentArterioleToPeritubularCapillaries RightEfferentArterioleToPeritubularCapillaries RightEfferentArteriole RightPeritubularCapillaries - RightGlomerularCapillariesToBowmansCapsules RightNetGlomerularCapillariesToNetBowmansCapsules RightGlomerularCapillaries RightBowmansCapsules - RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillaries RightEfferentArteriole - RightKidneyHemorrhage RightKidneyBleed RightRenalVein Ground - RightKidneyToVenaCava RightRenalVeinToVenaCavaConnection RightRenalVein VenaCava - RightLegHemorrhage RightLegBleed RightLegVasculature Ground - RightLegToVenaCava RightLeg2ToVenaCava RightLegVasculature VenaCava - RightLungHemorrhage RightLungBleed RightPulmonaryArteries Ground - RightPeritubularCapillariesToRenalVein RightPeritubularCapillariesToRenalVein RightPeritubularCapillaries RightRenalVein - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - RightPulmonaryArteriesToCapillaries RightPulmonaryArteriesToRightPulmonaryCapillaries RightPulmonaryArteries RightPulmonaryCapillaries - RightPulmonaryArteriesToVeins RightPulmonaryArteriesToRightPulmonaryVeins RightPulmonaryArteries RightPulmonaryVeins - RightPulmonaryCapillariesToVeins RightPulmonaryCapillariesToRightPulmonaryVeins RightPulmonaryCapillaries RightPulmonaryVeins - RightPulmonaryVeinsToLeftAtrium RightIntermediatePulmonaryVeinsToLeftAtrium1 RightPulmonaryVeins LeftAtrium - RightRenalArteryToAfferentArteriole RightRenalArteryToAfferentArteriole RightRenalArtery RightAfferentArteriole - RightTubulesToPeritubularCapillaries RightNetTubulesToNetPeritubularCapillaries RightTubules RightPeritubularCapillaries - RightTubulesToUreter RightTubulesToUreter RightTubules RightUreter - RightUreterToBladder RightUreterToBladder RightUreter Bladder - RightVentricleToLeftPulmonaryArteries MainPulmonaryArteriesToLeftIntermediatePulmonaryArteries RightVentricle LeftPulmonaryArteries - RightVentricleToRightPulmonaryArteries MainPulmonaryArteriesToRightIntermediatePulmonaryArteries RightVentricle RightPulmonaryArteries - SkinToVenaCava Skin2ToVenaCava SkinVasculature VenaCava - SmallIntestineHemorrhage SmallIntestineBleed SmallIntestineVasculature Ground - SmallIntestineToLiver SmallIntestineToPortalVein SmallIntestineVasculature LiverVasculature - SplanchnicHemorrhage SplanchnicBleed SplanchnicVasculature Ground - SplanchnicToLiver SplanchnicToPortalVein SplanchnicVasculature LiverVasculature - SpleenHemorrhage SpleenBleed SpleenVasculature Ground - SpleenToLiver SpleenToPortalVein SpleenVasculature LiverVasculature - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VenaCavaHemorrhage VenaCavaBleed VenaCava Ground - VenaCavaIV IVToVenaCava Ground VenaCava - VenaCavaToRightAtrium VenaCavaToRightAtrium1 VenaCava RightAtrium - Nitrogen Oxygen @@ -28636,10 +28134,6 @@ Ambient Ambient - - - - Nitrogen @@ -28662,10 +28156,6 @@ AnesthesiaConnection AnesthesiaConnection - - - - Nitrogen @@ -28688,7 +28178,6 @@ Connection MechanicalVentilatorConnection - Nitrogen @@ -28711,10 +28200,6 @@ ExpiratoryLimb ExpiratoryLimb - - - - Nitrogen @@ -28737,10 +28222,6 @@ GasInlet GasInlet - - - - Nitrogen @@ -28763,10 +28244,6 @@ GasSource GasSource - - - - Nitrogen @@ -28789,10 +28266,6 @@ InspiratoryLimb InspiratoryLimb - - - - Nitrogen @@ -28815,10 +28288,6 @@ LeftAlveoli LeftAlveoli - - - - Nitrogen @@ -28841,9 +28310,6 @@ LeftAlveoliLeak LeftAlveoliLeak - - - Nitrogen @@ -28857,10 +28323,6 @@ LeftBronchi LeftBronchi - - - - Nitrogen @@ -28883,9 +28345,6 @@ LeftChestLeak LeftChestLeak - - - Nitrogen @@ -28900,37 +28359,31 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - Nitrogen @@ -28953,10 +28406,6 @@ Mouth Mouth - - - - Nitrogen @@ -28979,8 +28428,6 @@ Mouthpiece Mouthpiece - - Nitrogen @@ -29003,7 +28450,6 @@ Nosepiece Nosepiece - Nitrogen @@ -29026,7 +28472,6 @@ OxygenTank OxygenTank - Nitrogen @@ -29050,62 +28495,53 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + ReliefValve ReliefValve - - - Nitrogen @@ -29128,10 +28564,6 @@ RightAlveoli RightAlveoli - - - - Nitrogen @@ -29154,9 +28586,6 @@ RightAlveoliLeak RightAlveoliLeak - - - Nitrogen @@ -29170,10 +28599,6 @@ RightBronchi RightBronchi - - - - Nitrogen @@ -29196,9 +28621,6 @@ RightChestLeak RightChestLeak - - - Nitrogen @@ -29213,37 +28635,30 @@ RightLungPulmonary RightBronchi RightAlveoli - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - Nitrogen @@ -29266,10 +28681,6 @@ Scrubber Scrubber - - - - Nitrogen @@ -29292,10 +28703,6 @@ Selector Selector - - - - Nitrogen @@ -29318,10 +28725,6 @@ Stomach Stomach - - - - Nitrogen @@ -29344,10 +28747,6 @@ Trachea Trachea - - - - Nitrogen @@ -29371,10 +28770,6 @@ Ventilator Ventilator VentilatorConnection - - - - Nitrogen @@ -29418,10 +28813,6 @@ YPiece YPiece - - - - Nitrogen @@ -29446,7 +28837,6 @@ AnesthesiaConnectionToEnvironment AnesthesiaConnection Ambient - ConnectionToMouth @@ -29459,14 +28849,12 @@ EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -29485,98 +28873,84 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - Exhaust SelectorToEnvironment Selector Ambient - ExpiratoryLimbToSelector ExpiratoryLimbToSelector ExpiratoryLimb Selector - GasInletToInspiratoryLimb GasInletToInspiratoryLimb GasInlet InspiratoryLimb - GasSourceToGasInlet GasSourceToGasInlet GasSource GasInlet - InspiratoryLimbToYPiece InspiratoryLimbToYPiece InspiratoryLimb YPiece - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - Mask AnesthesiaConnectionToMouth AnesthesiaConnection Mouth - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -29607,91 +28981,78 @@ RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - ScrubberToGasInlet ScrubberToGasInlet Scrubber GasInlet - SelectorToReliefValve SelectorToReliefValve Selector ReliefValve - SelectorToScrubber SelectorToScrubber Selector Scrubber - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VentilatorToSelector VentilatorConnectionToSelector Ventilator Selector - YPieceToAnesthesiaConnection YPieceToAnesthesiaConnection YPiece AnesthesiaConnection - YPieceToExpiratoryLimb YPieceToExpiratoryLimb YPiece ExpiratoryLimb - Nitrogen Oxygen @@ -29925,477 +29286,364 @@ Active Active - - - Ambient Ambient - - - Clothing Clothing - - - Enclosure Enclosure - - - ExternalCore ExternalCore - - - ExternalGround ExternalGround - - - ExternalHeadSkin ExternalHeadSkin - - - ExternalLeftArmSkin ExternalLeftArmSkin - - - ExternalLeftLegSkin ExternalLeftLegSkin - - - ExternalRightArmSkin ExternalRightArmSkin - - - ExternalRightLegSkin ExternalRightLegSkin - - - ExternalTorsoSkin ExternalTorsoSkin - - - InternalCore InternalCore InternalGround - - - - InternalGround - - InternalHeadSkin InternalHeadSkin - - - - InternalLeftArmSkin InternalLeftArmSkin - - - - InternalLeftLegSkin InternalLeftLegSkin - - - - InternalRightArmSkin InternalRightArmSkin - - - - InternalRightLegSkin InternalRightLegSkin - - - - InternalTorsoSkin InternalTorsoSkin - - - - ActiveToClothing ActiveToClothing Active Clothing - ClothingToEnclosure ClothingToEnclosure Clothing Enclosure - ClothingToEnvironment ClothingToEnvironment Clothing Ambient - ExternalCoreToGround ExternalCoreToGround ExternalCore ExternalGround - ExternalHeadSkinToClothing ExternalHeadSkinToClothing ExternalHeadSkin Clothing - ExternalHeadSkinToGround ExternalHeadSkinToGround ExternalHeadSkin ExternalGround - ExternalLeftArmSkinToClothing ExternalLeftArmSkinToClothing ExternalLeftArmSkin Clothing - ExternalLeftArmSkinToGround ExternalLeftArmSkinToGround ExternalLeftArmSkin ExternalGround - ExternalLeftLegSkinToClothing ExternalLeftLegSkinToClothing ExternalLeftLegSkin Clothing - ExternalLeftLegSkinToGround ExternalLeftLegSkinToGround ExternalLeftLegSkin ExternalGround - ExternalRightArmSkinToClothing ExternalRightArmSkinToClothing ExternalRightArmSkin Clothing - ExternalRightArmSkinToGround ExternalRightArmSkinToGround ExternalRightArmSkin ExternalGround - ExternalRightLegSkinToClothing ExternalRightLegSkinToClothing ExternalRightLegSkin Clothing - ExternalRightLegSkinToGround ExternalRightLegSkinToGround ExternalRightLegSkin ExternalGround - ExternalTorsoSkinToClothing ExternalTorsoSkinToClothing ExternalTorsoSkin Clothing - ExternalTorsoSkinToGround ExternalTorsoSkinToGround ExternalTorsoSkin ExternalGround - GroundToActive GroundToActive ExternalGround Active - GroundToClothing GroundToClothing ExternalGround Clothing - GroundToEnclosure GroundToEnclosure ExternalGround Enclosure - GroundToEnvironment GroundToEnvironment ExternalGround Ambient - GroundToInternalCore GroundToInternalCore InternalGround InternalCore - GroundToInternalHeadSkin GroundToInternalHeadSkin InternalGround InternalHeadSkin - GroundToInternalLeftArmSkin GroundToInternalLeftArmSkin InternalGround InternalLeftArmSkin - GroundToInternalLeftLegSkin GroundToInternalLeftLegSkin InternalGround InternalLeftLegSkin - GroundToInternalRightArmSkin GroundToInternalRightArmSkin InternalGround InternalRightArmSkin - GroundToInternalRightLegSkin GroundToInternalRightLegSkin InternalGround InternalRightLegSkin - GroundToInternalTorsoSkin GroundToInternalTorsoSkin InternalGround InternalTorsoSkin - InternalCoreToExternalCore InternalCoreToExternalCore InternalCore ExternalCore - InternalCoreToGround InternalCoreToGround InternalGround InternalCore - InternalCoreToInternalHeadSkin InternalCoreToInternalHeadSkin InternalCore InternalHeadSkin - InternalCoreToInternalLeftArmSkin InternalCoreToInternalLeftArmSkin InternalCore InternalLeftArmSkin - InternalCoreToInternalLeftLegSkin InternalCoreToInternalLeftLegSkin InternalCore InternalLeftLegSkin - InternalCoreToInternalRightArmSkin InternalCoreToInternalRightArmSkin InternalCore InternalRightArmSkin - InternalCoreToInternalRightLegSkin InternalCoreToInternalRightLegSkin InternalCore InternalRightLegSkin - InternalCoreToInternalTorsoSkin InternalCoreToInternalTorsoSkin InternalCore InternalTorsoSkin - InternalHeadSkinToExternalHeadSkin InternalHeadSkinToExternalHeadSkin InternalHeadSkin ExternalHeadSkin - InternalHeadSkinToGround InternalHeadSkinToTemperatureGround InternalGround InternalHeadSkin - InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkin ExternalLeftArmSkin - InternalLeftArmSkinToGround InternalLeftArmSkinToTemperatureGround InternalGround InternalLeftArmSkin - InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkin ExternalLeftLegSkin - InternalLeftLegSkinToGround InternalLeftLegSkinToTemperatureGround InternalGround InternalLeftLegSkin - InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkin ExternalRightArmSkin - InternalRightArmSkinToGround InternalRightArmSkinToTemperatureGround InternalGround InternalRightArmSkin - InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkin ExternalRightLegSkin - InternalRightLegSkinToGround InternalRightLegSkinToTemperatureGround InternalGround InternalRightLegSkin - InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkin ExternalTorsoSkin - InternalTorsoSkinToGround InternalTorsoSkinToTemperatureGround InternalGround InternalTorsoSkin - BoneTissue @@ -30569,7 +29817,6 @@ - Off @@ -30978,7 +30225,6 @@ - @@ -31005,15 +30251,15 @@ On - + - + - + - + @@ -32360,7 +31606,6 @@ - Extrasplanchnic @@ -32371,7 +31616,6 @@ - Extrasplanchnic @@ -32392,7 +31636,6 @@ - Splanchnic @@ -32403,7 +31646,6 @@ - Extrasplanchnic @@ -32421,7 +31663,6 @@ - Extrasplanchnic @@ -32432,7 +31673,6 @@ - Splanchnic @@ -32443,7 +31683,6 @@ - Muscle @@ -32454,7 +31693,6 @@ - Myocardium @@ -32465,7 +31703,6 @@ - Cerebral @@ -32476,7 +31713,6 @@ - Extrasplanchnic @@ -32494,7 +31730,6 @@ - Extrasplanchnic @@ -32505,7 +31740,6 @@ - Extrasplanchnic @@ -32516,7 +31750,6 @@ - Splanchnic @@ -32527,7 +31760,6 @@ - Splanchnic @@ -32538,7 +31770,6 @@ - Splanchnic @@ -32596,7 +31827,6 @@ - Extrasplanchnic @@ -32829,7 +32059,6 @@ - Cerebral @@ -32850,7 +32079,6 @@ - Cerebral @@ -32871,7 +32099,6 @@ - Cerebral @@ -32985,7 +32212,6 @@ - Extrasplanchnic @@ -33268,7 +32494,6 @@ - Splanchnic @@ -33347,7 +32572,6 @@ - Extrasplanchnic @@ -33631,7 +32855,6 @@ - Extrasplanchnic @@ -34004,7 +33227,6 @@ - Splanchnic @@ -34209,7 +33431,6 @@ - Muscle @@ -34326,7 +33547,6 @@ - Myocardium @@ -34443,7 +33663,6 @@ - Cerebral @@ -34474,7 +33693,6 @@ - Cerebral @@ -34518,7 +33736,6 @@ - Splanchnic @@ -34592,7 +33809,6 @@ - Extrasplanchnic @@ -34876,7 +34092,6 @@ - Extrasplanchnic @@ -35288,7 +34503,6 @@ - Extrasplanchnic @@ -35435,7 +34649,6 @@ - Splanchnic @@ -35496,7 +34709,6 @@ - Splanchnic @@ -35616,7 +34828,6 @@ - Splanchnic diff --git a/share/data/states/Male_44_Bradycardic@0s.xml b/share/data/states/Male_44_Bradycardic@0s.xml index 6fd7fa142..1c60e570b 100644 --- a/share/data/states/Male_44_Bradycardic@0s.xml +++ b/share/data/states/Male_44_Bradycardic@0s.xml @@ -1,5 +1,5 @@ - + Male_44_Bradycardic @@ -180,7 +180,7 @@ - + @@ -316,7 +316,7 @@ - + @@ -366,7 +366,7 @@ - + @@ -389,7 +389,7 @@ - + @@ -422,7 +422,7 @@ - + @@ -447,7 +447,7 @@ - + @@ -470,7 +470,7 @@ - + @@ -518,7 +518,7 @@ - + @@ -574,7 +574,7 @@ - + @@ -597,7 +597,7 @@ - + @@ -622,7 +622,7 @@ - + @@ -647,7 +647,7 @@ - + @@ -688,7 +688,7 @@ - + @@ -915,7 +915,6 @@ - false true false @@ -1014,6 +1013,7 @@ + @@ -1163,16 +1163,13 @@ - - - @@ -1219,15 +1216,15 @@ false - - + + - - + + @@ -1240,9 +1237,9 @@ 77.6122029 38.6101274921261 - - - + + + @@ -1304,8 +1301,8 @@ - - + + @@ -1320,6 +1317,9 @@ + + + @@ -1327,20 +1327,12 @@ Ambient Ambient - - - - Aorta Aorta1 Aorta2 Aorta3 - - - - Nitrogen @@ -1603,10 +1595,6 @@ Bladder Bladder - - - - Nitrogen @@ -1872,8 +1860,6 @@ BoneE3 BoneL1 BoneL2 - - Nitrogen @@ -2136,8 +2122,6 @@ BoneTissueIntracellular BoneI - - Nitrogen @@ -2401,10 +2385,6 @@ BoneVasculature Bone1 Bone2 - - - - Nitrogen @@ -2671,8 +2651,6 @@ BrainE3 BrainL1 BrainL2 - - Nitrogen @@ -2935,8 +2913,6 @@ BrainTissueIntracellular BrainI - - Nitrogen @@ -3201,276 +3177,269 @@ CerebralArteries CerebralCapillaries CerebralVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + CerebralArteries CerebralArteries1 CerebralArteries2 - - - - Nitrogen @@ -3733,10 +3702,6 @@ CerebralCapillaries CerebralCapillaries - - - - Nitrogen @@ -3999,8 +3964,6 @@ CerebralSpinalFluid SpinalFluid - - Nitrogen @@ -4264,10 +4227,6 @@ CerebralVeins1 CerebralVeins2 CerebralVeinsCheck - - - - Nitrogen @@ -4534,8 +4493,6 @@ FatE3 FatL1 FatL2 - - Nitrogen @@ -4798,8 +4755,6 @@ FatTissueIntracellular FatI - - Nitrogen @@ -5063,10 +5018,6 @@ FatVasculature Fat1 Fat2 - - - - Nitrogen @@ -5329,9 +5280,6 @@ Ground Ground - - - Nitrogen @@ -5452,8 +5400,6 @@ GutE3 GutL1 GutL2 - - Nitrogen @@ -5716,8 +5662,6 @@ GutTissueIntracellular GutI - - Nitrogen @@ -5982,266 +5926,263 @@ SplanchnicVasculature SmallIntestineVasculature LargeIntestineVasculature - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -6250,541 +6191,529 @@ LeftHeart RightHeart Pericardium - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + KidneyVasculature LeftKidneyVasculature RightKidneyVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LargeIntestineVasculature LargeIntestine1 - - - - Nitrogen @@ -7047,10 +6976,6 @@ LeftAfferentArteriole LeftAfferentArteriole - - - - Nitrogen @@ -7313,26 +7238,15 @@ LeftAlveoli LeftAlveoli - - - - LeftAlveoliLeak LeftAlveoliLeak - - - LeftArmVasculature LeftArm1 LeftArm2 - - - - Nitrogen @@ -7596,10 +7510,6 @@ LeftAtrium LeftAtrium1 LeftAtrium2 - - - - Nitrogen @@ -7863,10 +7773,6 @@ LeftBowmansCapsules LeftBowmansCapsules LeftNetBowmansCapsules - - - - Nitrogen @@ -8129,25 +8035,14 @@ LeftBronchi LeftBronchi - - - - LeftChestLeak LeftChestLeak - - - LeftEfferentArteriole LeftEfferentArteriole - - - - Nitrogen @@ -8411,10 +8306,6 @@ LeftGlomerularCapillaries LeftGlomerularCapillaries LeftNetGlomerularCapillaries - - - - Nitrogen @@ -8678,266 +8569,262 @@ LeftHeart LeftAtrium LeftVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -8947,8 +8834,6 @@ LeftKidneyE3 LeftKidneyL1 LeftKidneyL2 - - Nitrogen @@ -9211,8 +9096,6 @@ LeftKidneyTissueIntracellular LeftKidneyI - - Nitrogen @@ -9477,276 +9360,269 @@ LeftRenalArtery LeftNephron LeftRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftLegVasculature LeftLeg1 LeftLeg2 - - - - Nitrogen @@ -10010,10 +9886,6 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - - LeftLungTissueExtracellular @@ -10022,10 +9894,6 @@ LeftLungE3 LeftLungL1 LeftLungL2 - - - - Nitrogen @@ -10288,8 +10156,6 @@ LeftLungTissueIntracellular LeftLungI - - Nitrogen @@ -10554,266 +10420,263 @@ LeftPulmonaryArteries LeftPulmonaryCapillaries LeftPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -10824,276 +10687,269 @@ LeftPeritubularCapillaries LeftBowmansCapsules LeftTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftPeritubularCapillaries LeftPeritubularCapillaries LeftNetPeritubularCapillaries - - - - Nitrogen @@ -11357,19 +11213,11 @@ LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - LeftPulmonaryArteries LeftPulmonaryArteries LeftIntermediatePulmonaryArteries - - - - Nitrogen @@ -11632,10 +11480,6 @@ LeftPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen @@ -11898,10 +11742,6 @@ LeftPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen @@ -12164,10 +12004,6 @@ LeftRenalArtery LeftRenalArtery - - - - Nitrogen @@ -12430,10 +12266,6 @@ LeftRenalVein LeftRenalVein - - - - Nitrogen @@ -12697,10 +12529,6 @@ LeftTubules LeftTubules LeftNetTubules - - - - Nitrogen @@ -12963,10 +12791,6 @@ LeftUreter LeftUreter - - - - Nitrogen @@ -13229,10 +13053,6 @@ LeftVentricle LeftVentricle1 LeftVentricle2 - - - - Nitrogen @@ -13499,8 +13319,6 @@ LiverE3 LiverL1 LiverL2 - - Nitrogen @@ -13763,8 +13581,6 @@ LiverTissueIntracellular LiverI - - Nitrogen @@ -14030,9 +13846,6 @@ Liver2 PortalVein1 - - - Nitrogen @@ -14296,273 +14109,267 @@ LungsVasculature LeftLungVasculature RightLungVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + Lymph Lymph - - Nitrogen @@ -14824,16 +14631,10 @@ Mouth Mouth - - - - Mouthpiece Mouthpiece - - MuscleTissueExtracellular @@ -14842,8 +14643,6 @@ MuscleE3 MuscleL1 MuscleL2 - - Nitrogen @@ -15106,8 +14905,6 @@ MuscleTissueIntracellular MuscleI - - Nitrogen @@ -15371,10 +15168,6 @@ MuscleVasculature Muscle1 Muscle2 - - - - Nitrogen @@ -15641,8 +15434,6 @@ MyocardiumE3 MyocardiumL1 MyocardiumL2 - - Nitrogen @@ -15905,8 +15696,6 @@ MyocardiumTissueIntracellular MyocardiumI - - Nitrogen @@ -16170,10 +15959,6 @@ MyocardiumVasculature Myocardium1 Myocardium2 - - - - Nitrogen @@ -16436,10 +16221,6 @@ NeckArteries NeckArteries - - - - Nitrogen @@ -16702,10 +16483,6 @@ NeckVeins NeckVeins - - - - Nitrogen @@ -16968,8 +16745,6 @@ Pericardium Pericardium1 - - Nitrogen @@ -17233,825 +17008,801 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - PulmonaryArteries RightPulmonaryArteries LeftPulmonaryArteries - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryCapillaries RightPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - - PulmonaryVeins RightPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightAfferentArteriole RightAfferentArteriole - - - - Nitrogen @@ -18314,26 +18065,15 @@ RightAlveoli RightAlveoli - - - - RightAlveoliLeak RightAlveoliLeak - - - RightArmVasculature RightArm1 RightArm2 - - - - Nitrogen @@ -18597,10 +18337,6 @@ RightAtrium RightAtrium1 RightAtrium2 - - - - Nitrogen @@ -18864,10 +18600,6 @@ RightBowmansCapsules RightBowmansCapsules RightNetBowmansCapsules - - - - Nitrogen @@ -19130,25 +18862,14 @@ RightBronchi RightBronchi - - - - RightChestLeak RightChestLeak - - - RightEfferentArteriole RightEfferentArteriole - - - - Nitrogen @@ -19412,10 +19133,6 @@ RightGlomerularCapillaries RightGlomerularCapillaries RightNetGlomerularCapillaries - - - - Nitrogen @@ -19679,266 +19396,262 @@ RightHeart RightAtrium RightVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -19948,8 +19661,6 @@ RightKidneyE3 RightKidneyL1 RightKidneyL2 - - Nitrogen @@ -20212,8 +19923,6 @@ RightKidneyTissueIntracellular RightKidneyI - - Nitrogen @@ -20478,276 +20187,269 @@ RightRenalArtery RightNephron RightRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightLegVasculature RightLeg1 RightLeg2 - - - - Nitrogen @@ -21011,10 +20713,6 @@ RightLungPulmonary RightBronchi RightAlveoli - - - - RightLungTissueExtracellular @@ -21023,8 +20721,6 @@ RightLungE3 RightLungL1 RightLungL2 - - Nitrogen @@ -21287,8 +20983,6 @@ RightLungTissueIntracellular RightLungI - - Nitrogen @@ -21553,266 +21247,263 @@ RightPulmonaryArteries RightPulmonaryCapillaries RightPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -21823,276 +21514,269 @@ RightPeritubularCapillaries RightBowmansCapsules RightTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightPeritubularCapillaries RightPeritubularCapillaries RightNetPeritubularCapillaries - - - - Nitrogen @@ -22356,19 +22040,11 @@ RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - RightPulmonaryArteries RightPulmonaryArteries RightIntermediatePulmonaryArteries - - - - Nitrogen @@ -22631,10 +22307,6 @@ RightPulmonaryCapillaries RightPulmonaryCapillaries - - - - Nitrogen @@ -22897,10 +22569,6 @@ RightPulmonaryVeins RightPulmonaryVeins - - - - Nitrogen @@ -23163,10 +22831,6 @@ RightRenalArtery RightRenalArtery - - - - Nitrogen @@ -23429,10 +23093,6 @@ RightRenalVein RightRenalVein - - - - Nitrogen @@ -23696,10 +23356,6 @@ RightTubules RightTubules RightNetTubules - - - - Nitrogen @@ -23962,10 +23618,6 @@ RightUreter RightUreter - - - - Nitrogen @@ -24229,10 +23881,6 @@ RightVentricle1 RightVentricle2 MainPulmonaryArteries - - - - Nitrogen @@ -24499,8 +24147,6 @@ SkinE3 SkinL1 SkinL2 - - Nitrogen @@ -24763,8 +24409,6 @@ SkinTissueIntracellular SkinI - - Nitrogen @@ -25028,10 +24672,6 @@ SkinVasculature Skin1 Skin2 - - - - Nitrogen @@ -25294,8 +24934,6 @@ SmallIntestineChyme SmallIntestineC1 - - Nitrogen @@ -25557,10 +25195,6 @@ SmallIntestineVasculature SmallIntestine1 - - - - Nitrogen @@ -25823,10 +25457,6 @@ SplanchnicVasculature Splanchnic1 - - - - Nitrogen @@ -26093,8 +25723,6 @@ SpleenE3 SpleenL1 SpleenL2 - - Nitrogen @@ -26357,8 +25985,6 @@ SpleenTissueIntracellular SpleenI - - Nitrogen @@ -26621,10 +26247,6 @@ SpleenVasculature Spleen1 - - - - Nitrogen @@ -26887,290 +26509,276 @@ Stomach Stomach - - - - Trachea Trachea - - - - Ureters RightUreter LeftUreter - - - - Nitrogen - - + + - - + + Oxygen - - + + - - + + + CarbonDioxide - - + + - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + VenaCava VenaCava - - - - Nitrogen @@ -27435,189 +27043,162 @@ AortaBleed Aorta Ground - AortaToBone Aorta1ToBone1 Aorta BoneVasculature - AortaToFat Aorta1ToFat1 Aorta FatVasculature - AortaToLargeIntestine Aorta1ToLargeIntestine Aorta LargeIntestineVasculature - AortaToLeftArm Aorta1ToLeftArm1 Aorta LeftArmVasculature - AortaToLeftKidney LeftAortaConnectionToRenalArtery Aorta LeftRenalArtery - AortaToLeftLeg Aorta1ToLeftLeg1 Aorta LeftLegVasculature - AortaToLiver Aorta1ToLiver1 Aorta LiverVasculature - AortaToMuscle Aorta1ToMuscle1 Aorta MuscleVasculature - AortaToMyocardium Aorta1ToMyocardium1 Aorta MyocardiumVasculature - AortaToNeckArteries Aorta1ToNeckArteries Aorta NeckArteries - AortaToRightArm Aorta1ToRightArm1 Aorta RightArmVasculature - AortaToRightKidney RightAortaConnectionToRenalArtery Aorta RightRenalArtery - AortaToRightLeg Aorta1ToRightLeg1 Aorta RightLegVasculature - AortaToSkin Aorta1ToSkin1 Aorta SkinVasculature - AortaToSmallIntestine Aorta1ToSmallIntestine Aorta SmallIntestineVasculature - AortaToSplanchnic Aorta1ToSplanchnic Aorta SplanchnicVasculature - AortaToSpleen Aorta1ToSpleen Aorta SpleenVasculature - BladderToGround BladderToGroundUrinate Bladder Ground - BladderToGroundSource BladderToGroundPressure Bladder Ground - BoneToVenaCava Bone2ToVenaCava BoneVasculature VenaCava - BrainHemorrhage BrainBleed CerebralCapillaries Ground - CerebralArteriesToCerebralCapillaries CerebralArteries2ToCapillaries CerebralArteries CerebralCapillaries - CerebralCapillariesToCerebralVeins CerebralCapillariesToCerebralVeins1 CerebralCapillaries CerebralVeins - CerebralVeinsToNeckVeins CerebralVeins2ToNeckVeins CerebralVeins NeckVeins - EnvironmentToLeftChestLeak EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -27630,266 +27211,228 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - FatToVenaCava Fat2ToVenaCava FatVasculature VenaCava - HeartHemorrhage MyocardiumBleed MyocardiumVasculature Ground - LargeIntestineHemorrhage LargeIntestineBleed LargeIntestineVasculature Ground - LargeIntestineToLiver LargeIntestineToPortalVein LargeIntestineVasculature LiverVasculature - LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArteriole LeftGlomerularCapillaries - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftArmHemorrhage LeftArmBleed LeftArmVasculature Ground - LeftArmToVenaCava LeftArm2ToVenaCava LeftArmVasculature VenaCava - LeftAtriumToLeftVentricle LeftAtrium2ToLeftVentricle1 LeftAtrium LeftVentricle - LeftBowmansCapsulesToTubules LeftBowmansCapsulesToTubules LeftBowmansCapsules LeftTubules - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArteriole LeftPeritubularCapillaries - LeftGlomerularCapillariesToBowmansCapsules LeftNetGlomerularCapillariesToNetBowmansCapsules LeftGlomerularCapillaries LeftBowmansCapsules - LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillaries LeftEfferentArteriole - LeftKidneyHemorrhage LeftKidneyBleed LeftRenalVein Ground - LeftKidneyToVenaCava LeftRenalVeinToVenaCavaConnection LeftRenalVein VenaCava - LeftLegHemorrhage LeftLegBleed LeftLegVasculature Ground - LeftLegToVenaCava LeftLeg2ToVenaCava LeftLegVasculature VenaCava - LeftLungHemorrhage LeftLungBleed LeftPulmonaryArteries Ground - LeftLungVascularToTissue LeftLungVToLeftLungE1 LeftLungVasculature LeftLungTissueExtracellular - LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillaries LeftRenalVein - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - LeftPulmonaryArteriesToCapillaries LeftPulmonaryArteriesToLeftPulmonaryCapillaries LeftPulmonaryArteries LeftPulmonaryCapillaries - LeftPulmonaryArteriesToVeins LeftPulmonaryArteriesToLeftPulmonaryVeins LeftPulmonaryArteries LeftPulmonaryVeins - LeftPulmonaryCapillariesToVeins LeftPulmonaryCapillariesToLeftPulmonaryVeins LeftPulmonaryCapillaries LeftPulmonaryVeins - LeftPulmonaryVeinsToLeftAtrium LeftIntermediatePulmonaryVeinsToLeftAtrium1 LeftPulmonaryVeins LeftAtrium - LeftRenalArteryToAfferentArteriole LeftRenalArteryToAfferentArteriole LeftRenalArtery LeftAfferentArteriole - LeftTubulesToPeritubularCapillaries LeftNetTubulesToNetPeritubularCapillaries LeftTubules LeftPeritubularCapillaries - LeftTubulesToUreter LeftTubulesToUreter LeftTubules LeftUreter - LeftUreterToBladder LeftUreterToBladder LeftUreter Bladder - LeftVentricleToAorta LeftVentricle1ToAorta2 LeftVentricle Aorta - LiverHemorrhage LiverBleed LiverVasculature Ground - LiverToVenaCava Liver2ToVenaCava LiverVasculature VenaCava - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -27902,315 +27445,270 @@ Muscle2ToVenaCava MuscleVasculature VenaCava - MyocardiumToVenaCava Myocardium2ToVenaCava MyocardiumVasculature VenaCava - NeckArteriesToCerebralArteries NeckArteriesToCerebralArteries1 NeckArteries CerebralArteries - NeckVeinsToVenaCava NeckVeinsToVenaCava NeckVeins VenaCava - RightAfferentArterioleToGlomerularCapillaries RightAfferentArterioleToGlomerularCapillaries RightAfferentArteriole RightGlomerularCapillaries - RightAlveoliLeakToRightPleuralCavity RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightArmHemorrhage RightArmBleed RightArmVasculature Ground - RightArmToVenaCava RightArm2ToVenaCava RightArmVasculature VenaCava - RightAtriumToRightVentricle RightAtrium2ToRightVentricle1 RightAtrium RightVentricle - RightBowmansCapsulesToTubules RightBowmansCapsulesToTubules RightBowmansCapsules RightTubules - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightEfferentArterioleToPeritubularCapillaries RightEfferentArterioleToPeritubularCapillaries RightEfferentArteriole RightPeritubularCapillaries - RightGlomerularCapillariesToBowmansCapsules RightNetGlomerularCapillariesToNetBowmansCapsules RightGlomerularCapillaries RightBowmansCapsules - RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillaries RightEfferentArteriole - RightKidneyHemorrhage RightKidneyBleed RightRenalVein Ground - RightKidneyToVenaCava RightRenalVeinToVenaCavaConnection RightRenalVein VenaCava - RightLegHemorrhage RightLegBleed RightLegVasculature Ground - RightLegToVenaCava RightLeg2ToVenaCava RightLegVasculature VenaCava - RightLungHemorrhage RightLungBleed RightPulmonaryArteries Ground - RightPeritubularCapillariesToRenalVein RightPeritubularCapillariesToRenalVein RightPeritubularCapillaries RightRenalVein - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - RightPulmonaryArteriesToCapillaries RightPulmonaryArteriesToRightPulmonaryCapillaries RightPulmonaryArteries RightPulmonaryCapillaries - RightPulmonaryArteriesToVeins RightPulmonaryArteriesToRightPulmonaryVeins RightPulmonaryArteries RightPulmonaryVeins - RightPulmonaryCapillariesToVeins RightPulmonaryCapillariesToRightPulmonaryVeins RightPulmonaryCapillaries RightPulmonaryVeins - RightPulmonaryVeinsToLeftAtrium RightIntermediatePulmonaryVeinsToLeftAtrium1 RightPulmonaryVeins LeftAtrium - RightRenalArteryToAfferentArteriole RightRenalArteryToAfferentArteriole RightRenalArtery RightAfferentArteriole - RightTubulesToPeritubularCapillaries RightNetTubulesToNetPeritubularCapillaries RightTubules RightPeritubularCapillaries - RightTubulesToUreter RightTubulesToUreter RightTubules RightUreter - RightUreterToBladder RightUreterToBladder RightUreter Bladder - RightVentricleToLeftPulmonaryArteries MainPulmonaryArteriesToLeftIntermediatePulmonaryArteries RightVentricle LeftPulmonaryArteries - RightVentricleToRightPulmonaryArteries MainPulmonaryArteriesToRightIntermediatePulmonaryArteries RightVentricle RightPulmonaryArteries - SkinToVenaCava Skin2ToVenaCava SkinVasculature VenaCava - SmallIntestineHemorrhage SmallIntestineBleed SmallIntestineVasculature Ground - SmallIntestineToLiver SmallIntestineToPortalVein SmallIntestineVasculature LiverVasculature - SplanchnicHemorrhage SplanchnicBleed SplanchnicVasculature Ground - SplanchnicToLiver SplanchnicToPortalVein SplanchnicVasculature LiverVasculature - SpleenHemorrhage SpleenBleed SpleenVasculature Ground - SpleenToLiver SpleenToPortalVein SpleenVasculature LiverVasculature - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VenaCavaHemorrhage VenaCavaBleed VenaCava Ground - VenaCavaIV IVToVenaCava Ground VenaCava - VenaCavaToRightAtrium VenaCavaToRightAtrium1 VenaCava RightAtrium - Nitrogen Oxygen @@ -28636,10 +28134,6 @@ Ambient Ambient - - - - Nitrogen @@ -28662,10 +28156,6 @@ AnesthesiaConnection AnesthesiaConnection - - - - Nitrogen @@ -28688,7 +28178,6 @@ Connection MechanicalVentilatorConnection - Nitrogen @@ -28711,10 +28200,6 @@ ExpiratoryLimb ExpiratoryLimb - - - - Nitrogen @@ -28737,10 +28222,6 @@ GasInlet GasInlet - - - - Nitrogen @@ -28763,10 +28244,6 @@ GasSource GasSource - - - - Nitrogen @@ -28789,10 +28266,6 @@ InspiratoryLimb InspiratoryLimb - - - - Nitrogen @@ -28815,10 +28288,6 @@ LeftAlveoli LeftAlveoli - - - - Nitrogen @@ -28841,9 +28310,6 @@ LeftAlveoliLeak LeftAlveoliLeak - - - Nitrogen @@ -28857,10 +28323,6 @@ LeftBronchi LeftBronchi - - - - Nitrogen @@ -28883,9 +28345,6 @@ LeftChestLeak LeftChestLeak - - - Nitrogen @@ -28900,37 +28359,31 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - Nitrogen @@ -28953,10 +28406,6 @@ Mouth Mouth - - - - Nitrogen @@ -28979,8 +28428,6 @@ Mouthpiece Mouthpiece - - Nitrogen @@ -29003,7 +28450,6 @@ Nosepiece Nosepiece - Nitrogen @@ -29026,7 +28472,6 @@ OxygenTank OxygenTank - Nitrogen @@ -29050,62 +28495,53 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + ReliefValve ReliefValve - - - Nitrogen @@ -29128,10 +28564,6 @@ RightAlveoli RightAlveoli - - - - Nitrogen @@ -29154,9 +28586,6 @@ RightAlveoliLeak RightAlveoliLeak - - - Nitrogen @@ -29170,10 +28599,6 @@ RightBronchi RightBronchi - - - - Nitrogen @@ -29196,9 +28621,6 @@ RightChestLeak RightChestLeak - - - Nitrogen @@ -29213,37 +28635,30 @@ RightLungPulmonary RightBronchi RightAlveoli - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - Nitrogen @@ -29266,10 +28681,6 @@ Scrubber Scrubber - - - - Nitrogen @@ -29292,10 +28703,6 @@ Selector Selector - - - - Nitrogen @@ -29318,10 +28725,6 @@ Stomach Stomach - - - - Nitrogen @@ -29344,10 +28747,6 @@ Trachea Trachea - - - - Nitrogen @@ -29371,10 +28770,6 @@ Ventilator Ventilator VentilatorConnection - - - - Nitrogen @@ -29418,10 +28813,6 @@ YPiece YPiece - - - - Nitrogen @@ -29446,7 +28837,6 @@ AnesthesiaConnectionToEnvironment AnesthesiaConnection Ambient - ConnectionToMouth @@ -29459,14 +28849,12 @@ EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -29485,98 +28873,84 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - Exhaust SelectorToEnvironment Selector Ambient - ExpiratoryLimbToSelector ExpiratoryLimbToSelector ExpiratoryLimb Selector - GasInletToInspiratoryLimb GasInletToInspiratoryLimb GasInlet InspiratoryLimb - GasSourceToGasInlet GasSourceToGasInlet GasSource GasInlet - InspiratoryLimbToYPiece InspiratoryLimbToYPiece InspiratoryLimb YPiece - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - Mask AnesthesiaConnectionToMouth AnesthesiaConnection Mouth - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -29607,91 +28981,78 @@ RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - ScrubberToGasInlet ScrubberToGasInlet Scrubber GasInlet - SelectorToReliefValve SelectorToReliefValve Selector ReliefValve - SelectorToScrubber SelectorToScrubber Selector Scrubber - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VentilatorToSelector VentilatorConnectionToSelector Ventilator Selector - YPieceToAnesthesiaConnection YPieceToAnesthesiaConnection YPiece AnesthesiaConnection - YPieceToExpiratoryLimb YPieceToExpiratoryLimb YPiece ExpiratoryLimb - Nitrogen Oxygen @@ -29925,477 +29286,364 @@ Active Active - - - Ambient Ambient - - - Clothing Clothing - - - Enclosure Enclosure - - - ExternalCore ExternalCore - - - ExternalGround ExternalGround - - - ExternalHeadSkin ExternalHeadSkin - - - ExternalLeftArmSkin ExternalLeftArmSkin - - - ExternalLeftLegSkin ExternalLeftLegSkin - - - ExternalRightArmSkin ExternalRightArmSkin - - - ExternalRightLegSkin ExternalRightLegSkin - - - ExternalTorsoSkin ExternalTorsoSkin - - - InternalCore InternalCore InternalGround - - - - InternalGround - - InternalHeadSkin InternalHeadSkin - - - - InternalLeftArmSkin InternalLeftArmSkin - - - - InternalLeftLegSkin InternalLeftLegSkin - - - - InternalRightArmSkin InternalRightArmSkin - - - - InternalRightLegSkin InternalRightLegSkin - - - - InternalTorsoSkin InternalTorsoSkin - - - - ActiveToClothing ActiveToClothing Active Clothing - ClothingToEnclosure ClothingToEnclosure Clothing Enclosure - ClothingToEnvironment ClothingToEnvironment Clothing Ambient - ExternalCoreToGround ExternalCoreToGround ExternalCore ExternalGround - ExternalHeadSkinToClothing ExternalHeadSkinToClothing ExternalHeadSkin Clothing - ExternalHeadSkinToGround ExternalHeadSkinToGround ExternalHeadSkin ExternalGround - ExternalLeftArmSkinToClothing ExternalLeftArmSkinToClothing ExternalLeftArmSkin Clothing - ExternalLeftArmSkinToGround ExternalLeftArmSkinToGround ExternalLeftArmSkin ExternalGround - ExternalLeftLegSkinToClothing ExternalLeftLegSkinToClothing ExternalLeftLegSkin Clothing - ExternalLeftLegSkinToGround ExternalLeftLegSkinToGround ExternalLeftLegSkin ExternalGround - ExternalRightArmSkinToClothing ExternalRightArmSkinToClothing ExternalRightArmSkin Clothing - ExternalRightArmSkinToGround ExternalRightArmSkinToGround ExternalRightArmSkin ExternalGround - ExternalRightLegSkinToClothing ExternalRightLegSkinToClothing ExternalRightLegSkin Clothing - ExternalRightLegSkinToGround ExternalRightLegSkinToGround ExternalRightLegSkin ExternalGround - ExternalTorsoSkinToClothing ExternalTorsoSkinToClothing ExternalTorsoSkin Clothing - ExternalTorsoSkinToGround ExternalTorsoSkinToGround ExternalTorsoSkin ExternalGround - GroundToActive GroundToActive ExternalGround Active - GroundToClothing GroundToClothing ExternalGround Clothing - GroundToEnclosure GroundToEnclosure ExternalGround Enclosure - GroundToEnvironment GroundToEnvironment ExternalGround Ambient - GroundToInternalCore GroundToInternalCore InternalGround InternalCore - GroundToInternalHeadSkin GroundToInternalHeadSkin InternalGround InternalHeadSkin - GroundToInternalLeftArmSkin GroundToInternalLeftArmSkin InternalGround InternalLeftArmSkin - GroundToInternalLeftLegSkin GroundToInternalLeftLegSkin InternalGround InternalLeftLegSkin - GroundToInternalRightArmSkin GroundToInternalRightArmSkin InternalGround InternalRightArmSkin - GroundToInternalRightLegSkin GroundToInternalRightLegSkin InternalGround InternalRightLegSkin - GroundToInternalTorsoSkin GroundToInternalTorsoSkin InternalGround InternalTorsoSkin - InternalCoreToExternalCore InternalCoreToExternalCore InternalCore ExternalCore - InternalCoreToGround InternalCoreToGround InternalGround InternalCore - InternalCoreToInternalHeadSkin InternalCoreToInternalHeadSkin InternalCore InternalHeadSkin - InternalCoreToInternalLeftArmSkin InternalCoreToInternalLeftArmSkin InternalCore InternalLeftArmSkin - InternalCoreToInternalLeftLegSkin InternalCoreToInternalLeftLegSkin InternalCore InternalLeftLegSkin - InternalCoreToInternalRightArmSkin InternalCoreToInternalRightArmSkin InternalCore InternalRightArmSkin - InternalCoreToInternalRightLegSkin InternalCoreToInternalRightLegSkin InternalCore InternalRightLegSkin - InternalCoreToInternalTorsoSkin InternalCoreToInternalTorsoSkin InternalCore InternalTorsoSkin - InternalHeadSkinToExternalHeadSkin InternalHeadSkinToExternalHeadSkin InternalHeadSkin ExternalHeadSkin - InternalHeadSkinToGround InternalHeadSkinToTemperatureGround InternalGround InternalHeadSkin - InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkin ExternalLeftArmSkin - InternalLeftArmSkinToGround InternalLeftArmSkinToTemperatureGround InternalGround InternalLeftArmSkin - InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkin ExternalLeftLegSkin - InternalLeftLegSkinToGround InternalLeftLegSkinToTemperatureGround InternalGround InternalLeftLegSkin - InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkin ExternalRightArmSkin - InternalRightArmSkinToGround InternalRightArmSkinToTemperatureGround InternalGround InternalRightArmSkin - InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkin ExternalRightLegSkin - InternalRightLegSkinToGround InternalRightLegSkinToTemperatureGround InternalGround InternalRightLegSkin - InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkin ExternalTorsoSkin - InternalTorsoSkinToGround InternalTorsoSkinToTemperatureGround InternalGround InternalTorsoSkin - BoneTissue @@ -30569,7 +29817,6 @@ - Off @@ -30978,7 +30225,6 @@ - @@ -31005,15 +30251,15 @@ On - + - + - + - + @@ -32360,7 +31606,6 @@ - Extrasplanchnic @@ -32371,7 +31616,6 @@ - Extrasplanchnic @@ -32392,7 +31636,6 @@ - Splanchnic @@ -32403,7 +31646,6 @@ - Extrasplanchnic @@ -32421,7 +31663,6 @@ - Extrasplanchnic @@ -32432,7 +31673,6 @@ - Splanchnic @@ -32443,7 +31683,6 @@ - Muscle @@ -32454,7 +31693,6 @@ - Myocardium @@ -32465,7 +31703,6 @@ - Cerebral @@ -32476,7 +31713,6 @@ - Extrasplanchnic @@ -32494,7 +31730,6 @@ - Extrasplanchnic @@ -32505,7 +31740,6 @@ - Extrasplanchnic @@ -32516,7 +31750,6 @@ - Splanchnic @@ -32527,7 +31760,6 @@ - Splanchnic @@ -32538,7 +31770,6 @@ - Splanchnic @@ -32596,7 +31827,6 @@ - Extrasplanchnic @@ -32829,7 +32059,6 @@ - Cerebral @@ -32850,7 +32079,6 @@ - Cerebral @@ -32871,7 +32099,6 @@ - Cerebral @@ -32985,7 +32212,6 @@ - Extrasplanchnic @@ -33268,7 +32494,6 @@ - Splanchnic @@ -33347,7 +32572,6 @@ - Extrasplanchnic @@ -33631,7 +32855,6 @@ - Extrasplanchnic @@ -34004,7 +33227,6 @@ - Splanchnic @@ -34209,7 +33431,6 @@ - Muscle @@ -34326,7 +33547,6 @@ - Myocardium @@ -34443,7 +33663,6 @@ - Cerebral @@ -34474,7 +33693,6 @@ - Cerebral @@ -34518,7 +33736,6 @@ - Splanchnic @@ -34592,7 +33809,6 @@ - Extrasplanchnic @@ -34876,7 +34092,6 @@ - Extrasplanchnic @@ -35288,7 +34503,6 @@ - Extrasplanchnic @@ -35435,7 +34649,6 @@ - Splanchnic @@ -35496,7 +34709,6 @@ - Splanchnic @@ -35616,7 +34828,6 @@ - Splanchnic diff --git a/share/data/states/Male_44_Normal_hr109_rr15@0s.xml b/share/data/states/Male_44_Normal_hr109_rr15@0s.xml index ac14b7b79..302ecc8d4 100644 --- a/share/data/states/Male_44_Normal_hr109_rr15@0s.xml +++ b/share/data/states/Male_44_Normal_hr109_rr15@0s.xml @@ -1,5 +1,5 @@ - + Male_44_Normal_hr109_rr15 @@ -50,7 +50,7 @@ Gas - + @@ -180,7 +180,7 @@ - + @@ -316,7 +316,7 @@ - + @@ -366,7 +366,7 @@ - + @@ -389,7 +389,7 @@ - + @@ -422,7 +422,7 @@ - + @@ -447,7 +447,7 @@ - + @@ -470,7 +470,7 @@ - + @@ -518,7 +518,7 @@ - + @@ -574,7 +574,7 @@ - + @@ -597,7 +597,7 @@ - + @@ -622,7 +622,7 @@ - + @@ -647,7 +647,7 @@ - + @@ -688,7 +688,7 @@ - + @@ -915,7 +915,6 @@ - false true false @@ -1014,6 +1013,7 @@ + @@ -1163,16 +1163,13 @@ - - - @@ -1219,15 +1216,15 @@ false - + - - + + @@ -1240,9 +1237,9 @@ 77.6122029 38.5685692672312 - - - + + + @@ -1304,8 +1301,8 @@ - - + + @@ -1320,6 +1317,9 @@ 13 + + + @@ -1327,20 +1327,12 @@ Ambient Ambient - - - - Aorta Aorta1 Aorta2 Aorta3 - - - - Nitrogen @@ -1603,10 +1595,6 @@ Bladder Bladder - - - - Nitrogen @@ -1872,8 +1860,6 @@ BoneE3 BoneL1 BoneL2 - - Nitrogen @@ -2136,8 +2122,6 @@ BoneTissueIntracellular BoneI - - Nitrogen @@ -2401,10 +2385,6 @@ BoneVasculature Bone1 Bone2 - - - - Nitrogen @@ -2671,8 +2651,6 @@ BrainE3 BrainL1 BrainL2 - - Nitrogen @@ -2935,8 +2913,6 @@ BrainTissueIntracellular BrainI - - Nitrogen @@ -3201,276 +3177,269 @@ CerebralArteries CerebralCapillaries CerebralVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + CerebralArteries CerebralArteries1 CerebralArteries2 - - - - Nitrogen @@ -3733,10 +3702,6 @@ CerebralCapillaries CerebralCapillaries - - - - Nitrogen @@ -3999,8 +3964,6 @@ CerebralSpinalFluid SpinalFluid - - Nitrogen @@ -4264,10 +4227,6 @@ CerebralVeins1 CerebralVeins2 CerebralVeinsCheck - - - - Nitrogen @@ -4534,8 +4493,6 @@ FatE3 FatL1 FatL2 - - Nitrogen @@ -4798,8 +4755,6 @@ FatTissueIntracellular FatI - - Nitrogen @@ -5063,10 +5018,6 @@ FatVasculature Fat1 Fat2 - - - - Nitrogen @@ -5329,9 +5280,6 @@ Ground Ground - - - Nitrogen @@ -5452,8 +5400,6 @@ GutE3 GutL1 GutL2 - - Nitrogen @@ -5716,8 +5662,6 @@ GutTissueIntracellular GutI - - Nitrogen @@ -5982,266 +5926,263 @@ SplanchnicVasculature SmallIntestineVasculature LargeIntestineVasculature - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -6250,541 +6191,529 @@ LeftHeart RightHeart Pericardium - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + KidneyVasculature LeftKidneyVasculature RightKidneyVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LargeIntestineVasculature LargeIntestine1 - - - - Nitrogen @@ -7047,10 +6976,6 @@ LeftAfferentArteriole LeftAfferentArteriole - - - - Nitrogen @@ -7313,26 +7238,15 @@ LeftAlveoli LeftAlveoli - - - - LeftAlveoliLeak LeftAlveoliLeak - - - LeftArmVasculature LeftArm1 LeftArm2 - - - - Nitrogen @@ -7596,10 +7510,6 @@ LeftAtrium LeftAtrium1 LeftAtrium2 - - - - Nitrogen @@ -7863,10 +7773,6 @@ LeftBowmansCapsules LeftBowmansCapsules LeftNetBowmansCapsules - - - - Nitrogen @@ -8129,25 +8035,14 @@ LeftBronchi LeftBronchi - - - - LeftChestLeak LeftChestLeak - - - LeftEfferentArteriole LeftEfferentArteriole - - - - Nitrogen @@ -8411,10 +8306,6 @@ LeftGlomerularCapillaries LeftGlomerularCapillaries LeftNetGlomerularCapillaries - - - - Nitrogen @@ -8678,266 +8569,262 @@ LeftHeart LeftAtrium LeftVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -8947,8 +8834,6 @@ LeftKidneyE3 LeftKidneyL1 LeftKidneyL2 - - Nitrogen @@ -9211,8 +9096,6 @@ LeftKidneyTissueIntracellular LeftKidneyI - - Nitrogen @@ -9477,276 +9360,269 @@ LeftRenalArtery LeftNephron LeftRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftLegVasculature LeftLeg1 LeftLeg2 - - - - Nitrogen @@ -10010,10 +9886,6 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - - LeftLungTissueExtracellular @@ -10022,10 +9894,6 @@ LeftLungE3 LeftLungL1 LeftLungL2 - - - - Nitrogen @@ -10288,8 +10156,6 @@ LeftLungTissueIntracellular LeftLungI - - Nitrogen @@ -10554,266 +10420,263 @@ LeftPulmonaryArteries LeftPulmonaryCapillaries LeftPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -10824,276 +10687,269 @@ LeftPeritubularCapillaries LeftBowmansCapsules LeftTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftPeritubularCapillaries LeftPeritubularCapillaries LeftNetPeritubularCapillaries - - - - Nitrogen @@ -11357,19 +11213,11 @@ LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - LeftPulmonaryArteries LeftPulmonaryArteries LeftIntermediatePulmonaryArteries - - - - Nitrogen @@ -11632,10 +11480,6 @@ LeftPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen @@ -11898,10 +11742,6 @@ LeftPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen @@ -12164,10 +12004,6 @@ LeftRenalArtery LeftRenalArtery - - - - Nitrogen @@ -12430,10 +12266,6 @@ LeftRenalVein LeftRenalVein - - - - Nitrogen @@ -12697,10 +12529,6 @@ LeftTubules LeftTubules LeftNetTubules - - - - Nitrogen @@ -12963,10 +12791,6 @@ LeftUreter LeftUreter - - - - Nitrogen @@ -13229,10 +13053,6 @@ LeftVentricle LeftVentricle1 LeftVentricle2 - - - - Nitrogen @@ -13499,8 +13319,6 @@ LiverE3 LiverL1 LiverL2 - - Nitrogen @@ -13763,8 +13581,6 @@ LiverTissueIntracellular LiverI - - Nitrogen @@ -14030,9 +13846,6 @@ Liver2 PortalVein1 - - - Nitrogen @@ -14296,273 +14109,267 @@ LungsVasculature LeftLungVasculature RightLungVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + Lymph Lymph - - Nitrogen @@ -14824,16 +14631,10 @@ Mouth Mouth - - - - Mouthpiece Mouthpiece - - MuscleTissueExtracellular @@ -14842,8 +14643,6 @@ MuscleE3 MuscleL1 MuscleL2 - - Nitrogen @@ -15106,8 +14905,6 @@ MuscleTissueIntracellular MuscleI - - Nitrogen @@ -15371,10 +15168,6 @@ MuscleVasculature Muscle1 Muscle2 - - - - Nitrogen @@ -15641,8 +15434,6 @@ MyocardiumE3 MyocardiumL1 MyocardiumL2 - - Nitrogen @@ -15905,8 +15696,6 @@ MyocardiumTissueIntracellular MyocardiumI - - Nitrogen @@ -16170,10 +15959,6 @@ MyocardiumVasculature Myocardium1 Myocardium2 - - - - Nitrogen @@ -16436,10 +16221,6 @@ NeckArteries NeckArteries - - - - Nitrogen @@ -16702,10 +16483,6 @@ NeckVeins NeckVeins - - - - Nitrogen @@ -16968,8 +16745,6 @@ Pericardium Pericardium1 - - Nitrogen @@ -17233,825 +17008,801 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - PulmonaryArteries RightPulmonaryArteries LeftPulmonaryArteries - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryCapillaries RightPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - - PulmonaryVeins RightPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightAfferentArteriole RightAfferentArteriole - - - - Nitrogen @@ -18314,26 +18065,15 @@ RightAlveoli RightAlveoli - - - - RightAlveoliLeak RightAlveoliLeak - - - RightArmVasculature RightArm1 RightArm2 - - - - Nitrogen @@ -18597,10 +18337,6 @@ RightAtrium RightAtrium1 RightAtrium2 - - - - Nitrogen @@ -18864,10 +18600,6 @@ RightBowmansCapsules RightBowmansCapsules RightNetBowmansCapsules - - - - Nitrogen @@ -19130,25 +18862,14 @@ RightBronchi RightBronchi - - - - RightChestLeak RightChestLeak - - - RightEfferentArteriole RightEfferentArteriole - - - - Nitrogen @@ -19412,10 +19133,6 @@ RightGlomerularCapillaries RightGlomerularCapillaries RightNetGlomerularCapillaries - - - - Nitrogen @@ -19679,266 +19396,262 @@ RightHeart RightAtrium RightVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -19948,8 +19661,6 @@ RightKidneyE3 RightKidneyL1 RightKidneyL2 - - Nitrogen @@ -20212,8 +19923,6 @@ RightKidneyTissueIntracellular RightKidneyI - - Nitrogen @@ -20478,276 +20187,269 @@ RightRenalArtery RightNephron RightRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightLegVasculature RightLeg1 RightLeg2 - - - - Nitrogen @@ -21011,10 +20713,6 @@ RightLungPulmonary RightBronchi RightAlveoli - - - - RightLungTissueExtracellular @@ -21023,8 +20721,6 @@ RightLungE3 RightLungL1 RightLungL2 - - Nitrogen @@ -21287,8 +20983,6 @@ RightLungTissueIntracellular RightLungI - - Nitrogen @@ -21553,266 +21247,263 @@ RightPulmonaryArteries RightPulmonaryCapillaries RightPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -21823,276 +21514,269 @@ RightPeritubularCapillaries RightBowmansCapsules RightTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightPeritubularCapillaries RightPeritubularCapillaries RightNetPeritubularCapillaries - - - - Nitrogen @@ -22356,19 +22040,11 @@ RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - RightPulmonaryArteries RightPulmonaryArteries RightIntermediatePulmonaryArteries - - - - Nitrogen @@ -22631,10 +22307,6 @@ RightPulmonaryCapillaries RightPulmonaryCapillaries - - - - Nitrogen @@ -22897,10 +22569,6 @@ RightPulmonaryVeins RightPulmonaryVeins - - - - Nitrogen @@ -23163,10 +22831,6 @@ RightRenalArtery RightRenalArtery - - - - Nitrogen @@ -23429,10 +23093,6 @@ RightRenalVein RightRenalVein - - - - Nitrogen @@ -23696,10 +23356,6 @@ RightTubules RightTubules RightNetTubules - - - - Nitrogen @@ -23962,10 +23618,6 @@ RightUreter RightUreter - - - - Nitrogen @@ -24229,10 +23881,6 @@ RightVentricle1 RightVentricle2 MainPulmonaryArteries - - - - Nitrogen @@ -24499,8 +24147,6 @@ SkinE3 SkinL1 SkinL2 - - Nitrogen @@ -24763,8 +24409,6 @@ SkinTissueIntracellular SkinI - - Nitrogen @@ -25028,10 +24672,6 @@ SkinVasculature Skin1 Skin2 - - - - Nitrogen @@ -25294,8 +24934,6 @@ SmallIntestineChyme SmallIntestineC1 - - Nitrogen @@ -25557,10 +25195,6 @@ SmallIntestineVasculature SmallIntestine1 - - - - Nitrogen @@ -25823,10 +25457,6 @@ SplanchnicVasculature Splanchnic1 - - - - Nitrogen @@ -26093,8 +25723,6 @@ SpleenE3 SpleenL1 SpleenL2 - - Nitrogen @@ -26357,8 +25985,6 @@ SpleenTissueIntracellular SpleenI - - Nitrogen @@ -26621,10 +26247,6 @@ SpleenVasculature Spleen1 - - - - Nitrogen @@ -26887,290 +26509,276 @@ Stomach Stomach - - - - Trachea Trachea - - - - Ureters RightUreter LeftUreter - - - - Nitrogen - - + + - - + + Oxygen - - + + - - + + + CarbonDioxide - - + + - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + VenaCava VenaCava - - - - Nitrogen @@ -27435,189 +27043,162 @@ AortaBleed Aorta Ground - AortaToBone Aorta1ToBone1 Aorta BoneVasculature - AortaToFat Aorta1ToFat1 Aorta FatVasculature - AortaToLargeIntestine Aorta1ToLargeIntestine Aorta LargeIntestineVasculature - AortaToLeftArm Aorta1ToLeftArm1 Aorta LeftArmVasculature - AortaToLeftKidney LeftAortaConnectionToRenalArtery Aorta LeftRenalArtery - AortaToLeftLeg Aorta1ToLeftLeg1 Aorta LeftLegVasculature - AortaToLiver Aorta1ToLiver1 Aorta LiverVasculature - AortaToMuscle Aorta1ToMuscle1 Aorta MuscleVasculature - AortaToMyocardium Aorta1ToMyocardium1 Aorta MyocardiumVasculature - AortaToNeckArteries Aorta1ToNeckArteries Aorta NeckArteries - AortaToRightArm Aorta1ToRightArm1 Aorta RightArmVasculature - AortaToRightKidney RightAortaConnectionToRenalArtery Aorta RightRenalArtery - AortaToRightLeg Aorta1ToRightLeg1 Aorta RightLegVasculature - AortaToSkin Aorta1ToSkin1 Aorta SkinVasculature - AortaToSmallIntestine Aorta1ToSmallIntestine Aorta SmallIntestineVasculature - AortaToSplanchnic Aorta1ToSplanchnic Aorta SplanchnicVasculature - AortaToSpleen Aorta1ToSpleen Aorta SpleenVasculature - BladderToGround BladderToGroundUrinate Bladder Ground - BladderToGroundSource BladderToGroundPressure Bladder Ground - BoneToVenaCava Bone2ToVenaCava BoneVasculature VenaCava - BrainHemorrhage BrainBleed CerebralCapillaries Ground - CerebralArteriesToCerebralCapillaries CerebralArteries2ToCapillaries CerebralArteries CerebralCapillaries - CerebralCapillariesToCerebralVeins CerebralCapillariesToCerebralVeins1 CerebralCapillaries CerebralVeins - CerebralVeinsToNeckVeins CerebralVeins2ToNeckVeins CerebralVeins NeckVeins - EnvironmentToLeftChestLeak EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -27630,266 +27211,228 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - FatToVenaCava Fat2ToVenaCava FatVasculature VenaCava - HeartHemorrhage MyocardiumBleed MyocardiumVasculature Ground - LargeIntestineHemorrhage LargeIntestineBleed LargeIntestineVasculature Ground - LargeIntestineToLiver LargeIntestineToPortalVein LargeIntestineVasculature LiverVasculature - LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArteriole LeftGlomerularCapillaries - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftArmHemorrhage LeftArmBleed LeftArmVasculature Ground - LeftArmToVenaCava LeftArm2ToVenaCava LeftArmVasculature VenaCava - LeftAtriumToLeftVentricle LeftAtrium2ToLeftVentricle1 LeftAtrium LeftVentricle - LeftBowmansCapsulesToTubules LeftBowmansCapsulesToTubules LeftBowmansCapsules LeftTubules - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArteriole LeftPeritubularCapillaries - LeftGlomerularCapillariesToBowmansCapsules LeftNetGlomerularCapillariesToNetBowmansCapsules LeftGlomerularCapillaries LeftBowmansCapsules - LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillaries LeftEfferentArteriole - LeftKidneyHemorrhage LeftKidneyBleed LeftRenalVein Ground - LeftKidneyToVenaCava LeftRenalVeinToVenaCavaConnection LeftRenalVein VenaCava - LeftLegHemorrhage LeftLegBleed LeftLegVasculature Ground - LeftLegToVenaCava LeftLeg2ToVenaCava LeftLegVasculature VenaCava - LeftLungHemorrhage LeftLungBleed LeftPulmonaryArteries Ground - LeftLungVascularToTissue LeftLungVToLeftLungE1 LeftLungVasculature LeftLungTissueExtracellular - LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillaries LeftRenalVein - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - LeftPulmonaryArteriesToCapillaries LeftPulmonaryArteriesToLeftPulmonaryCapillaries LeftPulmonaryArteries LeftPulmonaryCapillaries - LeftPulmonaryArteriesToVeins LeftPulmonaryArteriesToLeftPulmonaryVeins LeftPulmonaryArteries LeftPulmonaryVeins - LeftPulmonaryCapillariesToVeins LeftPulmonaryCapillariesToLeftPulmonaryVeins LeftPulmonaryCapillaries LeftPulmonaryVeins - LeftPulmonaryVeinsToLeftAtrium LeftIntermediatePulmonaryVeinsToLeftAtrium1 LeftPulmonaryVeins LeftAtrium - LeftRenalArteryToAfferentArteriole LeftRenalArteryToAfferentArteriole LeftRenalArtery LeftAfferentArteriole - LeftTubulesToPeritubularCapillaries LeftNetTubulesToNetPeritubularCapillaries LeftTubules LeftPeritubularCapillaries - LeftTubulesToUreter LeftTubulesToUreter LeftTubules LeftUreter - LeftUreterToBladder LeftUreterToBladder LeftUreter Bladder - LeftVentricleToAorta LeftVentricle1ToAorta2 LeftVentricle Aorta - LiverHemorrhage LiverBleed LiverVasculature Ground - LiverToVenaCava Liver2ToVenaCava LiverVasculature VenaCava - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -27902,315 +27445,270 @@ Muscle2ToVenaCava MuscleVasculature VenaCava - MyocardiumToVenaCava Myocardium2ToVenaCava MyocardiumVasculature VenaCava - NeckArteriesToCerebralArteries NeckArteriesToCerebralArteries1 NeckArteries CerebralArteries - NeckVeinsToVenaCava NeckVeinsToVenaCava NeckVeins VenaCava - RightAfferentArterioleToGlomerularCapillaries RightAfferentArterioleToGlomerularCapillaries RightAfferentArteriole RightGlomerularCapillaries - RightAlveoliLeakToRightPleuralCavity RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightArmHemorrhage RightArmBleed RightArmVasculature Ground - RightArmToVenaCava RightArm2ToVenaCava RightArmVasculature VenaCava - RightAtriumToRightVentricle RightAtrium2ToRightVentricle1 RightAtrium RightVentricle - RightBowmansCapsulesToTubules RightBowmansCapsulesToTubules RightBowmansCapsules RightTubules - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightEfferentArterioleToPeritubularCapillaries RightEfferentArterioleToPeritubularCapillaries RightEfferentArteriole RightPeritubularCapillaries - RightGlomerularCapillariesToBowmansCapsules RightNetGlomerularCapillariesToNetBowmansCapsules RightGlomerularCapillaries RightBowmansCapsules - RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillaries RightEfferentArteriole - RightKidneyHemorrhage RightKidneyBleed RightRenalVein Ground - RightKidneyToVenaCava RightRenalVeinToVenaCavaConnection RightRenalVein VenaCava - RightLegHemorrhage RightLegBleed RightLegVasculature Ground - RightLegToVenaCava RightLeg2ToVenaCava RightLegVasculature VenaCava - RightLungHemorrhage RightLungBleed RightPulmonaryArteries Ground - RightPeritubularCapillariesToRenalVein RightPeritubularCapillariesToRenalVein RightPeritubularCapillaries RightRenalVein - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - RightPulmonaryArteriesToCapillaries RightPulmonaryArteriesToRightPulmonaryCapillaries RightPulmonaryArteries RightPulmonaryCapillaries - RightPulmonaryArteriesToVeins RightPulmonaryArteriesToRightPulmonaryVeins RightPulmonaryArteries RightPulmonaryVeins - RightPulmonaryCapillariesToVeins RightPulmonaryCapillariesToRightPulmonaryVeins RightPulmonaryCapillaries RightPulmonaryVeins - RightPulmonaryVeinsToLeftAtrium RightIntermediatePulmonaryVeinsToLeftAtrium1 RightPulmonaryVeins LeftAtrium - RightRenalArteryToAfferentArteriole RightRenalArteryToAfferentArteriole RightRenalArtery RightAfferentArteriole - RightTubulesToPeritubularCapillaries RightNetTubulesToNetPeritubularCapillaries RightTubules RightPeritubularCapillaries - RightTubulesToUreter RightTubulesToUreter RightTubules RightUreter - RightUreterToBladder RightUreterToBladder RightUreter Bladder - RightVentricleToLeftPulmonaryArteries MainPulmonaryArteriesToLeftIntermediatePulmonaryArteries RightVentricle LeftPulmonaryArteries - RightVentricleToRightPulmonaryArteries MainPulmonaryArteriesToRightIntermediatePulmonaryArteries RightVentricle RightPulmonaryArteries - SkinToVenaCava Skin2ToVenaCava SkinVasculature VenaCava - SmallIntestineHemorrhage SmallIntestineBleed SmallIntestineVasculature Ground - SmallIntestineToLiver SmallIntestineToPortalVein SmallIntestineVasculature LiverVasculature - SplanchnicHemorrhage SplanchnicBleed SplanchnicVasculature Ground - SplanchnicToLiver SplanchnicToPortalVein SplanchnicVasculature LiverVasculature - SpleenHemorrhage SpleenBleed SpleenVasculature Ground - SpleenToLiver SpleenToPortalVein SpleenVasculature LiverVasculature - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VenaCavaHemorrhage VenaCavaBleed VenaCava Ground - VenaCavaIV IVToVenaCava Ground VenaCava - VenaCavaToRightAtrium VenaCavaToRightAtrium1 VenaCava RightAtrium - Nitrogen Oxygen @@ -28636,10 +28134,6 @@ Ambient Ambient - - - - Nitrogen @@ -28662,10 +28156,6 @@ AnesthesiaConnection AnesthesiaConnection - - - - Nitrogen @@ -28688,7 +28178,6 @@ Connection MechanicalVentilatorConnection - Nitrogen @@ -28711,10 +28200,6 @@ ExpiratoryLimb ExpiratoryLimb - - - - Nitrogen @@ -28737,10 +28222,6 @@ GasInlet GasInlet - - - - Nitrogen @@ -28763,10 +28244,6 @@ GasSource GasSource - - - - Nitrogen @@ -28789,10 +28266,6 @@ InspiratoryLimb InspiratoryLimb - - - - Nitrogen @@ -28815,10 +28288,6 @@ LeftAlveoli LeftAlveoli - - - - Nitrogen @@ -28841,9 +28310,6 @@ LeftAlveoliLeak LeftAlveoliLeak - - - Nitrogen @@ -28857,10 +28323,6 @@ LeftBronchi LeftBronchi - - - - Nitrogen @@ -28883,9 +28345,6 @@ LeftChestLeak LeftChestLeak - - - Nitrogen @@ -28900,37 +28359,31 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - Nitrogen @@ -28953,10 +28406,6 @@ Mouth Mouth - - - - Nitrogen @@ -28979,8 +28428,6 @@ Mouthpiece Mouthpiece - - Nitrogen @@ -29003,7 +28450,6 @@ Nosepiece Nosepiece - Nitrogen @@ -29026,7 +28472,6 @@ OxygenTank OxygenTank - Nitrogen @@ -29050,62 +28495,53 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + ReliefValve ReliefValve - - - Nitrogen @@ -29128,10 +28564,6 @@ RightAlveoli RightAlveoli - - - - Nitrogen @@ -29154,9 +28586,6 @@ RightAlveoliLeak RightAlveoliLeak - - - Nitrogen @@ -29170,10 +28599,6 @@ RightBronchi RightBronchi - - - - Nitrogen @@ -29196,9 +28621,6 @@ RightChestLeak RightChestLeak - - - Nitrogen @@ -29213,37 +28635,30 @@ RightLungPulmonary RightBronchi RightAlveoli - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - Nitrogen @@ -29266,10 +28681,6 @@ Scrubber Scrubber - - - - Nitrogen @@ -29292,10 +28703,6 @@ Selector Selector - - - - Nitrogen @@ -29318,10 +28725,6 @@ Stomach Stomach - - - - Nitrogen @@ -29344,10 +28747,6 @@ Trachea Trachea - - - - Nitrogen @@ -29371,10 +28770,6 @@ Ventilator Ventilator VentilatorConnection - - - - Nitrogen @@ -29418,10 +28813,6 @@ YPiece YPiece - - - - Nitrogen @@ -29446,7 +28837,6 @@ AnesthesiaConnectionToEnvironment AnesthesiaConnection Ambient - ConnectionToMouth @@ -29459,14 +28849,12 @@ EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -29485,98 +28873,84 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - Exhaust SelectorToEnvironment Selector Ambient - ExpiratoryLimbToSelector ExpiratoryLimbToSelector ExpiratoryLimb Selector - GasInletToInspiratoryLimb GasInletToInspiratoryLimb GasInlet InspiratoryLimb - GasSourceToGasInlet GasSourceToGasInlet GasSource GasInlet - InspiratoryLimbToYPiece InspiratoryLimbToYPiece InspiratoryLimb YPiece - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - Mask AnesthesiaConnectionToMouth AnesthesiaConnection Mouth - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -29607,91 +28981,78 @@ RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - ScrubberToGasInlet ScrubberToGasInlet Scrubber GasInlet - SelectorToReliefValve SelectorToReliefValve Selector ReliefValve - SelectorToScrubber SelectorToScrubber Selector Scrubber - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VentilatorToSelector VentilatorConnectionToSelector Ventilator Selector - YPieceToAnesthesiaConnection YPieceToAnesthesiaConnection YPiece AnesthesiaConnection - YPieceToExpiratoryLimb YPieceToExpiratoryLimb YPiece ExpiratoryLimb - Nitrogen Oxygen @@ -29925,477 +29286,364 @@ Active Active - - - Ambient Ambient - - - Clothing Clothing - - - Enclosure Enclosure - - - ExternalCore ExternalCore - - - ExternalGround ExternalGround - - - ExternalHeadSkin ExternalHeadSkin - - - ExternalLeftArmSkin ExternalLeftArmSkin - - - ExternalLeftLegSkin ExternalLeftLegSkin - - - ExternalRightArmSkin ExternalRightArmSkin - - - ExternalRightLegSkin ExternalRightLegSkin - - - ExternalTorsoSkin ExternalTorsoSkin - - - InternalCore InternalCore InternalGround - - - - InternalGround - - InternalHeadSkin InternalHeadSkin - - - - InternalLeftArmSkin InternalLeftArmSkin - - - - InternalLeftLegSkin InternalLeftLegSkin - - - - InternalRightArmSkin InternalRightArmSkin - - - - InternalRightLegSkin InternalRightLegSkin - - - - InternalTorsoSkin InternalTorsoSkin - - - - ActiveToClothing ActiveToClothing Active Clothing - ClothingToEnclosure ClothingToEnclosure Clothing Enclosure - ClothingToEnvironment ClothingToEnvironment Clothing Ambient - ExternalCoreToGround ExternalCoreToGround ExternalCore ExternalGround - ExternalHeadSkinToClothing ExternalHeadSkinToClothing ExternalHeadSkin Clothing - ExternalHeadSkinToGround ExternalHeadSkinToGround ExternalHeadSkin ExternalGround - ExternalLeftArmSkinToClothing ExternalLeftArmSkinToClothing ExternalLeftArmSkin Clothing - ExternalLeftArmSkinToGround ExternalLeftArmSkinToGround ExternalLeftArmSkin ExternalGround - ExternalLeftLegSkinToClothing ExternalLeftLegSkinToClothing ExternalLeftLegSkin Clothing - ExternalLeftLegSkinToGround ExternalLeftLegSkinToGround ExternalLeftLegSkin ExternalGround - ExternalRightArmSkinToClothing ExternalRightArmSkinToClothing ExternalRightArmSkin Clothing - ExternalRightArmSkinToGround ExternalRightArmSkinToGround ExternalRightArmSkin ExternalGround - ExternalRightLegSkinToClothing ExternalRightLegSkinToClothing ExternalRightLegSkin Clothing - ExternalRightLegSkinToGround ExternalRightLegSkinToGround ExternalRightLegSkin ExternalGround - ExternalTorsoSkinToClothing ExternalTorsoSkinToClothing ExternalTorsoSkin Clothing - ExternalTorsoSkinToGround ExternalTorsoSkinToGround ExternalTorsoSkin ExternalGround - GroundToActive GroundToActive ExternalGround Active - GroundToClothing GroundToClothing ExternalGround Clothing - GroundToEnclosure GroundToEnclosure ExternalGround Enclosure - GroundToEnvironment GroundToEnvironment ExternalGround Ambient - GroundToInternalCore GroundToInternalCore InternalGround InternalCore - GroundToInternalHeadSkin GroundToInternalHeadSkin InternalGround InternalHeadSkin - GroundToInternalLeftArmSkin GroundToInternalLeftArmSkin InternalGround InternalLeftArmSkin - GroundToInternalLeftLegSkin GroundToInternalLeftLegSkin InternalGround InternalLeftLegSkin - GroundToInternalRightArmSkin GroundToInternalRightArmSkin InternalGround InternalRightArmSkin - GroundToInternalRightLegSkin GroundToInternalRightLegSkin InternalGround InternalRightLegSkin - GroundToInternalTorsoSkin GroundToInternalTorsoSkin InternalGround InternalTorsoSkin - InternalCoreToExternalCore InternalCoreToExternalCore InternalCore ExternalCore - InternalCoreToGround InternalCoreToGround InternalGround InternalCore - InternalCoreToInternalHeadSkin InternalCoreToInternalHeadSkin InternalCore InternalHeadSkin - InternalCoreToInternalLeftArmSkin InternalCoreToInternalLeftArmSkin InternalCore InternalLeftArmSkin - InternalCoreToInternalLeftLegSkin InternalCoreToInternalLeftLegSkin InternalCore InternalLeftLegSkin - InternalCoreToInternalRightArmSkin InternalCoreToInternalRightArmSkin InternalCore InternalRightArmSkin - InternalCoreToInternalRightLegSkin InternalCoreToInternalRightLegSkin InternalCore InternalRightLegSkin - InternalCoreToInternalTorsoSkin InternalCoreToInternalTorsoSkin InternalCore InternalTorsoSkin - InternalHeadSkinToExternalHeadSkin InternalHeadSkinToExternalHeadSkin InternalHeadSkin ExternalHeadSkin - InternalHeadSkinToGround InternalHeadSkinToTemperatureGround InternalGround InternalHeadSkin - InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkin ExternalLeftArmSkin - InternalLeftArmSkinToGround InternalLeftArmSkinToTemperatureGround InternalGround InternalLeftArmSkin - InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkin ExternalLeftLegSkin - InternalLeftLegSkinToGround InternalLeftLegSkinToTemperatureGround InternalGround InternalLeftLegSkin - InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkin ExternalRightArmSkin - InternalRightArmSkinToGround InternalRightArmSkinToTemperatureGround InternalGround InternalRightArmSkin - InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkin ExternalRightLegSkin - InternalRightLegSkinToGround InternalRightLegSkinToTemperatureGround InternalGround InternalRightLegSkin - InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkin ExternalTorsoSkin - InternalTorsoSkinToGround InternalTorsoSkinToTemperatureGround InternalGround InternalTorsoSkin - BoneTissue @@ -30569,7 +29817,6 @@ - Off @@ -30978,7 +30225,6 @@ - @@ -31005,15 +30251,15 @@ On - + - + - + - + @@ -32360,7 +31606,6 @@ - Extrasplanchnic @@ -32371,7 +31616,6 @@ - Extrasplanchnic @@ -32392,7 +31636,6 @@ - Splanchnic @@ -32403,7 +31646,6 @@ - Extrasplanchnic @@ -32421,7 +31663,6 @@ - Extrasplanchnic @@ -32432,7 +31673,6 @@ - Splanchnic @@ -32443,7 +31683,6 @@ - Muscle @@ -32454,7 +31693,6 @@ - Myocardium @@ -32465,7 +31703,6 @@ - Cerebral @@ -32476,7 +31713,6 @@ - Extrasplanchnic @@ -32494,7 +31730,6 @@ - Extrasplanchnic @@ -32505,7 +31740,6 @@ - Extrasplanchnic @@ -32516,7 +31750,6 @@ - Splanchnic @@ -32527,7 +31760,6 @@ - Splanchnic @@ -32538,7 +31770,6 @@ - Splanchnic @@ -32596,7 +31827,6 @@ - Extrasplanchnic @@ -32829,7 +32059,6 @@ - Cerebral @@ -32850,7 +32079,6 @@ - Cerebral @@ -32871,7 +32099,6 @@ - Cerebral @@ -32985,7 +32212,6 @@ - Extrasplanchnic @@ -33268,7 +32494,6 @@ - Splanchnic @@ -33347,7 +32572,6 @@ - Extrasplanchnic @@ -33631,7 +32855,6 @@ - Extrasplanchnic @@ -34004,7 +33227,6 @@ - Splanchnic @@ -34209,7 +33431,6 @@ - Muscle @@ -34326,7 +33547,6 @@ - Myocardium @@ -34443,7 +33663,6 @@ - Cerebral @@ -34474,7 +33693,6 @@ - Cerebral @@ -34518,7 +33736,6 @@ - Splanchnic @@ -34592,7 +33809,6 @@ - Extrasplanchnic @@ -34876,7 +34092,6 @@ - Extrasplanchnic @@ -35288,7 +34503,6 @@ - Extrasplanchnic @@ -35435,7 +34649,6 @@ - Splanchnic @@ -35496,7 +34709,6 @@ - Splanchnic @@ -35616,7 +34828,6 @@ - Splanchnic diff --git a/share/data/states/Male_44_Normal_rr12@0s.xml b/share/data/states/Male_44_Normal_rr12@0s.xml index 8273bb3a7..f0b210a33 100644 --- a/share/data/states/Male_44_Normal_rr12@0s.xml +++ b/share/data/states/Male_44_Normal_rr12@0s.xml @@ -1,5 +1,5 @@ - + Male_44_Normal_rr12 @@ -177,7 +177,7 @@ - + @@ -313,7 +313,7 @@ - + @@ -363,7 +363,7 @@ - + @@ -386,7 +386,7 @@ - + @@ -419,7 +419,7 @@ - + @@ -444,7 +444,7 @@ - + @@ -467,7 +467,7 @@ - + @@ -515,7 +515,7 @@ - + @@ -571,7 +571,7 @@ - + @@ -594,7 +594,7 @@ - + @@ -619,7 +619,7 @@ - + @@ -644,7 +644,7 @@ - + @@ -685,7 +685,7 @@ - + @@ -912,7 +912,6 @@ - true false false @@ -1011,6 +1010,7 @@ + @@ -1160,16 +1160,13 @@ - - - @@ -1216,15 +1213,15 @@ false - + - - + + @@ -1237,9 +1234,9 @@ 77.6122029 37.8644459711602 - - - + + + @@ -1301,8 +1298,8 @@ - - + + @@ -1317,6 +1314,9 @@ 1 + + + @@ -1324,20 +1324,12 @@ Ambient Ambient - - - - Aorta Aorta1 Aorta2 Aorta3 - - - - Nitrogen @@ -1600,10 +1592,6 @@ Bladder Bladder - - - - Nitrogen @@ -1869,8 +1857,6 @@ BoneE3 BoneL1 BoneL2 - - Nitrogen @@ -2133,8 +2119,6 @@ BoneTissueIntracellular BoneI - - Nitrogen @@ -2398,10 +2382,6 @@ BoneVasculature Bone1 Bone2 - - - - Nitrogen @@ -2668,8 +2648,6 @@ BrainE3 BrainL1 BrainL2 - - Nitrogen @@ -2932,8 +2910,6 @@ BrainTissueIntracellular BrainI - - Nitrogen @@ -3198,276 +3174,269 @@ CerebralArteries CerebralCapillaries CerebralVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + CerebralArteries CerebralArteries1 CerebralArteries2 - - - - Nitrogen @@ -3730,10 +3699,6 @@ CerebralCapillaries CerebralCapillaries - - - - Nitrogen @@ -3996,8 +3961,6 @@ CerebralSpinalFluid SpinalFluid - - Nitrogen @@ -4261,10 +4224,6 @@ CerebralVeins1 CerebralVeins2 CerebralVeinsCheck - - - - Nitrogen @@ -4531,8 +4490,6 @@ FatE3 FatL1 FatL2 - - Nitrogen @@ -4795,8 +4752,6 @@ FatTissueIntracellular FatI - - Nitrogen @@ -5060,10 +5015,6 @@ FatVasculature Fat1 Fat2 - - - - Nitrogen @@ -5326,9 +5277,6 @@ Ground Ground - - - Nitrogen @@ -5449,8 +5397,6 @@ GutE3 GutL1 GutL2 - - Nitrogen @@ -5713,8 +5659,6 @@ GutTissueIntracellular GutI - - Nitrogen @@ -5979,266 +5923,263 @@ SplanchnicVasculature SmallIntestineVasculature LargeIntestineVasculature - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -6247,541 +6188,529 @@ LeftHeart RightHeart Pericardium - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + KidneyVasculature LeftKidneyVasculature RightKidneyVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LargeIntestineVasculature LargeIntestine1 - - - - Nitrogen @@ -7044,10 +6973,6 @@ LeftAfferentArteriole LeftAfferentArteriole - - - - Nitrogen @@ -7310,26 +7235,15 @@ LeftAlveoli LeftAlveoli - - - - LeftAlveoliLeak LeftAlveoliLeak - - - LeftArmVasculature LeftArm1 LeftArm2 - - - - Nitrogen @@ -7593,10 +7507,6 @@ LeftAtrium LeftAtrium1 LeftAtrium2 - - - - Nitrogen @@ -7860,10 +7770,6 @@ LeftBowmansCapsules LeftBowmansCapsules LeftNetBowmansCapsules - - - - Nitrogen @@ -8126,25 +8032,14 @@ LeftBronchi LeftBronchi - - - - LeftChestLeak LeftChestLeak - - - LeftEfferentArteriole LeftEfferentArteriole - - - - Nitrogen @@ -8408,10 +8303,6 @@ LeftGlomerularCapillaries LeftGlomerularCapillaries LeftNetGlomerularCapillaries - - - - Nitrogen @@ -8675,266 +8566,262 @@ LeftHeart LeftAtrium LeftVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -8944,8 +8831,6 @@ LeftKidneyE3 LeftKidneyL1 LeftKidneyL2 - - Nitrogen @@ -9208,8 +9093,6 @@ LeftKidneyTissueIntracellular LeftKidneyI - - Nitrogen @@ -9474,276 +9357,269 @@ LeftRenalArtery LeftNephron LeftRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftLegVasculature LeftLeg1 LeftLeg2 - - - - Nitrogen @@ -10007,10 +9883,6 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - - LeftLungTissueExtracellular @@ -10019,10 +9891,6 @@ LeftLungE3 LeftLungL1 LeftLungL2 - - - - Nitrogen @@ -10285,8 +10153,6 @@ LeftLungTissueIntracellular LeftLungI - - Nitrogen @@ -10551,266 +10417,263 @@ LeftPulmonaryArteries LeftPulmonaryCapillaries LeftPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -10821,276 +10684,269 @@ LeftPeritubularCapillaries LeftBowmansCapsules LeftTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftPeritubularCapillaries LeftPeritubularCapillaries LeftNetPeritubularCapillaries - - - - Nitrogen @@ -11354,19 +11210,11 @@ LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - LeftPulmonaryArteries LeftPulmonaryArteries LeftIntermediatePulmonaryArteries - - - - Nitrogen @@ -11629,10 +11477,6 @@ LeftPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen @@ -11895,10 +11739,6 @@ LeftPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen @@ -12161,10 +12001,6 @@ LeftRenalArtery LeftRenalArtery - - - - Nitrogen @@ -12427,10 +12263,6 @@ LeftRenalVein LeftRenalVein - - - - Nitrogen @@ -12694,10 +12526,6 @@ LeftTubules LeftTubules LeftNetTubules - - - - Nitrogen @@ -12960,10 +12788,6 @@ LeftUreter LeftUreter - - - - Nitrogen @@ -13226,10 +13050,6 @@ LeftVentricle LeftVentricle1 LeftVentricle2 - - - - Nitrogen @@ -13496,8 +13316,6 @@ LiverE3 LiverL1 LiverL2 - - Nitrogen @@ -13760,8 +13578,6 @@ LiverTissueIntracellular LiverI - - Nitrogen @@ -14027,9 +13843,6 @@ Liver2 PortalVein1 - - - Nitrogen @@ -14293,273 +14106,267 @@ LungsVasculature LeftLungVasculature RightLungVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + Lymph Lymph - - Nitrogen @@ -14821,16 +14628,10 @@ Mouth Mouth - - - - Mouthpiece Mouthpiece - - MuscleTissueExtracellular @@ -14839,8 +14640,6 @@ MuscleE3 MuscleL1 MuscleL2 - - Nitrogen @@ -15103,8 +14902,6 @@ MuscleTissueIntracellular MuscleI - - Nitrogen @@ -15368,10 +15165,6 @@ MuscleVasculature Muscle1 Muscle2 - - - - Nitrogen @@ -15638,8 +15431,6 @@ MyocardiumE3 MyocardiumL1 MyocardiumL2 - - Nitrogen @@ -15902,8 +15693,6 @@ MyocardiumTissueIntracellular MyocardiumI - - Nitrogen @@ -16167,10 +15956,6 @@ MyocardiumVasculature Myocardium1 Myocardium2 - - - - Nitrogen @@ -16433,10 +16218,6 @@ NeckArteries NeckArteries - - - - Nitrogen @@ -16699,10 +16480,6 @@ NeckVeins NeckVeins - - - - Nitrogen @@ -16965,8 +16742,6 @@ Pericardium Pericardium1 - - Nitrogen @@ -17230,825 +17005,801 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - PulmonaryArteries RightPulmonaryArteries LeftPulmonaryArteries - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryCapillaries RightPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - - PulmonaryVeins RightPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightAfferentArteriole RightAfferentArteriole - - - - Nitrogen @@ -18311,26 +18062,15 @@ RightAlveoli RightAlveoli - - - - RightAlveoliLeak RightAlveoliLeak - - - RightArmVasculature RightArm1 RightArm2 - - - - Nitrogen @@ -18594,10 +18334,6 @@ RightAtrium RightAtrium1 RightAtrium2 - - - - Nitrogen @@ -18861,10 +18597,6 @@ RightBowmansCapsules RightBowmansCapsules RightNetBowmansCapsules - - - - Nitrogen @@ -19127,25 +18859,14 @@ RightBronchi RightBronchi - - - - RightChestLeak RightChestLeak - - - RightEfferentArteriole RightEfferentArteriole - - - - Nitrogen @@ -19409,10 +19130,6 @@ RightGlomerularCapillaries RightGlomerularCapillaries RightNetGlomerularCapillaries - - - - Nitrogen @@ -19676,266 +19393,262 @@ RightHeart RightAtrium RightVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -19945,8 +19658,6 @@ RightKidneyE3 RightKidneyL1 RightKidneyL2 - - Nitrogen @@ -20209,8 +19920,6 @@ RightKidneyTissueIntracellular RightKidneyI - - Nitrogen @@ -20475,276 +20184,269 @@ RightRenalArtery RightNephron RightRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightLegVasculature RightLeg1 RightLeg2 - - - - Nitrogen @@ -21008,10 +20710,6 @@ RightLungPulmonary RightBronchi RightAlveoli - - - - RightLungTissueExtracellular @@ -21020,8 +20718,6 @@ RightLungE3 RightLungL1 RightLungL2 - - Nitrogen @@ -21284,8 +20980,6 @@ RightLungTissueIntracellular RightLungI - - Nitrogen @@ -21550,266 +21244,263 @@ RightPulmonaryArteries RightPulmonaryCapillaries RightPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -21820,276 +21511,269 @@ RightPeritubularCapillaries RightBowmansCapsules RightTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightPeritubularCapillaries RightPeritubularCapillaries RightNetPeritubularCapillaries - - - - Nitrogen @@ -22353,19 +22037,11 @@ RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - RightPulmonaryArteries RightPulmonaryArteries RightIntermediatePulmonaryArteries - - - - Nitrogen @@ -22628,10 +22304,6 @@ RightPulmonaryCapillaries RightPulmonaryCapillaries - - - - Nitrogen @@ -22894,10 +22566,6 @@ RightPulmonaryVeins RightPulmonaryVeins - - - - Nitrogen @@ -23160,10 +22828,6 @@ RightRenalArtery RightRenalArtery - - - - Nitrogen @@ -23426,10 +23090,6 @@ RightRenalVein RightRenalVein - - - - Nitrogen @@ -23693,10 +23353,6 @@ RightTubules RightTubules RightNetTubules - - - - Nitrogen @@ -23959,10 +23615,6 @@ RightUreter RightUreter - - - - Nitrogen @@ -24226,10 +23878,6 @@ RightVentricle1 RightVentricle2 MainPulmonaryArteries - - - - Nitrogen @@ -24496,8 +24144,6 @@ SkinE3 SkinL1 SkinL2 - - Nitrogen @@ -24760,8 +24406,6 @@ SkinTissueIntracellular SkinI - - Nitrogen @@ -25025,10 +24669,6 @@ SkinVasculature Skin1 Skin2 - - - - Nitrogen @@ -25291,8 +24931,6 @@ SmallIntestineChyme SmallIntestineC1 - - Nitrogen @@ -25554,10 +25192,6 @@ SmallIntestineVasculature SmallIntestine1 - - - - Nitrogen @@ -25820,10 +25454,6 @@ SplanchnicVasculature Splanchnic1 - - - - Nitrogen @@ -26090,8 +25720,6 @@ SpleenE3 SpleenL1 SpleenL2 - - Nitrogen @@ -26354,8 +25982,6 @@ SpleenTissueIntracellular SpleenI - - Nitrogen @@ -26618,10 +26244,6 @@ SpleenVasculature Spleen1 - - - - Nitrogen @@ -26884,290 +26506,276 @@ Stomach Stomach - - - - Trachea Trachea - - - - Ureters RightUreter LeftUreter - - - - Nitrogen - - + + - - + + Oxygen - - + + - - + + + CarbonDioxide - - + + - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + VenaCava VenaCava - - - - Nitrogen @@ -27432,189 +27040,162 @@ AortaBleed Aorta Ground - AortaToBone Aorta1ToBone1 Aorta BoneVasculature - AortaToFat Aorta1ToFat1 Aorta FatVasculature - AortaToLargeIntestine Aorta1ToLargeIntestine Aorta LargeIntestineVasculature - AortaToLeftArm Aorta1ToLeftArm1 Aorta LeftArmVasculature - AortaToLeftKidney LeftAortaConnectionToRenalArtery Aorta LeftRenalArtery - AortaToLeftLeg Aorta1ToLeftLeg1 Aorta LeftLegVasculature - AortaToLiver Aorta1ToLiver1 Aorta LiverVasculature - AortaToMuscle Aorta1ToMuscle1 Aorta MuscleVasculature - AortaToMyocardium Aorta1ToMyocardium1 Aorta MyocardiumVasculature - AortaToNeckArteries Aorta1ToNeckArteries Aorta NeckArteries - AortaToRightArm Aorta1ToRightArm1 Aorta RightArmVasculature - AortaToRightKidney RightAortaConnectionToRenalArtery Aorta RightRenalArtery - AortaToRightLeg Aorta1ToRightLeg1 Aorta RightLegVasculature - AortaToSkin Aorta1ToSkin1 Aorta SkinVasculature - AortaToSmallIntestine Aorta1ToSmallIntestine Aorta SmallIntestineVasculature - AortaToSplanchnic Aorta1ToSplanchnic Aorta SplanchnicVasculature - AortaToSpleen Aorta1ToSpleen Aorta SpleenVasculature - BladderToGround BladderToGroundUrinate Bladder Ground - BladderToGroundSource BladderToGroundPressure Bladder Ground - BoneToVenaCava Bone2ToVenaCava BoneVasculature VenaCava - BrainHemorrhage BrainBleed CerebralCapillaries Ground - CerebralArteriesToCerebralCapillaries CerebralArteries2ToCapillaries CerebralArteries CerebralCapillaries - CerebralCapillariesToCerebralVeins CerebralCapillariesToCerebralVeins1 CerebralCapillaries CerebralVeins - CerebralVeinsToNeckVeins CerebralVeins2ToNeckVeins CerebralVeins NeckVeins - EnvironmentToLeftChestLeak EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -27627,266 +27208,228 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - FatToVenaCava Fat2ToVenaCava FatVasculature VenaCava - HeartHemorrhage MyocardiumBleed MyocardiumVasculature Ground - LargeIntestineHemorrhage LargeIntestineBleed LargeIntestineVasculature Ground - LargeIntestineToLiver LargeIntestineToPortalVein LargeIntestineVasculature LiverVasculature - LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArteriole LeftGlomerularCapillaries - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftArmHemorrhage LeftArmBleed LeftArmVasculature Ground - LeftArmToVenaCava LeftArm2ToVenaCava LeftArmVasculature VenaCava - LeftAtriumToLeftVentricle LeftAtrium2ToLeftVentricle1 LeftAtrium LeftVentricle - LeftBowmansCapsulesToTubules LeftBowmansCapsulesToTubules LeftBowmansCapsules LeftTubules - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArteriole LeftPeritubularCapillaries - LeftGlomerularCapillariesToBowmansCapsules LeftNetGlomerularCapillariesToNetBowmansCapsules LeftGlomerularCapillaries LeftBowmansCapsules - LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillaries LeftEfferentArteriole - LeftKidneyHemorrhage LeftKidneyBleed LeftRenalVein Ground - LeftKidneyToVenaCava LeftRenalVeinToVenaCavaConnection LeftRenalVein VenaCava - LeftLegHemorrhage LeftLegBleed LeftLegVasculature Ground - LeftLegToVenaCava LeftLeg2ToVenaCava LeftLegVasculature VenaCava - LeftLungHemorrhage LeftLungBleed LeftPulmonaryArteries Ground - LeftLungVascularToTissue LeftLungVToLeftLungE1 LeftLungVasculature LeftLungTissueExtracellular - LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillaries LeftRenalVein - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - LeftPulmonaryArteriesToCapillaries LeftPulmonaryArteriesToLeftPulmonaryCapillaries LeftPulmonaryArteries LeftPulmonaryCapillaries - LeftPulmonaryArteriesToVeins LeftPulmonaryArteriesToLeftPulmonaryVeins LeftPulmonaryArteries LeftPulmonaryVeins - LeftPulmonaryCapillariesToVeins LeftPulmonaryCapillariesToLeftPulmonaryVeins LeftPulmonaryCapillaries LeftPulmonaryVeins - LeftPulmonaryVeinsToLeftAtrium LeftIntermediatePulmonaryVeinsToLeftAtrium1 LeftPulmonaryVeins LeftAtrium - LeftRenalArteryToAfferentArteriole LeftRenalArteryToAfferentArteriole LeftRenalArtery LeftAfferentArteriole - LeftTubulesToPeritubularCapillaries LeftNetTubulesToNetPeritubularCapillaries LeftTubules LeftPeritubularCapillaries - LeftTubulesToUreter LeftTubulesToUreter LeftTubules LeftUreter - LeftUreterToBladder LeftUreterToBladder LeftUreter Bladder - LeftVentricleToAorta LeftVentricle1ToAorta2 LeftVentricle Aorta - LiverHemorrhage LiverBleed LiverVasculature Ground - LiverToVenaCava Liver2ToVenaCava LiverVasculature VenaCava - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -27899,315 +27442,270 @@ Muscle2ToVenaCava MuscleVasculature VenaCava - MyocardiumToVenaCava Myocardium2ToVenaCava MyocardiumVasculature VenaCava - NeckArteriesToCerebralArteries NeckArteriesToCerebralArteries1 NeckArteries CerebralArteries - NeckVeinsToVenaCava NeckVeinsToVenaCava NeckVeins VenaCava - RightAfferentArterioleToGlomerularCapillaries RightAfferentArterioleToGlomerularCapillaries RightAfferentArteriole RightGlomerularCapillaries - RightAlveoliLeakToRightPleuralCavity RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightArmHemorrhage RightArmBleed RightArmVasculature Ground - RightArmToVenaCava RightArm2ToVenaCava RightArmVasculature VenaCava - RightAtriumToRightVentricle RightAtrium2ToRightVentricle1 RightAtrium RightVentricle - RightBowmansCapsulesToTubules RightBowmansCapsulesToTubules RightBowmansCapsules RightTubules - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightEfferentArterioleToPeritubularCapillaries RightEfferentArterioleToPeritubularCapillaries RightEfferentArteriole RightPeritubularCapillaries - RightGlomerularCapillariesToBowmansCapsules RightNetGlomerularCapillariesToNetBowmansCapsules RightGlomerularCapillaries RightBowmansCapsules - RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillaries RightEfferentArteriole - RightKidneyHemorrhage RightKidneyBleed RightRenalVein Ground - RightKidneyToVenaCava RightRenalVeinToVenaCavaConnection RightRenalVein VenaCava - RightLegHemorrhage RightLegBleed RightLegVasculature Ground - RightLegToVenaCava RightLeg2ToVenaCava RightLegVasculature VenaCava - RightLungHemorrhage RightLungBleed RightPulmonaryArteries Ground - RightPeritubularCapillariesToRenalVein RightPeritubularCapillariesToRenalVein RightPeritubularCapillaries RightRenalVein - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - RightPulmonaryArteriesToCapillaries RightPulmonaryArteriesToRightPulmonaryCapillaries RightPulmonaryArteries RightPulmonaryCapillaries - RightPulmonaryArteriesToVeins RightPulmonaryArteriesToRightPulmonaryVeins RightPulmonaryArteries RightPulmonaryVeins - RightPulmonaryCapillariesToVeins RightPulmonaryCapillariesToRightPulmonaryVeins RightPulmonaryCapillaries RightPulmonaryVeins - RightPulmonaryVeinsToLeftAtrium RightIntermediatePulmonaryVeinsToLeftAtrium1 RightPulmonaryVeins LeftAtrium - RightRenalArteryToAfferentArteriole RightRenalArteryToAfferentArteriole RightRenalArtery RightAfferentArteriole - RightTubulesToPeritubularCapillaries RightNetTubulesToNetPeritubularCapillaries RightTubules RightPeritubularCapillaries - RightTubulesToUreter RightTubulesToUreter RightTubules RightUreter - RightUreterToBladder RightUreterToBladder RightUreter Bladder - RightVentricleToLeftPulmonaryArteries MainPulmonaryArteriesToLeftIntermediatePulmonaryArteries RightVentricle LeftPulmonaryArteries - RightVentricleToRightPulmonaryArteries MainPulmonaryArteriesToRightIntermediatePulmonaryArteries RightVentricle RightPulmonaryArteries - SkinToVenaCava Skin2ToVenaCava SkinVasculature VenaCava - SmallIntestineHemorrhage SmallIntestineBleed SmallIntestineVasculature Ground - SmallIntestineToLiver SmallIntestineToPortalVein SmallIntestineVasculature LiverVasculature - SplanchnicHemorrhage SplanchnicBleed SplanchnicVasculature Ground - SplanchnicToLiver SplanchnicToPortalVein SplanchnicVasculature LiverVasculature - SpleenHemorrhage SpleenBleed SpleenVasculature Ground - SpleenToLiver SpleenToPortalVein SpleenVasculature LiverVasculature - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VenaCavaHemorrhage VenaCavaBleed VenaCava Ground - VenaCavaIV IVToVenaCava Ground VenaCava - VenaCavaToRightAtrium VenaCavaToRightAtrium1 VenaCava RightAtrium - Nitrogen Oxygen @@ -28633,10 +28131,6 @@ Ambient Ambient - - - - Nitrogen @@ -28659,10 +28153,6 @@ AnesthesiaConnection AnesthesiaConnection - - - - Nitrogen @@ -28685,7 +28175,6 @@ Connection MechanicalVentilatorConnection - Nitrogen @@ -28708,10 +28197,6 @@ ExpiratoryLimb ExpiratoryLimb - - - - Nitrogen @@ -28734,10 +28219,6 @@ GasInlet GasInlet - - - - Nitrogen @@ -28760,10 +28241,6 @@ GasSource GasSource - - - - Nitrogen @@ -28786,10 +28263,6 @@ InspiratoryLimb InspiratoryLimb - - - - Nitrogen @@ -28812,10 +28285,6 @@ LeftAlveoli LeftAlveoli - - - - Nitrogen @@ -28838,9 +28307,6 @@ LeftAlveoliLeak LeftAlveoliLeak - - - Nitrogen @@ -28854,10 +28320,6 @@ LeftBronchi LeftBronchi - - - - Nitrogen @@ -28880,9 +28342,6 @@ LeftChestLeak LeftChestLeak - - - Nitrogen @@ -28897,37 +28356,31 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - Nitrogen @@ -28950,10 +28403,6 @@ Mouth Mouth - - - - Nitrogen @@ -28976,8 +28425,6 @@ Mouthpiece Mouthpiece - - Nitrogen @@ -29000,7 +28447,6 @@ Nosepiece Nosepiece - Nitrogen @@ -29023,7 +28469,6 @@ OxygenTank OxygenTank - Nitrogen @@ -29047,62 +28492,53 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + ReliefValve ReliefValve - - - Nitrogen @@ -29125,10 +28561,6 @@ RightAlveoli RightAlveoli - - - - Nitrogen @@ -29151,9 +28583,6 @@ RightAlveoliLeak RightAlveoliLeak - - - Nitrogen @@ -29167,10 +28596,6 @@ RightBronchi RightBronchi - - - - Nitrogen @@ -29193,9 +28618,6 @@ RightChestLeak RightChestLeak - - - Nitrogen @@ -29210,37 +28632,30 @@ RightLungPulmonary RightBronchi RightAlveoli - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - Nitrogen @@ -29263,10 +28678,6 @@ Scrubber Scrubber - - - - Nitrogen @@ -29289,10 +28700,6 @@ Selector Selector - - - - Nitrogen @@ -29315,10 +28722,6 @@ Stomach Stomach - - - - Nitrogen @@ -29341,10 +28744,6 @@ Trachea Trachea - - - - Nitrogen @@ -29368,10 +28767,6 @@ Ventilator Ventilator VentilatorConnection - - - - Nitrogen @@ -29415,10 +28810,6 @@ YPiece YPiece - - - - Nitrogen @@ -29443,7 +28834,6 @@ AnesthesiaConnectionToEnvironment AnesthesiaConnection Ambient - ConnectionToMouth @@ -29456,14 +28846,12 @@ EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -29482,98 +28870,84 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - Exhaust SelectorToEnvironment Selector Ambient - ExpiratoryLimbToSelector ExpiratoryLimbToSelector ExpiratoryLimb Selector - GasInletToInspiratoryLimb GasInletToInspiratoryLimb GasInlet InspiratoryLimb - GasSourceToGasInlet GasSourceToGasInlet GasSource GasInlet - InspiratoryLimbToYPiece InspiratoryLimbToYPiece InspiratoryLimb YPiece - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - Mask AnesthesiaConnectionToMouth AnesthesiaConnection Mouth - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -29604,91 +28978,78 @@ RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - ScrubberToGasInlet ScrubberToGasInlet Scrubber GasInlet - SelectorToReliefValve SelectorToReliefValve Selector ReliefValve - SelectorToScrubber SelectorToScrubber Selector Scrubber - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VentilatorToSelector VentilatorConnectionToSelector Ventilator Selector - YPieceToAnesthesiaConnection YPieceToAnesthesiaConnection YPiece AnesthesiaConnection - YPieceToExpiratoryLimb YPieceToExpiratoryLimb YPiece ExpiratoryLimb - Nitrogen Oxygen @@ -29922,477 +29283,364 @@ Active Active - - - Ambient Ambient - - - Clothing Clothing - - - Enclosure Enclosure - - - ExternalCore ExternalCore - - - ExternalGround ExternalGround - - - ExternalHeadSkin ExternalHeadSkin - - - ExternalLeftArmSkin ExternalLeftArmSkin - - - ExternalLeftLegSkin ExternalLeftLegSkin - - - ExternalRightArmSkin ExternalRightArmSkin - - - ExternalRightLegSkin ExternalRightLegSkin - - - ExternalTorsoSkin ExternalTorsoSkin - - - InternalCore InternalCore InternalGround - - - - InternalGround - - InternalHeadSkin InternalHeadSkin - - - - InternalLeftArmSkin InternalLeftArmSkin - - - - InternalLeftLegSkin InternalLeftLegSkin - - - - InternalRightArmSkin InternalRightArmSkin - - - - InternalRightLegSkin InternalRightLegSkin - - - - InternalTorsoSkin InternalTorsoSkin - - - - ActiveToClothing ActiveToClothing Active Clothing - ClothingToEnclosure ClothingToEnclosure Clothing Enclosure - ClothingToEnvironment ClothingToEnvironment Clothing Ambient - ExternalCoreToGround ExternalCoreToGround ExternalCore ExternalGround - ExternalHeadSkinToClothing ExternalHeadSkinToClothing ExternalHeadSkin Clothing - ExternalHeadSkinToGround ExternalHeadSkinToGround ExternalHeadSkin ExternalGround - ExternalLeftArmSkinToClothing ExternalLeftArmSkinToClothing ExternalLeftArmSkin Clothing - ExternalLeftArmSkinToGround ExternalLeftArmSkinToGround ExternalLeftArmSkin ExternalGround - ExternalLeftLegSkinToClothing ExternalLeftLegSkinToClothing ExternalLeftLegSkin Clothing - ExternalLeftLegSkinToGround ExternalLeftLegSkinToGround ExternalLeftLegSkin ExternalGround - ExternalRightArmSkinToClothing ExternalRightArmSkinToClothing ExternalRightArmSkin Clothing - ExternalRightArmSkinToGround ExternalRightArmSkinToGround ExternalRightArmSkin ExternalGround - ExternalRightLegSkinToClothing ExternalRightLegSkinToClothing ExternalRightLegSkin Clothing - ExternalRightLegSkinToGround ExternalRightLegSkinToGround ExternalRightLegSkin ExternalGround - ExternalTorsoSkinToClothing ExternalTorsoSkinToClothing ExternalTorsoSkin Clothing - ExternalTorsoSkinToGround ExternalTorsoSkinToGround ExternalTorsoSkin ExternalGround - GroundToActive GroundToActive ExternalGround Active - GroundToClothing GroundToClothing ExternalGround Clothing - GroundToEnclosure GroundToEnclosure ExternalGround Enclosure - GroundToEnvironment GroundToEnvironment ExternalGround Ambient - GroundToInternalCore GroundToInternalCore InternalGround InternalCore - GroundToInternalHeadSkin GroundToInternalHeadSkin InternalGround InternalHeadSkin - GroundToInternalLeftArmSkin GroundToInternalLeftArmSkin InternalGround InternalLeftArmSkin - GroundToInternalLeftLegSkin GroundToInternalLeftLegSkin InternalGround InternalLeftLegSkin - GroundToInternalRightArmSkin GroundToInternalRightArmSkin InternalGround InternalRightArmSkin - GroundToInternalRightLegSkin GroundToInternalRightLegSkin InternalGround InternalRightLegSkin - GroundToInternalTorsoSkin GroundToInternalTorsoSkin InternalGround InternalTorsoSkin - InternalCoreToExternalCore InternalCoreToExternalCore InternalCore ExternalCore - InternalCoreToGround InternalCoreToGround InternalGround InternalCore - InternalCoreToInternalHeadSkin InternalCoreToInternalHeadSkin InternalCore InternalHeadSkin - InternalCoreToInternalLeftArmSkin InternalCoreToInternalLeftArmSkin InternalCore InternalLeftArmSkin - InternalCoreToInternalLeftLegSkin InternalCoreToInternalLeftLegSkin InternalCore InternalLeftLegSkin - InternalCoreToInternalRightArmSkin InternalCoreToInternalRightArmSkin InternalCore InternalRightArmSkin - InternalCoreToInternalRightLegSkin InternalCoreToInternalRightLegSkin InternalCore InternalRightLegSkin - InternalCoreToInternalTorsoSkin InternalCoreToInternalTorsoSkin InternalCore InternalTorsoSkin - InternalHeadSkinToExternalHeadSkin InternalHeadSkinToExternalHeadSkin InternalHeadSkin ExternalHeadSkin - InternalHeadSkinToGround InternalHeadSkinToTemperatureGround InternalGround InternalHeadSkin - InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkin ExternalLeftArmSkin - InternalLeftArmSkinToGround InternalLeftArmSkinToTemperatureGround InternalGround InternalLeftArmSkin - InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkin ExternalLeftLegSkin - InternalLeftLegSkinToGround InternalLeftLegSkinToTemperatureGround InternalGround InternalLeftLegSkin - InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkin ExternalRightArmSkin - InternalRightArmSkinToGround InternalRightArmSkinToTemperatureGround InternalGround InternalRightArmSkin - InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkin ExternalRightLegSkin - InternalRightLegSkinToGround InternalRightLegSkinToTemperatureGround InternalGround InternalRightLegSkin - InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkin ExternalTorsoSkin - InternalTorsoSkinToGround InternalTorsoSkinToTemperatureGround InternalGround InternalTorsoSkin - BoneTissue @@ -30566,7 +29814,6 @@ - Off @@ -30975,7 +30222,6 @@ - @@ -31002,15 +30248,15 @@ On - + - + - + - + @@ -32357,7 +31603,6 @@ - Extrasplanchnic @@ -32368,7 +31613,6 @@ - Extrasplanchnic @@ -32389,7 +31633,6 @@ - Splanchnic @@ -32400,7 +31643,6 @@ - Extrasplanchnic @@ -32418,7 +31660,6 @@ - Extrasplanchnic @@ -32429,7 +31670,6 @@ - Splanchnic @@ -32440,7 +31680,6 @@ - Muscle @@ -32451,7 +31690,6 @@ - Myocardium @@ -32462,7 +31700,6 @@ - Cerebral @@ -32473,7 +31710,6 @@ - Extrasplanchnic @@ -32491,7 +31727,6 @@ - Extrasplanchnic @@ -32502,7 +31737,6 @@ - Extrasplanchnic @@ -32513,7 +31747,6 @@ - Splanchnic @@ -32524,7 +31757,6 @@ - Splanchnic @@ -32535,7 +31767,6 @@ - Splanchnic @@ -32593,7 +31824,6 @@ - Extrasplanchnic @@ -32826,7 +32056,6 @@ - Cerebral @@ -32847,7 +32076,6 @@ - Cerebral @@ -32868,7 +32096,6 @@ - Cerebral @@ -32982,7 +32209,6 @@ - Extrasplanchnic @@ -33265,7 +32491,6 @@ - Splanchnic @@ -33344,7 +32569,6 @@ - Extrasplanchnic @@ -33628,7 +32852,6 @@ - Extrasplanchnic @@ -34001,7 +33224,6 @@ - Splanchnic @@ -34206,7 +33428,6 @@ - Muscle @@ -34323,7 +33544,6 @@ - Myocardium @@ -34440,7 +33660,6 @@ - Cerebral @@ -34471,7 +33690,6 @@ - Cerebral @@ -34515,7 +33733,6 @@ - Splanchnic @@ -34589,7 +33806,6 @@ - Extrasplanchnic @@ -34873,7 +34089,6 @@ - Extrasplanchnic @@ -35285,7 +34500,6 @@ - Extrasplanchnic @@ -35432,7 +34646,6 @@ - Splanchnic @@ -35493,7 +34706,6 @@ - Splanchnic @@ -35613,7 +34825,6 @@ - Splanchnic diff --git a/share/data/states/Male_44_SleepDeprived@0s.xml b/share/data/states/Male_44_SleepDeprived@0s.xml index 467450992..3a675986c 100644 --- a/share/data/states/Male_44_SleepDeprived@0s.xml +++ b/share/data/states/Male_44_SleepDeprived@0s.xml @@ -1,5 +1,5 @@ - + Male_44_SleepDeprived @@ -177,7 +177,7 @@ - + @@ -313,7 +313,7 @@ - + @@ -363,7 +363,7 @@ - + @@ -386,7 +386,7 @@ - + @@ -419,7 +419,7 @@ - + @@ -444,7 +444,7 @@ - + @@ -467,7 +467,7 @@ - + @@ -515,7 +515,7 @@ - + @@ -571,7 +571,7 @@ - + @@ -594,7 +594,7 @@ - + @@ -619,7 +619,7 @@ - + @@ -644,7 +644,7 @@ - + @@ -675,7 +675,7 @@ - + @@ -685,7 +685,7 @@ - + @@ -912,7 +912,6 @@ - false true false @@ -1011,6 +1010,7 @@ + @@ -1160,16 +1160,13 @@ - - - @@ -1216,15 +1213,15 @@ false - + - - + + @@ -1237,9 +1234,9 @@ 77.6122029 37.8644459711602 - - - + + + @@ -1301,8 +1298,8 @@ - - + + @@ -1317,6 +1314,9 @@ 10 + + + @@ -1324,20 +1324,12 @@ Ambient Ambient - - - - Aorta Aorta1 Aorta2 Aorta3 - - - - Nitrogen @@ -1600,10 +1592,6 @@ Bladder Bladder - - - - Nitrogen @@ -1869,8 +1857,6 @@ BoneE3 BoneL1 BoneL2 - - Nitrogen @@ -2133,8 +2119,6 @@ BoneTissueIntracellular BoneI - - Nitrogen @@ -2398,10 +2382,6 @@ BoneVasculature Bone1 Bone2 - - - - Nitrogen @@ -2668,8 +2648,6 @@ BrainE3 BrainL1 BrainL2 - - Nitrogen @@ -2932,8 +2910,6 @@ BrainTissueIntracellular BrainI - - Nitrogen @@ -3198,276 +3174,269 @@ CerebralArteries CerebralCapillaries CerebralVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + CerebralArteries CerebralArteries1 CerebralArteries2 - - - - Nitrogen @@ -3730,10 +3699,6 @@ CerebralCapillaries CerebralCapillaries - - - - Nitrogen @@ -3996,8 +3961,6 @@ CerebralSpinalFluid SpinalFluid - - Nitrogen @@ -4261,10 +4224,6 @@ CerebralVeins1 CerebralVeins2 CerebralVeinsCheck - - - - Nitrogen @@ -4531,8 +4490,6 @@ FatE3 FatL1 FatL2 - - Nitrogen @@ -4795,8 +4752,6 @@ FatTissueIntracellular FatI - - Nitrogen @@ -5060,10 +5015,6 @@ FatVasculature Fat1 Fat2 - - - - Nitrogen @@ -5326,9 +5277,6 @@ Ground Ground - - - Nitrogen @@ -5449,8 +5397,6 @@ GutE3 GutL1 GutL2 - - Nitrogen @@ -5713,8 +5659,6 @@ GutTissueIntracellular GutI - - Nitrogen @@ -5979,266 +5923,263 @@ SplanchnicVasculature SmallIntestineVasculature LargeIntestineVasculature - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -6247,541 +6188,529 @@ LeftHeart RightHeart Pericardium - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + KidneyVasculature LeftKidneyVasculature RightKidneyVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LargeIntestineVasculature LargeIntestine1 - - - - Nitrogen @@ -7044,10 +6973,6 @@ LeftAfferentArteriole LeftAfferentArteriole - - - - Nitrogen @@ -7310,26 +7235,15 @@ LeftAlveoli LeftAlveoli - - - - LeftAlveoliLeak LeftAlveoliLeak - - - LeftArmVasculature LeftArm1 LeftArm2 - - - - Nitrogen @@ -7593,10 +7507,6 @@ LeftAtrium LeftAtrium1 LeftAtrium2 - - - - Nitrogen @@ -7860,10 +7770,6 @@ LeftBowmansCapsules LeftBowmansCapsules LeftNetBowmansCapsules - - - - Nitrogen @@ -8126,25 +8032,14 @@ LeftBronchi LeftBronchi - - - - LeftChestLeak LeftChestLeak - - - LeftEfferentArteriole LeftEfferentArteriole - - - - Nitrogen @@ -8408,10 +8303,6 @@ LeftGlomerularCapillaries LeftGlomerularCapillaries LeftNetGlomerularCapillaries - - - - Nitrogen @@ -8675,266 +8566,262 @@ LeftHeart LeftAtrium LeftVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -8944,8 +8831,6 @@ LeftKidneyE3 LeftKidneyL1 LeftKidneyL2 - - Nitrogen @@ -9208,8 +9093,6 @@ LeftKidneyTissueIntracellular LeftKidneyI - - Nitrogen @@ -9474,276 +9357,269 @@ LeftRenalArtery LeftNephron LeftRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftLegVasculature LeftLeg1 LeftLeg2 - - - - Nitrogen @@ -10007,10 +9883,6 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - - LeftLungTissueExtracellular @@ -10019,10 +9891,6 @@ LeftLungE3 LeftLungL1 LeftLungL2 - - - - Nitrogen @@ -10285,8 +10153,6 @@ LeftLungTissueIntracellular LeftLungI - - Nitrogen @@ -10551,266 +10417,263 @@ LeftPulmonaryArteries LeftPulmonaryCapillaries LeftPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -10821,276 +10684,269 @@ LeftPeritubularCapillaries LeftBowmansCapsules LeftTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftPeritubularCapillaries LeftPeritubularCapillaries LeftNetPeritubularCapillaries - - - - Nitrogen @@ -11354,19 +11210,11 @@ LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - LeftPulmonaryArteries LeftPulmonaryArteries LeftIntermediatePulmonaryArteries - - - - Nitrogen @@ -11629,10 +11477,6 @@ LeftPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen @@ -11895,10 +11739,6 @@ LeftPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen @@ -12161,10 +12001,6 @@ LeftRenalArtery LeftRenalArtery - - - - Nitrogen @@ -12427,10 +12263,6 @@ LeftRenalVein LeftRenalVein - - - - Nitrogen @@ -12694,10 +12526,6 @@ LeftTubules LeftTubules LeftNetTubules - - - - Nitrogen @@ -12960,10 +12788,6 @@ LeftUreter LeftUreter - - - - Nitrogen @@ -13226,10 +13050,6 @@ LeftVentricle LeftVentricle1 LeftVentricle2 - - - - Nitrogen @@ -13496,8 +13316,6 @@ LiverE3 LiverL1 LiverL2 - - Nitrogen @@ -13760,8 +13578,6 @@ LiverTissueIntracellular LiverI - - Nitrogen @@ -14027,9 +13843,6 @@ Liver2 PortalVein1 - - - Nitrogen @@ -14293,273 +14106,267 @@ LungsVasculature LeftLungVasculature RightLungVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + Lymph Lymph - - Nitrogen @@ -14821,16 +14628,10 @@ Mouth Mouth - - - - Mouthpiece Mouthpiece - - MuscleTissueExtracellular @@ -14839,8 +14640,6 @@ MuscleE3 MuscleL1 MuscleL2 - - Nitrogen @@ -15103,8 +14902,6 @@ MuscleTissueIntracellular MuscleI - - Nitrogen @@ -15368,10 +15165,6 @@ MuscleVasculature Muscle1 Muscle2 - - - - Nitrogen @@ -15638,8 +15431,6 @@ MyocardiumE3 MyocardiumL1 MyocardiumL2 - - Nitrogen @@ -15902,8 +15693,6 @@ MyocardiumTissueIntracellular MyocardiumI - - Nitrogen @@ -16167,10 +15956,6 @@ MyocardiumVasculature Myocardium1 Myocardium2 - - - - Nitrogen @@ -16433,10 +16218,6 @@ NeckArteries NeckArteries - - - - Nitrogen @@ -16699,10 +16480,6 @@ NeckVeins NeckVeins - - - - Nitrogen @@ -16965,8 +16742,6 @@ Pericardium Pericardium1 - - Nitrogen @@ -17230,825 +17005,801 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - PulmonaryArteries RightPulmonaryArteries LeftPulmonaryArteries - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryCapillaries RightPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - - PulmonaryVeins RightPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightAfferentArteriole RightAfferentArteriole - - - - Nitrogen @@ -18311,26 +18062,15 @@ RightAlveoli RightAlveoli - - - - RightAlveoliLeak RightAlveoliLeak - - - RightArmVasculature RightArm1 RightArm2 - - - - Nitrogen @@ -18594,10 +18334,6 @@ RightAtrium RightAtrium1 RightAtrium2 - - - - Nitrogen @@ -18861,10 +18597,6 @@ RightBowmansCapsules RightBowmansCapsules RightNetBowmansCapsules - - - - Nitrogen @@ -19127,25 +18859,14 @@ RightBronchi RightBronchi - - - - RightChestLeak RightChestLeak - - - RightEfferentArteriole RightEfferentArteriole - - - - Nitrogen @@ -19409,10 +19130,6 @@ RightGlomerularCapillaries RightGlomerularCapillaries RightNetGlomerularCapillaries - - - - Nitrogen @@ -19676,266 +19393,262 @@ RightHeart RightAtrium RightVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -19945,8 +19658,6 @@ RightKidneyE3 RightKidneyL1 RightKidneyL2 - - Nitrogen @@ -20209,8 +19920,6 @@ RightKidneyTissueIntracellular RightKidneyI - - Nitrogen @@ -20475,276 +20184,269 @@ RightRenalArtery RightNephron RightRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightLegVasculature RightLeg1 RightLeg2 - - - - Nitrogen @@ -21008,10 +20710,6 @@ RightLungPulmonary RightBronchi RightAlveoli - - - - RightLungTissueExtracellular @@ -21020,8 +20718,6 @@ RightLungE3 RightLungL1 RightLungL2 - - Nitrogen @@ -21284,8 +20980,6 @@ RightLungTissueIntracellular RightLungI - - Nitrogen @@ -21550,266 +21244,263 @@ RightPulmonaryArteries RightPulmonaryCapillaries RightPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -21820,276 +21511,269 @@ RightPeritubularCapillaries RightBowmansCapsules RightTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightPeritubularCapillaries RightPeritubularCapillaries RightNetPeritubularCapillaries - - - - Nitrogen @@ -22353,19 +22037,11 @@ RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - RightPulmonaryArteries RightPulmonaryArteries RightIntermediatePulmonaryArteries - - - - Nitrogen @@ -22628,10 +22304,6 @@ RightPulmonaryCapillaries RightPulmonaryCapillaries - - - - Nitrogen @@ -22894,10 +22566,6 @@ RightPulmonaryVeins RightPulmonaryVeins - - - - Nitrogen @@ -23160,10 +22828,6 @@ RightRenalArtery RightRenalArtery - - - - Nitrogen @@ -23426,10 +23090,6 @@ RightRenalVein RightRenalVein - - - - Nitrogen @@ -23693,10 +23353,6 @@ RightTubules RightTubules RightNetTubules - - - - Nitrogen @@ -23959,10 +23615,6 @@ RightUreter RightUreter - - - - Nitrogen @@ -24226,10 +23878,6 @@ RightVentricle1 RightVentricle2 MainPulmonaryArteries - - - - Nitrogen @@ -24496,8 +24144,6 @@ SkinE3 SkinL1 SkinL2 - - Nitrogen @@ -24760,8 +24406,6 @@ SkinTissueIntracellular SkinI - - Nitrogen @@ -25025,10 +24669,6 @@ SkinVasculature Skin1 Skin2 - - - - Nitrogen @@ -25291,8 +24931,6 @@ SmallIntestineChyme SmallIntestineC1 - - Nitrogen @@ -25554,10 +25192,6 @@ SmallIntestineVasculature SmallIntestine1 - - - - Nitrogen @@ -25820,10 +25454,6 @@ SplanchnicVasculature Splanchnic1 - - - - Nitrogen @@ -26090,8 +25720,6 @@ SpleenE3 SpleenL1 SpleenL2 - - Nitrogen @@ -26354,8 +25982,6 @@ SpleenTissueIntracellular SpleenI - - Nitrogen @@ -26618,10 +26244,6 @@ SpleenVasculature Spleen1 - - - - Nitrogen @@ -26884,290 +26506,276 @@ Stomach Stomach - - - - Trachea Trachea - - - - Ureters RightUreter LeftUreter - - - - Nitrogen - - + + - - + + Oxygen - - + + - - + + + CarbonDioxide - - + + - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + VenaCava VenaCava - - - - Nitrogen @@ -27432,189 +27040,162 @@ AortaBleed Aorta Ground - AortaToBone Aorta1ToBone1 Aorta BoneVasculature - AortaToFat Aorta1ToFat1 Aorta FatVasculature - AortaToLargeIntestine Aorta1ToLargeIntestine Aorta LargeIntestineVasculature - AortaToLeftArm Aorta1ToLeftArm1 Aorta LeftArmVasculature - AortaToLeftKidney LeftAortaConnectionToRenalArtery Aorta LeftRenalArtery - AortaToLeftLeg Aorta1ToLeftLeg1 Aorta LeftLegVasculature - AortaToLiver Aorta1ToLiver1 Aorta LiverVasculature - AortaToMuscle Aorta1ToMuscle1 Aorta MuscleVasculature - AortaToMyocardium Aorta1ToMyocardium1 Aorta MyocardiumVasculature - AortaToNeckArteries Aorta1ToNeckArteries Aorta NeckArteries - AortaToRightArm Aorta1ToRightArm1 Aorta RightArmVasculature - AortaToRightKidney RightAortaConnectionToRenalArtery Aorta RightRenalArtery - AortaToRightLeg Aorta1ToRightLeg1 Aorta RightLegVasculature - AortaToSkin Aorta1ToSkin1 Aorta SkinVasculature - AortaToSmallIntestine Aorta1ToSmallIntestine Aorta SmallIntestineVasculature - AortaToSplanchnic Aorta1ToSplanchnic Aorta SplanchnicVasculature - AortaToSpleen Aorta1ToSpleen Aorta SpleenVasculature - BladderToGround BladderToGroundUrinate Bladder Ground - BladderToGroundSource BladderToGroundPressure Bladder Ground - BoneToVenaCava Bone2ToVenaCava BoneVasculature VenaCava - BrainHemorrhage BrainBleed CerebralCapillaries Ground - CerebralArteriesToCerebralCapillaries CerebralArteries2ToCapillaries CerebralArteries CerebralCapillaries - CerebralCapillariesToCerebralVeins CerebralCapillariesToCerebralVeins1 CerebralCapillaries CerebralVeins - CerebralVeinsToNeckVeins CerebralVeins2ToNeckVeins CerebralVeins NeckVeins - EnvironmentToLeftChestLeak EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -27627,266 +27208,228 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - FatToVenaCava Fat2ToVenaCava FatVasculature VenaCava - HeartHemorrhage MyocardiumBleed MyocardiumVasculature Ground - LargeIntestineHemorrhage LargeIntestineBleed LargeIntestineVasculature Ground - LargeIntestineToLiver LargeIntestineToPortalVein LargeIntestineVasculature LiverVasculature - LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArteriole LeftGlomerularCapillaries - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftArmHemorrhage LeftArmBleed LeftArmVasculature Ground - LeftArmToVenaCava LeftArm2ToVenaCava LeftArmVasculature VenaCava - LeftAtriumToLeftVentricle LeftAtrium2ToLeftVentricle1 LeftAtrium LeftVentricle - LeftBowmansCapsulesToTubules LeftBowmansCapsulesToTubules LeftBowmansCapsules LeftTubules - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArteriole LeftPeritubularCapillaries - LeftGlomerularCapillariesToBowmansCapsules LeftNetGlomerularCapillariesToNetBowmansCapsules LeftGlomerularCapillaries LeftBowmansCapsules - LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillaries LeftEfferentArteriole - LeftKidneyHemorrhage LeftKidneyBleed LeftRenalVein Ground - LeftKidneyToVenaCava LeftRenalVeinToVenaCavaConnection LeftRenalVein VenaCava - LeftLegHemorrhage LeftLegBleed LeftLegVasculature Ground - LeftLegToVenaCava LeftLeg2ToVenaCava LeftLegVasculature VenaCava - LeftLungHemorrhage LeftLungBleed LeftPulmonaryArteries Ground - LeftLungVascularToTissue LeftLungVToLeftLungE1 LeftLungVasculature LeftLungTissueExtracellular - LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillaries LeftRenalVein - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - LeftPulmonaryArteriesToCapillaries LeftPulmonaryArteriesToLeftPulmonaryCapillaries LeftPulmonaryArteries LeftPulmonaryCapillaries - LeftPulmonaryArteriesToVeins LeftPulmonaryArteriesToLeftPulmonaryVeins LeftPulmonaryArteries LeftPulmonaryVeins - LeftPulmonaryCapillariesToVeins LeftPulmonaryCapillariesToLeftPulmonaryVeins LeftPulmonaryCapillaries LeftPulmonaryVeins - LeftPulmonaryVeinsToLeftAtrium LeftIntermediatePulmonaryVeinsToLeftAtrium1 LeftPulmonaryVeins LeftAtrium - LeftRenalArteryToAfferentArteriole LeftRenalArteryToAfferentArteriole LeftRenalArtery LeftAfferentArteriole - LeftTubulesToPeritubularCapillaries LeftNetTubulesToNetPeritubularCapillaries LeftTubules LeftPeritubularCapillaries - LeftTubulesToUreter LeftTubulesToUreter LeftTubules LeftUreter - LeftUreterToBladder LeftUreterToBladder LeftUreter Bladder - LeftVentricleToAorta LeftVentricle1ToAorta2 LeftVentricle Aorta - LiverHemorrhage LiverBleed LiverVasculature Ground - LiverToVenaCava Liver2ToVenaCava LiverVasculature VenaCava - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -27899,315 +27442,270 @@ Muscle2ToVenaCava MuscleVasculature VenaCava - MyocardiumToVenaCava Myocardium2ToVenaCava MyocardiumVasculature VenaCava - NeckArteriesToCerebralArteries NeckArteriesToCerebralArteries1 NeckArteries CerebralArteries - NeckVeinsToVenaCava NeckVeinsToVenaCava NeckVeins VenaCava - RightAfferentArterioleToGlomerularCapillaries RightAfferentArterioleToGlomerularCapillaries RightAfferentArteriole RightGlomerularCapillaries - RightAlveoliLeakToRightPleuralCavity RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightArmHemorrhage RightArmBleed RightArmVasculature Ground - RightArmToVenaCava RightArm2ToVenaCava RightArmVasculature VenaCava - RightAtriumToRightVentricle RightAtrium2ToRightVentricle1 RightAtrium RightVentricle - RightBowmansCapsulesToTubules RightBowmansCapsulesToTubules RightBowmansCapsules RightTubules - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightEfferentArterioleToPeritubularCapillaries RightEfferentArterioleToPeritubularCapillaries RightEfferentArteriole RightPeritubularCapillaries - RightGlomerularCapillariesToBowmansCapsules RightNetGlomerularCapillariesToNetBowmansCapsules RightGlomerularCapillaries RightBowmansCapsules - RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillaries RightEfferentArteriole - RightKidneyHemorrhage RightKidneyBleed RightRenalVein Ground - RightKidneyToVenaCava RightRenalVeinToVenaCavaConnection RightRenalVein VenaCava - RightLegHemorrhage RightLegBleed RightLegVasculature Ground - RightLegToVenaCava RightLeg2ToVenaCava RightLegVasculature VenaCava - RightLungHemorrhage RightLungBleed RightPulmonaryArteries Ground - RightPeritubularCapillariesToRenalVein RightPeritubularCapillariesToRenalVein RightPeritubularCapillaries RightRenalVein - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - RightPulmonaryArteriesToCapillaries RightPulmonaryArteriesToRightPulmonaryCapillaries RightPulmonaryArteries RightPulmonaryCapillaries - RightPulmonaryArteriesToVeins RightPulmonaryArteriesToRightPulmonaryVeins RightPulmonaryArteries RightPulmonaryVeins - RightPulmonaryCapillariesToVeins RightPulmonaryCapillariesToRightPulmonaryVeins RightPulmonaryCapillaries RightPulmonaryVeins - RightPulmonaryVeinsToLeftAtrium RightIntermediatePulmonaryVeinsToLeftAtrium1 RightPulmonaryVeins LeftAtrium - RightRenalArteryToAfferentArteriole RightRenalArteryToAfferentArteriole RightRenalArtery RightAfferentArteriole - RightTubulesToPeritubularCapillaries RightNetTubulesToNetPeritubularCapillaries RightTubules RightPeritubularCapillaries - RightTubulesToUreter RightTubulesToUreter RightTubules RightUreter - RightUreterToBladder RightUreterToBladder RightUreter Bladder - RightVentricleToLeftPulmonaryArteries MainPulmonaryArteriesToLeftIntermediatePulmonaryArteries RightVentricle LeftPulmonaryArteries - RightVentricleToRightPulmonaryArteries MainPulmonaryArteriesToRightIntermediatePulmonaryArteries RightVentricle RightPulmonaryArteries - SkinToVenaCava Skin2ToVenaCava SkinVasculature VenaCava - SmallIntestineHemorrhage SmallIntestineBleed SmallIntestineVasculature Ground - SmallIntestineToLiver SmallIntestineToPortalVein SmallIntestineVasculature LiverVasculature - SplanchnicHemorrhage SplanchnicBleed SplanchnicVasculature Ground - SplanchnicToLiver SplanchnicToPortalVein SplanchnicVasculature LiverVasculature - SpleenHemorrhage SpleenBleed SpleenVasculature Ground - SpleenToLiver SpleenToPortalVein SpleenVasculature LiverVasculature - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VenaCavaHemorrhage VenaCavaBleed VenaCava Ground - VenaCavaIV IVToVenaCava Ground VenaCava - VenaCavaToRightAtrium VenaCavaToRightAtrium1 VenaCava RightAtrium - Nitrogen Oxygen @@ -28633,10 +28131,6 @@ Ambient Ambient - - - - Nitrogen @@ -28659,10 +28153,6 @@ AnesthesiaConnection AnesthesiaConnection - - - - Nitrogen @@ -28685,7 +28175,6 @@ Connection MechanicalVentilatorConnection - Nitrogen @@ -28708,10 +28197,6 @@ ExpiratoryLimb ExpiratoryLimb - - - - Nitrogen @@ -28734,10 +28219,6 @@ GasInlet GasInlet - - - - Nitrogen @@ -28760,10 +28241,6 @@ GasSource GasSource - - - - Nitrogen @@ -28786,10 +28263,6 @@ InspiratoryLimb InspiratoryLimb - - - - Nitrogen @@ -28812,10 +28285,6 @@ LeftAlveoli LeftAlveoli - - - - Nitrogen @@ -28838,9 +28307,6 @@ LeftAlveoliLeak LeftAlveoliLeak - - - Nitrogen @@ -28854,10 +28320,6 @@ LeftBronchi LeftBronchi - - - - Nitrogen @@ -28880,9 +28342,6 @@ LeftChestLeak LeftChestLeak - - - Nitrogen @@ -28897,37 +28356,31 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - Nitrogen @@ -28950,10 +28403,6 @@ Mouth Mouth - - - - Nitrogen @@ -28976,8 +28425,6 @@ Mouthpiece Mouthpiece - - Nitrogen @@ -29000,7 +28447,6 @@ Nosepiece Nosepiece - Nitrogen @@ -29023,7 +28469,6 @@ OxygenTank OxygenTank - Nitrogen @@ -29047,62 +28492,53 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + ReliefValve ReliefValve - - - Nitrogen @@ -29125,10 +28561,6 @@ RightAlveoli RightAlveoli - - - - Nitrogen @@ -29151,9 +28583,6 @@ RightAlveoliLeak RightAlveoliLeak - - - Nitrogen @@ -29167,10 +28596,6 @@ RightBronchi RightBronchi - - - - Nitrogen @@ -29193,9 +28618,6 @@ RightChestLeak RightChestLeak - - - Nitrogen @@ -29210,37 +28632,30 @@ RightLungPulmonary RightBronchi RightAlveoli - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - Nitrogen @@ -29263,10 +28678,6 @@ Scrubber Scrubber - - - - Nitrogen @@ -29289,10 +28700,6 @@ Selector Selector - - - - Nitrogen @@ -29315,10 +28722,6 @@ Stomach Stomach - - - - Nitrogen @@ -29341,10 +28744,6 @@ Trachea Trachea - - - - Nitrogen @@ -29368,10 +28767,6 @@ Ventilator Ventilator VentilatorConnection - - - - Nitrogen @@ -29415,10 +28810,6 @@ YPiece YPiece - - - - Nitrogen @@ -29443,7 +28834,6 @@ AnesthesiaConnectionToEnvironment AnesthesiaConnection Ambient - ConnectionToMouth @@ -29456,14 +28846,12 @@ EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -29482,98 +28870,84 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - Exhaust SelectorToEnvironment Selector Ambient - ExpiratoryLimbToSelector ExpiratoryLimbToSelector ExpiratoryLimb Selector - GasInletToInspiratoryLimb GasInletToInspiratoryLimb GasInlet InspiratoryLimb - GasSourceToGasInlet GasSourceToGasInlet GasSource GasInlet - InspiratoryLimbToYPiece InspiratoryLimbToYPiece InspiratoryLimb YPiece - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - Mask AnesthesiaConnectionToMouth AnesthesiaConnection Mouth - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -29604,91 +28978,78 @@ RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - ScrubberToGasInlet ScrubberToGasInlet Scrubber GasInlet - SelectorToReliefValve SelectorToReliefValve Selector ReliefValve - SelectorToScrubber SelectorToScrubber Selector Scrubber - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VentilatorToSelector VentilatorConnectionToSelector Ventilator Selector - YPieceToAnesthesiaConnection YPieceToAnesthesiaConnection YPiece AnesthesiaConnection - YPieceToExpiratoryLimb YPieceToExpiratoryLimb YPiece ExpiratoryLimb - Nitrogen Oxygen @@ -29922,477 +29283,364 @@ Active Active - - - Ambient Ambient - - - Clothing Clothing - - - Enclosure Enclosure - - - ExternalCore ExternalCore - - - ExternalGround ExternalGround - - - ExternalHeadSkin ExternalHeadSkin - - - ExternalLeftArmSkin ExternalLeftArmSkin - - - ExternalLeftLegSkin ExternalLeftLegSkin - - - ExternalRightArmSkin ExternalRightArmSkin - - - ExternalRightLegSkin ExternalRightLegSkin - - - ExternalTorsoSkin ExternalTorsoSkin - - - InternalCore InternalCore InternalGround - - - - InternalGround - - InternalHeadSkin InternalHeadSkin - - - - InternalLeftArmSkin InternalLeftArmSkin - - - - InternalLeftLegSkin InternalLeftLegSkin - - - - InternalRightArmSkin InternalRightArmSkin - - - - InternalRightLegSkin InternalRightLegSkin - - - - InternalTorsoSkin InternalTorsoSkin - - - - ActiveToClothing ActiveToClothing Active Clothing - ClothingToEnclosure ClothingToEnclosure Clothing Enclosure - ClothingToEnvironment ClothingToEnvironment Clothing Ambient - ExternalCoreToGround ExternalCoreToGround ExternalCore ExternalGround - ExternalHeadSkinToClothing ExternalHeadSkinToClothing ExternalHeadSkin Clothing - ExternalHeadSkinToGround ExternalHeadSkinToGround ExternalHeadSkin ExternalGround - ExternalLeftArmSkinToClothing ExternalLeftArmSkinToClothing ExternalLeftArmSkin Clothing - ExternalLeftArmSkinToGround ExternalLeftArmSkinToGround ExternalLeftArmSkin ExternalGround - ExternalLeftLegSkinToClothing ExternalLeftLegSkinToClothing ExternalLeftLegSkin Clothing - ExternalLeftLegSkinToGround ExternalLeftLegSkinToGround ExternalLeftLegSkin ExternalGround - ExternalRightArmSkinToClothing ExternalRightArmSkinToClothing ExternalRightArmSkin Clothing - ExternalRightArmSkinToGround ExternalRightArmSkinToGround ExternalRightArmSkin ExternalGround - ExternalRightLegSkinToClothing ExternalRightLegSkinToClothing ExternalRightLegSkin Clothing - ExternalRightLegSkinToGround ExternalRightLegSkinToGround ExternalRightLegSkin ExternalGround - ExternalTorsoSkinToClothing ExternalTorsoSkinToClothing ExternalTorsoSkin Clothing - ExternalTorsoSkinToGround ExternalTorsoSkinToGround ExternalTorsoSkin ExternalGround - GroundToActive GroundToActive ExternalGround Active - GroundToClothing GroundToClothing ExternalGround Clothing - GroundToEnclosure GroundToEnclosure ExternalGround Enclosure - GroundToEnvironment GroundToEnvironment ExternalGround Ambient - GroundToInternalCore GroundToInternalCore InternalGround InternalCore - GroundToInternalHeadSkin GroundToInternalHeadSkin InternalGround InternalHeadSkin - GroundToInternalLeftArmSkin GroundToInternalLeftArmSkin InternalGround InternalLeftArmSkin - GroundToInternalLeftLegSkin GroundToInternalLeftLegSkin InternalGround InternalLeftLegSkin - GroundToInternalRightArmSkin GroundToInternalRightArmSkin InternalGround InternalRightArmSkin - GroundToInternalRightLegSkin GroundToInternalRightLegSkin InternalGround InternalRightLegSkin - GroundToInternalTorsoSkin GroundToInternalTorsoSkin InternalGround InternalTorsoSkin - InternalCoreToExternalCore InternalCoreToExternalCore InternalCore ExternalCore - InternalCoreToGround InternalCoreToGround InternalGround InternalCore - InternalCoreToInternalHeadSkin InternalCoreToInternalHeadSkin InternalCore InternalHeadSkin - InternalCoreToInternalLeftArmSkin InternalCoreToInternalLeftArmSkin InternalCore InternalLeftArmSkin - InternalCoreToInternalLeftLegSkin InternalCoreToInternalLeftLegSkin InternalCore InternalLeftLegSkin - InternalCoreToInternalRightArmSkin InternalCoreToInternalRightArmSkin InternalCore InternalRightArmSkin - InternalCoreToInternalRightLegSkin InternalCoreToInternalRightLegSkin InternalCore InternalRightLegSkin - InternalCoreToInternalTorsoSkin InternalCoreToInternalTorsoSkin InternalCore InternalTorsoSkin - InternalHeadSkinToExternalHeadSkin InternalHeadSkinToExternalHeadSkin InternalHeadSkin ExternalHeadSkin - InternalHeadSkinToGround InternalHeadSkinToTemperatureGround InternalGround InternalHeadSkin - InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkin ExternalLeftArmSkin - InternalLeftArmSkinToGround InternalLeftArmSkinToTemperatureGround InternalGround InternalLeftArmSkin - InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkin ExternalLeftLegSkin - InternalLeftLegSkinToGround InternalLeftLegSkinToTemperatureGround InternalGround InternalLeftLegSkin - InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkin ExternalRightArmSkin - InternalRightArmSkinToGround InternalRightArmSkinToTemperatureGround InternalGround InternalRightArmSkin - InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkin ExternalRightLegSkin - InternalRightLegSkinToGround InternalRightLegSkinToTemperatureGround InternalGround InternalRightLegSkin - InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkin ExternalTorsoSkin - InternalTorsoSkinToGround InternalTorsoSkinToTemperatureGround InternalGround InternalTorsoSkin - BoneTissue @@ -30566,7 +29814,6 @@ - Off @@ -30975,7 +30222,6 @@ - @@ -31002,15 +30248,15 @@ On - + - + - + - + @@ -32357,7 +31603,6 @@ - Extrasplanchnic @@ -32368,7 +31613,6 @@ - Extrasplanchnic @@ -32389,7 +31633,6 @@ - Splanchnic @@ -32400,7 +31643,6 @@ - Extrasplanchnic @@ -32418,7 +31660,6 @@ - Extrasplanchnic @@ -32429,7 +31670,6 @@ - Splanchnic @@ -32440,7 +31680,6 @@ - Muscle @@ -32451,7 +31690,6 @@ - Myocardium @@ -32462,7 +31700,6 @@ - Cerebral @@ -32473,7 +31710,6 @@ - Extrasplanchnic @@ -32491,7 +31727,6 @@ - Extrasplanchnic @@ -32502,7 +31737,6 @@ - Extrasplanchnic @@ -32513,7 +31747,6 @@ - Splanchnic @@ -32524,7 +31757,6 @@ - Splanchnic @@ -32535,7 +31767,6 @@ - Splanchnic @@ -32593,7 +31824,6 @@ - Extrasplanchnic @@ -32826,7 +32056,6 @@ - Cerebral @@ -32847,7 +32076,6 @@ - Cerebral @@ -32868,7 +32096,6 @@ - Cerebral @@ -32982,7 +32209,6 @@ - Extrasplanchnic @@ -33265,7 +32491,6 @@ - Splanchnic @@ -33344,7 +32569,6 @@ - Extrasplanchnic @@ -33628,7 +32852,6 @@ - Extrasplanchnic @@ -34001,7 +33224,6 @@ - Splanchnic @@ -34206,7 +33428,6 @@ - Muscle @@ -34323,7 +33544,6 @@ - Myocardium @@ -34440,7 +33660,6 @@ - Cerebral @@ -34471,7 +33690,6 @@ - Cerebral @@ -34515,7 +33733,6 @@ - Splanchnic @@ -34589,7 +33806,6 @@ - Extrasplanchnic @@ -34873,7 +34089,6 @@ - Extrasplanchnic @@ -35285,7 +34500,6 @@ - Extrasplanchnic @@ -35432,7 +34646,6 @@ - Splanchnic @@ -35493,7 +34706,6 @@ - Splanchnic @@ -35613,7 +34825,6 @@ - Splanchnic diff --git a/share/data/states/Male_44_Tachycardic@0s.xml b/share/data/states/Male_44_Tachycardic@0s.xml index 59686c3ab..a72469c06 100644 --- a/share/data/states/Male_44_Tachycardic@0s.xml +++ b/share/data/states/Male_44_Tachycardic@0s.xml @@ -1,5 +1,5 @@ - + Male_44_Tachycardic @@ -180,7 +180,7 @@ - + @@ -316,7 +316,7 @@ - + @@ -366,7 +366,7 @@ - + @@ -389,7 +389,7 @@ - + @@ -404,7 +404,7 @@ - + @@ -422,7 +422,7 @@ - + @@ -447,7 +447,7 @@ - + @@ -470,7 +470,7 @@ - + @@ -518,7 +518,7 @@ - + @@ -574,7 +574,7 @@ - + @@ -597,7 +597,7 @@ - + @@ -622,7 +622,7 @@ - + @@ -647,7 +647,7 @@ - + @@ -688,7 +688,7 @@ - + @@ -915,7 +915,6 @@ - false false false @@ -1014,6 +1013,7 @@ + @@ -1163,16 +1163,13 @@ - - - @@ -1219,15 +1216,15 @@ false - + - - + + @@ -1240,9 +1237,9 @@ 77.6122029 38.5579408035798 - - - + + + @@ -1304,8 +1301,8 @@ - - + + @@ -1320,6 +1317,9 @@ 4 + + + @@ -1327,20 +1327,12 @@ Ambient Ambient - - - - Aorta Aorta1 Aorta2 Aorta3 - - - - Nitrogen @@ -1603,10 +1595,6 @@ Bladder Bladder - - - - Nitrogen @@ -1872,8 +1860,6 @@ BoneE3 BoneL1 BoneL2 - - Nitrogen @@ -2136,8 +2122,6 @@ BoneTissueIntracellular BoneI - - Nitrogen @@ -2401,10 +2385,6 @@ BoneVasculature Bone1 Bone2 - - - - Nitrogen @@ -2671,8 +2651,6 @@ BrainE3 BrainL1 BrainL2 - - Nitrogen @@ -2935,8 +2913,6 @@ BrainTissueIntracellular BrainI - - Nitrogen @@ -3201,276 +3177,269 @@ CerebralArteries CerebralCapillaries CerebralVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + CerebralArteries CerebralArteries1 CerebralArteries2 - - - - Nitrogen @@ -3733,10 +3702,6 @@ CerebralCapillaries CerebralCapillaries - - - - Nitrogen @@ -3999,8 +3964,6 @@ CerebralSpinalFluid SpinalFluid - - Nitrogen @@ -4264,10 +4227,6 @@ CerebralVeins1 CerebralVeins2 CerebralVeinsCheck - - - - Nitrogen @@ -4534,8 +4493,6 @@ FatE3 FatL1 FatL2 - - Nitrogen @@ -4798,8 +4755,6 @@ FatTissueIntracellular FatI - - Nitrogen @@ -5063,10 +5018,6 @@ FatVasculature Fat1 Fat2 - - - - Nitrogen @@ -5329,9 +5280,6 @@ Ground Ground - - - Nitrogen @@ -5452,8 +5400,6 @@ GutE3 GutL1 GutL2 - - Nitrogen @@ -5716,8 +5662,6 @@ GutTissueIntracellular GutI - - Nitrogen @@ -5982,266 +5926,263 @@ SplanchnicVasculature SmallIntestineVasculature LargeIntestineVasculature - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -6250,541 +6191,529 @@ LeftHeart RightHeart Pericardium - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + KidneyVasculature LeftKidneyVasculature RightKidneyVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LargeIntestineVasculature LargeIntestine1 - - - - Nitrogen @@ -7047,10 +6976,6 @@ LeftAfferentArteriole LeftAfferentArteriole - - - - Nitrogen @@ -7313,26 +7238,15 @@ LeftAlveoli LeftAlveoli - - - - LeftAlveoliLeak LeftAlveoliLeak - - - LeftArmVasculature LeftArm1 LeftArm2 - - - - Nitrogen @@ -7596,10 +7510,6 @@ LeftAtrium LeftAtrium1 LeftAtrium2 - - - - Nitrogen @@ -7863,10 +7773,6 @@ LeftBowmansCapsules LeftBowmansCapsules LeftNetBowmansCapsules - - - - Nitrogen @@ -8129,25 +8035,14 @@ LeftBronchi LeftBronchi - - - - LeftChestLeak LeftChestLeak - - - LeftEfferentArteriole LeftEfferentArteriole - - - - Nitrogen @@ -8411,10 +8306,6 @@ LeftGlomerularCapillaries LeftGlomerularCapillaries LeftNetGlomerularCapillaries - - - - Nitrogen @@ -8678,266 +8569,262 @@ LeftHeart LeftAtrium LeftVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -8947,8 +8834,6 @@ LeftKidneyE3 LeftKidneyL1 LeftKidneyL2 - - Nitrogen @@ -9211,8 +9096,6 @@ LeftKidneyTissueIntracellular LeftKidneyI - - Nitrogen @@ -9477,276 +9360,269 @@ LeftRenalArtery LeftNephron LeftRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftLegVasculature LeftLeg1 LeftLeg2 - - - - Nitrogen @@ -10010,10 +9886,6 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - - LeftLungTissueExtracellular @@ -10022,10 +9894,6 @@ LeftLungE3 LeftLungL1 LeftLungL2 - - - - Nitrogen @@ -10288,8 +10156,6 @@ LeftLungTissueIntracellular LeftLungI - - Nitrogen @@ -10554,266 +10420,263 @@ LeftPulmonaryArteries LeftPulmonaryCapillaries LeftPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -10824,276 +10687,269 @@ LeftPeritubularCapillaries LeftBowmansCapsules LeftTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftPeritubularCapillaries LeftPeritubularCapillaries LeftNetPeritubularCapillaries - - - - Nitrogen @@ -11357,19 +11213,11 @@ LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - LeftPulmonaryArteries LeftPulmonaryArteries LeftIntermediatePulmonaryArteries - - - - Nitrogen @@ -11632,10 +11480,6 @@ LeftPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen @@ -11898,10 +11742,6 @@ LeftPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen @@ -12164,10 +12004,6 @@ LeftRenalArtery LeftRenalArtery - - - - Nitrogen @@ -12430,10 +12266,6 @@ LeftRenalVein LeftRenalVein - - - - Nitrogen @@ -12697,10 +12529,6 @@ LeftTubules LeftTubules LeftNetTubules - - - - Nitrogen @@ -12963,10 +12791,6 @@ LeftUreter LeftUreter - - - - Nitrogen @@ -13229,10 +13053,6 @@ LeftVentricle LeftVentricle1 LeftVentricle2 - - - - Nitrogen @@ -13499,8 +13319,6 @@ LiverE3 LiverL1 LiverL2 - - Nitrogen @@ -13763,8 +13581,6 @@ LiverTissueIntracellular LiverI - - Nitrogen @@ -14030,9 +13846,6 @@ Liver2 PortalVein1 - - - Nitrogen @@ -14296,273 +14109,267 @@ LungsVasculature LeftLungVasculature RightLungVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + Lymph Lymph - - Nitrogen @@ -14824,16 +14631,10 @@ Mouth Mouth - - - - Mouthpiece Mouthpiece - - MuscleTissueExtracellular @@ -14842,8 +14643,6 @@ MuscleE3 MuscleL1 MuscleL2 - - Nitrogen @@ -15106,8 +14905,6 @@ MuscleTissueIntracellular MuscleI - - Nitrogen @@ -15371,10 +15168,6 @@ MuscleVasculature Muscle1 Muscle2 - - - - Nitrogen @@ -15641,8 +15434,6 @@ MyocardiumE3 MyocardiumL1 MyocardiumL2 - - Nitrogen @@ -15905,8 +15696,6 @@ MyocardiumTissueIntracellular MyocardiumI - - Nitrogen @@ -16170,10 +15959,6 @@ MyocardiumVasculature Myocardium1 Myocardium2 - - - - Nitrogen @@ -16436,10 +16221,6 @@ NeckArteries NeckArteries - - - - Nitrogen @@ -16702,10 +16483,6 @@ NeckVeins NeckVeins - - - - Nitrogen @@ -16968,8 +16745,6 @@ Pericardium Pericardium1 - - Nitrogen @@ -17233,825 +17008,801 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - PulmonaryArteries RightPulmonaryArteries LeftPulmonaryArteries - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryCapillaries RightPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - - PulmonaryVeins RightPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightAfferentArteriole RightAfferentArteriole - - - - Nitrogen @@ -18314,26 +18065,15 @@ RightAlveoli RightAlveoli - - - - RightAlveoliLeak RightAlveoliLeak - - - RightArmVasculature RightArm1 RightArm2 - - - - Nitrogen @@ -18597,10 +18337,6 @@ RightAtrium RightAtrium1 RightAtrium2 - - - - Nitrogen @@ -18864,10 +18600,6 @@ RightBowmansCapsules RightBowmansCapsules RightNetBowmansCapsules - - - - Nitrogen @@ -19130,25 +18862,14 @@ RightBronchi RightBronchi - - - - RightChestLeak RightChestLeak - - - RightEfferentArteriole RightEfferentArteriole - - - - Nitrogen @@ -19412,10 +19133,6 @@ RightGlomerularCapillaries RightGlomerularCapillaries RightNetGlomerularCapillaries - - - - Nitrogen @@ -19679,266 +19396,262 @@ RightHeart RightAtrium RightVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -19948,8 +19661,6 @@ RightKidneyE3 RightKidneyL1 RightKidneyL2 - - Nitrogen @@ -20212,8 +19923,6 @@ RightKidneyTissueIntracellular RightKidneyI - - Nitrogen @@ -20478,276 +20187,269 @@ RightRenalArtery RightNephron RightRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightLegVasculature RightLeg1 RightLeg2 - - - - Nitrogen @@ -21011,10 +20713,6 @@ RightLungPulmonary RightBronchi RightAlveoli - - - - RightLungTissueExtracellular @@ -21023,8 +20721,6 @@ RightLungE3 RightLungL1 RightLungL2 - - Nitrogen @@ -21287,8 +20983,6 @@ RightLungTissueIntracellular RightLungI - - Nitrogen @@ -21553,266 +21247,263 @@ RightPulmonaryArteries RightPulmonaryCapillaries RightPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -21823,276 +21514,269 @@ RightPeritubularCapillaries RightBowmansCapsules RightTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightPeritubularCapillaries RightPeritubularCapillaries RightNetPeritubularCapillaries - - - - Nitrogen @@ -22356,19 +22040,11 @@ RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - RightPulmonaryArteries RightPulmonaryArteries RightIntermediatePulmonaryArteries - - - - Nitrogen @@ -22631,10 +22307,6 @@ RightPulmonaryCapillaries RightPulmonaryCapillaries - - - - Nitrogen @@ -22897,10 +22569,6 @@ RightPulmonaryVeins RightPulmonaryVeins - - - - Nitrogen @@ -23163,10 +22831,6 @@ RightRenalArtery RightRenalArtery - - - - Nitrogen @@ -23429,10 +23093,6 @@ RightRenalVein RightRenalVein - - - - Nitrogen @@ -23696,10 +23356,6 @@ RightTubules RightTubules RightNetTubules - - - - Nitrogen @@ -23962,10 +23618,6 @@ RightUreter RightUreter - - - - Nitrogen @@ -24229,10 +23881,6 @@ RightVentricle1 RightVentricle2 MainPulmonaryArteries - - - - Nitrogen @@ -24499,8 +24147,6 @@ SkinE3 SkinL1 SkinL2 - - Nitrogen @@ -24763,8 +24409,6 @@ SkinTissueIntracellular SkinI - - Nitrogen @@ -25028,10 +24672,6 @@ SkinVasculature Skin1 Skin2 - - - - Nitrogen @@ -25294,8 +24934,6 @@ SmallIntestineChyme SmallIntestineC1 - - Nitrogen @@ -25557,10 +25195,6 @@ SmallIntestineVasculature SmallIntestine1 - - - - Nitrogen @@ -25823,10 +25457,6 @@ SplanchnicVasculature Splanchnic1 - - - - Nitrogen @@ -26093,8 +25723,6 @@ SpleenE3 SpleenL1 SpleenL2 - - Nitrogen @@ -26357,8 +25985,6 @@ SpleenTissueIntracellular SpleenI - - Nitrogen @@ -26621,10 +26247,6 @@ SpleenVasculature Spleen1 - - - - Nitrogen @@ -26887,290 +26509,276 @@ Stomach Stomach - - - - Trachea Trachea - - - - Ureters RightUreter LeftUreter - - - - Nitrogen - - + + - - + + Oxygen - - + + - - + + + CarbonDioxide - - + + - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + VenaCava VenaCava - - - - Nitrogen @@ -27435,189 +27043,162 @@ AortaBleed Aorta Ground - AortaToBone Aorta1ToBone1 Aorta BoneVasculature - AortaToFat Aorta1ToFat1 Aorta FatVasculature - AortaToLargeIntestine Aorta1ToLargeIntestine Aorta LargeIntestineVasculature - AortaToLeftArm Aorta1ToLeftArm1 Aorta LeftArmVasculature - AortaToLeftKidney LeftAortaConnectionToRenalArtery Aorta LeftRenalArtery - AortaToLeftLeg Aorta1ToLeftLeg1 Aorta LeftLegVasculature - AortaToLiver Aorta1ToLiver1 Aorta LiverVasculature - AortaToMuscle Aorta1ToMuscle1 Aorta MuscleVasculature - AortaToMyocardium Aorta1ToMyocardium1 Aorta MyocardiumVasculature - AortaToNeckArteries Aorta1ToNeckArteries Aorta NeckArteries - AortaToRightArm Aorta1ToRightArm1 Aorta RightArmVasculature - AortaToRightKidney RightAortaConnectionToRenalArtery Aorta RightRenalArtery - AortaToRightLeg Aorta1ToRightLeg1 Aorta RightLegVasculature - AortaToSkin Aorta1ToSkin1 Aorta SkinVasculature - AortaToSmallIntestine Aorta1ToSmallIntestine Aorta SmallIntestineVasculature - AortaToSplanchnic Aorta1ToSplanchnic Aorta SplanchnicVasculature - AortaToSpleen Aorta1ToSpleen Aorta SpleenVasculature - BladderToGround BladderToGroundUrinate Bladder Ground - BladderToGroundSource BladderToGroundPressure Bladder Ground - BoneToVenaCava Bone2ToVenaCava BoneVasculature VenaCava - BrainHemorrhage BrainBleed CerebralCapillaries Ground - CerebralArteriesToCerebralCapillaries CerebralArteries2ToCapillaries CerebralArteries CerebralCapillaries - CerebralCapillariesToCerebralVeins CerebralCapillariesToCerebralVeins1 CerebralCapillaries CerebralVeins - CerebralVeinsToNeckVeins CerebralVeins2ToNeckVeins CerebralVeins NeckVeins - EnvironmentToLeftChestLeak EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -27630,266 +27211,228 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - FatToVenaCava Fat2ToVenaCava FatVasculature VenaCava - HeartHemorrhage MyocardiumBleed MyocardiumVasculature Ground - LargeIntestineHemorrhage LargeIntestineBleed LargeIntestineVasculature Ground - LargeIntestineToLiver LargeIntestineToPortalVein LargeIntestineVasculature LiverVasculature - LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArteriole LeftGlomerularCapillaries - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftArmHemorrhage LeftArmBleed LeftArmVasculature Ground - LeftArmToVenaCava LeftArm2ToVenaCava LeftArmVasculature VenaCava - LeftAtriumToLeftVentricle LeftAtrium2ToLeftVentricle1 LeftAtrium LeftVentricle - LeftBowmansCapsulesToTubules LeftBowmansCapsulesToTubules LeftBowmansCapsules LeftTubules - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArteriole LeftPeritubularCapillaries - LeftGlomerularCapillariesToBowmansCapsules LeftNetGlomerularCapillariesToNetBowmansCapsules LeftGlomerularCapillaries LeftBowmansCapsules - LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillaries LeftEfferentArteriole - LeftKidneyHemorrhage LeftKidneyBleed LeftRenalVein Ground - LeftKidneyToVenaCava LeftRenalVeinToVenaCavaConnection LeftRenalVein VenaCava - LeftLegHemorrhage LeftLegBleed LeftLegVasculature Ground - LeftLegToVenaCava LeftLeg2ToVenaCava LeftLegVasculature VenaCava - LeftLungHemorrhage LeftLungBleed LeftPulmonaryArteries Ground - LeftLungVascularToTissue LeftLungVToLeftLungE1 LeftLungVasculature LeftLungTissueExtracellular - LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillaries LeftRenalVein - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - LeftPulmonaryArteriesToCapillaries LeftPulmonaryArteriesToLeftPulmonaryCapillaries LeftPulmonaryArteries LeftPulmonaryCapillaries - LeftPulmonaryArteriesToVeins LeftPulmonaryArteriesToLeftPulmonaryVeins LeftPulmonaryArteries LeftPulmonaryVeins - LeftPulmonaryCapillariesToVeins LeftPulmonaryCapillariesToLeftPulmonaryVeins LeftPulmonaryCapillaries LeftPulmonaryVeins - LeftPulmonaryVeinsToLeftAtrium LeftIntermediatePulmonaryVeinsToLeftAtrium1 LeftPulmonaryVeins LeftAtrium - LeftRenalArteryToAfferentArteriole LeftRenalArteryToAfferentArteriole LeftRenalArtery LeftAfferentArteriole - LeftTubulesToPeritubularCapillaries LeftNetTubulesToNetPeritubularCapillaries LeftTubules LeftPeritubularCapillaries - LeftTubulesToUreter LeftTubulesToUreter LeftTubules LeftUreter - LeftUreterToBladder LeftUreterToBladder LeftUreter Bladder - LeftVentricleToAorta LeftVentricle1ToAorta2 LeftVentricle Aorta - LiverHemorrhage LiverBleed LiverVasculature Ground - LiverToVenaCava Liver2ToVenaCava LiverVasculature VenaCava - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -27902,315 +27445,270 @@ Muscle2ToVenaCava MuscleVasculature VenaCava - MyocardiumToVenaCava Myocardium2ToVenaCava MyocardiumVasculature VenaCava - NeckArteriesToCerebralArteries NeckArteriesToCerebralArteries1 NeckArteries CerebralArteries - NeckVeinsToVenaCava NeckVeinsToVenaCava NeckVeins VenaCava - RightAfferentArterioleToGlomerularCapillaries RightAfferentArterioleToGlomerularCapillaries RightAfferentArteriole RightGlomerularCapillaries - RightAlveoliLeakToRightPleuralCavity RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightArmHemorrhage RightArmBleed RightArmVasculature Ground - RightArmToVenaCava RightArm2ToVenaCava RightArmVasculature VenaCava - RightAtriumToRightVentricle RightAtrium2ToRightVentricle1 RightAtrium RightVentricle - RightBowmansCapsulesToTubules RightBowmansCapsulesToTubules RightBowmansCapsules RightTubules - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightEfferentArterioleToPeritubularCapillaries RightEfferentArterioleToPeritubularCapillaries RightEfferentArteriole RightPeritubularCapillaries - RightGlomerularCapillariesToBowmansCapsules RightNetGlomerularCapillariesToNetBowmansCapsules RightGlomerularCapillaries RightBowmansCapsules - RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillaries RightEfferentArteriole - RightKidneyHemorrhage RightKidneyBleed RightRenalVein Ground - RightKidneyToVenaCava RightRenalVeinToVenaCavaConnection RightRenalVein VenaCava - RightLegHemorrhage RightLegBleed RightLegVasculature Ground - RightLegToVenaCava RightLeg2ToVenaCava RightLegVasculature VenaCava - RightLungHemorrhage RightLungBleed RightPulmonaryArteries Ground - RightPeritubularCapillariesToRenalVein RightPeritubularCapillariesToRenalVein RightPeritubularCapillaries RightRenalVein - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - RightPulmonaryArteriesToCapillaries RightPulmonaryArteriesToRightPulmonaryCapillaries RightPulmonaryArteries RightPulmonaryCapillaries - RightPulmonaryArteriesToVeins RightPulmonaryArteriesToRightPulmonaryVeins RightPulmonaryArteries RightPulmonaryVeins - RightPulmonaryCapillariesToVeins RightPulmonaryCapillariesToRightPulmonaryVeins RightPulmonaryCapillaries RightPulmonaryVeins - RightPulmonaryVeinsToLeftAtrium RightIntermediatePulmonaryVeinsToLeftAtrium1 RightPulmonaryVeins LeftAtrium - RightRenalArteryToAfferentArteriole RightRenalArteryToAfferentArteriole RightRenalArtery RightAfferentArteriole - RightTubulesToPeritubularCapillaries RightNetTubulesToNetPeritubularCapillaries RightTubules RightPeritubularCapillaries - RightTubulesToUreter RightTubulesToUreter RightTubules RightUreter - RightUreterToBladder RightUreterToBladder RightUreter Bladder - RightVentricleToLeftPulmonaryArteries MainPulmonaryArteriesToLeftIntermediatePulmonaryArteries RightVentricle LeftPulmonaryArteries - RightVentricleToRightPulmonaryArteries MainPulmonaryArteriesToRightIntermediatePulmonaryArteries RightVentricle RightPulmonaryArteries - SkinToVenaCava Skin2ToVenaCava SkinVasculature VenaCava - SmallIntestineHemorrhage SmallIntestineBleed SmallIntestineVasculature Ground - SmallIntestineToLiver SmallIntestineToPortalVein SmallIntestineVasculature LiverVasculature - SplanchnicHemorrhage SplanchnicBleed SplanchnicVasculature Ground - SplanchnicToLiver SplanchnicToPortalVein SplanchnicVasculature LiverVasculature - SpleenHemorrhage SpleenBleed SpleenVasculature Ground - SpleenToLiver SpleenToPortalVein SpleenVasculature LiverVasculature - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VenaCavaHemorrhage VenaCavaBleed VenaCava Ground - VenaCavaIV IVToVenaCava Ground VenaCava - VenaCavaToRightAtrium VenaCavaToRightAtrium1 VenaCava RightAtrium - Nitrogen Oxygen @@ -28636,10 +28134,6 @@ Ambient Ambient - - - - Nitrogen @@ -28662,10 +28156,6 @@ AnesthesiaConnection AnesthesiaConnection - - - - Nitrogen @@ -28688,7 +28178,6 @@ Connection MechanicalVentilatorConnection - Nitrogen @@ -28711,10 +28200,6 @@ ExpiratoryLimb ExpiratoryLimb - - - - Nitrogen @@ -28737,10 +28222,6 @@ GasInlet GasInlet - - - - Nitrogen @@ -28763,10 +28244,6 @@ GasSource GasSource - - - - Nitrogen @@ -28789,10 +28266,6 @@ InspiratoryLimb InspiratoryLimb - - - - Nitrogen @@ -28815,10 +28288,6 @@ LeftAlveoli LeftAlveoli - - - - Nitrogen @@ -28841,9 +28310,6 @@ LeftAlveoliLeak LeftAlveoliLeak - - - Nitrogen @@ -28857,10 +28323,6 @@ LeftBronchi LeftBronchi - - - - Nitrogen @@ -28883,9 +28345,6 @@ LeftChestLeak LeftChestLeak - - - Nitrogen @@ -28900,37 +28359,31 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - Nitrogen @@ -28953,10 +28406,6 @@ Mouth Mouth - - - - Nitrogen @@ -28979,8 +28428,6 @@ Mouthpiece Mouthpiece - - Nitrogen @@ -29003,7 +28450,6 @@ Nosepiece Nosepiece - Nitrogen @@ -29026,7 +28472,6 @@ OxygenTank OxygenTank - Nitrogen @@ -29050,62 +28495,53 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + ReliefValve ReliefValve - - - Nitrogen @@ -29128,10 +28564,6 @@ RightAlveoli RightAlveoli - - - - Nitrogen @@ -29154,9 +28586,6 @@ RightAlveoliLeak RightAlveoliLeak - - - Nitrogen @@ -29170,10 +28599,6 @@ RightBronchi RightBronchi - - - - Nitrogen @@ -29196,9 +28621,6 @@ RightChestLeak RightChestLeak - - - Nitrogen @@ -29213,37 +28635,30 @@ RightLungPulmonary RightBronchi RightAlveoli - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - Nitrogen @@ -29266,10 +28681,6 @@ Scrubber Scrubber - - - - Nitrogen @@ -29292,10 +28703,6 @@ Selector Selector - - - - Nitrogen @@ -29318,10 +28725,6 @@ Stomach Stomach - - - - Nitrogen @@ -29344,10 +28747,6 @@ Trachea Trachea - - - - Nitrogen @@ -29371,10 +28770,6 @@ Ventilator Ventilator VentilatorConnection - - - - Nitrogen @@ -29418,10 +28813,6 @@ YPiece YPiece - - - - Nitrogen @@ -29446,7 +28837,6 @@ AnesthesiaConnectionToEnvironment AnesthesiaConnection Ambient - ConnectionToMouth @@ -29459,14 +28849,12 @@ EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -29485,98 +28873,84 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - Exhaust SelectorToEnvironment Selector Ambient - ExpiratoryLimbToSelector ExpiratoryLimbToSelector ExpiratoryLimb Selector - GasInletToInspiratoryLimb GasInletToInspiratoryLimb GasInlet InspiratoryLimb - GasSourceToGasInlet GasSourceToGasInlet GasSource GasInlet - InspiratoryLimbToYPiece InspiratoryLimbToYPiece InspiratoryLimb YPiece - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - Mask AnesthesiaConnectionToMouth AnesthesiaConnection Mouth - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -29607,91 +28981,78 @@ RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - ScrubberToGasInlet ScrubberToGasInlet Scrubber GasInlet - SelectorToReliefValve SelectorToReliefValve Selector ReliefValve - SelectorToScrubber SelectorToScrubber Selector Scrubber - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VentilatorToSelector VentilatorConnectionToSelector Ventilator Selector - YPieceToAnesthesiaConnection YPieceToAnesthesiaConnection YPiece AnesthesiaConnection - YPieceToExpiratoryLimb YPieceToExpiratoryLimb YPiece ExpiratoryLimb - Nitrogen Oxygen @@ -29925,477 +29286,364 @@ Active Active - - - Ambient Ambient - - - Clothing Clothing - - - Enclosure Enclosure - - - ExternalCore ExternalCore - - - ExternalGround ExternalGround - - - ExternalHeadSkin ExternalHeadSkin - - - ExternalLeftArmSkin ExternalLeftArmSkin - - - ExternalLeftLegSkin ExternalLeftLegSkin - - - ExternalRightArmSkin ExternalRightArmSkin - - - ExternalRightLegSkin ExternalRightLegSkin - - - ExternalTorsoSkin ExternalTorsoSkin - - - InternalCore InternalCore InternalGround - - - - InternalGround - - InternalHeadSkin InternalHeadSkin - - - - InternalLeftArmSkin InternalLeftArmSkin - - - - InternalLeftLegSkin InternalLeftLegSkin - - - - InternalRightArmSkin InternalRightArmSkin - - - - InternalRightLegSkin InternalRightLegSkin - - - - InternalTorsoSkin InternalTorsoSkin - - - - ActiveToClothing ActiveToClothing Active Clothing - ClothingToEnclosure ClothingToEnclosure Clothing Enclosure - ClothingToEnvironment ClothingToEnvironment Clothing Ambient - ExternalCoreToGround ExternalCoreToGround ExternalCore ExternalGround - ExternalHeadSkinToClothing ExternalHeadSkinToClothing ExternalHeadSkin Clothing - ExternalHeadSkinToGround ExternalHeadSkinToGround ExternalHeadSkin ExternalGround - ExternalLeftArmSkinToClothing ExternalLeftArmSkinToClothing ExternalLeftArmSkin Clothing - ExternalLeftArmSkinToGround ExternalLeftArmSkinToGround ExternalLeftArmSkin ExternalGround - ExternalLeftLegSkinToClothing ExternalLeftLegSkinToClothing ExternalLeftLegSkin Clothing - ExternalLeftLegSkinToGround ExternalLeftLegSkinToGround ExternalLeftLegSkin ExternalGround - ExternalRightArmSkinToClothing ExternalRightArmSkinToClothing ExternalRightArmSkin Clothing - ExternalRightArmSkinToGround ExternalRightArmSkinToGround ExternalRightArmSkin ExternalGround - ExternalRightLegSkinToClothing ExternalRightLegSkinToClothing ExternalRightLegSkin Clothing - ExternalRightLegSkinToGround ExternalRightLegSkinToGround ExternalRightLegSkin ExternalGround - ExternalTorsoSkinToClothing ExternalTorsoSkinToClothing ExternalTorsoSkin Clothing - ExternalTorsoSkinToGround ExternalTorsoSkinToGround ExternalTorsoSkin ExternalGround - GroundToActive GroundToActive ExternalGround Active - GroundToClothing GroundToClothing ExternalGround Clothing - GroundToEnclosure GroundToEnclosure ExternalGround Enclosure - GroundToEnvironment GroundToEnvironment ExternalGround Ambient - GroundToInternalCore GroundToInternalCore InternalGround InternalCore - GroundToInternalHeadSkin GroundToInternalHeadSkin InternalGround InternalHeadSkin - GroundToInternalLeftArmSkin GroundToInternalLeftArmSkin InternalGround InternalLeftArmSkin - GroundToInternalLeftLegSkin GroundToInternalLeftLegSkin InternalGround InternalLeftLegSkin - GroundToInternalRightArmSkin GroundToInternalRightArmSkin InternalGround InternalRightArmSkin - GroundToInternalRightLegSkin GroundToInternalRightLegSkin InternalGround InternalRightLegSkin - GroundToInternalTorsoSkin GroundToInternalTorsoSkin InternalGround InternalTorsoSkin - InternalCoreToExternalCore InternalCoreToExternalCore InternalCore ExternalCore - InternalCoreToGround InternalCoreToGround InternalGround InternalCore - InternalCoreToInternalHeadSkin InternalCoreToInternalHeadSkin InternalCore InternalHeadSkin - InternalCoreToInternalLeftArmSkin InternalCoreToInternalLeftArmSkin InternalCore InternalLeftArmSkin - InternalCoreToInternalLeftLegSkin InternalCoreToInternalLeftLegSkin InternalCore InternalLeftLegSkin - InternalCoreToInternalRightArmSkin InternalCoreToInternalRightArmSkin InternalCore InternalRightArmSkin - InternalCoreToInternalRightLegSkin InternalCoreToInternalRightLegSkin InternalCore InternalRightLegSkin - InternalCoreToInternalTorsoSkin InternalCoreToInternalTorsoSkin InternalCore InternalTorsoSkin - InternalHeadSkinToExternalHeadSkin InternalHeadSkinToExternalHeadSkin InternalHeadSkin ExternalHeadSkin - InternalHeadSkinToGround InternalHeadSkinToTemperatureGround InternalGround InternalHeadSkin - InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkin ExternalLeftArmSkin - InternalLeftArmSkinToGround InternalLeftArmSkinToTemperatureGround InternalGround InternalLeftArmSkin - InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkin ExternalLeftLegSkin - InternalLeftLegSkinToGround InternalLeftLegSkinToTemperatureGround InternalGround InternalLeftLegSkin - InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkin ExternalRightArmSkin - InternalRightArmSkinToGround InternalRightArmSkinToTemperatureGround InternalGround InternalRightArmSkin - InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkin ExternalRightLegSkin - InternalRightLegSkinToGround InternalRightLegSkinToTemperatureGround InternalGround InternalRightLegSkin - InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkin ExternalTorsoSkin - InternalTorsoSkinToGround InternalTorsoSkinToTemperatureGround InternalGround InternalTorsoSkin - BoneTissue @@ -30569,7 +29817,6 @@ - Off @@ -30978,7 +30225,6 @@ - @@ -31005,15 +30251,15 @@ On - + - + - + - + @@ -32360,7 +31606,6 @@ - Extrasplanchnic @@ -32371,7 +31616,6 @@ - Extrasplanchnic @@ -32392,7 +31636,6 @@ - Splanchnic @@ -32403,7 +31646,6 @@ - Extrasplanchnic @@ -32421,7 +31663,6 @@ - Extrasplanchnic @@ -32432,7 +31673,6 @@ - Splanchnic @@ -32443,7 +31683,6 @@ - Muscle @@ -32454,7 +31693,6 @@ - Myocardium @@ -32465,7 +31703,6 @@ - Cerebral @@ -32476,7 +31713,6 @@ - Extrasplanchnic @@ -32494,7 +31730,6 @@ - Extrasplanchnic @@ -32505,7 +31740,6 @@ - Extrasplanchnic @@ -32516,7 +31750,6 @@ - Splanchnic @@ -32527,7 +31760,6 @@ - Splanchnic @@ -32538,7 +31770,6 @@ - Splanchnic @@ -32596,7 +31827,6 @@ - Extrasplanchnic @@ -32829,7 +32059,6 @@ - Cerebral @@ -32850,7 +32079,6 @@ - Cerebral @@ -32871,7 +32099,6 @@ - Cerebral @@ -32985,7 +32212,6 @@ - Extrasplanchnic @@ -33268,7 +32494,6 @@ - Splanchnic @@ -33347,7 +32572,6 @@ - Extrasplanchnic @@ -33631,7 +32855,6 @@ - Extrasplanchnic @@ -34004,7 +33227,6 @@ - Splanchnic @@ -34209,7 +33431,6 @@ - Muscle @@ -34326,7 +33547,6 @@ - Myocardium @@ -34443,7 +33663,6 @@ - Cerebral @@ -34474,7 +33693,6 @@ - Cerebral @@ -34518,7 +33736,6 @@ - Splanchnic @@ -34592,7 +33809,6 @@ - Extrasplanchnic @@ -34876,7 +34092,6 @@ - Extrasplanchnic @@ -35288,7 +34503,6 @@ - Extrasplanchnic @@ -35435,7 +34649,6 @@ - Splanchnic @@ -35496,7 +34709,6 @@ - Splanchnic @@ -35616,7 +34828,6 @@ - Splanchnic diff --git a/share/data/states/StandardFemale@0s.xml b/share/data/states/StandardFemale@0s.xml index cdc8b46f6..6cbd6d89f 100644 --- a/share/data/states/StandardFemale@0s.xml +++ b/share/data/states/StandardFemale@0s.xml @@ -1,5 +1,5 @@ - + StandardFemale @@ -177,7 +177,7 @@ - + @@ -313,7 +313,7 @@ - + @@ -363,7 +363,7 @@ - + @@ -386,7 +386,7 @@ - + @@ -419,7 +419,7 @@ - + @@ -444,7 +444,7 @@ - + @@ -467,7 +467,7 @@ - + @@ -515,7 +515,7 @@ - + @@ -571,7 +571,7 @@ - + @@ -594,7 +594,7 @@ - + @@ -619,7 +619,7 @@ - + @@ -644,7 +644,7 @@ - + @@ -685,7 +685,7 @@ - + @@ -912,7 +912,6 @@ - false true false @@ -1011,6 +1010,7 @@ + @@ -1160,16 +1160,13 @@ - - - @@ -1216,15 +1213,15 @@ false - + - - + + @@ -1237,9 +1234,9 @@ 59.4685081 26.2536861759819 - - - + + + @@ -1301,8 +1298,8 @@ - - + + @@ -1317,6 +1314,9 @@ 17 + + + @@ -1324,20 +1324,12 @@ Ambient Ambient - - - - Aorta Aorta1 Aorta2 Aorta3 - - - - Nitrogen @@ -1600,10 +1592,6 @@ Bladder Bladder - - - - Nitrogen @@ -1869,8 +1857,6 @@ BoneE3 BoneL1 BoneL2 - - Nitrogen @@ -2133,8 +2119,6 @@ BoneTissueIntracellular BoneI - - Nitrogen @@ -2398,10 +2382,6 @@ BoneVasculature Bone1 Bone2 - - - - Nitrogen @@ -2668,8 +2648,6 @@ BrainE3 BrainL1 BrainL2 - - Nitrogen @@ -2932,8 +2910,6 @@ BrainTissueIntracellular BrainI - - Nitrogen @@ -3198,276 +3174,269 @@ CerebralArteries CerebralCapillaries CerebralVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + CerebralArteries CerebralArteries1 CerebralArteries2 - - - - Nitrogen @@ -3730,10 +3699,6 @@ CerebralCapillaries CerebralCapillaries - - - - Nitrogen @@ -3996,8 +3961,6 @@ CerebralSpinalFluid SpinalFluid - - Nitrogen @@ -4261,10 +4224,6 @@ CerebralVeins1 CerebralVeins2 CerebralVeinsCheck - - - - Nitrogen @@ -4531,8 +4490,6 @@ FatE3 FatL1 FatL2 - - Nitrogen @@ -4795,8 +4752,6 @@ FatTissueIntracellular FatI - - Nitrogen @@ -5060,10 +5015,6 @@ FatVasculature Fat1 Fat2 - - - - Nitrogen @@ -5326,9 +5277,6 @@ Ground Ground - - - Nitrogen @@ -5449,8 +5397,6 @@ GutE3 GutL1 GutL2 - - Nitrogen @@ -5713,8 +5659,6 @@ GutTissueIntracellular GutI - - Nitrogen @@ -5979,266 +5923,263 @@ SplanchnicVasculature SmallIntestineVasculature LargeIntestineVasculature - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -6247,541 +6188,529 @@ LeftHeart RightHeart Pericardium - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + KidneyVasculature LeftKidneyVasculature RightKidneyVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LargeIntestineVasculature LargeIntestine1 - - - - Nitrogen @@ -7044,10 +6973,6 @@ LeftAfferentArteriole LeftAfferentArteriole - - - - Nitrogen @@ -7310,26 +7235,15 @@ LeftAlveoli LeftAlveoli - - - - LeftAlveoliLeak LeftAlveoliLeak - - - LeftArmVasculature LeftArm1 LeftArm2 - - - - Nitrogen @@ -7593,10 +7507,6 @@ LeftAtrium LeftAtrium1 LeftAtrium2 - - - - Nitrogen @@ -7860,10 +7770,6 @@ LeftBowmansCapsules LeftBowmansCapsules LeftNetBowmansCapsules - - - - Nitrogen @@ -8126,25 +8032,14 @@ LeftBronchi LeftBronchi - - - - LeftChestLeak LeftChestLeak - - - LeftEfferentArteriole LeftEfferentArteriole - - - - Nitrogen @@ -8408,10 +8303,6 @@ LeftGlomerularCapillaries LeftGlomerularCapillaries LeftNetGlomerularCapillaries - - - - Nitrogen @@ -8675,266 +8566,262 @@ LeftHeart LeftAtrium LeftVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -8944,8 +8831,6 @@ LeftKidneyE3 LeftKidneyL1 LeftKidneyL2 - - Nitrogen @@ -9208,8 +9093,6 @@ LeftKidneyTissueIntracellular LeftKidneyI - - Nitrogen @@ -9474,276 +9357,269 @@ LeftRenalArtery LeftNephron LeftRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftLegVasculature LeftLeg1 LeftLeg2 - - - - Nitrogen @@ -10007,10 +9883,6 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - - LeftLungTissueExtracellular @@ -10019,10 +9891,6 @@ LeftLungE3 LeftLungL1 LeftLungL2 - - - - Nitrogen @@ -10285,8 +10153,6 @@ LeftLungTissueIntracellular LeftLungI - - Nitrogen @@ -10551,266 +10417,263 @@ LeftPulmonaryArteries LeftPulmonaryCapillaries LeftPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -10821,276 +10684,269 @@ LeftPeritubularCapillaries LeftBowmansCapsules LeftTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftPeritubularCapillaries LeftPeritubularCapillaries LeftNetPeritubularCapillaries - - - - Nitrogen @@ -11354,19 +11210,11 @@ LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - LeftPulmonaryArteries LeftPulmonaryArteries LeftIntermediatePulmonaryArteries - - - - Nitrogen @@ -11629,10 +11477,6 @@ LeftPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen @@ -11895,10 +11739,6 @@ LeftPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen @@ -12161,10 +12001,6 @@ LeftRenalArtery LeftRenalArtery - - - - Nitrogen @@ -12427,10 +12263,6 @@ LeftRenalVein LeftRenalVein - - - - Nitrogen @@ -12694,10 +12526,6 @@ LeftTubules LeftTubules LeftNetTubules - - - - Nitrogen @@ -12960,10 +12788,6 @@ LeftUreter LeftUreter - - - - Nitrogen @@ -13226,10 +13050,6 @@ LeftVentricle LeftVentricle1 LeftVentricle2 - - - - Nitrogen @@ -13496,8 +13316,6 @@ LiverE3 LiverL1 LiverL2 - - Nitrogen @@ -13760,8 +13578,6 @@ LiverTissueIntracellular LiverI - - Nitrogen @@ -14027,9 +13843,6 @@ Liver2 PortalVein1 - - - Nitrogen @@ -14293,273 +14106,267 @@ LungsVasculature LeftLungVasculature RightLungVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + Lymph Lymph - - Nitrogen @@ -14821,16 +14628,10 @@ Mouth Mouth - - - - Mouthpiece Mouthpiece - - MuscleTissueExtracellular @@ -14839,8 +14640,6 @@ MuscleE3 MuscleL1 MuscleL2 - - Nitrogen @@ -15103,8 +14902,6 @@ MuscleTissueIntracellular MuscleI - - Nitrogen @@ -15368,10 +15165,6 @@ MuscleVasculature Muscle1 Muscle2 - - - - Nitrogen @@ -15638,8 +15431,6 @@ MyocardiumE3 MyocardiumL1 MyocardiumL2 - - Nitrogen @@ -15902,8 +15693,6 @@ MyocardiumTissueIntracellular MyocardiumI - - Nitrogen @@ -16167,10 +15956,6 @@ MyocardiumVasculature Myocardium1 Myocardium2 - - - - Nitrogen @@ -16433,10 +16218,6 @@ NeckArteries NeckArteries - - - - Nitrogen @@ -16699,10 +16480,6 @@ NeckVeins NeckVeins - - - - Nitrogen @@ -16965,8 +16742,6 @@ Pericardium Pericardium1 - - Nitrogen @@ -17230,825 +17005,801 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - PulmonaryArteries RightPulmonaryArteries LeftPulmonaryArteries - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryCapillaries RightPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - - PulmonaryVeins RightPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightAfferentArteriole RightAfferentArteriole - - - - Nitrogen @@ -18311,26 +18062,15 @@ RightAlveoli RightAlveoli - - - - RightAlveoliLeak RightAlveoliLeak - - - RightArmVasculature RightArm1 RightArm2 - - - - Nitrogen @@ -18594,10 +18334,6 @@ RightAtrium RightAtrium1 RightAtrium2 - - - - Nitrogen @@ -18861,10 +18597,6 @@ RightBowmansCapsules RightBowmansCapsules RightNetBowmansCapsules - - - - Nitrogen @@ -19127,25 +18859,14 @@ RightBronchi RightBronchi - - - - RightChestLeak RightChestLeak - - - RightEfferentArteriole RightEfferentArteriole - - - - Nitrogen @@ -19409,10 +19130,6 @@ RightGlomerularCapillaries RightGlomerularCapillaries RightNetGlomerularCapillaries - - - - Nitrogen @@ -19676,266 +19393,262 @@ RightHeart RightAtrium RightVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -19945,8 +19658,6 @@ RightKidneyE3 RightKidneyL1 RightKidneyL2 - - Nitrogen @@ -20209,8 +19920,6 @@ RightKidneyTissueIntracellular RightKidneyI - - Nitrogen @@ -20475,276 +20184,269 @@ RightRenalArtery RightNephron RightRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightLegVasculature RightLeg1 RightLeg2 - - - - Nitrogen @@ -21008,10 +20710,6 @@ RightLungPulmonary RightBronchi RightAlveoli - - - - RightLungTissueExtracellular @@ -21020,8 +20718,6 @@ RightLungE3 RightLungL1 RightLungL2 - - Nitrogen @@ -21284,8 +20980,6 @@ RightLungTissueIntracellular RightLungI - - Nitrogen @@ -21550,266 +21244,263 @@ RightPulmonaryArteries RightPulmonaryCapillaries RightPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -21820,276 +21511,269 @@ RightPeritubularCapillaries RightBowmansCapsules RightTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightPeritubularCapillaries RightPeritubularCapillaries RightNetPeritubularCapillaries - - - - Nitrogen @@ -22353,19 +22037,11 @@ RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - RightPulmonaryArteries RightPulmonaryArteries RightIntermediatePulmonaryArteries - - - - Nitrogen @@ -22628,10 +22304,6 @@ RightPulmonaryCapillaries RightPulmonaryCapillaries - - - - Nitrogen @@ -22894,10 +22566,6 @@ RightPulmonaryVeins RightPulmonaryVeins - - - - Nitrogen @@ -23160,10 +22828,6 @@ RightRenalArtery RightRenalArtery - - - - Nitrogen @@ -23426,10 +23090,6 @@ RightRenalVein RightRenalVein - - - - Nitrogen @@ -23693,10 +23353,6 @@ RightTubules RightTubules RightNetTubules - - - - Nitrogen @@ -23959,10 +23615,6 @@ RightUreter RightUreter - - - - Nitrogen @@ -24226,10 +23878,6 @@ RightVentricle1 RightVentricle2 MainPulmonaryArteries - - - - Nitrogen @@ -24496,8 +24144,6 @@ SkinE3 SkinL1 SkinL2 - - Nitrogen @@ -24760,8 +24406,6 @@ SkinTissueIntracellular SkinI - - Nitrogen @@ -25025,10 +24669,6 @@ SkinVasculature Skin1 Skin2 - - - - Nitrogen @@ -25291,8 +24931,6 @@ SmallIntestineChyme SmallIntestineC1 - - Nitrogen @@ -25554,10 +25192,6 @@ SmallIntestineVasculature SmallIntestine1 - - - - Nitrogen @@ -25820,10 +25454,6 @@ SplanchnicVasculature Splanchnic1 - - - - Nitrogen @@ -26090,8 +25720,6 @@ SpleenE3 SpleenL1 SpleenL2 - - Nitrogen @@ -26354,8 +25982,6 @@ SpleenTissueIntracellular SpleenI - - Nitrogen @@ -26618,10 +26244,6 @@ SpleenVasculature Spleen1 - - - - Nitrogen @@ -26884,290 +26506,276 @@ Stomach Stomach - - - - Trachea Trachea - - - - Ureters RightUreter LeftUreter - - - - Nitrogen - - + + - - + + Oxygen - - + + - - + + + CarbonDioxide - - + + - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + VenaCava VenaCava - - - - Nitrogen @@ -27432,189 +27040,162 @@ AortaBleed Aorta Ground - AortaToBone Aorta1ToBone1 Aorta BoneVasculature - AortaToFat Aorta1ToFat1 Aorta FatVasculature - AortaToLargeIntestine Aorta1ToLargeIntestine Aorta LargeIntestineVasculature - AortaToLeftArm Aorta1ToLeftArm1 Aorta LeftArmVasculature - AortaToLeftKidney LeftAortaConnectionToRenalArtery Aorta LeftRenalArtery - AortaToLeftLeg Aorta1ToLeftLeg1 Aorta LeftLegVasculature - AortaToLiver Aorta1ToLiver1 Aorta LiverVasculature - AortaToMuscle Aorta1ToMuscle1 Aorta MuscleVasculature - AortaToMyocardium Aorta1ToMyocardium1 Aorta MyocardiumVasculature - AortaToNeckArteries Aorta1ToNeckArteries Aorta NeckArteries - AortaToRightArm Aorta1ToRightArm1 Aorta RightArmVasculature - AortaToRightKidney RightAortaConnectionToRenalArtery Aorta RightRenalArtery - AortaToRightLeg Aorta1ToRightLeg1 Aorta RightLegVasculature - AortaToSkin Aorta1ToSkin1 Aorta SkinVasculature - AortaToSmallIntestine Aorta1ToSmallIntestine Aorta SmallIntestineVasculature - AortaToSplanchnic Aorta1ToSplanchnic Aorta SplanchnicVasculature - AortaToSpleen Aorta1ToSpleen Aorta SpleenVasculature - BladderToGround BladderToGroundUrinate Bladder Ground - BladderToGroundSource BladderToGroundPressure Bladder Ground - BoneToVenaCava Bone2ToVenaCava BoneVasculature VenaCava - BrainHemorrhage BrainBleed CerebralCapillaries Ground - CerebralArteriesToCerebralCapillaries CerebralArteries2ToCapillaries CerebralArteries CerebralCapillaries - CerebralCapillariesToCerebralVeins CerebralCapillariesToCerebralVeins1 CerebralCapillaries CerebralVeins - CerebralVeinsToNeckVeins CerebralVeins2ToNeckVeins CerebralVeins NeckVeins - EnvironmentToLeftChestLeak EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -27627,266 +27208,228 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - FatToVenaCava Fat2ToVenaCava FatVasculature VenaCava - HeartHemorrhage MyocardiumBleed MyocardiumVasculature Ground - LargeIntestineHemorrhage LargeIntestineBleed LargeIntestineVasculature Ground - LargeIntestineToLiver LargeIntestineToPortalVein LargeIntestineVasculature LiverVasculature - LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArteriole LeftGlomerularCapillaries - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftArmHemorrhage LeftArmBleed LeftArmVasculature Ground - LeftArmToVenaCava LeftArm2ToVenaCava LeftArmVasculature VenaCava - LeftAtriumToLeftVentricle LeftAtrium2ToLeftVentricle1 LeftAtrium LeftVentricle - LeftBowmansCapsulesToTubules LeftBowmansCapsulesToTubules LeftBowmansCapsules LeftTubules - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArteriole LeftPeritubularCapillaries - LeftGlomerularCapillariesToBowmansCapsules LeftNetGlomerularCapillariesToNetBowmansCapsules LeftGlomerularCapillaries LeftBowmansCapsules - LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillaries LeftEfferentArteriole - LeftKidneyHemorrhage LeftKidneyBleed LeftRenalVein Ground - LeftKidneyToVenaCava LeftRenalVeinToVenaCavaConnection LeftRenalVein VenaCava - LeftLegHemorrhage LeftLegBleed LeftLegVasculature Ground - LeftLegToVenaCava LeftLeg2ToVenaCava LeftLegVasculature VenaCava - LeftLungHemorrhage LeftLungBleed LeftPulmonaryArteries Ground - LeftLungVascularToTissue LeftLungVToLeftLungE1 LeftLungVasculature LeftLungTissueExtracellular - LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillaries LeftRenalVein - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - LeftPulmonaryArteriesToCapillaries LeftPulmonaryArteriesToLeftPulmonaryCapillaries LeftPulmonaryArteries LeftPulmonaryCapillaries - LeftPulmonaryArteriesToVeins LeftPulmonaryArteriesToLeftPulmonaryVeins LeftPulmonaryArteries LeftPulmonaryVeins - LeftPulmonaryCapillariesToVeins LeftPulmonaryCapillariesToLeftPulmonaryVeins LeftPulmonaryCapillaries LeftPulmonaryVeins - LeftPulmonaryVeinsToLeftAtrium LeftIntermediatePulmonaryVeinsToLeftAtrium1 LeftPulmonaryVeins LeftAtrium - LeftRenalArteryToAfferentArteriole LeftRenalArteryToAfferentArteriole LeftRenalArtery LeftAfferentArteriole - LeftTubulesToPeritubularCapillaries LeftNetTubulesToNetPeritubularCapillaries LeftTubules LeftPeritubularCapillaries - LeftTubulesToUreter LeftTubulesToUreter LeftTubules LeftUreter - LeftUreterToBladder LeftUreterToBladder LeftUreter Bladder - LeftVentricleToAorta LeftVentricle1ToAorta2 LeftVentricle Aorta - LiverHemorrhage LiverBleed LiverVasculature Ground - LiverToVenaCava Liver2ToVenaCava LiverVasculature VenaCava - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -27899,315 +27442,270 @@ Muscle2ToVenaCava MuscleVasculature VenaCava - MyocardiumToVenaCava Myocardium2ToVenaCava MyocardiumVasculature VenaCava - NeckArteriesToCerebralArteries NeckArteriesToCerebralArteries1 NeckArteries CerebralArteries - NeckVeinsToVenaCava NeckVeinsToVenaCava NeckVeins VenaCava - RightAfferentArterioleToGlomerularCapillaries RightAfferentArterioleToGlomerularCapillaries RightAfferentArteriole RightGlomerularCapillaries - RightAlveoliLeakToRightPleuralCavity RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightArmHemorrhage RightArmBleed RightArmVasculature Ground - RightArmToVenaCava RightArm2ToVenaCava RightArmVasculature VenaCava - RightAtriumToRightVentricle RightAtrium2ToRightVentricle1 RightAtrium RightVentricle - RightBowmansCapsulesToTubules RightBowmansCapsulesToTubules RightBowmansCapsules RightTubules - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightEfferentArterioleToPeritubularCapillaries RightEfferentArterioleToPeritubularCapillaries RightEfferentArteriole RightPeritubularCapillaries - RightGlomerularCapillariesToBowmansCapsules RightNetGlomerularCapillariesToNetBowmansCapsules RightGlomerularCapillaries RightBowmansCapsules - RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillaries RightEfferentArteriole - RightKidneyHemorrhage RightKidneyBleed RightRenalVein Ground - RightKidneyToVenaCava RightRenalVeinToVenaCavaConnection RightRenalVein VenaCava - RightLegHemorrhage RightLegBleed RightLegVasculature Ground - RightLegToVenaCava RightLeg2ToVenaCava RightLegVasculature VenaCava - RightLungHemorrhage RightLungBleed RightPulmonaryArteries Ground - RightPeritubularCapillariesToRenalVein RightPeritubularCapillariesToRenalVein RightPeritubularCapillaries RightRenalVein - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - RightPulmonaryArteriesToCapillaries RightPulmonaryArteriesToRightPulmonaryCapillaries RightPulmonaryArteries RightPulmonaryCapillaries - RightPulmonaryArteriesToVeins RightPulmonaryArteriesToRightPulmonaryVeins RightPulmonaryArteries RightPulmonaryVeins - RightPulmonaryCapillariesToVeins RightPulmonaryCapillariesToRightPulmonaryVeins RightPulmonaryCapillaries RightPulmonaryVeins - RightPulmonaryVeinsToLeftAtrium RightIntermediatePulmonaryVeinsToLeftAtrium1 RightPulmonaryVeins LeftAtrium - RightRenalArteryToAfferentArteriole RightRenalArteryToAfferentArteriole RightRenalArtery RightAfferentArteriole - RightTubulesToPeritubularCapillaries RightNetTubulesToNetPeritubularCapillaries RightTubules RightPeritubularCapillaries - RightTubulesToUreter RightTubulesToUreter RightTubules RightUreter - RightUreterToBladder RightUreterToBladder RightUreter Bladder - RightVentricleToLeftPulmonaryArteries MainPulmonaryArteriesToLeftIntermediatePulmonaryArteries RightVentricle LeftPulmonaryArteries - RightVentricleToRightPulmonaryArteries MainPulmonaryArteriesToRightIntermediatePulmonaryArteries RightVentricle RightPulmonaryArteries - SkinToVenaCava Skin2ToVenaCava SkinVasculature VenaCava - SmallIntestineHemorrhage SmallIntestineBleed SmallIntestineVasculature Ground - SmallIntestineToLiver SmallIntestineToPortalVein SmallIntestineVasculature LiverVasculature - SplanchnicHemorrhage SplanchnicBleed SplanchnicVasculature Ground - SplanchnicToLiver SplanchnicToPortalVein SplanchnicVasculature LiverVasculature - SpleenHemorrhage SpleenBleed SpleenVasculature Ground - SpleenToLiver SpleenToPortalVein SpleenVasculature LiverVasculature - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VenaCavaHemorrhage VenaCavaBleed VenaCava Ground - VenaCavaIV IVToVenaCava Ground VenaCava - VenaCavaToRightAtrium VenaCavaToRightAtrium1 VenaCava RightAtrium - Nitrogen Oxygen @@ -28633,10 +28131,6 @@ Ambient Ambient - - - - Nitrogen @@ -28659,10 +28153,6 @@ AnesthesiaConnection AnesthesiaConnection - - - - Nitrogen @@ -28685,7 +28175,6 @@ Connection MechanicalVentilatorConnection - Nitrogen @@ -28708,10 +28197,6 @@ ExpiratoryLimb ExpiratoryLimb - - - - Nitrogen @@ -28734,10 +28219,6 @@ GasInlet GasInlet - - - - Nitrogen @@ -28760,10 +28241,6 @@ GasSource GasSource - - - - Nitrogen @@ -28786,10 +28263,6 @@ InspiratoryLimb InspiratoryLimb - - - - Nitrogen @@ -28812,10 +28285,6 @@ LeftAlveoli LeftAlveoli - - - - Nitrogen @@ -28838,9 +28307,6 @@ LeftAlveoliLeak LeftAlveoliLeak - - - Nitrogen @@ -28854,10 +28320,6 @@ LeftBronchi LeftBronchi - - - - Nitrogen @@ -28880,9 +28342,6 @@ LeftChestLeak LeftChestLeak - - - Nitrogen @@ -28897,37 +28356,31 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - Nitrogen @@ -28950,10 +28403,6 @@ Mouth Mouth - - - - Nitrogen @@ -28976,8 +28425,6 @@ Mouthpiece Mouthpiece - - Nitrogen @@ -29000,7 +28447,6 @@ Nosepiece Nosepiece - Nitrogen @@ -29023,7 +28469,6 @@ OxygenTank OxygenTank - Nitrogen @@ -29047,62 +28492,53 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + ReliefValve ReliefValve - - - Nitrogen @@ -29125,10 +28561,6 @@ RightAlveoli RightAlveoli - - - - Nitrogen @@ -29151,9 +28583,6 @@ RightAlveoliLeak RightAlveoliLeak - - - Nitrogen @@ -29167,10 +28596,6 @@ RightBronchi RightBronchi - - - - Nitrogen @@ -29193,9 +28618,6 @@ RightChestLeak RightChestLeak - - - Nitrogen @@ -29210,37 +28632,30 @@ RightLungPulmonary RightBronchi RightAlveoli - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - Nitrogen @@ -29263,10 +28678,6 @@ Scrubber Scrubber - - - - Nitrogen @@ -29289,10 +28700,6 @@ Selector Selector - - - - Nitrogen @@ -29315,10 +28722,6 @@ Stomach Stomach - - - - Nitrogen @@ -29341,10 +28744,6 @@ Trachea Trachea - - - - Nitrogen @@ -29368,10 +28767,6 @@ Ventilator Ventilator VentilatorConnection - - - - Nitrogen @@ -29415,10 +28810,6 @@ YPiece YPiece - - - - Nitrogen @@ -29443,7 +28834,6 @@ AnesthesiaConnectionToEnvironment AnesthesiaConnection Ambient - ConnectionToMouth @@ -29456,14 +28846,12 @@ EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -29482,98 +28870,84 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - Exhaust SelectorToEnvironment Selector Ambient - ExpiratoryLimbToSelector ExpiratoryLimbToSelector ExpiratoryLimb Selector - GasInletToInspiratoryLimb GasInletToInspiratoryLimb GasInlet InspiratoryLimb - GasSourceToGasInlet GasSourceToGasInlet GasSource GasInlet - InspiratoryLimbToYPiece InspiratoryLimbToYPiece InspiratoryLimb YPiece - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - Mask AnesthesiaConnectionToMouth AnesthesiaConnection Mouth - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -29604,91 +28978,78 @@ RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - ScrubberToGasInlet ScrubberToGasInlet Scrubber GasInlet - SelectorToReliefValve SelectorToReliefValve Selector ReliefValve - SelectorToScrubber SelectorToScrubber Selector Scrubber - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VentilatorToSelector VentilatorConnectionToSelector Ventilator Selector - YPieceToAnesthesiaConnection YPieceToAnesthesiaConnection YPiece AnesthesiaConnection - YPieceToExpiratoryLimb YPieceToExpiratoryLimb YPiece ExpiratoryLimb - Nitrogen Oxygen @@ -29922,477 +29283,364 @@ Active Active - - - Ambient Ambient - - - Clothing Clothing - - - Enclosure Enclosure - - - ExternalCore ExternalCore - - - ExternalGround ExternalGround - - - ExternalHeadSkin ExternalHeadSkin - - - ExternalLeftArmSkin ExternalLeftArmSkin - - - ExternalLeftLegSkin ExternalLeftLegSkin - - - ExternalRightArmSkin ExternalRightArmSkin - - - ExternalRightLegSkin ExternalRightLegSkin - - - ExternalTorsoSkin ExternalTorsoSkin - - - InternalCore InternalCore InternalGround - - - - InternalGround - - InternalHeadSkin InternalHeadSkin - - - - InternalLeftArmSkin InternalLeftArmSkin - - - - InternalLeftLegSkin InternalLeftLegSkin - - - - InternalRightArmSkin InternalRightArmSkin - - - - InternalRightLegSkin InternalRightLegSkin - - - - InternalTorsoSkin InternalTorsoSkin - - - - ActiveToClothing ActiveToClothing Active Clothing - ClothingToEnclosure ClothingToEnclosure Clothing Enclosure - ClothingToEnvironment ClothingToEnvironment Clothing Ambient - ExternalCoreToGround ExternalCoreToGround ExternalCore ExternalGround - ExternalHeadSkinToClothing ExternalHeadSkinToClothing ExternalHeadSkin Clothing - ExternalHeadSkinToGround ExternalHeadSkinToGround ExternalHeadSkin ExternalGround - ExternalLeftArmSkinToClothing ExternalLeftArmSkinToClothing ExternalLeftArmSkin Clothing - ExternalLeftArmSkinToGround ExternalLeftArmSkinToGround ExternalLeftArmSkin ExternalGround - ExternalLeftLegSkinToClothing ExternalLeftLegSkinToClothing ExternalLeftLegSkin Clothing - ExternalLeftLegSkinToGround ExternalLeftLegSkinToGround ExternalLeftLegSkin ExternalGround - ExternalRightArmSkinToClothing ExternalRightArmSkinToClothing ExternalRightArmSkin Clothing - ExternalRightArmSkinToGround ExternalRightArmSkinToGround ExternalRightArmSkin ExternalGround - ExternalRightLegSkinToClothing ExternalRightLegSkinToClothing ExternalRightLegSkin Clothing - ExternalRightLegSkinToGround ExternalRightLegSkinToGround ExternalRightLegSkin ExternalGround - ExternalTorsoSkinToClothing ExternalTorsoSkinToClothing ExternalTorsoSkin Clothing - ExternalTorsoSkinToGround ExternalTorsoSkinToGround ExternalTorsoSkin ExternalGround - GroundToActive GroundToActive ExternalGround Active - GroundToClothing GroundToClothing ExternalGround Clothing - GroundToEnclosure GroundToEnclosure ExternalGround Enclosure - GroundToEnvironment GroundToEnvironment ExternalGround Ambient - GroundToInternalCore GroundToInternalCore InternalGround InternalCore - GroundToInternalHeadSkin GroundToInternalHeadSkin InternalGround InternalHeadSkin - GroundToInternalLeftArmSkin GroundToInternalLeftArmSkin InternalGround InternalLeftArmSkin - GroundToInternalLeftLegSkin GroundToInternalLeftLegSkin InternalGround InternalLeftLegSkin - GroundToInternalRightArmSkin GroundToInternalRightArmSkin InternalGround InternalRightArmSkin - GroundToInternalRightLegSkin GroundToInternalRightLegSkin InternalGround InternalRightLegSkin - GroundToInternalTorsoSkin GroundToInternalTorsoSkin InternalGround InternalTorsoSkin - InternalCoreToExternalCore InternalCoreToExternalCore InternalCore ExternalCore - InternalCoreToGround InternalCoreToGround InternalGround InternalCore - InternalCoreToInternalHeadSkin InternalCoreToInternalHeadSkin InternalCore InternalHeadSkin - InternalCoreToInternalLeftArmSkin InternalCoreToInternalLeftArmSkin InternalCore InternalLeftArmSkin - InternalCoreToInternalLeftLegSkin InternalCoreToInternalLeftLegSkin InternalCore InternalLeftLegSkin - InternalCoreToInternalRightArmSkin InternalCoreToInternalRightArmSkin InternalCore InternalRightArmSkin - InternalCoreToInternalRightLegSkin InternalCoreToInternalRightLegSkin InternalCore InternalRightLegSkin - InternalCoreToInternalTorsoSkin InternalCoreToInternalTorsoSkin InternalCore InternalTorsoSkin - InternalHeadSkinToExternalHeadSkin InternalHeadSkinToExternalHeadSkin InternalHeadSkin ExternalHeadSkin - InternalHeadSkinToGround InternalHeadSkinToTemperatureGround InternalGround InternalHeadSkin - InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkin ExternalLeftArmSkin - InternalLeftArmSkinToGround InternalLeftArmSkinToTemperatureGround InternalGround InternalLeftArmSkin - InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkin ExternalLeftLegSkin - InternalLeftLegSkinToGround InternalLeftLegSkinToTemperatureGround InternalGround InternalLeftLegSkin - InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkin ExternalRightArmSkin - InternalRightArmSkinToGround InternalRightArmSkinToTemperatureGround InternalGround InternalRightArmSkin - InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkin ExternalRightLegSkin - InternalRightLegSkinToGround InternalRightLegSkinToTemperatureGround InternalGround InternalRightLegSkin - InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkin ExternalTorsoSkin - InternalTorsoSkinToGround InternalTorsoSkinToTemperatureGround InternalGround InternalTorsoSkin - BoneTissue @@ -30566,7 +29814,6 @@ - Off @@ -30975,7 +30222,6 @@ - @@ -31002,15 +30248,15 @@ On - + - + - + - + @@ -32357,7 +31603,6 @@ - Extrasplanchnic @@ -32368,7 +31613,6 @@ - Extrasplanchnic @@ -32389,7 +31633,6 @@ - Splanchnic @@ -32400,7 +31643,6 @@ - Extrasplanchnic @@ -32418,7 +31660,6 @@ - Extrasplanchnic @@ -32429,7 +31670,6 @@ - Splanchnic @@ -32440,7 +31680,6 @@ - Muscle @@ -32451,7 +31690,6 @@ - Myocardium @@ -32462,7 +31700,6 @@ - Cerebral @@ -32473,7 +31710,6 @@ - Extrasplanchnic @@ -32491,7 +31727,6 @@ - Extrasplanchnic @@ -32502,7 +31737,6 @@ - Extrasplanchnic @@ -32513,7 +31747,6 @@ - Splanchnic @@ -32524,7 +31757,6 @@ - Splanchnic @@ -32535,7 +31767,6 @@ - Splanchnic @@ -32593,7 +31824,6 @@ - Extrasplanchnic @@ -32826,7 +32056,6 @@ - Cerebral @@ -32847,7 +32076,6 @@ - Cerebral @@ -32868,7 +32096,6 @@ - Cerebral @@ -32982,7 +32209,6 @@ - Extrasplanchnic @@ -33265,7 +32491,6 @@ - Splanchnic @@ -33344,7 +32569,6 @@ - Extrasplanchnic @@ -33628,7 +32852,6 @@ - Extrasplanchnic @@ -34001,7 +33224,6 @@ - Splanchnic @@ -34206,7 +33428,6 @@ - Muscle @@ -34323,7 +33544,6 @@ - Myocardium @@ -34440,7 +33660,6 @@ - Cerebral @@ -34471,7 +33690,6 @@ - Cerebral @@ -34515,7 +33733,6 @@ - Splanchnic @@ -34589,7 +33806,6 @@ - Extrasplanchnic @@ -34873,7 +34089,6 @@ - Extrasplanchnic @@ -35285,7 +34500,6 @@ - Extrasplanchnic @@ -35432,7 +34646,6 @@ - Splanchnic @@ -35493,7 +34706,6 @@ - Splanchnic @@ -35613,7 +34825,6 @@ - Splanchnic diff --git a/share/data/states/StandardMale@0s.xml b/share/data/states/StandardMale@0s.xml index a01ac3198..ff9f08a82 100644 --- a/share/data/states/StandardMale@0s.xml +++ b/share/data/states/StandardMale@0s.xml @@ -1,5 +1,5 @@ - + StandardMale @@ -177,7 +177,7 @@ - + @@ -313,7 +313,7 @@ - + @@ -363,7 +363,7 @@ - + @@ -386,7 +386,7 @@ - + @@ -419,7 +419,7 @@ - + @@ -444,7 +444,7 @@ - + @@ -467,7 +467,7 @@ - + @@ -515,7 +515,7 @@ - + @@ -571,7 +571,7 @@ - + @@ -594,7 +594,7 @@ - + @@ -619,7 +619,7 @@ - + @@ -644,7 +644,7 @@ - + @@ -685,7 +685,7 @@ - + @@ -912,7 +912,6 @@ - false true false @@ -1011,6 +1010,7 @@ + @@ -1160,16 +1160,13 @@ - - - @@ -1216,15 +1213,15 @@ false - + - + - - + + @@ -1237,9 +1234,9 @@ 77.6122029 37.8644459711602 - - - + + + @@ -1301,8 +1298,8 @@ - - + + @@ -1317,6 +1314,9 @@ 10 + + + @@ -1324,20 +1324,12 @@ Ambient Ambient - - - - Aorta Aorta1 Aorta2 Aorta3 - - - - Nitrogen @@ -1600,10 +1592,6 @@ Bladder Bladder - - - - Nitrogen @@ -1869,8 +1857,6 @@ BoneE3 BoneL1 BoneL2 - - Nitrogen @@ -2133,8 +2119,6 @@ BoneTissueIntracellular BoneI - - Nitrogen @@ -2398,10 +2382,6 @@ BoneVasculature Bone1 Bone2 - - - - Nitrogen @@ -2668,8 +2648,6 @@ BrainE3 BrainL1 BrainL2 - - Nitrogen @@ -2932,8 +2910,6 @@ BrainTissueIntracellular BrainI - - Nitrogen @@ -3198,276 +3174,269 @@ CerebralArteries CerebralCapillaries CerebralVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + CerebralArteries CerebralArteries1 CerebralArteries2 - - - - Nitrogen @@ -3730,10 +3699,6 @@ CerebralCapillaries CerebralCapillaries - - - - Nitrogen @@ -3996,8 +3961,6 @@ CerebralSpinalFluid SpinalFluid - - Nitrogen @@ -4261,10 +4224,6 @@ CerebralVeins1 CerebralVeins2 CerebralVeinsCheck - - - - Nitrogen @@ -4531,8 +4490,6 @@ FatE3 FatL1 FatL2 - - Nitrogen @@ -4795,8 +4752,6 @@ FatTissueIntracellular FatI - - Nitrogen @@ -5060,10 +5015,6 @@ FatVasculature Fat1 Fat2 - - - - Nitrogen @@ -5326,9 +5277,6 @@ Ground Ground - - - Nitrogen @@ -5449,8 +5397,6 @@ GutE3 GutL1 GutL2 - - Nitrogen @@ -5713,8 +5659,6 @@ GutTissueIntracellular GutI - - Nitrogen @@ -5979,266 +5923,263 @@ SplanchnicVasculature SmallIntestineVasculature LargeIntestineVasculature - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -6247,541 +6188,529 @@ LeftHeart RightHeart Pericardium - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + KidneyVasculature LeftKidneyVasculature RightKidneyVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LargeIntestineVasculature LargeIntestine1 - - - - Nitrogen @@ -7044,10 +6973,6 @@ LeftAfferentArteriole LeftAfferentArteriole - - - - Nitrogen @@ -7310,26 +7235,15 @@ LeftAlveoli LeftAlveoli - - - - LeftAlveoliLeak LeftAlveoliLeak - - - LeftArmVasculature LeftArm1 LeftArm2 - - - - Nitrogen @@ -7593,10 +7507,6 @@ LeftAtrium LeftAtrium1 LeftAtrium2 - - - - Nitrogen @@ -7860,10 +7770,6 @@ LeftBowmansCapsules LeftBowmansCapsules LeftNetBowmansCapsules - - - - Nitrogen @@ -8126,25 +8032,14 @@ LeftBronchi LeftBronchi - - - - LeftChestLeak LeftChestLeak - - - LeftEfferentArteriole LeftEfferentArteriole - - - - Nitrogen @@ -8408,10 +8303,6 @@ LeftGlomerularCapillaries LeftGlomerularCapillaries LeftNetGlomerularCapillaries - - - - Nitrogen @@ -8675,266 +8566,262 @@ LeftHeart LeftAtrium LeftVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -8944,8 +8831,6 @@ LeftKidneyE3 LeftKidneyL1 LeftKidneyL2 - - Nitrogen @@ -9208,8 +9093,6 @@ LeftKidneyTissueIntracellular LeftKidneyI - - Nitrogen @@ -9474,276 +9357,269 @@ LeftRenalArtery LeftNephron LeftRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftLegVasculature LeftLeg1 LeftLeg2 - - - - Nitrogen @@ -10007,10 +9883,6 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - - LeftLungTissueExtracellular @@ -10019,10 +9891,6 @@ LeftLungE3 LeftLungL1 LeftLungL2 - - - - Nitrogen @@ -10285,8 +10153,6 @@ LeftLungTissueIntracellular LeftLungI - - Nitrogen @@ -10551,266 +10417,263 @@ LeftPulmonaryArteries LeftPulmonaryCapillaries LeftPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -10821,276 +10684,269 @@ LeftPeritubularCapillaries LeftBowmansCapsules LeftTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + LeftPeritubularCapillaries LeftPeritubularCapillaries LeftNetPeritubularCapillaries - - - - Nitrogen @@ -11354,19 +11210,11 @@ LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - LeftPulmonaryArteries LeftPulmonaryArteries LeftIntermediatePulmonaryArteries - - - - Nitrogen @@ -11629,10 +11477,6 @@ LeftPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen @@ -11895,10 +11739,6 @@ LeftPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen @@ -12161,10 +12001,6 @@ LeftRenalArtery LeftRenalArtery - - - - Nitrogen @@ -12427,10 +12263,6 @@ LeftRenalVein LeftRenalVein - - - - Nitrogen @@ -12694,10 +12526,6 @@ LeftTubules LeftTubules LeftNetTubules - - - - Nitrogen @@ -12960,10 +12788,6 @@ LeftUreter LeftUreter - - - - Nitrogen @@ -13226,10 +13050,6 @@ LeftVentricle LeftVentricle1 LeftVentricle2 - - - - Nitrogen @@ -13496,8 +13316,6 @@ LiverE3 LiverL1 LiverL2 - - Nitrogen @@ -13760,8 +13578,6 @@ LiverTissueIntracellular LiverI - - Nitrogen @@ -14027,9 +13843,6 @@ Liver2 PortalVein1 - - - Nitrogen @@ -14293,273 +14106,267 @@ LungsVasculature LeftLungVasculature RightLungVasculature - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + Lymph Lymph - - Nitrogen @@ -14821,16 +14628,10 @@ Mouth Mouth - - - - Mouthpiece Mouthpiece - - MuscleTissueExtracellular @@ -14839,8 +14640,6 @@ MuscleE3 MuscleL1 MuscleL2 - - Nitrogen @@ -15103,8 +14902,6 @@ MuscleTissueIntracellular MuscleI - - Nitrogen @@ -15368,10 +15165,6 @@ MuscleVasculature Muscle1 Muscle2 - - - - Nitrogen @@ -15638,8 +15431,6 @@ MyocardiumE3 MyocardiumL1 MyocardiumL2 - - Nitrogen @@ -15902,8 +15693,6 @@ MyocardiumTissueIntracellular MyocardiumI - - Nitrogen @@ -16167,10 +15956,6 @@ MyocardiumVasculature Myocardium1 Myocardium2 - - - - Nitrogen @@ -16433,10 +16218,6 @@ NeckArteries NeckArteries - - - - Nitrogen @@ -16699,10 +16480,6 @@ NeckVeins NeckVeins - - - - Nitrogen @@ -16965,8 +16742,6 @@ Pericardium Pericardium1 - - Nitrogen @@ -17230,825 +17005,801 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - PulmonaryArteries RightPulmonaryArteries LeftPulmonaryArteries - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryCapillaries RightPulmonaryCapillaries LeftPulmonaryCapillaries - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - - PulmonaryVeins RightPulmonaryVeins LeftPulmonaryVeins - - - - Nitrogen - - + + - - + + Oxygen - + - + - + CarbonDioxide - + - + - + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightAfferentArteriole RightAfferentArteriole - - - - Nitrogen @@ -18311,26 +18062,15 @@ RightAlveoli RightAlveoli - - - - RightAlveoliLeak RightAlveoliLeak - - - RightArmVasculature RightArm1 RightArm2 - - - - Nitrogen @@ -18594,10 +18334,6 @@ RightAtrium RightAtrium1 RightAtrium2 - - - - Nitrogen @@ -18861,10 +18597,6 @@ RightBowmansCapsules RightBowmansCapsules RightNetBowmansCapsules - - - - Nitrogen @@ -19127,25 +18859,14 @@ RightBronchi RightBronchi - - - - RightChestLeak RightChestLeak - - - RightEfferentArteriole RightEfferentArteriole - - - - Nitrogen @@ -19409,10 +19130,6 @@ RightGlomerularCapillaries RightGlomerularCapillaries RightNetGlomerularCapillaries - - - - Nitrogen @@ -19676,266 +19393,262 @@ RightHeart RightAtrium RightVentricle - - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -19945,8 +19658,6 @@ RightKidneyE3 RightKidneyL1 RightKidneyL2 - - Nitrogen @@ -20209,8 +19920,6 @@ RightKidneyTissueIntracellular RightKidneyI - - Nitrogen @@ -20475,276 +20184,269 @@ RightRenalArtery RightNephron RightRenalVein - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightLegVasculature RightLeg1 RightLeg2 - - - - Nitrogen @@ -21008,10 +20710,6 @@ RightLungPulmonary RightBronchi RightAlveoli - - - - RightLungTissueExtracellular @@ -21020,8 +20718,6 @@ RightLungE3 RightLungL1 RightLungL2 - - Nitrogen @@ -21284,8 +20980,6 @@ RightLungTissueIntracellular RightLungI - - Nitrogen @@ -21550,266 +21244,263 @@ RightPulmonaryArteries RightPulmonaryCapillaries RightPulmonaryVeins - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + @@ -21820,276 +21511,269 @@ RightPeritubularCapillaries RightBowmansCapsules RightTubules - - - Nitrogen - - + + - - + + Oxygen - - + + - - - + + + CarbonDioxide - - + + - - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + RightPeritubularCapillaries RightPeritubularCapillaries RightNetPeritubularCapillaries - - - - Nitrogen @@ -22353,19 +22037,11 @@ RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - RightPulmonaryArteries RightPulmonaryArteries RightIntermediatePulmonaryArteries - - - - Nitrogen @@ -22628,10 +22304,6 @@ RightPulmonaryCapillaries RightPulmonaryCapillaries - - - - Nitrogen @@ -22894,10 +22566,6 @@ RightPulmonaryVeins RightPulmonaryVeins - - - - Nitrogen @@ -23160,10 +22828,6 @@ RightRenalArtery RightRenalArtery - - - - Nitrogen @@ -23426,10 +23090,6 @@ RightRenalVein RightRenalVein - - - - Nitrogen @@ -23693,10 +23353,6 @@ RightTubules RightTubules RightNetTubules - - - - Nitrogen @@ -23959,10 +23615,6 @@ RightUreter RightUreter - - - - Nitrogen @@ -24226,10 +23878,6 @@ RightVentricle1 RightVentricle2 MainPulmonaryArteries - - - - Nitrogen @@ -24496,8 +24144,6 @@ SkinE3 SkinL1 SkinL2 - - Nitrogen @@ -24760,8 +24406,6 @@ SkinTissueIntracellular SkinI - - Nitrogen @@ -25025,10 +24669,6 @@ SkinVasculature Skin1 Skin2 - - - - Nitrogen @@ -25291,8 +24931,6 @@ SmallIntestineChyme SmallIntestineC1 - - Nitrogen @@ -25554,10 +25192,6 @@ SmallIntestineVasculature SmallIntestine1 - - - - Nitrogen @@ -25820,10 +25454,6 @@ SplanchnicVasculature Splanchnic1 - - - - Nitrogen @@ -26090,8 +25720,6 @@ SpleenE3 SpleenL1 SpleenL2 - - Nitrogen @@ -26354,8 +25982,6 @@ SpleenTissueIntracellular SpleenI - - Nitrogen @@ -26618,10 +26244,6 @@ SpleenVasculature Spleen1 - - - - Nitrogen @@ -26884,290 +26506,276 @@ Stomach Stomach - - - - Trachea Trachea - - - - Ureters RightUreter LeftUreter - - - - Nitrogen - - + + - - + + Oxygen - - + + - - + + + CarbonDioxide - - + + - - + + + Hemoglobin - - + + - + Oxyhemoglobin - - + + - + Carbaminohemoglobin - - + + - + OxyCarbaminohemoglobin - - + + - + Bicarbonate - - + + - + Epinephrine - - + + - + Albumin - - + + - + AminoAcids - - + + - + Calcium - - + + - + Chloride - - + + - + Creatinine - - + + - + Glucagon - - + + - + Glucose - - + + - + Insulin - - + + - + Ketones - - + + - + Lactate - - + + - + Potassium - - + + - + Sodium - - + + - + Triacylglycerol - - + + - + Urea - - + + - + Platelet - - + + - + Antigen_A - - + + - + Antigen_B - - + + - + RedBloodCell - - + + - + WhiteBloodCell - - + + - + VenaCava VenaCava - - - - Nitrogen @@ -27432,189 +27040,162 @@ AortaBleed Aorta Ground - AortaToBone Aorta1ToBone1 Aorta BoneVasculature - AortaToFat Aorta1ToFat1 Aorta FatVasculature - AortaToLargeIntestine Aorta1ToLargeIntestine Aorta LargeIntestineVasculature - AortaToLeftArm Aorta1ToLeftArm1 Aorta LeftArmVasculature - AortaToLeftKidney LeftAortaConnectionToRenalArtery Aorta LeftRenalArtery - AortaToLeftLeg Aorta1ToLeftLeg1 Aorta LeftLegVasculature - AortaToLiver Aorta1ToLiver1 Aorta LiverVasculature - AortaToMuscle Aorta1ToMuscle1 Aorta MuscleVasculature - AortaToMyocardium Aorta1ToMyocardium1 Aorta MyocardiumVasculature - AortaToNeckArteries Aorta1ToNeckArteries Aorta NeckArteries - AortaToRightArm Aorta1ToRightArm1 Aorta RightArmVasculature - AortaToRightKidney RightAortaConnectionToRenalArtery Aorta RightRenalArtery - AortaToRightLeg Aorta1ToRightLeg1 Aorta RightLegVasculature - AortaToSkin Aorta1ToSkin1 Aorta SkinVasculature - AortaToSmallIntestine Aorta1ToSmallIntestine Aorta SmallIntestineVasculature - AortaToSplanchnic Aorta1ToSplanchnic Aorta SplanchnicVasculature - AortaToSpleen Aorta1ToSpleen Aorta SpleenVasculature - BladderToGround BladderToGroundUrinate Bladder Ground - BladderToGroundSource BladderToGroundPressure Bladder Ground - BoneToVenaCava Bone2ToVenaCava BoneVasculature VenaCava - BrainHemorrhage BrainBleed CerebralCapillaries Ground - CerebralArteriesToCerebralCapillaries CerebralArteries2ToCapillaries CerebralArteries CerebralCapillaries - CerebralCapillariesToCerebralVeins CerebralCapillariesToCerebralVeins1 CerebralCapillaries CerebralVeins - CerebralVeinsToNeckVeins CerebralVeins2ToNeckVeins CerebralVeins NeckVeins - EnvironmentToLeftChestLeak EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -27627,266 +27208,228 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - FatToVenaCava Fat2ToVenaCava FatVasculature VenaCava - HeartHemorrhage MyocardiumBleed MyocardiumVasculature Ground - LargeIntestineHemorrhage LargeIntestineBleed LargeIntestineVasculature Ground - LargeIntestineToLiver LargeIntestineToPortalVein LargeIntestineVasculature LiverVasculature - LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArterioleToGlomerularCapillaries LeftAfferentArteriole LeftGlomerularCapillaries - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftArmHemorrhage LeftArmBleed LeftArmVasculature Ground - LeftArmToVenaCava LeftArm2ToVenaCava LeftArmVasculature VenaCava - LeftAtriumToLeftVentricle LeftAtrium2ToLeftVentricle1 LeftAtrium LeftVentricle - LeftBowmansCapsulesToTubules LeftBowmansCapsulesToTubules LeftBowmansCapsules LeftTubules - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArterioleToPeritubularCapillaries LeftEfferentArteriole LeftPeritubularCapillaries - LeftGlomerularCapillariesToBowmansCapsules LeftNetGlomerularCapillariesToNetBowmansCapsules LeftGlomerularCapillaries LeftBowmansCapsules - LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillariesToEfferentArteriole LeftGlomerularCapillaries LeftEfferentArteriole - LeftKidneyHemorrhage LeftKidneyBleed LeftRenalVein Ground - LeftKidneyToVenaCava LeftRenalVeinToVenaCavaConnection LeftRenalVein VenaCava - LeftLegHemorrhage LeftLegBleed LeftLegVasculature Ground - LeftLegToVenaCava LeftLeg2ToVenaCava LeftLegVasculature VenaCava - LeftLungHemorrhage LeftLungBleed LeftPulmonaryArteries Ground - LeftLungVascularToTissue LeftLungVToLeftLungE1 LeftLungVasculature LeftLungTissueExtracellular - LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillariesToRenalVein LeftPeritubularCapillaries LeftRenalVein - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - LeftPulmonaryArteriesToCapillaries LeftPulmonaryArteriesToLeftPulmonaryCapillaries LeftPulmonaryArteries LeftPulmonaryCapillaries - LeftPulmonaryArteriesToVeins LeftPulmonaryArteriesToLeftPulmonaryVeins LeftPulmonaryArteries LeftPulmonaryVeins - LeftPulmonaryCapillariesToVeins LeftPulmonaryCapillariesToLeftPulmonaryVeins LeftPulmonaryCapillaries LeftPulmonaryVeins - LeftPulmonaryVeinsToLeftAtrium LeftIntermediatePulmonaryVeinsToLeftAtrium1 LeftPulmonaryVeins LeftAtrium - LeftRenalArteryToAfferentArteriole LeftRenalArteryToAfferentArteriole LeftRenalArtery LeftAfferentArteriole - LeftTubulesToPeritubularCapillaries LeftNetTubulesToNetPeritubularCapillaries LeftTubules LeftPeritubularCapillaries - LeftTubulesToUreter LeftTubulesToUreter LeftTubules LeftUreter - LeftUreterToBladder LeftUreterToBladder LeftUreter Bladder - LeftVentricleToAorta LeftVentricle1ToAorta2 LeftVentricle Aorta - LiverHemorrhage LiverBleed LiverVasculature Ground - LiverToVenaCava Liver2ToVenaCava LiverVasculature VenaCava - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -27899,315 +27442,270 @@ Muscle2ToVenaCava MuscleVasculature VenaCava - MyocardiumToVenaCava Myocardium2ToVenaCava MyocardiumVasculature VenaCava - NeckArteriesToCerebralArteries NeckArteriesToCerebralArteries1 NeckArteries CerebralArteries - NeckVeinsToVenaCava NeckVeinsToVenaCava NeckVeins VenaCava - RightAfferentArterioleToGlomerularCapillaries RightAfferentArterioleToGlomerularCapillaries RightAfferentArteriole RightGlomerularCapillaries - RightAlveoliLeakToRightPleuralCavity RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightArmHemorrhage RightArmBleed RightArmVasculature Ground - RightArmToVenaCava RightArm2ToVenaCava RightArmVasculature VenaCava - RightAtriumToRightVentricle RightAtrium2ToRightVentricle1 RightAtrium RightVentricle - RightBowmansCapsulesToTubules RightBowmansCapsulesToTubules RightBowmansCapsules RightTubules - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightEfferentArterioleToPeritubularCapillaries RightEfferentArterioleToPeritubularCapillaries RightEfferentArteriole RightPeritubularCapillaries - RightGlomerularCapillariesToBowmansCapsules RightNetGlomerularCapillariesToNetBowmansCapsules RightGlomerularCapillaries RightBowmansCapsules - RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillariesToEfferentArteriole RightGlomerularCapillaries RightEfferentArteriole - RightKidneyHemorrhage RightKidneyBleed RightRenalVein Ground - RightKidneyToVenaCava RightRenalVeinToVenaCavaConnection RightRenalVein VenaCava - RightLegHemorrhage RightLegBleed RightLegVasculature Ground - RightLegToVenaCava RightLeg2ToVenaCava RightLegVasculature VenaCava - RightLungHemorrhage RightLungBleed RightPulmonaryArteries Ground - RightPeritubularCapillariesToRenalVein RightPeritubularCapillariesToRenalVein RightPeritubularCapillaries RightRenalVein - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - RightPulmonaryArteriesToCapillaries RightPulmonaryArteriesToRightPulmonaryCapillaries RightPulmonaryArteries RightPulmonaryCapillaries - RightPulmonaryArteriesToVeins RightPulmonaryArteriesToRightPulmonaryVeins RightPulmonaryArteries RightPulmonaryVeins - RightPulmonaryCapillariesToVeins RightPulmonaryCapillariesToRightPulmonaryVeins RightPulmonaryCapillaries RightPulmonaryVeins - RightPulmonaryVeinsToLeftAtrium RightIntermediatePulmonaryVeinsToLeftAtrium1 RightPulmonaryVeins LeftAtrium - RightRenalArteryToAfferentArteriole RightRenalArteryToAfferentArteriole RightRenalArtery RightAfferentArteriole - RightTubulesToPeritubularCapillaries RightNetTubulesToNetPeritubularCapillaries RightTubules RightPeritubularCapillaries - RightTubulesToUreter RightTubulesToUreter RightTubules RightUreter - RightUreterToBladder RightUreterToBladder RightUreter Bladder - RightVentricleToLeftPulmonaryArteries MainPulmonaryArteriesToLeftIntermediatePulmonaryArteries RightVentricle LeftPulmonaryArteries - RightVentricleToRightPulmonaryArteries MainPulmonaryArteriesToRightIntermediatePulmonaryArteries RightVentricle RightPulmonaryArteries - SkinToVenaCava Skin2ToVenaCava SkinVasculature VenaCava - SmallIntestineHemorrhage SmallIntestineBleed SmallIntestineVasculature Ground - SmallIntestineToLiver SmallIntestineToPortalVein SmallIntestineVasculature LiverVasculature - SplanchnicHemorrhage SplanchnicBleed SplanchnicVasculature Ground - SplanchnicToLiver SplanchnicToPortalVein SplanchnicVasculature LiverVasculature - SpleenHemorrhage SpleenBleed SpleenVasculature Ground - SpleenToLiver SpleenToPortalVein SpleenVasculature LiverVasculature - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VenaCavaHemorrhage VenaCavaBleed VenaCava Ground - VenaCavaIV IVToVenaCava Ground VenaCava - VenaCavaToRightAtrium VenaCavaToRightAtrium1 VenaCava RightAtrium - Nitrogen Oxygen @@ -28633,10 +28131,6 @@ Ambient Ambient - - - - Nitrogen @@ -28659,10 +28153,6 @@ AnesthesiaConnection AnesthesiaConnection - - - - Nitrogen @@ -28685,7 +28175,6 @@ Connection MechanicalVentilatorConnection - Nitrogen @@ -28708,10 +28197,6 @@ ExpiratoryLimb ExpiratoryLimb - - - - Nitrogen @@ -28734,10 +28219,6 @@ GasInlet GasInlet - - - - Nitrogen @@ -28760,10 +28241,6 @@ GasSource GasSource - - - - Nitrogen @@ -28786,10 +28263,6 @@ InspiratoryLimb InspiratoryLimb - - - - Nitrogen @@ -28812,10 +28285,6 @@ LeftAlveoli LeftAlveoli - - - - Nitrogen @@ -28838,9 +28307,6 @@ LeftAlveoliLeak LeftAlveoliLeak - - - Nitrogen @@ -28854,10 +28320,6 @@ LeftBronchi LeftBronchi - - - - Nitrogen @@ -28880,9 +28342,6 @@ LeftChestLeak LeftChestLeak - - - Nitrogen @@ -28897,37 +28356,31 @@ LeftLungPulmonary LeftBronchi LeftAlveoli - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + LeftPleuralCavity LeftPleuralCavity LeftPleuralConnection - - - - Nitrogen @@ -28950,10 +28403,6 @@ Mouth Mouth - - - - Nitrogen @@ -28976,8 +28425,6 @@ Mouthpiece Mouthpiece - - Nitrogen @@ -29000,7 +28447,6 @@ Nosepiece Nosepiece - Nitrogen @@ -29023,7 +28469,6 @@ OxygenTank OxygenTank - Nitrogen @@ -29047,62 +28492,53 @@ PleuralCavity LeftPleuralCavity RightPleuralCavity - - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + PulmonaryLungs LeftLungPulmonary RightLungPulmonary - - - + Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + ReliefValve ReliefValve - - - Nitrogen @@ -29125,10 +28561,6 @@ RightAlveoli RightAlveoli - - - - Nitrogen @@ -29151,9 +28583,6 @@ RightAlveoliLeak RightAlveoliLeak - - - Nitrogen @@ -29167,10 +28596,6 @@ RightBronchi RightBronchi - - - - Nitrogen @@ -29193,9 +28618,6 @@ RightChestLeak RightChestLeak - - - Nitrogen @@ -29210,37 +28632,30 @@ RightLungPulmonary RightBronchi RightAlveoli - - - Nitrogen - - - + + + Oxygen - - - + + + CarbonDioxide - - - + + + RightPleuralCavity RightPleuralCavity RightPleuralConnection - - - - Nitrogen @@ -29263,10 +28678,6 @@ Scrubber Scrubber - - - - Nitrogen @@ -29289,10 +28700,6 @@ Selector Selector - - - - Nitrogen @@ -29315,10 +28722,6 @@ Stomach Stomach - - - - Nitrogen @@ -29341,10 +28744,6 @@ Trachea Trachea - - - - Nitrogen @@ -29368,10 +28767,6 @@ Ventilator Ventilator VentilatorConnection - - - - Nitrogen @@ -29415,10 +28810,6 @@ YPiece YPiece - - - - Nitrogen @@ -29443,7 +28834,6 @@ AnesthesiaConnectionToEnvironment AnesthesiaConnection Ambient - ConnectionToMouth @@ -29456,14 +28846,12 @@ EnvironmentToLeftChestLeak Ambient LeftChestLeak - EnvironmentToMouth EnvironmentToMouth Ambient Mouth - EnvironmentToMouthpiece @@ -29482,98 +28870,84 @@ EnvironmentToRightChestLeak Ambient RightChestLeak - Exhaust SelectorToEnvironment Selector Ambient - ExpiratoryLimbToSelector ExpiratoryLimbToSelector ExpiratoryLimb Selector - GasInletToInspiratoryLimb GasInletToInspiratoryLimb GasInlet InspiratoryLimb - GasSourceToGasInlet GasSourceToGasInlet GasSource GasInlet - InspiratoryLimbToYPiece InspiratoryLimbToYPiece InspiratoryLimb YPiece - LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeakToLeftPleuralCavity LeftAlveoliLeak LeftPleuralCavity - LeftAlveoliToLeftAlveoliLeak LeftAlveoliToLeftAlveoliLeak LeftAlveoli LeftAlveoliLeak - LeftBronchiToAlveoli LeftBronchiToLeftAlveoli LeftBronchi LeftAlveoli - LeftChestLeakToLeftPleuralCavity LeftChestLeakToLeftPleuralCavity LeftChestLeak LeftPleuralCavity - LeftPleuralCavityToEnvironment LeftPleuralCavityToEnvironment LeftPleuralCavity Ambient - Mask AnesthesiaConnectionToMouth AnesthesiaConnection Mouth - MouthToStomach MouthToStomach Mouth Stomach - MouthToTrachea MouthToTrachea Mouth Trachea - MouthpieceToMouth @@ -29604,91 +28978,78 @@ RightAlveoliLeakToRightPleuralCavity RightAlveoliLeak RightPleuralCavity - RightAlveoliToRightAlveoliLeak RightAlveoliToRightAlveoliLeak RightAlveoli RightAlveoliLeak - RightBronchiToAlveoli RightBronchiToRightAlveoli RightBronchi RightAlveoli - RightChestLeakToRightPleuralCavity RightChestLeakToRightPleuralCavity RightChestLeak RightPleuralCavity - RightPleuralCavityToEnvironment RightPleuralCavityToEnvironment RightPleuralCavity Ambient - ScrubberToGasInlet ScrubberToGasInlet Scrubber GasInlet - SelectorToReliefValve SelectorToReliefValve Selector ReliefValve - SelectorToScrubber SelectorToScrubber Selector Scrubber - TracheaToLeftBronchi TracheaToLeftBronchi Trachea LeftBronchi - TracheaToRightBronchi TracheaToRightBronchi Trachea RightBronchi - VentilatorToSelector VentilatorConnectionToSelector Ventilator Selector - YPieceToAnesthesiaConnection YPieceToAnesthesiaConnection YPiece AnesthesiaConnection - YPieceToExpiratoryLimb YPieceToExpiratoryLimb YPiece ExpiratoryLimb - Nitrogen Oxygen @@ -29922,477 +29283,364 @@ Active Active - - - Ambient Ambient - - - Clothing Clothing - - - Enclosure Enclosure - - - ExternalCore ExternalCore - - - ExternalGround ExternalGround - - - ExternalHeadSkin ExternalHeadSkin - - - ExternalLeftArmSkin ExternalLeftArmSkin - - - ExternalLeftLegSkin ExternalLeftLegSkin - - - ExternalRightArmSkin ExternalRightArmSkin - - - ExternalRightLegSkin ExternalRightLegSkin - - - ExternalTorsoSkin ExternalTorsoSkin - - - InternalCore InternalCore InternalGround - - - - InternalGround - - InternalHeadSkin InternalHeadSkin - - - - InternalLeftArmSkin InternalLeftArmSkin - - - - InternalLeftLegSkin InternalLeftLegSkin - - - - InternalRightArmSkin InternalRightArmSkin - - - - InternalRightLegSkin InternalRightLegSkin - - - - InternalTorsoSkin InternalTorsoSkin - - - - ActiveToClothing ActiveToClothing Active Clothing - ClothingToEnclosure ClothingToEnclosure Clothing Enclosure - ClothingToEnvironment ClothingToEnvironment Clothing Ambient - ExternalCoreToGround ExternalCoreToGround ExternalCore ExternalGround - ExternalHeadSkinToClothing ExternalHeadSkinToClothing ExternalHeadSkin Clothing - ExternalHeadSkinToGround ExternalHeadSkinToGround ExternalHeadSkin ExternalGround - ExternalLeftArmSkinToClothing ExternalLeftArmSkinToClothing ExternalLeftArmSkin Clothing - ExternalLeftArmSkinToGround ExternalLeftArmSkinToGround ExternalLeftArmSkin ExternalGround - ExternalLeftLegSkinToClothing ExternalLeftLegSkinToClothing ExternalLeftLegSkin Clothing - ExternalLeftLegSkinToGround ExternalLeftLegSkinToGround ExternalLeftLegSkin ExternalGround - ExternalRightArmSkinToClothing ExternalRightArmSkinToClothing ExternalRightArmSkin Clothing - ExternalRightArmSkinToGround ExternalRightArmSkinToGround ExternalRightArmSkin ExternalGround - ExternalRightLegSkinToClothing ExternalRightLegSkinToClothing ExternalRightLegSkin Clothing - ExternalRightLegSkinToGround ExternalRightLegSkinToGround ExternalRightLegSkin ExternalGround - ExternalTorsoSkinToClothing ExternalTorsoSkinToClothing ExternalTorsoSkin Clothing - ExternalTorsoSkinToGround ExternalTorsoSkinToGround ExternalTorsoSkin ExternalGround - GroundToActive GroundToActive ExternalGround Active - GroundToClothing GroundToClothing ExternalGround Clothing - GroundToEnclosure GroundToEnclosure ExternalGround Enclosure - GroundToEnvironment GroundToEnvironment ExternalGround Ambient - GroundToInternalCore GroundToInternalCore InternalGround InternalCore - GroundToInternalHeadSkin GroundToInternalHeadSkin InternalGround InternalHeadSkin - GroundToInternalLeftArmSkin GroundToInternalLeftArmSkin InternalGround InternalLeftArmSkin - GroundToInternalLeftLegSkin GroundToInternalLeftLegSkin InternalGround InternalLeftLegSkin - GroundToInternalRightArmSkin GroundToInternalRightArmSkin InternalGround InternalRightArmSkin - GroundToInternalRightLegSkin GroundToInternalRightLegSkin InternalGround InternalRightLegSkin - GroundToInternalTorsoSkin GroundToInternalTorsoSkin InternalGround InternalTorsoSkin - InternalCoreToExternalCore InternalCoreToExternalCore InternalCore ExternalCore - InternalCoreToGround InternalCoreToGround InternalGround InternalCore - InternalCoreToInternalHeadSkin InternalCoreToInternalHeadSkin InternalCore InternalHeadSkin - InternalCoreToInternalLeftArmSkin InternalCoreToInternalLeftArmSkin InternalCore InternalLeftArmSkin - InternalCoreToInternalLeftLegSkin InternalCoreToInternalLeftLegSkin InternalCore InternalLeftLegSkin - InternalCoreToInternalRightArmSkin InternalCoreToInternalRightArmSkin InternalCore InternalRightArmSkin - InternalCoreToInternalRightLegSkin InternalCoreToInternalRightLegSkin InternalCore InternalRightLegSkin - InternalCoreToInternalTorsoSkin InternalCoreToInternalTorsoSkin InternalCore InternalTorsoSkin - InternalHeadSkinToExternalHeadSkin InternalHeadSkinToExternalHeadSkin InternalHeadSkin ExternalHeadSkin - InternalHeadSkinToGround InternalHeadSkinToTemperatureGround InternalGround InternalHeadSkin - InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkinToExternalLeftArmSkin InternalLeftArmSkin ExternalLeftArmSkin - InternalLeftArmSkinToGround InternalLeftArmSkinToTemperatureGround InternalGround InternalLeftArmSkin - InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkinToExternalLeftLegSkin InternalLeftLegSkin ExternalLeftLegSkin - InternalLeftLegSkinToGround InternalLeftLegSkinToTemperatureGround InternalGround InternalLeftLegSkin - InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkinToExternalRightArmSkin InternalRightArmSkin ExternalRightArmSkin - InternalRightArmSkinToGround InternalRightArmSkinToTemperatureGround InternalGround InternalRightArmSkin - InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkinToExternalRightLegSkin InternalRightLegSkin ExternalRightLegSkin - InternalRightLegSkinToGround InternalRightLegSkinToTemperatureGround InternalGround InternalRightLegSkin - InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkinToExternalTorsoSkin InternalTorsoSkin ExternalTorsoSkin - InternalTorsoSkinToGround InternalTorsoSkinToTemperatureGround InternalGround InternalTorsoSkin - BoneTissue @@ -30566,7 +29814,6 @@ - Off @@ -30975,7 +30222,6 @@ - @@ -31002,15 +30248,15 @@ On - + - + - + - + @@ -32357,7 +31603,6 @@ - Extrasplanchnic @@ -32368,7 +31613,6 @@ - Extrasplanchnic @@ -32389,7 +31633,6 @@ - Splanchnic @@ -32400,7 +31643,6 @@ - Extrasplanchnic @@ -32418,7 +31660,6 @@ - Extrasplanchnic @@ -32429,7 +31670,6 @@ - Splanchnic @@ -32440,7 +31680,6 @@ - Muscle @@ -32451,7 +31690,6 @@ - Myocardium @@ -32462,7 +31700,6 @@ - Cerebral @@ -32473,7 +31710,6 @@ - Extrasplanchnic @@ -32491,7 +31727,6 @@ - Extrasplanchnic @@ -32502,7 +31737,6 @@ - Extrasplanchnic @@ -32513,7 +31747,6 @@ - Splanchnic @@ -32524,7 +31757,6 @@ - Splanchnic @@ -32535,7 +31767,6 @@ - Splanchnic @@ -32593,7 +31824,6 @@ - Extrasplanchnic @@ -32826,7 +32056,6 @@ - Cerebral @@ -32847,7 +32076,6 @@ - Cerebral @@ -32868,7 +32096,6 @@ - Cerebral @@ -32982,7 +32209,6 @@ - Extrasplanchnic @@ -33265,7 +32491,6 @@ - Splanchnic @@ -33344,7 +32569,6 @@ - Extrasplanchnic @@ -33628,7 +32852,6 @@ - Extrasplanchnic @@ -34001,7 +33224,6 @@ - Splanchnic @@ -34206,7 +33428,6 @@ - Muscle @@ -34323,7 +33544,6 @@ - Myocardium @@ -34440,7 +33660,6 @@ - Cerebral @@ -34471,7 +33690,6 @@ - Cerebral @@ -34515,7 +33733,6 @@ - Splanchnic @@ -34589,7 +33806,6 @@ - Extrasplanchnic @@ -34873,7 +34089,6 @@ - Extrasplanchnic @@ -35285,7 +34500,6 @@ - Extrasplanchnic @@ -35432,7 +34646,6 @@ - Splanchnic @@ -35493,7 +34706,6 @@ - Splanchnic @@ -35613,7 +34825,6 @@ - Splanchnic diff --git a/share/data/templates/Generator/Population.template.xml b/share/data/templates/Generator/Population.template.xml index 85870b95d..a4e4d8b0b 100644 --- a/share/data/templates/Generator/Population.template.xml +++ b/share/data/templates/Generator/Population.template.xml @@ -180,7 +180,7 @@ YoungAdult + min="18" max="31" unit="yr">YoungAdult Adult Insult: Severe acute asthma attack - + diff --git a/share/xsd/biogears/BioGearsEquipment.xsd b/share/xsd/biogears/BioGearsEquipment.xsd index 82cb92c06..390b7e211 100644 --- a/share/xsd/biogears/BioGearsEquipment.xsd +++ b/share/xsd/biogears/BioGearsEquipment.xsd @@ -34,8 +34,8 @@ specific language governing permissions and limitations under the License. - - + + diff --git a/share/xsd/cdm/PatientActions.xsd b/share/xsd/cdm/PatientActions.xsd index b3db5b604..907defdd7 100644 --- a/share/xsd/cdm/PatientActions.xsd +++ b/share/xsd/cdm/PatientActions.xsd @@ -234,6 +234,18 @@ specific language governing permissions and limitations under the License. + + + + + + + + + + + + @@ -407,6 +419,40 @@ specific language governing permissions and limitations under the License. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -423,7 +469,19 @@ specific language governing permissions and limitations under the License. + + + + + + + + + + + +