Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pulse Physiology Suite
engine
Commits
e6542b80
Commit
e6542b80
authored
Nov 08, 2018
by
Aaron Bray
Browse files
Support shorthand naming for hemorrhage compartments
parent
6419cb05
Changes
4
Hide whitespace changes
Inline
Side-by-side
bin/InitialPatientState.pba
View file @
e6542b80
Name: "InitialStableState"
Description: "Stabilize a patient and save out the engines state at time zero"
InitialParameters
{ PatientFile:"StandardMale.pba" }
StartType { PatientConfiguration
{ PatientFile:"StandardMale.pba" }
}
AnyAction
{
...
...
bin/VitalsMonitor.pba
View file @
e6542b80
Name: "Vitals Monitor"
Description: "Data associated with a vitals monitor."
InitialParameters
{ PatientFile:"StandardMale.pba" }
StartType { PatientConfiguration
{ PatientFile:"StandardMale.pba" }
}
DataRequestManager
{
...
...
cdm/cpp/engine/SEPatientActionCollection.cpp
View file @
e6542b80
...
...
@@ -361,7 +361,6 @@ bool SEPatientActionCollection::ProcessAction(const SEPatientAction& action)
if
(
!
m_PericardialEffusion
->
IsActive
())
RemovePericardialEffusion
();
return
true
;
}
const
SESubstanceBolus
*
bolus
=
dynamic_cast
<
const
SESubstanceBolus
*>
(
&
action
);
...
...
engine/cpp/physiology/Cardiovascular.cpp
View file @
e6542b80
...
...
@@ -961,9 +961,12 @@ void Cardiovascular::Hemorrhage()
{
h
=
hem
.
second
;
double
rate_mL_Per_s
=
h
->
GetRate
().
GetValue
(
VolumePerTimeUnit
::
mL_Per_s
);
SELiquidCompartment
*
compartment
=
m_data
.
GetCompartments
().
GetLiquidCompartment
(
h
->
GetCompartment
());
// Allow shorthand naming
if
(
h
->
GetCompartment
().
find
(
"Vasculature"
)
==
std
::
string
::
npos
)
h
->
SetCompartment
(
h
->
GetCompartment
()
+
"Vasculature"
);
SELiquidCompartment
*
compartment
=
m_data
.
GetCompartments
().
GetCardiovascularGraph
().
GetCompartment
(
h
->
GetCompartment
());
/// \error
Fatal
: Bleeding rate cannot exceed cardiac output
/// \error
Error
: Bleeding rate cannot exceed cardiac output
if
(
rate_mL_Per_s
>
GetCardiacOutput
().
GetValue
(
VolumePerTimeUnit
::
mL_Per_s
))
{
m_ss
<<
"Cannot have bleeding rate greater than cardiac output.
\n\t
Current cardiac output is: "
<<
GetCardiacOutput
()
...
...
@@ -972,7 +975,7 @@ void Cardiovascular::Hemorrhage()
invalid_hemorrhages
.
push_back
(
h
);
continue
;
}
/// \error
Fatal
: Bleeding rate cannot be less than zero
/// \error
Error
: Bleeding rate cannot be less than zero
if
(
rate_mL_Per_s
<
0
)
{
m_ss
<<
"Cannot specify bleeding less than 0"
;
...
...
@@ -980,7 +983,7 @@ void Cardiovascular::Hemorrhage()
invalid_hemorrhages
.
push_back
(
h
);
continue
;
}
/// \error
Fatal
: Bleeding must be from a vascular compartment
/// \error
Error
: Bleeding must be from a vascular compartment
if
(
!
compartment
)
{
m_ss
<<
"Cannot hemorrhage from compartment "
+
h
->
GetComment
()
+
", must be a valid vascular compartment"
;
...
...
@@ -1026,6 +1029,7 @@ void Cardiovascular::Hemorrhage()
/// \error Fatal: Bleeding must come from nodes in the circultatory circuit
if
(
nodes
.
size
()
==
0
)
{
/// \error Error: Hemorrhage compartments must have nodes in the circulatory circuit
m_ss
<<
"Hemorrhage compartments must have nodes in the circulatory circuit"
;
Error
(
m_ss
);
invalid_hemorrhages
.
push_back
(
h
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment