Medical algorithm