Algorithm For the Bear

Just a bit of pseudo-code that shows the state transitions in our trauma bear project.

start
	*random
		-> convulse_cardio
		-> convulse_flatline
		-> convulse_gi
convulse_cardio
	*time < 20 && comp >= 6 && accel. == BACK
		-> stable
	*else
		-> death
convulse_flatline
	*time > 10
		-> any_touch
convulse_gi
	*time > 5
		-> shallow_vital
stable
	*time > 10 && accel. < error_movement
		-> well
	*else
		-> need_more_comps
dead
	*reset_button == HIGH
		-> start
well
	*reset_button == HIGH
		-> start
shallow_vitals
	*accel. == SIDE && time < 15
		-> ready_to_intubate
	*intubated == HIGH && time < 15
		-> tube_convulse 
	*else
		-> death
need_more_comps
	*time < 20 && comp >= 6 && accel. == BACK
		-> stable
	*time < 20
		-> need_air
	*else
		-> death
need_air
	*intubated == HIGH && pumps >= 6 && time < 20
		-> stable
	*else
		-> death
flatline
	*flatline_total < 3 && paddles_applied && time < 20
		-> paddled
	*else
		-> death
tube_convulse
	*intubated == LOW && time < 15
		-> shallow_vitals
	*else
		-> death
ready_to_intubate
	*intubated == HIGH && time < 15
		-> intubated
	*else
		-> death
intubated
	*accel. < error_movement && time > 10
		-> well
paddled
	*random
		-> needs_air
		-> flatline
		-> well
any_touch
	*time < 20 && accel. > error_movement
		-> flatline
	*time >= 20
		-> death

Copyright Mike Edwards 2006-2009. All content available under the Creative Commons Attribution ShareAlike license, unless otherwise noted.