Skip to content

Commit fe7a262

Browse files
ntatum94StevenAWhite
authored andcommitted
Connecting the burn time xsd updates to the implementation.
1 parent 063c2fc commit fe7a262

File tree

6 files changed

+24
-9
lines changed

6 files changed

+24
-9
lines changed

projects/biogears/libBiogears/include/biogears/cdm/patient/actions/SEBurnWound.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ class BIOGEARS_API SEBurnWound : public SEPatientAction {
5555
bool HasDegreeOfBurn() const;
5656
CDM::enumBurnDegree::value GetDegreeOfBurn() const;
5757
void SetDegreeOfBurn(CDM::enumBurnDegree::value value);
58-
void SEBurnWound::SetTimeOfBurn(SEScalarTime burnTime);
58+
void SEBurnWound::SetTimeOfBurn(double burnTime);
59+
double SEBurnWound::GetTimeOfBurn() const;
5960

6061
double GetBurnIntensity() const;
6162

projects/biogears/libBiogears/include/biogears/cdm/scenario/SEPatientActionCollection.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,6 @@ class BIOGEARS_API SEPatientActionCollection : public Loggable {
434434
SEUrinate* m_Urinate;
435435
SEOverride* m_OverrideAction;
436436

437-
double m_BurnIntroductionTimeStamp;
438-
439437
std::map<std::string, SEHemorrhage*> m_Hemorrhages;
440438
mutable std::map<std::string, SEHemorrhage*>::const_iterator m_HemorrhageItr;
441439

projects/biogears/libBiogears/src/cdm/patient/actions/SEBurnWound.cpp

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace biogears {
1919
SEBurnWound::SEBurnWound()
2020
: SEPatientAction()
2121
, m_DegreeModifier(1.0)
22-
, m_burnInitiationTime(0.0)
22+
, m_burnInitiationTime(0.0) // Automatically set on burn instantiation. Exists in xsd for state loading/unloading
2323
, m_TBSA(new SEScalar0To1()) // User input, size of wound measured by total body surface area
2424
, m_compartments(5)
2525
{
@@ -42,6 +42,7 @@ void SEBurnWound::Clear()
4242
m_Inflammation = false;
4343
m_compartmentsAffected.clear();
4444
m_DegreeOfBurn = (CDM::enumBurnDegree::value)-1;
45+
m_burnInitiationTime = 0.;
4546
m_TBSA->Clear();
4647
}
4748
//-----------------------------------------------------------------------------
@@ -66,6 +67,10 @@ bool SEBurnWound::Load(const CDM::BurnWoundData& in)
6667
SetDegreeOfBurn(in.DegreeOfBurn().get());
6768
}
6869

70+
if (in.BurnInitiationTime().present()) {
71+
SetTimeOfBurn(in.BurnInitiationTime().get());
72+
}
73+
6974
m_compartmentsAffected.clear();
7075
std::string compt;
7176
for (const std::string compData : in.Compartments()) {
@@ -97,6 +102,9 @@ void SEBurnWound::Unload(CDM::BurnWoundData& data) const
97102
data.TotalBodySurfaceArea(std::unique_ptr<CDM::Scalar0To1Data>(m_TBSA->Unload()));
98103
if (HasDegreeOfBurn())
99104
data.DegreeOfBurn(m_DegreeOfBurn);
105+
if (m_burnInitiationTime != 0.) {
106+
data.BurnInitiationTime(m_burnInitiationTime);
107+
}
100108
for (std::string compData : m_compartmentsAffected) {
101109
data.Compartments().push_back(compData);
102110
}
@@ -166,9 +174,14 @@ void SEBurnWound::SetDegreeOfBurn(CDM::enumBurnDegree::value bd)
166174
}
167175
}
168176
//-----------------------------------------------------------------------------
169-
void SEBurnWound::SetTimeOfBurn(SEScalarTime burnTime)
177+
void SEBurnWound::SetTimeOfBurn(double burnTime)
178+
{
179+
m_burnInitiationTime = burnTime;
180+
}
181+
//-----------------------------------------------------------------------------
182+
double SEBurnWound::GetTimeOfBurn() const
170183
{
171-
m_burnInitiationTime = burnTime.GetValue();
184+
return m_burnInitiationTime;
172185
}
173186
//-----------------------------------------------------------------------------
174187
double SEBurnWound::GetBurnIntensity() const

projects/biogears/libBiogears/src/cdm/scenario/SEPatientActionCollection.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,9 @@ bool SEPatientActionCollection::ProcessAction(const CDM::PatientActionData& acti
634634

635635

636636
m_BurnWound->Load(*burn);
637-
m_BurnIntroductionTimeStamp = engine.GetSimulationTime(TimeUnit::s);
637+
if (m_BurnWound->GetTimeOfBurn() == 0.0) {
638+
m_BurnWound->SetTimeOfBurn(engine.GetSimulationTime(TimeUnit::s));
639+
}
638640
if (!m_BurnWound->IsActive()) {
639641
RemoveBurnWound();
640642
return true;

projects/biogears/libBiogears/src/engine/Systems/Energy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ void Energy::UpdateHeatResistance()
744744
double burnTemperature = (30.3 * std::exp(-1.0 * std::pow(t - 7.81, 2) / 11.7)) + GetSkinTemperature(TemperatureUnit::C);
745745
GetBurnSkinTemperature().SetValue(burnTemperature, TemperatureUnit::C);
746746
} else {
747-
burnAction->SetTimeOfBurn(m_data.GetSimulationTime());
747+
burnAction->SetTimeOfBurn(m_data.GetSimulationTime().GetValue());
748748
}
749749
}
750750
}

share/xsd/cdm/PatientActions.xsd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ specific language governing permissions and limitations under the License.
171171
<xs:complexContent>
172172
<xs:extension base="PatientActionData">
173173
<xs:sequence>
174-
<xs:element name="DegreeOfBurn" type="enumBurnDegree" minOccurs="0" maxOccurs="1"/>
174+
<xs:element name="BurnInitiationTime" type="xs:double" minOccurs="0" maxOccurs="1"/> <!--Automatically set on burn instantiation. Exists here for state loading/unloading-->
175+
<xs:element name="DegreeOfBurn" type="enumBurnDegree" minOccurs="0" maxOccurs="1"/>
175176
<xs:element name="TotalBodySurfaceArea" type="Scalar0To1Data" minOccurs="1" maxOccurs="1"/>
176177
<xs:element name="Compartments" type="xs:string" minOccurs="0" maxOccurs="5"/>
177178
<!--Primarily used in calculating comaprtment syndrome. Not specifying will assume trunk-->

0 commit comments

Comments
 (0)