Scenario XML Files

BioGears can be used to simulate various physiological scenarios. The Common Data Model (CDM) provides a Scenario structure that can contain a set of instructions that can be used to drive BioGears. Below you can see :

  • How a scenario is structured in XSD Schema
  • XML examples of all the actions, conditions, assessments supported by BioGears

A Scenario is a 'canned' instruction set with requested data to be output in a comma delimited file that is executed by the engine and will produce the same results data. 'FATAL' is used below to note boundary cases that will result in a fatal exception, stopping the engine.

If you would like execute scenarios, the CDM contains a class, SEScenarioExec, that can execute any scenario with a physiology engine that implements the PhysiologyEngine interface. The Toolkit, also provides example scenario files and can also execute scenario files.

An example of a basic scenario file is shown below.

1 <?xml version="1.0" encoding="UTF-8"?>
2 <Scenario xmlns="uri:/mil/tatrc/physiology/datamodel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsdVersion="v16.12" contentVersion="BioGears_6.0.1-beta" xsi:schemaLocation="">
3  <Name>InitialStableState</Name>
4  <Description>Start the engine at a state, this is for debugging said state</Description>
5  <EngineStateFile>./states/StandardMale@0s.xml</EngineStateFile>
6 
7  <DataRequests>
8  <DataRequest xsi:type="PhysiologySystemDataRequestData" Name="HeartRate" Unit="1/min"/>
9  <DataRequest xsi:type="PhysiologySystemDataRequestData" Name="RespirationRate" Unit="1/min"/>
10  <DataRequest xsi:type="PhysiologySystemDataRequestData" Name="OxygenSaturation" Unit="unitless"/>
11 
12  <DataRequest xsi:type="GasCompartmentDataRequestData" Compartment="Carina" Substance="Oxygen" Name="PartialPressure" Unit="cmH2O" Precision="0"/>
13  <DataRequest xsi:type="GasCompartmentDataRequestData" Compartment="Carina" Substance="CarbonDioxide" Name="PartialPressure" Unit="cmH2O" Precision="1"/>
14 
15  <DataRequest xsi:type="LiquidCompartmentDataRequestData" Compartment="Aorta" Substance="Oxygen" Name="PartialPressure" Unit="mmHg" Precision="1"/>
16  <DataRequest xsi:type="LiquidCompartmentDataRequestData" Compartment="Aorta" Substance="CarbonDioxide" Name="PartialPressure" Unit="mmHg" Precision="1"/>
17  </DataRequests>
18 
19  <Action xsi:type="AdvanceTimeData">
20  <Time value="2" unit="min"/>
21  </Action>
22 </Scenario>

The scenario allows for a name and description, but this is not used in execution. The scenario contains the following execution information:

  • What engine state to use
  • A list of values to return from the engine
  • A list of actions to execute over the course of the run

Patient File and optional conditions

While it is recommened to use an Engine State when running a scenario, you do have the option to initialize the engine with a Patient File and optional conditions. The specified patient file refers to an XML file containing Patient_PatientData information. Replace the <EngineStateFile> tag with the <InitialParameters> tag like this:

1 <?xml version="1.0" encoding="UTF-8"?>
2 <Scenario xmlns="uri:/mil/tatrc/physiology/datamodel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsdVersion="v16.12" contentVersion="BioGears_6.0.1-beta" xsi:schemaLocation="">
3  <Name>Anemia30</Name>
4  <Description>Anemia onset, leading to 30% reduction in hemoblogin content</Description>
5  <InitialParameters>
6  <PatientFile>StandardMale.xml</PatientFile>
7  <Condition xsi:type="ChronicAnemiaData">
8  <ReductionFactor value="0.3"/>
9  </Condition>
10  </InitialParameters>

Patient Conditions

Conditions give instructions to the engine to apply certian changes to the engine to simulate the specified conditions. The following are links to the Condition class specification along with XML examples of conditions that can be used in making your own scenarios.

Chronic Anemia

1 <Condition xsi:type="ChronicAnemiaData">
2  <ReductionFactor value="0.3"/>
3 </Condition>

COPD

