A menu driven reprogrammable drug pump is provided with a memory, such as flash memory, a display, a keyboard, and a communications port to allow a generic pump to be programmed with a desired pump application (therapy) program and patient specific settings. Programming and data transfer with another pump or a computer to and from the patient pump is by the communications port that allows local and/or remote communications with the pump. Flash memory stores the pump application program during use. Patient safety is provided by a cassette identification system, an occlusion detection system, and a latch/lock detection system. Automated testing of the pump is by a closed loop testing system.