Commit 08fd71f3 authored by Jeff Webb's avatar Jeff Webb
Browse files

Revamped the Mechanical Ventilator and added new VC-AC mode.

parent d8a0ccbc
......@@ -125,6 +125,7 @@ equipment/MainstemIntubation.json = ScenarioTest
equipment/MechanicalVentilation.json = ScenarioTest
equipment/MechanicalVentilatorPressureControlledARDS.json = ScenarioTest
equipment/MechanicalVentilatorPressureControlledVaried.json = ScenarioTest
equipment/MechanicalVentilatorVolumeControlledARDS.json = ScenarioTest
equipment/NasalCannula.json = ScenarioTest
equipment/NonRebreatherMask.json = ScenarioTest
equipment/SimpleMask.json = ScenarioTest
......
......@@ -115,7 +115,7 @@
"ExpirationWaveform": "Square",
"PeakInspiratoryPressure": { "ScalarPressure": { "Value": 20.0, "Unit": "cmH2O" } },
"PositiveEndExpiredPressure": { "ScalarPressure": { "Value": 8.0, "Unit": "cmH2O" } },
"InspirationTriggerTime": { "ScalarTime": { "Value": 2.0, "Unit": "s" } },
"InspirationMachineTriggerTime": { "ScalarTime": { "Value": 2.0, "Unit": "s" } },
"ExpirationCycleTime": { "ScalarTime": { "Value": 1.0, "Unit": "s" } },
"FractionInspiredGas": [
{ "Name": "Oxygen", "Amount": { "Scalar0To1": { "Value": 0.25, "Unit": "" } } }
......@@ -147,7 +147,7 @@
"ExpirationWaveform": "Square",
"PeakInspiratoryPressure": { "ScalarPressure": { "Value": 25.0, "Unit": "cmH2O" } },
"PositiveEndExpiredPressure": { "ScalarPressure": { "Value": 10.0, "Unit": "cmH2O" } },
"InspirationTriggerTime": { "ScalarTime": { "Value": 2.0, "Unit": "s" } },
"InspirationMachineTriggerTime": { "ScalarTime": { "Value": 2.0, "Unit": "s" } },
"ExpirationCycleTime": { "ScalarTime": { "Value": 1.0, "Unit": "s" } },
"FractionInspiredGas": [
{ "Name": "Oxygen", "Amount": { "Scalar0To1": { "Value": 0.5, "Unit": "" } } }
......@@ -179,7 +179,7 @@
"ExpirationWaveform": "Square",
"PeakInspiratoryPressure": { "ScalarPressure": { "Value": 32.0, "Unit": "cmH2O" } },
"PositiveEndExpiredPressure": { "ScalarPressure": { "Value": 15.0, "Unit": "cmH2O" } },
"InspirationTriggerTime": { "ScalarTime": { "Value": 2.0, "Unit": "s" } },
"InspirationMachineTriggerTime": { "ScalarTime": { "Value": 2.0, "Unit": "s" } },
"ExpirationCycleTime": { "ScalarTime": { "Value": 1.0, "Unit": "s" } },
"FractionInspiredGas": [
{ "Name": "Oxygen", "Amount": { "Scalar0To1": { "Value": 0.9995, "Unit": "" } } }
......
......@@ -109,7 +109,7 @@
"ExpirationWaveform": "Square",
"PeakInspiratoryPressure": { "ScalarPressure": { "Value": 10.0, "Unit": "cmH2O" } },
"PositiveEndExpiredPressure": { "ScalarPressure": { "Value": 5.0, "Unit": "cmH2O" } },
"InspirationTriggerTime": { "ScalarTime": { "Value": 3.33, "Unit": "s" } },
"InspirationMachineTriggerTime": { "ScalarTime": { "Value": 3.33, "Unit": "s" } },
"ExpirationCycleTime": { "ScalarTime": { "Value": 1.67, "Unit": "s" } },
"FractionInspiredGas": [
{ "Name": "Nitrogen", "Amount": { "Scalar0To1": { "Value": 0.7896, "Unit": "" } } },
......@@ -137,7 +137,7 @@
"ExpirationWaveform": "Square",
"PeakInspiratoryPressure": { "ScalarPressure": { "Value": 20.0, "Unit": "cmH2O" } },
"PositiveEndExpiredPressure": { "ScalarPressure": { "Value": 10.0, "Unit": "cmH2O" } },
"InspirationTriggerTime": { "ScalarTime": { "Value": 1.5, "Unit": "s" } },
"InspirationMachineTriggerTime": { "ScalarTime": { "Value": 1.5, "Unit": "s" } },
"ExpirationCycleTime": { "ScalarTime": { "Value": 1.5, "Unit": "s" } },
"FractionInspiredGas": [
{ "Name": "Oxygen", "Amount": { "Scalar0To1": { "Value": 0.3, "Unit": "" } } } ],
......
{
"Name": "MechanicalVentilatorVolumeControlledARDS",
"Description": "Apply a VC-AC mode ventilator to treat a patient with ARDS.",
"PatientConfiguration": { "PatientFile": "StandardMale.json",
"Conditions": { "AnyCondition": [ {
"PatientCondition": {
"AcuteRespiratoryDistressSyndrome": {
"Severity": { "Scalar0To1": { "Value": 0.6 } },
"LeftLungAffected": { "Scalar0To1": { "Value": 1.0 } },
"RightLungAffected": { "Scalar0To1": { "Value": 1.0 } } } } }
] }
},
"DataRequestManager":
{
"DataRequest":
[
{ "DecimalFormat": { "Precision": 1 }, "PropertyName": "Weight", "Unit": "kg" },
{ "DecimalFormat": { "Precision": 2 }, "Category": "Physiology", "PropertyName": "HeartRate", "Unit": "1/min" },
{ "DecimalFormat": { "Precision": 1 }, "Category": "Physiology", "PropertyName": "HeartStrokeVolume", "Unit": "mL" },
{ "DecimalFormat": { "Precision": 2 }, "Category": "Physiology", "PropertyName": "BloodVolume", "Unit": "L" },
{ "DecimalFormat": { "Precision": 1 }, "Category": "Physiology", "PropertyName": "ExtravascularFluidVolume", "Unit": "L" },
{ "DecimalFormat": { "Precision": 1 }, "Category": "Physiology", "PropertyName": "ArterialPressure", "Unit": "mmHg" },
{ "DecimalFormat": { "Precision": 1 }, "Category": "Physiology", "PropertyName": "MeanArterialPressure", "Unit": "mmHg" },
{ "DecimalFormat": { }, "Category": "Physiology", "PropertyName": "SystolicArterialPressure", "Unit": "mmHg" },
{ "DecimalFormat": { "Precision": 1 }, "Category": "Physiology", "PropertyName": "DiastolicArterialPressure", "Unit": "mmHg" },
{ "DecimalFormat": { "Precision": 2 }, "Category": "Physiology", "PropertyName": "CardiacOutput", "Unit": "L/min" },
{ "DecimalFormat": { }, "Category": "Physiology", "PropertyName": "HemoglobinContent", "Unit": "g" },
{ "DecimalFormat": { "Precision": 2 }, "Category": "Physiology", "PropertyName": "CentralVenousPressure", "Unit": "mmHg" },
{ "DecimalFormat": { "Precision": 2 }, "Category": "Physiology", "PropertyName": "PulmonaryCapillariesWedgePressure", "Unit": "mmHg" },
{ "DecimalFormat": { "Precision": 3 }, "Category": "Physiology", "PropertyName": "TidalVolume", "Unit": "mL" },
{ "DecimalFormat": { "Precision": 2 }, "Category": "Physiology", "PropertyName": "TotalLungVolume", "Unit": "L" },
{ "DecimalFormat": { "Precision": 2 }, "Category": "Physiology", "PropertyName": "RespirationRate", "Unit": "1/min" },
{ "DecimalFormat": { "Precision": 3 }, "Category": "Physiology", "PropertyName": "OxygenSaturation", "Unit": "unitless" },
{ "DecimalFormat": { "Precision": 3 }, "Category": "Physiology", "PropertyName": "CarbonDioxideSaturation", "Unit": "unitless" },
{ "DecimalFormat": { "Precision": 4 }, "Category": "Physiology", "PropertyName": "EndTidalCarbonDioxideFraction", "Unit": "unitless" },
{ "DecimalFormat": { "Precision": 2 }, "Category": "Physiology", "PropertyName": "TotalAlveolarVentilation", "Unit": "L/min" },
{ "DecimalFormat": { "Precision": 2 }, "Category": "Physiology", "PropertyName": "TranspulmonaryPressure", "Unit": "cmH2O" },
{ "DecimalFormat": { "Precision": 1 }, "Category": "Physiology", "PropertyName": "CoreTemperature", "Unit": "degC" },
{ "DecimalFormat": { "Precision": 1 }, "Category": "Physiology", "PropertyName": "SkinTemperature", "Unit": "degC" },
{ "DecimalFormat": { "Precision": 3 }, "Category": "Physiology", "PropertyName": "RespiratoryExchangeRatio", "Unit": "unitless" },
{ "DecimalFormat": { }, "Category": "Physiology", "PropertyName": "OxygenConsumptionRate", "Unit": "mL/min" },
{ "DecimalFormat": { }, "Category": "Physiology", "PropertyName": "CarbonDioxideProductionRate", "Unit": "mL/min" },
{ "DecimalFormat": { }, "Category": "Physiology", "PropertyName": "GlomerularFiltrationRate", "Unit": "mL/min" },
{ "DecimalFormat": { "Precision": 2 }, "Category": "Physiology", "PropertyName": "RenalBloodFlow", "Unit": "L/min" },
{ "DecimalFormat": { "Precision": 3 }, "Category": "Physiology", "PropertyName": "UrineProductionRate", "Unit": "mL/min" },
{ "DecimalFormat": { "Precision": 4 }, "Category": "Physiology", "PropertyName": "LeftAfferentArterioleResistance", "Unit": "mmHg min/mL" },
{ "DecimalFormat": { "Precision": 4 }, "Category": "Physiology", "PropertyName": "RightAfferentArterioleResistance", "Unit": "mmHg min/mL" },
{ "DecimalFormat": { }, "Category": "GasCompartment", "CompartmentName": "LeftAlveoli", "PropertyName": "Pressure", "Unit": "cmH2O" },
{ "DecimalFormat": { }, "Category": "GasCompartment", "CompartmentName": "RightAlveoli", "PropertyName": "Pressure", "Unit": "cmH2O" },
{ "DecimalFormat": { }, "Category": "GasCompartment", "CompartmentName": "LeftAlveoli", "SubstanceName": "Oxygen", "PropertyName": "PartialPressure", "Unit": "mmHg" },
{ "DecimalFormat": { "Precision": 1 }, "Category": "GasCompartment", "CompartmentName": "LeftAlveoli", "SubstanceName": "CarbonDioxide", "PropertyName": "PartialPressure", "Unit": "mmHg" },
{ "DecimalFormat": { }, "Category": "GasCompartment", "CompartmentName": "RightAlveoli", "SubstanceName": "Oxygen", "PropertyName": "PartialPressure", "Unit": "mmHg" },
{ "DecimalFormat": { "Precision": 1 }, "Category": "GasCompartment", "CompartmentName": "RightAlveoli", "SubstanceName": "CarbonDioxide", "PropertyName": "PartialPressure", "Unit": "mmHg"},
{ "DecimalFormat": { }, "Category": "GasCompartment", "CompartmentName": "Carina", "SubstanceName": "Oxygen", "PropertyName": "PartialPressure", "Unit": "cmH2O" },
{ "DecimalFormat": { "Precision": 1 }, "Category": "GasCompartment", "CompartmentName": "Carina", "SubstanceName": "CarbonDioxide", "PropertyName": "PartialPressure", "Unit": "cmH2O" },
{ "DecimalFormat": { "Precision": 1 }, "Category": "LiquidCompartment", "CompartmentName": "Aorta", "SubstanceName": "Oxygen", "PropertyName": "PartialPressure", "Unit": "mmHg" },
{ "DecimalFormat": { "Precision": 1 }, "Category": "LiquidCompartment", "CompartmentName": "Aorta", "SubstanceName": "CarbonDioxide", "PropertyName": "PartialPressure", "Unit": "mmHg" },
{ "DecimalFormat": { "Precision": 1 }, "Category": "LiquidCompartment", "CompartmentName": "VenaCava", "SubstanceName": "Oxygen", "PropertyName": "PartialPressure", "Unit": "mmHg" },
{ "DecimalFormat": { "Precision": 1 }, "Category": "LiquidCompartment", "CompartmentName": "VenaCava", "SubstanceName": "CarbonDioxide", "PropertyName": "PartialPressure", "Unit": "mmHg" },
{ "DecimalFormat": { "Precision": 2 }, "Category": "LiquidCompartment", "CompartmentName": "RightTubules", "SubstanceName": "Sodium", "PropertyName": "Concentration", "Unit": "g/L" },
{ "DecimalFormat": { "Precision": 2 }, "Category": "LiquidCompartment", "CompartmentName": "LeftTubules", "SubstanceName": "Sodium", "PropertyName": "Concentration", "Unit": "g/L" },
{ "DecimalFormat": { "Precision": 2 }, "Category": "Substance", "SubstanceName": "Oxygen", "PropertyName": "AlveolarTransfer", "Unit": "mL/s" },
{ "DecimalFormat": { "Precision": 2 }, "Category": "Substance", "SubstanceName": "CarbonDioxide", "PropertyName": "AlveolarTransfer", "Unit": "mL/s" },
{ "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": 2 }, "Category": "Physiology", "PropertyName": "InspiratoryExpiratoryRatio", "Unit": "unitless" },
{ "DecimalFormat": { "Precision": 4 }, "Category": "Physiology", "PropertyName": "ExpiratoryFlow", "Unit": "L/s" },
{ "DecimalFormat": { "Precision": 4 }, "Category": "Physiology", "PropertyName": "InspiratoryFlow", "Unit": "L/s" },
{ "DecimalFormat": { "Precision": 4 }, "Category": "Physiology", "PropertyName": "PulmonaryCompliance", "Unit": "L/cmH2O" },
{ "DecimalFormat": { "Precision": 4 }, "Category": "Physiology", "PropertyName": "InspiratoryPulmonaryResistance", "Unit": "cmH2O s/L" },
{ "DecimalFormat": { "Precision": 4 }, "Category": "Physiology", "PropertyName": "ExpiratoryPulmonaryResistance", "Unit": "cmH2O s/L" },
{ "DecimalFormat": { "Precision": 4 }, "Category": "Physiology", "PropertyName": "CarricoIndex", "Unit": "mmHg" },
{ "DecimalFormat": { "Precision": 4 }, "Category": "Physiology", "PropertyName": "TransthoracicPressure", "Unit": "cmH2O" },
{ "DecimalFormat": { "Precision": 3 }, "Category": "Physiology", "PropertyName": "ShuntFraction", "Unit": "unitless" },
{ "DecimalFormat": { "Precision": 4 }, "Category": "Physiology", "PropertyName": "AlveolarArterialGradient", "Unit": "mmHg" },
{ "DecimalFormat": { "Precision": 4 }, "Category": "Physiology", "PropertyName": "TransthoracicPressure", "Unit": "cmH2O" },
{ "DecimalFormat": { "Precision": 4 }, "Category": "Physiology", "PropertyName": "TotalPulmonaryVentilation", "Unit": "L/min" },
{ "DecimalFormat": { "Precision": 4 }, "Category": "Physiology", "PropertyName": "FractionOfInsipredOxygen", "Unit": "unitless" },
{ "DecimalFormat": { "Precision": 4 }, "Category": "Physiology", "PropertyName": "SaturationAndFractionOfInspiredOxygenRatio", "Unit": "unitless" },
{ "DecimalFormat": { "Precision": 4 }, "Category": "Physiology", "PropertyName": "OxygenationIndex", "Unit": "unitless" },
{ "DecimalFormat": { "Precision": 4 }, "Category": "Physiology", "PropertyName": "OxygenSaturationIndex", "Unit": "cmH2O" },
{ "DecimalFormat": { "Precision": 4 }, "Category": "Physiology", "PropertyName": "MeanAirwayPressure", "Unit": "cmH2O" },
{ "DecimalFormat": { "Precision": 2 }, "Category": "GasCompartment", "CompartmentName": "Carina", "PropertyName": "OutFlow", "Unit": "L/s" },
{ "DecimalFormat": { "Precision": 3 }, "Category": "Patient", "PropertyName": "AlveoliSurfaceArea", "Unit": "m^2" }
]
},
"AnyAction":
[
{ "AdvanceTime": { "Time": { "ScalarTime": { "Value": 30.0, "Unit": "s" } } } },
{ "PatientAction": { "Intubation": { "Type": "Tracheal" } } },
{
"EquipmentAction": {
"MechanicalVentilatorConfiguration": {
"MechanicalVentilatorAction": { "EquipmentAction": { "Action": {
"Comment": "Attach the mechanical ventilator" }}},
"Configuration":
{
"Connection": "Tube",
"InspirationWaveform": "Square",
"ExpirationWaveform": "Square",
"InspirationMachineTriggerTime": { "ScalarTime": { "Value": 5.0, "Unit": "s" } },
"InspirationPatientTriggerPressure": { "ScalarPressure": { "Value": -0.000001, "Unit": "cmH2O" } },
"InspirationTargetFlow": { "ScalarVolumePerTime": { "Value": 0.5, "Unit": "L/s" } },
"ExpirationCycleVolume": { "ScalarVolume": { "Value": 0.540, "Unit": "L" } },
"PositiveEndExpiredPressure": { "ScalarPressure": { "Value": 8.0, "Unit": "cmH2O" } },
"FractionInspiredGas": [
{ "Name": "Oxygen", "Amount": { "Scalar0To1": { "Value": 0.5, "Unit": "" } } }
]
}
}
}
},
{ "AdvanceTime": { "Time": { "ScalarTime": { "Value": 5.0, "Unit": "min" } } } }
]
}
\ No newline at end of file
......@@ -103,7 +103,7 @@
"ExpirationWaveform": "Square",
"PeakInspiratoryPressure": { "ScalarPressure": { "Value": 10.0, "Unit": "cmH2O" } },
"PositiveEndExpiredPressure": { "ScalarPressure": { "Value": 0.0, "Unit": "cmH2O" } },
"InspirationTriggerTime": { "ScalarTime": { "Value": 2.0, "Unit": "s" } },
"InspirationMachineTriggerTime": { "ScalarTime": { "Value": 2.0, "Unit": "s" } },
"ExpirationCycleTime": { "ScalarTime": { "Value": 1.0, "Unit": "s" } },
"FractionInspiredGas":
[
......@@ -132,7 +132,7 @@
"ExpirationWaveform": "Square",
"PeakInspiratoryPressure": { "ScalarPressure": { "Value": 30.0, "Unit": "cmH2O" } },
"PositiveEndExpiredPressure": { "ScalarPressure": { "Value": 12.0, "Unit": "cmH2O" } },
"InspirationTriggerTime": { "ScalarTime": { "Value": 2.0, "Unit": "s" } },
"InspirationMachineTriggerTime": { "ScalarTime": { "Value": 2.0, "Unit": "s" } },
"ExpirationCycleTime": { "ScalarTime": { "Value": 1.0, "Unit": "s" } },
"FractionInspiredGas":
[
......@@ -172,7 +172,7 @@
"ExpirationWaveform": "Square",
"PeakInspiratoryPressure": { "ScalarPressure": { "Value": 22.0, "Unit": "cmH2O" } },
"PositiveEndExpiredPressure": { "ScalarPressure": { "Value": 8.0, "Unit": "cmH2O" } },
"InspirationTriggerTime": { "ScalarTime": { "Value": 2.0, "Unit": "s" } },
"InspirationMachineTriggerTime": { "ScalarTime": { "Value": 2.0, "Unit": "s" } },
"ExpirationCycleTime": { "ScalarTime": { "Value": 1.0, "Unit": "s" } },
"FractionInspiredGas":
[
......@@ -211,7 +211,7 @@
"ExpirationWaveform": "Square",
"PeakInspiratoryPressure": { "ScalarPressure": { "Value": 18.0, "Unit": "cmH2O" } },
"PositiveEndExpiredPressure": { "ScalarPressure": { "Value": 6.0, "Unit": "cmH2O" } },
"InspirationTriggerTime": { "ScalarTime": { "Value": 2.0, "Unit": "s" } },
"InspirationMachineTriggerTime": { "ScalarTime": { "Value": 2.0, "Unit": "s" } },
"ExpirationCycleTime": { "ScalarTime": { "Value": 1.0, "Unit": "s" } },
"FractionInspiredGas":
[
......
......@@ -36,6 +36,8 @@ void PBMechanicalVentilator::Serialize(const CDM_BIND::MechanicalVentilatorData&
PBProperty::Load(src.expirationcycleflow(), dst.GetExpirationCycleFlow());
if (src.has_expirationcyclepressure())
PBProperty::Load(src.expirationcyclepressure(), dst.GetExpirationCyclePressure());
if (src.has_expirationcyclevolume())
PBProperty::Load(src.expirationcyclevolume(), dst.GetExpirationCycleVolume());
if (src.has_expirationcycletime())
PBProperty::Load(src.expirationcycletime(), dst.GetExpirationCycleTime());
......@@ -57,15 +59,16 @@ void PBMechanicalVentilator::Serialize(const CDM_BIND::MechanicalVentilatorData&
if (src.has_peakinspiratorypressure())
PBProperty::Load(src.peakinspiratorypressure(), dst.GetPeakInspiratoryPressure());
if (src.has_endtidalcarbondioxidepressure())
PBProperty::Load(src.endtidalcarbondioxidepressure(), dst.GetEndTidalCarbonDioxidePressure());
if (src.has_inspirationtargetflow())
PBProperty::Load(src.inspirationtargetflow(), dst.GetInspirationTargetFlow());
if (src.has_inspirationtriggerflow())
PBProperty::Load(src.inspirationtriggerflow(), dst.GetInspirationTriggerFlow());
if (src.has_inspirationtriggerpressure())
PBProperty::Load(src.inspirationtriggerpressure(), dst.GetInspirationTriggerPressure());
if (src.has_inspirationtriggertime())
PBProperty::Load(src.inspirationtriggertime(), dst.GetInspirationTriggerTime());
if (src.has_inspirationmachinetriggertime())
PBProperty::Load(src.inspirationmachinetriggertime(), dst.GetInspirationMachineTriggerTime());
if (src.has_inspirationpatienttriggerflow())
PBProperty::Load(src.inspirationpatienttriggerflow(), dst.GetInspirationPatientTriggerFlow());
if (src.has_inspirationpatienttriggerpressure())
PBProperty::Load(src.inspirationpatienttriggerpressure(), dst.GetInspirationPatientTriggerPressure());
if (src.has_inspirationtuberesistance())
PBProperty::Load(src.inspirationtuberesistance(), dst.GetInspirationTubeResistance());
......@@ -133,6 +136,8 @@ void PBMechanicalVentilator::Serialize(const SEMechanicalVentilator& src, CDM_BI
dst.set_allocated_expirationcycleflow(PBProperty::Unload(*src.m_ExpirationCycleFlow));
if (src.HasExpirationCyclePressure())
dst.set_allocated_expirationcyclepressure(PBProperty::Unload(*src.m_ExpirationCyclePressure));
if (src.HasExpirationCycleVolume())
dst.set_allocated_expirationcyclevolume(PBProperty::Unload(*src.m_ExpirationCycleVolume));
if (src.HasExpirationCycleTime())
dst.set_allocated_expirationcycletime(PBProperty::Unload(*src.m_ExpirationCycleTime));
......@@ -154,15 +159,16 @@ void PBMechanicalVentilator::Serialize(const SEMechanicalVentilator& src, CDM_BI
if (src.HasPeakInspiratoryPressure())
dst.set_allocated_peakinspiratorypressure(PBProperty::Unload(*src.m_PeakInspiratoryPressure));
if (src.HasEndTidalCarbonDioxidePressure())
dst.set_allocated_endtidalcarbondioxidepressure(PBProperty::Unload(*src.m_EndTidalCarbonDioxidePressure));
if (src.HasInspirationTriggerFlow())
dst.set_allocated_inspirationtriggerflow(PBProperty::Unload(*src.m_InspirationTriggerFlow));
if (src.HasInspirationTriggerPressure())
dst.set_allocated_inspirationtriggerpressure(PBProperty::Unload(*src.m_InspirationTriggerPressure));
if (src.HasInspirationTriggerTime())
dst.set_allocated_inspirationtriggertime(PBProperty::Unload(*src.m_InspirationTriggerTime));
if (src.HasInspirationTargetFlow())
dst.set_allocated_inspirationtargetflow(PBProperty::Unload(*src.m_InspirationTargetFlow));
if (src.HasInspirationMachineTriggerTime())
dst.set_allocated_inspirationmachinetriggertime(PBProperty::Unload(*src.m_InspirationMachineTriggerTime));
if (src.HasInspirationPatientTriggerFlow())
dst.set_allocated_inspirationpatienttriggerflow(PBProperty::Unload(*src.m_InspirationPatientTriggerFlow));
if (src.HasInspirationPatientTriggerPressure())
dst.set_allocated_inspirationpatienttriggerpressure(PBProperty::Unload(*src.m_InspirationPatientTriggerPressure));
if (src.HasInspirationTubeResistance())
dst.set_allocated_inspirationtuberesistance(PBProperty::Unload(*src.m_InspirationTubeResistance));
......
......@@ -30,6 +30,7 @@ SEMechanicalVentilator::SEMechanicalVentilator(Logger* logger) : SEEquipment(log
m_ExpirationCycleFlow = nullptr;
m_ExpirationCyclePressure = nullptr;
m_ExpirationCycleVolume = nullptr;
m_ExpirationCycleTime = nullptr;
m_ExpirationTubeResistance = nullptr;
......@@ -43,11 +44,12 @@ SEMechanicalVentilator::SEMechanicalVentilator(Logger* logger) : SEEquipment(log
m_InspirationPauseTime = nullptr;
m_PeakInspiratoryPressure = nullptr;
m_EndTidalCarbonDioxidePressure = nullptr;
m_InspirationTargetFlow = nullptr;
m_InspirationTriggerFlow = nullptr;
m_InspirationTriggerPressure = nullptr;
m_InspirationTriggerTime = nullptr;
m_InspirationMachineTriggerTime = nullptr;
m_InspirationPatientTriggerFlow = nullptr;
m_InspirationPatientTriggerPressure = nullptr;
m_InspirationTubeResistance = nullptr;
m_InspirationValveResistance = nullptr;
......@@ -71,6 +73,7 @@ void SEMechanicalVentilator::Clear()
SAFE_DELETE(m_ExpirationCycleFlow);
SAFE_DELETE(m_ExpirationCyclePressure);
SAFE_DELETE(m_ExpirationCycleVolume);
SAFE_DELETE(m_ExpirationCycleTime);
SAFE_DELETE(m_ExpirationTubeResistance);
......@@ -84,11 +87,12 @@ void SEMechanicalVentilator::Clear()
SAFE_DELETE(m_InspirationPauseTime);
SAFE_DELETE(m_PeakInspiratoryPressure);
SAFE_DELETE(m_EndTidalCarbonDioxidePressure);
SAFE_DELETE(m_InspirationTargetFlow);
SAFE_DELETE(m_InspirationMachineTriggerTime);
SAFE_DELETE(m_InspirationTriggerFlow);
SAFE_DELETE(m_InspirationTriggerPressure);
SAFE_DELETE(m_InspirationTriggerTime);
SAFE_DELETE(m_InspirationPatientTriggerFlow);
SAFE_DELETE(m_InspirationPatientTriggerPressure);
SAFE_DELETE(m_InspirationTubeResistance);
SAFE_DELETE(m_InspirationValveResistance);
......@@ -129,6 +133,7 @@ void SEMechanicalVentilator::Merge(const SEMechanicalVentilator& from, SESubstan
COPY_PROPERTY(ExpirationCycleFlow);
COPY_PROPERTY(ExpirationCyclePressure);
COPY_PROPERTY(ExpirationCycleVolume);
COPY_PROPERTY(ExpirationCycleTime);
COPY_PROPERTY(ExpirationTubeResistance);
......@@ -143,11 +148,12 @@ void SEMechanicalVentilator::Merge(const SEMechanicalVentilator& from, SESubstan
COPY_PROPERTY(InspirationPauseTime);
COPY_PROPERTY(PeakInspiratoryPressure);
COPY_PROPERTY(EndTidalCarbonDioxidePressure);
COPY_PROPERTY(InspirationTargetFlow);
COPY_PROPERTY(InspirationMachineTriggerTime);
COPY_PROPERTY(InspirationTriggerFlow);
COPY_PROPERTY(InspirationTriggerPressure);
COPY_PROPERTY(InspirationTriggerTime);
COPY_PROPERTY(InspirationPatientTriggerFlow);
COPY_PROPERTY(InspirationPatientTriggerPressure);
COPY_PROPERTY(InspirationTubeResistance);
COPY_PROPERTY(InspirationValveResistance);
......@@ -234,6 +240,8 @@ const SEScalar* SEMechanicalVentilator::GetScalar(const std::string& name)
return &GetExpirationCycleFlow();
if (name == "ExpirationCyclePressure")
return &GetExpirationCyclePressure();
if (name == "ExpirationCycleVolume")
return &GetExpirationCycleVolume();
if (name == "ExpirationCycleTime")
return &GetExpirationCycleTime();
......@@ -254,15 +262,16 @@ const SEScalar* SEMechanicalVentilator::GetScalar(const std::string& name)
if (name == "PeakInspiratoryPressure")
return &GetPeakInspiratoryPressure();
if (name == "EndTidalCarbonDioxidePressure")
return &GetEndTidalCarbonDioxidePressure();
if (name == "InspirationTargetFlow")
return &GetInspirationTargetFlow();
if (name == "InspirationTriggerFlow")
return &GetInspirationTriggerFlow();
if (name == "InspirationTriggerPressure")
return &GetInspirationTriggerPressure();
if (name == "InspirationTriggerTime")
return &GetInspirationTriggerTime();
if (name == "InspirationMachineTriggerTime")
return &GetInspirationMachineTriggerTime();
if (name == "InspirationPatientTriggerFlow")
return &GetInspirationPatientTriggerFlow();
if (name == "InspirationPatientTriggerPressure")
return &GetInspirationPatientTriggerPressure();
if (name == "InspirationTubeResistance")
return &GetInspirationTubeResistance();
......@@ -367,6 +376,23 @@ double SEMechanicalVentilator::GetExpirationCyclePressure(const PressureUnit& un
return m_ExpirationCyclePressure->GetValue(unit);
}
bool SEMechanicalVentilator::HasExpirationCycleVolume() const
{
return m_ExpirationCycleVolume == nullptr ? false : m_ExpirationCycleVolume->IsValid();
}
SEScalarVolume& SEMechanicalVentilator::GetExpirationCycleVolume()
{
if (m_ExpirationCycleVolume == nullptr)
m_ExpirationCycleVolume = new SEScalarVolume();
return *m_ExpirationCycleVolume;
}
double SEMechanicalVentilator::GetExpirationCycleVolume(const VolumeUnit& unit) const
{
if (m_ExpirationCycleVolume == nullptr)
return SEScalar::dNaN();
return m_ExpirationCycleVolume->GetValue(unit);
}
bool SEMechanicalVentilator::HasExpirationCycleTime() const
{
return m_ExpirationCycleTime == nullptr ? false : m_ExpirationCycleTime->IsValid();
......@@ -461,6 +487,23 @@ double SEMechanicalVentilator::GetInspirationLimitPressure(const PressureUnit& u
return m_InspirationLimitPressure->GetValue(unit);
}
bool SEMechanicalVentilator::HasInspirationLimitVolume() const
{
return m_InspirationLimitVolume == nullptr ? false : m_InspirationLimitVolume->IsValid();
}
SEScalarVolume& SEMechanicalVentilator::GetInspirationLimitVolume()
{
if (m_InspirationLimitVolume == nullptr)
m_InspirationLimitVolume = new SEScalarVolume();
return *m_InspirationLimitVolume;
}
double SEMechanicalVentilator::GetInspirationLimitVolume(const VolumeUnit& unit) const
{
if (m_InspirationLimitVolume == nullptr)
return SEScalar::dNaN();
return m_InspirationLimitVolume->GetValue(unit);
}
bool SEMechanicalVentilator::HasInspirationPauseTime() const
{
return m_InspirationPauseTime == nullptr ? false : m_InspirationPauseTime->IsValid();
......@@ -495,89 +538,72 @@ double SEMechanicalVentilator::GetPeakInspiratoryPressure(const PressureUnit& un
return m_PeakInspiratoryPressure->GetValue(unit);
}
bool SEMechanicalVentilator::HasEndTidalCarbonDioxidePressure() const
bool SEMechanicalVentilator::HasInspirationTargetFlow() const
{
return m_EndTidalCarbonDioxidePressure == nullptr ? false : m_EndTidalCarbonDioxidePressure->IsValid();
return m_InspirationTargetFlow == nullptr ? false : m_InspirationTargetFlow->IsValid();
}
SEScalarPressure& SEMechanicalVentilator::GetEndTidalCarbonDioxidePressure()
SEScalarVolumePerTime& SEMechanicalVentilator::GetInspirationTargetFlow()
{
if (m_EndTidalCarbonDioxidePressure == nullptr)
m_EndTidalCarbonDioxidePressure = new SEScalarPressure();
return *m_EndTidalCarbonDioxidePressure;
if (m_InspirationTargetFlow == nullptr)
m_InspirationTargetFlow = new SEScalarVolumePerTime();
return *m_InspirationTargetFlow;
}
double SEMechanicalVentilator::GetEndTidalCarbonDioxidePressure(const PressureUnit& unit) const
double SEMechanicalVentilator::GetInspirationTargetFlow(const VolumePerTimeUnit& unit) const
{
if (m_EndTidalCarbonDioxidePressure == nullptr)
if (m_InspirationTargetFlow == nullptr)
return SEScalar::dNaN();
return m_EndTidalCarbonDioxidePressure->GetValue(unit);
}
bool SEMechanicalVentilator::HasInspirationLimitVolume() const
{
return m_InspirationLimitVolume == nullptr ? false : m_InspirationLimitVolume->IsValid();
}
SEScalarVolume& SEMechanicalVentilator::GetInspirationLimitVolume()
{
if (m_InspirationLimitVolume == nullptr)
m_InspirationLimitVolume = new SEScalarVolume();
return *m_InspirationLimitVolume;
}
double SEMechanicalVentilator::GetInspirationLimitVolume(const VolumeUnit& unit) const
{
if (m_InspirationLimitVolume == nullptr)
return SEScalar::dNaN();
return m_InspirationLimitVolume->GetValue(unit);
return m_InspirationTargetFlow->GetValue(unit);
}
bool SEMechanicalVentilator::HasInspirationTriggerFlow() const
bool SEMechanicalVentilator::HasInspirationMachineTriggerTime() const
{
return m_InspirationTriggerFlow == nullptr ? false : m_InspirationTriggerFlow->IsValid();
return m_InspirationMachineTriggerTime == nullptr ? false : m_InspirationMachineTriggerTime->IsValid();
}
SEScalarVolumePerTime& SEMechanicalVentilator::GetInspirationTriggerFlow()
SEScalarTime& SEMechanicalVentilator::GetInspirationMachineTriggerTime()
{
if (m_InspirationTriggerFlow == nullptr)
m_InspirationTriggerFlow = new SEScalarVolumePerTime();
return *m_InspirationTriggerFlow;
if (m_InspirationMachineTriggerTime == nullptr)
m_InspirationMachineTriggerTime = new SEScalarTime();
return *m_InspirationMachineTriggerTime;
}
double SEMechanicalVentilator::GetInspirationTriggerFlow(const VolumePerTimeUnit& unit) const
double SEMechanicalVentilator::GetInspirationMachineTriggerTime(const TimeUnit& unit) const
{
if (m_InspirationTriggerFlow == nullptr)
if (m_InspirationMachineTriggerTime == nullptr)
return SEScalar::dNaN();
return m_InspirationTriggerFlow->GetValue(unit);
return m_InspirationMachineTriggerTime->GetValue(unit);
}
bool SEMechanicalVentilator::HasInspirationTriggerPressure() const
bool SEMechanicalVentilator::HasInspirationPatientTriggerFlow() const
{
return m_InspirationTriggerPressure == nullptr ? false : m_InspirationTriggerPressure->IsValid();
return m_InspirationPatientTriggerFlow == nullptr ? false : m_InspirationPatientTriggerFlow->IsValid();
}
SEScalarPressure& SEMechanicalVentilator::GetInspirationTriggerPressure()
SEScalarVolumePerTime& SEMechanicalVentilator::GetInspirationPatientTriggerFlow()