The Respiratory System class handles the analysis and storage of data related the respiratory physiology and pathology. More...

#include <Respiratory.h>

Inherits SERespiratorySystem, PulseRespiratorySystem, and PulseSystem.

Public Member Functions

virtual ~Respiratory ()
 
void Clear ()
 
- Public Member Functions inherited from SERespiratorySystem
 SERespiratorySystem (Logger *logger)
 
virtual ~SERespiratorySystem ()
 
virtual const SEScalarGetScalar (const std::string &name)
 
virtual bool HasAlveolarArterialGradient () const
 
virtual SEScalarPressureGetAlveolarArterialGradient ()
 
virtual double GetAlveolarArterialGradient (const PressureUnit &unit) const
 
virtual bool HasCarricoIndex () const
 
virtual SEScalarPressureGetCarricoIndex ()
 
virtual double GetCarricoIndex (const PressureUnit &unit) const
 
virtual bool HasEndTidalCarbonDioxideFraction () const
 
virtual SEScalar0To1GetEndTidalCarbonDioxideFraction ()
 
virtual double GetEndTidalCarbonDioxideFraction () const
 
virtual bool HasEndTidalCarbonDioxidePressure () const
 
virtual SEScalarPressureGetEndTidalCarbonDioxidePressure ()
 
virtual double GetEndTidalCarbonDioxidePressure (const PressureUnit &unit) const
 
virtual bool HasExpiratoryFlow () const
 
virtual SEScalarVolumePerTimeGetExpiratoryFlow ()
 
virtual double GetExpiratoryFlow (const VolumePerTimeUnit &unit) const
 
virtual bool HasInspiratoryExpiratoryRatio () const
 
virtual SEScalarGetInspiratoryExpiratoryRatio ()
 
virtual double GetInspiratoryExpiratoryRatio () const
 
virtual bool HasInspiratoryFlow () const
 
virtual SEScalarVolumePerTimeGetInspiratoryFlow ()
 
virtual double GetInspiratoryFlow (const VolumePerTimeUnit &unit) const
 
virtual bool HasPulmonaryCompliance () const
 
virtual SEScalarFlowComplianceGetPulmonaryCompliance ()
 
virtual double GetPulmonaryCompliance (const FlowComplianceUnit &unit) const
 
virtual bool HasPulmonaryResistance () const
 
virtual SEScalarFlowResistanceGetPulmonaryResistance ()
 
virtual double GetPulmonaryResistance (const FlowResistanceUnit &unit) const
 
virtual bool HasRespirationDriverPressure () const
 
virtual SEScalarPressureGetRespirationDriverPressure ()
 
virtual double GetRespirationDriverPressure (const PressureUnit &unit) const
 
virtual bool HasRespirationMusclePressure () const
 
virtual SEScalarPressureGetRespirationMusclePressure ()
 
virtual double GetRespirationMusclePressure (const PressureUnit &unit) const
 
virtual bool HasRespirationRate () const
 
virtual SEScalarFrequencyGetRespirationRate ()
 
virtual double GetRespirationRate (const FrequencyUnit &unit) const
 
virtual bool HasSpecificVentilation () const
 
virtual SEScalarGetSpecificVentilation ()
 
virtual double GetSpecificVentilation () const
 
virtual bool HasTidalVolume () const
 
virtual SEScalarVolumeGetTidalVolume ()
 
virtual double GetTidalVolume (const VolumeUnit &unit) const
 
virtual bool HasTotalAlveolarVentilation () const
 
virtual SEScalarVolumePerTimeGetTotalAlveolarVentilation ()
 
virtual double GetTotalAlveolarVentilation (const VolumePerTimeUnit &unit) const
 
virtual bool HasTotalDeadSpaceVentilation () const
 
virtual SEScalarVolumePerTimeGetTotalDeadSpaceVentilation ()
 
virtual double GetTotalDeadSpaceVentilation (const VolumePerTimeUnit &unit) const
 
virtual bool HasTotalPulmonaryVentilation () const
 
virtual SEScalarVolumePerTimeGetTotalPulmonaryVentilation ()
 
virtual double GetTotalPulmonaryVentilation (const VolumePerTimeUnit &unit) const
 
virtual bool HasTotalLungVolume () const
 
virtual SEScalarVolumeGetTotalLungVolume ()
 
virtual double GetTotalLungVolume (const VolumeUnit &unit) const
 
virtual bool HasTranspulmonaryPressure () const
 
virtual SEScalarPressureGetTranspulmonaryPressure ()
 
virtual double GetTranspulmonaryPressure (const PressureUnit &unit) const
 
- Public Member Functions inherited from SESystem
 SESystem (Logger *logger)
 
virtual ~SESystem ()
 
- Public Member Functions inherited from Loggable
 Loggable ()
 
 Loggable (Logger *log)
 
virtual ~Loggable ()
 
virtual LoggerGetLogger () const
 
virtual void Debug (std::string const &msg, std::string const &origin=empty) const
 
