(a)
Notwithstanding Section 2670.5, if a confined person has inflicted or attempted to inflict substantial physical harm upon the person of another or himself, or presents, as a result of mental disorder, an imminent threat of substantial harm to others or himself, the attending physician may in such emergency employ or authorize for no longer than seven days in any three-month period the immediate use of shock treatments in order to alleviate such danger.
(b)
Notwithstanding Section 2670.5, if a confined person gives his informed consent to a program of shock therapy for a period not to exceed three months, the attending physician may administer such therapy for a period not to exceed three months in any one-year period without prior judicial authorization.