Updates will be applied on October 27th between 12pm - 12:45pm EDT (UTC-0400). Gitlab may be slow during the maintenance window.

Commit 50b630c9 authored by Aaron Bray's avatar Aaron Bray
Browse files

Update new hemorrhage severity scenarios with new system properties

parent 10b5740f
......@@ -32,5 +32,8 @@ Macro EngineUnitTestFull=EngineUnitTestDriver FullPlot Baseline=unit_tests/pulse
Macro ScenarioTest=ScenarioTestDriver FastPlot Baseline=scenarios/ Computed=./test_results/scenarios
#patient/BasicStandard.json = ScenarioTest
miscellaneous/Comprehensive.json = ScenarioTest
patient/HemorrhageSeverity1.json = ScenarioTest
patient/HemorrhageSeverityMultipleCompartments.json = ScenarioTest
patient/HemorrhageSeverityToFlowToSeverity.json = ScenarioTest
patient/HemorrhageVaryingSeverity.json = ScenarioTest
......@@ -68,7 +68,8 @@ patient/HemorrhageGroup4.json = ScenarioTest
patient/HemorrhageGroup5.json = ScenarioTest
patient/HemorrhageGroup6.json = ScenarioTest
patient/HemorrhageSeverity1.json = ScenarioTest
patient/HemorrhageSeverityToFlowToSeverity.json
patient/HemorrhageSeverityMultipleCompartments.json = ScenarioTest
patient/HemorrhageSeverityToFlowToSeverity.json = ScenarioTest
patient/HemorrhageToShock.json = ScenarioTest
patient/HemorrhageVaryingSeverity.json = ScenarioTest
patient/LobarPneumoniaExacerbation.json = ScenarioTest
......
......@@ -62,7 +62,9 @@
{ "DecimalFormat": { "Precision": 6 }, "Category": "Substance", "SubstanceName": "Epinephrine", "PropertyName": "BloodConcentration", "Unit": "ug/L" },
{ "DecimalFormat": { "Precision": 8 }, "Category": "Substance", "SubstanceName": "Epinephrine", "PropertyName": "SystemicMassCleared", "Unit": "ug" },
{ "DecimalFormat": { "Precision": 3 }, "Category": "Physiology", "PropertyName": "SystemicVascularResistance", "Unit": "mmHg s/mL"}
{ "DecimalFormat": { "Precision": 3 }, "Category": "Physiology", "PropertyName": "SystemicVascularResistance", "Unit": "mmHg s/mL"},
{ "DecimalFormat": { "Precision": 3 }, "Category": "Physiology", "PropertyName": "TotalHemorrhageRate", "Unit": "mL/s"},
{ "DecimalFormat": { "Precision": 3 }, "Category": "Physiology", "PropertyName": "TotalHemorrhagedVolume", "Unit": "mL"}
]
},
"AnyAction": [{
......
......@@ -62,7 +62,9 @@
{ "DecimalFormat": { "Precision": 6 }, "Category": "Substance", "SubstanceName": "Epinephrine", "PropertyName": "BloodConcentration", "Unit": "ug/L" },
{ "DecimalFormat": { "Precision": 8 }, "Category": "Substance", "SubstanceName": "Epinephrine", "PropertyName": "SystemicMassCleared", "Unit": "ug" },
{ "DecimalFormat": { "Precision": 3 }, "Category": "Physiology", "PropertyName": "SystemicVascularResistance", "Unit": "mmHg s/mL"}
{ "DecimalFormat": { "Precision": 3 }, "Category": "Physiology", "PropertyName": "SystemicVascularResistance", "Unit": "mmHg s/mL"},
{ "DecimalFormat": { "Precision": 3 }, "Category": "Physiology", "PropertyName": "TotalHemorrhageRate", "Unit": "mL/s"},
{ "DecimalFormat": { "Precision": 3 }, "Category": "Physiology", "PropertyName": "TotalHemorrhagedVolume", "Unit": "mL"}
]
},
"AnyAction": [{
......
......@@ -62,7 +62,9 @@
{ "DecimalFormat": { "Precision": 6 }, "Category": "Substance", "SubstanceName": "Epinephrine", "PropertyName": "BloodConcentration", "Unit": "ug/L" },
{ "DecimalFormat": { "Precision": 8 }, "Category": "Substance", "SubstanceName": "Epinephrine", "PropertyName": "SystemicMassCleared", "Unit": "ug" },
{ "DecimalFormat": { "Precision": 3 }, "Category": "Physiology", "PropertyName": "SystemicVascularResistance", "Unit": "mmHg s/mL"}
{ "DecimalFormat": { "Precision": 3 }, "Category": "Physiology", "PropertyName": "SystemicVascularResistance", "Unit": "mmHg s/mL"},
{ "DecimalFormat": { "Precision": 3 }, "Category": "Physiology", "PropertyName": "TotalHemorrhageRate", "Unit": "mL/s"},
{ "DecimalFormat": { "Precision": 3 }, "Category": "Physiology", "PropertyName": "TotalHemorrhagedVolume", "Unit": "mL"}
]
},
"AnyAction": [{
......
......@@ -62,7 +62,9 @@
{ "DecimalFormat": { "Precision": 6 }, "Category": "Substance", "SubstanceName": "Epinephrine", "PropertyName": "BloodConcentration", "Unit": "ug/L" },
{ "DecimalFormat": { "Precision": 8 }, "Category": "Substance", "SubstanceName": "Epinephrine", "PropertyName": "SystemicMassCleared", "Unit": "ug" },
{ "DecimalFormat": { "Precision": 3 }, "Category": "Physiology", "PropertyName": "SystemicVascularResistance", "Unit": "mmHg s/mL"}
{ "DecimalFormat": { "Precision": 3 }, "Category": "Physiology", "PropertyName": "SystemicVascularResistance", "Unit": "mmHg s/mL"},
{ "DecimalFormat": { "Precision": 3 }, "Category": "Physiology", "PropertyName": "TotalHemorrhageRate", "Unit": "mL/s"},
{ "DecimalFormat": { "Precision": 3 }, "Category": "Physiology", "PropertyName": "TotalHemorrhagedVolume", "Unit": "mL"}
]
},
"AnyAction": [{
......
......@@ -216,6 +216,10 @@ void PBPhysiology::Serialize(const CDM_BIND::CardiovascularSystemData& src, SECa
PBProperty::Load(src.systemicvascularresistance(), dst.GetSystemicVascularResistance());
if (src.has_systolicarterialpressure())
PBProperty::Load(src.systolicarterialpressure(), dst.GetSystolicArterialPressure());
if (src.has_totalhemorrhagerate())
PBProperty::Load(src.totalhemorrhagerate(), dst.GetTotalHemorrhageRate());
if (src.has_totalhemorrhagedvolume())
PBProperty::Load(src.totalhemorrhagedvolume(), dst.GetTotalHemorrhagedVolume());
}
CDM_BIND::CardiovascularSystemData* PBPhysiology::Unload(const SECardiovascularSystem& src)
......@@ -285,6 +289,10 @@ void PBPhysiology::Serialize(const SECardiovascularSystem& src, CDM_BIND::Cardio
dst.set_allocated_systemicvascularresistance(PBProperty::Unload(*src.m_SystemicVascularResistance));
if (src.HasSystolicArterialPressure())
dst.set_allocated_systolicarterialpressure(PBProperty::Unload(*src.m_SystolicArterialPressure));
if (src.HasTotalHemorrhageRate())
dst.set_allocated_totalhemorrhagerate(PBProperty::Unload(*src.m_TotalHemorrhageRate));
if (src.HasTotalHemorrhagedVolume())
dst.set_allocated_totalhemorrhagedvolume(PBProperty::Unload(*src.m_TotalHemorrhagedVolume));
}
......
......@@ -46,6 +46,8 @@ SECardiovascularSystem::SECardiovascularSystem(Logger* logger) : SESystem(logger
m_PulsePressure = nullptr;
m_SystemicVascularResistance = nullptr;
m_SystolicArterialPressure = nullptr;
m_TotalHemorrhageRate = nullptr;
m_TotalHemorrhagedVolume = nullptr;
}
SECardiovascularSystem::~SECardiovascularSystem()
......@@ -82,6 +84,8 @@ SECardiovascularSystem::~SECardiovascularSystem()
SAFE_DELETE(m_PulsePressure);
SAFE_DELETE(m_SystemicVascularResistance);
SAFE_DELETE(m_SystolicArterialPressure);
SAFE_DELETE(m_TotalHemorrhageRate);
SAFE_DELETE(m_TotalHemorrhagedVolume);
}
void SECardiovascularSystem::Clear()
......@@ -116,6 +120,8 @@ void SECardiovascularSystem::Clear()
INVALIDATE_PROPERTY(m_PulsePressure);
INVALIDATE_PROPERTY(m_SystemicVascularResistance);
INVALIDATE_PROPERTY(m_SystolicArterialPressure);
INVALIDATE_PROPERTY(m_TotalHemorrhageRate);
INVALIDATE_PROPERTY(m_TotalHemorrhagedVolume);
}
const SEScalar* SECardiovascularSystem::GetScalar(const std::string& name)
......@@ -178,6 +184,10 @@ const SEScalar* SECardiovascularSystem::GetScalar(const std::string& name)
return &GetSystemicVascularResistance();
if (name.compare("SystolicArterialPressure") == 0)
return &GetSystolicArterialPressure();
if (name.compare("TotalHemorrhageRate") == 0)
return &GetTotalHemorrhageRate();
if (name.compare("TotalHemorrhagedVolume") == 0)
return &GetTotalHemorrhagedVolume();
return nullptr;
}
......@@ -682,3 +692,37 @@ double SECardiovascularSystem::GetSystolicArterialPressure(const PressureUnit& u
return SEScalar::dNaN();
return m_SystolicArterialPressure->GetValue(unit);
}
bool SECardiovascularSystem::HasTotalHemorrhageRate() const
{
return m_TotalHemorrhageRate == nullptr ? false : m_TotalHemorrhageRate->IsValid();
}
SEScalarVolumePerTime& SECardiovascularSystem::GetTotalHemorrhageRate()
{
if (m_TotalHemorrhageRate == nullptr)
m_TotalHemorrhageRate = new SEScalarVolumePerTime();
return *m_TotalHemorrhageRate;
}
double SECardiovascularSystem::GetTotalHemorrhageRate(const VolumePerTimeUnit& unit) const
{
if (m_TotalHemorrhageRate == nullptr)
return SEScalar::dNaN();
return m_TotalHemorrhageRate->GetValue(unit);
}
bool SECardiovascularSystem::HasTotalHemorrhagedVolume() const
{
return m_TotalHemorrhagedVolume == nullptr ? false : m_TotalHemorrhagedVolume->IsValid();
}
SEScalarVolume& SECardiovascularSystem::GetTotalHemorrhagedVolume()
{
if (m_TotalHemorrhagedVolume == nullptr)
m_TotalHemorrhagedVolume = new SEScalarVolume();
return *m_TotalHemorrhagedVolume;
}
double SECardiovascularSystem::GetTotalHemorrhagedVolume(const VolumeUnit& unit) const
{
if (m_TotalHemorrhagedVolume == nullptr)
return SEScalar::dNaN();
return m_TotalHemorrhagedVolume->GetValue(unit);
}
......@@ -131,13 +131,21 @@ public:
virtual SEScalarPressure& GetPulsePressure();
virtual double GetPulsePressure(const PressureUnit& unit) const;
virtual bool HasSystemicVascularResistance() const;
virtual SEScalarPressureTimePerVolume& GetSystemicVascularResistance();
virtual double GetSystemicVascularResistance(const PressureTimePerVolumeUnit& unit) const;
virtual bool HasSystolicArterialPressure() const;
virtual SEScalarPressure& GetSystolicArterialPressure();
virtual double GetSystolicArterialPressure(const PressureUnit& unit) const;
virtual bool HasSystemicVascularResistance() const;
virtual SEScalarPressureTimePerVolume& GetSystemicVascularResistance();
virtual double GetSystemicVascularResistance(const PressureTimePerVolumeUnit& unit) const;
virtual bool HasTotalHemorrhageRate() const;
virtual SEScalarVolumePerTime& GetTotalHemorrhageRate();
virtual double GetTotalHemorrhageRate(const VolumePerTimeUnit& unit) const;
virtual bool HasTotalHemorrhagedVolume() const;
virtual SEScalarVolume& GetTotalHemorrhagedVolume();
virtual double GetTotalHemorrhagedVolume(const VolumeUnit& unit) const;
protected:
......@@ -171,4 +179,6 @@ protected:
SEScalarPressure* m_PulsePressure;
SEScalarPressure* m_SystolicArterialPressure;
SEScalarPressureTimePerVolume* m_SystemicVascularResistance;
SEScalarVolumePerTime* m_TotalHemorrhageRate;
SEScalarVolume* m_TotalHemorrhagedVolume;
};
\ No newline at end of file
......@@ -213,7 +213,6 @@ void Cardiovascular::Initialize()
//Initialize system data based on patient file inputs
GetBloodVolume().Set(m_data.GetCurrentPatient().GetBloodVolumeBaseline());
m_BloodVolumeEstimate = m_data.GetCurrentPatient().GetBloodVolumeBaseline().GetValue(VolumeUnit::mL);
m_CardiacCycleAortaPressureHigh_mmHg = m_data.GetCurrentPatient().GetSystolicArterialPressureBaseline(PressureUnit::mmHg);
m_CardiacCycleAortaPressureLow_mmHg = m_data.GetCurrentPatient().GetDiastolicArterialPressureBaseline(PressureUnit::mmHg);
GetMeanArterialPressure().SetValue((2. / 3.*m_CardiacCycleAortaPressureLow_mmHg) + (1. / 3.*m_CardiacCycleAortaPressureHigh_mmHg), PressureUnit::mmHg);
......@@ -254,8 +253,6 @@ void Cardiovascular::Initialize()
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, PressureTimePerVolumeUnit::mmHg_s_Per_mL);
//Debugging
m_CardiacOutputBaseline = m_CardiacOutput->GetValue(VolumePerTimeUnit::L_Per_min);
}
//--------------------------------------------------------------------------------------------------
......@@ -1334,10 +1331,8 @@ void Cardiovascular::Hemorrhage()
//Effect the Aorta with internal hemorrhages
InternalHemorrhagePressureApplication();
//Debugging hemorrhage
m_BloodVolumeEstimate -= (TotalLossRate_mL_Per_s * m_dT_s);
m_data.GetDataTrack().Probe("BloodLossRate", TotalLossRate_mL_Per_s);
m_data.GetDataTrack().Probe("BloodVolumeEstimate", m_BloodVolumeEstimate);
GetTotalHemorrhageRate().SetValue(TotalLossRate_mL_Per_s, VolumePerTimeUnit::mL_Per_s);
GetTotalHemorrhagedVolume().IncrementValue((TotalLossRate_mL_Per_s* m_dT_s), VolumeUnit::mL);
}
//--------------------------------------------------------------------------------------------------
......
......@@ -107,8 +107,8 @@ protected:
double m_CompressionRatio;
double m_CompressionPeriod_s;
//Hemorrhage
std::vector<SEFluidCircuitPath*> m_HemorrhagePaths;
std::vector<SELiquidCompartmentLink*> m_HemorrhageLinks;
std::vector<SEFluidCircuitPath*> m_HemorrhagePaths;
// Vitals and Averages
double m_CurrentCardiacCycleTime_s;
double m_CardiacCycleDiastolicVolume_mL; // Maximum left heart volume for the current cardiac cycle
......@@ -209,8 +209,4 @@ protected:
std::vector<SEFluidCircuitPath*> m_systemicResistancePaths;
std::vector<SEFluidCircuitPath*> m_systemicCompliancePaths;
//debugging hemorrhage
double m_BloodVolumeEstimate;
double m_CardiacOutputBaseline;
};
......@@ -97,6 +97,8 @@ message CardiovascularSystemData
ScalarPressureData PulsePressure = 28;/**<< @brief The difference between the systolic and diastolic pressures.*/
ScalarPressureTimePerVolumeData SystemicVascularResistance = 29;/**<< @brief The resistance to blood flow through the entire systemic vasculature, not including the pulmonary circulation.*/
ScalarPressureData SystolicArterialPressure = 30;/**<< @brief The maximum pressure in the aorta over the course of a cardiac cycle.*/
ScalarVolumePerTimeData TotalHemorrhageRate = 31;/**<< @brief The total rate of blood loss due to all active hemorrhages.*/
ScalarVolumeData TotalHemorrhagedVolume = 32;/**<< @brief The total amount of blood lost due to all hemorrhages.*/
}
/** @brief Provides transport of drugs through the blood and air in the cardiovascular and respiratory systems, respectively.
......
......@@ -55,8 +55,6 @@ message CardiovascularData
repeated string HemorrhageLinks = 33;
repeated string HemorrhagePaths = 34;
repeated string InternalHemorrhageLinks = 35;
repeated string InternalHemorrhagePaths = 36;
}
message DrugData
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment