Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pulse Physiology Suite
engine
Commits
58df766d
Commit
58df766d
authored
Apr 01, 2020
by
Jeff Webb
Browse files
New Mechanical Ventilation action is working.
Still needs more cleanup and testing - lots of to-dos in comments.
parent
d191dd24
Changes
6
Hide whitespace changes
Inline
Side-by-side
data/config/ScenarioVerification.config
View file @
58df766d
...
...
@@ -116,6 +116,7 @@ equipment/MainstemIntubation.json = ScenarioTest
equipment
/
MechanicalVentilation
.
json
=
ScenarioTest
equipment
/
NasalCannula
.
json
=
ScenarioTest
equipment
/
NonRebreatherMask
.
json
=
ScenarioTest
equipment
/
PressureControlContinuousMandatoryVentilation
.
json
=
ScenarioTest
equipment
/
SimpleMask
.
json
=
ScenarioTest
@
group
Drugs
...
...
data/human/adult/scenarios/equipment/PressureControlContinuousMandatoryVentilation.json
0 → 100644
View file @
58df766d
{
"Name"
:
"PressureControlContinuousMandatoryVentilation"
,
"Description"
:
"Apply a P-CMV mode ventilator."
,
"StartType"
:
{
"PatientConfiguration"
:
{
"PatientFile"
:
"StandardMale.json"
}},
"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"
:
"ChymeAbsorptionRate"
,
"Unit"
:
"mL/min"
},
{
"DecimalFormat"
:
{
"Precision"
:
2
},
"Category"
:
"Physiology"
,
"PropertyName"
:
"StomachContents-Carbohydrate"
,
"Unit"
:
"g"
},
{
"DecimalFormat"
:
{
"Precision"
:
2
},
"Category"
:
"Physiology"
,
"PropertyName"
:
"StomachContents-Fat"
,
"Unit"
:
"g"
},
{
"DecimalFormat"
:
{
"Precision"
:
2
},
"Category"
:
"Physiology"
,
"PropertyName"
:
"StomachContents-Protein"
,
"Unit"
:
"g"
},
{
"DecimalFormat"
:
{
"Precision"
:
2
},
"Category"
:
"Physiology"
,
"PropertyName"
:
"StomachContents-Calcium"
,
"Unit"
:
"g"
},
{
"DecimalFormat"
:
{
"Precision"
:
2
},
"Category"
:
"Physiology"
,
"PropertyName"
:
"StomachContents-Sodium"
,
"Unit"
:
"g"
},
{
"DecimalFormat"
:
{
},
"Category"
:
"Physiology"
,
"PropertyName"
:
"StomachContents-Water"
,
"Unit"
:
"mL"
},
{
"DecimalFormat"
:
{
},
"Category"
:
"LiquidCompartment"
,
"CompartmentName"
:
"SmallIntestineChyme"
,
"PropertyName"
:
"Volume"
,
"Unit"
:
"mL"
},
{
"DecimalFormat"
:
{
},
"Category"
:
"LiquidCompartment"
,
"CompartmentName"
:
"SmallIntestineVasculature"
,
"PropertyName"
:
"Volume"
,
"Unit"
:
"mL"
},
{
"DecimalFormat"
:
{
"Precision"
:
1
},
"Category"
:
"LiquidCompartment"
,
"CompartmentName"
:
"SmallIntestineVasculature"
,
"PropertyName"
:
"Pressure"
,
"Unit"
:
"mmHg"
},
{
"DecimalFormat"
:
{
"Precision"
:
2
},
"Category"
:
"LiquidCompartment"
,
"CompartmentName"
:
"SmallIntestineChyme"
,
"SubstanceName"
:
"Glucose"
,
"PropertyName"
:
"Mass"
,
"Unit"
:
"g"
},
{
"DecimalFormat"
:
{
"Precision"
:
2
},
"Category"
:
"LiquidCompartment"
,
"CompartmentName"
:
"SmallIntestineChyme"
,
"SubstanceName"
:
"Tristearin"
,
"PropertyName"
:
"Mass"
,
"Unit"
:
"g"
},
{
"DecimalFormat"
:
{
"Precision"
:
2
},
"Category"
:
"LiquidCompartment"
,
"CompartmentName"
:
"SmallIntestineChyme"
,
"SubstanceName"
:
"Calcium"
,
"PropertyName"
:
"Mass"
,
"Unit"
:
"g"
},
{
"DecimalFormat"
:
{
"Precision"
:
2
},
"Category"
:
"LiquidCompartment"
,
"CompartmentName"
:
"SmallIntestineChyme"
,
"SubstanceName"
:
"Sodium"
,
"PropertyName"
:
"Mass"
,
"Unit"
:
"g"
},
{
"DecimalFormat"
:
{
"Precision"
:
2
},
"Category"
:
"LiquidCompartment"
,
"CompartmentName"
:
"SmallIntestineChyme"
,
"SubstanceName"
:
"Urea"
,
"PropertyName"
:
"Mass"
,
"Unit"
:
"g"
},
{
"DecimalFormat"
:
{
"Precision"
:
1
},
"Category"
:
"LiquidCompartment"
,
"CompartmentName"
:
"SmallIntestineVasculature"
,
"SubstanceName"
:
"Glucose"
,
"PropertyName"
:
"Concentration"
,
"Unit"
:
"mg/dL"
},
{
"DecimalFormat"
:
{
},
"Category"
:
"LiquidCompartment"
,
"CompartmentName"
:
"SmallIntestineVasculature"
,
"SubstanceName"
:
"Tristearin"
,
"PropertyName"
:
"Concentration"
,
"Unit"
:
"mg/dL"
},
{
"DecimalFormat"
:
{
"Precision"
:
1
},
"Category"
:
"LiquidCompartment"
,
"CompartmentName"
:
"SmallIntestineVasculature"
,
"SubstanceName"
:
"Calcium"
,
"PropertyName"
:
"Concentration"
,
"Unit"
:
"mg/L"
},
{
"DecimalFormat"
:
{
"Precision"
:
2
},
"Category"
:
"LiquidCompartment"
,
"CompartmentName"
:
"SmallIntestineVasculature"
,
"SubstanceName"
:
"Sodium"
,
"PropertyName"
:
"Concentration"
,
"Unit"
:
"g/L"
},
{
"DecimalFormat"
:
{
"Precision"
:
1
},
"Category"
:
"LiquidCompartment"
,
"CompartmentName"
:
"SmallIntestineVasculature"
,
"SubstanceName"
:
"Urea"
,
"PropertyName"
:
"Concentration"
,
"Unit"
:
"mg/dL"
},
{
"DecimalFormat"
:
{
"Precision"
:
3
},
"Category"
:
"Physiology"
,
"PropertyName"
:
"HeartEjectionFraction"
},
{
"DecimalFormat"
:
{
"Precision"
:
3
},
"Category"
:
"Physiology"
,
"PropertyName"
:
"SystemicVascularResistance"
,
"Unit"
:
"mmHg s/mL"
},
{
"DecimalFormat"
:
{
},
"Category"
:
"LiquidCompartment"
,
"CompartmentName"
:
"Pericardium"
,
"PropertyName"
:
"Volume"
,
"Unit"
:
"mL"
},
{
"DecimalFormat"
:
{
"Precision"
:
2
},
"Category"
:
"LiquidCompartment"
,
"CompartmentName"
:
"Pericardium"
,
"PropertyName"
:
"Pressure"
,
"Unit"
:
"mmHg"
}
]
},
"AnyAction"
:
[
{
"AdvanceTime"
:
{
"Time"
:
{
"ScalarTime"
:
{
"Value"
:
1.0
,
"Unit"
:
"min"
}
}
}
},
{
"PatientAction"
:
{
"Dyspnea"
:
{
"Severity"
:
{
"Scalar0To1"
:
{
"Value"
:
1.0
}
}
}
}
},
{
"EquipmentAction"
:
{
"MechanicalVentilatorConfiguration"
:
{
"MechanicalVentilatorAction"
:
{
"EquipmentAction"
:
{
"Action"
:
{
"Comment"
:
"Attach the mechanical ventilator"
}}},
"Configuration"
:
{
"BreathProfile"
:
{
"Rate"
:
{
"ScalarFrequency"
:
{
"Value"
:
12.0
,
"Unit"
:
"1/min"
}
},
"InspiratoryExpiratoryRatio"
:
{
"Value"
:
0.5
,
"Unit"
:
""
}
},
"Connection"
:
"Mask"
,
"Control"
:
"P_CMV"
,
"DriverWaveform"
:
"Square"
,
"PeakInspiratoryPressure"
:
{
"ScalarPressure"
:
{
"Value"
:
10.0
,
"Unit"
:
"cmH2O"
}
},
"PositiveEndExpiredPressure"
:
{
"ScalarPressure"
:
{
"Value"
:
5.0
,
"Unit"
:
"cmH2O"
}
},
"FractionInspiredGas"
:
[
{
"Name"
:
"Nitrogen"
,
"Amount"
:
{
"Scalar0To1"
:
{
"Value"
:
0.7896
,
"Unit"
:
""
}
}
},
{
"Name"
:
"Oxygen"
,
"Amount"
:
{
"Scalar0To1"
:
{
"Value"
:
0.21
,
"Unit"
:
""
}
}
},
{
"Name"
:
"CarbonDioxide"
,
"Amount"
:
{
"Scalar0To1"
:
{
"Value"
:
0.0004
,
"Unit"
:
""
}
}
}
]
}
}
}
},
{
"AdvanceTime"
:
{
"Time"
:
{
"ScalarTime"
:
{
"Value"
:
5.0
,
"Unit"
:
"min"
}
}
}
}
]
}
\ No newline at end of file
src/cpp/cdm/system/equipment/mechanical_ventilator/SEMechanicalVentilator.cpp
View file @
58df766d
...
...
@@ -57,7 +57,8 @@ void SEMechanicalVentilator::Clear()
DELETE_VECTOR
(
m_cFractionInspiredGases
);
m_cFractionInspiredGases
.
clear
();
DELETE_VECTOR
(
m_FractionInspiredGases
);
//Aaron - What's going on here?
//DELETE_VECTOR(m_FractionInspiredGases);
m_FractionInspiredGases
.
clear
();
DELETE_VECTOR
(
m_cConcentrationInspiredAerosols
);
...
...
src/cpp/cpm/PulsePhysiologyEngine.h
View file @
58df766d
...
...
@@ -1105,29 +1105,31 @@ namespace pulse {
static
std
::
vector
<
std
::
string
>
_values
;
};
//Aaron - how do we want to share names between mechanical ventilator and anesthesia machine?
//Right now, I'm just adding "MechanicalVentilator"
class
MechanicalVentilatorCompartment
{
public:
DEFINE_STATIC_STRING
(
Ventilator
);
DEFINE_STATIC_STRING
(
ExpiratoryValve
);
DEFINE_STATIC_STRING
(
InspiratoryValve
);
DEFINE_STATIC_STRING
(
ExpiratoryLimb
);
DEFINE_STATIC_STRING
(
InspiratoryLimb
);
DEFINE_STATIC_STRING
(
YPiece
);
DEFINE_STATIC_STRING
(
Connection
);
DEFINE_STATIC_STRING
(
Mechanical
Ventilator
);
DEFINE_STATIC_STRING
(
MechanicalVentilator
ExpiratoryValve
);
DEFINE_STATIC_STRING
(
MechanicalVentilator
InspiratoryValve
);
DEFINE_STATIC_STRING
(
MechanicalVentilator
ExpiratoryLimb
);
DEFINE_STATIC_STRING
(
MechanicalVentilator
InspiratoryLimb
);
DEFINE_STATIC_STRING
(
MechanicalVentilator
YPiece
);
DEFINE_STATIC_STRING
(
MechanicalVentilator
Connection
);
static
const
std
::
vector
<
std
::
string
>&
GetValues
()
{
ScopedMutex
lock
;
if
(
_values
.
empty
())
{
_values
.
push_back
(
Ventilator
);
_values
.
push_back
(
ExpiratoryValve
);
_values
.
push_back
(
InspiratoryValve
);
_values
.
push_back
(
ExpiratoryLimb
);
_values
.
push_back
(
InspiratoryLimb
);
_values
.
push_back
(
YPiece
);
_values
.
push_back
(
Connection
);
_values
.
push_back
(
Mechanical
Ventilator
);
_values
.
push_back
(
MechanicalVentilator
ExpiratoryValve
);
_values
.
push_back
(
MechanicalVentilator
InspiratoryValve
);
_values
.
push_back
(
MechanicalVentilator
ExpiratoryLimb
);
_values
.
push_back
(
MechanicalVentilator
InspiratoryLimb
);
_values
.
push_back
(
MechanicalVentilator
YPiece
);
_values
.
push_back
(
MechanicalVentilator
Connection
);
}
return
_values
;
}
...
...
@@ -1135,33 +1137,35 @@ namespace pulse {
static
std
::
vector
<
std
::
string
>
_values
;
};
//Aaron - how do we want to share names between mechanical ventilator and anesthesia machine?
//Right now, I'm just adding "MechanicalVentilator"
class
MechanicalVentilatorLink
{
public:
DEFINE_STATIC_STRING
(
VentilatorToExpiratoryValve
);
DEFINE_STATIC_STRING
(
VentilatorToInspiratoryValve
);
DEFINE_STATIC_STRING
(
ExpiratoryLimbToExpiratoryValve
);
DEFINE_STATIC_STRING
(
InspiratoryValveToInspiratoryLimb
);
DEFINE_STATIC_STRING
(
ExpiratoryLimbToYPiece
);
DEFINE_STATIC_STRING
(
InspiratoryLimbToYPiece
);
DEFINE_STATIC_STRING
(
YPieceToConnection
);
DEFINE_STATIC_STRING
(
ConnectionToEnvironment
);
DEFINE_STATIC_STRING
(
ConnectionToMouth
);
DEFINE_STATIC_STRING
(
Mechanical
VentilatorToExpiratoryValve
);
DEFINE_STATIC_STRING
(
Mechanical
VentilatorToInspiratoryValve
);
DEFINE_STATIC_STRING
(
MechanicalVentilator
ExpiratoryLimbToExpiratoryValve
);
DEFINE_STATIC_STRING
(
MechanicalVentilator
InspiratoryValveToInspiratoryLimb
);
DEFINE_STATIC_STRING
(
MechanicalVentilator
ExpiratoryLimbToYPiece
);
DEFINE_STATIC_STRING
(
MechanicalVentilator
InspiratoryLimbToYPiece
);
DEFINE_STATIC_STRING
(
MechanicalVentilator
YPieceToConnection
);
DEFINE_STATIC_STRING
(
MechanicalVentilator
ConnectionToEnvironment
);
DEFINE_STATIC_STRING
(
MechanicalVentilator
ConnectionToMouth
);
static
const
std
::
vector
<
std
::
string
>&
GetValues
()
{
ScopedMutex
lock
;
if
(
_values
.
empty
())
{
_values
.
push_back
(
VentilatorToExpiratoryValve
);
_values
.
push_back
(
VentilatorToInspiratoryValve
);
_values
.
push_back
(
ExpiratoryLimbToExpiratoryValve
);
_values
.
push_back
(
InspiratoryValveToInspiratoryLimb
);
_values
.
push_back
(
ExpiratoryLimbToYPiece
);
_values
.
push_back
(
InspiratoryLimbToYPiece
);
_values
.
push_back
(
YPieceToConnection
);
_values
.
push_back
(
ConnectionToEnvironment
);
_values
.
push_back
(
ConnectionToMouth
);
_values
.
push_back
(
Mechanical
VentilatorToExpiratoryValve
);
_values
.
push_back
(
Mechanical
VentilatorToInspiratoryValve
);
_values
.
push_back
(
MechanicalVentilator
ExpiratoryLimbToExpiratoryValve
);
_values
.
push_back
(
MechanicalVentilator
InspiratoryValveToInspiratoryLimb
);
_values
.
push_back
(
MechanicalVentilator
ExpiratoryLimbToYPiece
);
_values
.
push_back
(
MechanicalVentilator
InspiratoryLimbToYPiece
);
_values
.
push_back
(
MechanicalVentilator
YPieceToConnection
);
_values
.
push_back
(
MechanicalVentilator
ConnectionToEnvironment
);
_values
.
push_back
(
MechanicalVentilator
ConnectionToMouth
);
}
return
_values
;
}
...
...
src/cpp/cpm/controller/Controller.cpp
View file @
58df766d
...
...
@@ -4444,6 +4444,8 @@ void PulseController::SetupMechanicalVentilator()
double
connectioneVolume_L
=
0.01
;
double
tubeResistance_cmH2O_s_Per_L
=
0.01
;
//4 total tubes - this is per tube
/////////////
// Circuit //
// Nodes
SEFluidCircuit
&
cMechanicalVentilator
=
m_Circuits
->
GetMechanicalVentilatorCircuit
();
SEFluidCircuitNode
&
Ambient
=
*
cRespiratory
.
GetNode
(
pulse
::
EnvironmentNode
::
Ambient
);
...
...
@@ -4517,40 +4519,42 @@ void PulseController::SetupMechanicalVentilator()
cCombinedMechanicalVentilator
.
SetNextAndCurrentFromBaselines
();
cCombinedMechanicalVentilator
.
StateChange
();
//////////////////////
// GAS COMPARTMENTS //
// Grab the Environment Compartment
SEGasCompartment
*
eEnvironment
=
m_Compartments
->
GetGasCompartment
(
pulse
::
EnvironmentCompartment
::
Ambient
);
// Mechanical Ventilator Compartments
SEGasCompartment
&
mVentilator
=
m_Compartments
->
CreateGasCompartment
(
pulse
::
MechanicalVentilatorCompartment
::
Ventilator
);
SEGasCompartment
&
mVentilator
=
m_Compartments
->
CreateGasCompartment
(
pulse
::
MechanicalVentilatorCompartment
::
Mechanical
Ventilator
);
mVentilator
.
MapNode
(
Ventilator
);
SEGasCompartment
&
mExpiratoryValve
=
m_Compartments
->
CreateGasCompartment
(
pulse
::
MechanicalVentilatorCompartment
::
ExpiratoryValve
);
SEGasCompartment
&
mExpiratoryValve
=
m_Compartments
->
CreateGasCompartment
(
pulse
::
MechanicalVentilatorCompartment
::
MechanicalVentilator
ExpiratoryValve
);
mExpiratoryValve
.
MapNode
(
ExpiratoryValve
);
SEGasCompartment
&
mInspiratoryValve
=
m_Compartments
->
CreateGasCompartment
(
pulse
::
MechanicalVentilatorCompartment
::
InspiratoryValve
);
SEGasCompartment
&
mInspiratoryValve
=
m_Compartments
->
CreateGasCompartment
(
pulse
::
MechanicalVentilatorCompartment
::
MechanicalVentilator
InspiratoryValve
);
mInspiratoryValve
.
MapNode
(
InspiratoryValve
);
SEGasCompartment
&
mExpiratoryLimb
=
m_Compartments
->
CreateGasCompartment
(
pulse
::
MechanicalVentilatorCompartment
::
ExpiratoryLimb
);
SEGasCompartment
&
mExpiratoryLimb
=
m_Compartments
->
CreateGasCompartment
(
pulse
::
MechanicalVentilatorCompartment
::
MechanicalVentilator
ExpiratoryLimb
);
mExpiratoryLimb
.
MapNode
(
ExpiratoryLimb
);
SEGasCompartment
&
mInspiratoryLimb
=
m_Compartments
->
CreateGasCompartment
(
pulse
::
MechanicalVentilatorCompartment
::
InspiratoryLimb
);
SEGasCompartment
&
mInspiratoryLimb
=
m_Compartments
->
CreateGasCompartment
(
pulse
::
MechanicalVentilatorCompartment
::
MechanicalVentilator
InspiratoryLimb
);
mInspiratoryLimb
.
MapNode
(
InspiratoryLimb
);
SEGasCompartment
&
mYPiece
=
m_Compartments
->
CreateGasCompartment
(
pulse
::
MechanicalVentilatorCompartment
::
YPiece
);
SEGasCompartment
&
mYPiece
=
m_Compartments
->
CreateGasCompartment
(
pulse
::
MechanicalVentilatorCompartment
::
MechanicalVentilator
YPiece
);
mYPiece
.
MapNode
(
YPiece
);
SEGasCompartment
&
mConnection
=
m_Compartments
->
CreateGasCompartment
(
pulse
::
MechanicalVentilatorCompartment
::
Connection
);
SEGasCompartment
&
mConnection
=
m_Compartments
->
CreateGasCompartment
(
pulse
::
MechanicalVentilatorCompartment
::
MechanicalVentilator
Connection
);
mConnection
.
MapNode
(
Connection
);
// Setup Links //
SEGasCompartmentLink
&
mVentilatorToExpiratoryValve
=
m_Compartments
->
CreateGasLink
(
mVentilator
,
mExpiratoryValve
,
pulse
::
MechanicalVentilatorLink
::
VentilatorToExpiratoryValve
);
SEGasCompartmentLink
&
mVentilatorToExpiratoryValve
=
m_Compartments
->
CreateGasLink
(
mVentilator
,
mExpiratoryValve
,
pulse
::
MechanicalVentilatorLink
::
Mechanical
VentilatorToExpiratoryValve
);
mVentilatorToExpiratoryValve
.
MapPath
(
VentilatorToExpiratoryValve
);
SEGasCompartmentLink
&
mVentilatorToInspiratoryValve
=
m_Compartments
->
CreateGasLink
(
mVentilator
,
mInspiratoryValve
,
pulse
::
MechanicalVentilatorLink
::
VentilatorToInspiratoryValve
);
SEGasCompartmentLink
&
mVentilatorToInspiratoryValve
=
m_Compartments
->
CreateGasLink
(
mVentilator
,
mInspiratoryValve
,
pulse
::
MechanicalVentilatorLink
::
Mechanical
VentilatorToInspiratoryValve
);
mVentilatorToInspiratoryValve
.
MapPath
(
VentilatorToInspiratoryValve
);
SEGasCompartmentLink
&
mExpiratoryLimbToExpiratoryValve
=
m_Compartments
->
CreateGasLink
(
mExpiratoryLimb
,
mExpiratoryValve
,
pulse
::
MechanicalVentilatorLink
::
ExpiratoryLimbToExpiratoryValve
);
SEGasCompartmentLink
&
mExpiratoryLimbToExpiratoryValve
=
m_Compartments
->
CreateGasLink
(
mExpiratoryLimb
,
mExpiratoryValve
,
pulse
::
MechanicalVentilatorLink
::
MechanicalVentilator
ExpiratoryLimbToExpiratoryValve
);
mExpiratoryLimbToExpiratoryValve
.
MapPath
(
ExpiratoryLimbToExpiratoryValve
);
SEGasCompartmentLink
&
mInspiratoryValveToInspiratoryLimb
=
m_Compartments
->
CreateGasLink
(
mInspiratoryValve
,
mInspiratoryLimb
,
pulse
::
MechanicalVentilatorLink
::
InspiratoryValveToInspiratoryLimb
);
SEGasCompartmentLink
&
mInspiratoryValveToInspiratoryLimb
=
m_Compartments
->
CreateGasLink
(
mInspiratoryValve
,
mInspiratoryLimb
,
pulse
::
MechanicalVentilatorLink
::
MechanicalVentilator
InspiratoryValveToInspiratoryLimb
);
mInspiratoryValveToInspiratoryLimb
.
MapPath
(
InspiratoryValveToInspiratoryLimb
);
SEGasCompartmentLink
&
mExpiratoryLimbToYPiece
=
m_Compartments
->
CreateGasLink
(
mExpiratoryLimb
,
mYPiece
,
pulse
::
MechanicalVentilatorLink
::
ExpiratoryLimbToYPiece
);
SEGasCompartmentLink
&
mExpiratoryLimbToYPiece
=
m_Compartments
->
CreateGasLink
(
mExpiratoryLimb
,
mYPiece
,
pulse
::
MechanicalVentilatorLink
::
MechanicalVentilator
ExpiratoryLimbToYPiece
);
mExpiratoryLimbToYPiece
.
MapPath
(
ExpiratoryLimbToYPiece
);
SEGasCompartmentLink
&
mInspiratoryLimbToYPiece
=
m_Compartments
->
CreateGasLink
(
mInspiratoryLimb
,
mYPiece
,
pulse
::
MechanicalVentilatorLink
::
InspiratoryLimbToYPiece
);
SEGasCompartmentLink
&
mInspiratoryLimbToYPiece
=
m_Compartments
->
CreateGasLink
(
mInspiratoryLimb
,
mYPiece
,
pulse
::
MechanicalVentilatorLink
::
MechanicalVentilator
InspiratoryLimbToYPiece
);
mInspiratoryLimbToYPiece
.
MapPath
(
InspiratoryLimbToYPiece
);
SEGasCompartmentLink
&
mYPieceToConnection
=
m_Compartments
->
CreateGasLink
(
mYPiece
,
mConnection
,
pulse
::
MechanicalVentilatorLink
::
YPieceToConnection
);
SEGasCompartmentLink
&
mYPieceToConnection
=
m_Compartments
->
CreateGasLink
(
mYPiece
,
mConnection
,
pulse
::
MechanicalVentilatorLink
::
MechanicalVentilator
YPieceToConnection
);
mYPieceToConnection
.
MapPath
(
YPieceToConnection
);
SEGasCompartmentLink
&
mConnectionToEnvironment
=
m_Compartments
->
CreateGasLink
(
mConnection
,
*
eEnvironment
,
pulse
::
MechanicalVentilatorLink
::
ConnectionToEnvironment
);
SEGasCompartmentLink
&
mConnectionToEnvironment
=
m_Compartments
->
CreateGasLink
(
mConnection
,
*
eEnvironment
,
pulse
::
MechanicalVentilatorLink
::
MechanicalVentilator
ConnectionToEnvironment
);
mConnectionToEnvironment
.
MapPath
(
ConnectionToEnvironment
);
SEGasCompartmentGraph
&
gMechanicalVentilator
=
m_Compartments
->
GetMechanicalVentilatorGraph
();
...
...
@@ -4574,16 +4578,85 @@ void PulseController::SetupMechanicalVentilator()
//Now do the combined transport setup
// Grab the mouth from pulmonary
SEGasCompartment
*
pMouth
=
m_Compartments
->
GetGasCompartment
(
pulse
::
PulmonaryCompartment
::
Mouth
);
SEGasCompartmentLink
&
mConnectionToMouth
=
m_Compartments
->
CreateGasLink
(
mConnection
,
*
pMouth
,
pulse
::
MechanicalVentilatorLink
::
ConnectionToMouth
);
SEGasCompartmentLink
&
mConnectionToMouth
=
m_Compartments
->
CreateGasLink
(
mConnection
,
*
pMouth
,
pulse
::
MechanicalVentilatorLink
::
MechanicalVentilator
ConnectionToMouth
);
mConnectionToMouth
.
MapPath
(
ConnectionToMouth
);
SEGasCompartmentGraph
&
gCombinedRespiratoryMechanicalVentilator
=
m_Compartments
->
GetRespiratoryAndMechanicalVentilatorGraph
();
gCombinedRespiratoryMechanicalVentilator
.
AddGraph
(
gRespiratory
);
gCombinedRespiratoryMechanicalVentilator
.
AddGraph
(
gMechanicalVentilator
);
gCombinedRespiratoryMechanicalVentilator
.
RemoveLink
(
pulse
::
PulmonaryLink
::
EnvironmentToMouth
);
gCombinedRespiratoryMechanicalVentilator
.
RemoveLink
(
pulse
::
MechanicalVentilatorLink
::
ConnectionToEnvironment
);
gCombinedRespiratoryMechanicalVentilator
.
RemoveLink
(
pulse
::
MechanicalVentilatorLink
::
MechanicalVentilator
ConnectionToEnvironment
);
gCombinedRespiratoryMechanicalVentilator
.
AddLink
(
mConnectionToMouth
);
gCombinedRespiratoryMechanicalVentilator
.
StateChange
();
///////////////////////////////////
// LIQUID (AEROSOL) COMPARTMENTS //
// Grab from pulmonary
SELiquidCompartment
*
lMouth
=
m_Compartments
->
GetLiquidCompartment
(
pulse
::
PulmonaryCompartment
::
Mouth
);
SELiquidCompartment
*
lEnvironment
=
m_Compartments
->
GetLiquidCompartment
(
pulse
::
EnvironmentCompartment
::
Ambient
);
// Mechanical Ventilator Compartments
SELiquidCompartment
&
lVentilator
=
m_Compartments
->
CreateLiquidCompartment
(
pulse
::
MechanicalVentilatorCompartment
::
MechanicalVentilator
);
lVentilator
.
MapNode
(
Ventilator
);
SELiquidCompartment
&
lExpiratoryValve
=
m_Compartments
->
CreateLiquidCompartment
(
pulse
::
MechanicalVentilatorCompartment
::
MechanicalVentilatorExpiratoryValve
);
lExpiratoryValve
.
MapNode
(
ExpiratoryValve
);
SELiquidCompartment
&
lInspiratoryValve
=
m_Compartments
->
CreateLiquidCompartment
(
pulse
::
MechanicalVentilatorCompartment
::
MechanicalVentilatorInspiratoryValve
);
lInspiratoryValve
.
MapNode
(
InspiratoryValve
);
SELiquidCompartment
&
lExpiratoryLimb
=
m_Compartments
->
CreateLiquidCompartment
(
pulse
::
MechanicalVentilatorCompartment
::
MechanicalVentilatorExpiratoryLimb
);
lExpiratoryLimb
.
MapNode
(
ExpiratoryLimb
);
SELiquidCompartment
&
lInspiratoryLimb
=
m_Compartments
->
CreateLiquidCompartment
(
pulse
::
MechanicalVentilatorCompartment
::
MechanicalVentilatorInspiratoryLimb
);
lInspiratoryLimb
.
MapNode
(
InspiratoryLimb
);
SELiquidCompartment
&
lYPiece
=
m_Compartments
->
CreateLiquidCompartment
(
pulse
::
MechanicalVentilatorCompartment
::
MechanicalVentilatorYPiece
);
lYPiece
.
MapNode
(
YPiece
);
SELiquidCompartment
&
lConnection
=
m_Compartments
->
CreateLiquidCompartment
(
pulse
::
MechanicalVentilatorCompartment
::
MechanicalVentilatorConnection
);
lConnection
.
MapNode
(
Connection
);
//Links
SELiquidCompartmentLink
&
lConnectionToMouth
=
m_Compartments
->
CreateLiquidLink
(
lConnection
,
*
lMouth
,
pulse
::
MechanicalVentilationLink
::
ConnectionToMouth
);
lConnectionToMouth
.
MapPath
(
ConnectionToMouth
);
SELiquidCompartmentLink
&
lVentilatorToExpiratoryValve
=
m_Compartments
->
CreateLiquidLink
(
lVentilator
,
lExpiratoryValve
,
pulse
::
MechanicalVentilatorLink
::
MechanicalVentilatorToExpiratoryValve
);
lVentilatorToExpiratoryValve
.
MapPath
(
VentilatorToExpiratoryValve
);
SELiquidCompartmentLink
&
lVentilatorToInspiratoryValve
=
m_Compartments
->
CreateLiquidLink
(
lVentilator
,
lInspiratoryValve
,
pulse
::
MechanicalVentilatorLink
::
MechanicalVentilatorToInspiratoryValve
);
lVentilatorToInspiratoryValve
.
MapPath
(
VentilatorToInspiratoryValve
);
SELiquidCompartmentLink
&
lExpiratoryLimbToExpiratoryValve
=
m_Compartments
->
CreateLiquidLink
(
lExpiratoryLimb
,
lExpiratoryValve
,
pulse
::
MechanicalVentilatorLink
::
MechanicalVentilatorExpiratoryLimbToExpiratoryValve
);
lExpiratoryLimbToExpiratoryValve
.
MapPath
(
ExpiratoryLimbToExpiratoryValve
);
SELiquidCompartmentLink
&
lInspiratoryValveToInspiratoryLimb
=
m_Compartments
->
CreateLiquidLink
(
lInspiratoryValve
,
lInspiratoryLimb
,
pulse
::
MechanicalVentilatorLink
::
MechanicalVentilatorInspiratoryValveToInspiratoryLimb
);
lInspiratoryValveToInspiratoryLimb
.
MapPath
(
InspiratoryValveToInspiratoryLimb
);
SELiquidCompartmentLink
&
lExpiratoryLimbToYPiece
=
m_Compartments
->
CreateLiquidLink
(
lExpiratoryLimb
,
lYPiece
,
pulse
::
MechanicalVentilatorLink
::
MechanicalVentilatorExpiratoryLimbToYPiece
);
lExpiratoryLimbToYPiece
.
MapPath
(
ExpiratoryLimbToYPiece
);
SELiquidCompartmentLink
&
lInspiratoryLimbToYPiece
=
m_Compartments
->
CreateLiquidLink
(
lInspiratoryLimb
,
lYPiece
,
pulse
::
MechanicalVentilatorLink
::
MechanicalVentilatorInspiratoryLimbToYPiece
);
lInspiratoryLimbToYPiece
.
MapPath
(
InspiratoryLimbToYPiece
);
SELiquidCompartmentLink
&
lYPieceToConnection
=
m_Compartments
->
CreateLiquidLink
(
lYPiece
,
lConnection
,
pulse
::
MechanicalVentilatorLink
::
MechanicalVentilatorYPieceToConnection
);
lYPieceToConnection
.
MapPath
(
YPieceToConnection
);
SELiquidCompartmentLink
&
lConnectionToEnvironment
=
m_Compartments
->
CreateLiquidLink
(
lConnection
,
*
lEnvironment
,
pulse
::
MechanicalVentilatorLink
::
MechanicalVentilatorConnectionToEnvironment
);
lConnectionToEnvironment
.
MapPath
(
ConnectionToEnvironment
);
//Graph
SELiquidCompartmentGraph
&
lCombinedMechanicalVentilator
=
m_Compartments
->
GetAerosolAndMechanicalVentilatorGraph
();
//Respiratory Graph
lCombinedMechanicalVentilator
.
AddGraph
(
lAerosol
);
lCombinedMechanicalVentilator
.
RemoveLink
(
pulse
::
PulmonaryLink
::
EnvironmentToMouth
);
//Mechanical Ventilator Additions
lCombinedMechanicalVentilator
.
AddCompartment
(
lVentilator
);
lCombinedMechanicalVentilator
.
AddCompartment
(
lExpiratoryValve
);
lCombinedMechanicalVentilator
.
AddCompartment
(
lInspiratoryValve
);
lCombinedMechanicalVentilator
.
AddCompartment
(
lExpiratoryLimb
);
lCombinedMechanicalVentilator
.
AddCompartment
(
lInspiratoryLimb
);
lCombinedMechanicalVentilator
.
AddCompartment
(
lYPiece
);
lCombinedMechanicalVentilator
.
AddCompartment
(
lConnection
);
lCombinedMechanicalVentilator
.
AddLink
(
lVentilatorToExpiratoryValve
);
lCombinedMechanicalVentilator
.
AddLink
(
lVentilatorToInspiratoryValve
);
lCombinedMechanicalVentilator
.
AddLink
(
lExpiratoryLimbToExpiratoryValve
);
lCombinedMechanicalVentilator
.
AddLink
(
lInspiratoryValveToInspiratoryLimb
);
lCombinedMechanicalVentilator
.
AddLink
(
lExpiratoryLimbToYPiece
);
lCombinedMechanicalVentilator
.
AddLink
(
lInspiratoryLimbToYPiece
);
lCombinedMechanicalVentilator
.
AddLink
(
lYPieceToConnection
);
//lCombinedMechanicalVentilator.AddLink(lConnectionToEnvironment);
//Connection to Respiratory
lCombinedMechanicalVentilator
.
AddLink
(
lConnectionToMouth
);
//Set it
lCombinedMechanicalVentilator
.
StateChange
();
}
void
PulseController
::
SetupNasalCannula
()
...
...
src/cpp/cpm/equipment/MechanicalVentilator.cpp
View file @
58df766d
...
...
@@ -79,7 +79,7 @@ void MechanicalVentilator::SetUp()
// Compartments
m_Environment
=
m_data
.
GetCompartments
().
GetGasCompartment
(
pulse
::
EnvironmentCompartment
::
Ambient
);
m_ventilator
=
m_data
.
GetCompartments
().
GetGasCompartment
(
pulse
::
MechanicalVentilatorCompartment
::
Ventilator
);
m_ventilator
=
m_data
.
GetCompartments
().
GetGasCompartment
(
pulse
::
MechanicalVentilatorCompartment
::
Mechanical
Ventilator
);
// Paths
m_pEnvironmentToVentilator
=
m_data
.
GetCircuits
().
GetMechanicalVentilatorCircuit
().
GetPath
(
pulse
::
MechanicalVentilatorPath
::
EnvironmentToVentilator
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment