Back in 1990, I joined the development team of a software system that was approved by the Advanced Cardiac Life Support organization for a realistic, accurate reproduction of a code blue.  The object of the software was to train emergency physicians who were not able to make it to testing centers, and this software would record, grade and rate the performance and accuracy of the attending physician.  The algorithms were incredibly difficult, but we got it right. Sometimes the patient did make it, and sometimes not.  All of this was part of the system determination on the severity of the condition and the real world statistics on the chances of surviving the particular cardiac event of the patient.  

Proper protocol, including diagnosis, administration of the proper drugs, CPR intervention, as well as when to shock a patient for their particular arrhythmia or not.  The software used a 3D model of a patient and all the tools needed for an experienced physician to achieve full resuscitation.