I have a privacy preserving technology that could conceivably help prevent the Germanwings [crash of 2014][1].  The idea would be there is a long list of issues that would prohibit a pilot from flying encoded on a ID card that anonymizes a pilot's information:

I'm guessing that a list might look like this:

* Overwork (no sleep)
* Simulator experience, test results
* Medical issues (temporary)
* Drug tests
* Psychological issues

A list of medical providers would link the results together, anonymously, and during the pre-flight check, the ID card would be scanned and rather than a specific issue being highlighted, (depression), the pilot would be asked to rest for a while.  No system would know why the rejection occurred, except for the pilot himself.

This might for a balance of privacy, safety, and accountability without compromising need to know.

That being said, I would appreciate any official, or carrier specific list of reasons a pilot would be rejected from flying.  The closest I've gotten to learning about this is MSFT Flight Simulator and a few hours in a Cessna 

Supplemental information would be helpful as well (your thoughts about this solution)

I am mostly concerned with US, or even UK regulations.

  [1]: http://www.slate.com/blogs/the_slatest/2015/03/25/germanwings_pilot_reportedly_locked_out_of_cockpit_before_crash.html