You cannot rule out such problem of space travel as illness of astronauts in space. On of the reasons is that on long missions the immunity of practically all the astronauts weakens. This is natural. On the Earth immunity is ensured by a system of antibodies which protect us against microorganisms. In outer space due to weightlessness all processes in the human body, including the production of antibodies, are slower than under normal conditions.
On board of the every orbital space station there are kits with medicines for practically all purposes, such as pills for headaches and colds, sleeping pills, and medicines for the treatment of injuries, burns and hemorrhages. Each kit has an inventory with instructions for use.
In an emergency if the medicines aboard the space station fail to improve astronaut's condition a sick astronaut has to be returned to Earth. It is the decision of the Mission Control Center to bring astronaut back to Earth and interrupt the space flight.
For example some years ago Russian astronaut Aleksandr Laveikin had to return to Earth before the mission ended. The doctors found out that he had a minor heart disorder. On the ground it amounted to nothing. But in outer space it might have led to undesirable consequences. That was why it was decided to replace Aleksandr Laveikin by another astronaut.
It is obvious that the crews of interplanetary space ships will include doctors or special mashines (robodoctors) who will keep the other members fit. If necessary, they will provide medical aid, including surgical treatment.