An implantable medical device comprising: an integrity measurement module; and a processor that: monitors a signal from a sensor that detects at least one of activity, posture, or pressure; detects, based on the signal, an external force or impact; determines that a magnitude of the external force or impact exceeds a predetermined damage threshold associated with possible device damage; and automatically tests integrity of at least one element of the implantable medical device, wherein the at least one element comprises at least one of a therapy delivery element, the sensor, another sensor that detects another physiological parameter of the patient, a software element, a firmware element, or a hardware element; characterised in that the processor automatically tests said integrity in response to the determination that the magnitude of the external force or impact exceeds the predetermined damage threshold. an integrity measurement module; and a processor that: monitors a signal from a sensor that detects at least one of activity, posture, or pressure; detects, based on the signal, an external force or impact; determines that a magnitude of the external force or impact exceeds a predetermined damage threshold associated with possible device damage; and automatically tests integrity of at least one element of the implantable medical device, wherein the at least one element comprises at least one of a therapy delivery element, the sensor, another sensor that detects another physiological parameter of the patient, a software element, a firmware element, or a hardware element; characterised in that the processor automatically tests said integrity in response to the determination that the magnitude of the external force or impact exceeds the predetermined damage threshold. a processor that: monitors a signal from a sensor that detects at least one of activity, posture, or pressure; detects, based on the signal, an external force or impact; determines that a magnitude of the external force or impact exceeds a predetermined damage threshold associated with possible device damage; and automatically tests integrity of at least one element of the implantable medical device, wherein the at least one element comprises at least one of a therapy delivery element, the sensor, another sensor that detects another physiological parameter of the patient, a software element, a firmware element, or a hardware element; characterised in that the processor automatically tests said integrity in response to the determination that the magnitude of the external force or impact exceeds the predetermined damage threshold. monitors a signal from a sensor that detects at least one of activity, posture, or pressure; detects, based on the signal, an external force or impact; determines that a magnitude of the external force or impact exceeds a predetermined damage threshold associated with possible device damage; and automatically tests integrity of at least one element of the implantable medical device, wherein the at least one element comprises at least one of a therapy delivery element, the sensor, another sensor that detects another physiological parameter of the patient, a software element, a firmware element, or a hardware element; characterised in that the processor automatically tests said integrity in response to the determination that the magnitude of the external force or impact exceeds the predetermined damage threshold.