virtual void Debug (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Debug (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Info (std::string const &msg, std::string const &origin=empty) const
 
virtual void Info (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Info (const std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Info (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Warning (std::string const &msg, std::string const &origin=empty) const
 
virtual void Warning (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Warning (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Error (std::string const &msg, std::string const &origin=empty) const
 
virtual void Error (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Error (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Fatal (std::string const &msg, std::string const &origin=empty) const
 
virtual void Fatal (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Fatal (std::ostream &msg, std::string const &origin=empty) const
 

Protected Member Functions

 Respiratory (PulseController &data)
 
void Initialize ()
 Initializes system properties to valid homeostatic values. More...
 
void SetUp ()
 Initializes parameters for Respiratory Class. More...
 
void AtSteadyState ()
 Respiratory system at steady state. More...
 
void PreProcess ()
 Respiratory system preprocess function. More...
 
void Process ()
 Respiratory system process function. More...
 
void PostProcess ()
 Respiratory system postprocess function. More...
 
bool CalculatePulmonaryFunctionTest (SEPulmonaryFunctionTest &pft) const
 Populate the Pulmonary Function Test Assessment. More...
 
void TuneCircuit ()
 Run the circuit standalone for a little to get it into a good starting state. More...
 
void COPD ()
 Chronic Obstructive Pulmonary Disease (COPD) More...
 
void ImpairedAlveolarExchange ()
 Impaired Alveolar Exchange. More...
 
void LobarPneumonia ()
 Lobar Pneumonia. More...
 
void UpdatePleuralCompliance ()
 Chest wall compliance modifier. More...
 
void AirwayObstruction ()
 Airway obstruction. More...
 
void BronchoConstriction ()
 Bronchoconstriction. More...
 
void BronchoDilation ()
 Bronchodilation PD effects. More...
 
void Intubation ()
 Intubation, including esophageal, left mainstem, and right mainstem. More...
 
void Pneumothorax ()
 Tension pneumothorax. More...
 
void ConsciousRespiration ()
 Conscious respiration. More...
 
void ProcessConsciousRespiration (SEConsciousRespirationCommand &cmd)
 Process conscious respiration. More...
 
void MechanicalVentilation ()
 Modifies the pressure and/or flow at the mouth. More...
 
void Apnea ()
 Apply apnea action. More...
 
void RespiratoryDriver ()
 Respiratory driver pressure source. More...
 
void UpdateObstructiveResistance ()
 Update obstructive (airway) resistance. More...
 
void UpdateIERatio ()
 Update the inspiratory-expiratory ratio. More...
 
void UpdateAlveoliCompliance (double dCompilanceScalingFactor, double dLeftLungFraction, double dRightLungFraction)
 Update Alveoli Compliance. More...
 
void UpdateGasDiffusionSurfaceArea (double dFractionalArea, double dLeftLungFraction, double dRightLungFraction)
 Update Gas Diffusion Surface Area. More...
 
void UpdatePulmonaryCapillaryResistance (double dResistanceScalingFactor, double dLeftLungFraction, double dRightLungFraction)
 Update Pulmonary Capillary Resistance. More...
 
void DoLeftNeedleDecompression (double dFlowResistance)
 Left Side Needle Decompression. More...
 
void DoRightNeedleDecompression (double dFlowResistance)
 Right Side Needle Decompression. More...
 
void ProcessAerosolSubstances ()
 Compute deposited mass, update localized PD effects. More...
 
double VolumeToDriverPressure (double TargetVolume)
 Peak Driver Pressure Based on Target Volume. More...
 
void CalculateVitalSigns ()
 Calculates key respiratory physiological parameters. More...
 

Protected Attributes

PulseControllerm_data
 
double m_InitialExpiratoryReserveVolume_L
 
double m_InitialFunctionalResidualCapacity_L
 
double m_InitialInspiratoryCapacity_L
 
double m_InitialResidualVolume_L
 
bool m_BreathingCycle
 
bool m_NotBreathing
 
double m_TopBreathTotalVolume_L
 
double m_TopBreathAlveoliVolume_L
 
double m_TopBreathDeadSpaceVolume_L
 
double m_TopBreathPleuralPressure_cmH2O
 
double m_LastCardiacCycleBloodPH
 
double m_TopCarinaO2
 
double m_TopBreathElapsedTime_min
 
double m_BottomBreathElapsedTime_min
 
double m_BottomBreathTotalVolume_L
 
double m_BottomBreathAlveoliVolume_L
 
double m_BottomBreathDeadSpaceVolume_L
 
double m_BottomBreathPleuralPressure_cmH2O
 
SERunningAveragem_BloodPHRunningAverage
 
double m_ArterialO2PartialPressure_mmHg
 
double m_ArterialCO2PartialPressure_mmHg
 
double m_BreathingCycleTime_s
 
double m_DefaultDrivePressure_cmH2O
 
double m_DriverInspirationTime_s
 
double m_DriverPressure_cmH2O
 
double m_DriverPressureMin_cmH2O
 
double m_ElapsedBreathingCycleTime_min
 
double m_IEscaleFactor
 
double m_InstantaneousFunctionalResidualCapacity_L
 
double m_MaxDriverPressure_cmH2O
 
double m_PeakRespiratoryDrivePressure_cmH2O
 
double m_PreviousTargetAlveolarVentilation_L_Per_min
 
double m_VentilationFrequency_Per_min
 
double m_VentilationToTidalVolumeSlope
 
SERunningAveragem_ArterialO2RunningAverage_mmHg
 
SERunningAveragem_ArterialCO2RunningAverage_mmHg
 
bool m_ConsciousBreathing
 
double m_ConsciousRespirationPeriod_s
 
double m_ConsciousRespirationRemainingPeriod_s
 
double m_ExpiratoryReserveVolumeFraction
 
double m_InspiratoryCapacityFraction
 
double m_ConsciousStartPressure_cmH2O
 
double m_ConsciousEndPressure_cmH2O
 
double m_dt_s
 
double m_dt_min
 
double m_CentralControlGainConstant
 
double m_DefaultOpenResistance_cmH2O_s_Per_L
 
double m_DefaultClosedResistance_cmH2O_s_Per_L
 
double m_PeripheralControlGainConstant
 
double m_PleuralComplianceSensitivity_Per_L
 
double m_RespOpenResistance_cmH2O_s_Per_L
 
double m_RespClosedResistance_cmH2O_s_Per_L
 
double m_VentilationTidalVolumeIntercept
 
double m_VentilatoryOcclusionPressure_cmH2O
 
double m_MinimumAllowableTidalVolume_L
 
double m_MinimumAllowableInpiratoryAndExpiratoryPeriod_s
 
double m_AverageLocalTissueBronchodilationEffects
 
SEPatientm_Patient
 
SEPatientActionCollectionm_PatientActions
 
SEGasCompartmentm_Environment
 
SELiquidCompartmentm_AerosolMouth
 
SELiquidCompartmentm_AerosolCarina
 
SELiquidCompartmentm_AerosolLeftDeadSpace
 
SELiquidCompartmentm_AerosolLeftAlveoli
 
SELiquidCompartmentm_AerosolRightDeadSpace
 
SELiquidCompartmentm_AerosolRightAlveoli
 
SELiquidCompartmentm_LeftLungExtravascular
 
SELiquidCompartmentm_RightLungExtravascular
 
SEGasCompartmentm_Lungs
 
SEGasCompartmentm_Carina
 
SEGasSubstanceQuantitym_CarinaO2
 
SELiquidSubstanceQuantitym_AortaO2
 
SELiquidSubstanceQuantitym_AortaCO2
 
SEGasSubstanceQuantitym_LeftAlveoliO2
 
SEGasSubstanceQuantitym_RightAlveoliO2
 
std::vector< SELiquidCompartment * > m_AerosolEffects
 
SEGasCompartmentm_MechanicalVentilatorConnection
 
SELiquidCompartmentm_MechanicalVentilatorAerosolConnection
 
SEFluidCircuitm_RespiratoryCircuit
 
SEFluidCircuitNodem_Mouth
 
SEFluidCircuitNodem_LeftAlveoli
 
SEFluidCircuitNodem_LeftDeadSpace
 
SEFluidCircuitNodem_LeftPleural
 
SEFluidCircuitNodem_RespiratoryMuscle
 
SEFluidCircuitNodem_RightAlveoli
 
SEFluidCircuitNodem_RightDeadSpace
 
SEFluidCircuitNodem_RightPleural
 
SEFluidCircuitNodem_Ambient
 
SEFluidCircuitNodem_Stomach
 
SEFluidCircuitPathm_CarinaToLeftAnatomicDeadSpace
 
SEFluidCircuitPathm_CarinaToRightAnatomicDeadSpace
 
SEFluidCircuitPathm_LeftAnatomicDeadSpaceToLeftAlveoli
 
SEFluidCircuitPathm_RightAnatomicDeadSpaceToRightAlveoli
 
SEFluidCircuitPathm_RightPleuralToRespiratoryMuscle
 
SEFluidCircuitPathm_LeftPleuralToRespiratoryMuscle
 
SEFluidCircuitPathm_DriverPressurePath
 
SEFluidCircuitPathm_LeftDriverPressurePath
 
SEFluidCircuitPathm_MouthToCarina
 
SEFluidCircuitPathm_MouthToStomach
 
SEFluidCircuitPathm_EnvironmentToLeftChestLeak
 
SEFluidCircuitPathm_EnvironmentToRightChestLeak
 
SEFluidCircuitPathm_LeftAlveoliLeakToLeftPleural
 
SEFluidCircuitPathm_RightAlveoliLeakToRightPleural
 
SEFluidCircuitPathm_LeftPleuralToEnvironment
 
SEFluidCircuitPathm_RightPleuralToEnvironment
 
SEFluidCircuitPathm_RightAlveoliToRightPleuralConnection
 
SEFluidCircuitPathm_LeftAlveoliToLeftPleuralConnection
 
SEFluidCircuitPathm_RightAnatomicDeadSpaceToRightPleuralConnection
 
SEFluidCircuitPathm_LeftAnatomicDeadSpaceToLeftPleuralConnection
 
SEFluidCircuitPathm_RightPulmonaryCapillary
 
SEFluidCircuitPathm_LeftPulmonaryCapillary
 
SEFluidCircuitPathm_ConnectionToMouth
 
SEFluidCircuitPathm_GroundToConnection
 
SEFluidCircuitCalculatorm_Calculator
 
SEGasTransporterm_GasTransporter
 
SELiquidTransporterm_AerosolTransporter
 
- Protected Attributes inherited from SERespiratorySystem
SEScalarPressurem_AlveolarArterialGradient
 
SEScalarPressurem_CarricoIndex
 
SEScalar0To1m_EndTidalCarbonDioxideFraction
 
SEScalarPressurem_EndTidalCarbonDioxidePressure
 
SEScalarVolumePerTimem_ExpiratoryFlow
 
SEScalarm_InspiratoryExpiratoryRatio
 
SEScalarVolumePerTimem_InspiratoryFlow
 
SEScalarFlowCompliancem_PulmonaryCompliance
 
SEScalarFlowResistancem_PulmonaryResistance
 
SEScalarPressurem_RespirationDriverPressure
 
SEScalarPressurem_RespirationMusclePressure
 
SEScalarFrequencym_RespirationRate
 
SEScalarm_SpecificVentilation
 
SEScalarVolumem_TidalVolume
 
SEScalarVolumePerTimem_TotalAlveolarVentilation
 
SEScalarVolumePerTimem_TotalDeadSpaceVentilation
 
SEScalarVolumem_TotalLungVolume
 
SEScalarVolumePerTimem_TotalPulmonaryVentilation
 
SEScalarPressurem_TranspulmonaryPressure
 
- Protected Attributes inherited from SESystem
std::stringstream m_ss
 
- Protected Attributes inherited from Loggable
Loggerm_Logger
 

Friends

class PBPulsePhysiology
 
class PulseController
 
class PulseEngineTest
 

Additional Inherited Members

- Static Public Member Functions inherited from SESystem
static const SEScalarGetScalar (const std::string &name, std::vector< SESystem *> *systems)
 
- Static Public Attributes inherited from Loggable
static const std::string empty
 

Detailed Description

The Respiratory System class handles the analysis and storage of data related the respiratory physiology and pathology.

The goal of the Respiratory System class is to handle the analysis and storage of data representing the ventilation and gas exchange of the human respiratory system. The class handles the analysis of changes in the lungs volume and pressure data during the flow and transfer of gases between the lungs, the blood and the outside environment. The class updates the volume and volume fractions of gases in the lungs, and ensures the integration and flow of data between the respiratory system and the anesthesia machine during mechanical ventilation.

Constructor & Destructor Documentation

◆ Respiratory()

Respiratory::Respiratory ( PulseController data)
protected

◆ ~Respiratory()

Respiratory::~Respiratory ( )
virtual

Member Function Documentation

◆ AirwayObstruction()

void Respiratory::AirwayObstruction ( )
protected

Airway obstruction.

Various factors can trigger upper airway obstruction. The engine handles airway obstruction that arise from the partial or complete obstruction of the upper airways by foreign objects. The model accounts for such obstruction by setting the flow resistance of the trachea compartment in proportion to the severity of the obstruction. The function updates the tracheal flow resistance by modifying the resistance across the airway to carina node path.

◆ Apnea()

void Respiratory::Apnea ( )
protected

Apply apnea action.

Parameters
None
Returns
void

This reduces the respiratory driver pressure source amplitude by the percentage defined by the action severity.

◆ AtSteadyState()

void Respiratory::AtSteadyState ( )
protectedvirtual

Respiratory system at steady state.

Initializes respiratory conditions if any are present.

  • COPD
  • Lobar Pneumonia
  • ImpairedAlveolarExchange

Reimplemented from PulseSystem.

◆ BronchoConstriction()

void Respiratory::BronchoConstriction ( )
protected

Bronchoconstriction.

Bronchoconstriction involves the tightening of smooth muscles surrounding bronchi. The effect of such airway constriction is the reduction of air flow or increase of flow resistance of the lower airways. This model handles bronchoconstriction by increasing the flow resistances of the bronchi compartments. The function updates the bronchial resistances in proportion to the severity of the bronchoconstriction.

◆ BronchoDilation()

void Respiratory::BronchoDilation ( )
protected

Bronchodilation PD effects.

This reduces the bronchi resitances based on drug PD effects (i.e., plasma concentrations).

◆ CalculatePulmonaryFunctionTest()

bool Respiratory::CalculatePulmonaryFunctionTest ( SEPulmonaryFunctionTest pft) const
protected

Populate the Pulmonary Function Test Assessment.

Parameters
pftpft data
Returns
success true, if everything worked out
Todo:
Insert more PFT calculations here

◆ CalculateVitalSigns()

void Respiratory::CalculateVitalSigns ( )
protected

Calculates key respiratory physiological parameters.

Calculates the respiration rate and tidal volume. For each breathing cycle, the tidal volume is calculated by identifying the peaks in the total lung volume. The tidal volume of a particular breathing cycle is then calculated by taking the difference between the maximum and minimum values of the total lung volume. The respiration rate is calculated by measuring the duration for one complete breathing cycle and then converting the duration to the number of breaths per minute.

Event:
Patient: Severe ARDS: Carrico Index is below 100 mmHg

[209]

Event:
Patient: Moderate ARDS: Carrico Index is below 200 mmHg

[209]

Event:
Patient: Mild ARDS: Carrico Index is below 300 mmHg

[209]

Event:
Patient: End ARDS: Carrico Index is above 305 mmHg
Todo:
Move to blood chemistry
Event:
Patient: Bradypnea: Respiration rate is below 10 breaths per minute The patient has bradypnea.

[195]

Event:
Patient: End Bradypnea Event. The respiration rate has risen above 10. The patient is no longer considered to have bradypnea.
Event:
Patient: Tachypnea: Respiration rate is above 20 breaths per minute. The patient has tachypnea.
Event:
Patient: End Tachypnea Event. The respiration rate has fallen below 19.5. The patient is no longer considered to have tachypnea.
Event:
Patient: Respiratory Acidosis: event is triggered when blood pH is below 7.36 The patient has respiratory acidosis.
Event:
Patient: arterial blood ph has dropped below 6.5.
Irreversible:
Extreme respiratory Acidosis: blood pH below 6.5.
Event:
Patient: End Respiratory Acidosis Event. The pH value has risen above 7.38. The patient is no longer considered to have respiratory acidosis.
Event:
Patient: Respiratory Alkalosis: event is triggered when blood pH is above 7.45 The patient has respiratory alkalosis.
Event:
Patient: arterial blood ph has gotten above 8.5.
Irreversible:
Extreme respiratory Alkalosis: blood pH above 8.5.
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.

◆ Clear()

void Respiratory::Clear ( )
virtual

Reimplemented from SERespiratorySystem.

◆ ConsciousRespiration()

void Respiratory::ConsciousRespiration ( )
protected

Conscious respiration.

Parameters
None
Returns
void

This method determines when to process a conscious respiration command and removes the command from the stack.

◆ COPD()

void Respiratory::COPD ( )
protected

Chronic Obstructive Pulmonary Disease (COPD)

Parameters
None
Returns
void

This method handles the COPD condition. It determines if the patient has COPD, and if so, calculates a set of multipliers to model the various symptoms. This method should only run once per simulation. Note that the bronchitis symptom (airway obstruction) is handled by another method that is called every time-step in pre-process.

◆ DoLeftNeedleDecompression()

void Respiratory::DoLeftNeedleDecompression ( double  dFlowResistance)
protected

Left Side Needle Decompression.

Parameters
dFlowResistance- Resistance value for air flow through the needle

Used for left side needle decompression. this is an intervention (action) used to treat left side tension pneumothorax

◆ DoRightNeedleDecompression()

void Respiratory::DoRightNeedleDecompression ( double  dFlowResistance)
protected

Right Side Needle Decompression.

Parameters
dFlowResistance- Resistance value for air flow through the needle

Used for right side needle decompression. this is an intervention (action) used to treat right side tension pneumothorax

◆ ImpairedAlveolarExchange()

void Respiratory::ImpairedAlveolarExchange ( )
protected

Impaired Alveolar Exchange.

Parameters
None
Returns
void

This method handles the Impaired Alveolar Exchange condition.

Error:
Fatal: The Impaired Alveolar Exchange action must include either a surface area of fraction.
Error:
Error: The Impaired Alveolar Exchange action cannot have both an impaired surface area and impaired fraction defined. Defaulting to the surface area value.

◆ Initialize()

void Respiratory::Initialize ( )
protectedvirtual

Initializes system properties to valid homeostatic values.

Reimplemented from PulseSystem.

◆ Intubation()

void Respiratory::Intubation ( )
protected

Intubation, including esophageal, left mainstem, and right mainstem.

During mechanical ventilation, one of the clinical complications of endotracheal intubation is esophageal intubation. This involves the misplacement of the tube down the esophagus. Such event prohibits air flow into or out of the lungs. The Biogers circuit handles this respiratory distress by manipulating the tracheal resistance. When esophageal intubation incidence is triggered, significantly large resistance is assigned to the trachea compartment. Otherwise, the esophageal compartment resistance is set to be significantly large value under normal condition.

Todo:
Make this a modifier (i.e. multiplier), instead of setting it directly

◆ LobarPneumonia()

void Respiratory::LobarPneumonia ( )
protected

Lobar Pneumonia.

Parameters
None
Returns
void

This method handles the lobar pneumonia condition. It determines if the patient has lobar pneumonia and calculates a set of multipliers to model the various symptoms. This method should only run once per simulation.

◆ MechanicalVentilation()

void Respiratory::MechanicalVentilation ( )
protected

Modifies the pressure and/or flow at the mouth.

Handles the mechanical ventilation action that adds a flow and pressure source to instantaneously set the respiratory connection (mouth) to user specified values.

◆ Pneumothorax()

void Respiratory::Pneumothorax ( )
protected

Tension pneumothorax.

Pneumothorax is an abnormal accumulation of air in the pleural cavity. Tension pneumothorax occurs when air escapes into the pleural space on inspiration, but cannot return on expiration. Different types of pneumothorces are known. The engine models open (sucking chest wound) and closed (intact thoracic cage) pnumothoraces whereas occlusive dressing and needle decompression are modeled as interventions. The function models pneumothorax and needle decompression by opening respiratory circuits that allow air flows into and out of the pleural cavity. Under normal condition, the path between the lung node or the outside environment and the intrapleural cavity is blocked via significantly high resistances that serve as open switches. When open or closed pneumothorax is triggered, these resistances are reduced in proportion to the severity of the pneumothorax. This reduction permits air flow into the pleural cavity a and cause respiratory and cardiovascular distress. The function allows the selection of tension pneumothorax and/or needle decompression events on the left or right lung side. The effects on the cardiovascular system parameters is accounted through modifiers that scale in proportion to the accumulated gas.

Error:
Patient: Cannot perform an intervention if Tension Pneumothorax is not present on that side.
Error:
Patient: Cannot perform an intervention if Tension Pneumothorax is not present on that side.
Error:
Patient: can't process needle decompression if no pneumothorax is present
Error:
Patient: can't process a chest occlusive dressing if no pneumothorax is present

◆ PostProcess()

void Respiratory::PostProcess ( )
protectedvirtual

Respiratory system postprocess function.

Updates the current values of the gas volume fraction and gas volumes for the nodes in the respiratory circuit or the nodes in the combined (respiratory + anesthesia machine) circuit when the anesthesia machine is turned on.

Implements PulseSystem.

◆ PreProcess()

void Respiratory::PreProcess ( )
protectedvirtual

Respiratory system preprocess function.

Calculates the muscle pressure source that drives the respiratory system. Updates airway resistance to account for changes arising from factors like drugs and respiratory insults and interventions. Updates the chest wall variable compliance. Handles all respiratory insults and actions.

Implements PulseSystem.

◆ Process()

void Respiratory::Process ( )
protectedvirtual

Respiratory system process function.

Ensures the selection of the respiratory system with or without the anesthesia machine. Handles the integration of the anesthesia machine to the respiratory system when the anesthesia machine is turned on. The integration of the anesthesia machine to the respiratory system is handled at run time by constructing a combined circuit of the respiratory and anesthesia machine. Handles lung volume changes during alveolar gas transfer. Calculates physiological parameters such as respiration rate, tidal volume and others that belonging to the respiratory system.

Implements PulseSystem.

◆ ProcessAerosolSubstances()

void Respiratory::ProcessAerosolSubstances ( )
protected

Compute deposited mass, update localized PD effects.

For each aerosol get the SIDE coefficient to determine deposited mass in each respiratory compartment. Adjust the resistances between compartments as a function of deposited mass to reach validated data. Liquid and solid aerosols are handeled here.

◆ ProcessConsciousRespiration()

void Respiratory::ProcessConsciousRespiration ( SEConsciousRespirationCommand cmd)
protected

Process conscious respiration.

Parameters
cmd- Conscious respiration command

Processes conscious respiration commands.

◆ RespiratoryDriver()

void Respiratory::RespiratoryDriver ( )
protected

Respiratory driver pressure source.

Calculates the muscle pressure source pressure by using the chemical stimuli as feedback control mechanism. The method reads the arterial O2 and CO2 partial pressures. Using these partial pressures, the method calculates the alveolar ventilation from which the method calculates the target breathing frequency. The target breathing frequency is used in the equation for muscle pressure source. The muscle pressure source is used as a driver for ventilation. This method also calculates the drug modifiers that adjusts the depth and frequency of respiration.

Event:
Patient: Start of exhale/inhale
Event:
Patient: Maximum Pulmonary Ventilation Rate : Pulmonary ventilation exceeds maximum value
Todo:
rename "StartOfConsiousInhale"

◆ SetUp()

void Respiratory::SetUp ( )
protectedvirtual

Initializes parameters for Respiratory Class.

Initializes member variables and system level values on the common data model.

Todo:
figure out how to modify these resistances without getting the cv circuit - maybe add a parameter, like baroreceptors does

Implements PulseSystem.

◆ TuneCircuit()

void Respiratory::TuneCircuit ( )
protected

Run the circuit standalone for a little to get it into a good starting state.

  • keep volume fractions constant

◆ UpdateAlveoliCompliance()

void Respiratory::UpdateAlveoliCompliance ( double  dCompilanceScalingFactor,
double  dLeftLungFraction,
double  dRightLungFraction 
)
protected

Update Alveoli Compliance.

Parameters
dComplianceScalingFactorAlveoli compliance multiplier
dLeftLungFractionFraction of left lung affected by change in surface area (0 to 1)
dRightLungFractionFraction of right lung affected by change in surface area (0 to 1)
Returns
void

This method takes a compliance scaling factor and lung percentages (left and right) as input variables. It updates the Alveoli to Pleural compliances in order to model changes in alveoli compliance resulting from alveolus membrane damage or alveolus fluid content

◆ UpdateGasDiffusionSurfaceArea()

void Respiratory::UpdateGasDiffusionSurfaceArea ( double  dFractionArea,
double  dLeftLungFraction,
double  dRightLungFraction 
)
protected

Update Gas Diffusion Surface Area.

Parameters
dFractionAreaFractional change in gas diffusion surface area (0 to 1)
dLeftLungFractionFraction of left lung affected by change in surface area (0 to 1)
dRightLungFractionFraction of right lung affected by change in surface area (0 to 1)
Returns
void

This method takes a percent valve and lung percentages (left and right) as input variables. It updates the gas diffusion surface area in the lungs in order to model the destruction of alveoli membranes and/or lung consolidation.

◆ UpdateIERatio()

void Respiratory::UpdateIERatio ( )
protected

Update the inspiratory-expiratory ratio.

Returns
void

The inspiratory-expiratory ratio is modified based on certain actions and conditions, as well as local bronchodilation effects from aerosols.

◆ UpdateObstructiveResistance()

void Respiratory::UpdateObstructiveResistance ( )
protected

Update obstructive (airway) resistance.

Returns
void

This method takes a resistance scaling factor and lung percentages (left and right) as input variables. It updates the Carina to Dead Space path resistances in order to model airflow blockage through the bronchi and bronchioles.

◆ UpdatePleuralCompliance()

void Respiratory::UpdatePleuralCompliance ( )
protected

Chest wall compliance modifier.

Adjusts the chest wall compliance based on the pleural volume. The variable compliance allows some level of tolerance to mechanical stresses that may arise from events like airway obstruction. Currently, a linear relation with an upper bound has been used.

◆ UpdatePulmonaryCapillaryResistance()

void Respiratory::UpdatePulmonaryCapillaryResistance ( double  dResistanceScalingFactor,
double  dLeftLungPercent,
double  dRightLungPercent 
)
protected

Update Pulmonary Capillary Resistance.

Parameters
dResistanceScalingFactorPulmonary capillary resistance multiplier
dLeftLungFractionFraction of left lung affected by change in surface area (0 to 1)
dRightLungFractionFraction of right lung affected by change in surface area (0 to 1)
Returns
void

This method takes a resistance scaling factor and lung fractions (left and right) as input variables. It updates the pulmonary capillary to pulmonary vein resistance in order to model the destruction of capillaries in the alveolus membrane.

◆ VolumeToDriverPressure()

double Respiratory::VolumeToDriverPressure ( double  TargetVolume_L)
protected

Peak Driver Pressure Based on Target Volume.

Parameters
TargetVolume_LTarget tidal volume, including residual capacity (L)
Returns
Peak Driver Pressure The driver pressure required to achieve target tidal volume (cm H2O)

This method returns the peak driver pressure as a function of target tidal volume. The equation used is constructed from respiratory unit test data (see RespiratoryDriverTest).

Friends And Related Function Documentation

◆ PBPulsePhysiology

friend class PBPulsePhysiology
friend

◆ PulseController

friend class PulseController
friend

◆ PulseEngineTest

friend class PulseEngineTest
friend

Member Data Documentation

◆ m_AerosolCarina

SELiquidCompartment* Respiratory::m_AerosolCarina
protected

◆ m_AerosolEffects

std::vector<SELiquidCompartment*> Respiratory::m_AerosolEffects
protected

◆ m_AerosolLeftAlveoli

SELiquidCompartment* Respiratory::m_AerosolLeftAlveoli
protected

◆ m_AerosolLeftDeadSpace

SELiquidCompartment* Respiratory::m_AerosolLeftDeadSpace
protected

◆ m_AerosolMouth

SELiquidCompartment* Respiratory::m_AerosolMouth
protected

◆ m_AerosolRightAlveoli

SELiquidCompartment* Respiratory::m_AerosolRightAlveoli
protected

◆ m_AerosolRightDeadSpace

SELiquidCompartment* Respiratory::m_AerosolRightDeadSpace
protected

◆ m_AerosolTransporter

SELiquidTransporter* Respiratory::m_AerosolTransporter
protected

◆ m_Ambient

SEFluidCircuitNode* Respiratory::m_Ambient
protected

◆ m_AortaCO2

SELiquidSubstanceQuantity* Respiratory::m_AortaCO2
protected

◆ m_AortaO2

SELiquidSubstanceQuantity* Respiratory::m_AortaO2
protected

◆ m_ArterialCO2PartialPressure_mmHg

double Respiratory::m_ArterialCO2PartialPressure_mmHg
protected

◆ m_ArterialCO2RunningAverage_mmHg

SERunningAverage* Respiratory::m_ArterialCO2RunningAverage_mmHg
protected

◆ m_ArterialO2PartialPressure_mmHg

double Respiratory::m_ArterialO2PartialPressure_mmHg
protected

◆ m_ArterialO2RunningAverage_mmHg

SERunningAverage* Respiratory::m_ArterialO2RunningAverage_mmHg
protected

◆ m_AverageLocalTissueBronchodilationEffects

double Respiratory::m_AverageLocalTissueBronchodilationEffects
protected

◆ m_BloodPHRunningAverage

SERunningAverage* Respiratory::m_BloodPHRunningAverage
protected

◆ m_BottomBreathAlveoliVolume_L

double Respiratory::m_BottomBreathAlveoliVolume_L
protected

◆ m_BottomBreathDeadSpaceVolume_L

double Respiratory::m_BottomBreathDeadSpaceVolume_L
protected

◆ m_BottomBreathElapsedTime_min

double Respiratory::m_BottomBreathElapsedTime_min
protected

◆ m_BottomBreathPleuralPressure_cmH2O

double Respiratory::m_BottomBreathPleuralPressure_cmH2O
protected

◆ m_BottomBreathTotalVolume_L

double Respiratory::m_BottomBreathTotalVolume_L
protected

◆ m_BreathingCycle

bool Respiratory::m_BreathingCycle
protected

◆ m_BreathingCycleTime_s

double Respiratory::m_BreathingCycleTime_s
protected

◆ m_Calculator

SEFluidCircuitCalculator* Respiratory::m_Calculator
protected

◆ m_Carina

SEGasCompartment* Respiratory::m_Carina
protected

◆ m_CarinaO2

SEGasSubstanceQuantity* Respiratory::m_CarinaO2
protected

◆ m_CarinaToLeftAnatomicDeadSpace

SEFluidCircuitPath* Respiratory::m_CarinaToLeftAnatomicDeadSpace
protected

◆ m_CarinaToRightAnatomicDeadSpace

SEFluidCircuitPath* Respiratory::m_CarinaToRightAnatomicDeadSpace
protected

◆ m_CentralControlGainConstant

double Respiratory::m_CentralControlGainConstant
protected

◆ m_ConnectionToMouth

SEFluidCircuitPath* Respiratory::m_ConnectionToMouth
protected

◆ m_ConsciousBreathing

bool Respiratory::m_ConsciousBreathing
protected

◆ m_ConsciousEndPressure_cmH2O

double Respiratory::m_ConsciousEndPressure_cmH2O
protected

◆ m_ConsciousRespirationPeriod_s

double Respiratory::m_ConsciousRespirationPeriod_s
protected

◆ m_ConsciousRespirationRemainingPeriod_s

double Respiratory::m_ConsciousRespirationRemainingPeriod_s
protected

◆ m_ConsciousStartPressure_cmH2O

double Respiratory::m_ConsciousStartPressure_cmH2O
protected

◆ m_data

PulseController& Respiratory::m_data
protected

◆ m_DefaultClosedResistance_cmH2O_s_Per_L

double Respiratory::m_DefaultClosedResistance_cmH2O_s_Per_L
protected

◆ m_DefaultDrivePressure_cmH2O

double Respiratory::m_DefaultDrivePressure_cmH2O
protected

◆ m_DefaultOpenResistance_cmH2O_s_Per_L

double Respiratory::m_DefaultOpenResistance_cmH2O_s_Per_L
protected

◆ m_DriverInspirationTime_s

double Respiratory::m_DriverInspirationTime_s
protected

◆ m_DriverPressure_cmH2O

double Respiratory::m_DriverPressure_cmH2O
protected

◆ m_DriverPressureMin_cmH2O

double Respiratory::m_DriverPressureMin_cmH2O
protected

◆ m_DriverPressurePath

SEFluidCircuitPath* Respiratory::m_DriverPressurePath
protected

◆ m_dt_min

double Respiratory::m_dt_min
protected

◆ m_dt_s

double Respiratory::m_dt_s
protected

◆ m_ElapsedBreathingCycleTime_min

double Respiratory::m_ElapsedBreathingCycleTime_min
protected

◆ m_Environment

SEGasCompartment* Respiratory::m_Environment
protected

◆ m_EnvironmentToLeftChestLeak

SEFluidCircuitPath* Respiratory::m_EnvironmentToLeftChestLeak
protected

◆ m_EnvironmentToRightChestLeak

SEFluidCircuitPath* Respiratory::m_EnvironmentToRightChestLeak
protected

◆ m_ExpiratoryReserveVolumeFraction

double Respiratory::m_ExpiratoryReserveVolumeFraction
protected

◆ m_GasTransporter

SEGasTransporter* Respiratory::m_GasTransporter
protected

◆ m_GroundToConnection

SEFluidCircuitPath* Respiratory::m_GroundToConnection
protected

◆ m_IEscaleFactor

double Respiratory::m_IEscaleFactor
protected

◆ m_InitialExpiratoryReserveVolume_L

double Respiratory::m_InitialExpiratoryReserveVolume_L
protected

◆ m_InitialFunctionalResidualCapacity_L

double Respiratory::m_InitialFunctionalResidualCapacity_L
protected

◆ m_InitialInspiratoryCapacity_L

double Respiratory::m_InitialInspiratoryCapacity_L
protected

◆ m_InitialResidualVolume_L

double Respiratory::m_InitialResidualVolume_L
protected

◆ m_InspiratoryCapacityFraction

double Respiratory::m_InspiratoryCapacityFraction
protected

◆ m_InstantaneousFunctionalResidualCapacity_L

double Respiratory::m_InstantaneousFunctionalResidualCapacity_L
protected

◆ m_LastCardiacCycleBloodPH

double Respiratory::m_LastCardiacCycleBloodPH
protected

◆ m_LeftAlveoli

SEFluidCircuitNode* Respiratory::m_LeftAlveoli
protected

◆ m_LeftAlveoliLeakToLeftPleural

SEFluidCircuitPath* Respiratory::m_LeftAlveoliLeakToLeftPleural
protected

◆ m_LeftAlveoliO2

SEGasSubstanceQuantity* Respiratory::m_LeftAlveoliO2
protected

◆ m_LeftAlveoliToLeftPleuralConnection

SEFluidCircuitPath* Respiratory::m_LeftAlveoliToLeftPleuralConnection
protected

◆ m_LeftAnatomicDeadSpaceToLeftAlveoli

SEFluidCircuitPath* Respiratory::m_LeftAnatomicDeadSpaceToLeftAlveoli
protected

◆ m_LeftAnatomicDeadSpaceToLeftPleuralConnection

SEFluidCircuitPath* Respiratory::m_LeftAnatomicDeadSpaceToLeftPleuralConnection
protected

◆ m_LeftDeadSpace

SEFluidCircuitNode* Respiratory::m_LeftDeadSpace
protected

◆ m_LeftDriverPressurePath

SEFluidCircuitPath* Respiratory::m_LeftDriverPressurePath
protected

◆ m_LeftLungExtravascular

SELiquidCompartment* Respiratory::m_LeftLungExtravascular
protected

◆ m_LeftPleural

SEFluidCircuitNode* Respiratory::m_LeftPleural
protected

◆ m_LeftPleuralToEnvironment

SEFluidCircuitPath* Respiratory::m_LeftPleuralToEnvironment
protected

◆ m_LeftPleuralToRespiratoryMuscle

SEFluidCircuitPath* Respiratory::m_LeftPleuralToRespiratoryMuscle
protected

◆ m_LeftPulmonaryCapillary

SEFluidCircuitPath* Respiratory::m_LeftPulmonaryCapillary
protected

◆ m_Lungs

SEGasCompartment* Respiratory::m_Lungs
protected

◆ m_MaxDriverPressure_cmH2O

double Respiratory::m_MaxDriverPressure_cmH2O
protected

◆ m_MechanicalVentilatorAerosolConnection

SELiquidCompartment* Respiratory::m_MechanicalVentilatorAerosolConnection
protected

◆ m_MechanicalVentilatorConnection

SEGasCompartment* Respiratory::m_MechanicalVentilatorConnection
protected

◆ m_MinimumAllowableInpiratoryAndExpiratoryPeriod_s

double Respiratory::m_MinimumAllowableInpiratoryAndExpiratoryPeriod_s
protected

◆ m_MinimumAllowableTidalVolume_L

double Respiratory::m_MinimumAllowableTidalVolume_L
protected

◆ m_Mouth

SEFluidCircuitNode* Respiratory::m_Mouth
protected

◆ m_MouthToCarina

SEFluidCircuitPath* Respiratory::m_MouthToCarina
protected

◆ m_MouthToStomach

SEFluidCircuitPath* Respiratory::m_MouthToStomach
protected

◆ m_NotBreathing

bool Respiratory::m_NotBreathing
protected

◆ m_Patient

SEPatient* Respiratory::m_Patient
protected

◆ m_PatientActions

SEPatientActionCollection* Respiratory::m_PatientActions
protected

◆ m_PeakRespiratoryDrivePressure_cmH2O

double Respiratory::m_PeakRespiratoryDrivePressure_cmH2O
protected

◆ m_PeripheralControlGainConstant

double Respiratory::m_PeripheralControlGainConstant
protected

◆ m_PleuralComplianceSensitivity_Per_L

double Respiratory::m_PleuralComplianceSensitivity_Per_L
protected

◆ m_PreviousTargetAlveolarVentilation_L_Per_min

double Respiratory::m_PreviousTargetAlveolarVentilation_L_Per_min
protected

◆ m_RespClosedResistance_cmH2O_s_Per_L

double Respiratory::m_RespClosedResistance_cmH2O_s_Per_L
protected

◆ m_RespiratoryCircuit

SEFluidCircuit* Respiratory::m_RespiratoryCircuit
protected

◆ m_RespiratoryMuscle

SEFluidCircuitNode* Respiratory::m_RespiratoryMuscle
protected

◆ m_RespOpenResistance_cmH2O_s_Per_L

double Respiratory::m_RespOpenResistance_cmH2O_s_Per_L
protected

◆ m_RightAlveoli

SEFluidCircuitNode* Respiratory::m_RightAlveoli
protected

◆ m_RightAlveoliLeakToRightPleural

SEFluidCircuitPath* Respiratory::m_RightAlveoliLeakToRightPleural
protected

◆ m_RightAlveoliO2

SEGasSubstanceQuantity* Respiratory::m_RightAlveoliO2
protected

◆ m_RightAlveoliToRightPleuralConnection

SEFluidCircuitPath* Respiratory::m_RightAlveoliToRightPleuralConnection
protected

◆ m_RightAnatomicDeadSpaceToRightAlveoli

SEFluidCircuitPath* Respiratory::m_RightAnatomicDeadSpaceToRightAlveoli
protected

◆ m_RightAnatomicDeadSpaceToRightPleuralConnection

SEFluidCircuitPath* Respiratory::m_RightAnatomicDeadSpaceToRightPleuralConnection
protected

◆ m_RightDeadSpace

SEFluidCircuitNode* Respiratory::m_RightDeadSpace
protected

◆ m_RightLungExtravascular

SELiquidCompartment* Respiratory::m_RightLungExtravascular
protected

◆ m_RightPleural

SEFluidCircuitNode* Respiratory::m_RightPleural
protected

◆ m_RightPleuralToEnvironment

SEFluidCircuitPath* Respiratory::m_RightPleuralToEnvironment
protected

◆ m_RightPleuralToRespiratoryMuscle

SEFluidCircuitPath* Respiratory::m_RightPleuralToRespiratoryMuscle
protected

◆ m_RightPulmonaryCapillary

SEFluidCircuitPath* Respiratory::m_RightPulmonaryCapillary
protected

◆ m_Stomach

SEFluidCircuitNode* Respiratory::m_Stomach
protected

◆ m_TopBreathAlveoliVolume_L

double Respiratory::m_TopBreathAlveoliVolume_L
protected

◆ m_TopBreathDeadSpaceVolume_L

double Respiratory::m_TopBreathDeadSpaceVolume_L
protected

◆ m_TopBreathElapsedTime_min

double Respiratory::m_TopBreathElapsedTime_min
protected

◆ m_TopBreathPleuralPressure_cmH2O

double Respiratory::m_TopBreathPleuralPressure_cmH2O
protected

◆ m_TopBreathTotalVolume_L

double Respiratory::m_TopBreathTotalVolume_L
protected

◆ m_TopCarinaO2

double Respiratory::m_TopCarinaO2
protected

◆ m_VentilationFrequency_Per_min

double Respiratory::m_VentilationFrequency_Per_min
protected

◆ m_VentilationTidalVolumeIntercept

double Respiratory::m_VentilationTidalVolumeIntercept
protected

◆ m_VentilationToTidalVolumeSlope

double Respiratory::m_VentilationToTidalVolumeSlope
protected

◆ m_VentilatoryOcclusionPressure_cmH2O

double Respiratory::m_VentilatoryOcclusionPressure_cmH2O
protected