1 Condition xsi:type="ChronicObstructivePulmonaryDiseaseData">
2  <BronchitisSeverity value="0.65"/>
3  <EmphysemaSeverity value="0.50"/>
4 </Condition>

Chronic Pericardial Effusion

1 <Condition xsi:type="ChronicPericardialEffusionData">
2  <AccumulatedVolume value="500" unit="mL"/>
3  </Condition>

Chronic Renal Stenosis

1 <Condition xsi:type="ChronicRenalStenosisData">
2  <LeftKidneySeverity value="0.9"/>
3  <RightKidneySeverity value="0.9"/>
4 </Condition>

Chronic Ventricular Systolic Dysfunction

1 <Condition xsi:type="ChronicVentricularSystolicDysfunctionData"/>

Consume Meal

1 <Condition xsi:type="ConsumeMealData">
2  <Meal>
3  <Water value="1.0" unit="L"/>
4  <ElapsedTime value="12.0" unit="hr"/>
5  </Meal>
6 </Condition>

Impaired Alveolar Exchange

1 <Condition xsi:type="ImpairedAlveolarExchangeData">
2  <ImpairedSurfaceArea value="1.0" unit="m^2"/>
3 </Condition>
4 
5 or
6 
7 <Condition xsi:type="ImpairedAlveolarExchangeData">
8  <ImpairedFraction value="0.20"/>
9 </Condition>

Lobar Pneumonia

1 <Condition xsi:type="LobarPneumoniaData">
2  <Severity value="0.70"/>
3  <LeftLungAffected value="0.00"/>
4  <RightLungAffected value="0.67"/>
5 </Condition>

Initial Environment

1 <Condition xsi:type="InitialEnvironmentData">
2  <Conditions>
3  <SurroundingType>Air</SurroundingType>
4  <AirVelocity value="0.0" unit="m/s"/>
5  <AmbientTemperature value="20.0" unit="degC"/>
6  <AtmosphericPressure value="525.0" unit="mmHg"/>
7  <ClothingResistance value="3.0" unit="clo"/>
8  <Emissivity value="0.9"/>
9  <MeanRadiantTemperature value="20.0" unit="degC"/>
10  <RelativeHumidity value="1.0"/>
11  <RespirationAmbientTemperature value="20.0" unit="degC"/>
12  <AmbientSubstance Name="Nitrogen">
13  <FractionAmount value="0.8576"/>
14  </AmbientSubstance>
15  <AmbientSubstance Name="Oxygen">
16  <FractionAmount value="0.142"/>
17  </AmbientSubstance>
18  <AmbientSubstance Name="CarbonDioxide">
19  <FractionAmount value="4.0E-4"/>
20  </AmbientSubstance>
21  </Conditions>
22 </Condition>
23 
24 or
25 
26 
27 <Condition xsi:type="InitialEnvironmentData">
28  <ConditionsFile>Hypobaric3000m.xml</ConditionsFile>
29 </Condition>

Data Requests

Currently there are four supported types of data requests:

Physiology System Data

Physiology System data refers to all the data specified by SystemData and its derived types.

At this time, you do not need to specify the system name. The Name attribute should be set to a System Property name. (e.g., HeartRate)

1 <DataRequest xsi:type="PhysiologySystemDataRequestData" Name="HeartRate" Unit="1/min" />

Compartment Data

Compartments refer to all the data specified on Compartments. You can read more about compartments here.

There are two amin types of Compartments, gas and liquid.

Data on the compartment itself: The Compartment attribute can be any of the enumerations defined by BioGears. The Name attribute should be set to a Compartment Property name. The Substance attribute is optional, and the if used the name will refer to a substance quantity property.

1 <DataRequest xsi:type="GasCompartmentDataRequestData" Compartment="LeftAlveoli" Name="Pressure" Unit="cmH2O"/>
1 <DataRequest xsi:type="GasCompartmentDataRequestData" Compartment="LeftAlveoli" Substance="Oxygen" Name="PartialPressure" Unit="mmHg"/>
1 <DataRequest xsi:type="LiquidCompartmentDataRequestData" Compartment="Aorta" Name="Pressure" Unit="mmHg" />
1 <DataRequest xsi:type="LiquidCompartmentDataRequestData" Compartment="Aorta" Substance="Oxygen" Name="PartialPressure" Unit="mmHg"/>

