Another thing the pilot would have to be aware of is if they currently have a Special Issuance. If there is a change in condition or treatment then the airmen would have to ground, report to the FAA, and wait for approval.
§61.53 Prohibition on operations during medical deficiency.
(a) Operations that require a medical certificate. Except as provided for in paragraph (b) of this section, no person who holds a medical certificate issued under part 67 of this chapter may act as pilot in command, or in any other capacity as a required pilot flight crewmember, while that person:
(1) Knows or has reason to know of any medical condition that would make the person unable to meet the requirements for the medical certificate necessary for the pilot operation; or
(2) Is taking medication or receiving other treatment for a medical condition that results in the person being unable to meet the requirements for the medical certificate necessary for the pilot operation.
OTOH, if the post-surgical condition (say, reduced range of motion or sensation in the limb) would not allow unrestricted issuance, or the pilot is going to remain on unacceptable meds, the pilot would have to apply for a new medical and go through the evaluation/special issuance process before flying again. Alternatively, as long as the condition isn't one of the six areas listed in 14 CFR 68.9(a) (cardiac, neurologic, etc), and the pilot won't be on a medication incompatible with safe flying, the pilot could go on Basic Med, within the limits for Basic Med flying.