ER doctors shocking a flat line cardiac condition (twice) and getting a heart beat reestablished (once). The shock is done to stop the heart beating in an irregular rhythm which then allows the intrinsic pacemaker to take over and produce a regular rhythm. In other words, shocking the heart produces a flat line which allows a regular rhythm to take over. Shocking a flat line is not done because there is no rhythm to reset; it only produces a continuing flat line. AEDs are programmed not to shock a flat line and it is not done manually either.