Environment Data

Environment System data refers to all the data specified by Environment_EnvironmentData and its derived types.

1 <DataRequest xsi:type="EnvironmentDataRequestData" Name="ConvectiveHeatLoss" Unit="W" Precision="2"/>

Equipment Data

System level data from a piece of equipment

1 <DataRequest xsi:type="EquipmentDataRequestData" Type="ECG" Name="Lead3ElectricPotential" Unit="mV" Precision="0"/>

Substance Data

Substance data is provided about a substance and its current state in the body and on specific anatomy compartments

1 <DataRequest xsi:type="SubstanceDataRequestData" Substance="Morphine" Name="PlasmaConcentration" Unit="ug/mL"/>
1 <DataRequest xsi:type="SubstanceDataRequestData" Substance="Morphine" Compartment="LeftKidneyTissue" Name="MassCleared" Unit="ug"/>

General Actions

Actions give instructions to the engine to define what happens over the course of a scenario. Everything from advancing time, to starting a hemorrhage, to administering a drug is an action of some kind. The following are links to the Action class specification along with XML examples of actions that can be used in making your own scenarios.


Advance Time

1 <Action xsi:type="AdvanceTimeData">
2  <Time value="350" unit="s"/>
3 </Action>

Serialize State

1 <Action xsi:type="SerializeStateData" Type="Save">
2  <Filename></Filename>
3  </Action>

Patient Insults


Acute Stress


Severity value must be >=0.0 and <=1.0
A severity of 0 removes the action completely.

1 <Action xsi:type="AcuteStressData">
2  <Severity value="0.3"/>
3 </Action>

Apnea


Severity value must be >=0.0 and <=1.0
A severity of 0 removes the action completely.

1 <Action xsi:type="ApneaData">
2  <Severity value="0.3"/>
3 </Action>

Airway Obstruction


Severity value must be >=0.0 and <=1.0
A severity of 0 removes the action completely.

1 <Action xsi:type="AirwayObstructionData">
2  <Severity value="0.3"/>
3 </Action>

Asthma Attack


Severity value must be >=0.0 and <=1.0
A severity of 0 removes the action completely.

1 <Action xsi:type="AsthmaAttackData">
2  <Severity value="0.3"/>
3 </Action>

Brain Injury


Severity value must be >=0.0 and <=1.0
A severity of 0 removes the action completely.
Types : Diffuse, LeftFocal, RightFocal

1 <Action xsi:type="BrainInjuryData" Type="Diffuse">
2  <Severity value="0.3"/>
3 </Action>

Bronchoconstriction


Severity value must be >=0.0 and <=1.0
A severity of 0 removes the action completely.

1 <Action xsi:type="BronchoconstrictionData">
2  <Severity value="0.3"/>
3 </Action>

Consume Nutrients

1 <Action xsi:type="ConsumeMealData">
2  <Nutrition>
3  <Carbohydrate value="390.0" unit="g"/>
4  <CarbohydrateDigestionRate value="0.5" unit="g/min"/>
5  <Fat value="90.0" unit="g"/>
6  <FatDigestionRate value="0.055" unit="g/min"/>
7  <Protein value="56.0" unit="g"/>
8  <ProteinDigestionRate value="0.071" unit="g/min"/>
9  <Calcium value="1000.0" unit="mg"/>
10  <Sodium value="1.5" unit="g"/>
11  <Water value="3.7" unit="L"/>
12  </Nutrition>
13 </Action>

Cardiac Arrest

1 <Action xsi:type="CardiacArrestData"/>

Exercise


An intensity of 0 removes the action completely.

1 <Action xsi:type="ExerciseData">
2  <Intensity value="1.0"/>
3 </Action>
1 <Action xsi:type="ExerciseData">
2  <BorgScale value="10.0"/>
3 </Action>

Hemorrhage


