And if you divert due for medical reasons and the passenger dies before landing some countries will simply refuse to "accept" the deceased and insist that they stay on the flight/aircraft..
If you have a doctor on board do not let him declare a passenger dead. Get the passenger with 'possibly weak signs of life' into an ambulance and away. We had an incident where we diverted. Pax died in the decent. We were waiting ages for steps and the doctor told the handling agent through the door 'no rush, he's dead'. It then took us hours to get the body off. The aircraft was packed with the deceased lying in the aisle next to his wife. Apparently it ruined her whole holiday