Yes. The FAA's position on this is clear. Pilots are prohibited by federal law from acting as pilot-in-command or as a required pilot flight crewmember during any medical deficiency that would be disqualifying or may interfere with the safe operation of an aircraft. There is certainly room for a judgment call here. Our advice is to be conservative. If in doubt, don't fly. If you are facing a chronic problem, then find and consult with an AME.
A simple, self-limited problem such as a cold, a broken arm, or an abscessed tooth may require nothing more than the appropriate treatment and a little time before you can safely return to the skies. A more complicated problem or the development or change of a chronic illness will probably necessitate consultation with an AME or the FAA before resuming flying. In civilian aviation, new medical conditions don't automatically require a visit to the Flight Surgeon (AME), you can simply ground yourself (self-imposed flight restriction). When you do wish to return to flying; however, these new medical conditions will need to be reported to the FAA .