The Compartment attribute can be any of the enumerations defined in the enumAnatomy enumeration.
FATAL: Cannot have bleeding rate greater than cardiac output or less than 0

1 <Action xsi:type="HemorrhageData" Compartment="RightLegVascular">
2  <Rate value="250" unit="mL/min"/>
3 </Action>

Pericardial Effusion


EffusionRate of the liquid

1 <Action xsi:type="PericardialEffusionData" >
2  <EffusionRate value="0.1" unit="mL/s"/>
3 </Action>

Tension Pneumothorax


The Type attribute can be "Open" or "Closed"
The Side attribute can be "Left" or "Right"
Severity value must be >=0.0 and <=1.0
A severity of 0 removes the action completely.

1 <Action xsi:type="TensionPneumothoraxData" Type="Closed" Side="Left">
2  <Severity value="0.6"/>
3  </Action>

Patient Interventions


Chest Compression Force


Force is the specific magnitude to perform a compression with.
Note, that patient should be in Cardiac Arrest before performing CPR

1 <Action xsi:type="ChestCompressionForceData">
2  <Force value="100.0" unit="N"/>
3 </Action>

Chest Compression Force Scale


ForceScale value must be >=0.0 and <=1.0
Note, that patient should be in Cardiac Arrest before performing CPR

1 <Action xsi:type="ChestCompressionForceScaleData">
2  <ForceScale value="0.73"/>
3 </Action>

Chest Occlusive Dressing


The State attribute can be "On" or "Off"
Side is either Left or Right
FATAL: If the side specified does not have a pnumothorax

1 <Action xsi:type="ChestOcclusiveDressingData" State="On" Side="Left">
2 </Action>

Conscious Respiration


This action can contain 1 or more commands :


