I'm sure there are side effects from taking these drugs that would make you unfit to fly. If a pilot is suffering from heavy stress or depression he/she should not be flying and should voluntarily take themselves offline, take care of themselves and comeback when he/she is healthy and ready.