Skip to content

Creating a Biogears Runtime Directory

Steven A White edited this page Aug 5, 2020 · 6 revisions

Introduction

A valid run time directory is required for any use of the core features of BioGears libraries. Several IO requirements exist for BioGears including the existence of log configuration files along with definitions for substances, patients, and the surrounding environment. If you have built BioGearsfrom scratch an example of this runtime directory is created by the build system using files provided in the source releases ${ROOT}/share/ folder. The location of this example directory is ${BUILD_DIR}/runtime

However the runtime directory created contains more then the files which are required for BioGears to run. The following is a minimum example of the BioGears runtime directory.

   runtime/
   ├──ecg/
   │    └── StandardECG.xml
   ├──environments/
   │   ├── AnchorageDecember.xml
   │   ├── AnchorageInside.xml
   │   ├── CarbonMonoxideAtmospheric.xml
   │   ├── CheyenneMountainAmbulance.xml
   │   ├── CheyenneMountainAprilCool.xml
   │   ├── CheyenneMountainAprilWarm.xml
   │   ├── CheyenneMountainFireFighter.xml
   │   ├── ExerciseEnvironment.xml
   │   ├── Hypobaric3000m.xml
   │   ├── Hypobaric4000m.xml
   │   ├── Standard.xml
   │   ├── Submerged.xml
   │   └── SubmergedFreezing.xml
   ├──log4j.properties
   ├──nutrition/
   │  ├── NoMacros.xml
   │  ├── Soylent.xml
   │  ├── Standard.xml
   │  └── Water.xml
   ├──override/
   │   └── BioGearsOverride.xml
   ├──patients/
   │  ├── DefaultFemale.xml
   │  └── DefaultMale.xml
   ├──Scenarios/
   ├──states/
   ├──substances/
   │  ├── Acetoacetate.xml
   │  ├── Albumin.xml
   │  ├── Albuterol.xml
   │  ├── AminoAcids.xml
   │  ├── Antigen_A.xml
   │  ├── Antigen_B.xml
   │  ├── Bicarbonate.xml
   │  ├── Blood_ABNegative.xml
   │  ├── Blood_ABPositive.xml
   │  ├── Blood_ANegative.xml
   │  ├── Blood_APositive.xml
   │  ├── Blood_BNegative.xml
   │  ├── Blood_BPositive.xml
   │  ├── Blood_ONegative.xml
   │  ├── Blood_OPositive.xml
   │  ├── Calcium.xml
   │  ├── Carbaminohemoglobin.xml
   │  ├── CarbonDioxide.xml
   │  ├── CarbonMonoxide.xml
   │  ├── Carboxyhemoglobin.xml
   │  ├── Chloride.xml
   │  ├── Creatinine.xml
   │  ├── Desflurane.xml
   │  ├── Epinephrine.xml
   │  ├── Ertapenem.xml
   │  ├── Fentanyl.xml
   │  ├── ForestFireParticulate.xml
   │  ├── Furosemide.xml
   │  ├── Globulin.xml
   │  ├── Glucagon.xml
   │  ├── Glucose.xml
   │  ├── Hemoglobin.xml
   │  ├── Insulin.xml
   │  ├── Ketamine.xml
   │  ├── Ketones.xml
   │  ├── Lactate.xml
   │  ├── Midazolam.xml
   │  ├── Morphine.xml
   │  ├── Moxifloxacin.xml
   │  ├── Naloxone.xml
   │  ├── Nitrogen.xml
   │  ├── Norepinephrine.xml
   │  ├── OxyCarbaminohemoglobin.xml
   │  ├── Oxygen.xml
   │  ├── Oxyhemoglobin.xml
   │  ├── Piperacillin.xml
   │  ├── PiperacillinTazobactam.xml
   │  ├── Plasma.xml
   │  ├── Platelet.xml
   │  ├── Potassium.xml
   │  ├── Pralidoxime.xml
   │  ├── Prednisone.xml
   │  ├── Propofol.xml
   │  ├── RedBloodCell.xml
   │  ├── RingersLactate.xml
   │  ├── Rocuronium.xml
   │  ├── Saline.xml
   │  ├── SalineSlowDrip.xml
   │  ├── Sarin.xml
   │  ├── Sodium.xml
   │  ├── Succinylcholine.xml
   │  ├── Tazobactam.xml
   │  ├── TranexamicAcid.xml
   │  ├── Triacylglycerol.xml
   │  ├── Tristearin.xml
   │  ├── Urea.xml
   │  ├── Vasopressin.xml
   │  └── WhiteBloodCell.xml
   └──xsd/
      ├── BioGearsDataModel.xsd
      ├── CommonDataModel.xsd
      ├── biogears/
      │   ├── BioGears.xsd
      │   ├── BioGearsConfiguration.xsd
      │   ├── BioGearsEnvironment.xsd
      │   ├── BioGearsEquipment.xsd
      │   └── BioGearsPhysiology.xsd
      └── cdm/
          ├── Anesthesia.xsd
          ├── AnesthesiaActions.xsd
          ├── Circuit.xsd
          ├── Compartment.xsd
          ├── ElectroCardioGram.xsd
          ├── EngineConfiguration.xsd
          ├── EngineState.xsd
          ├── Environment.xsd
          ├── EnvironmentActions.xsd
          ├── EnvironmentConditions.xsd
          ├── Inhaler.xsd
          ├── InhalerActions.xsd
          ├── Patient.xsd
          ├── PatientActions.xsd
          ├── PatientAssessments.xsd
          ├── PatientConditions.xsd
          ├── PatientNutrition.xsd
          ├── Physiology.xsd
          ├── Properties.xsd
          ├── Scenario.xsd
          ├── Substance.xsd
          ├── SubstanceQuantity.xsd
          ├── System.xsd
          └── TestReport.xsd

