It is not a good idea. According to the American Medical Association Code of Medical Ethics, 'Except in emergencies, it is not appropriate for physicians to write prescriptions for controlled substances for themselves or immediate family members.'