syntax = "proto3";
package pulse.engine.bind;
option java_package = "com.kitware.pulse.engine.bind";
option csharp_namespace = "pulse.engine.bind";
option optimize_for = SPEED;

import "pulse/cdm/bind/Enums.proto";
import "pulse/cdm/bind/Properties.proto";
import "pulse/cdm/bind/Physiology.proto";

message BloodChemistryData
{
  pulse.cdm.bind.BloodChemistrySystemData   Common                                              = 1;
  pulse.cdm.bind.RunningAverageData         ArterialOxygenAverage_mmHg                          = 2;
  pulse.cdm.bind.RunningAverageData         ArterialCarbonDioxideAverage_mmHg                   = 3;
}

message CardiovascularData
{
  pulse.cdm.bind.CardiovascularSystemData   Common                                              = 1;
  bool                                      StartSystole                                        = 2;
  bool                                      HeartFlowDetected                                   = 3;
  bool                                      FullyCompressedHeart                                = 4;
  double                                    StabilizedHeartRateBaseline_Per_min                 = 5;
  double                                    StabilizedMeanArterialPressureBaseline_mmHg         = 6;
  // Driver Variables
  double                                    CurrentDriverCycleTime_s                            = 7;
  double                                    DriverCyclePeriod_s                                 = 8;
  double                                    LeftHeartElastanceModifier                          = 9;
  double                                    LeftHeartElastance_mmHg_Per_mL                      = 10;
  double                                    LeftHeartElastanceMax_mmHg_Per_mL                   = 11;
  double                                    LeftHeartElastanceMin_mmHg_Per_mL                   = 12;
  double                                    RightHeartElastance_mmHg_Per_mL                     = 13;
  double                                    RightHeartElastanceMax_mmHg_Per_mL                  = 14;
  double                                    RightHeartElastanceMin_mmHg_Per_mL                  = 15;

  // Arrhythmia
  pulse.cdm.bind.eSwitch                    EnableFeedbackAfterArrhythmiaTrasition              = 16;
  bool                                      StartCardiacArrest                                  = 17;
  bool                                      TransitionArrhythmia                                = 18;
  double                                    CardiacArrestVitalsUpdateTimer_s                    = 19;

  pulse.cdm.bind.TemporalInterpolatorData   HeartRateBaseline_Per_min                           = 20;
  pulse.cdm.bind.TemporalInterpolatorData   HeartComplianceModifier                             = 21;
  pulse.cdm.bind.TemporalInterpolatorData   AortaComplianceModifier                             = 22;
  pulse.cdm.bind.TemporalInterpolatorData   VenaCavaComplianceModifier                          = 23;
  pulse.cdm.bind.TemporalInterpolatorData   PulmonaryComplianceModifier                         = 24;
  pulse.cdm.bind.TemporalInterpolatorData   SystemicVascularResistanceModifier                  = 25;
  pulse.cdm.bind.TemporalInterpolatorData   SystemicVascularComplianceModifier                  = 26;

  // CPR
  double                                    CompressionFrequencyCurrentTime_s                   = 27;
  double                                    CompressionFrequencyDuration_s                      = 28;
  double                                    CompressionPeriod_s                                 = 29;
  double                                    CompressionPeriodCurrentTime_s                      = 30;

  // Vitals and Averages
  double                                    CardiacCycleDiastolicVolume_mL                      = 31;
  double                                    CardiacCycleAortaPressureHigh_mmHg                  = 32;
  double                                    CardiacCycleAortaPressureLow_mmHg                   = 33;
  double                                    CardiacCycleLeftHeartPressureHigh_mmHg              = 34;
  double                                    CardiacCycleLeftHeartPressureLow_mmHg               = 35;
  double                                    CardiacCyclePulmonaryArteryPressureHigh_mmHg        = 36;
  double                                    CardiacCyclePulmonaryArteryPressureLow_mmHg         = 37;
  double                                    CardiacCycleRightHeartPressureHigh_mmHg             = 38;
  double                                    CardiacCycleRightHeartPressureLow_mmHg              = 39;
  double                                    LastCardiacCycleMeanArterialCO2PartialPressure_mmHg = 40;
  double                                    CardiacCycleStrokeVolume_mL                         = 41;
  repeated double                           LeftCardiacCyclePerfusionVolumes_mL                 = 42;
  repeated double                           RightCardiacCyclePerfusionVolumes_mL                = 43;
  double                                    PeripheralVolumeHigh_mL                             = 44;
  double                                    PeripheralVolumeLow_mL                              = 45;

  pulse.cdm.bind.RunningAverageData         CardiacCycleArterialPressure_mmHg                   = 46;
  pulse.cdm.bind.RunningAverageData         CardiacCycleArterialCO2PartialPressure_mmHg         = 47;
  pulse.cdm.bind.RunningAverageData         CardiacCyclePulmonaryCapillariesWedgePressure_mmHg  = 48;
  pulse.cdm.bind.RunningAverageData         CardiacCyclePulmonaryCapillariesFlow_mL_Per_s       = 49;
  pulse.cdm.bind.RunningAverageData         CardiacCyclePulmonaryShuntFlow_mL_Per_s             = 50;
  pulse.cdm.bind.RunningAverageData         CardiacCyclePulmonaryArteryPressure_mmHg            = 51;
  pulse.cdm.bind.RunningAverageData         CardiacCycleCentralVenousPressure_mmHg              = 52;
  pulse.cdm.bind.RunningAverageData         CardiacCycleSkinFlow_mL_Per_s                       = 53;

}