Obtaining the files

All source copies of BioGears > 7.0 contain a copy of the required files in ${ROOT}/share/data When the INSTALL target is run by the build system a pruned list of files contained in share/data will be placed in ${INSTALL_ROOT}/share/biogears/data and ${INSTALL_ROOT}/share/biogears/xsd These files are attached to the installed version of BioGears and are incompatible with previous and future BioGears releases. Starting in BioGears 7.4.0 we will install the libraries in to a versioned folder in share to help track compatibility.

So, before testing BioGears simply preform the following commands as is appropriate for your particular system configuration

   cd ~
   mkdir -p biogears/runtme
   cd biogears/runtime
   cp /usr/local/share/biogears/data/* ./
   cp /usr/local/share/biogears/xsd ./
   #Example Biogears bg-cli execution
   /usr/local/bin/bg-cli SCENARIO Combined/Cynthia.xml

BioGears development roadmap includes future enhancements to help the BioGears libraries find these installed files, but all releases up to BioGears 7.3.0 do require that the library be run from a runtime dir. Starting with BioGears 7.3.0 a API user can pass a WORKING_DIR to the physiology_engine, but currently no provided example utilities implement this feature. Moving forward it is our hope to support BIOGEARS_DATA_ROOT and BIOGEARS_XSD_ROOT env variables for configuring fall back locations of the RUNTIME_DIR. Additionally future versions of BioGears starting with 7.4.0 will support --dataroot and --xsdroot flags for supporting end user configuration.

Scenarios

Scenario files are optional for running BioGears, but are also our most common execution scenario. A user is free to install the provided Scenarios in ${INSTALL_ROOT}/share/biogears/data/Scenarios or author there own. For legacy reasons BioGears utilities almost always assume Scenarios are provided with out an assumed Scenario folder which is append by the library.

#Example of running Cynthia.xml
/usr/local/bin/scenario_driver Combined/Cynthia.xml #This will launch Scenarios/Combined/Cynthia.xml
/usr/local/bin/scenario_driver Scenarios/Combined/Cynthia.xml #Error could not open Scenarios/Scenarios/Combined/Cynthia.xml

Our development RoadMap includes using this assumption only as a fall back option, but multiple locations in the libraries still exist which have this legacy behavior. Please keep it in mind when trouble shooting.

States

Like scenarios almost all States are assumed to be provided without a prefix of "states/" This includes both loading and saving functions in the core library and with in our scenario format. Again our roadmap will use this assumption only as a fallback behavior.

For now use the convention of keeping all states in the ${BIOGEARS_ROOT}/states folder and referring to them in scenario files as simply the path relative to states.

Clone this wiki locally