Commands will be processed in order. The first commands will be proceesed instantly When it has completed (run through it's Period), the next command will be processed. Other actions will be processed while these commands are processed or waiting to be processed. You may want to advance time for the sum of the command periods to ensure the body is doing what you expect it to.. Or not, depending on how you want the system to react.

1 <Action xsi:type="ConsciousRespirationData">
2  <Command xsi:type="ForcedExhaleData">
3  <ExpiratoryReserveVolumeFraction value="1.0"/>
4  <Period value="3.0" unit="s"/>
5  </Command>
6  <Command xsi:type="ForcedInhaleData">
7  <InspiratoryCapacityFraction value="1.0"/>
8  <Period value="5.0" unit="s"/>
9  </Command>
10  <Command xsi:type="UseInhalerData"/>
11  <Command xsi:type="BreathHoldData">
12  <Period value="10.0" unit="s"/>
13  </Command>
14 </Action>

Intubation


Note: In order to 'turn off' an intubation, use'Off' as the Type
Types : Off, Esophageal, LeftMainstem, RightMainstem, Tracheal

1 <Action xsi:type="IntubationData" Type="Tracheal"/>

Mechanical Ventilation


You may provide Pressure and/or Flow.
If you do not provide GasFractions, the environment gas fractions will be used.
If you do provide Gas Fractions, they must add up to 1.

1 <Action xsi:type="MechanicalVentilationData" State="On">
2  <Pressure value="10.0" unit="cmH2O"/>
3  <Flow value="1.0" unit="mL/s"/>
4  <GasFraction Name="Oxygen">
5  <FractionAmount value="1.0"/>
6  </GasFraction>
7 </Action>

Needle Decompression


The Side attribute can be "Left" or "Right"
The State attribute can be "On" or "Off" FATAL: If the side specified does not have a pnumothorax

1 <Action xsi:type="NeedleDecompressionData" State="On" Side="Left"/>

Urinate


Action to empty the bladder. if not emptied, it will empty and throw an event.

1 <Action xsi:type="UrinateData"/>

Substance Bolus

The AdminRoute can be one of:

  • "Intravenous"
  • "Intramuscular"
  • "Subcutaneous"
  • "Oral"
  • "Rectal"
  • "Inhaled"

The Substance element should be set to a name of any of the Substances.

1 <Action xsi:type="SubstanceBolusData" AdminRoute="Intravenous">
2  <Substance>Succinylcholine</Substance>
3  <Concentration value="4820" unit="ug/mL"/>
4  <Dose value="30" unit="mL"/>
5 </Action>

Substance Compound Infusion Fluids


The Substance Compound element should be set to a name of any of the Substances Compounds.
Set Rate to 0 to remove Action

1 <Action xsi:type="SubstanceCompoundInfusionData">
2  <SubstanceCompound>Saline</SubstanceCompound>
3  <BagVolume value="500" unit="mL"/>
4  <Rate value="100" unit="mL/min"/>
5 </Action>

Substance Infusion


The Substance element should be set to a name of any of the Substances.
Set Rate to 0 to remove Action

1 <Action xsi:type="SubstanceInfusionData" State="On" AdminRoute="Intravenous">
2  <Substance>Succinylcholine</Substance>
3  <Concentration value="5000" unit="ug/mL"/>
4  <Rate value="100" unit="mL/min"/>
5 </Action>

Anesthesia Machine State


Anesthesia Machine Configuration


NOTE: Each field is optional.
Connection can be one of : Off, Mask, Tube
Patient must be intubated to be connected as Tube
Anesthesia machine will be disconneted if intubation is removed.
Patient cannot be intubated to be connected as Mask
Anesthesia machine will be disconneted if patient is then intubated.
Cannot have inhaler and anesthesia machine on at the same time

1 <Action xsi:type="AnesthesiaMachineConfigurationData">
2  <Configuration>
3  <Connection>Mask</Connection>
4  <InletFlow value="5.0" unit="L/min"/>
5  <InspiratoryExpiratoryRatio value="0.5"/>
6  <OxygenFraction value="0.25"/>
7  <OxygenSource>Wall</OxygenSource>
8  <PositiveEndExpiredPressure value="1.0" unit="cmH2O"/>
9  <PrimaryGas>Nitrogen</PrimaryGas>
10  <RespiratoryRate value="16.0" unit="1/min"/>
11  <VentilatorPressure value="10.5" unit="cmH2O"/>
12  <OxygenBottleOne>
13  <Volume value="660" unit="L"/>
14  </OxygenBottleOne>
15  <OxygenBottleTwo>
16  <Volume value="660" unit="L"/>
17  </OxygenBottleTwo>
18  </Configuration>
19 </Action>
1 <Action xsi:type="AnesthesiaMachineConfigurationData" >
2  <Configuration>
3  <Connection>Off</Connection>
4  </Configuration>
5 </Action>
1 <Action xsi:type="AnesthesiaMachineConfigurationData">
2  <Configuration>
3  <LeftChamber>
4  <State>On</State>
5  <SubstanceFraction value="0.04"/>
6  <Substance>Desflurane</Substance>
7  </LeftChamber>
8  </Configuration>
9 </Action>

Anesthesia Machine Incidents


Oxygen TankPressure Loss


The State attribute can be "On" or "Off"

1 <Action xsi:type="OxygenTankPressureLossData" State="On"/>

Oxygen Wall Port Pressure Loss


The State attribute can be "On" or "Off"

1 <Action xsi:type="OxygenWallPortPressureLossData" State="On"/>

Anesthesia Machine Failures


Expiratory Valve Leak


The State attribute can be "On" or "Off"
Severity value must be >=0.0 and <=1.0

1 <Action xsi:type="ExpiratoryValveLeakData" State="On">
2  <Severity value="0.5"/>
3 </Action>

Expiratory Valve Obstruction


The State attribute can be "On" or "Off"
Severity value must be >=0.0 and <=1.0

1 <Action xsi:type="ExpiratoryValveObstructionData" State="On">
2  <Severity value="1.0"/>
3 </Action>

Inspiratory Valve Leak


The State attribute can be "On" or "Off"
Severity value must be >=0.0 and <=1.0

1 <Action xsi:type="InspiratoryValveLeakData" State="On">
2  <Severity value="1.0"/>
3 </Action>

Inspiratory Valve Obstruction


The State attribute can be "On" or "Off"
Severity value must be >=0.0 and <=1.0

1 <Action xsi:type="InspiratoryValveObstructionData" State="On">
2  <Severity value="1.0"/>
3 </Action>

Mask Leak


The State attribute can be "On" or "Off"
Severity value must be >=0.0 and <=1.0

1 <Action xsi:type="MaskLeakData" State="On">
2  <Severity value="1.0"/>
3 </Action>

Soda Lime Failure


The State attribute can be "On" or "Off"
Severity value must be >=0.0 and <=1.0

1 <Action xsi:type="SodaLimeFailureData" State="On">
2  <Severity value="1.0"/>
3 </Action>

Tube Cuff Leak


The State attribute can be "On" or "Off"
Severity value must be >=0.0 and <=1.0

1 <Action xsi:type="TubeCuffLeakData" State="On">
2  <Severity value="0.5"/>
3 </Action>

Vaporizer Failure


The State attribute can be "On" or "Off"
Severity value must be >=0.0 and <=1.0

1 <Action xsi:type="VaporizerFailureData" State="On">
2  <Severity value="0.25"/>
3 </Action>

Ventilator Pressure Loss


The State attribute can be "On" or "Off"
Severity value must be >=0.0 and <=1.0

1 <Action xsi:type="VentilatorPressureLossData" State="On">
2  <Severity value="1.0"/>
3 </Action>

Y Piece Disconnect


The State attribute can be "On" or "Off"
Severity value must be >=0.0 and <=1.0

1 <Action xsi:type="YPieceDisconnectData" State="On">
2  <Severity value="1.0"/>
3 </Action>

Inhaler State

Inhaler Configuration


FATAL: Cannot have inhaler and anesthesia machine on at the same time

1 <Action xsi:type="InhalerConfigurationData">
2  <Configuration>
3  <Substance>Albuterol</Substance>
4  <MeteredDose value="90.0" unit="ug"/>
5  <NozzleLoss value="0.04"/>
6  </Configuration>
7 </Action>

Environment


Environment Configuration State


NOTE: Each field is optional.

1 <Action xsi:type="EnvironmentChangeData">
2  <Conditions>
3  <SurroundingType>Water</SurroundingType>
4  <AirVelocity value="0.0" unit="m/s"/>
5  <AmbientTemperature value="10.0" unit="degC"/>
6  <AtmosphericPressure value="760.0" unit="mmHg"/>
7  <ClothingResistance value="0.01" unit="clo"/>
8  <Emissivity value="0.0"/>
9  <MeanRadiantTemperature value="22.0" unit="degC"/>
10  <RelativeHumidity value="1.0"/>
11  <RespirationAmbientTemperature value="22.0" unit="degC"/>
12  <AmbientSubstance Name="Nitrogen">
13  <FractionAmount value="0.7901"/>
14  </AmbientSubstance>
15  <AmbientSubstance Name="Oxygen">
16  <FractionAmount value="0.2095"/>
17  </AmbientSubstance>
18  <AmbientSubstance Name="CarbonDioxide">
19  <FractionAmount value="4.0E-4"/>
20  </AmbientSubstance>
21  </Conditions>
22 </Action>

Thermal Application


You must provide at least 1 activity, but up can also apply upto all 3 in one action.

1 <Action xsi:type="ThermalApplicationData">
2  <ActiveHeating>
3  <Power value="500" unit="BTU/hr"/>
4  <SurfaceAreaFraction value="0.2" unit="unitless"/>
5  </ActiveHeating>
6  <ActiveCooling>
7  <Power value="500" unit="BTU/hr"/>
8  <CSurfaceArea value="0.1" unit="m^2"/>
9  </ActiveCooling>
10  <AppliedTemperature>
11  <State>On</State>
12  <Temperature value="30" unit="degF"/>
13  <SurfaceAreaFraction value="1.0" unit="unitless"/>
14  </AppliedTemperature>
15 </Action>
1 <Action xsi:type="ThermalApplicationData">
2  <AppliedTemperature>
3  <State>On</State>
4  <Temperature value="140" unit="degF"/>
5  <SurfaceAreaFraction value="0.9" unit="unitless"/>
6  </AppliedTemperature>
7 </Action>