message DrugData
{
  pulse.cdm.bind.DrugSystemData             Common                                              = 1;
}

message EndocrineData
{
  pulse.cdm.bind.EndocrineSystemData        Common                                              = 1;
}

message EnergyData
{
  pulse.cdm.bind.EnergySystemData           Common                                              = 1;
  double                                    EnduranceEnergyStore_J                              = 2;
  double                                    MediumPowerEnergyStore_J                            = 3;
  double                                    PeakPowerEnergyStore_J                              = 4;
  double                                    UsableEnergyStore_J                                 = 5;
  
  pulse.cdm.bind.RunningAverageData         BloodpH                                             = 6;
  pulse.cdm.bind.RunningAverageData         BicarbonateMolarity_mmol_Per_L                      = 7;
}

message GastrointestinalData
{
  pulse.cdm.bind.GastrointestinalSystemData Common                                              = 1;
}

message HepaticData
{
  pulse.cdm.bind.HepaticSystemData          Common                                              = 1;
}

message NervousData
{
  pulse.cdm.bind.NervousSystemData          Common                                              = 1;
  double                                    ArterialOxygenBaseline_mmHg                         = 2;
  double                                    ArterialCarbonDioxideBaseline_mmHg                  = 3;
  bool                                      BaroreceptorFeedbackStatus                          = 4;
  bool                                      BaroreceptorSaturationStatus                        = 5;
  double                                    BaroreceptorActiveTime_s                            = 6;
  double                                    BaroreceptorEffectivenessParameter                  = 7;
  double                                    BaroreceptorSaturationTime_s                        = 8;
  double                                    LastMeanArterialPressure_mmHg                       = 9;
  double                                    PreviousBloodVolume_mL                              = 10;
  pulse.cdm.bind.eHeartRhythm               PreviousHeartRhythm                                 = 11;
}

message RenalData
{
  pulse.cdm.bind.RenalSystemData           Common                                              = 1;
  bool                                     Urinating                                           = 2;
  double                                   LeftAfferentResistance_mmHg_s_Per_mL                = 3;
  double                                   RightAfferentResistance_mmHg_s_Per_mL               = 4;
  double                                   LeftSodiumFlowSetPoint_mg_Per_s                     = 5;
  double                                   RightSodiumFlowSetPoint_mg_Per_s                    = 6;
  
  pulse.cdm.bind.RunningAverageData        UrineProductionRate_mL_Per_min                      = 7;
  pulse.cdm.bind.RunningAverageData        UrineOsmolarity_mOsm_Per_L                          = 8;
  pulse.cdm.bind.RunningAverageData        SodiumConcentration_mg_Per_mL                       = 9;
  pulse.cdm.bind.RunningAverageData        SodiumExcretionRate_mg_Per_min                      = 10;
  pulse.cdm.bind.RunningAverageData        LeftSodiumFlow_mg_Per_s                             = 11;
  pulse.cdm.bind.RunningAverageData        RightSodiumFlow_mg_Per_s                            = 12;
  pulse.cdm.bind.RunningAverageData        LeftRenalArterialPressure_mmHg                      = 13;
  pulse.cdm.bind.RunningAverageData        RightRenalArterialPressure_mmHg                     = 14;
}

