syntax = "proto3";
package pulse.cdm.bind;
option java_package = "pulse.cdm.bind";
option csharp_namespace = "pulse.cdm.bind";
option optimize_for = SPEED;

import "pulse/cdm/bind/Properties.proto";
import "pulse/cdm/bind/Substance.proto";

message MechanicalVentilatorData
{

  enum eConnection
  {
    NullConnection = 0;/**<< Signals not provided, or no change */
    Off            = 1;
    Mask           = 2;
    Tube           = 3;
  }
  
  enum eDriverWaveform
  {
    NullDriverWaveform = 0;/**<< Signals not provided, or no change */
    Square             = 1;/**<<  */
    Exponential        = 2;/**<<  */
    Ramp               = 3;/**<<  */
    Sinusoidal         = 4;/**<<  */
    Sigmoidal          = 5;/**<<  */
  }
  
  eConnection                         Connection                    = 1; /**<< @brief @ref MechanicalVentilatorData_eControlTable */
  ScalarPressureTimePerVolumeData     EndoTrachealTubeResistance    = 2; /**<< @brief Total connection resistance. */
  
  oneof ExpiratoryBaseline
  {
    ScalarPressureData                PositiveEndExpiredPressure    = 3; /**<< @brief Extrinsic pressure above atmosphere at the end of exhalation. */
    ScalarPressureData                FunctionalResidualCapacity    = 4; /**<< @brief Total lung volume at the end of exhalation. */
  }
  oneof ExpirationCycle
  {
    ScalarVolumePerTimeData           ExpirationCycleFlow           = 5; /**<< @brief Ventilator sensor flow value to trigger expiration phase. */
    ScalarPressureData                ExpirationCyclePressure       = 6; /**<< @brief Ventilator sensor pressure value to trigger expiration phase. */
    ScalarTimeData                    ExpirationCycleTime           = 7; /**<< @brief Total length of inspiration phase to trigger expiration phase. */
  }
  
  ScalarPressureTimePerVolumeData     ExpirationTubeResistance      = 8; /**<< @brief Total resistance of expiratory limb tubing. */
  ScalarPressureTimePerVolumeData     ExpirationValveResistance     = 9; /**<< @brief Total resistance of expiratory valves. */
  eDriverWaveform                     ExpirationWaveform            = 10;/**<< @brief @ref MechanicalVentilatorData_eDriverWaveformTable */
  
  oneof InspirationLimits
  {
    ScalarVolumePerTimeData           InspirationLimitFlow          = 11;/**<< @brief Ventilator sensor flow cutoff/maximum. */
    ScalarPressureData                InspirationLimitPressure      = 12;/**<< @brief Ventilator sensor pressure cutoff/maximum. */
    ScalarVolumeData                  InspirationLimitVolume        = 13;/**<< @brief Total lung volume cutoff/maximum. */
  }
  
  ScalarTimeData                      InspirationPauseTime          = 14;/**<< @brief Time of plateau (i.e., constant driver pressure) between inspiration and expiration. */
  
  oneof InspiratoryTargets
  {
    ScalarPressureData                PeakInspiratoryPressure       = 15;/**<< @brief Extrinsic pressure above atmosphere at the end of inhalation. */
    ScalarPressureData                EndTidalCarbonDioxidePressure = 16;/**<< @brief Ideal EtCO2 target for automatically adjusting ventilator driver values. */
  }
  
  oneof InspirationTriggers
  {
    ScalarVolumePerTimeData           InspirationTriggerFlow        = 17;/**<< @brief Ventilator sensor flow value to trigger inspiration phase. */
    ScalarPressureData                InspirationTriggerPressure    = 18;/**<< @brief Ventilator sensor pressure value to trigger inspiration phase. */
    ScalarTimeData                    InspirationTriggerTime        = 19;/**<< @brief Total length of expiration phase to trigger inspiration phase. */
  }
  
  ScalarPressureTimePerVolumeData     InspirationTubeResistance     = 20;/**<< @brief Total resistance of inspiratory limb tubing. */
  ScalarPressureTimePerVolumeData     InspirationValveResistance    = 21;/**<< @brief Total resistance of inspiratory valves. */
  eDriverWaveform                     InspirationWaveform           = 22;/**<< @brief @ref MechanicalVentilatorData_eDriverWaveformTable */
  
  repeated SubstanceFractionData      FractionInspiredGas           = 23;/**<< @brief Break down of the gases, such as FiO2. */
  repeated SubstanceConcentrationData ConcentrationInspiredAerosol  = 24;/**<< @brief Concentration of added aerosolized substances. */
}