syntax = "proto3";
package pulse.cdm.bind;
option java_package = "com.kitware.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_eConnectionTable */
  
  oneof ExpiratoryBaseline
  {
    ScalarPressureData                PositiveEndExpiredPressure        = 2; /**<< @brief Extrinsic pressure above atmosphere at the end of exhalation. */
    ScalarPressureData                FunctionalResidualCapacity        = 3; /**<< @brief Total lung volume at the end of exhalation. */
  }
  oneof ExpirationCycle
  {
    ScalarVolumePerTimeData           ExpirationCycleFlow               = 4; /**<< @brief Ventilator sensor flow value to trigger expiration phase. */
    ScalarPressureData                ExpirationCyclePressure           = 5; /**<< @brief Ventilator sensor pressure value to trigger expiration phase. */
    ScalarTimeData                    ExpirationCycleTime               = 6; /**<< @brief Total length of inspiration phase to trigger expiration phase. */
    ScalarVolumeData                  ExpirationCycleVolume             = 7; /**<< @brief Ventilator sensor volume change (i.e., tidal volume) to trigger expiration phase. */
  }
  
  ScalarVolumeData                    ExpirationLimbVolume              = 8; /**<< @brief Dead space volume of the expiratory limb. */
  ScalarPressureTimePerVolumeData     ExpirationTubeResistance          = 9; /**<< @brief Total resistance of expiratory limb tubing. */  
  ScalarPressureTimePerVolumeData     ExpirationValveResistance         = 10;/**<< @brief Total resistance of expiratory valves. */
  ScalarVolumeData                    ExpirationValveVolume             = 11;/**<< @brief Dead space volume of the expiratory valve. */
  eDriverWaveform                     ExpirationWaveform                = 12;/**<< @brief @ref MechanicalVentilatorData_eDriverWaveformTable */
  
  oneof InspirationLimit
  {
    ScalarVolumePerTimeData           InspirationLimitFlow              = 13;/**<< @brief Ventilator sensor flow cutoff/maximum. */
    ScalarPressureData                InspirationLimitPressure          = 14;/**<< @brief Ventilator sensor pressure cutoff/maximum. */
    ScalarVolumeData                  InspirationLimitVolume            = 15;/**<< @brief Total lung volume cutoff/maximum. */
  }
  
  ScalarTimeData                      InspirationPauseTime              = 16;/**<< @brief Time of plateau (i.e., constant driver pressure) between inspiration and expiration. */
  
  oneof InspiratoryTarget
  {
    ScalarVolumePerTimeData           InspirationTargetFlow             = 17;/**<< @brief Air flow at end of inhalation. */
    ScalarPressureData                PeakInspiratoryPressure           = 18;/**<< @brief Extrinsic pressure above atmosphere at the end of inhalation. */
  }
  
  oneof InspirationMachineTrigger
  {
    ScalarTimeData                    InspirationMachineTriggerTime     = 19;/**<< @brief Total length of expiration phase to trigger inspiration phase. */
  }
  
  oneof InspirationPatientTrigger
  {
    ScalarVolumePerTimeData           InspirationPatientTriggerFlow     = 20;/**<< @brief Ventilator sensor volume change value to trigger inspiration phase. */
    ScalarPressureData                InspirationPatientTriggerPressure = 21;/**<< @brief Ventilator sensor pressure value to trigger inspiration phase. */
  }
  
  ScalarVolumeData                    InspirationLimbVolume             = 22;/**<< @brief Dead space volume of the inspiratory limb. */
  ScalarPressureTimePerVolumeData     InspirationTubeResistance         = 23;/**<< @brief Total resistance of inspiratory limb tubing. */  
  ScalarPressureTimePerVolumeData     InspirationValveResistance        = 24;/**<< @brief Total resistance of inspiratory valves. */
  ScalarVolumeData                    InspirationValveVolume            = 25;/**<< @brief Dead space volume of the inspiratory valve. */
  eDriverWaveform                     InspirationWaveform               = 26;/**<< @brief @ref MechanicalVentilatorData_eDriverWaveformTable */
  
  ScalarVolumeData                    YPieceVolume                      = 27;/**<< @brief Dead space volume of the y-piece. */
  ScalarVolumeData                    ConnectionVolume                  = 28;/**<< @brief Dead space volume of the connection (i.e., mask/tube). */
  
  repeated SubstanceFractionData      FractionInspiredGas               = 29;/**<< @brief Break down of the gases, such as FiO2. */
  repeated SubstanceConcentrationData ConcentrationInspiredAerosol      = 30;/**<< @brief Concentration of added aerosolized substances. */
}