message RespiratoryData
{// Next value : 45
  pulse.cdm.bind.RespiratorySystemData     Common                                              = 1;
  
  bool                                     BreathingCycle                                      = 2;
  bool                                     NotBreathing                                        = 3;
  double                                   TopBreathTotalVolume_L                              = 4;
  double                                   LastCardiacCycleBloodPH                             = 5;
  double                                   TopCarinaO2                                         = 6;
  double                                   TopBreathElapsedTime_min                            = 7;
  double                                   BottomBreathElapsedTime_min                         = 8;
  double                                   BottomBreathTotalVolume_L                           = 9;
  double                                   BottomBreathAlveoliPressure_cmH2O                   = 10;
  double                                   BottomBreathAirwayPressure_cmH2O                    = 11;
  double                                   PeakAlveolarPressure_cmH2O                          = 12;
  double                                   MaximalAlveolarPressure_cmH2O                       = 13;
  pulse.cdm.bind.RunningAverageData        BloodPHRunningAverage                               = 14;
  pulse.cdm.bind.RunningAverageData        MeanAirwayPressure_cmH2O                            = 15;
  
  repeated double                          AlveoliVolumeIncrement_L                            = 16;
  repeated double                          TopBreathAcinarZoneVolumes_L                        = 17;
  repeated double                          BottomBreathAcinarZoneVolumes_L                     = 18;
  double                                   PreviousPleuralVolume_L                             = 19;
  
  double                                   ArterialO2PartialPressure_mmHg                      = 20;
  double                                   ArterialCO2PartialPressure_mmHg                     = 21;
  double                                   BreathingCycleTime_s                                = 22;
  double                                   DriverPressure_cmH2O                                = 23;
  double                                   ElapsedBreathingCycleTime_min                       = 24;
  double                                   IERatioScaleFactor                                  = 25;
  double                                   PeakInspiratoryPressure_cmH2O                       = 26;
  double                                   PeakExpiratoryPressure_cmH2O                        = 27;
  double                                   PreviousTargetAlveolarVentilation_L_Per_min         = 28;
  double                                   VentilationFrequency_Per_min                        = 29;
  double                                   VentilationPeriod_s                                 = 30;
  double                                   VentilationToTidalVolumeSlope                       = 31;
  pulse.cdm.bind.RunningAverageData        ArterialO2RunningAverage_mmHg                       = 32;
  pulse.cdm.bind.RunningAverageData        ArterialCO2RunningAverage_mmHg                      = 33;
  // Muscle Pressure Waveform
  double                                   AppliedMechanoreceptorsDyspneaFactor                = 34;
  double                                   ExpiratoryHoldFraction                              = 35;
  double                                   ExpiratoryReleaseFraction                           = 36;
  double                                   ExpiratoryRiseFraction                              = 37;
  double                                   InspiratoryHoldFraction                             = 38;
  double                                   InspiratoryReleaseFraction                          = 39;
  double                                   InspiratoryRiseFraction                             = 40;
  double                                   InspiratoryToExpiratoryPauseFraction                = 41;
  double                                   ResidueFraction                                     = 42;
  double                                   PreviousDyspneaSeverity                             = 43;
  double                                   MechanoreceptorsDyspneaFactor                       = 44;
  
  bool                                     PositivePressureVentilation                         = 45;
  
  // Conscious Breathing
  bool                                     ActiveConsciousRespirationCommand                   = 46;
  // Disease States
  double                                   LeftAlveoliDecrease_L                               = 47;
  double                                   RightAlveoliDecrease_L                              = 48;
  // Overrides
  double                                   RespiratoryComplianceOverride_L_Per_cmH2O           = 49;
  double                                   RespiratoryResistanceOverride_cmH2O_s_Per_L         = 50;
}

message TissueData
{
  pulse.cdm.bind.TissueSystemData          Common                                              = 1;
  map<string,double>                       CardiacArrestVascularFlows_ml_per_min               = 2;
  double                                   RestingTissueGlucose_g                              = 3;
  double                                   RestingBloodGlucose_mg_Per_mL                       = 4;
  double                                   RestingBloodLipid_mg_Per_mL                         = 5;
  double                                   RestingBloodInsulin_mg_Per_mL                       = 6;
  double                                   RestingFluidMass_kg                                 = 7;
  double                                   PreviousFluidMass_kg                                = 8;
}