Commit f18559b5 authored by Rachel Clipp's avatar Rachel Clipp Committed by Aaron Bray
Browse files

Fixed asystole.

parent 987029ec
......@@ -4,7 +4,14 @@
"PatientConfiguration": { "PatientFile": "StandardMale.json" },
"DataRequestManager": {
"DataRequest": [{
"DecimalFormat": {
"DecimalFormat": {
"Precision": 3
},
"Category": "ECG",
"PropertyName": "Lead3ElectricPotential",
"Unit": "mV"
}, {
"DecimalFormat": {
"Precision": 1
},
"PropertyName": "Weight",
......@@ -399,7 +406,7 @@
"AdvanceTime": {
"Time": {
"ScalarTime": {
"Value": 300.0,
"Value": 240.0,
"Unit": "s"
}
}
......@@ -414,7 +421,7 @@
"AdvanceTime": {
"Time": {
"ScalarTime": {
"Value": 120.0,
"Value": 420.0,
"Unit": "s"
}
}
......
......@@ -4,7 +4,14 @@
"PatientConfiguration": { "PatientFile": "StandardMale.json" },
"DataRequestManager": {
"DataRequest": [{
"DecimalFormat": {
"DecimalFormat": {
"Precision": 3
},
"Category": "ECG",
"PropertyName": "Lead3ElectricPotential",
"Unit": "mV"
}, {
"DecimalFormat": {
"Precision": 1
},
"PropertyName": "Weight",
......@@ -389,36 +396,6 @@
}
}
}
}, {
"PatientAction": {
"Arrhythmia": {
"Rhythm": "Asystole"
}
}
}, {
"AdvanceTime": {
"Time": {
"ScalarTime": {
"Value": 60.0,
"Unit": "s"
}
}
}
}, {
"PatientAction": {
"Arrhythmia": {
"Rhythm": "NormalSinus"
}
}
}, {
"AdvanceTime": {
"Time": {
"ScalarTime": {
"Value": 60.0,
"Unit": "s"
}
}
}
}, {
"PatientAction": {
"Arrhythmia": {
......@@ -429,7 +406,7 @@
"AdvanceTime": {
"Time": {
"ScalarTime": {
"Value": 60.0,
"Value": 210.0,
"Unit": "s"
}
}
......@@ -444,7 +421,7 @@
"AdvanceTime": {
"Time": {
"ScalarTime": {
"Value": 60.0,
"Value": 210.0,
"Unit": "s"
}
}
......@@ -459,7 +436,7 @@
"AdvanceTime": {
"Time": {
"ScalarTime": {
"Value": 60.0,
"Value": 210.0,
"Unit": "s"
}
}
......@@ -474,7 +451,7 @@
"AdvanceTime": {
"Time": {
"ScalarTime": {
"Value": 60.0,
"Value": 180.0,
"Unit": "s"
}
}
......
......@@ -4,6 +4,13 @@
"PatientConfiguration": { "PatientFile": "StandardMale.json" },
"DataRequestManager": {
"DataRequest": [{
"DecimalFormat": {
"Precision": 3
},
"Category": "ECG",
"PropertyName": "Lead3ElectricPotential",
"Unit": "mV"
}, {
"DecimalFormat": {
"Precision": 1
},
......@@ -399,7 +406,7 @@
"AdvanceTime": {
"Time": {
"ScalarTime": {
"Value": 180.0,
"Value": 210.0,
"Unit": "s"
}
}
......@@ -414,7 +421,7 @@
"AdvanceTime": {
"Time": {
"ScalarTime": {
"Value": 180.0,
"Value": 210.0,
"Unit": "s"
}
}
......@@ -429,7 +436,7 @@
"AdvanceTime": {
"Time": {
"ScalarTime": {
"Value": 180.0,
"Value": 210.0,
"Unit": "s"
}
}
......
......@@ -4,6 +4,13 @@
"PatientConfiguration": { "PatientFile": "StandardMale.json" },
"DataRequestManager": {
"DataRequest": [{
"DecimalFormat": {
"Precision": 3
},
"Category": "ECG",
"PropertyName": "Lead3ElectricPotential",
"Unit": "mV"
}, {
"DecimalFormat": {
"Precision": 1
},
......@@ -399,7 +406,7 @@
"AdvanceTime": {
"Time": {
"ScalarTime": {
"Value": 60.0,
"Value": 210.0,
"Unit": "s"
}
}
......@@ -414,7 +421,7 @@
"AdvanceTime": {
"Time": {
"ScalarTime": {
"Value": 60.0,
"Value": 210.0,
"Unit": "s"
}
}
......@@ -429,7 +436,7 @@
"AdvanceTime": {
"Time": {
"ScalarTime": {
"Value": 60.0,
"Value": 210.0,
"Unit": "s"
}
}
......@@ -444,7 +451,7 @@
"AdvanceTime": {
"Time": {
"ScalarTime": {
"Value": 60.0,
"Value": 180.0,
"Unit": "s"
}
}
......
......@@ -4,6 +4,13 @@
"PatientConfiguration": { "PatientFile": "StandardMale.json" },
"DataRequestManager": {
"DataRequest": [{
"DecimalFormat": {
"Precision": 3
},
"Category": "ECG",
"PropertyName": "Lead3ElectricPotential",
"Unit": "mV"
}, {
"DecimalFormat": {
"Precision": 1
},
......@@ -399,7 +406,7 @@
"AdvanceTime": {
"Time": {
"ScalarTime": {
"Value": 180.0,
"Value": 210.0,
"Unit": "s"
}
}
......@@ -414,7 +421,7 @@
"AdvanceTime": {
"Time": {
"ScalarTime": {
"Value": 180.0,
"Value": 210.0,
"Unit": "s"
}
}
......@@ -429,7 +436,7 @@
"AdvanceTime": {
"Time": {
"ScalarTime": {
"Value": 180.0,
"Value": 210.0,
"Unit": "s"
}
}
......
Methodology Sources and References
@misc{ACLS2021Bradycardia,
title = {{ACLS Symptomatic Bradycardia}},
url = {https://nhcps.com/lesson/acls-symptomatic-bradycardia/},
urldate = {2021-12-02}
}
@misc{ACLS2021Tachy,
title = {{ACLS Stable and Unstable Tachycardia Guide}},
url = {https://nhcps.com/lesson/acls-stable-unstable-tachycardia/},
urldate = {2021-12-02}
}
@misc{LearningNetwork2021stable,
title = {{Stable or Unstable?}},
url = {https://www.hmpgloballearningnetwork.com/site/emsworld/article/10320367/stable-or-unstable},
urldate = {2021-12-02}
}
@article{Wegria1958effect,
author = {WEGRIA, R. and FRANK, C. W. and WANG, H. H. and LAMMERANT, J.},
doi = {10.1161/01.RES.6.5.624},
issn = {00097330},
journal = {Circulation research},
number = {5},
pages = {624--632},
pmid = {13573593},
title = {{The effect of atrial and ventricular tachycardia on cardiac output, coronary blood flow and mean arterial blood pressure.}},
volume = {6},
year = {1958}
}
@misc{ClevelandClinic2021vfib,
title = {{V-Fib: What Is It, Causes, Symptoms & Treatment}},
url = {https://my.clevelandclinic.org/health/diseases/21878-ventricular-fibrillation},
urldate = {2021-12-02}
}
@misc{ACLS2021Pulseless,
title = {{Ventricular Fibrillation and Pulseless Ventricular Tachycardia Guide}},
url = {https://nhcps.com/lesson/acls-cases-ventricular-fibrillation-pulseless-ventricular-tachycardia/},
urldate = {2021-12-02}
}
@article{Babbs1983relationship,
author = {Babbs, Charles F and Voorhees, W D and Fitzgerald, K R and Holmes, H R and Geddes, L A},
title = {Relationship of blood pressure and flow during CPR to chest compression amplitude: Evidence for an effective compression threshold Recommended Citation},
journal = {Weldon School of Biomedical Engineering Faculty Publications.},
volume = {53},
year = {1983},
url = {http://docs.lib.purdue.edu/bmepubshttp://docs.lib.purdue.edu/bmepubs/53}
}
@misc{ACLS2021asystole,
title = {{ACLS Pulseless Electrical Activity and Asystole Guide}},
url = {https://nhcps.com/lesson/acls-cases-pulseless-electrical-activity-asystole/},
urldate = {2021-12-02}
}
@article{Kanaya2003differential,
author = {Kanaya, Noriaki and Hirata, Naoyuki and Kurosawa, Saori and Nakayama, Masayasu and Namiki, Akiyoshi},
doi = {10.1097/00000542-200301000-00009},
......
......@@ -207,6 +207,7 @@ namespace pulse
// CPR and Cardiac Arrest control
m_CardiacArrest = false;
m_StartCardiacArrest = false;
m_CompressionTime_s = 0.0;
m_CompressionRatio = 0.0;
m_CompressionPeriod_s = 0.0;
......@@ -718,6 +719,10 @@ namespace pulse
if (LHeartFlow_mL_Per_s < 0.1 && m_HeartFlowDetected)
m_HeartFlowDetected = false;
//Aaron - I kind of brute force it, maybe a better way?
if(m_data.GetEvents().IsEventActive(eEvent::CardiacArrest) && (m_data.GetEvents().GetEventDuration(eEvent::CardiacArrest, TimeUnit::s) > 5.0 && (m_data.GetEvents().GetEventDuration(eEvent::CardiacArrest, TimeUnit::s) < (5.0 + m_data.GetTimeStep_s()))))
RecordAndResetCardiacCycle();
// Record high and low values to compute for systolic and diastolic pressures:
if (AortaNodePressure_mmHg > m_CardiacCycleAortaPressureHigh_mmHg)
m_CardiacCycleAortaPressureHigh_mmHg = AortaNodePressure_mmHg;
......@@ -1620,52 +1625,63 @@ namespace pulse
// Flip the cardiac arrest switch
// This tells the CV system that a cardiac arrest has been initiated.
// The cardiac arrest event will be triggered by CardiacCycleCalculations() at the end of the cardiac cycle.
m_CardiacArrest = true;
m_StartCardiacArrest = true;
m_ArrhythmiaHeartElastanceModifier = 1.0;
m_CurrentCardiacCycleTime_s = m_CardiacCyclePeriod_s - m_data.GetTimeStep_s();
m_data.GetCurrentPatient().GetHeartRateBaseline().SetValue(m_StabilizedHeartRateBaseline_Per_min, FrequencyUnit::Per_min);
m_data.GetNervous().SetBaroreceptorFeedback(eSwitch::Off);
m_data.GetNervous().SetChemoreceptorFeedback(eSwitch::Off);
break;
}
case eHeartRhythm::NormalSinus:
{
m_CardiacArrest = false;
m_data.GetEvents().SetEvent(eEvent::CardiacArrest, false, m_data.GetSimulationTime());
m_ArrhythmiaHeartElastanceModifier = 1.0;
m_data.GetCurrentPatient().GetHeartRateBaseline().SetValue(m_StabilizedHeartRateBaseline_Per_min, FrequencyUnit::Per_min);
m_data.GetNervous().SetBaroreceptorFeedback(eSwitch::On);
m_data.GetNervous().SetChemoreceptorFeedback(eSwitch::On);
break;
}
case eHeartRhythm::SinusTachycardia:
{
m_CardiacArrest = false;
m_data.GetEvents().SetEvent(eEvent::CardiacArrest, false, m_data.GetSimulationTime());
m_ArrhythmiaHeartElastanceModifier = 1.0;
m_data.GetCurrentPatient().GetHeartRateBaseline().SetValue(m_StabilizedHeartRateBaseline_Per_min * 1.5, FrequencyUnit::Per_min);
m_data.GetNervous().SetBaroreceptorFeedback(eSwitch::On);
m_data.GetNervous().SetChemoreceptorFeedback(eSwitch::On);
break;
}
case eHeartRhythm::SinusBradycardia:
{
m_CardiacArrest = false;
m_data.GetEvents().SetEvent(eEvent::CardiacArrest, false, m_data.GetSimulationTime());
m_ArrhythmiaHeartElastanceModifier = 1.0;
m_data.GetCurrentPatient().GetHeartRateBaseline().SetValue(m_StabilizedHeartRateBaseline_Per_min * 0.7, FrequencyUnit::Per_min);
m_data.GetNervous().SetBaroreceptorFeedback(eSwitch::On);
m_data.GetNervous().SetChemoreceptorFeedback(eSwitch::On);
break;
}
case eHeartRhythm::StableVentricularTachycardia:
{
m_CardiacArrest = false;
m_data.GetEvents().SetEvent(eEvent::CardiacArrest, false, m_data.GetSimulationTime());
m_ArrhythmiaHeartElastanceModifier = 1.0;
m_data.GetCurrentPatient().GetHeartRateBaseline().SetValue(m_StabilizedHeartRateBaseline_Per_min * 2.2, FrequencyUnit::Per_min);
m_data.GetNervous().SetBaroreceptorFeedback(eSwitch::On);
m_data.GetNervous().SetChemoreceptorFeedback(eSwitch::On);
break;
}
case eHeartRhythm::UnstableVentricularTachycardia:
{
m_CardiacArrest = false;
m_data.GetEvents().SetEvent(eEvent::CardiacArrest, false, m_data.GetSimulationTime());
m_ArrhythmiaHeartElastanceModifier = 0.5;
m_data.GetCurrentPatient().GetHeartRateBaseline().SetValue(m_StabilizedHeartRateBaseline_Per_min * 2.8, FrequencyUnit::Per_min);
m_data.GetNervous().SetBaroreceptorFeedback(eSwitch::On);
m_data.GetNervous().SetChemoreceptorFeedback(eSwitch::On);
break;
}
default:// Any other rhythms take us out of cardiac arrest
Error("Unsupported heart arrhythmia.");
}
//Info("Setting Baseline HR to "+std::to_string(m_data.GetCurrentPatient().GetHeartRateBaseline(FrequencyUnit::Per_min)));
m_data.GetEvents().SetEvent(eEvent::CardiacArrest, m_CardiacArrest, m_data.GetSimulationTime());
//Force a new cardiac cycle to start when cardiac arrest is removed
m_CurrentCardiacCycleTime_s = m_CardiacCyclePeriod_s - m_data.GetTimeStep_s();
}
......@@ -1801,9 +1817,10 @@ namespace pulse
m_LeftHeartElastanceMax_mmHg_Per_mL *= m_LeftHeartElastanceModifier;
// Now set the cardiac cycle period and the cardiac arrest event if applicable
if (m_CardiacArrest)
if (m_StartCardiacArrest)
{
m_data.GetEvents().SetEvent(eEvent::CardiacArrest, true, m_data.GetSimulationTime());
m_StartCardiacArrest = false;
m_CardiacCyclePeriod_s = 1.0e9; // Not beating, so set the period to a large number (1.0e9 sec = 31.7 years)
RecordAndResetCardiacCycle();
GetHeartRate().SetValue(0.0, FrequencyUnit::Per_min);
......
......@@ -98,6 +98,7 @@ namespace pulse
bool m_StartSystole;
bool m_HeartFlowDetected;
bool m_CardiacArrest;// Can't go into cardiac arrest during the middle of a cycle
bool m_StartCardiacArrest; // Can't go into cardiac arrest during the middle of a cycle
double m_CardiacCyclePeriod_s;
double m_CurrentCardiacCycleDuration_s; // How long have we been in this heart beat
double m_LeftHeartElastanceModifier;// from Heart Failure and such
......
......@@ -178,6 +178,7 @@ namespace pulse
}
}
if (m_BaroreceptorFeedback == eSwitch::On)
BaroreceptorFeedback();
#ifdef PROBE
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment