@@ -354,6 +354,14 @@ void BurnThread::FluidLoading(double tbsa)
354354 Status ();
355355 // m_bg->GetLogger()->Info(asprintf("Checking urine production %f %s", m_bg->GetRenalSystem()->GetMeanUrineOutput(VolumePerTimeUnit::mL_Per_hr), "mL_Per_hr"));
356356 urineProduction = m_bg->GetRenalSystem ()->GetMeanUrineOutput (VolumePerTimeUnit::mL_Per_hr );
357+
358+ // to add "too high" and "too low" options for titrating
359+ double scaleTitration = 1.0 ;
360+ double errTitrate[] {0.9 , 1.0 , 1.1 };
361+ int errSelection = rand () % (3 - 1 + 1 ) + 1 ;
362+ scaleTitration = errTitrate[errSelection - 1 ];
363+ // m_bg->GetLogger()->Info(asprintf("Were they right? titrate percent is: %f %s", scaleTitration, "percent"));
364+
357365 if (fluid == ringers && fluidOn == true ) {
358366 if (((int )m_bg->GetSimulationTime (TimeUnit::s) + 1 ) == ((int )hrsBeforeIntervention*3600 )) {
359367 double beginningInfusion_mL_Per_hr = 10.0 * tbsa;
@@ -363,12 +371,12 @@ void BurnThread::FluidLoading(double tbsa)
363371 } else {
364372 if (urineProduction < targetLowUrineProduction_mL_Per_Hr) {
365373 m_bg->GetLogger ()->Info (asprintf (" Urine production is too low at %f %s" , urineProduction, " mL_Per_hr" ));
366- m_ringers->GetRate ().SetValue ((m_ringers->GetRate ().GetValue (VolumePerTimeUnit::mL_Per_hr )) * (1 + titrate), VolumePerTimeUnit::mL_Per_hr );
374+ m_ringers->GetRate ().SetValue ((m_ringers->GetRate ().GetValue (VolumePerTimeUnit::mL_Per_hr )) * (1 + titrate) * scaleTitration , VolumePerTimeUnit::mL_Per_hr );
367375 m_bg->ProcessAction (*m_ringers);
368376 }
369377 if ((m_bg->GetRenalSystem ()->GetMeanUrineOutput (VolumePerTimeUnit::mL_Per_hr ) > targetHighUrineProduction_mL_Per_Hr)) {
370378 m_bg->GetLogger ()->Info (asprintf (" Urine production is too high at %f %s" , urineProduction, " mL_Per_hr" ));
371- m_ringers->GetRate ().SetValue ((m_ringers->GetRate ().GetValue (VolumePerTimeUnit::mL_Per_hr )) * (1 - titrate), VolumePerTimeUnit::mL_Per_hr );
379+ m_ringers->GetRate ().SetValue ((m_ringers->GetRate ().GetValue (VolumePerTimeUnit::mL_Per_hr )) * (1 - titrate) * scaleTitration , VolumePerTimeUnit::mL_Per_hr );
372380 m_bg->ProcessAction (*m_ringers);
373381 }
374382 }
@@ -407,27 +415,7 @@ void BurnThread::FluidLoading(double tbsa)
407415 m_bg->ProcessAction (*m_escharotomy);
408416 }
409417 }
410- // escharotomy
411- /* if (m_bg->GetPatient().IsEventActive(CDM::enumPatientEvent::CompartmentSyndrome_Abdominal)
412- || m_bg->GetPatient().IsEventActive(CDM::enumPatientEvent::CompartmentSyndrome_LeftArm)
413- || m_bg->GetPatient().IsEventActive(CDM::enumPatientEvent::CompartmentSyndrome_LeftLeg)
414- || m_bg->GetPatient().IsEventActive(CDM::enumPatientEvent::CompartmentSyndrome_RightArm)
415- || m_bg->GetPatient().IsEventActive(CDM::enumPatientEvent::CompartmentSyndrome_RightLeg)) {
416- if (m_bg->GetPatient().IsEventActive(CDM::enumPatientEvent::CompartmentSyndrome_Abdominal)) {
417- m_escharotomy->SetLocation("Trunk");
418- } else if (m_bg->GetPatient().IsEventActive(CDM::enumPatientEvent::CompartmentSyndrome_LeftArm)) {
419- m_escharotomy->SetLocation("LeftArm");
420- } else if (m_bg->GetPatient().IsEventActive(CDM::enumPatientEvent::CompartmentSyndrome_LeftLeg)) {
421- m_escharotomy->SetLocation("LeftLeg");
422- } else if (m_bg->GetPatient().IsEventActive(CDM::enumPatientEvent::CompartmentSyndrome_RightArm)) {
423- m_escharotomy->SetLocation("RightArm");
424- } else if (m_bg->GetPatient().IsEventActive(CDM::enumPatientEvent::CompartmentSyndrome_RightLeg)) {
425- m_escharotomy->SetLocation("RightLeg");
426- } else {
427- return;
428- }
429- m_bg->ProcessAction(*m_escharotomy);
430- }*/
418+
431419 if (fluid == ringers) {
432420 if (m_ivBagVolume_mL < 1.0 ) {
433421 m_ringers->GetBagVolume ().SetValue (ringersVolume_mL, VolumeUnit::mL );
0 commit comments