A physician who, as part of a medical treatment plan for a patient with reduced life expectancy due to advanced illness, prescribes for that patient a controlled substance that is included in schedules 2 to 5 under part 72 and that is a narcotic drug is immune from administrative and civil liability based on prescribing the controlled substance if the prescription is given in good faith and with the intention to treat a patient with reduced life expectancy due to advanced illness or alleviate the patient’s pain, or both, and all of the following are met:
  (a) The prescription is for a legitimate legal and professionally recognized therapeutic purpose.
  (b) Prescribing the controlled substance is within the scope of practice of the physician.
  (c) The physician holds a valid license under article 7 to prescribe controlled substances.