Skip to content

Commit daf2e09

Browse files
ajbairdStevenAWhite
authored andcommitted
final changes for focus group
1 parent 462ab5a commit daf2e09

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

projects/howto/BurnWoundPainStimulus/src/HowTo-BurnWoundPainStimulus.cpp

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ specific language governing permissions and limitations under the License.
2929
#include <biogears/cdm/system/physiology/SERenalSystem.h>
3030
#include <biogears/cdm/system/physiology/SERespiratorySystem.h>
3131
#include <biogears/cdm/utils/SEEventHandler.h>
32+
#include <biogears/cdm/patient/actions/SEPainStimulus.h>
3233
#include <biogears/engine/BioGearsPhysiologyEngine.h>
3334
#include <biogears/string/manipulation.h>
3435

@@ -104,6 +105,8 @@ BurnThread::BurnThread(const std::string logFile, double tbsa)
104105
m_bg->GetLogger()->Error("Could not load state, check the error");
105106
return;
106107
}
108+
SESubstance* epi = m_bg->GetSubstanceManager().GetSubstance("Epinephrine");
109+
107110
//Create CSV results file and set up data that we want to be tracked (tracking done in AdvanceModelTime)
108111
int docTBSA = (int)(tbsa);
109112
std::string resultsFileTBSA = std::to_string(docTBSA);
@@ -112,6 +115,7 @@ BurnThread::BurnThread(const std::string logFile, double tbsa)
112115
resultsFile.append(".csv");
113116
m_bg->GetEngineTrack()->GetDataRequestManager().SetResultsFilename(resultsFile); //deposits in build/runtime
114117
m_bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("HeartRate", "1/min");
118+
m_bg->GetEngineTrack()->GetDataRequestManager().CreateSubstanceDataRequest().Set(*epi, "PlasmaConcentration", MassPerVolumeUnit::ug_Per_L);
115119
m_bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("ArterialBloodPH", "unitless");
116120
m_bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("CardiacOutput", "mL/min");
117121
m_bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("InflammatoryResponse-TissueIntegrity");
@@ -123,6 +127,7 @@ BurnThread::BurnThread(const std::string logFile, double tbsa)
123127
m_bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("SystemicVascularResistance", "mmHg s/mL");
124128
m_bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("BloodVolume", "mL");
125129
m_bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("MeanUrineOutput", "mL/hr");
130+
m_bg->GetEngineTrack()->GetDataRequestManager().CreatePhysiologyDataRequest().Set("PainVisualAnalogueScale");
126131
m_bg->GetEngineTrack()->GetDataTrack().Probe("totalFluid_mL", m_TotalVolume_mL);
127132
m_bg->GetEngineTrack()->GetDataTrack().Probe("bagVolume_mL", m_ivBagVolume_mL);
128133
m_bg->GetEngineTrack()->GetDataTrack().Probe("totalFluidAlbumin_mL", m_TotalVolumeAlbumin_mL);
@@ -294,6 +299,17 @@ void BurnThread::FluidLoading(double tbsa)
294299
double titrate = 0.25; //how much to adjust each hour
295300
double maxSimTime = 24.0;
296301
m_runThread = true;
302+
//Create variables for scenario
303+
SEPainStimulus PainStimulus; //pain object
304+
std::string location; //location of pain stimulus, examples "Arm", "Leg"
305+
double severity; //severity (scale 0-1)
306+
307+
//set up the configuration of the pain stimulus
308+
location = "Arm";
309+
severity = 0.1;
310+
PainStimulus.SetLocation(location);
311+
PainStimulus.GetSeverity().SetValue(severity);
312+
// m_bg->ProcessAction(PainStimulus);
297313

298314
//compute urine production and max fluid requirements, per parkland formula
299315
const SEPatient& patient = m_bg->GetPatient();
@@ -321,6 +337,7 @@ void BurnThread::FluidLoading(double tbsa)
321337

322338
while (m_runThread) {
323339
// Generate State Every X amount of time
340+
m_bg->GetLogger()->Info(asprintf("Mean Arterial Pressure : %f %s", m_bg->GetCardiovascularSystem()->GetMeanArterialPressure(PressureUnit::mmHg), "mmHg"));
324341
if (((int)m_bg->GetSimulationTime(TimeUnit::s) + 1) % stateTime_s == 0 && saveState == true) {
325342
int intTBSA = (int)tbsa;
326343
std::string stringTBSA = std::to_string(intTBSA);
@@ -343,7 +360,10 @@ void BurnThread::FluidLoading(double tbsa)
343360
//albuminRate_mL_Per_hr = (int)(floor(albuminRate_mL_Per_hr * 100.0) / 100.0);
344361
fname.append(std::to_string(albuminRate_mL_Per_hr));
345362
fname.append("Albumin.xml");
363+
364+
m_bg->GetLogger()->Info(asprintf("Saved state"));
346365
m_bg->SaveStateToFile(fname);
366+
347367
}
348368

349369
//set fluid to albumin at the 8 hour mark
@@ -422,14 +442,6 @@ void BurnThread::FluidLoading(double tbsa)
422442
}
423443
}
424444

425-
if (fluid == ringers) {
426-
if (m_ivBagVolume_mL < 1.0) {
427-
m_ringers->GetBagVolume().SetValue(ringersVolume_mL, VolumeUnit::mL);
428-
m_bg->GetLogger()->Info("ringers IV bag is low, refilling bag \n");
429-
m_bg->ProcessAction(*m_ringers);
430-
m_ivBagVolume_mL = ringersVolume_mL; //tracking purposes
431-
}
432-
}
433445
// make sure that the bag is full
434446
if (m_ivBagVolume_mL < 1.0) {
435447
m_ringers->GetBagVolume().SetValue(ringersVolume_mL, VolumeUnit::mL);

projects/howto/PainStimulus/src/HowTo-PainStimulus.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void HowToPainStimulus()
5656

5757
//set up the configuration of the pain stimulus
5858
location = "Arm";
59-
severity = 0.5;
59+
severity = 0.6;
6060
PainStimulus.SetLocation(location);
6161
PainStimulus.GetSeverity().SetValue(severity);
6262

@@ -103,7 +103,7 @@ void HowToPainStimulus()
103103
}
104104

105105
bg->GetLogger()->Info("Giving the patient Morphine.");
106-
bg->ProcessAction(bolus);
106+
//bg->ProcessAction(bolus);
107107

108108

109109
bg->GetLogger()->Info(asprintf("Mean Arterial Pressure : %f %s", bg->GetCardiovascularSystem()->GetMeanArterialPressure(PressureUnit::mmHg), "mmHg"));

0 commit comments

Comments
 (0)