The Indy has a fully kitted medical centre, on deck 2, which has 2 doctors and 3 nurses. Thankfully I have not needed their assistance but a freind who did could not believe how good they were.
You do have to pay for a lot of things but you can claim most back from your travel insurance.
A ship is a moving town of crew and passengers (Indy has between 5-6000 people) and therefore must have very good facilities to look after them all. American and British lines have to have doctors with A & E (or ER) expertise.
What if someone has a heart attack.