A prescription that is valid when written remains valid for the period stated in the medical order notwithstanding the prescribing practitioner's subsequent death or retirement or the suspension or revocation of the prescribing practitioner's credential by the appropriate board, and a pharmacist may use professional judgment to fill or refill such a prescription which has sufficient fills remaining. This section shall not apply to a prescription issued by a veterinarian.